[asterisk-users] How to encode plus sign in REGEX function in dialplan?

2015-11-04 Thread Recursive
Dear all,

I have made a fairly complex dialplan where I am using the REGEX function in 
many places. This works so far, but I wasn't able to solve the following 
problem. What I would like to do is the following (please note that this is 
normal regex syntax and obviously not what the REGEX function expects, but I 
hope it shows the idea):

  same => n(A1), GotoIf($[${REGEX("^\+49.*" ${EXTEN})}]?:A2)

This line should make Asterisk jump to label A2 if the extension begins with 
+49. Since the plus sign is a special char in regexes, I have escaped it with \ 
as usual. But that does not work; the pattern is not matched and the goto is 
not executed when the extension begins with +49.

What I already have tried:

1) same => n(A1), GotoIf($[${REGEX("^\\+49.*" ${EXTEN})}]?:A2)

2) same => n(A1), GotoIf($[${REGEX("^\\\+49.*" ${EXTEN})}]?:A2)

3) same => n(A1), GotoIf($[${REGEX("^+49.*" ${EXTEN})}]?:A2)

4) same => n, Set(REPAT=^+49.*) 
   same => n(A1), GotoIf($[${REGEX(${REPAT} ${EXTEN})}]?:A2)

5) same => n, Set(REPAT="^+49.*")
   same => n(A1), GotoIf($[${REGEX(${REPAT} ${EXTEN})}]?:A2)

6) same => n, Set(REPAT=^+49.*)
   same => n(A1), GotoIf($[${REGEX("${REPAT}" ${EXTEN})}]?:A2)

7) same => n, Set(REPAT="^+49.*")
   same => n(A1), GotoIf($[${REGEX("${REPAT}" ${EXTEN})}]?:A2)

Neither of these worked.

Actually, the REGEX function is not able to handle normal regular expressions. 
To make things worse, there doesn't seem to be any documentation. Could anybody 
please point me to documentation or tell me how write that very simple pattern?

Thank you very much,

Recursive

P.S. This happens in Asterisk 13.6.0 - I haven't tested with other versions.

-- 
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
   http://www.asterisk.org/hello

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


Re: [asterisk-users] Find me macro - calling multiple people to get a hold of one

2015-11-04 Thread Wiebe Cazemier
- Original Message -
> From: "jg" 
> To: "Asterisk Users Mailing List - Non-Commercial Discussion" 
> 
> Sent: Wednesday, 4 November, 2015 5:42:17 PM
> Subject: Re: [asterisk-users] Find me macro - calling multiple people to get 
> a hold of one
> >
> Sorry, but why is a simple
> 
> Dial(SIP/A&SIP/B&...,${CALLTIMEOUT},${DIALOPTS})
> ...
> Hangup()
> 
> not acceptable? If necessary, one can try to find out which devices are
> technically available to
> avoid dialing a non-existent device. If pressing a "1" is acceptable, then
> why not pressing the
> "DND" to not accept the call?

Because when somebody has their phone off, the caller gets a voicemail 
immediately. 

-- 
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
   http://www.asterisk.org/hello

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


Re: [asterisk-users] Find me macro - calling multiple people to get a hold of one

2015-11-04 Thread jg



We're trying to set up a phone number that customers can call to get a hold of 
anyone of a group of sysadmins (and not their voice mails!). We found the 
findme example ([1]) that makes the callees press 1 to accept the call. It 
almost works, but it doesn't work correctly when one of the callees, the 
sysadmins, hangs up after accepting the call.

We're using this 'screen' macro:

==
[default]
exten => _XX,1,Dial(SIP/bla/${EXTEN:4},40,M(screen))
exten => _XX,2,Hangup

[macro-screen]
exten => s,1,Wait(1)
exten => s,n,Background(press-1)
exten => s,n,WaitExten(10) ; the value is the Wait time before we assume the 
call is not accepted
exten => 1,1,NoOp(Caller accepted) ; Do not set MACRO_RESULT to anything to 
connect the caller
exten => t,1,Playback(weasels-eaten-phonesys) ; if you're too late with 
pressing 1
exten => t,n,Set(MACRO_RESULT=CONTINUE)

