I've been for weeks trying to solve this one.
I have two callcentric accounts on the same PBX, and have 4 DIDs among them. It's taken me this long of trial, error and head-banging to fix it.
To get DID routing on callcentric working:
1)
Create a custom context in /etc/asterisk/extensions_custom.conf
replace the 1777XXXXX... with your Callcentric account number:
2)
In /etc/asterisk/sip_custom.conf
change:
to:
3)
In FreePBX, Create your inbound routes for each DID.
Remember that Callcentric treats all US numbers as 11 digits (1+area+number), so your DID must be "1XXXXXXXXXX"
4)
In FreePBX, change the context for each trunk to "custom-get-did"
5)
Reload asterisk
6) Test
This works under the latest PiaF as of this writing
I have two callcentric accounts on the same PBX, and have 4 DIDs among them. It's taken me this long of trial, error and head-banging to fix it.
To get DID routing on callcentric working:
1)
Create a custom context in /etc/asterisk/extensions_custom.conf
replace the 1777XXXXX... with your Callcentric account number:
Code:
[custom-get-did]
exten => _.,1,NoOp(Received incoming SIP connection from unknown peer to ${EXTEN})
exten => _.,n,Set(DID=${IF($["${EXTEN:1:2}"=""]?s:${EXTEN})})
exten => _.,n,Goto(s,1)
exten => s,1,GotoIf($["${DID}"<>"1777XXXXXXX"]?from-sip-external,${DID},1)
exten => s,n,NoOp(Processing Account ${DID})
exten => s,n,Set(MYVAR=${SIP_HEADER(TO):5})
exten => s,n,NoOp(Actual DID from SIP Header is ${MYVAR})
exten => s,n,Set(DID=${MYVAR:0:11})
exten => s,n,Goto(from-trunk,${DID},1)
exten => h,1,Macro(hangupcall)
In /etc/asterisk/sip_custom.conf
change:
Code:
context=from-trunk
Code:
context=custom-get-did
In FreePBX, Create your inbound routes for each DID.
Remember that Callcentric treats all US numbers as 11 digits (1+area+number), so your DID must be "1XXXXXXXXXX"
4)
In FreePBX, change the context for each trunk to "custom-get-did"
5)
Reload asterisk
6) Test
This works under the latest PiaF as of this writing