1 |
Creating or editing the inbound context |
|
Here we will configure the inbound context which will be used to handle the routing of inbound calls to your Asterisk installation. To create this context you can either use the command line or a text editor to edit the extensions.conf file.
Once you are able to access the extensions.conf file you can follow the steps below:
1. Enter the following context:
[from-callcentric]
exten => s,1,Set(Var_TO=${CUT(CUT(SIP_HEADER(To),@,1),:,2)})
exten => s,2,GotoIf($["${Var_TO}" = "1777MYCCID"]?to-100,s,1:3)
exten => s,3,GotoIf($["${Var_TO}" = "DID1"]?to-100,s,1:4)
exten => s,4,GotoIf($["${Var_TO}" = "DID2"]?to-101,s,1:5)
exten => s,5,Hangup
[to-100]
exten => s,1,Dial(SIP/100,20)
exten => s,n,Hangup
[to-101]
exten => s,1,Dial(SIP/101,20)
exten => s,n,Hangup
NOTE: Any instance of 1777MYCCID should be replaced with the 1777 number assigned to you by Callcentric. EXT is the three digit extension you are trying to register this UA to.
For example: 17770001234101 would register to extension 101 on account 17770001234. However, if you are registering towards the main/default extension of your Callcentric Account (extension 100), you can simply use your 1777 number without the 3 digit extension suffix (example: 17770001234).
Where DID1, and DID2 are located, please replace it with the number(s) you've acquired from our service. So for example, if your account number is 17770001234 and you've acquired the numbers 12125551000 and 12125551001, the block of code would look something like:
[from-callcentric]
exten => s,1,Set(Var_TO=${CUT(CUT(SIP_HEADER(To),@,1),:,2)})
exten => s,2,GotoIf($["${Var_TO}" = "17770001234"]?to-100,s,1:3)
exten => s,3,GotoIf($["${Var_TO}" = "12125551000"]?to-100,s,1:4)
exten => s,4,GotoIf($["${Var_TO}" = "12125551001"]?to-101,s,1:5)
exten => s,5,Hangup
And where to-100 and to-101 are contexts which decide where to send the call. In our example code, inbound calls towards 12125551000 will route towards extension 100 and inbound calls towards 12125551001 will route towards extension 101.
2. Save the file.
|
2 |
Placing Test Calls |
|
Once you are done save your changes and then test incoming calling to see that your Asterisk setup now routes inbound calling based on the number called.
To test inbound calls from Callcentric to your new DID based routing setup, follow the directions listed in this FAQ.
You will also want to test calls directly to your DID from a PSTN phone if you have a DID on your account.
|
|