Hi,<br><br>I've ran into an issue with a PRI provider in a major metropolitan area that I haven't needed to deal with before and I was hoping someone might have some insight on how to handle this within the Asterisk dialplan.<br>
<br>At this location users can't always tell if a number is long distance or not (there are a lot of area codes and prefixes in the vicinity). Additionally, users are required by the provider to dial the full 10 digit number even if a call is local since a local call could be for a few different area codes and prefixes. The problem is the provider requires a 1 in front of the number for long distance calls, but errors out if the call has a 1 in front and the call is local.<br>
<br>As a result, users are complaining that they are constantly having to redial with or without the 1. I've tracked down this behavior when a call fails:<br><br> -- Executing [5551515121@internal:1] Set("SIP/user9-b696fb58", "GROUP(default)=dialpool") in new stack<br>
-- Executing [5551515121@internal:2] GotoIf("SIP/user9-b696fb58", "1?5") in new stack<br> -- Goto (internal,5551515121,5)<br> -- Executing [5551515121@internal:5] Set("SIP/user9-b696fb58", "GROUP(default)=dialpool") in new stack<br>
-- Executing [5551515121@internal:6] Answer("SIP/user9-b696fb58", "") in new stack<br> -- Executing [5551515121@internal:7] Set("SIP/user9-b696fb58", "CALLERID(num)=5552223333") in new stack<br>
-- Executing [5551515121@internal:8] Set("SIP/user9-b696fb58", "CALLERID(name)=HiThere") in new stack<br> -- Executing [5551515121@internal:9] NoOp("SIP/user9-b696fb58", "--out the pri--") in new stack<br>
-- Executing [5551515121@internal:10] Dial("SIP/user9-b696fb58", "Zap/G2/15551515121") in new stack<br> -- Requested transfer capability: 0x00 - SPEECH<br> -- Called G2/15551515121<br> -- Zap/22-1 is proceeding passing it to SIP/user9-b696fb58<br>
-- PROGRESS with cause code 31 received<br> -- Zap/22-1 is making progress passing it to SIP/user9-b696fb58<br> -- Hungup 'Zap/22-1'<br> == Spawn extension (internal, 5551515121, 10) exited non-zero on 'SIP/user9-b696fb58'<br>
<br>The above call was a call that is considered local by the provider. The caller is then redirected to a message (by the provider) saying 'You do not need to dial a one or zero...' and the message repeats indefinitely.<br>
<br>I'd like to figure out how to handle this in the dial plan so users do not even know anything happened. To test to see if I could stop the call progress and reroute it I've tried this so far:<br><br>exten => _NXXXXXXXXX,1,Set(GROUP(default)=dialpool)<br>
exten => _NXXXXXXXXX,2,GotoIf($[${GROUP_COUNT(priout@default)}<19]?5)<br>exten => _NXXXXXXXXX,3,GotoIf($[${GROUP_COUNT(congest@default)}>18]?BLOCK)<br>exten => _NXXXXXXXXX,4,NoOp<br>exten => _NXXXXXXXXX,5,Set(GROUP(default)=dialpool)<br>
exten => _NXXXXXXXXX,6,Answer()<br>exten => _NXXXXXXXXX,7,Set(CALLERID(num)=${CLR})<br>exten => _NXXXXXXXXX,8,Set(CALLERID(name)=HiThere)<br>exten => _NXXXXXXXXX,9,NoOp(--out the pri--)<br>; Primary Dialout<br>
exten => _NXXXXXXXXX,10,Dial(Zap/G2/1${EXTEN})<br>exten => _NXXXXXXXXX,11,GotoIf,($[${HANGUPCAUSE} = 31]?YAY)<br>exten => _NXXXXXXXXX,12,Hangup()<br>; Call limiter<br>exten => _NXXXXXXXXX,n(BLOCK),Answer()<br>
exten => _NXXXXXXXXX,n(BLOCK),Playback(all-circuits-busy-now)<br>exten => _NXXXXXXXXX,n(BLOCK),Playback(pls-try-call-later)<br>exten => _NXXXXXXXXX,n(BLOCK),Hangup()<br>; 1 tester<br>exten => _NXXXXXXXXX,n(YAY),Answer()<br>
exten => _NXXXXXXXXX,n(YAY),Playback(beep)<br>exten => _NXXXXXXXXX,n(YAY),Hangup()<br><br>It doesn't work. The user simply hangs up when the message is heard and the next line in the dialplan isn't followed. How can I detect that a call has received a progress code 31 then reroute it to another extension? From what I found on <a href="http://voip-info.org">voip-info.org</a> ( <a href="http://www.voip-info.org/wiki/index.php?page=Asterisk+variable+hangupcause">http://www.voip-info.org/wiki/index.php?page=Asterisk+variable+hangupcause</a> ) this should work. What am I missing?<br>
<br>The server is running Asterisk <a href="http://1.4.21.1">1.4.21.1</a>, zaptel 1.4.11, libpri 1.4.5, compiled from source.<br><br>Thanks in advance!<br>