<html>

<head>
<meta http-equiv=Content-Type content="text/html; charset=us-ascii">
<meta name=Generator content="Microsoft Word 11 (filtered)">

<style>
<!--
 /* Font Definitions */
 @font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman";}
a:link, span.MsoHyperlink
        {color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {color:blue;
        text-decoration:underline;}
span.EmailStyle18
        {font-family:Arial;
        color:navy;}
@page Section1
        {size:8.5in 11.0in;
        margin:1.0in 1.25in 1.0in 1.25in;}
div.Section1
        {page:Section1;}
-->
</style>

</head>

<body lang=EN-US link=blue vlink=blue>

<div class=Section1>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>Here is an example of a dialplan that
looks up a post dial code in a mysql database and updates the accountcode
accordingly.</span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>&nbsp;</span></font></p>

<p class=MsoNormal style='text-autospace:none'><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'>exten =&gt;
_1XXXXXXXXXX,1,Read(postcode|beep|3||1|10)</span></font></p>

<p class=MsoNormal style='text-autospace:none'><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'>exten =&gt;
_1XXXXXXXXXX,2,set(level_auth=0)</span></font></p>

<p class=MsoNormal style='text-autospace:none'><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'>exten =&gt;
_1XXXXXXXXXX,3,Realtime(postcodes|postcode|${ACCOUNTCODE}${postcode}|level_)</span></font></p>

<p class=MsoNormal style='text-autospace:none'><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'>exten =&gt; _1XXXXXXXXXX,4,GotoIf($[${level_auth}
&gt; 0]?7)</span></font></p>

<p class=MsoNormal style='text-autospace:none'><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'>exten =&gt;
_1XXXXXXXXXX,5,Congestion(5)</span></font></p>

<p class=MsoNormal style='text-autospace:none'><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'>exten =&gt;
_1XXXXXXXXXX,6,Hangup()</span></font></p>

<p class=MsoNormal style='text-autospace:none'><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'>exten =&gt;
_1XXXXXXXXXX,7,playback(beep)</span></font></p>

<p class=MsoNormal style='text-autospace:none'><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'>exten =&gt;
_1XXXXXXXXXX,8,Set(CDR(accountcode)=${ACCOUNTCODE}${postcode})</span></font></p>

<p class=MsoNormal style='text-autospace:none'><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'>exten =&gt;
_1XXXXXXXXXX,9,Dial(LOCAL/${EXTEN}@subscriber)</span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>&nbsp;</span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>&nbsp;</span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>The values in the db for the field auth
are 1 and 2, 1 allows this dialplan to run (US national calls) and 2 is used in
similar dialpna to allow international calls (_011.)</span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>&nbsp;</span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>If you are not enforcing strict
accountcodes, so the user can enter any code they want, you do not need the
database.</span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>&nbsp;</span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>The authenticate application command was
too cumbersome for our use, it shares prompts with another application (which really
should be changed).</span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>&nbsp;</span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>&nbsp;</span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>&nbsp;</span></font></p>

<div style='border:none;border-left:solid blue 1.5pt;padding:0in 0in 0in 4.0pt'>

<div>

<div class=MsoNormal align=center style='text-align:center'><font size=3
face="Times New Roman"><span style='font-size:12.0pt'>

<hr size=2 width="100%" align=center tabindex=-1>

</span></font></div>

<p class=MsoNormal><b><font size=2 face=Tahoma><span style='font-size:10.0pt;
font-family:Tahoma;font-weight:bold'>From:</span></font></b><font size=2
face=Tahoma><span style='font-size:10.0pt;font-family:Tahoma'>
asterisk-users-bounces@lists.digium.com
[mailto:asterisk-users-bounces@lists.digium.com] <b><span style='font-weight:
bold'>On Behalf Of </span></b>Pietro U<br>
<b><span style='font-weight:bold'>Sent:</span></b> Friday, June 09, 2006 7:51
AM<br>
<b><span style='font-weight:bold'>To:</span></b> Asterisk Users Mailing List -
 Non-Commercial Discussion<br>
<b><span style='font-weight:bold'>Subject:</span></b> Re: [Asterisk-Users] long
distance ask for pin</span></font></p>

</div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>&nbsp;</span></font></p>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>On 6/9/06, <b><span style='font-weight:bold'>Doug Lytle</span></b> &lt;<a
href="mailto:support@drdos.info">support@drdos.info</a>&gt; wrote:</span></font></p>

<div>

<blockquote style='border:none;border-left:solid #CCCCCC 1.0pt;padding:0in 0in 0in 6.0pt;
margin-left:4.8pt;margin-right:0in'>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>Pietro U wrote:<br>
&gt; hi all i have my asterisk work perfectly thanks to you now i need to<br>
&gt; apply some improvements like PIN :(<br>
&gt;<br>
&gt; i need to add somenthing in here or in other section in the conf?<br>
&gt;<br>
<a href="http://www.voip-info.org/wiki/index.php?page=Asterisk+cmd+Authenticate">http://www.voip-info.org/wiki/index.php?page=Asterisk+cmd+Authenticate</a></span></font></p>

</blockquote>

<div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'><br>
<br>
yes but this is for extensions numbers, not for longdistance calls, because the
same user can call in my city but i need to asterisk ask a pin when this people
dial a longdistance <br>
<br>
&nbsp;</span></font></p>

</div>

<blockquote style='border:none;border-left:solid #CCCCCC 1.0pt;padding:0in 0in 0in 6.0pt;
margin-left:4.8pt;margin-right:0in'>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>&nbsp;</span></font></p>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>Doug<br>
<br>
<br>
--<br>
<br>
Ben Franklin quote:<br>
<br>
&quot;Those who would give up Essential Liberty to purchase a little Temporary
Safety, deserve neither Liberty nor Safety.&quot; <br>
<br>
<br>
_______________________________________________<br>
--Bandwidth and Colocation provided by <a href="http://Easynews.com">Easynews.com</a>
--<br>
<br>
Asterisk-Users mailing list<br>
To UNSUBSCRIBE or update options visit: <br>
&nbsp;&nbsp; <a href="http://lists.digium.com/mailman/listinfo/asterisk-users">http://lists.digium.com/mailman/listinfo/asterisk-users</a></span></font></p>

</blockquote>

</div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>&nbsp;</span></font></p>

</div>

</div>

</body>

</html>