1500 prefixes is not a big number. You can use a little script for it (less than 50 lines).&nbsp;<div><br></div><div>With a script connecting to a DB server and looking for the prefix, is a good solution. This way you don&#39;t need to force the user to dial the the leading 1 (or not to do it), you just look on the DB server and if it does not matches a local prefix then you dial with the leading 1.</div>
<div><br></div><div>I do not recommend you having all that prefixes on the Dialplan, because it is&nbsp;difficult to maintain.</div><div><div><br></div><div><br><div class="gmail_quote">On Thu, Oct 30, 2008 at 10:14 AM, arkda <span dir="ltr">&lt;<a href="mailto:thrills3k3r@gmail.com">thrills3k3r@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Thanks for the reply!<br><br>Generally that&#39;s what I do, script local area codes and prefixes so that dialing 1 is necessary only for long distance calls. The problem here is that there are over 1500 area codes and prefixes (DC area) that are required by the carrier to not be dialed with a 1 (ie, local calls). If push comes to shove, I&#39;ll implement them all in the dialplan, but this just seems like a poor way of handling it.<br>

<br>Running another Dial statement after a timeout with r will put the possible wait time close to a minute if the callee doesn&#39;t answer and voicemail picks up (I try to estimate as long as 30 seconds for voicemail pickup). I may turn this on for a temporary fix, but it&#39;s not an acceptable solution long term.<div>
<div></div><div class="Wj3C7c"><br>
<br><div class="gmail_quote">On Thu, Oct 30, 2008 at 12:08 AM, Juan Rodríguez <span dir="ltr">&lt;<a href="mailto:jerdguez@gmail.com" target="_blank">jerdguez@gmail.com</a>&gt;</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">

Arka:<div><br></div><div>I thought you would reroute the call with (or without) the leading one, so, just Dial again.</div><div><br></div><div>This will work and your users wont notice a BIG difference if the call is answered. The problem is if the call is not answer, because if you have a busy number, then your users will get something like &quot;ring, ring...ring, beep,beep...&quot;.</div>


<div><br></div><div>For a better solution I would recommend you to get at least your local prefixes and use the correct dial string with patterns. This can be&nbsp;achieved with a script.</div><div><div></div><div>
<div><br></div><div><br><div class="gmail_quote">
On Wed, Oct 29, 2008 at 6:15 PM, arkda <span dir="ltr">&lt;<a href="mailto:thrills3k3r@gmail.com" target="_blank">thrills3k3r@gmail.com</a>&gt;</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">


I left something out on that last message, sorry.<br><br>With r, not R, it will mask the message with ringing. I could then fail it over to another dial out, however from testing I&#39;ve found that my users expect something to happen within 30 seconds (voicemail, pickup, etc.) The worse-case scenario would be using r a time of 60 seconds. I&#39;ve been thinking of implementing this as a temp fix, but not something I want to leave in place.<div>


<div></div><div><br>
<br><br><div class="gmail_quote">On Wed, Oct 29, 2008 at 5:46 PM, arkda <span dir="ltr">&lt;<a href="mailto:thrills3k3r@gmail.com" target="_blank">thrills3k3r@gmail.com</a>&gt;</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">



Thanks for the reply!<br><br>I&#39;ve played around with R to solve this (probably should have mentioned that), however I wasn&#39;t able to make it work. The message is still played (this message is from the provider). It will move to the next line in the dialplan, but as soon as users hear the message they hang up.<br>




<br>Since the progress code comes before actual audio is played to the caller there has to be a way of catching this and dealing with it in the dialplan, but nothing I&#39;ve tried so far works.<div><div></div><div>
<br><br><div class="gmail_quote">
On Wed, Oct 29, 2008 at 12:25 AM, Juan Rodríguez <span dir="ltr">&lt;<a href="mailto:jerdguez@gmail.com" target="_blank">jerdguez@gmail.com</a>&gt;</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">




Try using a R or r on the Dial command, the R option is better for you in my opinion.<div><br></div><div>i.e&nbsp;<span style="border-collapse:collapse">Dial(Zap/G2/1${EXTEN},30,R) or&nbsp;</span><span style="border-collapse:collapse">Dial(Zap/G2/1${EXTEN}|30|R)</span></div>





<div><span style="border-collapse:collapse"><br></span></div><div><span style="border-collapse:collapse">The R option is going to generate a ring tone when the callee indicates ringing and is going wait for an Answer. As Progress is just for early media, you wont get that message.&nbsp;</span></div>





