Page 1 of 1

Custom prefix per sip carrier

PostPosted: Wed Oct 07, 2009 6:10 pm
by lmora
Hi guys

I have 2 sip carriers that require the following patterns:

Carrier 1: 01(10 digits)
Carrier 2: 52(10 digits)


My lists were uploaded using the pattern of carrier 1: [01(10 digits)] so in order to use carrier 2 I need some logic in the dial plan to replace the 01 by 52 but honestly I don't know how to do it.

could you help me with the instruction?


I use Dial Prefix with 8 or 9 to choose the carrier
Carrier 1
exten => _952X.,1,AGI(agi://127.0.0.1:4577/call_log)
exten => _952X.,2,Dial(${SIPTRUNK}/${EXTEN:3},,tTor)
exten => _952X.,3,Hangup

Carrier 2
exten => _852X.,1,AGI(agi://127.0.0.1:4577/call_log)
exten => _852X.,2,Dial(${SIPTRUNK_iVOICE}/${EXTEN:3},,tTor)
exten => _852X.,3,Hangup


Thanks

PostPosted: Thu Oct 08, 2009 3:47 am
by codehaxor
Just use _9. for carrier 1 and _8. for carrier 2

PostPosted: Fri Oct 09, 2009 10:22 am
by lmora
Thanks for asnwering.

Unfortunately I already have my lists uploaded with a format that I have to process to comply with the pattern required by my new sip carrier.

I solved the problem reading further about getting substrings and concatenation in dialplans.

The solution is to take the last 10 digits of my string and then concatenate 52 at the beginning of the string to dial.

Dial(${SIPTRUNK}/52${EXTEN:-10},,tTor)


Thanks