Some additional information.<br><br>I played with ${DIALEDSTATUS} in place of ${HANGUPCAUSE} and got an unusual result:<br><br>[Oct 28 16:50:54] WARNING[17503]: chan_sip.c:1950 retrans_pkt: Maximum retries exceeded on transmission NzJlOWI0NjI5NTMwMmEwZTExYzZiZTM5YWY4MDk0MzA. for seqno 2 (Critical Response)<br>
<br>This occurs about a second after the user hangs up on the error message being played from the provider. I have a feeling it's trying to execute the next step in the dialplan but unable since the caller hung up.<br>
<br>Thoughts, criticism, insults all welcome!<br><br><div class="gmail_quote">On Tue, Oct 28, 2008 at 12:53 PM, arkda <span dir="ltr"><<a href="mailto:thrills3k3r@gmail.com">thrills3k3r@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">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" target="_blank">voip-info.org</a> ( <a href="http://www.voip-info.org/wiki/index.php?page=Asterisk+variable+hangupcause" target="_blank">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" target="_blank">1.4.21.1</a>, zaptel 1.4.11, libpri 1.4.5, compiled from source.<br><br>Thanks in advance!<br>
</blockquote></div><br>