<div><span style="border-collapse:collapse"><br></span></div><div><span style="border-collapse:collapse">For more info on the Dial command see:</span></div><div><span style="border-collapse:collapse"><br>
</span></div><div><span style="border-collapse:collapse"><a href="http://www.voip-info.org/wiki-Asterisk+cmd+Dial" target="_blank">http://www.voip-info.org/wiki-Asterisk+cmd+Dial</a><br></span></div><div><br></div>
<div><br></div><div><br><div class="gmail_quote"><div><div></div><div>On Tue, Oct 28, 2008 at 6:56 PM, arkda <span dir="ltr">&lt;<a href="mailto:thrills3k3r@gmail.com" target="_blank">thrills3k3r@gmail.com</a>&gt;</span> wrote:<br>




</div></div><blockquote class="gmail_quote" style="border-left:1px solid rgb(204, 204, 204);margin:0pt 0pt 0pt 0.8ex;padding-left:1ex"><div><div></div><div>
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&#39;s trying to execute the next step in the dialplan but unable since the caller hung up.<br>






<br>Thoughts, criticism, insults all welcome!<div><div></div><div><br><br><div class="gmail_quote">On Tue, Oct 28, 2008 at 12:53 PM, arkda <span dir="ltr">&lt;<a href="mailto:thrills3k3r@gmail.com" target="_blank">thrills3k3r@gmail.com</a>&gt;</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&#39;ve ran into an issue with a PRI provider in a major metropolitan area that I haven&#39;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&#39;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&#39;ve tracked down this behavior when a call fails:<br><br>&nbsp;&nbsp;&nbsp; -- Executing [5551515121@internal:1] Set(&quot;SIP/user9-b696fb58&quot;, &quot;GROUP(default)=dialpool&quot;) in new stack<br>







&nbsp;&nbsp;&nbsp; -- Executing [5551515121@internal:2] GotoIf(&quot;SIP/user9-b696fb58&quot;, &quot;1?5&quot;) in new stack<br>&nbsp;&nbsp;&nbsp; -- Goto (internal,5551515121,5)<br>&nbsp;&nbsp;&nbsp; -- Executing [5551515121@internal:5] Set(&quot;SIP/user9-b696fb58&quot;, &quot;GROUP(default)=dialpool&quot;) in new stack<br>







&nbsp;&nbsp;&nbsp; -- Executing [5551515121@internal:6] Answer(&quot;SIP/user9-b696fb58&quot;, &quot;&quot;) in new stack<br>&nbsp;&nbsp;&nbsp; -- Executing [5551515121@internal:7] Set(&quot;SIP/user9-b696fb58&quot;, &quot;CALLERID(num)=5552223333&quot;) in new stack<br>







&nbsp;&nbsp;&nbsp; -- Executing [5551515121@internal:8] Set(&quot;SIP/user9-b696fb58&quot;, &quot;CALLERID(name)=HiThere&quot;) in new stack<br>&nbsp;&nbsp;&nbsp; -- Executing [5551515121@internal:9] NoOp(&quot;SIP/user9-b696fb58&quot;, &quot;--out the pri--&quot;) in new stack<br>







&nbsp;&nbsp;&nbsp; -- Executing [5551515121@internal:10] Dial(&quot;SIP/user9-b696fb58&quot;, &quot;Zap/G2/15551515121&quot;) in new stack<br>&nbsp;&nbsp;&nbsp; -- Requested transfer capability: 0x00 - SPEECH<br>&nbsp;&nbsp;&nbsp; -- Called G2/15551515121<br>&nbsp;&nbsp;&nbsp; -- Zap/22-1 is proceeding passing it to SIP/user9-b696fb58<br>







&nbsp;&nbsp;&nbsp; -- PROGRESS with cause code 31 received<br>&nbsp;&nbsp;&nbsp; -- Zap/22-1 is making progress passing it to SIP/user9-b696fb58<br>&nbsp;&nbsp;&nbsp; -- Hungup &#39;Zap/22-1&#39;<br>&nbsp; == Spawn extension (internal, 5551515121, 10) exited non-zero on &#39;SIP/user9-b696fb58&#39;<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 &#39;You do not need to dial a one or zero...&#39; and the message repeats indefinitely.<br>







<br>I&#39;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&#39;ve tried this so far:<br><br>exten =&gt; _NXXXXXXXXX,1,Set(GROUP(default)=dialpool)<br>







exten =&gt; _NXXXXXXXXX,2,GotoIf($[${GROUP_COUNT(priout@default)}&lt;19]?5)<br>exten =&gt; _NXXXXXXXXX,3,GotoIf($[${GROUP_COUNT(congest@default)}&gt;18]?BLOCK)<br>exten =&gt; _NXXXXXXXXX,4,NoOp<br>exten =&gt; _NXXXXXXXXX,5,Set(GROUP(default)=dialpool)<br>