[findme]
exten =>  s,1,Set(CALLERID(all)="Alarm" <911>)
same  =>   n,Playback(please-wait-connect-oncall-eng)
same  =>   n,Dial(LOCAL/${WIEBE_MOBILE})
same  =>   n,Playback(vm-nobodyavail)
exten  =>  t,1,Playback(vm-nobodyavail)
=

First of all, what is MACRO_RESULT? I can't seem to find anything about that. 
Googling for it yields basically nothing.

But the biggest problem is when the callee answers, then hangs up. The person 
calling is connected to the phone that hangs up, instead of hearing 
'vm-nobodyavail'. This seems to be because there is nothing that sets 
MACRO_RESULT in that event (it's only set on 't', timeout).

I tried adding:

exten => h,1,Verbose(0,"The callee hung up")
exten => h,n,Set(MACRO_RESULT=CONTINUE)

to handle the hangup (h), but it's not doing that.

WaitExten() pushes the result back on the stack and restarts the context, 
right? So what is the result when the person hangs up?

Regards,

Wiebe


Sorry, but why is a simple

Dial(SIP/A&SIP/B&...,${CALLTIMEOUT},${DIALOPTS})
...
Hangup()

not acceptable? If necessary, one can try to find out which devices are technically available to 
avoid dialing a non-existent device. If pressing a "1" is acceptable, then why not pressing the 
"DND" to not accept the call?


jg

There's

--
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
  http://www.asterisk.org/hello

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


[asterisk-users] Find me macro - calling multiple people to get a hold of one

2015-11-04 Thread Wiebe Cazemier
Hi list,

We're trying to set up a phone number that customers can call to get a hold of 
anyone of a group of sysadmins (and not their voice mails!). We found the 
findme example ([1]) that makes the callees press 1 to accept the call. It 
almost works, but it doesn't work correctly when one of the callees, the 
sysadmins, hangs up after accepting the call.

We're using this 'screen' macro:

==
[default]
exten => _XX,1,Dial(SIP/bla/${EXTEN:4},40,M(screen))
exten => _XX,2,Hangup

[macro-screen]  
  
exten => s,1,Wait(1)
exten => s,n,Background(press-1)
exten => s,n,WaitExten(10) ; the value is the Wait time before we assume the 
call is not accepted
exten => 1,1,NoOp(Caller accepted) ; Do not set MACRO_RESULT to anything to 
connect the caller 
exten => t,1,Playback(weasels-eaten-phonesys) ; if you're too late with 
pressing 1
exten => t,n,Set(MACRO_RESULT=CONTINUE)

[findme]
exten =>  s,1,Set(CALLERID(all)="Alarm" <911>)
same  =>   n,Playback(please-wait-connect-oncall-eng)
same  =>   n,Dial(LOCAL/${WIEBE_MOBILE})
same  =>   n,Playback(vm-nobodyavail)
exten  =>  t,1,Playback(vm-nobodyavail)
=

First of all, what is MACRO_RESULT? I can't seem to find anything about that. 
Googling for it yields basically nothing.

But the biggest problem is when the callee answers, then hangs up. The person 
calling is connected to the phone that hangs up, instead of hearing 
'vm-nobodyavail'. This seems to be because there is nothing that sets 
MACRO_RESULT in that event (it's only set on 't', timeout).

I tried adding:

exten => h,1,Verbose(0,"The callee hung up")
exten => h,n,Set(MACRO_RESULT=CONTINUE)

to handle the hangup (h), but it's not doing that.

WaitExten() pushes the result back on the stack and restarts the context, 
right? So what is the result when the person hangs up?

Regards,

Wiebe



[1] http://www.voip-info.org/wiki/view/Asterisk+tips+findme

-- 
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
   http://www.asterisk.org/hello

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


[asterisk-users] PJSIP with registratrion to DNS SRV records fail with PJLIB_UTIL_EDNSNOANSWERREC

2015-11-04 Thread Daniel Tryba

I finally thought it might be a good time to start looking at the pjsip
implementation in Asterisk 13. But trying to register to a sip cluster
that uses SRV records fails randomly with:

[Nov  4 15:50:59] WARNING[31330]: pjsip:0 :  tsx0x7f075c006 Failed to
send Request msg REGISTER/cseq=17800 (tdta0x7f075c0058f0)! err=320047
(No answer record in the DNS response (PJLIB_UTIL_EDNSNOANSWERREC))
[Nov  4 15:50:59] WARNING[31330]: res_pjsip_outbound_registration.c:735
schedule_retry: No response received from 'sip:sip.itco.nl' on
registration attempt to 'sip:tr...@sip.itco.nl', retrying in '60'

[Nov  4 15:51:59] WARNING[31330]: pjsip:0 :  tsx0x7f075c006 Failed to
send Request msg REGISTER/cseq=17801 (tdta0x7f075c0058f0)! err=320047
(No answer record in the DNS response (PJLIB_UTIL_EDNSNOANSWERREC))
[Nov  4 15:51:59] WARNING[31330]: res_pjsip_outbound_registration.c:735
schedule_retry: No response received from 'sip:sip.itco.nl' on
registration attempt to 'sip:tr...@sip.itco.nl', retrying in '60'

At 15:52:59 the register succeeds somehow.

Attached is a pcap of the DNS request and the responses (capture filter:
port 53 or port 5060 or port 5061). Unlike the warning says the
responses are there.

Does anybody have a hint of what is going on/what I do wrong?

pjsip.conf:
[transport-udp]
type=transport
protocol=udp
bind=0.0.0.0

[transport-tcp]
type=transport
protocol=tcp
bind=0.0.0.0

[tryba]
type=endpoint
transport=transport-udp
context=tryba
disallow=all
allow=alaw
outbound_auth=tryba_auth
force_rport=yes
direct_media=no
ice_support=yes
auth=tryba_auth

[tryba_auth]
type=auth
auth_type=userpass
password=**
username=tryba

[tryba_register]
transport=transport-udp
type=registration
server_uri=sip:sip.itco.nl
client_uri=sip:tr...@sip.itco.nl
contact_user=tryba
outbound_auth=tryba_auth
expiration=180



dnsrsrv.pcapng.gz
Description: application/gzip
-- 
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
   http://www.asterisk.org/hello

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

Re: [asterisk-users] no ringing tone with Dial option r

2015-11-04 Thread Bertrand LUPART - Linkeo.com
Hello,


> I'm not getting any ringing when I use option r with Dial:
> 
> Dial("DAHDI/1-1", "motif/8447/+1@voice.google.com,,rTt") in new 
> stack

Warning, options are the 3rd arguments.

You seem to have an extra comma and a non-closed double-quote.


http://www.voip-info.org/wiki/view/Asterisk+cmd+Dial

-- 
Bertrand LUPART

-- 
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
   http://www.asterisk.org/hello

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


Re: [asterisk-users] no ringing tone with Dial option r

2015-11-04 Thread A J Stiles
On Tuesday 03 Nov 2015, sean darcy wrote:
> On 11/01/2015 12:38 PM, sean darcy wrote:
> > I'm not getting any ringing when I use option r with Dial:
> > 
> > Dial("DAHDI/1-1", "motif/8447/+1@voice.google.com,,rTt") in
> > new stack
> > 
> > Otherwise all works. The call goes through, good audio.
> > 
> > sean
> 
> FWIW, 11.18.0 on Fedora 22.
> 
> sean

Make sure you have an Answer(), or some command that does an implicit 
Answer(), somewhere in the dialplan before the Dial() statement with the r 
option.  Been bitten that way before .

-- 
AJS

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 --
New to Asterisk? Join us for a live introductory webinar every Thurs:
   http://www.asterisk.org/hello

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