The scenario
- In the UK.
- I have one (BT openreach) phone line coming into a Cisco SPA232D. That phone line is ringable on a number, let's say 01235AAAAAA.
- I have a virtual number, 01235BBBBBB, which is redirected to that line. When people dial this number they are redirected to my phone line. Their caller ID is preserved and I can tell who is calling.
- The line is connected to a SPA232D which does PSTN to VoIP fine and passes the call on to my FreePBX/Asterisk server.
The requirement
I would like to differentiate how I handle calls depending on whether the caller rang A or B. How do I configure the SPA232 to pass this information to Asterisk/FrePbX so that it can handle the calls differently.
The information
The dialplan on the SPA for PSTN to VoIP is:
(S0:@192.168.1.XXX)
The first few lines of the asterisk log for an incoming call, whether it has come to the line direct or via the redirect, is:
VERBOSE[1496][C-000000f7] netsock2.c: == Using SIP RTP TOS bits 184
VERBOSE[1496][C-000000f7] netsock2.c: == Using SIP RTP CoS mark 5
VERBOSE[12405][C-000000f7] pbx.c: -- Executing [+441235AAAAAA@from-trunk-sip-landline:1] Set("SIP/landline-00000226", "GROUP()=OUT_2") in new stack
VERBOSE[12405][C-000000f7] pbx.c: -- Executing [+441235AAAAAA@from-trunk-sip-landline:2] Goto("SIP/landline-00000226", "from-trunk,+441235AAAAAA,1") in new stack
VERBOSE[12405][C-000000f7] pbx.c: -- Goto (from-trunk,+441235AAAAAA,1)
VERBOSE[12405][C-000000f7] pbx.c: -- Executing [+441235AAAAAA@from-trunk:1] Set("SIP/landline-00000226", "__FROM_DID=+441235AAAAAA") in new stack
Looking at that, whether the call is direct to my line or has come via the forwarding service, by the time it gets to asterisk it has the same DID: that of the landline.