exten =&gt; _NXXXXXXXXX,6,Answer()<br>exten =&gt; _NXXXXXXXXX,7,Set(CALLERID(num)=${CLR})<br>exten =&gt; _NXXXXXXXXX,8,Set(CALLERID(name)=HiThere)<br>exten =&gt; _NXXXXXXXXX,9,NoOp(--out the pri--)<br>; Primary Dialout<br>







exten =&gt; _NXXXXXXXXX,10,Dial(Zap/G2/1${EXTEN})<br>exten =&gt; _NXXXXXXXXX,11,GotoIf,($[${HANGUPCAUSE} = 31]?YAY)<br>exten =&gt; _NXXXXXXXXX,12,Hangup()<br>; Call limiter<br>exten =&gt; _NXXXXXXXXX,n(BLOCK),Answer()<br>







exten =&gt; _NXXXXXXXXX,n(BLOCK),Playback(all-circuits-busy-now)<br>exten =&gt; _NXXXXXXXXX,n(BLOCK),Playback(pls-try-call-later)<br>exten =&gt; _NXXXXXXXXX,n(BLOCK),Hangup()<br>; 1 tester<br>exten =&gt; _NXXXXXXXXX,n(YAY),Answer()<br>







exten =&gt; _NXXXXXXXXX,n(YAY),Playback(beep)<br>exten =&gt; _NXXXXXXXXX,n(YAY),Hangup()<br><br>It doesn&#39;t work. The user simply hangs up when the message is heard and the next line in the dialplan isn&#39;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>
</div></div><br></div></div>_______________________________________________<br>
-- Bandwidth and Colocation Provided by <a href="http://www.api-digital.com" target="_blank">http://www.api-digital.com</a> --<br>
<br>
asterisk-users mailing list<br>
To UNSUBSCRIBE or update options visit:<br>
 &nbsp; <a href="http://lists.digium.com/mailman/listinfo/asterisk-users" target="_blank">http://lists.digium.com/mailman/listinfo/asterisk-users</a><br></blockquote></div><br><br clear="all"><br>-- <br>Juan E. Rodríguez<br>Cel. 829-886-5565<br>





Work: 809-724-9227<br>
</div>
<br>_______________________________________________<br>
-- Bandwidth and Colocation Provided by <a href="http://www.api-digital.com" target="_blank">http://www.api-digital.com</a> --<br>
<br>
asterisk-users mailing list<br>
To UNSUBSCRIBE or update options visit:<br>
 &nbsp; <a href="http://lists.digium.com/mailman/listinfo/asterisk-users" target="_blank">http://lists.digium.com/mailman/listinfo/asterisk-users</a><br></blockquote></div><br>
</div></div></blockquote></div><br>
</div></div><br>_______________________________________________<br>
-- Bandwidth and Colocation Provided by <a href="http://www.api-digital.com" target="_blank">http://www.api-digital.com</a> --<br>
<br>
asterisk-users mailing list<br>
To UNSUBSCRIBE or update options visit:<br>
 &nbsp; <a href="http://lists.digium.com/mailman/listinfo/asterisk-users" target="_blank">http://lists.digium.com/mailman/listinfo/asterisk-users</a><br></blockquote></div><br><br clear="all"><br>-- <br>Juan E. Rodríguez<br>Cel. 829-886-5565<br>


Work: 809-724-9227<br>
</div>
</div></div><br>_______________________________________________<br>
-- Bandwidth and Colocation Provided by <a href="http://www.api-digital.com" target="_blank">http://www.api-digital.com</a> --<br>
<br>
asterisk-users mailing list<br>
To UNSUBSCRIBE or update options visit:<br>
 &nbsp; <a href="http://lists.digium.com/mailman/listinfo/asterisk-users" target="_blank">http://lists.digium.com/mailman/listinfo/asterisk-users</a><br></blockquote></div><br>
</div></div><br>_______________________________________________<br>
-- Bandwidth and Colocation Provided by <a href="http://www.api-digital.com" target="_blank">http://www.api-digital.com</a> --<br>
<br>
asterisk-users mailing list<br>
To UNSUBSCRIBE or update options visit:<br>
 &nbsp; <a href="http://lists.digium.com/mailman/listinfo/asterisk-users" target="_blank">http://lists.digium.com/mailman/listinfo/asterisk-users</a><br></blockquote></div><br><br clear="all"><br>-- <br>Juan E. Rodríguez<br>Cel. 829-886-5565<br>
Work: 809-724-9227<br>
</div></div>