I’m using two asterisk instances in tandem for this purpose as there is an end PBX that connects to endpoints and does the PBX functions that customers use (feature codes, voicemail etc.) and one “core” instance as an intermediary to the CTS provider (through Cisco CUBE devices) that is used to aggregate calls from other customers who use trunking and their own PBX instances as well as the main PBX.
I’m trying to set this up in a way that calls with prefix 1111 sent by the end PBX are sent by the “core” without the prefix to a different CTS provider.
I can currently send calls with a valid number to the second CTS service as shown here:
exten => _0[4]XXXXXXXX,1,NoOp(Call sent out to CTS1)
exten => _0[4]XXXXXXXX,2,Set(CDR(diallingnumber)=${CALLERID(NUM)})
exten => _0[4]XXXXXXXX,3,Set(CDR(diallednumber)=${CALLERID(DNID)})
exten => _0[4]XXXXXXXX,4,Dial(SIP/${CALLERID(DNID)}@CUBE1)
exten => _0[4]XXXXXXXX,5,Goto(s-${DIALSTATUS},1)
vs
exten => _0[8]XXXXXXXX,1,NoOp(Call sent out to CTS2)
exten => _0[8]XXXXXXXX,2,Set(CDR(diallingnumber)=${CALLERID(NUM)})
exten => _0[8]XXXXXXXX,3,Set(CDR(diallednumber)=${CALLERID(DNID)})
exten => _0[8]XXXXXXXX,4,Dial(SIP/${CALLERID(DNID)}@CUBE2)
exten => _0[8]XXXXXXXX,5,Goto(s-${DIALSTATUS},1)
Rather than sending all calls to 04XXXXXXXX via CTS1, what I want to do is dial 111104XXXXXXXX and have the “core” send 04XXXXXXXX calls via CTS2.
exten => _11110[4]XXXXXXXX,1,NoOp(Call sent out to CTS2)
exten => _11110[4]XXXXXXXX,2,Set(CDR(diallingnumber)=${CALLERID(NUM)})
exten => _11110[4]XXXXXXXX,3,Set(CDR(diallednumber)=${CALLERID(DNID:4)})
exten => _11110[4]XXXXXXXX,4,Dial(SIP/${CALLERID(DNID:4)}@CUBE2)
exten => _11110[4]XXXXXXXX.,5,Goto(s-${DIALSTATUS},1)
What ends up happening is that the “core” calls 111104XXXXXXX@CUBE2 rather than 04XXXXXXX@CUBE2
Could anyone provide some guidance on how this should be fixed?