Edwin Groothuis
2005-Jan-28 23:28 UTC
[Asterisk-Users] extensions.conf - redundancy removal
The number 9335 3510 is sent by the telco. The number 1414 02 9335 3510 is sent by an PABX. The number 02 9335 3510 is the one which is the real telephone number: exten => 93353510,1,Macro(call-local-sip,edwin,02${EXTEN}) exten => 0293353510,1,Macro(call-local-sip,edwin,${EXTEN}) exten => 14140293353510,1,Macro(call-local-sip,edwin,${EXTEN:4}) Is there a way to do this in one line? -- Edwin Groothuis | Personal website: http://www.mavetju.org edwin@mavetju.org | Weblog: http://weblog.barnet.com.au/edwin/
Steven Critchfield
2005-Jan-28 23:35 UTC
[Asterisk-Users] extensions.conf - redundancy removal
On Sat, 2005-01-29 at 17:28 +1100, Edwin Groothuis wrote:> The number 9335 3510 is sent by the telco. > The number 1414 02 9335 3510 is sent by an PABX. > The number 02 9335 3510 is the one which is the real telephone number: > > exten => 93353510,1,Macro(call-local-sip,edwin,02${EXTEN}) > exten => 0293353510,1,Macro(call-local-sip,edwin,${EXTEN}) > exten => 14140293353510,1,Macro(call-local-sip,edwin,${EXTEN:4}) > > Is there a way to do this in one line?exten => _.93353510,1,Macro(call-local-sip,edwin,0293353510) -- Steven Critchfield <critch@basesys.com>
Robert Jackson
2005-Jan-28 23:39 UTC
[Asterisk-Users] extensions.conf - redundancy removal
Edwin Groothuis wrote:> The number 9335 3510 is sent by the telco. > The number 1414 02 9335 3510 is sent by an PABX. > The number 02 9335 3510 is the one which is the real telephone number: > > exten => 93353510,1,Macro(call-local-sip,edwin,02${EXTEN}) > exten => 0293353510,1,Macro(call-local-sip,edwin,${EXTEN}) > exten => 14140293353510,1,Macro(call-local-sip,edwin,${EXTEN:4}) > > Is there a way to do this in one line? >The only way that I can think of is like so: exten => _.93353510,1,Macro(call-local-sip,edwin,02${EXTEN:-8}) This basically would grab the last eight characters from ${EXTEN} and pass them along with the 02 that is needed. I did not test this but I believe that is how it works. Check out the what the wiki says about substrings here: http://www.voip-info.org/wiki-Asterisk+Variables Good luck, Robert Jackson
Robert Jackson
2005-Jan-28 23:41 UTC
[Asterisk-Users] extensions.conf - redundancy removal
Steven Critchfield wrote:> On Sat, 2005-01-29 at 17:28 +1100, Edwin Groothuis wrote: > >>The number 9335 3510 is sent by the telco. >>The number 1414 02 9335 3510 is sent by an PABX. >>The number 02 9335 3510 is the one which is the real telephone number: >> >>exten => 93353510,1,Macro(call-local-sip,edwin,02${EXTEN}) >>exten => 0293353510,1,Macro(call-local-sip,edwin,${EXTEN}) >>exten => 14140293353510,1,Macro(call-local-sip,edwin,${EXTEN:4}) >> >>Is there a way to do this in one line? > > > > exten => _.93353510,1,Macro(call-local-sip,edwin,0293353510) > >Well I guess I had to go and get complicated. I forgot the KISS method ;) FYI - (I just suggested that he use ${EXTEN:-8}) Robert Jackson