Re: [asterisk-users] HELP! AGI AUTOHANGUP does not seem to hangup the channel.

2021-05-26 Thread Jonathan H
I think I can confidently say, after most of a day and reading the following

https://stackoverflow.com/questions/66768885/why-doesnt-asterisk-17-catch-hangup-request-from-pjsip-client-solved
https://wiki.asterisk.org/wiki/display/AST/Asterisk+18+AGICommand_set+autohangup
https://community.freepbx.org/t/inbound-calls-dont-hang-up/53612
https://community.freepbx.org/t/pjsip-problem-channel-not-closing/65311/7
https://wiki.asterisk.org/wiki/display/AST/Asterisk+18+Function_PJSIP_ENDPOINT
https://wiki.asterisk.org/wiki/display/AST/Asterisk+18+Configuration_res_pjsip

... that Asterisk doesn't like mixing autoHangup with AGI, and there
appears to be no way of the ts-agi library I'm using knowing that it
has autoHungup, so it can't close the AGI connection which seems to
release Asterisk to hangup properly.

I had thought that the AGIEXITONHANGUP variable might help, but it
appears to do nothing, although I'm unsure if I'm setting it correctly
as:

Here it says the flag is "1"
https://wiki.asterisk.org/wiki/display/AST/Asterisk+Standard+Channel+Variables

And here it says the flag is "yes"
https://wiki.asterisk.org/wiki/display/AST/Asterisk+18+Application_AGI

That said, I wish I could use ARI not AGI but without the current
media offset available on ARI, I need AGI :)

So for now, the workaround is to forget about setting autohangup, and
just hangup the caller manually at the point they don't over-ride the
timeout.

Thanks!

