Re: [asterisk-users] Dial cmd help
>Even simpler: >exten => s,n,Set(Dialnum=${IF($["${ARG1:0:1}"="1"]?${ARG1:1}:${ARG1})}) Thanks Tilghman, I am making a note of this as well! jlc ___ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
Re: [asterisk-users] Dial cmd help
On Monday 06 July 2009 12:15:03 am Joseph L. Casale wrote: > >exten => s,n,ExecIf($["${ARG1}" = "1${ARG1:1}" > > ]?Set(Dialnum=${ARG1:1}):Set(Dialnum=${ARG1})) > > Much simpler Dhaval, thanks! Even simpler: exten => s,n,Set(Dialnum=${IF($["${ARG1:0:1}"="1"]?${ARG1:1}:${ARG1})}) -- Tilghman ___ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
Re: [asterisk-users] Dial cmd help
>exten => s,n,ExecIf($["${ARG1}" = "1${ARG1:1}" >]?Set(Dialnum=${ARG1:1}):Set(Dialnum=${ARG1})) Much simpler Dhaval, thanks! jlc ___ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
Re: [asterisk-users] Dial cmd help
hi joshep try this in your macro *exten => s,1,Noop(${ARG1:1}=) exten => s,n,ExecIf($["${ARG1}" = "1${ARG1:1}" ]?Set(Dialnum=${ARG1:1}):Set(Dialnum=${ARG1})) exten => s,n,NooP(${Dialnum}) exten => s,n,Dial(SIP/1${dialn...@sip_peer,60,T) exten => s,n,hangup() please arrange second line regards dhaval * On Mon, Jul 6, 2009 at 9:27 AM, Joseph L. Casale wrote: > I have a dial cmd buried amongst a series of others in a macro > like so: exten => s,n,Dial(SIP/1${ar...@sip_peer,60,T) > > Reason for adding a "1" is all the others in the macro don't > want the "1" so this was easiest at the time. Now I need to > send NA long distance through this macro. All the other dial > cmds will just work, but this one is going to try to dial > 11NXXNXX instead of 1NXXNXX. > > Is there some way to simply add some logic above it such that > if the EXTEN coming in starts with a "1", remove it so I don't > have to hack this extensions.conf all to heck? > > Thanks! > jlc > > ___ > -- Bandwidth and Colocation Provided by http://www.api-digital.com -- > > 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 -- asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
Re: [asterisk-users] Dial cmd help
>Is there some way to simply add some logic above it such that >if the EXTEN coming in starts with a "1", remove it so I don't >have to hack this extensions.conf all to heck? Ok, a bit more searching and maybe I have it (I'm remote and cant test this, so before I call in tomorrow I'd like to get it as close as possible to keep the disruption to a minimum)? exten => s,n,GotoIf($["${ARG1}" = "[^1][0-9]{9}"]?Dial1:Dial2) exten => s,n(Dial1),Dial(SIP/1${ar...@sip_peer,60,T) exten => s,n,Goto(Resume) exten => s,n(Dial2),Dial(SIP/{ar...@sip_peer,60,T) exten => s,n(Resume), If I understand this right, the number being dialed, ARG1, will be matched against the regex which loosely looks for a 10 digit number not beginning with a "1". If it does, it dials the peer as expected (by adding a one) and if it does have a one, it dials the peer as is. My pattern match going into this sequence only catches 10 or 11 digit numbers and I handle intl differently so I think the regex will work so long as asterisk supports this? Thanks for any pointers! jlc ___ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
[asterisk-users] Dial cmd help
I have a dial cmd buried amongst a series of others in a macro like so: exten => s,n,Dial(SIP/1${ar...@sip_peer,60,T) Reason for adding a "1" is all the others in the macro don't want the "1" so this was easiest at the time. Now I need to send NA long distance through this macro. All the other dial cmds will just work, but this one is going to try to dial 11NXXNXX instead of 1NXXNXX. Is there some way to simply add some logic above it such that if the EXTEN coming in starts with a "1", remove it so I don't have to hack this extensions.conf all to heck? Thanks! jlc ___ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users