I have the following extension to dial outside via SIP it's like this: phone----asterisk-----internet-----SIP provider----USA exten => _91NXXNXXXXXX,1,AGI(call_log.agi,${EXTEN}) exten => _91NXXNXXXXXX,2,Dial(${SIPtrunk}/${EXTEN},55,o) exten => _91NXXNXXXXXX,3,Hangup I want to strip the digit 9 before sending it to the SIP provider. Also, any suggestions for the above definition? Thanks, Erick. --
You can do it adding a parameter to the ${EXTEN}: exten => _91NXXNXXXXXX,1,AGI(call_log.agi,${EXTEN:1}) exten => _91NXXNXXXXXX,2,Dial(${SIPtrunk}/${EXTEN:1},55,o) ":1" would strip the first digit. Fred ----- Original Message ----- From: "Erick Perez" <eaperezh@gmail.com> To: "Asterisk Users Mailing List - Non-Commercial Discussion" <asterisk-users@lists.digium.com> Sent: Tuesday, May 30, 2006 17:00 Subject: [Asterisk-Users] How to strip a digit>I have the following extension to dial outside via SIP > it's like this: > phone----asterisk-----internet-----SIP provider----USA > > exten => _91NXXNXXXXXX,1,AGI(call_log.agi,${EXTEN}) > exten => _91NXXNXXXXXX,2,Dial(${SIPtrunk}/${EXTEN},55,o) > exten => _91NXXNXXXXXX,3,Hangup > > I want to strip the digit 9 before sending it to the SIP provider. > Also, any suggestions for the above definition? > Thanks, > > Erick. > > -- > _______________________________________________ > --Bandwidth and Colocation provided by Easynews.com -- > > Asterisk-Users mailing list > To UNSUBSCRIBE or update options visit: > http://lists.digium.com/mailman/listinfo/asterisk-users > >
Erick Perez wrote:> I want to strip the digit 9 before sending it to the SIP provider. > Also, any suggestions for the above definition?${EXTEN:1} This is very well documented. Please read more. Jeremy McNamara
It's all in README.variables or here: http://voip-info.org/wiki/view/Asterisk+variables use ${EXTEN:1} On 5/30/06, Erick Perez <eaperezh@gmail.com> wrote:> I have the following extension to dial outside via SIP > it's like this: > phone----asterisk-----internet-----SIP provider----USA > > exten => _91NXXNXXXXXX,1,AGI(call_log.agi,${EXTEN}) > exten => _91NXXNXXXXXX,2,Dial(${SIPtrunk}/${EXTEN},55,o) > exten => _91NXXNXXXXXX,3,Hangup > > I want to strip the digit 9 before sending it to the SIP provider. > Also, any suggestions for the above definition? > Thanks, > > Erick. > > -- > _______________________________________________ > --Bandwidth and Colocation provided by Easynews.com -- > > Asterisk-Users mailing list > To UNSUBSCRIBE or update options visit: > http://lists.digium.com/mailman/listinfo/asterisk-users >
Erick, Try this: exten => _91NXXNXXXXXX,1,AGI(call_log.agi,${EXTEN:1}) exten => _91NXXNXXXXXX,2,Dial(${SIPtrunk}/${EXTEN:1},55,o) exten => _91NXXNXXXXXX,3,Hangup Note the :1. This strips out the first digit and passes the rest of the variable. Alex On 5/30/06, Erick Perez <eaperezh@gmail.com> wrote:> > I have the following extension to dial outside via SIP > it's like this: > phone----asterisk-----internet-----SIP provider----USA > > exten => _91NXXNXXXXXX,1,AGI(call_log.agi,${EXTEN}) > exten => _91NXXNXXXXXX,2,Dial(${SIPtrunk}/${EXTEN},55,o) > exten => _91NXXNXXXXXX,3,Hangup > > I want to strip the digit 9 before sending it to the SIP provider. > Also, any suggestions for the above definition? > Thanks, > > Erick. > > -- > _______________________________________________ > --Bandwidth and Colocation provided by Easynews.com -- > > Asterisk-Users mailing list > To UNSUBSCRIBE or update options visit: > http://lists.digium.com/mailman/listinfo/asterisk-users >-- Alex Robar alex.robar@gmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20060530/09c7a970/attachment.htm
On 5/30/06, Erick Perez <eaperezh@gmail.com> wrote:> I have the following extension to dial outside via SIP > it's like this: > phone----asterisk-----internet-----SIP provider----USA > > exten => _91NXXNXXXXXX,1,AGI(call_log.agi,${EXTEN}) > exten => _91NXXNXXXXXX,2,Dial(${SIPtrunk}/${EXTEN},55,o) > exten => _91NXXNXXXXXX,3,Hangup > > I want to strip the digit 9 before sending it to the SIP provider.exten => _91NXXNXXXXXX,2,Dial(${SIPtrunk}/${EXTEN:1},55,o) hth
you need to put ":1" next to ${EXTEN} something like: exten => _91NXXNXXXXXX,1,AGI(call_log.agi,${EXTEN:1}) exten => _91NXXNXXXXXX,2,Dial(${SIPtrunk}/${EXTEN:1},55,o) exten => _91NXXNXXXXXX,3,Hangup Joao Pereira Erick Perez wrote:> I have the following extension to dial outside via SIP > it's like this: > phone----asterisk-----internet-----SIP provider----USA > > exten => _91NXXNXXXXXX,1,AGI(call_log.agi,${EXTEN}) > exten => _91NXXNXXXXXX,2,Dial(${SIPtrunk}/${EXTEN},55,o) > exten => _91NXXNXXXXXX,3,Hangup > > I want to strip the digit 9 before sending it to the SIP provider. > Also, any suggestions for the above definition? > Thanks, > > Erick. > > -- > _______________________________________________ > --Bandwidth and Colocation provided by Easynews.com -- > > Asterisk-Users mailing list > To UNSUBSCRIBE or update options visit: > http://lists.digium.com/mailman/listinfo/asterisk-users
This should do the job exten => _91NXXNXXXXXX,2,Dial(${SIPtrunk}/${EXTEN:1},55,o) Henk -----Original Message----- From: asterisk-users-bounces@lists.digium.com [mailto:asterisk-users-bounces@lists.digium.com] On Behalf Of Erick Perez Sent: dinsdag 30 mei 2006 22:01 To: Asterisk Users Mailing List - Non-Commercial Discussion Subject: [Asterisk-Users] How to strip a digit I have the following extension to dial outside via SIP it's like this: phone----asterisk-----internet-----SIP provider----USA exten => _91NXXNXXXXXX,1,AGI(call_log.agi,${EXTEN}) exten => _91NXXNXXXXXX,2,Dial(${SIPtrunk}/${EXTEN},55,o) exten => _91NXXNXXXXXX,3,Hangup I want to strip the digit 9 before sending it to the SIP provider. Also, any suggestions for the above definition? Thanks, Erick. -- _______________________________________________ --Bandwidth and Colocation provided by Easynews.com -- Asterisk-Users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
Change: exten => _91NXXNXXXXXX,2,Dial(${SIPtrunk}/${EXTEN},55,o) To: exten => _91NXXNXXXXXX,2,Dial(${SIPtrunk}/${EXTEN:1},55,o) -John Erick Perez wrote:> I have the following extension to dial outside via SIP > it's like this: > phone----asterisk-----internet-----SIP provider----USA > > exten => _91NXXNXXXXXX,1,AGI(call_log.agi,${EXTEN}) > exten => _91NXXNXXXXXX,2,Dial(${SIPtrunk}/${EXTEN},55,o) > exten => _91NXXNXXXXXX,3,Hangup > > I want to strip the digit 9 before sending it to the SIP provider. > Also, any suggestions for the above definition? > Thanks, > > Erick. > > -- > _______________________________________________ > --Bandwidth and Colocation provided by Easynews.com -- > > Asterisk-Users mailing list > To UNSUBSCRIBE or update options visit: > http://lists.digium.com/mailman/listinfo/asterisk-users
Apparently Analagous Threads
- error dialing a SIP user. chan_sip.c:1994 create_addr: No such host
- Extension wise dialplan
- Unable to connect to remote asterisk (does / var/run/asterisk.ctl exist?)
- Meetme versus app_conference
- Training Material: Books about linux but targeting Centos installations