On Wed, 26 May 2021 at 18:01, Joshua C. Colp  wrote:
>
> On Wed, May 26, 2021 at 1:58 PM Jonathan H  wrote:
>>
>> I have also tried configuring pjsip wizard like this.
>>
>> endpoint/rtp_timeout=5
>>
>> And I see this shortly after the "hangup" command has been sent, so
>> that part is working:
>>
>> [May 26 17:36:37] NOTICE[1276]: res_pjsip_sdp_rtp.c:150
>> rtp_check_timeout: Disconnecting channel
>> 'PJSIP/fromvoipfone-206-000b' for lack of audio RTP activity in 5
>> seconds
>>
>> But, again, it doesn't disconnect. The line stays open. And yes, my
>> fallthrough after agi is
>>
>> same => n, Hangup()
>>
>> Also, apparently I now have a load of channels, which won't even hangup with
>>
>> channel request hangup all
>>
>> Requested Hangup on channel 'PJSIP/fromvoipfone-206-000b'
>> Requested Hangup on channel 'PJSIP/fromvoipfone-206-000a'
>> Requested Hangup on channel 'PJSIP/fromvoipfone-206-0009'
>>
>> ...and wait.. and then...
>>
>> Channel  Location State   Application(Data)
>> PJSIP/fromvoipfone-2 s@test:2 Up  AGI(agi://localhost:3456)
>> PJSIP/fromvoipfone-2 s@test:2 Up  AGI(agi://localhost:3456)
>> PJSIP/fromvoipfone-2 s@test:2 Up  AGI(agi://localhost:3456)
>> 3 active channels
>> 3 active calls
>>
>> So they just won't die.
>>
>> Asterisk 18.4.0 - worth filing a bug?
>
>
> Is your AGI closing the connection or are you expecting Asterisk to drop it? 
> (I'm not that familiar with FastAGI or AGI these days, just wondering what 
> happens if you drop the connection)
>
> --
> Joshua C. Colp
> Asterisk Technical Lead
> Sangoma Technologies
> Check us out at www.sangoma.com and www.asterisk.org
> --
> _
> -- Bandwidth and Colocation Provided by http://www.api-digital.com --
>
> Check out the new Asterisk community forum at: https://community.asterisk.org/
>
> New to Asterisk? Start here:
>   https://wiki.asterisk.org/wiki/display/AST/Getting+Started
>
> asterisk-users mailing list
> To UNSUBSCRIBE or update options visit:
>http://lists.digium.com/mailman/listinfo/asterisk-users

-- 
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

Check out the new Asterisk community forum at: https://community.asterisk.org/

New to Asterisk? Start here:
  https://wiki.asterisk.org/wiki/display/AST/Getting+Started

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users

Re: [asterisk-users] HELP! AGI AUTOHANGUP does not seem to hangup the channel.

2021-05-26 Thread Jonathan H
I have also tried configuring pjsip wizard like this.

endpoint/rtp_timeout=5

And I see this shortly after the "hangup" command has been sent, so
that part is working:

[May 26 17:36:37] NOTICE[1276]: res_pjsip_sdp_rtp.c:150
rtp_check_timeout: Disconnecting channel
'PJSIP/fromvoipfone-206-000b' for lack of audio RTP activity in 5
seconds

But, again, it doesn't disconnect. The line stays open. And yes, my
fallthrough after agi is

same => n, Hangup()

Also, apparently I now have a load of channels, which won't even hangup with

channel request hangup all

Requested Hangup on channel 'PJSIP/fromvoipfone-206-000b'
Requested Hangup on channel 'PJSIP/fromvoipfone-206-000a'
Requested Hangup on channel 'PJSIP/fromvoipfone-206-0009'

...and wait.. and then...

Channel  Location State   Application(Data)
PJSIP/fromvoipfone-2 s@test:2 Up  AGI(agi://localhost:3456)
PJSIP/fromvoipfone-2 s@test:2 Up  AGI(agi://localhost:3456)
PJSIP/fromvoipfone-2 s@test:2 Up  AGI(agi://localhost:3456)
3 active channels
3 active calls

So they just won't die.

Asterisk 18.4.0 - worth filing a bug?

On Wed, 26 May 2021 at 17:22, Jonathan H  wrote:
>
> https://wiki.asterisk.org/wiki/display/AST/Asterisk+18+AGICommand_set+autohangup
>
> "Cause the channel to automatically hangup at time seconds in the future"
>
> SET AUTOHANGUP TIME
>
> Looks great. Except... it doesn't. It just causes AGI to send "HANGUP"
> and any audio to stop playing.
> It does NOT hangup the channel, or even send any SIP event. The line
> just goes silent.
>
> It's been an entire afternoon of profuse googling; I have tried adding
> and removing hangup handlers, I have even tried setting the
> AGIEXITONHANGUP flag to "1" as per
> https://wiki.asterisk.org/wiki/display/AST/Asterisk+Standard+Channel+Variables
>
> But this is all that happens (5 seconds is ridiculous, it's just to
> test). This is with "pjsip set logger on"
>
> AGI Rx << SET AUTOHANGUP 5
> AGI Tx >> 200 result=0
> AGI Rx << SET VARIABLE AGIEXITONHANGUP "1"
> AGI Tx >> 200 result=1
> AGI Tx >> HANGUP   <<
> AGI Rx << HANGUP
> AGI Tx >> 511 Command Not Permitted on a dead channel or intercept routine
>
> basically, the next log event is whenever the next REGISTER would
> normally happen.
>
> And of course, if I try and respond to the AGI again, it tells me the
> channel is dead. So WHY is the "hangup" event not sent to the phone?
>
> I cannot use other methods like setting the absolute channel timeout
> variable, or using a local "dial" with a timeout message because:
>
> 1: the system tests whether the next file will push the listener over
> the 1 hour limit for included calls in UK packages, so the autohangup
> value has to be dynamic
> 2: It has to be over-ridable so that the listener can continue past the hour
> 3: The message that plays out is dynamically generated
>
> Everything about it works fine... except the fact that it doesn't
> actually hangup.
> Which leaves the possibility that an old person might fall asleep and
> end up with a large bill, which we don't want!

-- 
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

Check out the new Asterisk community forum at: https://community.asterisk.org/

New to Asterisk? Start here:
  https://wiki.asterisk.org/wiki/display/AST/Getting+Started

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users

[asterisk-users] HELP! AGI AUTOHANGUP does not seem to hangup the channel.

2021-05-26 Thread Jonathan H
https://wiki.asterisk.org/wiki/display/AST/Asterisk+18+AGICommand_set+autohangup

"Cause the channel to automatically hangup at time seconds in the future"

SET AUTOHANGUP TIME

Looks great. Except... it doesn't. It just causes AGI to send "HANGUP"
and any audio to stop playing.
It does NOT hangup the channel, or even send any SIP event. The line
just goes silent.

It's been an entire afternoon of profuse googling; I have tried adding
and removing hangup handlers, I have even tried setting the
AGIEXITONHANGUP flag to "1" as per
https://wiki.asterisk.org/wiki/display/AST/Asterisk+Standard+Channel+Variables

But this is all that happens (5 seconds is ridiculous, it's just to
test). This is with "pjsip set logger on"

AGI Rx << SET AUTOHANGUP 5
AGI Tx >> 200 result=0
AGI Rx << SET VARIABLE AGIEXITONHANGUP "1"
AGI Tx >> 200 result=1
AGI Tx >> HANGUP   <<
AGI Rx << HANGUP
AGI Tx >> 511 Command Not Permitted on a dead channel or intercept routine

basically, the next log event is whenever the next REGISTER would
normally happen.

And of course, if I try and respond to the AGI again, it tells me the
channel is dead. So WHY is the "hangup" event not sent to the phone?

I cannot use other methods like setting the absolute channel timeout
variable, or using a local "dial" with a timeout message because:

1: the system tests whether the next file will push the listener over
the 1 hour limit for included calls in UK packages, so the autohangup
value has to be dynamic
2: It has to be over-ridable so that the listener can continue past the hour
3: The message that plays out is dynamically generated

Everything about it works fine... except the fact that it doesn't
actually hangup.
Which leaves the possibility that an old person might fall asleep and
end up with a large bill, which we don't want!

-- 
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

Check out the new Asterisk community forum at: https://community.asterisk.org/

New to Asterisk? Start here:
  https://wiki.asterisk.org/wiki/display/AST/Getting+Started

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users

Re: [asterisk-users] AGI: Why is stream file and wait for digit result ASCII, but get data is "normal"?

2021-05-24 Thread Jonathan H
On Mon, 24 May 2021 at 18:41, Steve Edwards 
wrote:

>
> If you're not using a library, you may want to consider it.

'Comma' is not a valid 'digit' so this the same as '#*0123456789'
>

I'm using ts-agi which has served me well. In the docs, it suggests
phonekeys is an array:
https://github.com/sergey12313/ts-agi/blob/master/src/__tests__/index.test.ts#L295

   ctx.streamFile("test", [1,2,3,4,5,6,7,8,9,0,"#","*"], 1000,)

But in fact, you're right! I just tried "12345*#" and it works. I learn
something new every day here!

Believe me, I'd love to be going full ARI right now, but with no way to get
the current offset of a track I have to stick with AGI.

Thanks again.


>
> --
> Thanks in advance,
> -
> Steve Edwards   sedwa...@sedwards.com  Voice: +1-760-468-3867 PST
>  https://www.linkedin.com/in/steve-edwards-4244281
>
> --
> _
> -- Bandwidth and Colocation Provided by http://www.api-digital.com --
>
> Check out the new Asterisk community forum at:
> https://community.asterisk.org/
>
> New to Asterisk? Start here:
>   https://wiki.asterisk.org/wiki/display/AST/Getting+Started
>
> asterisk-users mailing list
> To UNSUBSCRIBE or update options visit:
>http://lists.digium.com/mailman/listinfo/asterisk-users
-- 
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

Check out the new Asterisk community forum at: https://community.asterisk.org/

New to Asterisk? Start here:
  https://wiki.asterisk.org/wiki/display/AST/Getting+Started

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users

[asterisk-users] AGI: Why is stream file and wait for digit result ASCII, but get data is "normal"?

2021-05-24 Thread Jonathan H
Having been scratching my head the whole morning to find a bug, I now have
an A4 poster on the wall (not joking!) saying:

"get data" = *number*
"wait for digit" and "stream file" = *ascii !!!*

As you can see here:

AGI Rx << STREAM FILE "hello-world" "1,2,3,4,5,6,7,8,9,*,0,#"
AGI Tx >> 200 result=49 endpos=11840
AGI Rx << GET DATA hello-world -1 1
AGI Tx >> 200 result=1
AGI Rx << WAIT FOR DIGIT -1
AGI Tx >> 200 result=49

OK, I should have RTFM a bit harder, but this is VERY confusing! Out of
interest, any idea why it was done like this, and why someone would ever
need the ascii result from a keypress, rather than the keypress as given by
"get data"?

Just curious!
-- 
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

Check out the new Asterisk community forum at: https://community.asterisk.org/

New to Asterisk? Start here:
  https://wiki.asterisk.org/wiki/display/AST/Getting+Started

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users

Re: [asterisk-users] S3 Bucket support for playing sound files

2021-05-06 Thread Jonathan H
What authentication? I just point to the bucket URL.

On Thu, 6 May 2021, 21:28 Dovid Bender,  wrote:

> Jonathan,
>
> How do you get around the authentication part? In my case I am using GSM
> files so there are no issues there.
>
>
>
> On Thu, May 6, 2021 at 4:11 AM Jonathan H  wrote:
>
>> I stream mp3s from s3 buckets all the time - but it's not Asterisk and s3
>> that have the issue, it's the incredibly outdated mp3 player baked into
>> Asterisk, which is from 1997 (see my original whinge about this below from
>> last year) and gives all those annoying "junk" warnings, plays very
>> quietly, and chokes on mp3 files with certain id3 tags (like embedded album
>> art).
>>
>> At the moment, my workaround is to just grab the file and strip all id3
>> tags and bumps up the outgoing volume to +7.
>>
>> I don't know why it's not been possible to update the mp3 library, but
>> hopefully one way round it might be if Asterisk were to offer a way of
>> using ControlPlayback etc with an external library?
>>
>> Good luck!
>>
>> -- Forwarded message -
>> From: Jonathan H 
>> Date: Wed, 23 Dec 2020 at 09:33
>> Subject: Re: [asterisk-users] Playing MP3's in Asterisk
>> To: Asterisk Users Mailing List - Non-Commercial Discussion <
>> asterisk-users@lists.digium.com>
>>
>>
>> Hi all,
>>
>> Returning to the issue of mp3 support in Asterisk, it seems it is using a
>> build from 1997?!
>> http://svn.digium.com/svn/thirdparty/mp3/trunk/layer3.c
>>
>> I have the same problems as everyone with the mp3 add-on, but now a new
>> one:
>>
>>- "mp3/interface.c: Junk at the beginning of frame 49443304" for ALL
>>mp3 files, even when debug/verbose is off.
>>- Very quiet playback compared to slin, so I have to control the
>>outgoing volume by +7 for mp3 playback.
>>- Now I find it chokes on mp3s which have a png cover art - this is
>>perfectly valid in mp3 id3
>>
>> But I still need to use ControlPlayback from dialplan and f-agi.
>>
>> I started going down a rabbit-hole of ARI media and Audiosocket etc, for
>> example:
>>
>> https://www.youtube.com/watch?v=tjduXbZZEgI
>> https://github.com/CyCoreSystems/audiosocket
>>
>> These all seem to add a fair amount of complexity for controlling
>> playback - for example:
>>
>> https://wiki.asterisk.org/wiki/display/AST/ARI+and+Media%3A+Part+2+-+Playbacks#ARIandMedia:Part2-Playbacks-Controllingplaybacks
>> And I need to know the current cplaybackoffset at any given time.
>>
>> I was thinking: to keep it simple, is there a way to tell Asterisk to use
>> a different mpg123 (the system one - my currently installed version from
>> 2020!) instead of the Asterisk build?
>>
>> I can live with the "junk" warnings and the quiet playback, but it cannot
>> be crashing on valid id3 content (and I have no control over the remotely
>> hosting files).
>>
>> Thanks for any pointers in the right direction!
>>
>> On Wed, 5 May 2021 at 22:11,  wrote:
>>
>>> On 5/5/2021 4:01 PM, Dovid Bender wrote:
>>> > Hi,
>>> >
>>> > Is anyone aware of any way of getting ControlPlayBack to work with an
>>> > amazon S3 bucket? I know I can put nginx in the middle but I am trying
>>> > to avoid that.
>>> I had some similar issues where ControlPlayback() wouldn't stream mp3
>>> files from certain sites.
>>> I ended up downloading the file to /tmp using wget and then playing the
>>> local file, which worked perfectly as a workaround.
>>> > TIA.
>>> >
>>> > Dovid
>>>
>>>
>>> --
>>> _
>>> -- Bandwidth and Colocation Provided by http://www.api-digital.com --
>>>
>>> Check out the new Asterisk community forum at:
>>> https://community.asterisk.org/
>>>
>>> New to Asterisk? Start here:
>>>   https://wiki.asterisk.org/wiki/display/AST/Getting+Started
>>>
>>> asterisk-users mailing list
>>> To UNSUBSCRIBE or update options visit:
>>>http://lists.digium.com/mailman/listinfo/asterisk-users
>>
>> --
>> _
>> -- Bandwidth and Colocation Provided by http://www.api-digital.com --
>>
>> Check out the new Asterisk community forum at:
>> https://community.asterisk.org/
>>
>> New to Asterisk? St

Re: [asterisk-users] S3 Bucket support for playing sound files

2021-05-06 Thread Jonathan H
I stream mp3s from s3 buckets all the time - but it's not Asterisk and s3
that have the issue, it's the incredibly outdated mp3 player baked into
Asterisk, which is from 1997 (see my original whinge about this below from
last year) and gives all those annoying "junk" warnings, plays very
quietly, and chokes on mp3 files with certain id3 tags (like embedded album
art).

At the moment, my workaround is to just grab the file and strip all id3
tags and bumps up the outgoing volume to +7.

I don't know why it's not been possible to update the mp3 library, but
hopefully one way round it might be if Asterisk were to offer a way of
using ControlPlayback etc with an external library?

Good luck!

-- Forwarded message -----
From: Jonathan H 
Date: Wed, 23 Dec 2020 at 09:33
Subject: Re: [asterisk-users] Playing MP3's in Asterisk
To: Asterisk Users Mailing List - Non-Commercial Discussion <
asterisk-users@lists.digium.com>


Hi all,

Returning to the issue of mp3 support in Asterisk, it seems it is using a
build from 1997?!
http://svn.digium.com/svn/thirdparty/mp3/trunk/layer3.c

I have the same problems as everyone with the mp3 add-on, but now a new one:

   - "mp3/interface.c: Junk at the beginning of frame 49443304" for ALL mp3
   files, even when debug/verbose is off.
   - Very quiet playback compared to slin, so I have to control the
   outgoing volume by +7 for mp3 playback.
   - Now I find it chokes on mp3s which have a png cover art - this is
   perfectly valid in mp3 id3

But I still need to use ControlPlayback from dialplan and f-agi.

I started going down a rabbit-hole of ARI media and Audiosocket etc, for
example:

https://www.youtube.com/watch?v=tjduXbZZEgI
https://github.com/CyCoreSystems/audiosocket

These all seem to add a fair amount of complexity for controlling playback
- for example:
https://wiki.asterisk.org/wiki/display/AST/ARI+and+Media%3A+Part+2+-+Playbacks#ARIandMedia:Part2-Playbacks-Controllingplaybacks
And I need to know the current cplaybackoffset at any given time.

I was thinking: to keep it simple, is there a way to tell Asterisk to use a
different mpg123 (the system one - my currently installed version from
2020!) instead of the Asterisk build?

I can live with the "junk" warnings and the quiet playback, but it cannot
be crashing on valid id3 content (and I have no control over the remotely
hosting files).

Thanks for any pointers in the right direction!

On Wed, 5 May 2021 at 22:11,  wrote:

> On 5/5/2021 4:01 PM, Dovid Bender wrote:
> > Hi,
> >
> > Is anyone aware of any way of getting ControlPlayBack to work with an
> > amazon S3 bucket? I know I can put nginx in the middle but I am trying
> > to avoid that.
> I had some similar issues where ControlPlayback() wouldn't stream mp3
> files from certain sites.
> I ended up downloading the file to /tmp using wget and then playing the
> local file, which worked perfectly as a workaround.
> > TIA.
> >
> > Dovid
>
>
> --
> _
> -- Bandwidth and Colocation Provided by http://www.api-digital.com --
>
> Check out the new Asterisk community forum at:
> https://community.asterisk.org/
>
> New to Asterisk? Start here:
>   https://wiki.asterisk.org/wiki/display/AST/Getting+Started
>
> asterisk-users mailing list
> To UNSUBSCRIBE or update options visit:
>http://lists.digium.com/mailman/listinfo/asterisk-users
-- 
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

Check out the new Asterisk community forum at: https://community.asterisk.org/

New to Asterisk? Start here:
  https://wiki.asterisk.org/wiki/display/AST/Getting+Started

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users

Re: [asterisk-users] Help needed with ARI RTP externalMedia bridging please

2021-01-04 Thread Jonathan H
You're a genius, sir! I don't know how I missed the part about ports, but
anyway...

Looks for "channelvars": {
"UNICASTRTP_LOCAL_PORT": "*14880*",

and then

vlc -vvv https://media-ssl.musicradio.com/LBCUK --sout
'#transcode{vcodec=none,acodec=*a*
law,channels=1,samplerate=8000}:rtp{dst=127.0.0.1,port=14880}'

Then the rest as before...

The other change I made was from ulaw to alaw, as ulaw sounded horribly
scratchy, particularly with "s" sounds. alaw was much better.

At last no more dynamic rewriting of moh files and then reloading moh etc
etc!

Thanks again.

On Mon, 4 Jan 2021 at 17:03, Joshua C. Colp  wrote:

> On Sun, Jan 3, 2021 at 4:14 PM Jonathan H  wrote:
>
>> Very simply, I want to pipe some external audio into a channel (bridge)
>> using the externalMedia channel option.
>> Running Asterisk 18 on ubuntu, here's what I did to try and test things
>> out:
>>
>> open a console tab
>> vlc -vvv https://media-ssl.musicradio.com/LBCUK --sout
>> '#transcode{vcodec=none,acodec=ulaw,channels=1,samplerate=8000}:rtp{dst=127.0.0.1,port=5005}'
>>
>> open another console tab
>> wscat -c
>> "ws://localhost:8088/ari/events?api_key=asterisk:asterisk=playback-example"
>>
>> open another console tab
>> curl -v -u asterisk:asterisk -X POST "
>> http://localhost:8088/ari/channels/externalMedia?external_host=127.0.0.1:5005=musicChannel=ulaw=playback-example
>> "
>> curl -v -u asterisk:asterisk -X POST "
>> http://localhost:8088/ari/bridges/musicBridge?type=mixing;
>> then dial in from a phone
>> curl -v -u asterisk:asterisk -X GET "http://localhost:8088/ari/channels
>> "
>> and note the new call channel ID
>> curl -v -u asterisk:asterisk -X POST "
>> http://localhost:8088/ari/bridges/musicBridge/addChannel?channel=> channel from above>,musicChannel"
>>
>
> You're sending media from Asterisk to VLC, not the other way around,
> currently. You need to examine the result from the call to
> channels/externalMedia, this will include the RTP port that Asterisk is
> listening for media on. You then need to pass this to vlc somehow (I'm not
> familar with the VLC options) and have it send RTP to that port.
>
> --
> Joshua C. Colp
> Asterisk Technical Lead
> Sangoma Technologies
> Check us out at www.sangoma.com and www.asterisk.org
> --
> _
> -- Bandwidth and Colocation Provided by http://www.api-digital.com --
>
> Check out the new Asterisk community forum at:
> https://community.asterisk.org/
>
> New to Asterisk? Start here:
>   https://wiki.asterisk.org/wiki/display/AST/Getting+Started
>
> asterisk-users mailing list
> To UNSUBSCRIBE or update options visit:
>http://lists.digium.com/mailman/listinfo/asterisk-users
-- 
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

Check out the new Asterisk community forum at: https://community.asterisk.org/

New to Asterisk? Start here:
  https://wiki.asterisk.org/wiki/display/AST/Getting+Started

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users

Re: [asterisk-users] How do I extract CPLAYBACKOFFSET from ARI playback?

2021-01-04 Thread Jonathan H
On Mon, 4 Jan 2021 at 10:17, Joshua C. Colp  wrote:

> On Mon, Jan 4, 2021 at 6:14 AM Jonathan H  wrote:
>
>> Following the playback.js ari-client example, I now need to store the
>> current playback offsetms, either when it was skipped or hung up on.
>>
>> The information is not currently exposed. ARI would have to be extended
> to provide it in some manner.
>

OK - thanks for clarifying. So my choices are to keep track with my own
timer, OR switch back to diaplan / AGI and use controlplayback for this
case?

Now I'm getting my head round ARI I'm loving it - would just love to know
where I'm going wrong with piping rtp into externalmedia (see my other post
from last night)

Thanks.
-- 
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

Check out the new Asterisk community forum at: https://community.asterisk.org/

New to Asterisk? Start here:
  https://wiki.asterisk.org/wiki/display/AST/Getting+Started

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users

[asterisk-users] How do I extract CPLAYBACKOFFSET from ARI playback?

2021-01-04 Thread Jonathan H
Following the playback.js ari-client example, I now need to store the
current playback offsetms, either when it was skipped or hung up on.
But I can't seem to find it.
I know that
https://wiki.asterisk.org/wiki/display/AST/Asterisk+18+Application_ControlPlayback
sets CPLAYBACKOFFSET but that variable doesn't seem to be set by the ARI
request.

Nor is there any info in the "get playback" information request, in fact,
it doesn't seem to exist anywhere.

Internally, it must know the point at which it was paused to set the
correct offsetms when it is restarted - so how can I get this?
What I want to try and avoid is stuff like starting a timer and then having
to manually track all the skips back and forth etc.
Thanks.

What have I tried? Reading all of this!
https://wiki.asterisk.org/wiki/display/AST/Introduction+to+ARI+and+Channels#IntroductiontoARIandChannels-channel-dump.js
https://wiki.asterisk.org/wiki/display/AST/Introduction+to+ARI+and+Channels
https://wiki.asterisk.org/wiki/display/AST/Asterisk+18+Playbacks+REST+API
https://wiki.asterisk.org/wiki/display/AST/Asterisk+18+Asterisk+REST+API
https://wiki.asterisk.org/wiki/display/AST/Asterisk+18+Application_ControlPlayback
https://github.com/asterisk/asterisk/blob/91fc57f56bd25d9bf28d44486d9e97ada1daafa9/res/res_stasis_playback.c
https://github.com/asterisk/asterisk/blob/773f424c7f7d54a8fa585deaa815cacdf1557e2b/apps/app_controlplayback.c
-- 
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

Check out the new Asterisk community forum at: https://community.asterisk.org/

New to Asterisk? Start here:
  https://wiki.asterisk.org/wiki/display/AST/Getting+Started

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users

[asterisk-users] Help needed with ARI RTP externalMedia bridging please

2021-01-03 Thread Jonathan H
Very simply, I want to pipe some external audio into a channel (bridge)
using the externalMedia channel option.
Running Asterisk 18 on ubuntu, here's what I did to try and test things out:

open a console tab
vlc -vvv https://media-ssl.musicradio.com/LBCUK --sout
'#transcode{vcodec=none,acodec=ulaw,channels=1,samplerate=8000}:rtp{dst=127.0.0.1,port=5005}'

open another console tab
wscat -c
"ws://localhost:8088/ari/events?api_key=asterisk:asterisk=playback-example"

open another console tab
curl -v -u asterisk:asterisk -X POST "
http://localhost:8088/ari/channels/externalMedia?external_host=127.0.0.1:5005=musicChannel=ulaw=playback-example
"
curl -v -u asterisk:asterisk -X POST "
http://localhost:8088/ari/bridges/musicBridge?type=mixing;
then dial in from a phone
curl -v -u asterisk:asterisk -X GET "http://localhost:8088/ari/channels;
and note the new call channel ID
curl -v -u asterisk:asterisk -X POST "
http://localhost:8088/ari/bridges/musicBridge/addChannel?channel=,musicChannel"

... and there is silence when I expected either music or at least some kind
of noise.

Is it something I'm doing wrong with the channel mixing, or with the
transcoding with vlc? Been battling this all day and could really use a
second pair of eyes on this.
Thanks.

(PS - of course, I would use the node SDK for live stuff, and not
"asterisk:asterisk" as username/password!)

Here's the VLC output - does "PCMU/8000 on port 5005 RTP/AVP 0" look
reasonable?

o=- 16401160996019665100 16401160996019665100 IN IP4 ip-172-31-37-244
s=Unnamed
i=N/A
c=IN IP4 127.0.0.1
t=0 0
a=tool:vlc 3.0.11
a=recvonly
a=type:broadcast
a=charset:UTF-8
m=audio 5005 RTP/AVP 0
b=AS:64
b=RR:0
a=rtpmap:0 PCMU/8000
a=rtcp:5006
-- 
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

Check out the new Asterisk community forum at: https://community.asterisk.org/

New to Asterisk? Start here:
  https://wiki.asterisk.org/wiki/display/AST/Getting+Started

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users

[asterisk-users] serverless fastagi/ARI via AWS lambda and a question about dialplan curl for variables

2020-12-29 Thread Jonathan H
I want a very basic Asterisk install on a pi to play two mp3 files, which
change location, one after another.
I have a tiny node script which reads an rss feed and returns the first 2
episodes.

In this case, running a fast-agi server seems like overkill and as it's
simply 2 or 3 variables, I can make a simple dialplan curl request to a
simple text/plain lamdba http endpoint, and then CUT the variables.
(eg: https://example.com/something.mp3|https://example.com/tuesday.mp3)

But it made me wonder: has anyone ever attempted running fastagi on
something serverless like AWS Lambda? I'm not really sure what the agi tcp
spec is - it doesn't seem to be websockets.

I think ARI might be a different proposition as one can configure an API
websocket gateway on Lambda - go into stasis, websocket to the lambda
running node-ari, job done.
And has anyone attempted that too, or is that also a bit hopeful?

PS: Side-question: is it possible to put a curl result directly into a
variable rather than doing these two back to back (curl > file > file >
variable)
https://wiki.asterisk.org/wiki/display/AST/Asterisk+18+Function_CURL
https://wiki.asterisk.org/wiki/display/AST/Asterisk+18+Function_FILE

Thanks again, hope you all had a good Christmas, and stay safe.

PPS - yes, I know none of the above is production-safe and it sounds a bit
insane; this is a little short term micro-project for my own interest, but
the thought of serverless AGI/ARI for bigger things intrigued me
-- 
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

Check out the new Asterisk community forum at: https://community.asterisk.org/

New to Asterisk? Start here:
  https://wiki.asterisk.org/wiki/display/AST/Getting+Started

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users

Re: [asterisk-users] Playing MP3's in Asterisk

2020-12-23 Thread Jonathan H
Thank you,

I'm using ControlPlayback, Playback, Background etc from dialplan and AGI
... not MoH.
All the files are remote so no conversion possible.

Thanks

On Wed, 23 Dec 2020 at 12:47, Dovid Bender  wrote:

> John,
>
> In what application are you using mp3's? In my case it was for music on
> hold. I simply had asterisk call ffmpeg to play the files (to get around
> all the issues). Where I have local files I convert them over to wav or gsm
> and call it a day.
>
>
> On Wed, Dec 23, 2020 at 4:33 AM Jonathan H  wrote:
>
>> Hi all,
>>
>> Returning to the issue of mp3 support in Asterisk, it seems it is using a
>> build from 1997?!
>> http://svn.digium.com/svn/thirdparty/mp3/trunk/layer3.c
>>
>> I have the same problems as everyone with the mp3 add-on, but now a new
>> one:
>>
>>- "mp3/interface.c: Junk at the beginning of frame 49443304" for ALL
>>mp3 files, even when debug/verbose is off.
>>- Very quiet playback compared to slin, so I have to control the
>>outgoing volume by +7 for mp3 playback.
>>- Now I find it chokes on mp3s which have a png cover art - this is
>>perfectly valid in mp3 id3
>>
>> But I still need to use ControlPlayback from dialplan and f-agi.
>>
>> I started going down a rabbit-hole of ARI media and Audiosocket etc, for
>> example:
>>
>> https://www.youtube.com/watch?v=tjduXbZZEgI
>> https://github.com/CyCoreSystems/audiosocket
>>
>> These all seem to add a fair amount of complexity for controlling
>> playback - for example:
>>
>> https://wiki.asterisk.org/wiki/display/AST/ARI+and+Media%3A+Part+2+-+Playbacks#ARIandMedia:Part2-Playbacks-Controllingplaybacks
>> And I need to know the current cplaybackoffset at any given time.
>>
>> I was thinking: to keep it simple, is there a way to tell Asterisk to use
>> a different mpg123 (the system one - my currently installed version from
>> 2020!) instead of the Asterisk build?
>>
>> I can live with the "junk" warnings and the quiet playback, but it cannot
>> be crashing on valid id3 content (and I have no control over the remotely
>> hosting files).
>>
>> Thanks for any pointers in the right direction!
>>
>> On Tue, 3 Sept 2019 at 16:20, Dovid Bender  wrote:
>>
>>> Ludovic,
>>>
>>> Currently using Asterisk 14.5.0 with
>>> [root@a1-c2-nyc3 ~]# rpm -qa | grep mpg123
>>> mpg123-1.25.6-1.el7.x86_64
>>> mpg123-libs-1.25.6-1.el7.x86_64
>>> mpg123-devel-1.25.6-1.el7.x86_64
>>> [root@a1-c2-nyc3 ~]#
>>> Should I be using a newer version of mpg123?
>>>
>>>
>>>
>>> On Tue, Sep 3, 2019 at 11:11 AM  wrote:
>>>
>>>> Hi !
>>>>
>>>> Which Asterisk version do you use?
>>>> Asterisk uses the mpg123 library.
>>>>
>>>> Regards,
>>>>
>>>> Ludovic
>>>>
>>>> On Sun, Sep 01, 2019 at 03:27:59PM -0400, Dovid Bender wrote:
>>>> >Hi,
>>>> >Does anyone know what code (if any)Â format_mp3 uses? I am trying
>>>> to play
>>>> >a MP3 (e.g.
>>>>
>>>> --
>>>> https://drolez.com/blog- Marketing automation and Web dev
>>>> https://chezsandro.com - A cool place in Cape Verde :)
>>>> https://aopensource.com- Android Open Source Portal
>>>>
>>>> --
>>>> _
>>>> -- Bandwidth and Colocation Provided by http://www.api-digital.com --
>>>>
>>>> Check out the new Asterisk community forum at:
>>>> https://community.asterisk.org/
>>>>
>>>> New to Asterisk? Start here:
>>>>   https://wiki.asterisk.org/wiki/display/AST/Getting+Started
>>>>
>>>> asterisk-users mailing list
>>>> To UNSUBSCRIBE or update options visit:
>>>>http://lists.digium.com/mailman/listinfo/asterisk-users
>>>
>>> --
>>> _
>>> -- Bandwidth and Colocation Provided by http://www.api-digital.com --
>>>
>>> Check out the new Asterisk community forum at:
>>> https://community.asterisk.org/
>>>
>>> New to Asterisk? Start here:
>>>   https://wiki.asterisk.org/wiki/display/AST/Getting+Started
>>>
>>> asterisk-users mailing list
>>> To UNSUBSCRIBE or update options visit:
>>>http://lists.digium.

Re: [asterisk-users] Playing MP3's in Asterisk

2020-12-23 Thread Jonathan H
Hi all,

Returning to the issue of mp3 support in Asterisk, it seems it is using a
build from 1997?!
http://svn.digium.com/svn/thirdparty/mp3/trunk/layer3.c

I have the same problems as everyone with the mp3 add-on, but now a new one:

   - "mp3/interface.c: Junk at the beginning of frame 49443304" for ALL mp3
   files, even when debug/verbose is off.
   - Very quiet playback compared to slin, so I have to control the
   outgoing volume by +7 for mp3 playback.
   - Now I find it chokes on mp3s which have a png cover art - this is
   perfectly valid in mp3 id3

But I still need to use ControlPlayback from dialplan and f-agi.

I started going down a rabbit-hole of ARI media and Audiosocket etc, for
example:

https://www.youtube.com/watch?v=tjduXbZZEgI
https://github.com/CyCoreSystems/audiosocket

These all seem to add a fair amount of complexity for controlling playback
- for example:
https://wiki.asterisk.org/wiki/display/AST/ARI+and+Media%3A+Part+2+-+Playbacks#ARIandMedia:Part2-Playbacks-Controllingplaybacks
And I need to know the current cplaybackoffset at any given time.

I was thinking: to keep it simple, is there a way to tell Asterisk to use a
different mpg123 (the system one - my currently installed version from
2020!) instead of the Asterisk build?

I can live with the "junk" warnings and the quiet playback, but it cannot
be crashing on valid id3 content (and I have no control over the remotely
hosting files).

Thanks for any pointers in the right direction!

On Tue, 3 Sept 2019 at 16:20, Dovid Bender  wrote:

> Ludovic,
>
> Currently using Asterisk 14.5.0 with
> [root@a1-c2-nyc3 ~]# rpm -qa | grep mpg123
> mpg123-1.25.6-1.el7.x86_64
> mpg123-libs-1.25.6-1.el7.x86_64
> mpg123-devel-1.25.6-1.el7.x86_64
> [root@a1-c2-nyc3 ~]#
> Should I be using a newer version of mpg123?
>
>
>
> On Tue, Sep 3, 2019 at 11:11 AM  wrote:
>
>> Hi !
>>
>> Which Asterisk version do you use?
>> Asterisk uses the mpg123 library.
>>
>> Regards,
>>
>> Ludovic
>>
>> On Sun, Sep 01, 2019 at 03:27:59PM -0400, Dovid Bender wrote:
>> >Hi,
>> >Does anyone know what code (if any)Â format_mp3 uses? I am trying to
>> play
>> >a MP3 (e.g.
>>
>> --
>> https://drolez.com/blog- Marketing automation and Web dev
>> https://chezsandro.com - A cool place in Cape Verde :)
>> https://aopensource.com- Android Open Source Portal
>>
>> --
>> _
>> -- Bandwidth and Colocation Provided by http://www.api-digital.com --
>>
>> Check out the new Asterisk community forum at:
>> https://community.asterisk.org/
>>
>> New to Asterisk? Start here:
>>   https://wiki.asterisk.org/wiki/display/AST/Getting+Started
>>
>> asterisk-users mailing list
>> To UNSUBSCRIBE or update options visit:
>>http://lists.digium.com/mailman/listinfo/asterisk-users
>
> --
> _
> -- Bandwidth and Colocation Provided by http://www.api-digital.com --
>
> Check out the new Asterisk community forum at:
> https://community.asterisk.org/
>
> New to Asterisk? Start here:
>   https://wiki.asterisk.org/wiki/display/AST/Getting+Started
>
> asterisk-users mailing list
> To UNSUBSCRIBE or update options visit:
>http://lists.digium.com/mailman/listinfo/asterisk-users
-- 
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

Check out the new Asterisk community forum at: https://community.asterisk.org/

New to Asterisk? Start here:
  https://wiki.asterisk.org/wiki/display/AST/Getting+Started

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users

Re: [asterisk-users] CURLOPT(useragent) fails with Set requires an '=' to be a valid assignment

2020-12-14 Thread Jonathan H
Of course! Thank you. I had not thought about escaping it because ";"
is not a character I've normally had to escape.

Thanks again for this - so obvious now you mention it.

On Mon, 14 Dec 2020 at 18:54, Joshua C. Colp  wrote:
>
> On Mon, Dec 14, 2020 at 2:51 PM Jonathan H  wrote:
>>
>> Thank you.
>>
>> Yes, the useragent string does indeed contain semicolon, and as most
>> seem to, how can I set the (useragent) to a valid useragent?
>>
>> And does that mean I can never SET something with a semicolon in the
>> string, even if wrapped in quotes?
>>
>> Sorry if I'm being thick here!
>
>
> The character to escape it is "\" thus: "\;" would tell the config parser to 
> not treat it as a comment.
>
> --
> Joshua C. Colp
> Asterisk Technical Lead
> Sangoma Technologies
> Check us out at www.sangoma.com and www.asterisk.org
> --
> _
> -- Bandwidth and Colocation Provided by http://www.api-digital.com --
>
> Check out the new Asterisk community forum at: https://community.asterisk.org/
>
> New to Asterisk? Start here:
>   https://wiki.asterisk.org/wiki/display/AST/Getting+Started
>
> asterisk-users mailing list
> To UNSUBSCRIBE or update options visit:
>http://lists.digium.com/mailman/listinfo/asterisk-users

-- 
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

Check out the new Asterisk community forum at: https://community.asterisk.org/

New to Asterisk? Start here:
  https://wiki.asterisk.org/wiki/display/AST/Getting+Started

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users

Re: [asterisk-users] CURLOPT(useragent) fails with Set requires an '=' to be a valid assignment

2020-12-14 Thread Jonathan H
Thank you.

Yes, the useragent string does indeed contain semicolon, and as most
seem to, how can I set the (useragent) to a valid useragent?

And does that mean I can never SET something with a semicolon in the
string, even if wrapped in quotes?

Sorry if I'm being thick here!

Thanks


On Mon, 14 Dec 2020 at 18:34, Richard Mudgett  wrote:
>
> There are semicolons in the useragent string you are trying to set.  If that 
> is the exact dialplan line then
> those semicolons are being seen as a start of a comment.
>
> Richard
>
> On Mon, Dec 14, 2020 at 12:25 PM Jonathan H  wrote:
>>
>> All my other CURLOPT settings like timeout work fine. But this:
>>
>> same  => n,Set(CURLOPT(useragent)="Mozilla/5.0 (Windows NT 10.0;
>> Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.41
>> Safari/537.36")
>>
>> give the following warning on dialplan reload, with and without quotes
>> around the user agent. Everything else is fine - perhaps it is the
>> parenthesis in the user agent?
>> If so, how do I get round this? I am fairly sure it's a typo at my
>> end, but I've looked at examples from other people/gists and my usage
>> looks correct.
>> It's only the useragent option it chokes on.
>>
>> -- Executing [s@setup:3] Set("Local/s@setup-0006;2",
>> "CURLOPT(useragent") in new stack
>> [Dec 14 17:24:30] WARNING[10243][C-0007]: pbx_variables.c:1140
>> pbx_builtin_setvar: Set requires an '=' to be a valid assignment.
>> -- Executing [s@setup:4] Set("Local/s@setup-0006;2",
>> "CURLOPT(conntimeout)=3") in new stack
>> -- Executing [s@setup:5] Set("Local/s@setup-0006;2",
>> "CURLOPT(dnstimeout)=3") in new stack
>>
>>
>> NOTE: The reason I'm doing this is because I want Asterisk to give a
>> different user agent for ControlPlayback function and move on quickly
>> if the remote file is not available / slow.
>> If that is not the correct way then please let me know!
>>
>> --
>> _
>> -- Bandwidth and Colocation Provided by http://www.api-digital.com --
>>
>> Check out the new Asterisk community forum at: 
>> https://community.asterisk.org/
>>
>> New to Asterisk? Start here:
>>   https://wiki.asterisk.org/wiki/display/AST/Getting+Started
>>
>> asterisk-users mailing list
>> To UNSUBSCRIBE or update options visit:
>>http://lists.digium.com/mailman/listinfo/asterisk-users
>
> --
> _
> -- Bandwidth and Colocation Provided by http://www.api-digital.com --
>
> Check out the new Asterisk community forum at: https://community.asterisk.org/
>
> New to Asterisk? Start here:
>   https://wiki.asterisk.org/wiki/display/AST/Getting+Started
>
> asterisk-users mailing list
> To UNSUBSCRIBE or update options visit:
>http://lists.digium.com/mailman/listinfo/asterisk-users

-- 
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

Check out the new Asterisk community forum at: https://community.asterisk.org/

New to Asterisk? Start here:
  https://wiki.asterisk.org/wiki/display/AST/Getting+Started

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users

[asterisk-users] CURLOPT(useragent) fails with Set requires an '=' to be a valid assignment

2020-12-14 Thread Jonathan H
All my other CURLOPT settings like timeout work fine. But this:

same  => n,Set(CURLOPT(useragent)="Mozilla/5.0 (Windows NT 10.0;
Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.41
Safari/537.36")

give the following warning on dialplan reload, with and without quotes
around the user agent. Everything else is fine - perhaps it is the
parenthesis in the user agent?
If so, how do I get round this? I am fairly sure it's a typo at my
end, but I've looked at examples from other people/gists and my usage
looks correct.
It's only the useragent option it chokes on.

-- Executing [s@setup:3] Set("Local/s@setup-0006;2",
"CURLOPT(useragent") in new stack
[Dec 14 17:24:30] WARNING[10243][C-0007]: pbx_variables.c:1140
pbx_builtin_setvar: Set requires an '=' to be a valid assignment.
-- Executing [s@setup:4] Set("Local/s@setup-0006;2",
"CURLOPT(conntimeout)=3") in new stack
-- Executing [s@setup:5] Set("Local/s@setup-0006;2",
"CURLOPT(dnstimeout)=3") in new stack


NOTE: The reason I'm doing this is because I want Asterisk to give a
different user agent for ControlPlayback function and move on quickly
if the remote file is not available / slow.
If that is not the correct way then please let me know!

-- 
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

Check out the new Asterisk community forum at: https://community.asterisk.org/

New to Asterisk? Start here:
  https://wiki.asterisk.org/wiki/display/AST/Getting+Started

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users

Re: [asterisk-users] Any api (agi/ari/ami) equivalent of "core show calls"?

2020-06-14 Thread Jonathan H
Wow! I've been *-ing for about 6 years and had literally no idea about
that!

I can see a way I could put it to a different use, but it seems to be a bit
of a sledgehammer to crack the walnut of "how many current callers"
compared to one line of (albeit hacky) dialplan.

That's making me sound ungrateful. I don't mean to be!

On Sun, 14 Jun 2020, 22:39 Steve Edwards,  wrote:

> On Sun, 14 Jun 2020, Jonathan H wrote:
>
> > Thank you... but "just update the database" - hmm, what database?
>
> I used MySQL.
>
> > Did you mean ARI? I still can't find the command! The asterisk wiki is
> > somewhat, um... spread around!
>
> ARA as in Asterisk RealTime Architecture
>
> https://wiki.asterisk.org/wiki/display/AST/Realtime+Database+Configuration
> https://www.voip-info.org/asterisk-realtime/
>
> As I recall (back from 2015), you tell Asterisk which 'configuration file'
> you want to read from MySQL like this:
>
> # /etc/asterisk/extconfig.conf
>
> [settings]
>  musiconhold.conf= mysql,vchat,static
> ;   musiconhold.conf= mysql,vchat,musiconhold
>
> I have no idea if this will help, but here are the tables as I defined
> them back in 2015.
>
>  create  table   if not exists   static
>  (
>idint(11) not null auto_increment
>  , cat_metricint(11) not null default '0'
>  , var_metricint(11) not null default '0'
>  , commented int(11) not null default '0'
>  , filename  varchar(128) not null default ''
>  , category  varchar(128) not null default
> 'default'
>  , var_name  varchar(128) not null default ''
>  , var_val   varchar(128) not null default ''
>  , primary key   (id)
>  )
>  ;
>
> -- defaults
>  set @CAT_METRIC = 0;
>  set @FILENAME   = 'musiconhold.conf';
>  set @VAR_METRIC = 0;
>
> -- Funk Dance
>  set @COMMENTED  = 0;
>  set @NAME   = 'Funk Dance';
>  insert into static set
>cat_metric= @CAT_METRIC
>  , category  = @NAME
>  , commented = @COMMENTED
>  , filename  = @FILENAME
>  , var_metric= @VAR_METRIC
>  , var_name  = 'directory'
>  , var_val   =
> concat('/source/src/tmp/T2/moh/', @NAME, '/')
>  ;
>  insert into static set
>cat_metric= @CAT_METRIC
>  , category  = @NAME
>  , commented = @COMMENTED
>  , filename  = @FILENAME
>  , var_metric= @VAR_METRIC
>  , var_name  = 'mode'
>  , var_val   = 'files'
>  ;
>  insert into static set
>cat_metric= @CAT_METRIC
>  , category  = @NAME
>  , commented = @COMMENTED
>  , filename  = @FILENAME
>  , var_metric= @VAR_METRIC
>  , var_name  = 'sort'
>  , var_val   = 'random'
>  ;
>  insert into static set
>cat_metric= @CAT_METRIC
>  , category  = @NAME
>  , commented = @COMMENTED
>  , filename  = @FILENAME
>  , var_metric= @VAR_METRIC
>  , var_name  = 'type'
>  , var_val   = 'preset'
>  ;
> --  insert into static set
> --cat_metric= @CAT_METRIC
> --  , category  = @NAME
> --  , commented = @COMMENTED
> --  , filename  = @FILENAME
> --  , var_metric= @VAR_METRIC
> --  , var_name  = 'application'
> --  , var_val   = '/usr/bin/mpg123 --mono -b 0 -f
> 8192 -q -r 8000 -s -@ http://206.190.136.141:5022/Live'
> --  ;
>
> -- FILES
> --  set @COMMENTED  = 0;
> --  insert into static se

Re: [asterisk-users] Any api (agi/ari/ami) equivalent of "core show calls"?

2020-06-14 Thread Jonathan H
Thank you... but "just update the database" - hmm, what database?

Did you mean ARI? I still can't find the command! The asterisk wiki is
somewhat, um... spread around!


On Sat, 13 Jun 2020 at 16:56, Steve Edwards  wrote:
>
> On Sat, 13 Jun 2020, Jonathan H wrote:
>
> > I need to ensure that a MusicOnHold stream is only running when there's
> > a caller on hold and listening.To do that, I need to rewrite and reload
> > the moh.conf file when the caller hangs up IF there are no other callers
> > (ie there's just 1 active call as the caller hangs up), and then
> > rewrite and reload again when there's a new caller.
>
> How about ARA to configure MOH and then just update the database.
>
> --
> Thanks in advance,
> -
> Steve Edwards   sedwa...@sedwards.com  Voice: +1-760-468-3867 PST
>  https://www.linkedin.com/in/steve-edwards-4244281--
> _
> -- Bandwidth and Colocation Provided by http://www.api-digital.com --
>
> Check out the new Asterisk community forum at: https://community.asterisk.org/
>
> New to Asterisk? Start here:
>   https://wiki.asterisk.org/wiki/display/AST/Getting+Started
>
> asterisk-users mailing list
> To UNSUBSCRIBE or update options visit:
>http://lists.digium.com/mailman/listinfo/asterisk-users

-- 
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

Check out the new Asterisk community forum at: https://community.asterisk.org/

New to Asterisk? Start here:
  https://wiki.asterisk.org/wiki/display/AST/Getting+Started

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users

[asterisk-users] Any api (agi/ari/ami) equivalent of "core show calls"?

2020-06-13 Thread Jonathan H
I'm parsing ` sudo asterisk -rx "core show calls" | grep active | head -c 1
` as an external call from within the Asterisk dialplan then passing it to
agi, but this seems really hacky and ugly.

However, I cannot find any ARI/AGI/AMI function (or global variable I can
get with agi) which shows me this.

Any ideas?!?

In case it helps and you're wondering why...
I need to ensure that a MusicOnHold stream is only running when there's a
caller on hold and listening.
To do that, I need to rewrite and reload the moh.conf file when the caller
hangs up IF there are no other callers (ie there's just 1 active call as
the caller hangs up), and then  rewrite and reload again when there's a new
caller.
-- 
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

Check out the new Asterisk community forum at: https://community.asterisk.org/

New to Asterisk? Start here:
  https://wiki.asterisk.org/wiki/display/AST/Getting+Started

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users

Re: [asterisk-users] Old Asterisk forums not working

2020-05-15 Thread Jonathan H
Thanks Joshua;

Working now - but regarding the slow wiki, it's normally 5-10 second page
load for me in the UK, but it was closer to 20 seconds earlier.
https://tools.pingdom.com/#5c862c04ad80

Seems to be back to around 5 seconds now, but I notice that if I run a
Pingdom page test from a US server, the page loads in about 1.3 seconds.

I wonder if there might be a misconfigured edge cache my side of the pond
of something? (I'm in the UK)

Example:
https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+ManagerEvent_AttendedTransfer
- tested 3 times
>From Washington test point, never *above* 1.5 seconds - DNS, SSL and
Connect all about 50ms
>From UK London test point, never *under *4 seconds -  DNS, SSL and Connect
all about 500ms (10x more)

Anyway, not to worry, a few seconds is fine, just thought I'd point out the
discrepancy!

Thanks again for the project/service

Jonathan

On Fri, 15 May 2020 at 15:52, Joshua C. Colp  wrote:

> On Fri, May 15, 2020 at 9:39 AM Jonathan H  wrote:
>
>> Hello!
>>
>> https://forums.asterisk.org/ is doing it again - "Content Encoding
>> Error. An error occurred during a connection to forums.asterisk.org.
>> Please contact the website owners to inform them of this problem".
>>
>> Which is odd, as the Qualys test seems to pass, only losing a point for
>> supporting TLS 1.0. But I know it's not just me because Pingdom can't read
>> the page, either.
>>
>
> This has been resolved.
>
> --
> Joshua C. Colp
> Asterisk Technical Lead
> Sangoma Technologies
> Check us out at www.sangoma.com and www.asterisk.org
> --
> _
> -- Bandwidth and Colocation Provided by http://www.api-digital.com --
>
> Check out the new Asterisk community forum at:
> https://community.asterisk.org/
>
> New to Asterisk? Start here:
>   https://wiki.asterisk.org/wiki/display/AST/Getting+Started
>
> asterisk-users mailing list
> To UNSUBSCRIBE or update options visit:
>http://lists.digium.com/mailman/listinfo/asterisk-users
-- 
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

Check out the new Asterisk community forum at: https://community.asterisk.org/

New to Asterisk? Start here:
  https://wiki.asterisk.org/wiki/display/AST/Getting+Started

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users

Re: [asterisk-users] Old Asterisk forums not working

2020-05-15 Thread Jonathan H
Hello!

https://forums.asterisk.org/ is doing it again - "Content Encoding Error.
An error occurred during a connection to forums.asterisk.org. Please
contact the website owners to inform them of this problem".

Which is odd, as the Qualys test seems to pass, only losing a point for
supporting TLS 1.0. But I know it's not just me because Pingdom can't read
the page, either.

Also, the wiki seems VERY slow today - I'm trying to find out whether
agi_threadid is safe to use as an identifier to track a call, rather than
casting the uniquedid (a float) to an int (variables don't like dots in the
name!).

I had thought the agi_threadid would change each time a new thread was
started (after an agi_hangup/break etc was sent and the caller returned to
dialplan) but it appears to persist for the duration of the call/channel.

Hmmm



On Mon, 23 Mar 2020 at 12:40, Joshua C. Colp  wrote:

> On Mon, Mar 23, 2020 at 9:30 AM Jonathan H  wrote:
>
>> Hope you're all well.
>>
>> I know we should be using  https://community.asterisk.org/ but until
>> someone lets Google know that it's moved, all the search results (and
>> Asterisk's own search results) come from  https://forums.asterisk.org/
>>
>> In most browsers, it's not displaying; in Firefox, it says:
>>
>> "Content Encoding Error
>> The page you are trying to view cannot be shown because it uses an
>> invalid or unsupported form of compression."
>>
>> Of course, I can work around by visiting the
>> https://community.asterisk.org/  site and searching again there, and
>> it's not the most important thing in the world right now, but I thought I'd
>> note it anyway.
>>
>
> I have raised a ticket with IT regarding this.
>
> --
> Joshua C. Colp
> Asterisk Technical Lead
> Sangoma Technologies
> Check us out at www.sangoma.com and www.asterisk.org
> --
> _
> -- Bandwidth and Colocation Provided by http://www.api-digital.com --
>
> Check out the new Asterisk community forum at:
> https://community.asterisk.org/
>
> New to Asterisk? Start here:
>   https://wiki.asterisk.org/wiki/display/AST/Getting+Started
>
> asterisk-users mailing list
> To UNSUBSCRIBE or update options visit:
>http://lists.digium.com/mailman/listinfo/asterisk-users
-- 
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

Check out the new Asterisk community forum at: https://community.asterisk.org/

New to Asterisk? Start here:
  https://wiki.asterisk.org/wiki/display/AST/Getting+Started

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users

[asterisk-users] Tip/Question about encoding temporary data for storage in Asterisk variable to use in AGI

2020-05-13 Thread Jonathan H
I wanted to store a JSON object between agi requests for the duration of a
call.

Turns out asterisk does NOT like a stringified JSON object! AGI complains
of "520-Invalid command syntax"

So, I just base64 encode/decode it.

Assuming I don't need to manipulate the JSON object within Asterisk itself,
and I don't want to use a DB or memcache, is this the best/correct method?
WARNING! Asterisk truncates long variables - seems to be about 3000
characters or so(?), so make sure your base64 encoded object is small!

The following is a simple example which just encodes and decodes the agi
variables themselves as they're an object in ts-agi
(I'm using the ts-agi node package here as an example -
https://github.com/sergey12313/ts-agi/ )

await ctx.setVariable('testvar2',
Buffer.from(JSON.stringify(ctx.variables), 'utf8').toString('base64'))
const testvar2 = (await ctx.getVariable('testvar2')).value
const decoded = JSON.parse(Buffer.from(testvar2,
'base64').toString('utf8'))
console.log('decoded is', decoded)


Hope this helps someone!
-- 
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

Check out the new Asterisk community forum at: https://community.asterisk.org/

New to Asterisk? Start here:
  https://wiki.asterisk.org/wiki/display/AST/Getting+Started

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users

Re: [asterisk-users] Better way of streaming radio than "musiconhold" for Asterisk 17.4 ?

2020-05-06 Thread Jonathan H
Thanks Dan - might have to scratch my head over that one for a while!
The phrase "you make your own RTP server" has made me all twitchy ;)

Jonathan

On Wed, 6 May 2020 at 07:21, Dan Jenkins  wrote:

> Hi Jonathan,
>
> I'd probably go down the external media route in the ARI now - you make
> your own RTP server and provide your own RTP back to asterisk
>
> On Sun, 3 May 2020, 13:07 Jonathan H,  wrote:
>
>> Way back in 2016 the only way to allow callers to listen in to a stream
>> "at will" was to do the following:
>>
>> moh.conf
>>
>> [radio]
>> mode=custom
>> application=/usr/bin/mplayer https://example.com/stream.mp3 -quiet -ao
>> pcm:file=/dev/stdout -af volume=5,resample=8000,channels=1,format=alaw
>>
>> extensions.conf
>>
>> exten => radio,1,Verbose(1, Entered radio context)
>>   same  => n,Set(VOLUME(TX)=1)
>>   same  => n,WaitExten(27006,m(radio))
>>   same  => n,Goto(#,1)
>>
>> It kind of works, but two problems here:
>> It's pulling data 24x7, giving the radio host artificial stats - all
>> rather needless as maybe one or two people might listen for 10 mins each in
>> a day.
>> And even though mplayer seems to stay up and running all the time,
>> sometimes Asterisk will stop listening on that pipe and everything needs a
>> restart (random, less than once a week).
>>
>> Is there a more modern/sensible way of achieving the same, just ensuring
>> that stream plays if someone listens, isn't playing when no-one is
>> listening, and listening can be exited with a specified key?
>>
>> Thanks!
>>
>
-- 
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

Check out the new Asterisk community forum at: https://community.asterisk.org/

New to Asterisk? Start here:
  https://wiki.asterisk.org/wiki/display/AST/Getting+Started

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users

[asterisk-users] Better way of streaming radio than "musiconhold" for Asterisk 17.4 ?

2020-05-03 Thread Jonathan H
Way back in 2016 the only way to allow callers to listen in to a stream "at
will" was to do the following:

moh.conf

[radio]
mode=custom
application=/usr/bin/mplayer https://example.com/stream.mp3 -quiet -ao
pcm:file=/dev/stdout -af volume=5,resample=8000,channels=1,format=alaw

extensions.conf

exten => radio,1,Verbose(1, Entered radio context)
  same  => n,Set(VOLUME(TX)=1)
  same  => n,WaitExten(27006,m(radio))
  same  => n,Goto(#,1)

It kind of works, but two problems here:
It's pulling data 24x7, giving the radio host artificial stats - all rather
needless as maybe one or two people might listen for 10 mins each in a day.
And even though mplayer seems to stay up and running all the time,
sometimes Asterisk will stop listening on that pipe and everything needs a
restart (random, less than once a week).

Is there a more modern/sensible way of achieving the same, just ensuring
that stream plays if someone listens, isn't playing when no-one is
listening, and listening can be exited with a specified key?

Thanks!
-- 
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

Check out the new Asterisk community forum at: https://community.asterisk.org/

New to Asterisk? Start here:
  https://wiki.asterisk.org/wiki/display/AST/Getting+Started

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users

[asterisk-users] Old Asterisk forums not working

2020-03-23 Thread Jonathan H
Hope you're all well.

I know we should be using  https://community.asterisk.org/ but until
someone lets Google know that it's moved, all the search results (and
Asterisk's own search results) come from  https://forums.asterisk.org/

In most browsers, it's not displaying; in Firefox, it says:

"Content Encoding Error
The page you are trying to view cannot be shown because it uses an invalid
or unsupported form of compression."

Of course, I can work around by visiting the https://community.asterisk.org/
site and searching again there, and it's not the most important thing in
the world right now, but I thought I'd note it anyway.

Thanks.
-- 
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

Check out the new Asterisk community forum at: https://community.asterisk.org/

New to Asterisk? Start here:
  https://wiki.asterisk.org/wiki/display/AST/Getting+Started

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users

Re: [asterisk-users] AGI: "Get variable" returns variable VALUE vs "Get full variable" returns variable NAME - bug or my misunderstanding?

2019-12-27 Thread Jonathan H
OK, that works - looks like a documentation bug? (Also very confusing!)

Should I report it on the page at
https://wiki.asterisk.org/wiki/display/AST/Asterisk+17+AGICommand_get+full+variable
or
on the main tracker?

Many thanks - couldn't figure out what was wrong!

On Fri, 27 Dec 2019 at 19:36, Sean Bright  wrote:

> On 12/27/2019 2:24 PM, Jonathan H wrote:
> > AGI Rx << SET VARIABLE myVar "Hello
> > World!!!"
> > AGI Tx >> 200 result=1
> > AGI Rx << GET FULL VARIABLE myVar
> > AGI Tx >> 200 result=1 (myVar)
> >
> > Is this a bug, poor documentation, or my poor understanding of them?
>
> I believe the syntax you are looking for is:
>
>  GET FULL VARIABLE ${myVar}
>
> Kind regards,
> Sean
>
> --
> _
> -- Bandwidth and Colocation Provided by http://www.api-digital.com --
>
> Check out the new Asterisk community forum at:
> https://community.asterisk.org/
>
> New to Asterisk? Start here:
>   https://wiki.asterisk.org/wiki/display/AST/Getting+Started
>
> asterisk-users mailing list
> To UNSUBSCRIBE or update options visit:
>http://lists.digium.com/mailman/listinfo/asterisk-users
-- 
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

Check out the new Asterisk community forum at: https://community.asterisk.org/

New to Asterisk? Start here:
  https://wiki.asterisk.org/wiki/display/AST/Getting+Started

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users

[asterisk-users] AGI: "Get variable" returns variable VALUE vs "Get full variable" returns variable NAME - bug or my misunderstanding?

2019-12-27 Thread Jonathan H
Just trying out a node agi package (https://github.com/sergey12313/ts-agi/ ,
and it wasn't behaving as I expected, but when turning on agi debug, it
looks like it might be Asterisk (using 17.1.0)

This works as expected

AGI Rx << SET VARIABLE myVar "Hello World!!!"
AGI Tx >> 200 result=1
AGI Rx << GET VARIABLE myVar
AGI Tx >> 200 result=1 (Hello World!!!)

But  GET FULL VARIABLE just returns the NAME of the variable

AGI Rx << SET VARIABLE myVar "Hello World!!!"
AGI Tx >> 200 result=1
AGI Rx << GET FULL VARIABLE myVar
AGI Tx >> 200 result=1 (myVar)

Is this a bug, poor documentation, or my poor understanding of them?

https://wiki.asterisk.org/wiki/display/AST/Asterisk+17+AGICommand_get+full+variable
GET FULL VARIABLE VARIABLENAME CHANNEL NAME
Example return code: 200 result=1 (testvariable)

https://wiki.asterisk.org/wiki/display/AST/Asterisk+17+AGICommand_get+variable
GET VARIABLE VARIABLENAME
Example return code: 200 result=1 (testvariable)
-- 
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

Check out the new Asterisk community forum at: https://community.asterisk.org/

New to Asterisk? Start here:
  https://wiki.asterisk.org/wiki/display/AST/Getting+Started

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users

[asterisk-users] Simple, fast single-word offline free speech recognition in Asterisk (or as an AGI)?

2019-11-25 Thread Jonathan H
I'm after fast, native recognition of the numbers 1 to 20, yes, no, menu
and help.

At the moment, I use Google Speech Recognition which uses no local
processing power, and is very accurate, allowing me to run on a very low
end VPS.

However, with the minimum of 15 seconds, numbers and words like "yes, no"
soon eat up the 60 minute free allowance.

I was hoping I could use "local", with a fallback to Google speech rec if
it was uncertain.

Any ideas? Thanks

Yes, I know I post similar back in January, but there was no response back
then and I was hoping things might have changed :)

On Wed, 16 Jan 2019 at 17:42, Jonathan H  wrote:

> When I last looked into this a couple of years ago, simple one-word speech
> recognition was rather complex and slow.
>
> At the moment, I use Google Speech Recognition which uses no local
> processing power, and is very accurate and fast, allowing me to run on a
> very low end VPS.
>
> However, with the minimum of 15 seconds, numbers and words like "yes, no"
> soon eat up the 60 minute free allowance.
>
> Have things changed much in the last couple of years? I see a couple of
> new "standalone" projects even from the likes of Facebook and Mozilla, but
> they require a degree in C++ and, apparently, about 24 hours to build a
> voice model on a high-end box with the latest graphics cards (for the
> number crunching). Also, unless I'm reading it wrong, each second of speech
> takes 4 seconds to recognise on a low end machine with this standalone
> offerings and similar ones.
>
> https://github.com/facebookresearch/wav2letter
> https://voice.mozilla.org/en
>
> In fact, come to think of it, I really only need offline fast recognition
> of numbers 1 to 20, yes, no, menu and help.
> For voicemail transcription I'm happy to stick with Google's paid service
> as it's remarkably accurate with phone quality speech (beats Microsoft and
> Amazon Transcribe hands down from what I can tell).
>
> Oh, and UniMRPC seems rather complex and the licensing doesn't suit - 99%
> of the time I have one channel (caller) but it can jump to 10 - I don't
> want to have to buy a 10 channel license for that 1 hour a month!
>
> Any ideas? Thanks
>
-- 
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

Check out the new Asterisk community forum at: https://community.asterisk.org/

New to Asterisk? Start here:
  https://wiki.asterisk.org/wiki/display/AST/Getting+Started

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users

Re: [asterisk-users] Multiple readfile oddities, newlines etc

2019-10-29 Thread Jonathan H
October 2019, Asterisk 17.0, this is still happening

Bug updated:  https://issues.asterisk.org/jira/browse/ASTERISK-26481

File is a single line unix-line UTF-8 file, with  "1," (no quote marks)

hexdump output is as follows

000 2c31
002

dialplan is


same =>
n(skipto),Set(unfilteredfeat=${FILE(${scanPath}/skipto.txt,0,1,l,u)})
same => n,Set(feature=${SHIFT(unfilteredfeat)})
same => n,Verbose(1,feature is ${feature} unfilteredfeat is
${unfilteredfeat})


Console log output is


-- Executing [s@root:40] Set("Local/s@root-0011;2",
"unfilteredfeat=1,▒=") in new stack
[Oct 29 09:36:15] ERROR[2134][C-0012]: json.c:607 ast_json_vpack: Error
building JSON from '{s: s, s: s}': Invalid UTF-8 string.
[Oct 29 09:36:15] ERROR[2134][C-0012]:   Got 11 backtrace records
# 0: /usr/sbin/asterisk(ast_json_pack+0xa5) [0x5627588a7f45]
# 1: /usr/sbin/asterisk(ast_channel_publish_varset+0x30) [0x562758937820]
# 2: /usr/sbin/asterisk(pbx_builtin_setvar_helper+0x148) [0x5627588e8e78]
# 3: /usr/sbin/asterisk(pbx_builtin_setvar+0x119) [0x5627588e9209]
# 4: /usr/sbin/asterisk(pbx_exec+0x158) [0x5627588dedf8]
# 5: /usr/sbin/asterisk(+0x137479) [0x5627588d3479]
# 6: /usr/sbin/asterisk(+0x139134) [0x5627588d5134]
# 7: /usr/sbin/asterisk(+0x13a7a1) [0x5627588d67a1]
# 8: /usr/sbin/asterisk(+0x1bd598) [0x562758959598]
# 9: /lib/x86_64-linux-gnu/libpthread.so.0(+0x9669) [0x7fa95fd1b669]
#10: /lib/x86_64-linux-gnu/libc.so.6(clone+0x43) [0x7fa95fa9f323]

[Oct 29 09:36:15] ERROR[2134][C-0012]: stasis_channels.c:1161
ast_channel_publish_varset: Error creating message
[Oct 29 09:36:15] ERROR[2134][C-0012]: json.c:607 ast_json_vpack: Error
building JSON from '{s: s, s: s}': Invalid UTF-8 string.
[Oct 29 09:36:15] ERROR[2134][C-0012]:   Got 12 backtrace records
# 0: /usr/sbin/asterisk(ast_json_pack+0xa5) [0x5627588a7f45]
# 1: /usr/sbin/asterisk(ast_channel_publish_varset+0x30) [0x562758937820]
# 2: /usr/sbin/asterisk(pbx_builtin_setvar_helper+0x148) [0x5627588e8e78]
# 3: /usr/lib/asterisk/modules/func_strings.so(+0x64c0) [0x7fa93fd054c0]
# 4: /usr/sbin/asterisk(ast_func_read+0x326) [0x5627588e35b6]
# 5: /usr/sbin/asterisk(pbx_substitute_variables_helper_full+0x282)
[0x5627588e7cc2]
# 6: /usr/sbin/asterisk(+0x137445) [0x5627588d3445]
# 7: /usr/sbin/asterisk(+0x139134) [0x5627588d5134]
# 8: /usr/sbin/asterisk(+0x13a7a1) [0x5627588d67a1]
# 9: /usr/sbin/asterisk(+0x1bd598) [0x562758959598]
#10: /lib/x86_64-linux-gnu/libpthread.so.0(+0x9669) [0x7fa95fd1b669]
#11: /lib/x86_64-linux-gnu/libc.so.6(clone+0x43) [0x7fa95fa9f323]

[Oct 29 09:36:15] ERROR[2134][C-0012]: stasis_channels.c:1161
ast_channel_publish_varset: Error creating message
-- Executing [s@root:42] Set("Local/s@root-0011;2", "feature=1") in
new stack
-- Executing [s@root:43] Verbose("Local/s@root-0011;2", "1,feature
is 1 unfilteredfeat is ▒=") in new stack
 feature is 1 unfilteredfeat is ▒=


On Tue, 18 Oct 2016 at 12:41, Jonathan H  wrote:

> I'm going to go ahead and file a bug report, 'cos something definitely
> ain't right here! Bug filed:
> https://issues.asterisk.org/jira/browse/ASTERISK-26481
>
> This bit of dialplan.
>
> exten => 5,1,Verbose(Context: ${CONTEXT} Exten:${EXTEN})
> same => n,Set(featurefile=/home/test/feature-1.txt)
> same =>
> n,set(myList=1,12,123,1234,12345,123456,A,AB,ABC,ABCD,ABCDE,ABC123)
> same => n,While($["${SET(rawVar=${SHIFT(myList)})}" != ""])
> same => n,SET(FILE(${featurefile})=${rawVar})
> same => n,SET(fileVar=${FILE(${featurefile},0,1,l,u)})
> same => n,SET(hexDump=${SHELL(hd ${featurefile})})
> same => n,Verbose(Before file: ---${rawVar}--- len ${LEN(rawVar)}
> after file: ---${fileVar}--- len ${LEN(fileVar)} hexdump:${hexDump})
> same => n,EndWhile()
> same => n,Hangup()
>
>
> ...produces this output: (tidied only for posting) - this is messed up
> in so many ways.
>
> LEN is showing the wrong length.
> 1 character gets a weird character added.
> 23, and 4  characters OK
> 5 characters loses a character - BUT LOOK! Even though hexdump prints
> the correct contents and length, have a close look at this: 35|12345|
> whereas normally it would have a space before the pipe.
> 6 characters is OK
>
> Before file: ---1--- len 6 after file: ---1▒--- len 7 hexdump:
>  31|1| 0001
> Before file: ---12--- len 6 after file: ---12--- len 7
> hexdump:  31 32 |12| 0002
> Before file: ---123--- len 6 after file: ---123--- len 7
> hexdump:  31 32 33  |123| 0003
>
> [Oct 18 12:23:53] ERROR[8584][C-001a]: json.c:704 ast_json_vpack:
> Error building JSON from '{s: s, s: s}': Invalid UTF-8 string.
> [Oct 18 12:23:53] ERROR[8584][C-001a]: stasis_channels.c:773
> ast_c

[asterisk-users] Simple one-word offline free speech recognition in Asterisk (or as an AGI)?

2019-01-16 Thread Jonathan H
When I last looked into this a couple of years ago, simple one-word speech
recognition was rather complex and slow.

At the moment, I use Google Speech Recognition which uses no local
processing power, and is very accurate and fast, allowing me to run on a
very low end VPS.

However, with the minimum of 15 seconds, numbers and words like "yes, no"
soon eat up the 60 minute free allowance.

Have things changed much in the last couple of years? I see a couple of new
"standalone" projects even from the likes of Facebook and Mozilla, but they
require a degree in C++ and, apparently, about 24 hours to build a voice
model on a high-end box with the latest graphics cards (for the number
crunching). Also, unless I'm reading it wrong, each second of speech takes
4 seconds to recognise on a low end machine with this standalone offerings
and similar ones.

https://github.com/facebookresearch/wav2letter
https://voice.mozilla.org/en

In fact, come to think of it, I really only need offline fast recognition
of numbers 1 to 20, yes, no, menu and help.
For voicemail transcription I'm happy to stick with Google's paid service
as it's remarkably accurate with phone quality speech (beats Microsoft and
Amazon Transcribe hands down from what I can tell).

Oh, and UniMRPC seems rather complex and the licensing doesn't suit - 99%
of the time I have one channel (caller) but it can jump to 10 - I don't
want to have to buy a 10 channel license for that 1 hour a month!

Any ideas? Thanks
-- 
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

Check out the new Asterisk community forum at: https://community.asterisk.org/

New to Asterisk? Start here:
  https://wiki.asterisk.org/wiki/display/AST/Getting+Started

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users

[asterisk-users] Is order of channels shown by Function_CHANNELS consistently newest first?

2018-10-26 Thread Jonathan H
After originating a PJSIP call, I need to get the channel for that call, so
I can end it later in a hangup handler.
So I use this:

https://wiki.asterisk.org/wiki/display/AST/Function_CHANNELS

In this bit of dialplan:

same => n,Originate(PJSIP/0203123456@voipfone-205
,exten,bcab-bridge-conference,s,1)
same => n,Verbose(1,***CHANNELS ARE ${CHANNELS()})
same => n,SET(GLOBAL(chan)=${CHANNELS(PJSIP\/voipfone-205-(.*))})

Now, of course, I get more than one channel shown, like this:

***CHAN WE WANT IS PJSIP/voipfone-205-0249 PJSIP/voipfone-205-024c
PJSIP/voipfone-205-024d

Assuming I use CUT to trim out the first in the list, can we ALWAYS be
absolutely sure that the channel just created by Originate is the highest
numbered/first in list?

Otherwise, I'm wondering if there's a reliable way to get the channel
created by originate, when there may be many other active channels on the
system, too.

In case anyone's wondering, I'm using it so that when there is only one
party left in a conference, it'll clear down the newly created external
channel.
For which I need the outgoing name, of course...

same => n,GotoIf($["${CONFBRIDGE_INFO(parties,1234)}" = "1"]?hangchan)
same => n,Return()
same => n(hangchan),SoftHangup(${GLOBAL(chan)})
-- 
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

Astricon is coming up October 9-11!  Signup is available at: 
https://www.asterisk.org/community/astricon-user-conference

Check out the new Asterisk community forum at: https://community.asterisk.org/

New to Asterisk? Start here:
  https://wiki.asterisk.org/wiki/display/AST/Getting+Started

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users

Re: [asterisk-users] How can I connect an existing Confbridge to a new SIP channel when DIALEDPEERNAME is empty?

2018-10-25 Thread Jonathan H
Would really appreciate some help here - into day 4 of trying to bridge a
PJSIP call to an existing confbridge.

There's a fair amount of dialplan and log to show which doesn't really work
well via plain text email, so I've taken it over to the forum at
https://community.asterisk.org/t/bridging-an-existing-conference-to-a-new-call/76806/7

Many thanks in advance.

On Wed, 24 Oct 2018 at 17:17, Jonathan H  wrote:

> Asterisk 16.0, PJSIP
>
> For the first caller to a conference, I want to dial out and bridge that
> conference to a new PJSIP external call.
>
> For the next callers, I just want them to join the local Asterisk
> conference.
>
> After the last caller leaves the conference, I want to hangup the call it
> initiated.
>
> Most of this works, but there are two problems - after the dial string and
> username is done sending, no further audio flows between the Confbridge
> conference and the external call.
>
> Secondly, I understand that I need the name of the "dialling out" channel:
>
> https://wiki.asterisk.org/wiki/display/AST/Pre-Bridge+Handlers
> > This application sets the following channel variables:
> > DIALEDPEERNAME - The name of the outbound channel that answered the call.
>
> But  DIALEDPEERNAME is  empty. Can anyone please suggest where I might be
> going wrong here, and how to complete this? Thank you!
>
> [bcab-dial-zoom]
> exten => s,1,Answer()
> same => n,Dial(PJSIP/0203456789@voipfone-201,,U(bcab-send-dtmf))
>
> [bcab-send-dtmf]
> exten => s,1,Wait(1)
> same => n,Verbose(1,***Dialled channel is ${DIALEDPEERNAME});  just
> gives :**Dialled channel is
> same => n,Set(dialedname=${DIALEDPEERNAME})
> same => n,SendDTMF(WW123456#W#W)
> same => n,Playback(technical-support)
> same => n,SendDTMF(#)
>
> same => n,SET(GOSUB_RESULT=GOTO:bcab-bridge-conference^s^1)
> same => n,Return()
>
> [bcab-bridge-conference]
> exten => s,1,Verbose(1,*** Entered bcab-bridge-conference)
> same => n,Answer()
> same => n,ConfBridge(1234)
> same => n,Wait(55)
> same => n,Hangup()
>
>
-- 
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

Astricon is coming up October 9-11!  Signup is available at: 
https://www.asterisk.org/community/astricon-user-conference

Check out the new Asterisk community forum at: https://community.asterisk.org/

New to Asterisk? Start here:
  https://wiki.asterisk.org/wiki/display/AST/Getting+Started

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users

[asterisk-users] How can I connect an existing Confbridge to a new SIP channel when DIALEDPEERNAME is empty?

2018-10-24 Thread Jonathan H
Asterisk 16.0, PJSIP

For the first caller to a conference, I want to dial out and bridge that
conference to a new PJSIP external call.

For the next callers, I just want them to join the local Asterisk
conference.

After the last caller leaves the conference, I want to hangup the call it
initiated.

Most of this works, but there are two problems - after the dial string and
username is done sending, no further audio flows between the Confbridge
conference and the external call.

Secondly, I understand that I need the name of the "dialling out" channel:

https://wiki.asterisk.org/wiki/display/AST/Pre-Bridge+Handlers
> This application sets the following channel variables:
> DIALEDPEERNAME - The name of the outbound channel that answered the call.

But  DIALEDPEERNAME is  empty. Can anyone please suggest where I might be
going wrong here, and how to complete this? Thank you!

[bcab-dial-zoom]
exten => s,1,Answer()
same => n,Dial(PJSIP/0203456789@voipfone-201,,U(bcab-send-dtmf))

[bcab-send-dtmf]
exten => s,1,Wait(1)
same => n,Verbose(1,***Dialled channel is ${DIALEDPEERNAME});  just
gives :**Dialled channel is
same => n,Set(dialedname=${DIALEDPEERNAME})
same => n,SendDTMF(WW123456#W#W)
same => n,Playback(technical-support)
same => n,SendDTMF(#)

same => n,SET(GOSUB_RESULT=GOTO:bcab-bridge-conference^s^1)
same => n,Return()

[bcab-bridge-conference]
exten => s,1,Verbose(1,*** Entered bcab-bridge-conference)
same => n,Answer()
same => n,ConfBridge(1234)
same => n,Wait(55)
same => n,Hangup()
-- 
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

Astricon is coming up October 9-11!  Signup is available at: 
https://www.asterisk.org/community/astricon-user-conference

Check out the new Asterisk community forum at: https://community.asterisk.org/

New to Asterisk? Start here:
  https://wiki.asterisk.org/wiki/display/AST/Getting+Started

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users

Re: [asterisk-users] After updating to 16 "Some non-required modules failed to load"

2018-10-23 Thread Jonathan H
Thanks Richard - any idea if these matter? And how to stop the errors:

cdr_sqlite3_custom declined to load.
cel_sqlite3_custom declined to load
pbx_ael declined to load

Standard 16.0 build, just updated a 15.4; nothing fiddled with in
menuselect.


On Tue, 23 Oct 2018 at 23:02, Richard Mudgett  wrote:

>
>
> On Tue, Oct 23, 2018 at 1:35 PM Dan Cropp  wrote:
>
>> The res_pjsip_transport_websocket failing to load seems to be a conflict
>> with the chan_sip.so loading.
>>
>> When I make the chan_sip.so not load, res_pjsip_transport_websocket.so
>> does load.
>>
>> We have customers who need chan_sip and chan_pjsip, so we need to load
>> both.  Is there a way to make the res_pjsip_transport_websocket load after
>> the chan_sip?
>>
>
> res_pjsip_transport_websocket.so will fail to load if chan_sip is
> configured to handle
> websockets.  Only one channel driver can provide websocket services at a
> time.
> Either disable support in chan_sip's sip.conf (websocket_enabled = no) or
> don't load
> the res_pjsip_transport_websocket.so module.
>
> From sip.conf.sample:
> ;websocket_enabled = true   ; Set to false to prevent chan_sip from
> listening to websockets.  This
> ; is needed when using chan_sip and
> res_pjsip_transport_websockets on
> ; the same system.
>
> Richard
>
> --
> _
> -- Bandwidth and Colocation Provided by http://www.api-digital.com --
>
> Astricon is coming up October 9-11!  Signup is available at:
> https://www.asterisk.org/community/astricon-user-conference
>
> Check out the new Asterisk community forum at:
> https://community.asterisk.org/
>
> New to Asterisk? Start here:
>   https://wiki.asterisk.org/wiki/display/AST/Getting+Started
>
> asterisk-users mailing list
> To UNSUBSCRIBE or update options visit:
>http://lists.digium.com/mailman/listinfo/asterisk-users
-- 
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

Astricon is coming up October 9-11!  Signup is available at: 
https://www.asterisk.org/community/astricon-user-conference

Check out the new Asterisk community forum at: https://community.asterisk.org/

New to Asterisk? Start here:
  https://wiki.asterisk.org/wiki/display/AST/Getting+Started

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users

Re: [asterisk-users] Struggling to make sense of sending DTMF and why DIAL is trying to make multiple calls?

2018-10-18 Thread Jonathan H
Revisiting this with Asterisk 16 a few months later - I spend a whole
night on this, trying to figure this out.

Would anyone mind looking at this thread on the forum where I've added
more debug info?

https://community.asterisk.org/t/struggling-to-make-sense-of-sending-dtmf-and-why-dial-is-trying-to-make-multiple-calls/75556/2

Many thanks

On Thu, 2 Aug 2018 at 12:44, Jonathan H  wrote:
>
> Hi there; I'm trying to dial into a Zoom conference, send some digits,
> wait, send a name, and be "in the room", as it were.
>
> I thought this would work:
>
> same => 
> n,Dial(PJSIP/02036950088@voipfone-205,12,r(callWaiting)D(WWW12345W#WW::))
>
> But it didn't, so I tried all of these:
>
> same => 
> n,Dial(PJSIP/02036950088@voipfone-205,12,r(callWaiting)D(:WWW12345W#WW:))
> same => 
> n,Dial(PJSIP/02036950088@voipfone-205,12,r(callWaiting)D(::WWW12345W#WW))
> same => 
> n,Dial(PJSIP/02036950088@voipfone-205,12,r(callWaiting)D(WWW12345W#WW:WWW12345W#WW:WWW12345W#WW))
>
> Still nothing. So I thought send_DTMF might work.
>
> Of course, this is too simple, and doesn't work:
>
> [dial-zoom-bcab]
> exten => s,1,Verbose(1,Dialling BCAB Zoom)
> same => 
> n,Dial(PJSIP/02036950088@voipfone-205,,U(dial-zoom-bcab^called_channel^1)))
> same => n,Wait(3)
> same => n,SendDTMF(1234#WWW#WW)
> same => n,Playback(technical-support)
> same => n,SendDTMF(#)
> ;same => n,Wait(15)
> same => n,Hangup()
>
> So I found an example of how to dial, and then send DTMF at
> https://wiki.asterisk.org/wiki/display/AST/Asterisk+15+Application_Dial
>
> [dial-zoom-bcab]
> exten => s,1,Verbose(1,Dialling BCAB Zoom)
> same => 
> n,Dial(PJSIP/02036950088@voipfone-205,,U(dial-zoom-bcab^called_channel^1)))
> same => n,Playback(abandon-all-hope)
> same => n,Hangup()
>
> exten => called_channel,1,Answer()
> same => n,Wait(3)
> same => n,SendDTMF(1234#WWW#WWW)
> same => n,Playback(technical-support)
> same => n,SendDTMF(#)
> ;same => n,Wait(8)
> same => n,Return()
>
> Not only did that not work, but I rapidly got an email alerting me to
> having run out of ITSP credit (fortunately I only keep £2 or so and
> the calls are only 1.2p each).
>
> What I hadn't noticed on the log was that asterisk was making multiple
> simultaneous calls, and even after I had hung up!
>
> Here's my ITSP log for the latest batch. The only way to stop the
> calls was to restart Asterisk. I'm confused (and concerned) as hell as
> to how this happened with that example code above?
>
> Time, ext, number, duration.
> 12:25 205 02036950088 0:14 0.0120 0
> 12:25 205 02036950088 0:16 0.0120 0
> 12:25 205 02036950088 0:18 0.0120 0
> 12:25 205 02036950088 0:20 0.0120 0
> 12:25 205 02036950088 0:21 0.0120 0
> 12:25 205 02036950088 0:23 0.0120 0
> 12:25 205 02036950088 0:25 0.0120 0
> 12:25 205 02036950088 0:27 0.0120 0
> 12:25 205 02036950088 0:29 0.0120 0
> 12:25 205 02036950088 0:31 0.0120 0
> 12:25 205 02036950088 0:33 0.0120 0
> 12:25 205 02036950088 0:35 0.0120 0
> 12:24 205 02036950088 0:37 0.0120 0
> 12:24 205 02036950088 0:39 0.0120 0
> 12:24 205 02036950088 0:40 0.0120 0
> 12:24 205 02036950088 0:42 0.0120 0
> 12:24 205 02036950088 0:44 0.0120 0
> 12:24 205 02036950088 0:46 0.0120 0
> 12:24 205 02036950088 0:48 0.0120 0

-- 
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

Astricon is coming up October 9-11!  Signup is available at: 
https://www.asterisk.org/community/astricon-user-conference

Check out the new Asterisk community forum at: https://community.asterisk.org/

New to Asterisk? Start here:
  https://wiki.asterisk.org/wiki/display/AST/Getting+Started

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users

[asterisk-users] After updating to 16 "Some non-required modules failed to load"

2018-10-18 Thread Jonathan H
I just noticed this upon startup since updating from 15.6.1 to 16.0.0
- do any of these matter?

[Oct 18 12:12:18] WARNING[4489]: loader.c:2228 load_modules: Some
non-required modules failed to load.
[Oct 18 12:12:18] ERROR[4489]: loader.c:2243 load_modules:
res_pjsip_transport_websocket declined to load.
[Oct 18 12:12:18] ERROR[4489]: loader.c:2243 load_modules:
cdr_sqlite3_custom declined to load.
[Oct 18 12:12:18] ERROR[4489]: loader.c:2243 load_modules:
cel_sqlite3_custom declined to load.
[Oct 18 12:12:18] ERROR[4489]: loader.c:2243 load_modules: pbx_ael
declined to load.

I do also notice a fair few of these in the log (note the typo on
"statement", not that it matters unless searching logs)

Oct 18 10:06:58] WARNING[2888] db.c: Couldn't execute statment: SQL logic error
[Oct 18 10:06:58] WARNING[2888] db.c: Couldn't execute statment: SQL logic error
[Oct 18 11:06:58] WARNING[2888] db.c: Couldn't execute statment: SQL logic error
[Oct 18 11:06:58] WARNING[2888] db.c: Couldn't execute statment: SQL logic error


Incidentally, if there are any old modules hanging around from 15.6.1,
you get a segfault.
777:Oct 17 13:03:34 televox-live-2 kernel: [6.056590]
asterisk[718]: segfault at 1 ip 55fc8dbe2689 sp 7fff72499f90
error 4 in asterisk[55fc8da2b000+2ea000]

I have to remove the following before it would start:

format_mp3.so
app_macro.so
cdr_syslog.so
format_jpeg.so

-- 
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

Astricon is coming up October 9-11!  Signup is available at: 
https://www.asterisk.org/community/astricon-user-conference

Check out the new Asterisk community forum at: https://community.asterisk.org/

New to Asterisk? Start here:
  https://wiki.asterisk.org/wiki/display/AST/Getting+Started

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users

[asterisk-users] Connecting an existing conference via PJSIP?

2018-10-17 Thread Jonathan H
Let's say I have a conference room of 8 users. At some point in the
evening, we need to hook up with a Zoom conference.

That means hooking up that existing pool of users to a new PJSIP
channel. An admin would dial in, enter a pin, and initiate that
connection.

Sounds really simple, but I've read:

https://wiki.asterisk.org/wiki/display/AST/ConfBridge
https://wiki.asterisk.org/wiki/display/AST/Asterisk+16+Application_ConfBridge
https://wiki.asterisk.org/wiki/display/AST/Asterisk+16+Configuration_app_confbridge
https://wiki.asterisk.org/wiki/display/AST/Asterisk+16+Function_CONFBRIDGE
https://wiki.asterisk.org/wiki/display/AST/Asterisk+16+Function_CONFBRIDGE_INFO

Perhaps I'm not seeing the wood for the trees, but I'm not figuring it out.

I think I need to set a variable when the admin dials the pin, and
then within that variable, write the name of the new PJSIP channel
which the admin caused to happen.

And then join the existing channel into the conference. That's the bit
I can't figure out.

Thanks.

Oh, and finally, when dialling the Zoom channel, I think I need to use
https://wiki.asterisk.org/wiki/display/AST/Asterisk+16+Function_PJSIP_DTMF_MODE
to "PJSIP_DTMF_MODE(inband)"
because in PJSIP wizard, I've set "endpoint/dtmf_mode=rfc4733"
otherwise it doesn't work with everything else.
And of course, Zoom needs audible touchtone digits.


(Before anyone says "Why not use Zoom Sip Connector" - well, £39 per
month for the SIP connector, or 3*10 minutes at 1p/minute (ie:30p) per
month via PSTN is why!

-- 
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

Astricon is coming up October 9-11!  Signup is available at: 
https://www.asterisk.org/community/astricon-user-conference

Check out the new Asterisk community forum at: https://community.asterisk.org/

New to Asterisk? Start here:
  https://wiki.asterisk.org/wiki/display/AST/Getting+Started

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users

Re: [asterisk-users] Spontaneous reboot due to MySQL lookups ?

2018-10-12 Thread Jonathan H
Or better still, skip straight to the current LTS version 16 which was
release a few days ago, supported right through until 10-2023!

If you're going to do a big upgrade, might as well leap onto the
current release :)

https://wiki.asterisk.org/wiki/display/AST/Asterisk+Versions
On Fri, 12 Oct 2018 at 09:40, Jonas Kellens  wrote:
>
> Hello
>
> thank you for your answer.
>
> This does not happen all the time. It happens about once every 4 months. I 
> just can not pinpoint WHEN exactly it occurs. I just see in the verbose 
> logfile that it occurs after a MYSQL insert/update/delete statement.
>
> If Asterisk 13 handels MYSQL connections in a better way, then indeed I 
> should look for upgrade.
>
>
>
> Kind regards.
>
>
>
> Op 05-10-18 om 01:25 schreef John Novack:
>
> As others have said, clearly it ISN'T "just working" or you would not have 
> posted the question
>
> To state again, I am using Version 13, though a few minor revisions behind, 
> with MySql, on CentOS 6 and have no rebooting or other MySql related issues
>
> Clearly you need to state in more detail what issues remain, once you migrate 
> to AT LEAST 13.xx, and state your OS after becoming current with Asterisk, 
> MySql and the OS
>
> I use MySql on every incoming call, and also maintain call detail records in 
> MySql for every call, and it just simply works, and has for some time.
>
> Although I may be using it quite differently that you, it simply works.
> Is this a newly developing issue, or has it persisted for some time
> What if any changes have been made to the dialplan etc?
>
> Have you considered a strictly hardware issue? Memory? HD? MB??
>
> The crystal ball is very cloudy on this one!
>
> John Novack
>
>
> Jonas Kellens wrote:
>
> Hello
>
> thank you for your answer.
>
> If I read your (and others) reaction correctly I can conclude that this is an 
> Asterisk problem and not a problem of MySQL or dialplan logic ?
>
>
> You should know that the MySQL database is heavily questioned :
>
>
> mysql> show status like '%onn%';
> +--++
> | Variable_name| Value  |
> +--++
> | Aborted_connects | 469|
> | Connections  | 132762 |
> | Max_used_connections | 8  |
> | Ssl_client_connects  | 0  |
> | Ssl_connect_renegotiates | 0  |
> | Ssl_finished_connects| 0  |
> | Threads_connected| 3  |
> +--++
> 7 rows in set (0.00 sec)
>
>
>
> I stick to 1.8 because it just works. I had some issues with version 11 and 
> 13 in the past.
>
>
> Regards
>
> Jonas.
>
>
> Op 04-10-18 om 17:49 schreef John Novack:
>
> Woefully out of date.
> You really need to put your efforts into at least a modest upgrade
> I use version 13 with MySql queries built into the dialplan on CentOs 6 and 
> have NO such issues, either performance or any restart or reboot. It simply 
> works
>
> I never used either 1.6 or 1.8, going from 1.4 to version 11, which did 
> require some syntax changes to the dialplan.
>
> Given that even version 11 is EOL, you really need to put your efforts into 
> doing the migration rather than tracking this one down
>
> JMO
>
> John Novack
>
>
>
> Jonas Kellens wrote:
>
> Hello
>
> using Asterisk 1.8.32.
>
> I notice that there is a spontaneous reboot of the Asterisk system from time 
> to time.
>
> When I look in the logs (verbose file) I noticed that every time this occurs 
> it's at a moment that there is a MySQL action, be it a lookup or an 
> insert/update/delete.
>
> I must say I do have some MySQL queries that occur in my dialplan when a call 
> comes in, to look up different actions to perform on this call.
>
>
> An idea how to overcome this problem ? Seems a "performance" issue, no ?!
>
> Is it better to have these MySQL queries to be done by an external script 
> (like a php script that I call with the System()-command or a 
> SHELL()-command) ?
>
>
> Here are some examples from the verbose file.
>
>
>
> [Aug 22 15:19:10] VERBOSE[2977] pbx.c: [Aug 22 15:19:10] -- Executing 
> [s@sub-GetAlertInfo:3] MYSQL("SIP/SipAgenT01-317d", "Connect connid 
> localhost myuser mypwd myDB") in new stack
> [Aug 22 15:19:10] VERBOSE[2977] pbx.c: [Aug 22 15:19:10] -- Executing 
> [s@sub-GetAlertInfo:5] MYSQL("SIP/SipAgenT01-317d", "Query resultid 1 
> SELECT uri, callinfo FROM distringtone WHERE onoff='1'") in new stack
> [Aug 22 15:19:18] VERBOSE[3306] config.c: [Aug 22 15:19:18]   == Parsing 
> '/etc/asterisk/logger.conf': [Aug 22 15:19:18] VERBOSE[3306] config.c: [Aug 
> 22 15:19:18]   == Found
> [Aug 22 15:19:18] VERBOSE[3306] config.c: [Aug 22 15:19:18]   == Parsing 
> '/etc/asterisk/asterisk.conf': [Aug 22 15:19:18] VERBOSE[3306] config.c: [Aug 
> 22 15:19:18]   == Found
> [Aug 22 15:19:18] VERBOSE[3306] manager.c: [Aug 22 15:19:18]   == Manager 
> registered action DataGet
> [Aug 22 15:19:18] VERBOSE[3306] config.c: [Aug 22 15:19:18]   == Parsing 
> 

[asterisk-users] What's the best way of extracting call data which has been written to flat files?

2018-10-11 Thread Jonathan H
I'm dealing with a blind charity phone information system which writes
its logs to two flat csv files
(Although the log COULD actually now be written to dynamoDB or
sqlite3, too if needed).

The first file contains basic call information, one line per call and
a unique call ID (distinct from "caller ID"!)
The second file relates the call ID to more information about what
happened during that call.

I'd really just like to extract info like: What was the most popular
caller region? Time of day? Item in the menu?
What did people listen to most or skip or hang up during? What
percentage were mobiles?

The information is all there, but I have NO idea how to extract it,
nor the skills to do so myself without a steer in the right direction.

So my question is really: What now? I've written this, and some
example log entries, to

https://gist.github.com/lardconcepts/c3595db7a8bae54110f36dcbdd0c8c2c

If I don't get any luck here, I'll try asterisk-biz later.
Alternatively, where to find help?
PeoplePerHour? Or some other web-worker site? What should I look to
pay? What is this kind of data-wrangling even called?

Basically, I'm hoping that either someone will know of something that
exists already which is very cost-effective and I could learn in a day
or two.
Or, know of someone who could write something for me, for a reasonable amount.

I have an idea that the answer lies in something like Dynamo/MongoDB,
but need some pointers.

(But what's not going to be possible is someone offering to do it for
"just" 4 days at $1200 per day plus tax!)

Thanks.

-- 
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

Astricon is coming up October 9-11!  Signup is available at: 
https://www.asterisk.org/community/astricon-user-conference

Check out the new Asterisk community forum at: https://community.asterisk.org/

New to Asterisk? Start here:
  https://wiki.asterisk.org/wiki/display/AST/Getting+Started

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users

Re: [asterisk-users] Spontaneous reboot due to MySQL lookups ?

2018-10-04 Thread Jonathan H
On Thu, 4 Oct 2018 at 20:36, Jonas Kellens  wrote:

> I stick to 1.8 because it just works.

Well, clearly it doesn't because you're posting here! In a few days time,
the *8-year-old* Asterisk 1.8 line will be *three years past EOL.*
That means End of Life. Do not use. No more support.

Now, if you were to bring yourself onto the current 13.x LTS (or perhaps
better still wait a few days until the 16.x LTS which will be supported
until 2023), then you might get more answers.

> I had some issues with version 11 and 13 in the past.

Especially if you explain what issues you had with version 13 in the past.
-- 
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

Astricon is coming up October 9-11!  Signup is available at: 
https://www.asterisk.org/community/astricon-user-conference

Check out the new Asterisk community forum at: https://community.asterisk.org/

New to Asterisk? Start here:
  https://wiki.asterisk.org/wiki/display/AST/Getting+Started

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users

[asterisk-users] Struggling to make sense of sending DTMF and why DIAL is trying to make multiple calls?

2018-08-02 Thread Jonathan H
Hi there; I'm trying to dial into a Zoom conference, send some digits,
wait, send a name, and be "in the room", as it were.

I thought this would work:

same => 
n,Dial(PJSIP/02036950088@voipfone-205,12,r(callWaiting)D(WWW12345W#WW::))

But it didn't, so I tried all of these:

same => 
n,Dial(PJSIP/02036950088@voipfone-205,12,r(callWaiting)D(:WWW12345W#WW:))
same => 
n,Dial(PJSIP/02036950088@voipfone-205,12,r(callWaiting)D(::WWW12345W#WW))
same => 
n,Dial(PJSIP/02036950088@voipfone-205,12,r(callWaiting)D(WWW12345W#WW:WWW12345W#WW:WWW12345W#WW))

Still nothing. So I thought send_DTMF might work.

Of course, this is too simple, and doesn't work:

[dial-zoom-bcab]
exten => s,1,Verbose(1,Dialling BCAB Zoom)
same => 
n,Dial(PJSIP/02036950088@voipfone-205,,U(dial-zoom-bcab^called_channel^1)))
same => n,Wait(3)
same => n,SendDTMF(1234#WWW#WW)
same => n,Playback(technical-support)
same => n,SendDTMF(#)
;same => n,Wait(15)
same => n,Hangup()

So I found an example of how to dial, and then send DTMF at
https://wiki.asterisk.org/wiki/display/AST/Asterisk+15+Application_Dial

[dial-zoom-bcab]
exten => s,1,Verbose(1,Dialling BCAB Zoom)
same => 
n,Dial(PJSIP/02036950088@voipfone-205,,U(dial-zoom-bcab^called_channel^1)))
same => n,Playback(abandon-all-hope)
same => n,Hangup()

exten => called_channel,1,Answer()
same => n,Wait(3)
same => n,SendDTMF(1234#WWW#WWW)
same => n,Playback(technical-support)
same => n,SendDTMF(#)
;same => n,Wait(8)
same => n,Return()

Not only did that not work, but I rapidly got an email alerting me to
having run out of ITSP credit (fortunately I only keep £2 or so and
the calls are only 1.2p each).

What I hadn't noticed on the log was that asterisk was making multiple
simultaneous calls, and even after I had hung up!

Here's my ITSP log for the latest batch. The only way to stop the
calls was to restart Asterisk. I'm confused (and concerned) as hell as
to how this happened with that example code above?

Time, ext, number, duration.
12:25 205 02036950088 0:14 0.0120 0
12:25 205 02036950088 0:16 0.0120 0
12:25 205 02036950088 0:18 0.0120 0
12:25 205 02036950088 0:20 0.0120 0
12:25 205 02036950088 0:21 0.0120 0
12:25 205 02036950088 0:23 0.0120 0
12:25 205 02036950088 0:25 0.0120 0
12:25 205 02036950088 0:27 0.0120 0
12:25 205 02036950088 0:29 0.0120 0
12:25 205 02036950088 0:31 0.0120 0
12:25 205 02036950088 0:33 0.0120 0
12:25 205 02036950088 0:35 0.0120 0
12:24 205 02036950088 0:37 0.0120 0
12:24 205 02036950088 0:39 0.0120 0
12:24 205 02036950088 0:40 0.0120 0
12:24 205 02036950088 0:42 0.0120 0
12:24 205 02036950088 0:44 0.0120 0
12:24 205 02036950088 0:46 0.0120 0
12:24 205 02036950088 0:48 0.0120 0

-- 
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

Check out the new Asterisk community forum at: https://community.asterisk.org/

New to Asterisk? Start here:
  https://wiki.asterisk.org/wiki/display/AST/Getting+Started

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users

Re: [asterisk-users] dialplan reload not showing debug info even with debug on (ast 15.5)

2018-07-29 Thread Jonathan H
OK, many thanks for that. Not sure I see the point of the change, but
at least I can get the info back by changing

console => notice,warning,error
to
console => notice,warning,error,debug

That said, dialplan reload seems to show significantly fewer items
than before. I've got loads of extensions, and it does indeed seem to
reload them all, but only shows about 1/4 of them in the console when
doing dialplan reload. Hmmm...

Incidentally, just while I'm here, is there a particular reason that
debug can only every be pushed higher when connecting to the console?
it's always been the case since I started using Asterisk 3 years ago
so I guess there's a reason, and I never questioned it before. I'm
just curious!
For example:


asterisk -rvddd
Core debug was 2 and is now 3.

asterisk -rv
Core debug was 3 and is now 4.

asterisk -rvdd
Core debug is still 4.

asterisk -rvd
Core debug is still 4.

But it always respects "core set debug" in whichever direction of
verbosity is required.

Thanks again!
On Sun, 29 Jul 2018 at 13:14, Richard Mudgett  wrote:
>
>
>
> On Sat, Jul 28, 2018 at 1:10 PM, Jonathan H  wrote:
>>
>> I've not needed to do a dialplan reload for a while, so I don't know
>> exactly which version is stopped working, but on 15.5, I'm not seeing
>> ANY debug info at any debug level.
>> So I'm not really sure how to find mistakes in the dialplan.  This is
>> all I get... how do I enable this debug mode to see the previous
>> behaviour? Thanks
>>
>> asterisk -rvd
>> (enters console)
>> dialplan reload
>> Dialplan reloaded.
>> [...]
>> -- pbx_config successfully loaded 125 contexts (enable debug for 
>> details).
>
>
> Many of those messages now go out as DEBUG level 1 messages.  You would
> need to enable those to go out to your console in logger.conf if they aren't 
> enabled.
> Or you need to look at one of the logging files (like full) that has debug 
> messages
> routed to it.
>
> https://issues.asterisk.org/jira/browse/ASTERISK-27084 is the issue that did 
> that
> which went out in v15.3.0 and is mentioned in the CHANGES file:
>
> Core
> --
>  * During dialplan reload log messages are produced for each context,
>extension and include.  These messages are no longer printed by the
>verbose loggers, they are now only logged as debug messages.
>
>
> Richard
> --
> _
> -- Bandwidth and Colocation Provided by http://www.api-digital.com --
>
> Check out the new Asterisk community forum at: https://community.asterisk.org/
>
> New to Asterisk? Start here:
>   https://wiki.asterisk.org/wiki/display/AST/Getting+Started
>
> asterisk-users mailing list
> To UNSUBSCRIBE or update options visit:
>http://lists.digium.com/mailman/listinfo/asterisk-users

-- 
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

Check out the new Asterisk community forum at: https://community.asterisk.org/

New to Asterisk? Start here:
  https://wiki.asterisk.org/wiki/display/AST/Getting+Started

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users

Re: [asterisk-users] Any way of "flattening out" 2 channels back into one?

2018-07-28 Thread Jonathan H
Oh... I looked at that before, but I don't see how to play a warning
before the caller is disconnected with TIMEOUT?
On Sat, 28 Jul 2018 at 23:05, Social Boh  wrote:
>
> TIMEOUT function:
>
> example
>
> same => n,Set(TIMEOUT(absolute)=600)
>
> after 600 seconds Asterisk Hankup the call
>
> Regards
>
> ---
> I'm SoCIaL, MayBe
>
> On 7/28/18 16:08, Jonathan H wrote:
> > Last question for today, I promise!
> >
> > The problem: In order to disconnect calls after x minutes, I need to do 
> > this:
> >
> > [setup]
> > exten => setup,1,Answer()
> >  same => n,Set(LIMIT_PLAYAUDIO_CALLER=yes)
> >  same => 
> > n,Set(LIMIT_WARNING_FILE=/var/lib/asterisk/sounds/en_GB_TNS/time_limit_reached)
> >  same => n,Dial(Local/s@root/n,3,L(354:6))
> >  same => n,Hangup()
> >
> > [root]
> > exten => s,1,Verbose(1,Call to: ${CALLERID(name)} from: ${CALLERID(num)})
> > same => n,Set(CHANNEL(hangup_handler_push)=hdlr1,s,1)
> >
> > etc etc
> >
> > Works well, but the result is it looks like there are 2 active calls
> > in the console. Is there any way of forcing the drop of a call after x
> > minutes without doing this "double dialling" business?
> >
> > Thanks
> >
>
>
> --
> _
> -- Bandwidth and Colocation Provided by http://www.api-digital.com --
>
> Check out the new Asterisk community forum at: https://community.asterisk.org/
>
> New to Asterisk? Start here:
>   https://wiki.asterisk.org/wiki/display/AST/Getting+Started
>
> asterisk-users mailing list
> To UNSUBSCRIBE or update options visit:
>http://lists.digium.com/mailman/listinfo/asterisk-users

-- 
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

Check out the new Asterisk community forum at: https://community.asterisk.org/

New to Asterisk? Start here:
  https://wiki.asterisk.org/wiki/display/AST/Getting+Started

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users

Re: [asterisk-users] SRV with pjsip on Asterisk 15.5: yes or no?

2018-07-28 Thread Jonathan H
OK, thanks. Shall I file a ticket to get that example file updated?

On Sat, 28 Jul 2018 at 21:50, Joshua Colp  wrote:
>
> On Sat, Jul 28, 2018, at 5:42 PM, Jonathan H wrote:
> > I'm trying to configure sip2sip, which says:
> > http://wiki.sip2sip.info/projects/sip2sip/wiki/SipDevicesAsterisk
> > "Asterisk, is currently unable to handle more that one result for a
> > DNS SRV lookup, and the Asterisk configuration needed for getting it
> > work with the SIP2SIP service is not trivial"
> >
> > It then gives a complex multi-section workaround in SIP. I remember
> > reading there'd be the same issue with PJSIP, and then I found this
> > post in the Asterisk blog from 2016:
> > https://blogs.asterisk.org/2016/04/20/pjsip-dns-support/ which says:
> > "chan_pjsip will now look for SRV records based on what transports are
> > configured on the system".
> >
> > Does this mean there's now a way of doing it? Because
> > https://github.com/asterisk/asterisk/blob/master/configs/samples/pjsip_wizard.conf.sample
> > says:
> > ; Hostnames must resolve to A,  or CNAME records.
> > ; SRV records are not currently supported.
> >
> > H... I'm confused!
>
> SRV support for inbound matching was added after that comment was written. 
> Identifying by IP address resolve a hostname down to all addresses (including 
> SRV) - not just a single one.
>
> Outgoing supports A, , SRV, and NAPTR automatically.
>
> --
> Joshua Colp
> Digium, Inc. | Senior Software Developer
> 445 Jan Davis Drive NW - Huntsville, AL 35806 - US
> Check us out at: www.digium.com & www.asterisk.org
>
> --
> _
> -- Bandwidth and Colocation Provided by http://www.api-digital.com --
>
> Check out the new Asterisk community forum at: https://community.asterisk.org/
>
> New to Asterisk? Start here:
>   https://wiki.asterisk.org/wiki/display/AST/Getting+Started
>
> asterisk-users mailing list
> To UNSUBSCRIBE or update options visit:
>http://lists.digium.com/mailman/listinfo/asterisk-users

-- 
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

Check out the new Asterisk community forum at: https://community.asterisk.org/

New to Asterisk? Start here:
  https://wiki.asterisk.org/wiki/display/AST/Getting+Started

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users

Re: [asterisk-users] Can someone please help with this sip2sip pjsip_wizard "no matching endpoint" issue?

2018-07-28 Thread Jonathan H
Thanks, but... whoah! I think I just found a bug!

As soon as I changed
accepts_registrations = yes
to
sends_registrations = yes

and did a pjsip reload, Asterisk crashed. I tried starting asterisk.
Nothing. In the syslog:

Jul 28 22:20:41 televox kernel: [   50.728769] asterisk[1504]:
segfault at 0 ip 7f4be3e00646 sp 7ffc32067388 error 4 in
libc-2.27.so[7f4be3d4f000+1e7000]
Jul 28 22:22:02 televox kernel: [  132.413114] asterisk[1579]:
segfault at 0 ip 7f62a9ba2646 sp 7ffc9215d408 error 4 in
libc-2.27.so[7f62a9af1000+1e7000]

Took that line back out, and Asterisk started again. Shall I file a bug?
On Sat, 28 Jul 2018 at 21:55, Joshua Colp  wrote:
>
>
>
> On Sat, Jul 28, 2018, at 3:06 PM, Jonathan H wrote:
> > Using pjsip 2.7.2 on Asterisk 15.5
> > Really struggling to make sense of translating these old 1.8 SIP
> > instructions into a neat pjsip_wizard conf suitable for 2018
> > http://wiki.sip2sip.info/projects/sip2sip/wiki/SipDevicesAsterisk#Version-18
> >
> > In pjsip_wizard.conf, I have the following, which seems to get me
> > registered, and it responds to an incoming call, but I always get
> > this:
> >
> > [Jul 28 18:32:29] NOTICE[22492]: res_pjsip/pjsip_distributor.c:659
> > log_failed_request: Request 'INVITE' from '"demo"
> > ' failed for 'x.x.x.x:5060' (callid:
> > 5fa139428fef42d9bd0cd4063e10b047) - No matching endpoint found
> >
> > here's what I have in pjsip_wizard.conf
> >
> > [sip2sip]
> > type = wizard
> > sends_auth = yes
> > accepts_registrations = yes
> > transport = simpletrans
> > outound_auth/username = myusern...@sip2sip.info
> > outound_auth/password = password
> > remote_hosts = 81.23.228.129,85.17.186.7,81.23.228.150,sip2sip.info
> > endpoint/allow = alaw
> > endpoint/context = fromsip2sip
> > aor/max_contacts = 3
> > registration/contact_user = myusername
> > outbound_proxy = proxy.sipthor.net
> > endpoint/language=en_GB
>
> This is an ITSP trunk, you've configured it kind of as if it were a phone.  
> Instead of "accepts_registrations" you likely want "sends_registrations". 
> Asterisk needs to register to them.
>
> --
> Joshua Colp
> Digium, Inc. | Senior Software Developer
> 445 Jan Davis Drive NW - Huntsville, AL 35806 - US
> Check us out at: www.digium.com & www.asterisk.org
>
> --
> _
> -- Bandwidth and Colocation Provided by http://www.api-digital.com --
>
> Check out the new Asterisk community forum at: https://community.asterisk.org/
>
> New to Asterisk? Start here:
>   https://wiki.asterisk.org/wiki/display/AST/Getting+Started
>
> asterisk-users mailing list
> To UNSUBSCRIBE or update options visit:
>http://lists.digium.com/mailman/listinfo/asterisk-users

-- 
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

Check out the new Asterisk community forum at: https://community.asterisk.org/

New to Asterisk? Start here:
  https://wiki.asterisk.org/wiki/display/AST/Getting+Started

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users

[asterisk-users] Any way of "flattening out" 2 channels back into one?

2018-07-28 Thread Jonathan H
Last question for today, I promise!

The problem: In order to disconnect calls after x minutes, I need to do this:

[setup]
exten => setup,1,Answer()
same => n,Set(LIMIT_PLAYAUDIO_CALLER=yes)
same => 
n,Set(LIMIT_WARNING_FILE=/var/lib/asterisk/sounds/en_GB_TNS/time_limit_reached)
same => n,Dial(Local/s@root/n,3,L(354:6))
same => n,Hangup()

[root]
exten => s,1,Verbose(1,Call to: ${CALLERID(name)} from: ${CALLERID(num)})
same => n,Set(CHANNEL(hangup_handler_push)=hdlr1,s,1)

etc etc

Works well, but the result is it looks like there are 2 active calls
in the console. Is there any way of forcing the drop of a call after x
minutes without doing this "double dialling" business?

Thanks

-- 
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

Check out the new Asterisk community forum at: https://community.asterisk.org/

New to Asterisk? Start here:
  https://wiki.asterisk.org/wiki/display/AST/Getting+Started

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users

[asterisk-users] SRV with pjsip on Asterisk 15.5: yes or no?

2018-07-28 Thread Jonathan H
I'm trying to configure sip2sip, which says:
http://wiki.sip2sip.info/projects/sip2sip/wiki/SipDevicesAsterisk
"Asterisk, is currently unable to handle more that one result for a
DNS SRV lookup, and the Asterisk configuration needed for getting it
work with the SIP2SIP service is not trivial"

It then gives a complex multi-section workaround in SIP. I remember
reading there'd be the same issue with PJSIP, and then I found this
post in the Asterisk blog from 2016:
https://blogs.asterisk.org/2016/04/20/pjsip-dns-support/ which says:
"chan_pjsip will now look for SRV records based on what transports are
configured on the system".

Does this mean there's now a way of doing it? Because
https://github.com/asterisk/asterisk/blob/master/configs/samples/pjsip_wizard.conf.sample
says:
; Hostnames must resolve to A,  or CNAME records.
; SRV records are not currently supported.

H... I'm confused!

-- 
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

Check out the new Asterisk community forum at: https://community.asterisk.org/

New to Asterisk? Start here:
  https://wiki.asterisk.org/wiki/display/AST/Getting+Started

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users

[asterisk-users] dialplan reload not showing debug info even with debug on (ast 15.5)

2018-07-28 Thread Jonathan H
I've not needed to do a dialplan reload for a while, so I don't know
exactly which version is stopped working, but on 15.5, I'm not seeing
ANY debug info at any debug level.
So I'm not really sure how to find mistakes in the dialplan.  This is
all I get... how do I enable this debug mode to see the previous
behaviour? Thanks

asterisk -rvd
(enters console)
dialplan reload
Dialplan reloaded.
[...]
-- pbx_config successfully loaded 125 contexts (enable debug for details).

-- 
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

Check out the new Asterisk community forum at: https://community.asterisk.org/

New to Asterisk? Start here:
  https://wiki.asterisk.org/wiki/display/AST/Getting+Started

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users

[asterisk-users] Can someone please help with this sip2sip pjsip_wizard "no matching endpoint" issue?

2018-07-28 Thread Jonathan H
Using pjsip 2.7.2 on Asterisk 15.5
Really struggling to make sense of translating these old 1.8 SIP
instructions into a neat pjsip_wizard conf suitable for 2018
http://wiki.sip2sip.info/projects/sip2sip/wiki/SipDevicesAsterisk#Version-18

In pjsip_wizard.conf, I have the following, which seems to get me
registered, and it responds to an incoming call, but I always get
this:

[Jul 28 18:32:29] NOTICE[22492]: res_pjsip/pjsip_distributor.c:659
log_failed_request: Request 'INVITE' from '"demo"
' failed for 'x.x.x.x:5060' (callid:
5fa139428fef42d9bd0cd4063e10b047) - No matching endpoint found

here's what I have in pjsip_wizard.conf

[sip2sip]
type = wizard
sends_auth = yes
accepts_registrations = yes
transport = simpletrans
outound_auth/username = myusern...@sip2sip.info
outound_auth/password = password
remote_hosts = 81.23.228.129,85.17.186.7,81.23.228.150,sip2sip.info
endpoint/allow = alaw
endpoint/context = fromsip2sip
aor/max_contacts = 3
registration/contact_user = myusername
outbound_proxy = proxy.sipthor.net
endpoint/language=en_GB

in pjsip.conf

[simpletrans]
type = transport
protocol = UDP
bind = 0.0.0.0

[acl]
type = acl
deny = 0.0.0.0/0.0.0.0
   ; next 3 are for sip2sip
   permit = 81.23.228.129
   permit = 85.17.186.7
   permit = 81.23.228.150

in extensions.conf, I've got a bit OTT and covered every possible base
to match an endpoint! Every single item in the "to" or "from" header
is accounted for somewhere, so why can't it find this endpoint?
Would be really grateful. Thanks.

extensions.conf

[fromsip2sip]
exten => _.,1,Verbose(answered)

[myusername]
exten => _.,1,Verbose(answered)

[myusern...@sip2sip.info]
exten => _.,1,Verbose(answered)

[demo]
exten => _.,1,Verbose(answered)

-- 
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

Check out the new Asterisk community forum at: https://community.asterisk.org/

New to Asterisk? Start here:
  https://wiki.asterisk.org/wiki/display/AST/Getting+Started

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users

Re: [asterisk-users] G729

2018-07-26 Thread Jonathan H
Hmmm, again, this conversation has just faded out. I wondered why no
response from Digium?

So I found this discussion -
https://community.asterisk.org/t/why-does-g729-still-require-licensing/71920/8
- seems very clear that G729 is patent free, but still no response from
Digium.

Also, the link to the "definitely royalty free" version was removed.

Don't get me wrong, I'm sure there must be a valid reason.

And I'm not at all against Digium making money. But this whole 729 thing is
a mystery without any official feedback...



On Mon, 23 Jul 2018 at 05:37, Dmitry Melekhov  wrote:

> 20.07.2018 23:35, John Kiniston пишет:
>
>
> On Fri, Jul 20, 2018 at 11:41 AM Saint Michael  wrote:
>
>> ​The community would benefit if a non/licensed version of G729 would be
>>> included with Asterisk​, since the license expired. The current codec
>>> source code posted still requires licensing.
>>>
>> ​I am sure Digium would not prefer to ​
>>
>> ​acknowledge this, but the phenomenal growth of Asterisk is due to the
>> a​availability of a free G729 codec compiled and distributed free by Arkadi
>> Shislov.
>>
>> That'd be a surprise to me with the 325 G.729 licenses I have from Digium.
>
> I'm not a software pirate, I doubt that most telephony providers are
> either.
>
>
> Once again- patent is expired, g729 algorithm is now free.
> You spent you money to wrong place :-)
>
>
>
> --
> _
> -- Bandwidth and Colocation Provided by http://www.api-digital.com --
>
> Check out the new Asterisk community forum at:
> https://community.asterisk.org/
>
> New to Asterisk? Start here:
>   https://wiki.asterisk.org/wiki/display/AST/Getting+Started
>
> asterisk-users mailing list
> To UNSUBSCRIBE or update options visit:
>http://lists.digium.com/mailman/listinfo/asterisk-users
-- 
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

Check out the new Asterisk community forum at: https://community.asterisk.org/

New to Asterisk? Start here:
  https://wiki.asterisk.org/wiki/display/AST/Getting+Started

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users

[asterisk-users] TALK_DETECT - having trouble figuring it out.

2018-02-23 Thread Jonathan H
Is there a bit more of a detailed explanation of TALK_DETECT anywhere?

I googled and found nothing really beyond the wiki at
https://wiki.asterisk.org/wiki/display/AST/Asterisk+15+Function_TALK_DETECT

I really only want it to listen for one side (the caller) but it seems to
listen to both. OK, I can work round that, but the other thing is, it seems
to be ignoring my threshold values

using Set(TALK_DETECT(set)=silence_ms,noise_ms)

like

Set(TALK_DETECT(set)=120,1200)

then even though it shouldn't even respond to "hello" (under a second), it
even detects with a click of the fingers, which is definitely not 1200ms.

I really only want it to respond to "Asterisk?" but ... struggling a bit.

In case there's a better way, what I'm trying to do is CONTROLPLAYBACK a
file, but also listen for someone saying what you might call a wake word,
but not via MRCP or anything like that.
-- 
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

Check out the new Asterisk community forum at: https://community.asterisk.org/

New to Asterisk? Start here:
  https://wiki.asterisk.org/wiki/display/AST/Getting+Started

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users

Re: [asterisk-users] What does pct mean?

2018-02-13 Thread Jonathan H
Um, I may be missing something here, but if it was "percent", wouldn't it
simply be the internationally recognised symbol for percent, the, um,
percent symbol? %

That's why I don't think it can be percent.

On 13 February 2018 at 18:32, Eric Wieling  wrote:

> Could this gap in sequence numbers caused by a codec change generate
> errors like the one below?
>
> [2018-02-13 12:57:43] WARNING[4917][C-0004c2cb] codec_sangoma.c:
> [526559][g722toulaw] Got Seq 15944 but expecting 10106 (time since last
> read = 0ms), dropped 5838 packets
>
>
> On 02/13/2018 01:24 PM, Andres wrote:
>
>> On 2/13/18 11:55 AM, Michael Maier wrote:
>>
>>> On 02/13/2018 at 08:41 AM Floimair Florian wrote:
>>>
 No you're reading it wrong.

 There are 188K received with no loss, and 16441K transmitted.

>>> This doesn't make any sense to me, either. There can't be more packages
>>> transmitted than received. It's the same codec in and out and it's been
>>> running exactly the same time.
>>>
>> Lost and Percent (pct) are not calculated by counting packets. Those are
>> calculated from the sequence numbers in the RTP frame.
>>
>> For example let's say you start the receiver (Asterisk) at Sequence
>> #1then something happens and it jumps to sequence #5000.  The audio
>> might be fine, but now the stats say 4998 packets were lost. Why is there a
>> bizarre sequence jump?  Hard to say.  I have seen it because of bugs that
>> eventually get fixed on the CPE, or even when there is a change of codec
>> (or re-invite) mid-call.  I would not worry too much about this unless you
>> can reproduce it and can address it properly at the CPE level.  A packet
>> capture will clearly confirm what I am referring to here. Just look at
>> every Sequence # in the RTP flow and you will see the jump.
>>
>>>
>>> ...Receive. .Transmit..
 CountLost Pct  Jitter   CountLost PctJitter RTT
 188K  00   0.000188K   16641K 8809   0.000   0.026

>>>
>>> There are 188K received and 188K transmitted. Pct is unknown - what's
>>> Pct?
>>>
>>>
>>> Still 8809 does not sound like a percentage to me  so there is
 something wrong with either the label or the value.
  From what's in the code, you can see it's clearly a lost Packet count
 not a percentage.
 So I guess Pct in this case is short for "Packet".

 With best regards

 Florian Floimair
 Innovation - Software-Development

 COMMEND INTERNATIONAL GMBH
 http://www.commend.com

 Security and Communication by Commend

 FN 178618z | LG Salzburg

 -Ursprüngliche Nachricht-
 Von: asterisk-users-boun...@lists.digium.com [mailto:
 asterisk-users-boun...@lists.digium.com] Im Auftrag von Michael Maier
 Gesendet: Montag, 12. Februar 2018 17:46
 An: asterisk-users@lists.digium.com
 Betreff: Re: [asterisk-users] What does pct mean?

 Hi Carsten,

 On 02/11/2018 at 07:46 PM Carsten Bock wrote:

> Hi,
>
> Lost percent (%)
>
 Are you sure? I'm seeing here:

 ...Receive. .Transmit..
 CountLost Pct  Jitter   CountLost PctJitter RTT
 188K  00   0.000188K   16641K 8809   0.000   0.026

 => This doesn't sound reliable to me: there are 188K packets and 16641K
 of them are lost?! The Pct value is fluctuating between about 6009 and 
 9009.

 Thanks,
 Michael



> Am 11.02.2018 19:27 schrieb "Michael Maier" :
>
> Hello,
>>
>> could somebody please tell me the meaning of "Pct" as seen in
>> asterisk cli:
>>
>> ...Receive. .Transmit..
>> CountLost Pct  Jitter   CountLost Pct  Jitter RTT
>>
>>
>> Thanks,
>> Michael
>>
> --
 _
 -- Bandwidth and Colocation Provided by https://linkprotect.cudasvc.co
 m/url?a=http://www.api-digital.com=E,1,uxGzivqW6oZ241hxc5A
 3oz1rZf6JLog-Gi4ziwN-95NzbE_HEndRkD8LLLem_gvmmxd5k_T95J2jepi
 t1IpIkZ2AxkG4RSoADT-AMulX4hxaaQ,,=1
 --

 Check out the new Asterisk community forum at:
 https://community.asterisk.org/

 New to Asterisk? Start here:
 https://wiki.asterisk.org/wiki/display/AST/Getting+Started

 asterisk-users mailing list
 To UNSUBSCRIBE or update options visit:
 https://linkprotect.cudasvc.com/url?a=http://lists.digium.co
 m/mailman/listinfo/asterisk-users=E,1,wIdvPI63-ImQqWZFblrm
 lGJbQ_cbmu31TlSPHYv9kAkHrNRLdIAjL2IUr9sVYxm6piHc0Pf2Zna7zuNO
 J2hb4CVzp2WYVDsgZJqAyHt2YkVuGQ,,=1


>>>
>>
>>
>
> --
> _
> -- Bandwidth and Colocation Provided by http://www.api-digital.com --
>

[asterisk-users] ast_iostream_close: SSL_shutdown() failed: Underlying BIO error: Bad file descriptor

2018-02-09 Thread Jonathan H
Before I file a bug any ideas?

Got valid certs, working fine for everything I need them from, but this
seems to popup randomly in my logs.

[Feb  9 12:43:07] ERROR[14968]: iostream.c:507 ast_iostream_close:
SSL_shutdown() failed: error:0005:lib(0):func(0):DH lib, Underlying BIO
error: Bad file descriptor

Something I'm doing?

Asterisk 15.2.0 on Ubuntu 17.10
-- 
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

Check out the new Asterisk community forum at: https://community.asterisk.org/

New to Asterisk? Start here:
  https://wiki.asterisk.org/wiki/display/AST/Getting+Started

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users

Re: [asterisk-users] "Cannot write OGG/Opus streams. Sorry" - any ideas?

2018-01-28 Thread Jonathan H
Oh. Ok, thanks for the quick response. Any idea of a workaround, or when it
might be implemented? It's just that most of the speech recognition
services now prefer opus. I can transcode with Sox, but that just puts
another (short) delay and process into pipeline. Not a complaint, just a
question.

Thanks.

On 28 Jan 2018 9:47 pm, "Joshua Colp" <jc...@digium.com> wrote:

> On Sun, Jan 28, 2018, at 5:34 PM, Jonathan H wrote:
> > So as y'all know, with your help I managed to get Opus installed at
> last. Yay!
> >
> > With excitement, I wrote my dialplan, dialled in, and
> >
> > [Jan 28 21:30:11] ERROR[29977][C-001d]: format_ogg_opus.c:95
> > ogg_opus_rewrite: Cannot write OGG/Opus streams. Sorry :(
> > [Jan 28 21:30:11] WARNING[29977][C-001d]: file.c:468 fn_wrapper:
> > Unable to rewrite format ogg_opus
> >
> > Any idea where I'm going wrong? I googled that error and can't find it
> > anywhere, nor can I find any notes about not actually being able to
> > *use* Opus once installed, so if anyone can point me to where I've
> > gone wrong I'd be most grateful!
>
> The opus support can only be used currently for reading files and for
> transcoding (for example one leg in g722 and the other in opus, or for
> conference mixing).
>
> --
> Joshua Colp
> Digium, Inc. | Senior Software Developer
> 445 Jan Davis Drive NW - Huntsville, AL 35806 - US
> Check us out at: www.digium.com & www.asterisk.org
>
> --
> _
> -- Bandwidth and Colocation Provided by http://www.api-digital.com --
>
> Check out the new Asterisk community forum at: https://community.asterisk.
> org/
>
> New to Asterisk? Start here:
>   https://wiki.asterisk.org/wiki/display/AST/Getting+Started
>
> asterisk-users mailing list
> To UNSUBSCRIBE or update options visit:
>http://lists.digium.com/mailman/listinfo/asterisk-users
>
-- 
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

Check out the new Asterisk community forum at: https://community.asterisk.org/

New to Asterisk? Start here:
  https://wiki.asterisk.org/wiki/display/AST/Getting+Started

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users

[asterisk-users] "Cannot write OGG/Opus streams. Sorry" - any ideas?

2018-01-28 Thread Jonathan H
So as y'all know, with your help I managed to get Opus installed at last. Yay!

With excitement, I wrote my dialplan, dialled in, and

[Jan 28 21:30:11] ERROR[29977][C-001d]: format_ogg_opus.c:95
ogg_opus_rewrite: Cannot write OGG/Opus streams. Sorry :(
[Jan 28 21:30:11] WARNING[29977][C-001d]: file.c:468 fn_wrapper:
Unable to rewrite format ogg_opus

Any idea where I'm going wrong? I googled that error and can't find it
anywhere, nor can I find any notes about not actually being able to
*use* Opus once installed, so if anyone can point me to where I've
gone wrong I'd be most grateful!

Thanks.

-- 
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

Check out the new Asterisk community forum at: https://community.asterisk.org/

New to Asterisk? Start here:
  https://wiki.asterisk.org/wiki/display/AST/Getting+Started

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users


Re: [asterisk-users] Installation instructions for Opus are incorrect - maybe?

2018-01-27 Thread Jonathan H
On 27 January 2018 at 16:14, Ludovic Gasc <gml...@gmail.com> wrote:

> (M) means it's a module, not it's an error.
> Do you relaunch configure after xmlstarlet install ?
> For bash error, no idea.

Many thanks! Stupid mistake of mine, I hadn't tried when I saw bash
was still on (E)  (Error, I guess?).

But then I did ./configure and it said (among other things)

checking for sh... /bin/bash
checking for bash... /bin/bash
checking for xmlstarlet... /usr/bin/xmlstarlet
checking for curl-config... /usr/bin/curl-config
checking for the version of libcurl... 7.55.1
checking for libcurl >= version 7.10.1... yes
checking whether libcurl is usable... yes
checking for curl_free... yes

Then of course, make menuselect worked and I now have opus!

Hmm, as it's free and open, I wonder why opus isn't a core codec?

Anyway, thanks for the help.

Jonathan

-- 
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

Check out the new Asterisk community forum at: https://community.asterisk.org/

New to Asterisk? Start here:
  https://wiki.asterisk.org/wiki/display/AST/Getting+Started

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users


Re: [asterisk-users] Installation instructions for Opus are incorrect - maybe?

2018-01-27 Thread Jonathan H
On 27 January 2018 at 09:27, Ludovic Gasc <gml...@gmail.com> wrote:
> Hi Jonathan,
>
> If you put the cursor on the line XXX, you will see what are the
> dependencies are missing to enable the option.
> In this case, it's certainly curl that is missing on your system.

Ah, OK! No, it wasn't curl that was missing, but I think the way it
was phrased confused me. It says:

"Download the Opus codec from Digium.  See
http://downloads.digium.com/pub/telephony/codec_opus/README.
Depends on: xmlstarlet(E), bash(E), res_format_attr_opus(M)
Support Level: external"

However, while I managed to apt install xmlstarlet, I already had
bash, and I can't find res_format_attr_opus.

Any ideas? Many thanks,

Jonathan

> Regards.
>
> --
> Ludovic Gasc (GMLudo)
>
> 2018-01-27 2:06 GMT+01:00 Jonathan H <lardconce...@gmail.com>:
>>
>> Before I got an log a ticket, can I just check I'm not doing anything
>> wrong?
>>
>> In 15.2, to install Opus:
>>
>> 1) run `make menuselect`
>> 2) Highlight "Codec Translators" and press enter.
>> 3) Scroll down to "codec_opus" in the section labeled "External"
>> 4) Press enter to select the codec if it is not already selected.
>> ... at this point, I see
>>
>>   XXX codec_opus
>>
>> and a message to download codec opus from Digium, using this link:
>>
>> http://downloads.digium.com/pub/telephony/codec_opus/README
>> (note: same as
>> http://downloads.digium.com/pub/telephony/codec_opus/asterisk-15.0/x86-64/
>> )
>>
>> The link says:
>>
>>  The preferred way of installing the Opus codec is to use menuselect in
>>   Asterisk to automatically download and install the codec. From the
>> Asterisk
>>   top-level source directory, run
>>
>>   1) run `make menuselect`
>>   2) Highlight "Codec Translators" and press enter.
>>   3) Scroll down to "codec_opus" in the section labeled "External"
>>   4) Press enter to select the codec if it is not already selected.
>>
>> ... well, you've guessed it, I'm in a loop now!
>>
>> There's another way:
>>
>>  " The alternative way to install codec_opus is to download a tarball
>>   directly from digium.com. Once the tarball is downloaded and untarred,
>>   perform the following steps:
>>
>>   1) Copy the codec_opus.so file into the Asterisk module directory (by
>> default,
>>  /usr/lib/asterisk/modules/).
>>   2) Copy the codec_opus_config-en_US.xml file into the Asterisk external
>>  documentation directory (by default,"
>>
>> But there are two files:
>>
>> -rwxr-xr-x 1 root root 354000 Dec 11 23:16 codec_opus.so*
>> -rwxr-xr-x 1 root root 226576 Dec 11 23:16 format_ogg_opus.so*
>>
>>
>> Not saying this latter part is beyond my comprehension, just that
>> neither route matches the instructions :)
>>
>> So... is it me being stupid, or should I log a ticket?
>>
>> --
>> _
>> -- Bandwidth and Colocation Provided by http://www.api-digital.com --
>>
>> Check out the new Asterisk community forum at:
>> https://community.asterisk.org/
>>
>> New to Asterisk? Start here:
>>   https://wiki.asterisk.org/wiki/display/AST/Getting+Started
>>
>> asterisk-users mailing list
>> To UNSUBSCRIBE or update options visit:
>>http://lists.digium.com/mailman/listinfo/asterisk-users
>
>
>
> --
> _
> -- Bandwidth and Colocation Provided by http://www.api-digital.com --
>
> Check out the new Asterisk community forum at:
> https://community.asterisk.org/
>
> New to Asterisk? Start here:
>   https://wiki.asterisk.org/wiki/display/AST/Getting+Started
>
> asterisk-users mailing list
> To UNSUBSCRIBE or update options visit:
>http://lists.digium.com/mailman/listinfo/asterisk-users

-- 
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

Check out the new Asterisk community forum at: https://community.asterisk.org/

New to Asterisk? Start here:
  https://wiki.asterisk.org/wiki/display/AST/Getting+Started

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users


[asterisk-users] Installation instructions for Opus are incorrect - maybe?

2018-01-26 Thread Jonathan H
Before I got an log a ticket, can I just check I'm not doing anything wrong?

In 15.2, to install Opus:

1) run `make menuselect`
2) Highlight "Codec Translators" and press enter.
3) Scroll down to "codec_opus" in the section labeled "External"
4) Press enter to select the codec if it is not already selected.
... at this point, I see

  XXX codec_opus

and a message to download codec opus from Digium, using this link:

http://downloads.digium.com/pub/telephony/codec_opus/README
(note: same as 
http://downloads.digium.com/pub/telephony/codec_opus/asterisk-15.0/x86-64/
)

The link says:

 The preferred way of installing the Opus codec is to use menuselect in
  Asterisk to automatically download and install the codec. From the Asterisk
  top-level source directory, run

  1) run `make menuselect`
  2) Highlight "Codec Translators" and press enter.
  3) Scroll down to "codec_opus" in the section labeled "External"
  4) Press enter to select the codec if it is not already selected.

... well, you've guessed it, I'm in a loop now!

There's another way:

 " The alternative way to install codec_opus is to download a tarball
  directly from digium.com. Once the tarball is downloaded and untarred,
  perform the following steps:

  1) Copy the codec_opus.so file into the Asterisk module directory (by default,
 /usr/lib/asterisk/modules/).
  2) Copy the codec_opus_config-en_US.xml file into the Asterisk external
 documentation directory (by default,"

But there are two files:

-rwxr-xr-x 1 root root 354000 Dec 11 23:16 codec_opus.so*
-rwxr-xr-x 1 root root 226576 Dec 11 23:16 format_ogg_opus.so*


Not saying this latter part is beyond my comprehension, just that
neither route matches the instructions :)

So... is it me being stupid, or should I log a ticket?

-- 
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

Check out the new Asterisk community forum at: https://community.asterisk.org/

New to Asterisk? Start here:
  https://wiki.asterisk.org/wiki/display/AST/Getting+Started

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users


Re: [asterisk-users] Can anyone help with a quick app_record.c module improvement and can explain over-riding modules?

2018-01-23 Thread Jonathan H
Hi Dmitry and Tim (and everyone else with input into this thread)

Just wanted to thank you all; with your guidance, I've managed to bolt
something very clean and efficient together using Dmity and Tim's
templates, piped into the ding-dong npm node package, which calls Google
Speech API node package.

What I particularly like about DingDong is that it's well documented
insofar as it's so simple, it barely needs documentation!

Once I've finished experimenting in a day or two, I'll stick a Gist up with
everything together.

Once again, many, many thanks.

Refs:
https://github.com/antirek/ding-dong
https://github.com/googleapis/nodejs-speech



On 21 January 2018 at 08:30, Dmitriy Serov <serov@gmail.com> wrote:

> Hello.
>
> A little sub from my dialplan:
>
> [sub-Read]
> exten => s,1,NoOp(Read)
>  same => n,Set(LOCAL(tmp_record_file)=/tmp/asterisk-in/${EPOCH})
>  same => n,Monitor(wav16,${tmp_record_file},o)
>  same => n,Read(tmp_ext,${ARG2},${ARG3},${ARG4},${ARG5},${ARG6})
>  same => n,StopMonitor()
>  same => n,NoOp(ReadStatus=${READSTATUS})
>  same => n,Gotoif($[ ${LEN(${tmp_ext})} > 0 ]?end)
>  same => n,AGI(agi-ruvoip-net.php,speeddial-voice,${ARG1},${tmp_recor
> d_file}-in.wav16)
>  same => n,NoOp(Voice recognition result: "${agi_result}")
>  same => n,Gotoif($[ "${agi_result}" != "found" ]?end)
>  same => n,Return(${agi_call_exten})
>  same => n(end),return(${tmp_ext})
>
>
> 21.01.2018 2:57, Jonathan H пишет:
>
> On 20 January 2018 at 23:30, Tim S <tim.strom...@gmail.com> wrote:
>>
>> I have seen this take over 2 seconds before on a sluggish machine.
>>>
>> Thanks - my host uses SSD and everything seems pretty quick, but I'll
>> give it a 1 second pause.
>>
>> you'd need to pipe that to a Google Speech API tunnel.
>>> That's probably not something you can hack away at with simple
>>> Asterisk dialplan applications.
>>>
>> Funnily enough, I had just found an old reply from last year to
>> another similar question:
>>
>> -- Forwarded message --
>>> From: Matt Riddell
>>> Date: 22 September 2017 at 16:01
>>> Subject: Re: [asterisk-users] Asterisk 15, Jack, streams, speech
>>> recognition… so many questions!
>>> At least in older versions you can use EAGI to get a handle to the audio
>>> stream.
>>>
>> So I had a look and found this:
>>
>> https://stackoverflow.com/questions/34026698/asterisk-write-
>> plugin-to-catch-voice-stream
>>
>> And read this:
>>
>> https://wiki.asterisk.org/wiki/display/AST/Asterisk+15+Application_EAGI
>>
>> There's a few knowledge gaps, but I think with a few days reading and
>> the great help here, we might have a solution :)
>>
>> This is all very helpful - if anyone else feels like wading in, please do.
>>
>> Many thanks!
>>
>>
>
> --
> _
> -- Bandwidth and Colocation Provided by http://www.api-digital.com --
>
> Check out the new Asterisk community forum at:
> https://community.asterisk.org/
>
> New to Asterisk? Start here:
>  https://wiki.asterisk.org/wiki/display/AST/Getting+Started
>
> asterisk-users mailing list
> To UNSUBSCRIBE or update options visit:
>   http://lists.digium.com/mailman/listinfo/asterisk-users
>
-- 
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

Check out the new Asterisk community forum at: https://community.asterisk.org/

New to Asterisk? Start here:
  https://wiki.asterisk.org/wiki/display/AST/Getting+Started

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users

Re: [asterisk-users] Can anyone help with a quick app_record.c module improvement and can explain over-riding modules?

2018-01-20 Thread Jonathan H
On 20 January 2018 at 23:30, Tim S  wrote:

> I have seen this take over 2 seconds before on a sluggish machine.

Thanks - my host uses SSD and everything seems pretty quick, but I'll
give it a 1 second pause.

> you'd need to pipe that to a Google Speech API tunnel.
> That's probably not something you can hack away at with simple
> Asterisk dialplan applications.

Funnily enough, I had just found an old reply from last year to
another similar question:

> -- Forwarded message --
> From: Matt Riddell
> Date: 22 September 2017 at 16:01
> Subject: Re: [asterisk-users] Asterisk 15, Jack, streams, speech recognition… 
> so many questions!
> At least in older versions you can use EAGI to get a handle to the audio 
> stream.

So I had a look and found this:

https://stackoverflow.com/questions/34026698/asterisk-write-plugin-to-catch-voice-stream

And read this:

https://wiki.asterisk.org/wiki/display/AST/Asterisk+15+Application_EAGI

There's a few knowledge gaps, but I think with a few days reading and
the great help here, we might have a solution :)

This is all very helpful - if anyone else feels like wading in, please do.

Many thanks!

-- 
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

Check out the new Asterisk community forum at: https://community.asterisk.org/

New to Asterisk? Start here:
  https://wiki.asterisk.org/wiki/display/AST/Getting+Started

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users

Re: [asterisk-users] Can anyone help with a quick app_record.c module improvement and can explain over-riding modules?

2018-01-20 Thread Jonathan H
Oh, what a good idea! That's exactly the kind of lateral thinking I
was hoping someone would come up with.

I thought it was called MixMonitor, and tried to wrap my head around
it but couldn't.

I'll give this a go tomorrow and let you know what I come up with!

Many thanks,

Jonathan

T

On 20 January 2018 at 17:03, Tim S <tim.strom...@gmail.com> wrote:
> Just a quick and dirty thought, try the MONITOR application.
>
>
> Pseudo-code:
>
> Anchor-point
> PLAYBACK ("press or say")
> MONITOR (use the split audio files mode, not the mixed - this way you can
> roughly separate which side did the "talking")
> READ (audio file "1 to 5", try to grab one digit)
> STOPMONITOR
> IF (READ variable timed-out, send the incoming half of the monitor file to
> Google Speech)
>  Playback (some sound effect to indicate "thinking" on the Asterisk side
> - user feedback is good)
>  Check Google Speech result against a white-list
>  IF filtered result was not a valid option
>  PLAYBACK "I didn't understand that"
>  GOTO to Anchor-point
>  ELSE
>  Goto next step using valid decoded speech data
> ELSE
>  Check DTMF result against a white-list
>  IF filtered DTMFresult was not a valid option
>  PLAYBACK "I didn't understand that"
>  GOTO to Anchor-point
>  ELSE
>  Goto next step using valid decoded DTMF data
> Catch-all, should never get here.
>
> /Pseudo-code
>
>
> Don't forget to filter your user sourced data against your white-list,
> always assume users are hostile, this is part of the total picture of
> defence-in-depth.
>
> -Tim
>
>
> On Sat, Jan 20, 2018 at 12:42 AM, Jonathan H <lardconce...@gmail.com> wrote:
>>
>> Hello,
>>
>> I want to start recording with a prompt of "press or say 1 to 5". If
>> no DMTF is pressed, I want to send the recording to Google Speech to
>> get the number back (got that part working already).
>>
>> If any dtmf key is pressed while Application_Record  is running with
>> option y, then the recording terminates and sends
>> RECORD_STATUS of "DTMF" (A terminating DTMF was received).
>>
>> But I need to know **what** number that DTMF was, and I can't see a
>> way of grabbing it after the fact.
>>
>> I can see in the code where the right variables are..
>>
>> https://github.com/asterisk/asterisk/blob/master/apps/app_record.c#L140
>> dtmf_response
>>
>> https://github.com/asterisk/asterisk/blob/master/apps/app_record.c#L166
>> * \param dtmf_integer the integer value of the DTMF key received
>>
>> So,3 questions I guess:
>>
>> 1: Am I going about this the right way? (unimrcp is not an option here)
>> 2: Can someone explain in layman's terms how a simpleton like me could
>> copy, hack about with and make a new module, like, for example,
>> app_record_alt.c, that would stick around each time I updated Asterisk
>> from source?
>> 3: Or, is anyone willing to make the simple code change to the file to
>> improve it to send back the DTMF to the dialplan? For free to improve
>> core code? If not, and I posted on the commercial list, how much would
>> I be looking at to modify about 6 lines of code and return an extra
>> variable?
>>
>> So, ultimately, I'm hoping for something like:
>>
>> Currently:
>> option "y" returns a RECORD_STATUS of "DTMF" if a key was press
>>
>> Hopefully:
>> option "z" returns a RECORD_STATUS of  showing which key
>> was pressed.
>> Or possibly even DTMF_VALUE (if an app can return two variables to the
>> dialplan?)
>>
>> I'm sure this would benefit a lot of people.
>>
>> I posted this a few days ago in the forum at
>>
>> https://community.asterisk.org/t/can-anyone-help-with-a-quick-app-record-c-module-improvement-and-can-explain-over-riding-modules/73221
>> but no-one bit, so, I'm hoping this list can help.
>>
>> Many thanks!
>>
>> --
>> _
>> -- Bandwidth and Colocation Provided by http://www.api-digital.com --
>>
>> Check out the new Asterisk community forum at:
>> https://community.asterisk.org/
>>
>> New to Asterisk? Start here:
>>   https://wiki.asterisk.org/wiki/display/AST/Getting+Started
>>
>> asterisk-users mailing list
>> To UNSUBSCRIBE or update options visit:
>>http://lists.digium.com/mailman/listinfo/asterisk-users
>
>
>
> --
> ___

[asterisk-users] Can anyone help with a quick app_record.c module improvement and can explain over-riding modules?

2018-01-20 Thread Jonathan H
Hello,

I want to start recording with a prompt of "press or say 1 to 5". If
no DMTF is pressed, I want to send the recording to Google Speech to
get the number back (got that part working already).

If any dtmf key is pressed while Application_Record  is running with
option y, then the recording terminates and sends
RECORD_STATUS of "DTMF" (A terminating DTMF was received).

But I need to know **what** number that DTMF was, and I can't see a
way of grabbing it after the fact.

I can see in the code where the right variables are..

https://github.com/asterisk/asterisk/blob/master/apps/app_record.c#L140
dtmf_response

https://github.com/asterisk/asterisk/blob/master/apps/app_record.c#L166
* \param dtmf_integer the integer value of the DTMF key received

So,3 questions I guess:

1: Am I going about this the right way? (unimrcp is not an option here)
2: Can someone explain in layman's terms how a simpleton like me could
copy, hack about with and make a new module, like, for example,
app_record_alt.c, that would stick around each time I updated Asterisk
from source?
3: Or, is anyone willing to make the simple code change to the file to
improve it to send back the DTMF to the dialplan? For free to improve
core code? If not, and I posted on the commercial list, how much would
I be looking at to modify about 6 lines of code and return an extra
variable?

So, ultimately, I'm hoping for something like:

Currently:
option "y" returns a RECORD_STATUS of "DTMF" if a key was press

Hopefully:
option "z" returns a RECORD_STATUS of  showing which key
was pressed.
Or possibly even DTMF_VALUE (if an app can return two variables to the
dialplan?)

I'm sure this would benefit a lot of people.

I posted this a few days ago in the forum at
https://community.asterisk.org/t/can-anyone-help-with-a-quick-app-record-c-module-improvement-and-can-explain-over-riding-modules/73221
but no-one bit, so, I'm hoping this list can help.

Many thanks!

-- 
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

Check out the new Asterisk community forum at: https://community.asterisk.org/

New to Asterisk? Start here:
  https://wiki.asterisk.org/wiki/display/AST/Getting+Started

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users


Re: [asterisk-users] Handling a long-running agi on hangup-handler?

2018-01-20 Thread Jonathan H
Thanks Eric,

Well, with your guidance and after a fair bit of Googling, experimentation
and headscratching, here is the Python version for anyone who wants it
Also works with other long AGI background tasks to quickly return to the
dialplan when something else is being processed.

import os, sys
from asterisk.agi import AGI
from speechrecgoogle import *

agi = AGI()

recFilename = str(agi.env['agi_arg_1'])

if os.fork():
sys.exit(0)
else:
os.setsid()
os.close(sys.stdout.fileno())
response_data = speechrec(recFilename)
feedback = response_data.results[0].alternatives[0].transcript
# You now have your plain text feedback which takes a few seconds, but
# Asterisk has safely already returned to the dialplan or hangup
handler


Hope this helps someone!

On 18 January 2018 at 17:42, Eric Wieling <ewiel...@nyigc.com> wrote:

>
> Asterisk (after 1.4?) sends the AGI a HUP when the call hangs up.
>
> Try setting your script to ignore the HUP signal and make it fork and go
> into the background so Asterisk thinks the process has completed.
>
> In PHP ignore HUP:
>
> pcntl_signal(SIGHUP, SIG_IGN);
>
> In PHP fork and become a short lived daemon:
>
> $pid = pcntl_fork();
> if ($pid == -1) {
> die("could not fork");
> } elseif ($pid) {
> exit; // we are the parent
> }
> // we are the child
> // detatch from the controlling terminal so we don't become a
> zombie when we die.
> if (posix_setsid() == -1) {
>     die("could not detach from terminal");
>
> }
>
>
> On 01/18/2018 12:27 PM, Jonathan H wrote:
>
> I know that hangup handlers (https://wiki.asterisk.org/
> wiki/display/AST/Hangup+Handlers) have to finish quickly.
>
> So it's no surprise that my speech to text agi which takes 8 seconds gets
> killed.
>
> However, can anyone think of a way round this? So, once the caller has
> hung up, I need to take one of the channel variables, and pass it to a
> python agi script which then does speech to text.
>
> In-call, it works fine. After hangup, it doesn't. Which is correct, but
> any thoughts on ways round this?
>
> Thanks.
>
>
>
>
-- 
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

Check out the new Asterisk community forum at: https://community.asterisk.org/

New to Asterisk? Start here:
  https://wiki.asterisk.org/wiki/display/AST/Getting+Started

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users

[asterisk-users] Handling a long-running agi on hangup-handler?

2018-01-18 Thread Jonathan H
I know that hangup handlers (
https://wiki.asterisk.org/wiki/display/AST/Hangup+Handlers) have to finish
quickly.

So it's no surprise that my speech to text agi which takes 8 seconds gets
killed.

However, can anyone think of a way round this? So, once the caller has hung
up, I need to take one of the channel variables, and pass it to a python
agi script which then does speech to text.

In-call, it works fine. After hangup, it doesn't. Which is correct, but any
thoughts on ways round this?

Thanks.
-- 
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

Check out the new Asterisk community forum at: https://community.asterisk.org/

New to Asterisk? Start here:
  https://wiki.asterisk.org/wiki/display/AST/Getting+Started

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users

Re: [asterisk-users] Simple speech recognition for driving IVR - "press or say one".

2017-12-10 Thread Jonathan H
Hang on, all of the fiddling in this thread seems remarkably
over-complicating what should be an incredibly simple task.

We know that a DTMF keypress interrupted the recording. We also know
that app_record.c knows which keypress it was from

* \param dtmf_integer the integer value of the DTMF key received

as in

static enum dtmf_response record_dtmf_response(struct ast_channel
*chan, struct ast_flags *flags, int dtmf_integer, int terminator)

For reasons which have me scratching my head, app_record turns a
useful DTMF value into a rather meaningless "DTMF" in the
RECORD_STATUS variable.

But SOMETHING must be floating around in Asterisk for app_record.c to
know what number was pushed. If I'm using RFC2833, is there ANY way of
getting that last keypress.

In other words: "The user pressed a number, recording stopped, now
what was that number?" - WITHOUT rewriting and recompiling a core
application or doing any complex workaround?

Thanks

On 6 December 2017 at 23:25, Jonathan H <lardconce...@gmail.com> wrote:
> Thanks for your responses - it looks like I have the following
> options, in order of ease:
>
> 1: Modify and recompile app_record.c
>
> Change line 471
> https://github.com/asterisk/asterisk/blob/master/apps/app_record.c#L471
> from
>status_response = "DTMF";
> to
>status_response = dtmf_integer;
>
> Pro: Free, easy
> Con: Have to remember to edit module each time a new Asterisk update comes out
>
> 2: Use the Jean Aunis "mix ARI and AGI" trick.
> Pro: Doesn't need recompiling on each Asterisk release.
> Con: A bit of fiddling and requires an ARI library.
>
> 3: Pay $50 for uniMRCP module
> Pro: Does what I need to do
> Con: $50 per channel. Requires account. Lots of setup to basically add
> DTMF to the speech recognition I'm already doing.
>
> Yes? No? None of the above? Other?!
>
> On 6 December 2017 at 14:54, Jurijs Ivolga <jurijs.ivo...@gmail.com> wrote:
>> Hi,
>>
>> Please check code of it. It listens for # and it is quite easy to add all
>> other keys 1-9 and etc
>>
>> Then change code accordingly so script returns value of key.
>>
>> As far as I remember it wasn't hard.
>>
>> With kind regards,
>>
>>
>> Jurijs
>>
>> On Wed, Dec 6, 2017 at 4:50 PM, Jonathan H <lardconce...@gmail.com> wrote:
>>>
>>> Thanks Jurijs,
>>>
>>> Yes, in fact I'm already using that, and it works fine. The problem
>>> here is that I cannot find a way of recording speech AND listening for
>>> a DTMF digit being pressed as an alternative.
>>>
>>> That's where the problem lies.
>>>
>>> J.
>>>
>>> --
>>> _
>>> -- Bandwidth and Colocation Provided by http://www.api-digital.com --
>>>
>>> Check out the new Asterisk community forum at:
>>> https://community.asterisk.org/
>>>
>>> New to Asterisk? Start here:
>>>   https://wiki.asterisk.org/wiki/display/AST/Getting+Started
>>>
>>> asterisk-users mailing list
>>> To UNSUBSCRIBE or update options visit:
>>>http://lists.digium.com/mailman/listinfo/asterisk-users
>>
>>
>>
>> --
>> _
>> -- Bandwidth and Colocation Provided by http://www.api-digital.com --
>>
>> Check out the new Asterisk community forum at:
>> https://community.asterisk.org/
>>
>> New to Asterisk? Start here:
>>   https://wiki.asterisk.org/wiki/display/AST/Getting+Started
>>
>> asterisk-users mailing list
>> To UNSUBSCRIBE or update options visit:
>>http://lists.digium.com/mailman/listinfo/asterisk-users

-- 
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

Check out the new Asterisk community forum at: https://community.asterisk.org/

New to Asterisk? Start here:
  https://wiki.asterisk.org/wiki/display/AST/Getting+Started

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users


Re: [asterisk-users] Simple speech recognition for driving IVR - "press or say one".

2017-12-06 Thread Jonathan H
Thanks for your responses - it looks like I have the following
options, in order of ease:

1: Modify and recompile app_record.c

Change line 471
https://github.com/asterisk/asterisk/blob/master/apps/app_record.c#L471
from
   status_response = "DTMF";
to
   status_response = dtmf_integer;

Pro: Free, easy
Con: Have to remember to edit module each time a new Asterisk update comes out

2: Use the Jean Aunis "mix ARI and AGI" trick.
Pro: Doesn't need recompiling on each Asterisk release.
Con: A bit of fiddling and requires an ARI library.

3: Pay $50 for uniMRCP module
Pro: Does what I need to do
Con: $50 per channel. Requires account. Lots of setup to basically add
DTMF to the speech recognition I'm already doing.

Yes? No? None of the above? Other?!

On 6 December 2017 at 14:54, Jurijs Ivolga <jurijs.ivo...@gmail.com> wrote:
> Hi,
>
> Please check code of it. It listens for # and it is quite easy to add all
> other keys 1-9 and etc
>
> Then change code accordingly so script returns value of key.
>
> As far as I remember it wasn't hard.
>
> With kind regards,
>
>
> Jurijs
>
> On Wed, Dec 6, 2017 at 4:50 PM, Jonathan H <lardconce...@gmail.com> wrote:
>>
>> Thanks Jurijs,
>>
>> Yes, in fact I'm already using that, and it works fine. The problem
>> here is that I cannot find a way of recording speech AND listening for
>> a DTMF digit being pressed as an alternative.
>>
>> That's where the problem lies.
>>
>> J.
>>
>> --
>> _
>> -- Bandwidth and Colocation Provided by http://www.api-digital.com --
>>
>> Check out the new Asterisk community forum at:
>> https://community.asterisk.org/
>>
>> New to Asterisk? Start here:
>>   https://wiki.asterisk.org/wiki/display/AST/Getting+Started
>>
>> asterisk-users mailing list
>> To UNSUBSCRIBE or update options visit:
>>http://lists.digium.com/mailman/listinfo/asterisk-users
>
>
>
> --
> _
> -- Bandwidth and Colocation Provided by http://www.api-digital.com --
>
> Check out the new Asterisk community forum at:
> https://community.asterisk.org/
>
> New to Asterisk? Start here:
>   https://wiki.asterisk.org/wiki/display/AST/Getting+Started
>
> asterisk-users mailing list
> To UNSUBSCRIBE or update options visit:
>http://lists.digium.com/mailman/listinfo/asterisk-users

-- 
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

Check out the new Asterisk community forum at: https://community.asterisk.org/

New to Asterisk? Start here:
  https://wiki.asterisk.org/wiki/display/AST/Getting+Started

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users


Re: [asterisk-users] Simple speech recognition for driving IVR - "press or say one".

2017-12-06 Thread Jonathan H
Thanks Jurijs,

Yes, in fact I'm already using that, and it works fine. The problem
here is that I cannot find a way of recording speech AND listening for
a DTMF digit being pressed as an alternative.

That's where the problem lies.

J.

-- 
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

Check out the new Asterisk community forum at: https://community.asterisk.org/

New to Asterisk? Start here:
  https://wiki.asterisk.org/wiki/display/AST/Getting+Started

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users


[asterisk-users] Simple speech recognition for driving IVR - "press or say one".

2017-12-06 Thread Jonathan H
Briefly: I want to be able to have "press or say (number)", with
Asterisk listening for a spoken number, but accepting a DTMF digit,
too.

I'm posting everything I found so far, here, partly to show working,
but also in case anyone else finds it useful. So, moving on

This looked hopeful for a moment until I realised that it doesn't do DTMF:
https://wiki.asterisk.org/wiki/display/AST/Asterisk+15+Application_SpeechBackground

So then there's
https://wiki.asterisk.org/wiki/display/AST/Asterisk+15+Application_Record,
which can terminate on any DTMF key with "y", but according to the
docs, "RECORD_STATUS" only sets a flag of "DTMF" (A terminating DTMF
was received ('#' or '*', depending upon option 't')).
So, I don't get to know which key was pressed via that method, either.

There's very little information I can find about the built-in
functions for speech recognition.
https://wiki.asterisk.org/wiki/display/AST/Speech+Recognition+API
doesn't actually explain how to integrate the actual speech engines.

In this previous forum post,
https://community.asterisk.org/t/asterisk-15-jack-streams-speech-recognition-so-many-questions/72108/2
, jcolp explained that most people don't use the speech interface
anyway, because
"Asterisk modules are written in C, and it’s more difficult to do
things in that fashion. Using the Record and ship it off using Python,
etc, is just easier and gets the job done for a lot of people to where
they find it acceptable.
So, AGI it is! But I'm still stuck on how I record for speech AND get
a DTMF if it was dialled.

Regarding speech in general, even "Asterisk - The Definitive Guide" just says:

"Asterisk does not have speech recognition built in, but there are
many third-party speech
recognition packages that integrate with Asterisk. Much of that is
outside of the scope
of this book, as those applications are external to Asterisk" - helpful!

The speech-rec mailing list at
http://lists.digium.com/pipermail/asterisk-speech-rec/ hasn't been
posted to since 2013

Someone else asked about speech recognition and unimrcp in this post:
http://lists.digium.com/pipermail/asterisk-users/2017-February/290875.html

uniMCRP https://mojolingo.com/blog/2015/speech-rec-asterisk-get-started/
http://www.unimrcp.org/manuals/html/AsteriskManual.html#_Toc424230605
This has a Google Speech Recogniser plugin, but it's $50 per channel
http://www.unimrcp.org/gsr

*Reasons to use Lex over Google TTS*
• Has just been released in eu-west-1:
https://forums.aws.amazon.com/ann.jspa?annID=5186
• Supports 8KHz telepony https://forums.aws.amazon.com/ann.jspa?annID=4775
• Is in the core AWS SDK
http://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/LexRuntime.html
• Has a number slot type:
http://docs.aws.amazon.com/lex/latest/dg/built-in-slot-number.html
 - this means no accidental recognition of "won", "one" or "juan" instead of 1!

The pricing is definitely right: "The cost for 1,000 speech requests
would be $4.00, and 1,000 text requests would cost $0.75. From the
date you get started with Amazon Lex, you can process up to 10,000
text requests and 5,000 speech requests per month for free for the
first year".

Amazon Transcribe looks promising too, but is only available for
developer invitation at this time:
https://aws.amazon.com/transcribe/ https://aws.amazon.com/transcribe/pricing/

But all I need now is the quickest, simplest way to send Lex a short
8KHz file and get a single digit back, as quickly and reliably as
possible.

Before I travel too far down this road, can someone point me in the
right direction and possibly steer me away from the wrong path?!

-- 
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

Check out the new Asterisk community forum at: https://community.asterisk.org/

New to Asterisk? Start here:
  https://wiki.asterisk.org/wiki/display/AST/Getting+Started

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users

Re: [asterisk-users] ASR Suggestions for small dictionnary (<1000 entries) lookup in France/french

2017-10-22 Thread Jonathan H
Having experimented with something similar myself, I'd say you are
about to create a vast amount of complexity by moving away from keypad
entry.

Also, a lot of the natural language APIs don't support French - for
example, Amazon Lex or https://dialogflow.com would be great for this
as they understand contexts and intents... but they don't understand
French.

But if you pursue ASR, try this:
https://cloud.google.com/speech/
Switch the console to French and see how you get on. In English,
sometimes it turns it into a number, sometimes it comes out as "twenty
five thousand two hundred twelve".

I think you have two choices with ASR:

1: Explain to the caller that they must say one digit at a time, in
which case, easy! Pick any free speech recognition you want.
2: Try and handle "natural language" ways of speaking numbers, in
which case be prepared for a lot of debugging and learning!

I could be wrong - if anyone knows, please let us both know, too!

On 22 October 2017 at 09:46, Olivier  wrote:
> Hello,
>
> I'm in the early stages of designing an Emergency calling service IVR
> application.
>
> The IVR application asks simple one or two questions like "which is the
> postal code of the area you are currently calling from ?" "Is the correct
> ?". The expected values are a 5-digits number like
> "twenty-five-thousand-two-hundreds-twelve" or "twenty-five-two-twelve"
> variations or "yes or no".
>
> From received answers, this application would route incoming call to an
> appropriate Public Safety Answering Point.
>
> As IVR requires working DTMF and sometimes it's not easy to type DTMF with
> wireless phones, I wonder if I should or not use ASR as an alternative to
> IVR.
>
> My requirements are:
> - spoken language is France/french
> - low call volume (<5 calls at peak time)
> - asterisk 13 and up support
> - hosted (prefered) or online
> - if hosted, should be installable on Debian (prefered) or CentOS on a
> dedicated VM.
>
> 1. What do you think of using ASR for such application ? Would you favor
> IVR, ASR or implement both ?
> 2. Which ASR would you recommend ?
>
> Best regards
>
>
>
>
> --
> _
> -- Bandwidth and Colocation Provided by http://www.api-digital.com --
>
> Check out the new Asterisk community forum at:
> https://community.asterisk.org/
>
> New to Asterisk? Start here:
>   https://wiki.asterisk.org/wiki/display/AST/Getting+Started
>
> asterisk-users mailing list
> To UNSUBSCRIBE or update options visit:
>http://lists.digium.com/mailman/listinfo/asterisk-users

-- 
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

Check out the new Asterisk community forum at: https://community.asterisk.org/

New to Asterisk? Start here:
  https://wiki.asterisk.org/wiki/display/AST/Getting+Started

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users


Re: [asterisk-users] speech-recog.agi

2017-10-19 Thread Jonathan H
Argh! Of course, you are correct! I had not noticed that either - why
does he hide the working version right at the end?!

Anyway, that is your immediate requirement resolved, but I will still
post python version for anyone who wishes for it, soon!



On 19 October 2017 at 23:32, Carlos Chavez <cur...@telecomab.mx> wrote:
> On 10/19/17 3:53 PM, Jonathan H wrote:
>
>> That's because it uses a deprecated API and endpoint.
>>
>> However, funny you should ask this, because I've just finished
>> updating my Google TTS routine to take advantage of the new
>> streamlined API.
>>
>> If you can wait a couple of days, I've stick it up on the repo -
>> BUT... it's going to require python3.5+, the way I do it...
>>
>> Would that work for you?
>>
> Thank you.  I just realized that I just needed to RTFM.  There is a new
> version of the speech-recog agi that uses the Cloud Speech API.  It is
> listed on the web site almost at the end. That one works perfectly.  Of
> course alternatives are always welcome.
>
>
> --
> Telecomunicaciones Abiertas de México S.A. de C.V.
> Carlos Chávez
> +52 (55)8116-9161
>
>
> --
> _
> -- Bandwidth and Colocation Provided by http://www.api-digital.com --
>
> Check out the new Asterisk community forum at:
> https://community.asterisk.org/
>
> New to Asterisk? Start here:
>  https://wiki.asterisk.org/wiki/display/AST/Getting+Started
>
> asterisk-users mailing list
> To UNSUBSCRIBE or update options visit:
>   http://lists.digium.com/mailman/listinfo/asterisk-users

-- 
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

Check out the new Asterisk community forum at: https://community.asterisk.org/

New to Asterisk? Start here:
  https://wiki.asterisk.org/wiki/display/AST/Getting+Started

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users

Re: [asterisk-users] speech-recog.agi

2017-10-19 Thread Jonathan H
That's because it uses a deprecated API and endpoint.

However, funny you should ask this, because I've just finished
updating my Google TTS routine to take advantage of the new
streamlined API.

If you can wait a couple of days, I've stick it up on the repo -
BUT... it's going to require python3.5+, the way I do it...

Would that work for you?

On 19 October 2017 at 18:41, Carlos Chavez  wrote:
> I want to try using google for speech recognition in Asterisk and I
> found a ready made AGI:
>
> http://zaf.github.io/asterisk-speech-recog/
>
> I have followed all the steps listed in the web site but I keep getting
> this error:
>
> AGI Tx >> 200 result=99981 (timeout) endpos=22720
> AGI Rx << VERBOSE "Unable to get recognition data." 3
>
> I made sure all the dependencies are met and that my API key for Google
> Cloud Speech is correct (cut and paste).  Any pointers to get this to work
> or any other quick waysto start using Google for speech recognition in
> Asterisk?  Thanks.
>
>
> --
> Telecomunicaciones Abiertas de México S.A. de C.V.
> Carlos Chávez
> +52 (55)8116-9161
>
>
> --
> _
> -- Bandwidth and Colocation Provided by http://www.api-digital.com --
>
> Check out the new Asterisk community forum at:
> https://community.asterisk.org/
>
> New to Asterisk? Start here:
>  https://wiki.asterisk.org/wiki/display/AST/Getting+Started
>
> asterisk-users mailing list
> To UNSUBSCRIBE or update options visit:
>   http://lists.digium.com/mailman/listinfo/asterisk-users

-- 
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

Check out the new Asterisk community forum at: https://community.asterisk.org/

New to Asterisk? Start here:
  https://wiki.asterisk.org/wiki/display/AST/Getting+Started

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users

[asterisk-users] Asterisk 15, Jack, streams, speech recognition… so many questions!

2017-09-22 Thread Jonathan H
I know Asterisk has a speech recognition interface built in, but I
need to go beyond that, with APIs like Lex, Wit or Luis etc.

There's also the very cheap/free high quality speech synthesis
services like Amazon Polly, which can also return an audio stream
object (or save a file).

These APIs can respond really quickly and accurately as they can
receive and interpret an audio stream, but in all the Asterisk speech
recognition tools I can find, they all say that they need to save the
speech to a file, then convert, then upload via whatever API.

Removing the "record in Asterisk/store as file/convert file/upload
file  <> receive stream/save file/convert file/playback in Asterisk"
part of the sequence would save vital seconds of silence and caller
annoyance.

I am looking at, for example, Google's speech to text service, and it
can cope with the following codecs (below), some of which can be used
directly from Asterisk, yes? So there is no need to transcode? As
Google returns "live" word results, I could set an API to "watch" for
a trigger word, and then use the AGI to trigger something in Asterisk.

Well, that is how I am assuming it can/should be done!

Also, there is JackAudio. And I'm thinking to myself that surely
something could be done here, but then also, surely one of the people
far more skilled than me would have already done this?

So, have they either missed a trick here, or is there something in a
recent version of Asterisk which could do this? Some steer my in the
right direction!

LINEAR16 Uncompressed 16-bit signed little-endian samples (Linear PCM).
FLAC FLAC (Free Lossless Audio Codec) is the recommended encoding
because it is lossless--therefore recognition is not compromised--and
requires only about half the bandwidth of LINEAR16. FLAC stream
encoding supports 16-bit and 24-bit samples, however, not all fields
in STREAMINFO are supported.
MULAW 8-bit samples that compand 14-bit audio samples using G.711 PCMU/mu-law.
AMR Adaptive Multi-Rate Narrowband codec. sample_rate_hertz must be 8000.
AMR_WB Adaptive Multi-Rate Wideband codec. sample_rate_hertz must be 16000.
OGG_OPUS Opus encoded audio frames in Ogg container (OggOpus).
sample_rate_hertz must be 16000.
SPEEX_WITH_HEADER_BYTE Although the use of lossy encodings is not
recommended, if a very low bitrate encoding is required, OGG_OPUS is
highly preferred over Speex encoding. The Speex encoding supported by
Cloud Speech API has a header byte in each block, as in MIME type
audio/x-speex-with-header-byte. It is a variant of the RTP Speex
encoding defined in RFC 5574. The stream is a sequence of blocks, one
block per RTP packet. Each block starts with a byte containing the
length of the block, in bytes, followed by one or more frames of Speex
data, padded to an integral number of bytes (octets) as specified in
RFC 5574. In other words, each RTP header is replaced with a single
byte containing the block length. Only Speex wideband is supported.
sample_rate_hertz must be 16000.

Example services...
https://cloud.google.com/speech/reference/rpc/google.cloud.speech.v1#google.cloud.speech.v1.RecognitionConfig
https://pypi.python.org/pypi/SpeechRecognition/3.7.1
https://wit.ai/faq
https://wiki.asterisk.org/wiki/display/AST/Asterisk+15+Application_JACK

-- 
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

Check out the new Asterisk community forum at: https://community.asterisk.org/

New to Asterisk? Start here:
  https://wiki.asterisk.org/wiki/display/AST/Getting+Started

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users


Re: [asterisk-users] Asterisk Voicemail changes

2017-08-31 Thread Jonathan H
What about just using the built-in options? In
http://doxygen.asterisk.org/trunk/voicemail.conf.html; you can configure
the following:

; listen-control-forward-key=#  ; Customize the key that fast-forwards
message playback
; listen-control-reverse-key=*  ; Customize the key that rewinds message 
playback
; listen-control-pause-key=0; Customize the key that pauses/unpauses
message playback
; listen-control-restart-key=2  ; Customize the key that restarts
message playback
; listen-control-stop-key=13456789  ; Customize the keys that interrupt
message playback, probably all keys not set above


On 31 August 2017 at 23:16, Tim Turpin <ttur...@z-harris.com> wrote:

> I’m looking to change the TUI, the Telephone User Interface.  In other
> words, instead of pressing ‘1’ to play a message, I want to press ‘7’,
> etc., etc.
>
>
>
> *From:* asterisk-users-boun...@lists.digium.com [mailto:asterisk-users-
> boun...@lists.digium.com] *On Behalf Of *Jonathan H
> *Sent:* Thursday, August 31, 2017 6:13 PM
>
> *To:* Asterisk Users Mailing List - Non-Commercial Discussion
> *Subject:* Re: [asterisk-users] Asterisk Voicemail changes
>
>
>
> Well, yes, anyone can recompile anything! But what exactly is it that the
> current voicemail can't do or be modified to do through normal dialplan and
> config?
>
>
>
> On 31 August 2017 at 23:07, Tim Turpin <ttur...@z-harris.com> wrote:
>
> Thanks for the info, but not really what I’m looking for.  If possible,
> I’d like to modify the source and re-compile the existing voicemail to make
> it match what I have today.
>
>
>
> Thanks.
>
>
>
> *From:* asterisk-users-boun...@lists.digium.com [mailto:asterisk-users-
> boun...@lists.digium.com] *On Behalf Of *Jonathan H
> *Sent:* Thursday, August 31, 2017 4:13 PM
> *To:* Asterisk Users Mailing List - Non-Commercial Discussion
> *Subject:* Re: [asterisk-users] Asterisk Voicemail changes
>
>
>
> What about MiniVM? http://doxygen.asterisk.org/trunk/App_minivm.html
>
> Example: http://doxygen.asterisk.org/trunk/Config_minivm_examples.html
>
>
>
> That said, I don't know if it's actually actively developed or stable
> (docs last updated 2015 - Asterisk team?)
>
>
>
> Also make sure your Asterisk is up to date because of
> https://issues.asterisk.org/jira/browse/ASTERISK-27103
>
>
>
> On 31 August 2017 at 16:12, Tim Turpin <ttur...@z-harris.com> wrote:
>
> Is there a way that I can modify the source code for the voicemail
> application?  I need to change some of the options in the user’s interface
> to make it work like an existing system that I’m replacing.
>
>
>
> Thanks.
>
> Tim
>
>
> --
> _
> -- Bandwidth and Colocation Provided by http://www.api-digital.com --
>
> Check out the new Asterisk community forum at: https://community.asterisk.
> org/
>
> New to Asterisk? Start here:
>   https://wiki.asterisk.org/wiki/display/AST/Getting+Started
>
> asterisk-users mailing list
> To UNSUBSCRIBE or update options visit:
>http://lists.digium.com/mailman/listinfo/asterisk-users
>
>
>
>
> --
> _
> -- Bandwidth and Colocation Provided by http://www.api-digital.com --
>
> Check out the new Asterisk community forum at: https://community.asterisk.
> org/
>
> New to Asterisk? Start here:
>   https://wiki.asterisk.org/wiki/display/AST/Getting+Started
>
> asterisk-users mailing list
> To UNSUBSCRIBE or update options visit:
>http://lists.digium.com/mailman/listinfo/asterisk-users
>
>
>
> --
> _
> -- Bandwidth and Colocation Provided by http://www.api-digital.com --
>
> Check out the new Asterisk community forum at: https://community.asterisk.
> org/
>
> New to Asterisk? Start here:
>   https://wiki.asterisk.org/wiki/display/AST/Getting+Started
>
> asterisk-users mailing list
> To UNSUBSCRIBE or update options visit:
>http://lists.digium.com/mailman/listinfo/asterisk-users
>
-- 
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

Check out the new Asterisk community forum at: https://community.asterisk.org/

New to Asterisk? Start here:
  https://wiki.asterisk.org/wiki/display/AST/Getting+Started

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users

Re: [asterisk-users] Asterisk Voicemail changes

2017-08-31 Thread Jonathan H
Well, yes, anyone can recompile anything! But what exactly is it that the
current voicemail can't do or be modified to do through normal dialplan and
config?

On 31 August 2017 at 23:07, Tim Turpin <ttur...@z-harris.com> wrote:

> Thanks for the info, but not really what I’m looking for.  If possible,
> I’d like to modify the source and re-compile the existing voicemail to make
> it match what I have today.
>
>
>
> Thanks.
>
>
>
> *From:* asterisk-users-boun...@lists.digium.com [mailto:asterisk-users-
> boun...@lists.digium.com] *On Behalf Of *Jonathan H
> *Sent:* Thursday, August 31, 2017 4:13 PM
> *To:* Asterisk Users Mailing List - Non-Commercial Discussion
> *Subject:* Re: [asterisk-users] Asterisk Voicemail changes
>
>
>
> What about MiniVM? http://doxygen.asterisk.org/trunk/App_minivm.html
>
> Example: http://doxygen.asterisk.org/trunk/Config_minivm_examples.html
>
>
>
> That said, I don't know if it's actually actively developed or stable
> (docs last updated 2015 - Asterisk team?)
>
>
>
> Also make sure your Asterisk is up to date because of
> https://issues.asterisk.org/jira/browse/ASTERISK-27103
>
>
>
> On 31 August 2017 at 16:12, Tim Turpin <ttur...@z-harris.com> wrote:
>
> Is there a way that I can modify the source code for the voicemail
> application?  I need to change some of the options in the user’s interface
> to make it work like an existing system that I’m replacing.
>
>
>
> Thanks.
>
> Tim
>
>
> --
> _
> -- Bandwidth and Colocation Provided by http://www.api-digital.com --
>
> Check out the new Asterisk community forum at: https://community.asterisk.
> org/
>
> New to Asterisk? Start here:
>   https://wiki.asterisk.org/wiki/display/AST/Getting+Started
>
> asterisk-users mailing list
> To UNSUBSCRIBE or update options visit:
>http://lists.digium.com/mailman/listinfo/asterisk-users
>
>
>
> --
> _
> -- Bandwidth and Colocation Provided by http://www.api-digital.com --
>
> Check out the new Asterisk community forum at: https://community.asterisk.
> org/
>
> New to Asterisk? Start here:
>   https://wiki.asterisk.org/wiki/display/AST/Getting+Started
>
> asterisk-users mailing list
> To UNSUBSCRIBE or update options visit:
>http://lists.digium.com/mailman/listinfo/asterisk-users
>
-- 
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

Check out the new Asterisk community forum at: https://community.asterisk.org/

New to Asterisk? Start here:
  https://wiki.asterisk.org/wiki/display/AST/Getting+Started

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users

Re: [asterisk-users] Asterisk Voicemail changes

2017-08-31 Thread Jonathan H
What about MiniVM? http://doxygen.asterisk.org/trunk/App_minivm.html
Example: http://doxygen.asterisk.org/trunk/Config_minivm_examples.html

That said, I don't know if it's actually actively developed or stable (docs
last updated 2015 - Asterisk team?)

Also make sure your Asterisk is up to date because of
https://issues.asterisk.org/jira/browse/ASTERISK-27103

On 31 August 2017 at 16:12, Tim Turpin  wrote:

> Is there a way that I can modify the source code for the voicemail
> application?  I need to change some of the options in the user’s interface
> to make it work like an existing system that I’m replacing.
>
>
>
> Thanks.
>
> Tim
>
> --
> _
> -- Bandwidth and Colocation Provided by http://www.api-digital.com --
>
> Check out the new Asterisk community forum at: https://community.asterisk.
> org/
>
> New to Asterisk? Start here:
>   https://wiki.asterisk.org/wiki/display/AST/Getting+Started
>
> asterisk-users mailing list
> To UNSUBSCRIBE or update options visit:
>http://lists.digium.com/mailman/listinfo/asterisk-users
>
-- 
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

Check out the new Asterisk community forum at: https://community.asterisk.org/

New to Asterisk? Start here:
  https://wiki.asterisk.org/wiki/display/AST/Getting+Started

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users

Re: [asterisk-users] Integration of Google Speech API V2

2017-07-19 Thread Jonathan H
Hi Rahul,

So sorry - I got interrupted. Anyway, this is the library I am using -
seems much smaller and uses the correct endpoints.

https://github.com/invitecomm/asterisk-speech-recog/tree/master/v1beta1

The link in that README is broken - I've put in a pull request, but
for now, the correct git repository for the API mentioned is
https://github.com/GoogleCloudPlatform/python-docs-samples/tree/master/speech/cloud-client

Hope that all makes sense!

On 19 July 2017 at 10:17, Rahul MathuR <rahul.ultim...@gmail.com> wrote:
> Hi Jonathan
>
> Thanks !
> That would indeed be wonderful, at this point I really do not care whether I
> need to use Python or Lua or JS.
>
> I was following http://zaf.github.io/asterisk-speech-recog/
> but hit a road end with (for the lack of sane word ) copulating Google's Key
>
>
>
> On Wed, Jul 19, 2017 at 2:28 PM, Jonathan H <lardconce...@gmail.com> wrote:
>>
>> Yes! But I can only tell you if you can use Python, as I used Google's own
>> demo code.
>>
>> If you can hold on for half an hour, I'll remove personal info and put a
>> version up on Github if you're interested?
>>
>>
>> On 19 July 2017 at 09:37, Rahul MathuR <rahul.ultim...@gmail.com> wrote:
>>>
>>> Hi,
>>>
>>> I'm trying to integrate Google cloud speech recognition v2 in it. I can
>>> get the audio recorded, have created Service key and API key but whenever I
>>> try to access it, I just get 403 access denied. I am at my wits end here.
>>>
>>> Has anybody tried it ? were you successful ? Could you please guide me
>>> how to do it ?
>>> I'll be grateful to you if this works !
>>>
>>>
>>>
>>> --
>>> Warm Regds.
>>> MathuRahul
>>>
>>> --
>>> _
>>> -- Bandwidth and Colocation Provided by http://www.api-digital.com --
>>>
>>> Check out the new Asterisk community forum at:
>>> https://community.asterisk.org/
>>>
>>> New to Asterisk? Start here:
>>>   https://wiki.asterisk.org/wiki/display/AST/Getting+Started
>>>
>>> asterisk-users mailing list
>>> To UNSUBSCRIBE or update options visit:
>>>http://lists.digium.com/mailman/listinfo/asterisk-users
>>
>>
>>
>> --
>> _
>> -- Bandwidth and Colocation Provided by http://www.api-digital.com --
>>
>> Check out the new Asterisk community forum at:
>> https://community.asterisk.org/
>>
>> New to Asterisk? Start here:
>>   https://wiki.asterisk.org/wiki/display/AST/Getting+Started
>>
>> asterisk-users mailing list
>> To UNSUBSCRIBE or update options visit:
>>http://lists.digium.com/mailman/listinfo/asterisk-users
>
>
>
>
> --
> Warm Regds.
> MathuRahul
>
> --
> _
> -- Bandwidth and Colocation Provided by http://www.api-digital.com --
>
> Check out the new Asterisk community forum at:
> https://community.asterisk.org/
>
> New to Asterisk? Start here:
>   https://wiki.asterisk.org/wiki/display/AST/Getting+Started
>
> asterisk-users mailing list
> To UNSUBSCRIBE or update options visit:
>http://lists.digium.com/mailman/listinfo/asterisk-users

-- 
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

Check out the new Asterisk community forum at: https://community.asterisk.org/

New to Asterisk? Start here:
  https://wiki.asterisk.org/wiki/display/AST/Getting+Started

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users


Re: [asterisk-users] Integration of Google Speech API V2

2017-07-19 Thread Jonathan H
Yes! But I can only tell you if you can use Python, as I used Google's own
demo code.

If you can hold on for half an hour, I'll remove personal info and put a
version up on Github if you're interested?


On 19 July 2017 at 09:37, Rahul MathuR  wrote:

> Hi,
>
> I'm trying to integrate Google cloud speech recognition v2 in it. I can
> get the audio recorded, have created Service key and API key but whenever I
> try to access it, I just get 403 access denied. I am at my wits end here.
>
> Has anybody tried it ? were you successful ? Could you please guide me how
> to do it ?
> I'll be grateful to you if this works !
>
>
>
> --
> Warm Regds.
> MathuRahul
>
> --
> _
> -- Bandwidth and Colocation Provided by http://www.api-digital.com --
>
> Check out the new Asterisk community forum at: https://community.asterisk.
> org/
>
> New to Asterisk? Start here:
>   https://wiki.asterisk.org/wiki/display/AST/Getting+Started
>
> asterisk-users mailing list
> To UNSUBSCRIBE or update options visit:
>http://lists.digium.com/mailman/listinfo/asterisk-users
>
-- 
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

Check out the new Asterisk community forum at: https://community.asterisk.org/

New to Asterisk? Start here:
  https://wiki.asterisk.org/wiki/display/AST/Getting+Started

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users

Re: [asterisk-users] Asterisk Wiki down?

2017-07-09 Thread Jonathan H
Definitely not just you - not working for me either, and tested from a
few ping sites too

On 9 July 2017 at 20:39, Dovid Bender  wrote:
> I am tryint to get to
> https://wiki.asterisk.org/wiki/display/AST/Function_REGEX both via V6 and v4
> and it seems to be timing out.
>
>
>
> --
> _
> -- Bandwidth and Colocation Provided by http://www.api-digital.com --
>
> Check out the new Asterisk community forum at:
> https://community.asterisk.org/
>
> New to Asterisk? Start here:
>   https://wiki.asterisk.org/wiki/display/AST/Getting+Started
>
> asterisk-users mailing list
> To UNSUBSCRIBE or update options visit:
>http://lists.digium.com/mailman/listinfo/asterisk-users

-- 
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

Check out the new Asterisk community forum at: https://community.asterisk.org/

New to Asterisk? Start here:
  https://wiki.asterisk.org/wiki/display/AST/Getting+Started

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users


Re: [asterisk-users] Simplest way of executing a non-blocking (async) python AGI script?

2017-07-01 Thread Jonathan H
Oh wow - thank you SO much Marcelo.

This works perfectly - exactly as I wanted. Don't think I'd have
figured it out, though.

Well, that ticket says "not a bug" if this isn't a bug, then
"behaviour which differs dramatically from that which is expected"
would definitely be the tag.

Again, this fix works, and thank you!



On 30 June 2017 at 23:18, Marcelo Terres <mhter...@gmail.com> wrote:
> Take a look on that:
>
> https://issues.asterisk.org/jira/browse/ASTERISK-20532
>
> Regards,
> Marcelo H. Terres <mhter...@gmail.com>
> IM: mhter...@jabber.mundoopensource.com.br
> https://www.mundoopensource.com.br
> https://twitter.com/mhterres
> https://linkedin.com/in/marceloterres
>
>
> On 30 June 2017 at 22:23, Jonathan H <lardconce...@gmail.com> wrote:
>> OK, I give up and come grovelling, "Fork" was suggested at 18:23, it's
>> now 22:20 and I have been through 4 different methods, all block with
>> a 2 second delay before returning to dialplan.
>>
>> Here are just some of the examples I have tried, as as per the
>> suggestions, I am closing all possible outputs in the forked process.
>>
>> https://docs.python.org/3.5/library/multiprocessing.html
>> https://docs.python.org/3.5/library/multiprocessing.html?highlight=multiprocessing#multiprocessing.Process.join
>> https://stackoverflow.com/questions/19747371/python-exit-commands-why-so-many-and-when-should-each-be-used
>> https://stackoverflow.com/questions/27624850/launch-a-completely-independent-process
>> https://stackoverflow.com/questions/13612434/why-are-the-methods-sys-exit-exit-raise-systemexit-not-working
>> https://stackoverflow.com/questions/43280947/os-fork-share-local-variable-with-parent
>> https://stackoverflow.com/questions/24052217/may-someone-explain-the-following-os-fork-example-to-me
>> http://www.python-course.eu/forking.php
>> https://pymotw.com/3/subprocess/
>> http://code.activestate.com/recipes/186101-really-closing-stdin-stdout-stderr/
>>
>> This is the most likely looking code based on the examples. I would
>> really, really appreciate a couple of pointers as to where I might be
>> going wrong:
>>
>> #! /usr/bin/env python3
>> # -*- coding: utf-8 -*-
>>
>> import multiprocessing as mp
>> import time
>> import sys
>> import os
>>
>> #from asterisk.agi import AGI
>> #agi = AGI()
>>
>> def f(name):
>> sys.stdin.close()
>> sys.stdout.close()
>> sys.stderr.close()
>> os.close(0)   # close C's stdin stream
>> os.close(1)   # close C's stdout stream
>> os.close(2)   # close C's stderr stream
>> time.sleep(2)
>> f = open('/var/lib/asterisk/agi-bin/tns/testing/testout.txt', 'w')
>> f.write(name)
>> f.close()
>>
>>
>> if __name__ == '__main__':
>> print('before process')
>> mp.set_start_method('fork')
>> q = mp.Queue()
>> p = mp.Process(target=f, args=('asterisk',))
>> p.start()
>> sys.exit()
>>
>> On 30 June 2017 at 19:59, J Montoya or A J Stiles
>> <asterisk_l...@earthshod.co.uk> wrote:
>>> On Friday 30 Jun 2017, Jonathan H wrote:
>>>> What's the simplest, easiest quickest least-code way of firing off an AGI
>>>> with some variable, and then returning to the dialplan?
>>>
>>> You have to use the "fork" command.  This starts a copy of the process with
>>> all the same internal state including variables and filehandles.  The 
>>> command
>>> returns a non-zero value  (which is the PID of the child process; you may 
>>> need
>>> this, if you plan to outlive your children and have to clear their entries
>>> from the process table)  to the parent process, and zero to the child 
>>> process.
>>> So in the parent, you exit and return to the dialplan; and in the child, you
>>> close STDIN, STDOUT and STDERR  (so no process is waiting for you to produce
>>> output),  then just take your time doing what you have to.  The parent is
>>> already long dead by this time, so exiting goes nowhere.
>>>
>>>> I've seen people talking about fastAGI, stasis, python ASYNC... all seems
>>>> rather complicated. I feel I must be missing something embarrassingly
>>>> obvious - isn't there just the equivalent of the unix shell's "&"?!
>>>
>>> Yes, fork!  That is what the "&" operator is using "under the bonnet".
>>>
>>> --
>>> JKLM
>>>
>>> Note:  Originating address only accepts e

Re: [asterisk-users] Simplest way of executing a non-blocking (async) python AGI script?

2017-06-30 Thread Jonathan H
OK, I give up and come grovelling, "Fork" was suggested at 18:23, it's
now 22:20 and I have been through 4 different methods, all block with
a 2 second delay before returning to dialplan.

Here are just some of the examples I have tried, as as per the
suggestions, I am closing all possible outputs in the forked process.

https://docs.python.org/3.5/library/multiprocessing.html
https://docs.python.org/3.5/library/multiprocessing.html?highlight=multiprocessing#multiprocessing.Process.join
https://stackoverflow.com/questions/19747371/python-exit-commands-why-so-many-and-when-should-each-be-used
https://stackoverflow.com/questions/27624850/launch-a-completely-independent-process
https://stackoverflow.com/questions/13612434/why-are-the-methods-sys-exit-exit-raise-systemexit-not-working
https://stackoverflow.com/questions/43280947/os-fork-share-local-variable-with-parent
https://stackoverflow.com/questions/24052217/may-someone-explain-the-following-os-fork-example-to-me
http://www.python-course.eu/forking.php
https://pymotw.com/3/subprocess/
http://code.activestate.com/recipes/186101-really-closing-stdin-stdout-stderr/

This is the most likely looking code based on the examples. I would
really, really appreciate a couple of pointers as to where I might be
going wrong:

#! /usr/bin/env python3
# -*- coding: utf-8 -*-

import multiprocessing as mp
import time
import sys
import os

#from asterisk.agi import AGI
#agi = AGI()

def f(name):
sys.stdin.close()
sys.stdout.close()
sys.stderr.close()
os.close(0)   # close C's stdin stream
os.close(1)   # close C's stdout stream
os.close(2)   # close C's stderr stream
time.sleep(2)
f = open('/var/lib/asterisk/agi-bin/tns/testing/testout.txt', 'w')
f.write(name)
f.close()


if __name__ == '__main__':
print('before process')
mp.set_start_method('fork')
q = mp.Queue()
p = mp.Process(target=f, args=('asterisk',))
p.start()
sys.exit()

On 30 June 2017 at 19:59, J Montoya or A J Stiles
<asterisk_l...@earthshod.co.uk> wrote:
> On Friday 30 Jun 2017, Jonathan H wrote:
>> What's the simplest, easiest quickest least-code way of firing off an AGI
>> with some variable, and then returning to the dialplan?
>
> You have to use the "fork" command.  This starts a copy of the process with
> all the same internal state including variables and filehandles.  The command
> returns a non-zero value  (which is the PID of the child process; you may need
> this, if you plan to outlive your children and have to clear their entries
> from the process table)  to the parent process, and zero to the child process.
> So in the parent, you exit and return to the dialplan; and in the child, you
> close STDIN, STDOUT and STDERR  (so no process is waiting for you to produce
> output),  then just take your time doing what you have to.  The parent is
> already long dead by this time, so exiting goes nowhere.
>
>> I've seen people talking about fastAGI, stasis, python ASYNC... all seems
>> rather complicated. I feel I must be missing something embarrassingly
>> obvious - isn't there just the equivalent of the unix shell's "&"?!
>
> Yes, fork!  That is what the "&" operator is using "under the bonnet".
>
> --
> JKLM
>
> Note:  Originating address only accepts e-mail from list!  If replying off-
> list, change address to asterisk1list at earthshod dot co dot uk .
>
> --
> _
> -- Bandwidth and Colocation Provided by http://www.api-digital.com --
>
> Check out the new Asterisk community forum at: https://community.asterisk.org/
>
> New to Asterisk? Start here:
>   https://wiki.asterisk.org/wiki/display/AST/Getting+Started
>
> asterisk-users mailing list
> To UNSUBSCRIBE or update options visit:
>http://lists.digium.com/mailman/listinfo/asterisk-users

-- 
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

Check out the new Asterisk community forum at: https://community.asterisk.org/

New to Asterisk? Start here:
  https://wiki.asterisk.org/wiki/display/AST/Getting+Started

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users


[asterisk-users] Simplest way of executing a non-blocking (async) python AGI script?

2017-06-30 Thread Jonathan H
I use a python AGI which pulls some info from a web service, which should
take half a second.

Sometimes, it takes 5-10 seconds which blocks the dialplan execution, but
the dialplan should continue immediately as it's not dependent on the
AGI/web service data.

What's the simplest, easiest quickest least-code way of firing off an AGI
with some variable, and then returning to the dialplan?

I've seen people talking about fastAGI, stasis, python ASYNC... all seems
rather complicated. I feel I must be missing something embarrassingly
obvious - isn't there just the equivalent of the unix shell's "&"?!

Thanks.

(I'm using pyst2 if it matters)
-- 
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

Check out the new Asterisk community forum at: https://community.asterisk.org/

New to Asterisk? Start here:
  https://wiki.asterisk.org/wiki/display/AST/Getting+Started

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users

Re: [asterisk-users] Difference between Application Set and Function SET?

2017-06-16 Thread Jonathan H
OK, thanks. That sort of makes sense. Is it case sensitive?

Bonus quickie while I'm here (not worth own thread) - Asterisklint
complains that:

H_PAT_NON_CANONICAL: pattern '_#' is not in the canonical form '#'

for the line

exten => _#,1,Goto(s,1)

I'm sure I read somewhere it should be _#.

Am I imagining it?!

On 16 June 2017 at 19:17, Richard Kenner  wrote:
>> It was only when I ran AsteriskLint over my dialplan that I noticed this:
>>
>> https://wiki.asterisk.org/wiki/display/AST/Asterisk+14+Application_Set
>> https://wiki.asterisk.org/wiki/display/AST/Asterisk+14+Function_SET
>>
>> Hmmm, they both seem to do the same thing. Or don't they?
>
> In some sense they do, but one's an application, meaning that it's
> like a subprogram in a programming-language sense, and the other is a
> function, which returns a value.
>
> --
> _
> -- Bandwidth and Colocation Provided by http://www.api-digital.com --
>
> Check out the new Asterisk community forum at: https://community.asterisk.org/
>
> New to Asterisk? Start here:
>   https://wiki.asterisk.org/wiki/display/AST/Getting+Started
>
> asterisk-users mailing list
> To UNSUBSCRIBE or update options visit:
>http://lists.digium.com/mailman/listinfo/asterisk-users

-- 
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

Check out the new Asterisk community forum at: https://community.asterisk.org/

New to Asterisk? Start here:
  https://wiki.asterisk.org/wiki/display/AST/Getting+Started

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users


[asterisk-users] Difference between Application Set and Function SET?

2017-06-16 Thread Jonathan H
It was only when I ran AsteriskLint over my dialplan that I noticed this:

https://wiki.asterisk.org/wiki/display/AST/Asterisk+14+Application_Set
https://wiki.asterisk.org/wiki/display/AST/Asterisk+14+Function_SET

Hmmm, they both seem to do the same thing. Or don't they?

Confused!

-- 
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

Check out the new Asterisk community forum at: https://community.asterisk.org/

New to Asterisk? Start here:
  https://wiki.asterisk.org/wiki/display/AST/Getting+Started

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users


Re: [asterisk-users] OT: Explain where mailing list bouncing comes from ?

2017-06-16 Thread Jonathan H
On 16 June 2017 at 08:38, J Montoya or A J Stiles
 wrote:

> It's hardly Digium's fault, if Google have decided that playing nicely with
> syntactically-valid messages doesn't fit their business model

Not really Gmail's fault, either.  Someone above said they had the
same problem with Comcast.net.

Gmail complies with the relevant RFCs just fine. It's most likely
simply because most people who use email, use Gmail.

In addition, gmail properly implement SPF and DMARC checking.

There's over 1 billion gmail account as of 2016, so that's why most
people who are bouncing would be gmail.

-- 
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

Check out the new Asterisk community forum at: https://community.asterisk.org/

New to Asterisk? Start here:
  https://wiki.asterisk.org/wiki/display/AST/Getting+Started

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users


Re: [asterisk-users] OT: Explain where mailing list bouncing comes from ?

2017-06-12 Thread Jonathan H
Me too, also gmail. I emailed the list owner a couple of days ago, but no reply.

Is everyone else affected also forwarding to another email address
(gmail or not)?

Could be wrong, but I'm guessing there may be an incorrect DMARC
policy somewhere - although this is the only fail I could find in the
headers.

boun...@lists.digium.com;
   dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=gmail.com



On 12 June 2017 at 09:12, Steve Davies  wrote:
> I am also getting this, three or four times in the last month after years of
> no problems.
>
> I agree that Gmail is the likely common factor, but I would love to have
> access to these bounce messages to know whether it is actually an
> overly-paranoid list server!
>
> Steve
>
> On Mon, 12 Jun 2017 at 09:09 Andrew Furey  wrote:
>>
>> Ditto; a Gmail issue?
>>
>> Andrew
>>
>> On 12 June 2017 at 16:00, Marcelo Terres  wrote:
>>>
>>> It is happening the same with me.
>>>
>>> Regards,
>>> Marcelo H. Terres 
>>> IM: mhter...@jabber.mundoopensource.com.br
>>> https://www.mundoopensource.com.br
>>> https://twitter.com/mhterres
>>> https://linkedin.com/in/marceloterres
>>>
>>>
>>> On 12 June 2017 at 08:07, Olivier  wrote:
>>> > Hello,
>>> >
>>> > I'm a faithful reader of this mailing list, for several years now.
>>> >
>>> > Lately, I'm receiving emails asking me to re-enable my list
>>> > subscription due
>>> > to "excessive bouncing".
>>> >
>>> > What does this exactly mean and why am I receiving this ?
>>> > Beside re-enabling my subscription, what can I do to improve things ?
>>> >
>>> > Regards
>>> >
>>> > --
>>> > _
>>> > -- Bandwidth and Colocation Provided by http://www.api-digital.com --
>>> >
>>> > Check out the new Asterisk community forum at:
>>> > https://community.asterisk.org/
>>> >
>>> > New to Asterisk? Start here:
>>> >   https://wiki.asterisk.org/wiki/display/AST/Getting+Started
>>> >
>>> > asterisk-users mailing list
>>> > To UNSUBSCRIBE or update options visit:
>>> >http://lists.digium.com/mailman/listinfo/asterisk-users
>>>
>>> --
>>> _
>>> -- Bandwidth and Colocation Provided by http://www.api-digital.com --
>>>
>>> Check out the new Asterisk community forum at:
>>> https://community.asterisk.org/
>>>
>>> New to Asterisk? Start here:
>>>   https://wiki.asterisk.org/wiki/display/AST/Getting+Started
>>>
>>> asterisk-users mailing list
>>> To UNSUBSCRIBE or update options visit:
>>>http://lists.digium.com/mailman/listinfo/asterisk-users
>>
>>
>>
>>
>> --
>> Linux supports the notion of a command line or a shell for the same
>> reason that only children read books with only pictures in them.
>> Language, be it English or something else, is the only tool flexible
>> enough to accomplish a sufficiently broad range of tasks.
>>   -- Bill Garrett
>> --
>> _
>> -- Bandwidth and Colocation Provided by http://www.api-digital.com --
>>
>> Check out the new Asterisk community forum at:
>> https://community.asterisk.org/
>>
>> New to Asterisk? Start here:
>>   https://wiki.asterisk.org/wiki/display/AST/Getting+Started
>>
>> asterisk-users mailing list
>> To UNSUBSCRIBE or update options visit:
>>http://lists.digium.com/mailman/listinfo/asterisk-users
>
>
> --
> _
> -- Bandwidth and Colocation Provided by http://www.api-digital.com --
>
> Check out the new Asterisk community forum at:
> https://community.asterisk.org/
>
> New to Asterisk? Start here:
>   https://wiki.asterisk.org/wiki/display/AST/Getting+Started
>
> asterisk-users mailing list
> To UNSUBSCRIBE or update options visit:
>http://lists.digium.com/mailman/listinfo/asterisk-users

-- 
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

Check out the new Asterisk community forum at: https://community.asterisk.org/

New to Asterisk? Start here:
  https://wiki.asterisk.org/wiki/display/AST/Getting+Started

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users


Re: [asterisk-users] Best way to know a call is being transfered

2017-05-29 Thread Jonathan H
Well, once you've upgraded to a version of Asterisk which didn't
become "EOL - DO NOT USE - NO FIXES" (!) almost 2 years ago, then you
might be able use logging which was introduced 5 years ago in Asterisk
11. Although the "transfers" section in the info below says it "can be
a little tricky...". Read on!

https://wiki.asterisk.org/wiki/display/AST/Call+Identifier+Logging



Call ID Logging (which has nothing to do with caller ID) is a new
feature of Asterisk 11 intended to help administrators and support
givers to more quickly understand problems that occur during the
course of calls. Channels are now bound to call identifiers which can
be shared among a number of channels, threads, and other consumers.

Transfers

Transfers can be a little tricky to follow with the call ID logging
feature. As a general rule, an attended transfer will always result in
a new call ID being made because a separate call must occur between
the party that initiates the transfer and whatever extension is going
to receive it. Once the attended transfer is completed, the channel
that was transferred will use the Call ID created when the transferrer
called the recipient.

Blind transfers are slightly more variable. If a SIP peer 'peer1'
calls another SIP peer 'peer2' via the dial application and peer2
blind transfers peer1 elsewhere, the call ID will persist. If on the
other hand, peer1 blind transfers peer2 at this point a new call ID
will be created. When peer1 transfers peer2, peer2 has a new channel
created which enters the PBX for the first time, so it creates a new
call ID. When peer1 is transferred, it simply resumes running PBX, so
the call is still considered the same call. By setting the debug level
to 3 for the channel internal API (channel_internal_api.c), all call
ID settings for every channel will be logged and this may be able to
help when trying to keep track of calls through multiple transfers.


On 29 May 2017 at 08:17, Jonas Kellens  wrote:
> Hello
>
> using Asterisk 1.8.32.3.
>
> What is the best way of knowing a call is being transfered (attended and
> unattended) ? And also knowing whereto (sip user) the call is being
> transfered and who is the transferer ?
>
> So I can log this information.
>
>
>
> Kind regards.
>
> J.
>
>
> --
> _
> -- Bandwidth and Colocation Provided by http://www.api-digital.com --
>
> Check out the new Asterisk community forum at:
> https://community.asterisk.org/
>
> New to Asterisk? Start here:
>   https://wiki.asterisk.org/wiki/display/AST/Getting+Started
>
> asterisk-users mailing list
> To UNSUBSCRIBE or update options visit:
>http://lists.digium.com/mailman/listinfo/asterisk-users

-- 
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

Check out the new Asterisk community forum at: https://community.asterisk.org/

New to Asterisk? Start here:
  https://wiki.asterisk.org/wiki/display/AST/Getting+Started

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users


Re: [asterisk-users] Can't compile asterisk-certified-11.6-cert16 on Ubuntu 16

2017-04-29 Thread Jonathan H
Sure, so why not install the current supported certified 13.13-cert 3
which he confirms builds OK, rather than the about-to-become-EOL 11
version?

http://www.asterisk.org/downloads/asterisk/all-asterisk-versions

On 29 April 2017 at 17:11, Jeff LaCoursiere <j...@jeff.net> wrote:
> On 04/29/2017 10:57 AM, Jonathan H wrote:
>>
>> On 29 April 2017 at 16:47, Tech Support <aster...@voipbusiness.us> wrote:
>>
>>> I’m trying to install certified asterisk 11.6 cert16 on a Ubuntu 16
>>> server. However, when I try to compile it, I’m getting hundreds and hundreds
>>> of errors. Here is a sample of the output.
>>> When I try to build Asterisk 13, I have no problem. Any insight at all
>>> would be greatly appreciated.
>>
>> I suppose the first and most obvious question would be:
>>
>> If the current version installs fine, why would you want to install an
>> old obsolete version which is currently subject to an end of life
>> warning?
>>
>> https://community.asterisk.org/t/asterisk-11-eol-6-month-notice/70490
>>
>> "As many of you know, for the past 6 months Asterisk 11 has been in
>> security
>> fix only mode. This means it currently does not receive bug fixes,
>> but it does receive applicable security fixes and will continue to do
>> so for the next 6 months."
>>
> Probably because he wants to run certified...
>
>
> --
> _
> -- Bandwidth and Colocation Provided by http://www.api-digital.com --
>
> Check out the new Asterisk community forum at:
> https://community.asterisk.org/
>
> New to Asterisk? Start here:
>  https://wiki.asterisk.org/wiki/display/AST/Getting+Started
>
> asterisk-users mailing list
> To UNSUBSCRIBE or update options visit:
>   http://lists.digium.com/mailman/listinfo/asterisk-users

-- 
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

Check out the new Asterisk community forum at: https://community.asterisk.org/

New to Asterisk? Start here:
  https://wiki.asterisk.org/wiki/display/AST/Getting+Started

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users

Re: [asterisk-users] Can't compile asterisk-certified-11.6-cert16 on Ubuntu 16

2017-04-29 Thread Jonathan H
On 29 April 2017 at 16:47, Tech Support  wrote:

> I’m trying to install certified asterisk 11.6 cert16 on a Ubuntu 16 server. 
> However, when I try to compile it, I’m getting hundreds and hundreds of 
> errors. Here is a sample of the output.
> When I try to build Asterisk 13, I have no problem. Any insight at all would 
> be greatly appreciated.

I suppose the first and most obvious question would be:

If the current version installs fine, why would you want to install an
old obsolete version which is currently subject to an end of life
warning?

https://community.asterisk.org/t/asterisk-11-eol-6-month-notice/70490

"As many of you know, for the past 6 months Asterisk 11 has been in security
fix only mode. This means it currently does not receive bug fixes,
but it does receive applicable security fixes and will continue to do
so for the next 6 months."

-- 
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

Check out the new Asterisk community forum at: https://community.asterisk.org/

New to Asterisk? Start here:
  https://wiki.asterisk.org/wiki/display/AST/Getting+Started

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users

Re: [asterisk-users] Can't compile Asterisk on Ubuntu 16

2017-04-19 Thread Jonathan H
I don't - it just seems to.. work!

Try a reboot - it always comes up OK for me. Are you doing "make install"?

On 19 April 2017 at 14:19, Tech Support <aster...@voipbusiness.us> wrote:

> Hey;
>Thank you very much. I was able to install asterisk from your link. One
> other question. How are you starting asterisk? Do you use an init script or
> systemd? Do you think that you could share the script you use?
> Thanks Again;
> John V.
>
> -Original Message-
> From: asterisk-users-boun...@lists.digium.com
> [mailto:asterisk-users-boun...@lists.digium.com] On Behalf Of Jonathan H
> Sent: Tuesday, April 18, 2017 09:10 AM
> To: Asterisk Users Mailing List - Non-Commercial Discussion
> Subject: Re: [asterisk-users] Can't compile Asterisk on Ubuntu 16
>
> Feel free to take a look at
> https://github.com/lardconcepts/asterisk-digitalocean-voipfone-config/
> blob/m
> aster/Asterisk-14-on-Ubuntu.md
>
> Ignore the bit about Voipfone and just skip to the "Install Asterisk" bit.
>
> I've used this same script with Asterisk 12,13 and 14 on Ubuntu 15,16 and
> 17
> so this should work!
>
> Let me know how you get on.
>
> On 18 April 2017 at 13:41, Tech Support <aster...@voipbusiness.us> wrote:
> > All;
> >
> > I am trying to build and install certified Asterisk 13.13 cert3 on
> > a Ubuntu 16.04.2 LTS host without much success. I am getting the
> > following errors when I try to compile.
> >
> >
> >
> >[CC] res_pjsip/config_transport.c -> res_pjsip/config_transport.o
> >
> > res_pjsip/config_transport.c: In function 'transport_apply':
> >
> > res_pjsip/config_transport.c:572:6: error: 'pjsip_tcp_transport_cfg
> > {aka struct pjsip_tcp_transport_cfg}' has no member named
> 'sockopt_params'
> >
> >cfg.sockopt_params.options[0].level = pj_SOL_TCP();
> >
> >   ^
> >
> > res_pjsip/config_transport.c:573:6: error: 'pjsip_tcp_transport_cfg
> > {aka struct pjsip_tcp_transport_cfg}' has no member named
> 'sockopt_params'
> >
> >cfg.sockopt_params.options[0].optname = pj_TCP_NODELAY();
> >
> >   ^
> >
> > res_pjsip/config_transport.c:574:6: error: 'pjsip_tcp_transport_cfg
> > {aka struct pjsip_tcp_transport_cfg}' has no member named
> 'sockopt_params'
> >
> >cfg.sockopt_params.options[0].optval = 
> >
> >   ^
> >
> > res_pjsip/config_transport.c:575:6: error: 'pjsip_tcp_transport_cfg
> > {aka struct pjsip_tcp_transport_cfg}' has no member named
> 'sockopt_params'
> >
> >cfg.sockopt_params.options[0].optlen = sizeof(option);
> >
> >   ^
> >
> > res_pjsip/config_transport.c:576:6: error: 'pjsip_tcp_transport_cfg
> > {aka struct pjsip_tcp_transport_cfg}' has no member named
> 'sockopt_params'
> >
> >cfg.sockopt_params.cnt = 1;
> >
> >   ^
> >
> > /usr/src/asterisk-certified-13.13-cert3/Makefile.rules:149: recipe for
> > target 'res_pjsip/config_transport.o' failed
> >
> > make[1]: *** [res_pjsip/config_transport.o] Error 1
> >
> > Makefile:402: recipe for target 'res' failed
> >
> > make: *** [res] Error 2
> >
> >
> >
> > Has anyone seen this error before? Any insight at all would be greatly
> > appreciated.
> >
> > Thanks;
> >
> > John V.
> >
> >
> >
> > Tech Support
> >
> > Tech Support
> >
> > VoIP Business Solutions
> >
> > 240-215-3479 x325
> >
> > supp...@voipbusiness.us
> >
> >
> >
> >
> > --
> > _
> > -- Bandwidth and Colocation Provided by http://www.api-digital.com --
> >
> > Check out the new Asterisk community forum at:
> > https://community.asterisk.org/
> >
> > New to Asterisk? Start here:
> >   https://wiki.asterisk.org/wiki/display/AST/Getting+Started
> >
> > asterisk-users mailing list
> > To UNSUBSCRIBE or update options visit:
> >http://lists.digium.com/mailman/listinfo/asterisk-users
>
> --
> _
> -- Bandwidth and Colocation Provided by http://www.api-digital.com --
>
> Check out the new Asterisk community forum at:
> https://community.asterisk.org/
>
> New to Asterisk? Start here:
>   https://wiki.asterisk.org/wiki/display/AST/Getting+Started
>
> asterisk-users mailing list
> To UNSUBSCRIBE or update options visit:
>http://lists.digium.com/mailman/listinfo/asterisk-users
>
&g

Re: [asterisk-users] PBX selection

2017-04-18 Thread Jonathan H
On 18 April 2017 at 09:40, J Montoya or A J Stiles
 wrote:
>
> It is always preferrable to compile your own Asterisk to fit your hardware and
> include just the bits you want, rather than rely on anyone else's pre-compiled
> package.

Feel free to take a look at
https://github.com/lardconcepts/asterisk-digitalocean-voipfone-config/blob/master/Asterisk-14-on-Ubuntu.md

Ignore the bit about Voipfone and just skip to the "Install Asterisk" bit.

I've used this same script with Asterisk 12,13 and 14 on Ubuntu 15,16
and 17 so this should work!

Let me know how you get on. And if anyone spots anything wrong on
there, let me know!

-- 
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

Check out the new Asterisk community forum at: https://community.asterisk.org/

New to Asterisk? Start here:
  https://wiki.asterisk.org/wiki/display/AST/Getting+Started

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users


Re: [asterisk-users] Can't compile Asterisk on Ubuntu 16

2017-04-18 Thread Jonathan H
Feel free to take a look at
https://github.com/lardconcepts/asterisk-digitalocean-voipfone-config/blob/master/Asterisk-14-on-Ubuntu.md

Ignore the bit about Voipfone and just skip to the "Install Asterisk" bit.

I've used this same script with Asterisk 12,13 and 14 on Ubuntu 15,16
and 17 so this should work!

Let me know how you get on.

On 18 April 2017 at 13:41, Tech Support  wrote:
> All;
>
> I am trying to build and install certified Asterisk 13.13 cert3 on a
> Ubuntu 16.04.2 LTS host without much success. I am getting the following
> errors when I try to compile.
>
>
>
>[CC] res_pjsip/config_transport.c -> res_pjsip/config_transport.o
>
> res_pjsip/config_transport.c: In function 'transport_apply':
>
> res_pjsip/config_transport.c:572:6: error: 'pjsip_tcp_transport_cfg {aka
> struct pjsip_tcp_transport_cfg}' has no member named 'sockopt_params'
>
>cfg.sockopt_params.options[0].level = pj_SOL_TCP();
>
>   ^
>
> res_pjsip/config_transport.c:573:6: error: 'pjsip_tcp_transport_cfg {aka
> struct pjsip_tcp_transport_cfg}' has no member named 'sockopt_params'
>
>cfg.sockopt_params.options[0].optname = pj_TCP_NODELAY();
>
>   ^
>
> res_pjsip/config_transport.c:574:6: error: 'pjsip_tcp_transport_cfg {aka
> struct pjsip_tcp_transport_cfg}' has no member named 'sockopt_params'
>
>cfg.sockopt_params.options[0].optval = 
>
>   ^
>
> res_pjsip/config_transport.c:575:6: error: 'pjsip_tcp_transport_cfg {aka
> struct pjsip_tcp_transport_cfg}' has no member named 'sockopt_params'
>
>cfg.sockopt_params.options[0].optlen = sizeof(option);
>
>   ^
>
> res_pjsip/config_transport.c:576:6: error: 'pjsip_tcp_transport_cfg {aka
> struct pjsip_tcp_transport_cfg}' has no member named 'sockopt_params'
>
>cfg.sockopt_params.cnt = 1;
>
>   ^
>
> /usr/src/asterisk-certified-13.13-cert3/Makefile.rules:149: recipe for
> target 'res_pjsip/config_transport.o' failed
>
> make[1]: *** [res_pjsip/config_transport.o] Error 1
>
> Makefile:402: recipe for target 'res' failed
>
> make: *** [res] Error 2
>
>
>
> Has anyone seen this error before? Any insight at all would be greatly
> appreciated.
>
> Thanks;
>
> John V.
>
>
>
> Tech Support
>
> Tech Support
>
> VoIP Business Solutions
>
> 240-215-3479 x325
>
> supp...@voipbusiness.us
>
>
>
>
> --
> _
> -- Bandwidth and Colocation Provided by http://www.api-digital.com --
>
> Check out the new Asterisk community forum at:
> https://community.asterisk.org/
>
> New to Asterisk? Start here:
>   https://wiki.asterisk.org/wiki/display/AST/Getting+Started
>
> asterisk-users mailing list
> To UNSUBSCRIBE or update options visit:
>http://lists.digium.com/mailman/listinfo/asterisk-users

-- 
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

Check out the new Asterisk community forum at: https://community.asterisk.org/

New to Asterisk? Start here:
  https://wiki.asterisk.org/wiki/display/AST/Getting+Started

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users


[asterisk-users] Any way of limiting incoming caller connection time without making 2 active calls for each incoming call?

2017-04-16 Thread Jonathan H
The following setup prevents callers from going over 59 minutes:

--

[setup]
exten => setup,1,Answer()
same => n,Set(LIMIT_PLAYAUDIO_CALLER=yes)
same => 
n,Set(LIMIT_WARNING_FILE=/var/lib/asterisk/sounds/en_GB_TNS/time_limit_reached)
same => n,Dial(Local/s@root/n,3,L(354:6))
same => n,Hangup()

[root]

exten => s,1,Verbose(Call to: ${CALLERID(name)} from: ${CALLERID(num)})
same => n,etc etc

--

Thing is, each call shows as 2 calls in the console. Not a big
problem, but also now I want to offer a way of overriding that time
limit.

Is there a different or better way of doing this while still hanging
up after 59 minutes, even when the original incoming call has been
transferred elsewhere?

Thanks.

-- 
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

Check out the new Asterisk community forum at: https://community.asterisk.org/

New to Asterisk? Start here:
  https://wiki.asterisk.org/wiki/display/AST/Getting+Started

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users


[asterisk-users] Any way to clear ALL gosub stacks without knowing what they are?

2017-04-01 Thread Jonathan H
Any way of clearing ALL gosub stacks in dialplan?

Thanks.
-- 
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

Check out the new Asterisk community forum at: https://community.asterisk.org/

New to Asterisk? Start here:
  https://wiki.asterisk.org/wiki/display/AST/Getting+Started

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users

Re: [asterisk-users] SipVicious scans getting through iptables firewall - but how?

2017-03-28 Thread Jonathan H
OK, I understand, Clever - I didn't know anything could read packets before
iptables.

And sorry about the formatting - I tried to make it all neat, but it looks
like it got excessively word wrapped.

Thanks for putting my mind at ease.

On 28 March 2017 at 16:12, Andres <and...@telesip.net> wrote:

> On 3/28/17 9:32 AM, Jonathan H wrote:
>
>> My firewall and asterisk pjsip config only has "permit" options for my
>> ITSP's (SIP trunk) IPs.
>>
>> Here's the script that sets it up.
>>
>> --
>> #!/bin/bash
>> EXIF="eth0"
>>
>> /sbin/iptables --flush
>> /sbin/iptables --policy INPUT DROP
>> /sbin/iptables --policy OUTPUT ACCEPT
>> /sbin/iptables -A INPUT -i lo -j ACCEPT
>> /sbin/iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
>> /sbin/iptables -A INPUT -p tcp ! --syn -m state --state NEW -j DROP
>> /sbin/iptables -A INPUT -f -j DROP
>> /sbin/iptables -A INPUT -p tcp --tcp-flags ALL ALL -j REJECT
>> /sbin/iptables -A INPUT -p tcp --tcp-flags ALL NONE -j DROP
>>
>> # Voipfone
>> /sbin/iptables -A INPUT -p tcp -i $EXIF -m state --state NEW -s
>> 195.189.173.0/24 -j ACCEPT
>> /sbin/iptables -A INPUT -p udp -i $EXIF -m state --state NEW -s
>> 195.189.173.0/24 -j ACCEPT
>> /sbin/iptables -A INPUT -p tcp -i $EXIF -m state --state NEW -s
>> 46.31.225.0/24 -j ACCEPT
>> /sbin/iptables -A INPUT -p udp -i $EXIF -m state --state NEW -s
>> 46.31.225.0/24 -j ACCEPT
>> /sbin/iptables -A INPUT -p tcp -i $EXIF -m state --state NEW -s
>> 46.31.231.0/24 -j ACCEPT
>> /sbin/iptables -A INPUT -p udp -i $EXIF -m state --state NEW -s
>> 46.31.231.0/24 -j ACCEPT
>>
>> # my SSH
>> /sbin/iptables -A INPUT -p tcp --dport 22XXX -m conntrack --ctstate
>> NEW,ESTABLISHED -j ACCEPT
>> /sbin/iptables -A OUTPUT -p tcp --sport 22XXX -m conntrack --ctstate
>> ESTABLISHED -j ACCEPT
>>
>> # HTTP
>> /sbin/iptables -A INPUT -p tcp --dport 8443 -m conntrack --ctstate
>> NEW,ESTABLISHED -j ACCEPT
>> /sbin/iptables -A OUTPUT -p tcp --sport 8443 -m conntrack --ctstate
>> ESTABLISHED -j ACCEPT
>>
>>
>> # Allow icmp input so that people can ping us
>> /sbin/iptables -A INPUT -p icmp --icmp-type 8 -m state --state NEW -j
>> ACCEPT
>>
>> # Log then drop any packets that are not allowed. You will probably
>> want to turn off the logging
>> # /sbin/iptables -A INPUT -j LOG
>> /sbin/iptables -A INPUT -j REJECT
>>
>> --
>>
>> Then one day, sngrep was running in the background, and I noticed lots
>> of these...
>>
> ngrep and tcpdump will show you packets before they reach iptables, so you
> can see attacks like below.
> You should not see responses if the firewall is working and I don't see
> any responses below so you
> should be safe.
>
>
>>
>> OPTIONS sip:50901@46.101.X.X SIP/2.0
>> 163.172.210.65:508946.101.X.X:5060 │Via:
>> SIP/2.0/UDP 127.0.1.1:5089;branch=z9hG4bK-786048925;rport
>>──┬─  ──┬─│Content-Length:
>> 0
>>  │   OPTIONS   │ │From:
>> "sipvicious"<sip:100@1.1.1.1>;tag=32653635303466303133633401
>> 32333439343631383137
>>13:26:10.350316   │ ──> │ │Accept:
>> application/sdp
>>  │ │
>> │User-Agent: friendly-scanner
>>  │ │ │To:
>> "sipvicious"<sip:100@1.1.1.1>
>>  │ │ │Contact:
>> sip:50901@127.0.1.1:5089
>>  │ │ │CSeq: 1
>> OPTIONS
>>  │ │ │Call-ID:
>> 67968489840845542823418
>>  │ │
>>  │Max-Forwards: 70
>>
>> [ ] 4OPTIONS100@1.1.1.1   100@1.1.1.1
>>   1 163.172.210.65:508946.101.X.X:5060
>> [ ] 5OPTIONS100@1.1.1.1   100@1.1.1.1
>>   1 89.163.242.118:508946.101.X.X:5060
>> [ ] 6OPTIONS100@1.1.1.1   100@1.1.1.1
>>   1 142.54.162.58:5061 46.101.X.X:5060
>> [ ] 7OPTIONS100@1.1.1.1   100@1.1.1.1
>>   1 95.211.197.176:506546.101.X.X:5060
>>
>>
>> ---

[asterisk-users] SipVicious scans getting through iptables firewall - but how?

2017-03-28 Thread Jonathan H
My firewall and asterisk pjsip config only has "permit" options for my
ITSP's (SIP trunk) IPs.

Here's the script that sets it up.

--
#!/bin/bash
EXIF="eth0"

/sbin/iptables --flush
/sbin/iptables --policy INPUT DROP
/sbin/iptables --policy OUTPUT ACCEPT
/sbin/iptables -A INPUT -i lo -j ACCEPT
/sbin/iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
/sbin/iptables -A INPUT -p tcp ! --syn -m state --state NEW -j DROP
/sbin/iptables -A INPUT -f -j DROP
/sbin/iptables -A INPUT -p tcp --tcp-flags ALL ALL -j REJECT
/sbin/iptables -A INPUT -p tcp --tcp-flags ALL NONE -j DROP

# Voipfone
/sbin/iptables -A INPUT -p tcp -i $EXIF -m state --state NEW -s
195.189.173.0/24 -j ACCEPT
/sbin/iptables -A INPUT -p udp -i $EXIF -m state --state NEW -s
195.189.173.0/24 -j ACCEPT
/sbin/iptables -A INPUT -p tcp -i $EXIF -m state --state NEW -s
46.31.225.0/24 -j ACCEPT
/sbin/iptables -A INPUT -p udp -i $EXIF -m state --state NEW -s
46.31.225.0/24 -j ACCEPT
/sbin/iptables -A INPUT -p tcp -i $EXIF -m state --state NEW -s
46.31.231.0/24 -j ACCEPT
/sbin/iptables -A INPUT -p udp -i $EXIF -m state --state NEW -s
46.31.231.0/24 -j ACCEPT

# my SSH
/sbin/iptables -A INPUT -p tcp --dport 22XXX -m conntrack --ctstate
NEW,ESTABLISHED -j ACCEPT
/sbin/iptables -A OUTPUT -p tcp --sport 22XXX -m conntrack --ctstate
ESTABLISHED -j ACCEPT

# HTTP
/sbin/iptables -A INPUT -p tcp --dport 8443 -m conntrack --ctstate
NEW,ESTABLISHED -j ACCEPT
/sbin/iptables -A OUTPUT -p tcp --sport 8443 -m conntrack --ctstate
ESTABLISHED -j ACCEPT


# Allow icmp input so that people can ping us
/sbin/iptables -A INPUT -p icmp --icmp-type 8 -m state --state NEW -j ACCEPT

# Log then drop any packets that are not allowed. You will probably
want to turn off the logging
# /sbin/iptables -A INPUT -j LOG
/sbin/iptables -A INPUT -j REJECT

--

Then one day, sngrep was running in the background, and I noticed lots
of these...


OPTIONS sip:50901@46.101.X.X SIP/2.0
   163.172.210.65:508946.101.X.X:5060 │Via:
SIP/2.0/UDP 127.0.1.1:5089;branch=z9hG4bK-786048925;rport
  ──┬─  ──┬─│Content-Length: 0
│   OPTIONS   │ │From:
"sipvicious";tag=3265363530346630313363340132333439343631383137
  13:26:10.350316   │ ──> │ │Accept:
application/sdp
│ │
│User-Agent: friendly-scanner
│ │ │To:
"sipvicious"
│ │ │Contact:
sip:50901@127.0.1.1:5089
│ │ │CSeq: 1 OPTIONS
│ │ │Call-ID:
67968489840845542823418
│ │ │Max-Forwards: 70

[ ] 4OPTIONS100@1.1.1.1   100@1.1.1.1
 1 163.172.210.65:508946.101.X.X:5060
[ ] 5OPTIONS100@1.1.1.1   100@1.1.1.1
 1 89.163.242.118:508946.101.X.X:5060
[ ] 6OPTIONS100@1.1.1.1   100@1.1.1.1
 1 142.54.162.58:5061 46.101.X.X:5060
[ ] 7OPTIONS100@1.1.1.1   100@1.1.1.1
 1 95.211.197.176:506546.101.X.X:5060


-

This is what nmap from a remote machine can see:

Not shown: 65534 filtered ports
PORT STATE SERVICE
22XXX/tcp open  unknown
8443/tcp open  https-alt

--

How are these SipVicious probes getting through? Clearly the firewall
is misconfigured.. or maybe not?
I'm not seeing these warnings in Asterisk of course, as it's not
listening on these other ports.

Together with the allow/deny pjsip settings, I *think* I'm reasonably safe?

What bothers me is that don't understand how/why this is happening.
And that makes me nervous!

Thanks.

-- 
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

Check out the new Asterisk community forum at: https://community.asterisk.org/

New to Asterisk? Start here:
  https://wiki.asterisk.org/wiki/display/AST/Getting+Started

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users

Re: [asterisk-users] While loop inside recursive calls

2017-03-21 Thread Jonathan H
Well, I've never seen dialplan like that - is this a very old version
of Asterisk, or psuedocode?

Anyway..

A subroutine MUST be balanced, and if a subroutine is aborted before
it reaches return, you'll be in all sorts of hell.

An example:

You make a subroutine of some sound files you want to loop through to
make an IVR menu.

You call it using Gosub. Someone presses two while the third of 5
tracks is playing.

The stack will then be unbalanced and you'll then be in a potential
world of stack overflow and unknown hell.

So keep the gosubs for things where they cannot be interrupted.
Playback is fine. Background and ControlPlayback is not. See?

Here's a solution to this problem which caused me HUGE amounts of
headaches early on (and I mean days and nights on end!)

Hope it helps...
https://github.com/lardconcepts/asterisk-pbx-tips-and-snips/blob/master/gotchas-and-warnings.md

On 21 March 2017 at 17:31, Ethy H. Brito  wrote:
>
> Hi All
>
> What happens if I, inside of a while/endwhile loop, call recursively a
> macro that itself has another while/endwhile loop and calls exitwhile() 
> inside the
> recursive call?
>
> [macro-recursive]
> instance=$ARG1
> if instance>3
> macroexit
> X=1
> _var1=""
> ; recursive loop
> while(Dcondition)
> _var1=value_${X}
> recursive(instance+1)
> if var1==""
> ExitWhile()
> X=X+1
> some_Dcondition_changing
> bla...
> bla...
> EndWhile
> macroexit
>
> [some_running_context]
> ; Main loop
> while(Zcondition)
> recursive(1)
> if (var1=="")
> ExitWhile
> some_Zcondition_changing
> bla...
> bla...
> endwhile
> more_intructions
> MacroExit
>
> The problem I see is if I reentry "macro-recursive" a the second time,
> Macroexit returns to "more_instructions" at "some_running_context" (just after
> the Main Loop endWhile). It should return to 'if (var1=="")' at the previous
> "macro-recursive" call.
>
> It is like the second call to "macro-recursive" overwrites the first
> "macro-recursive" while/endwhile loop return point, and the second ExitWhile
> exits from the while/endwhile at "some_running_context" and not from first
> "macro-recursive" instance.
>
> In short: second (and subsequent??) call to macro-recursive is ExitWhile()ing
> from "some_running_context" while loop. First call exits ok.
>
> Any directions to share?
>
> Is this explanation too complicated to understand?
>
> Regards
>
> Ethy
>
> --
> _
> -- Bandwidth and Colocation Provided by http://www.api-digital.com --
>
> Check out the new Asterisk community forum at: https://community.asterisk.org/
>
> New to Asterisk? Start here:
>   https://wiki.asterisk.org/wiki/display/AST/Getting+Started
>
> asterisk-users mailing list
> To UNSUBSCRIBE or update options visit:
>http://lists.digium.com/mailman/listinfo/asterisk-users

-- 
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

Check out the new Asterisk community forum at: https://community.asterisk.org/

New to Asterisk? Start here:
  https://wiki.asterisk.org/wiki/display/AST/Getting+Started

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users


Re: [asterisk-users] Something similar to Doxygen for standard dialplan?

2017-03-18 Thread Jonathan H
Hey, that's great. I just tried the executable - seems to run OK.

I've also taken a look at the PDF - thank you again.

It's getting late here in the UK so I'm going to look more with a
fresh head tomorrow.

So, even if I do not actually build dialplan with this, I can still
use it to document existing dialplan, correct?

This looks like a really great tool and I wonder why I've not heard of
it before? I'll add it to my page of asterisk tips and links.

Is there anything else I need to know? Once again, thank you for
making what looks to be an excellent and valuable tool for the whole
community.




On 18 March 2017 at 21:17, Sebastian Gutierrez <scg...@gmail.com> wrote:
> Everything is now on release folder on GitHub, documentation and executable.
>
> Hope it helps
>
> On Mar 18, 2017, 20:17 +0100, Sebastian Gutierrez <scg...@gmail.com>, wrote:
>
> This should work with at least .net framework 4, no dependency needed, just
> .net framework, I think you should be able to compile it from a vs express
> version. If you are not able to let me know and next week I will build it
> for you and upload it as an artifact, in my Astricon 2015 talk (Workflows
> and Maintainability ) you can also see how to extend this very easily with
> your custom applications.
>
> Let me know if you need assistance.
>
> Best regards
>
>
> On Mar 18, 2017, 20:13 +0100, Jonathan H <lardconce...@gmail.com>, wrote:
>
> Hi, thanks - that looks really good!
>
> I was about to embark on some non-visual stuff using Ragic, but this
> looks great.
>
> Is there a binary anywhere, or any instructions to compile? I've never
> compiled C# code before, and although a quick google suggests it
> shouldn't be too hard, I might need to know a few things like what
> version of .net it should be compiled with.
>
> The readme just points to the website.
>
> Thanks!
>
> On 18 March 2017 at 18:57, Sebastian Gutierrez <scg...@gmail.com> wrote:
>
> Check this one:
>
> https://github.com/IntegraCCS/integradesigner
>
> You can do many things, document each node, and save xml with each
> extension.
> We´ve made it open source on Astricon 2015 you can extend it the way you
> want.
>
> Hope it helps you.
>
> Best regards
>
>
>
>
> On Mar 18, 2017, 12:50 +0100, Jonathan H <lardconce...@gmail.com>, wrote:
>
> How are we all documenting complex dialplan?
>
> Is there something similar to Doxygen?
>
> I've got around 20 config files covering around 60 contexts and 40
> variables. Of course, I've maintained a basic list of the major stuff,
> and documented the code throughout, but it's grown to the stage where
> it needs to be better documented, have a proper flowchart etc.
>
> Talking of flowcharts, I see there are several flowchart makers for
> Asterisk and other IVRs - specifically, in the flowchart, I need "set
> this variable, uses that variable, calls this context, uses that
> gosub" and so on.
>
> So it's not just dragging extensions together.
>
> Any ideas?!
>
> Thanks
>
> --
> _
> -- Bandwidth and Colocation Provided by http://www.api-digital.com --
>
> Check out the new Asterisk community forum at:
> https://community.asterisk.org/
>
> New to Asterisk? Start here:
> https://wiki.asterisk.org/wiki/display/AST/Getting+Started
>
> asterisk-users mailing list
> To UNSUBSCRIBE or update options visit:
> http://lists.digium.com/mailman/listinfo/asterisk-users
>
>
> --
> _
> -- Bandwidth and Colocation Provided by http://www.api-digital.com --
>
> Check out the new Asterisk community forum at:
> https://community.asterisk.org/
>
> New to Asterisk? Start here:
> https://wiki.asterisk.org/wiki/display/AST/Getting+Started
>
> asterisk-users mailing list
> To UNSUBSCRIBE or update options visit:
> http://lists.digium.com/mailman/listinfo/asterisk-users
>
>
> --
> _
> -- Bandwidth and Colocation Provided by http://www.api-digital.com --
>
> Check out the new Asterisk community forum at:
> https://community.asterisk.org/
>
> New to Asterisk? Start here:
> https://wiki.asterisk.org/wiki/display/AST/Getting+Started
>
> asterisk-users mailing list
> To UNSUBSCRIBE or update options visit:
> http://lists.digium.com/mailman/listinfo/asterisk-users
>
>
> --
> _
> -- Bandwidth and Colocation Provided by http://www.api-digital.com --
>
> Check out the new Asterisk community forum at:
> https://communi

Re: [asterisk-users] Something similar to Doxygen for standard dialplan?

2017-03-18 Thread Jonathan H
Hi, thanks - that looks really good!

I was about to embark on some non-visual stuff using Ragic, but this
looks great.

Is there a binary anywhere, or any instructions to compile? I've never
compiled C# code before, and although a quick google suggests it
shouldn't be too hard, I might need to know a few things like what
version of .net it should be compiled with.

The readme just points to the website.

Thanks!

On 18 March 2017 at 18:57, Sebastian Gutierrez <scg...@gmail.com> wrote:
> Check this one:
>
> https://github.com/IntegraCCS/integradesigner
>
> You can do many things, document each node, and save xml with each
> extension.
> We´ve made it open source on Astricon 2015 you can extend it the way you
> want.
>
> Hope it helps you.
>
> Best regards
>
>
>
>
> On Mar 18, 2017, 12:50 +0100, Jonathan H <lardconce...@gmail.com>, wrote:
>
> How are we all documenting complex dialplan?
>
> Is there something similar to Doxygen?
>
> I've got around 20 config files covering around 60 contexts and 40
> variables. Of course, I've maintained a basic list of the major stuff,
> and documented the code throughout, but it's grown to the stage where
> it needs to be better documented, have a proper flowchart etc.
>
> Talking of flowcharts, I see there are several flowchart makers for
> Asterisk and other IVRs - specifically, in the flowchart, I need "set
> this variable, uses that variable, calls this context, uses that
> gosub" and so on.
>
> So it's not just dragging extensions together.
>
> Any ideas?!
>
> Thanks
>
> --
> _
> -- Bandwidth and Colocation Provided by http://www.api-digital.com --
>
> Check out the new Asterisk community forum at:
> https://community.asterisk.org/
>
> New to Asterisk? Start here:
> https://wiki.asterisk.org/wiki/display/AST/Getting+Started
>
> asterisk-users mailing list
> To UNSUBSCRIBE or update options visit:
> http://lists.digium.com/mailman/listinfo/asterisk-users
>
>
> --
> _
> -- Bandwidth and Colocation Provided by http://www.api-digital.com --
>
> Check out the new Asterisk community forum at:
> https://community.asterisk.org/
>
> New to Asterisk? Start here:
>   https://wiki.asterisk.org/wiki/display/AST/Getting+Started
>
> asterisk-users mailing list
> To UNSUBSCRIBE or update options visit:
>http://lists.digium.com/mailman/listinfo/asterisk-users

-- 
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

Check out the new Asterisk community forum at: https://community.asterisk.org/

New to Asterisk? Start here:
  https://wiki.asterisk.org/wiki/display/AST/Getting+Started

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users

[asterisk-users] Something similar to Doxygen for standard dialplan?

2017-03-18 Thread Jonathan H
How are we all documenting complex dialplan?

Is there something similar to Doxygen?

I've got around 20 config files covering around 60 contexts and 40
variables. Of course, I've maintained a basic list of the major stuff,
and documented the code throughout, but it's grown to the stage where
it needs to be better documented, have a proper flowchart etc.

Talking of flowcharts, I see there are several flowchart makers for
Asterisk and other IVRs - specifically, in the flowchart, I need "set
this variable, uses that variable, calls this context, uses that
gosub" and so on.

So it's not just dragging extensions together.

Any ideas?!

Thanks

-- 
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

Check out the new Asterisk community forum at: https://community.asterisk.org/

New to Asterisk? Start here:
  https://wiki.asterisk.org/wiki/display/AST/Getting+Started

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users


  1   2   3   4   5   6   7   8   9   10   >