Our network:
I have an internal network here at our mission hospital. We are using FreePBX with A2B 1.2.3. We make outgoing calls from the hospital extensions. We also have calls being made from wireless clients linked toour network from homes. The homes are 200-300, the hospital offices are 500-600. The calls are billed to the callers pin number when making an outbound call. We also bill inbound calls to the pin number of the owner of the inbound DID.
The problem:
When an extension dials out the CID passed to A2B is the extension number that dialed the call. Even though the FreePBX extension has an outbound CID entered this CID is not passed to A2B. In other words when extension 203 dials an outbound call I want a valid CID to be passed to a2b based on the extension dialed. For example if I dial 01740281xxxx I want my CID of 1740587xxxx so that when the part answers the see the number that the call came from and not 0000000000 as it is now. Now I could have my voip provider assign a CID to my account but that means that everyone making a call would appear to be from the same phone number. We have about 15 phone numbers through the same Vitelity.net account. Vitelity.net allows unlimited sub-accounts which would be a solution as each sub-account may have an attached CID. This would mean configuring 15 different outbound trunks.
I searched the forum for a solution. I was unable to find an answer. Below is my solution. If there is a better way to do this please let me know.
Notice I used CALLERID(all) but CALLERID(number) would be just as complete as the text name is not used. I have zeroed out the last 4 digits for security
extensions_custom.conf
[a2billing]
exten => _01NXXNXXXXXX,1,Answer
exten => _01NXXNXXXXXX,2,Wait,2
exten => _01NXXNXXXXXX,3,Set(Var_TO=${CALLERID(number))
# set Kenton Caller ID
exten => _01NXXNXXXXXX,4,GotoIf($["${Var_TO}" = "525"]?5:8)
exten => _01NXXNXXXXXX,5,Set(CALLERID(all)="Kenton Brown <7402810000>")
exten => _01NXXNXXXXXX,6,Goto(300)
exten => _01NXXNXXXXXX,8,GotoIf($["${Var_TO}" = "202"]?9:12)
exten => _01NXXNXXXXXX,9,Set(CALLERID(all)="Kenton Brown <7402810000>")
exten => _01NXXNXXXXXX,10,Goto(300)
exten => _01NXXNXXXXXX,12,GotoIf($["${Var_TO}" = "203"]?13:20)
exten => _01NXXNXXXXXX,13,Set(CALLERID(all)=Kenton Brown <7402810000>)
exten => _01NXXNXXXXXX,14,Goto(300)
# set Ted Caller ID
exten => _01NXXNXXXXXX,20,GotoIf($["${Var_TO}" = "204"]?21:30)
exten => _01NXXNXXXXXX,21,Set(CALLERID(all)="Ted Faull <8153150000>")
exten => _01NXXNXXXXXX,22,Goto(300)
# set Ted Caller ID
exten => _01NXXNXXXXXX,30,GotoIf($["${Var_TO}" = "206"]?31:40)
exten => _01NXXNXXXXXX,31,Set(CALLERID(all)="Dr. Ted Faull <3303150000>")
exten => _01NXXNXXXXXX,32,Goto(300)
# set Hospital Caller ID
exten => _01NXXNXXXXXX,40,GotoIf($["${Var_TO}" = "506"]?41:50)
exten => _01NXXNXXXXXX,41,Set(CALLERID(all)=Hospital Loma de Luz <2282060000>)
exten => _01NXXNXXXXXX,42,Goto(300)
# set Ted Caller ID
exten => _01NXXNXXXXXX,50,GotoIf($["${Var_TO}" = "204"]?51:60)
exten => _01NXXNXXXXXX,51,Set(CALLERID(all)="Ted Faull <8153150000>")
exten => _01NXXNXXXXXX,52,Goto(300)
# set next Caller ID
exten => _01NXXNXXXXXX,60,Goto(300)
# pass to a2billing
exten => _01NXXNXXXXXX,300,DeadAGI(a2billing.php|2)
exten => _01NXXNXXXXXX,301,Wait,2
exten => _01NXXNXXXXXX,302,Hangup
|