T1 PRI Caller ID problems

darrin
Posts: 11
Member Since:
2009-10-23

Hi All,

We have a OpenVOX D110P to interface our Trixbox (2.8.0.4) machine to the PSTN. I was getting complaints that inbound calls would sometimes be missing the caller id name. The number was always being shown on the handsets.

I used 'pri intensive debug span 1' to see what was going on. It turned out that asterisk was handling the call too quickly - by the time the caller id name was received it had already routed it to a handset.

I was able to work around this by modifiying the from-zaptel context and inserting a delay. That caused the caller id name to show up. However it stopped the nationalprefix and internationalprefix (chan_dahdi.conf, I set them to 91 and 9011) from being applied. So I had to add lines to save away the original caller id number and then restore it again after the sleep.

catalina*CLI> dialplan show from-zaptel
[ Context 'from-zaptel' created by 'pbx_config' ]
'fax' => 1. Goto(ext-fax,in_fax,1) [pbx_config]
's' => 1. Noop(Entering from-zaptel with DID == ${DID} CID == ${CALLERID(all)}) [pbx_config]
2. Set(PREFIXED_CID=${CALLERID(number)}) [pbx_config]
3. Wait(1) [pbx_config]
4. Set(CALLERID(number)=${PREFIXED_CID}) [pbx_config]
5. Noop(After delay with DID == ${DID} CID == ${CALLERID(all)}) [pbx_config]
6. Ringing() [pbx_config]
7. Set(DID=${IF($["${DID}"= ""]?s:${DID})}) [pbx_config]
8. Noop(DID is now ${DID}) [pbx_config]
9. GotoIf($["${CHANNEL:0:5}"="DAHDI"]?zapok:notzap) [pbx_config]
[notzap] 10. Goto(from-pstn,${DID},1) [pbx_config]
11. Macro(Hangupcall,dummy) [pbx_config]
[zapok] 12. Noop(Is a Zaptel Channel) [pbx_config]
13. Set(CHAN=${CHANNEL:6}) [pbx_config]
14. Set(CHAN=${CUT(CHAN,-,1)}) [pbx_config]
15. Macro(from-zaptel-${CHAN},${DID},1) [pbx_config]
16. Noop(Returned from Macro from-zaptel-${CHAN}) [pbx_config]
17. Goto(from-pstn,${DID},1) [pbx_config]
'_X.' => 1. Set(DID=${EXTEN}) [pbx_config]
2. Goto(s,1) [pbx_config]
Include => 'from-zaptel-custom' [pbx_config]

With this code, an incoming call looks like:

-- Executing [s@from-zaptel:1] NoOp("DAHDI/1-1", "Entering from-zaptel with DID == 1630 CID == "" ") in new stack
-- Executing [s@from-zaptel:2] Set("DAHDI/1-1", "PREFIXED_CID=913231234567") in new stack
-- Executing [s@from-zaptel:3] Wait("DAHDI/1-1", "1") in new stack
-- Executing [s@from-zaptel:4] Set("DAHDI/1-1", "CALLERID(number)=913231234567") in new stack
-- Executing [s@from-zaptel:5] NoOp("DAHDI/1-1", "After delay with DID == 1630 CID == "JOHN APPLESEED " ") in new stack

This is a pretty awful hack, but it seems to work. Is there a better way to handle this?

Thanks



jfinstrom
Posts: 2013
Member Since:
2007-03-07
http://www.voip-info.org/wiki

http://www.voip-info.org/wiki/view/CallerID

On ISDN PRI lines (US NI-2 type) Callerid name information CNAM is transmitted in a separate FACILITY IE. some time AFTER the initial SETUP message. If you are using CNAM in your dialplan make sure to insert a wait statement before using the calleridname variable. Otherwise CALLERIDNAME will not be populated initially.

i.e.:
exten => _X.,1,NoOp,${CALLERIDNAME} ; will be empty. - FACILITY IE has not been received yet.
exten => _X.,2,Wait(1) ; wait for the CO to find the name in the database
exten => _X.,3,NoOp,${CALLERIDNAME} ; now it shows the name

--



Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.