<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 TRANSITIONAL//EN">
<HTML>
<HEAD>
  <META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=UTF-8">
  <META NAME="GENERATOR" CONTENT="GtkHTML/3.32.2">
</HEAD>
<BODY LINK="#0000ff">
Hello Felix,<BR>
<BR>
I did it in this way:<BR>
<BR>
<B>In the extensions.conf</B><BR>
Create this two Macros:<BR>
<BR>
[macro-ask-pass]<BR>
exten =&gt; s,1,Set(ORI=${MACRO_EXTEN})<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; same =&gt; n,Set(TIMEOUT(digit)=5)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ; Set Digit Timeout to 5 seconds<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; same =&gt; n,Set(TIMEOUT(response)=10)&nbsp;&nbsp;&nbsp;&nbsp; ; Set Response Timeout to 10 seconds<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; same =&gt; n,Background(vm-password)<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; same =&gt; n,WaitExten(5)<BR>
<BR>
[macro-verify-pass]<BR>
exten =&gt; s,1,Set(GO=${ODBC_PASS(${MACRO_EXTEN:2},${ARG1},${ARG2})})<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; same =&gt; n,Verbose(${GO})<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; same =&gt; n,Verbose(${ORI})<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; same =&gt; n,GotoIf($[${GO} = 0]?wrong:ok)<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; same =&gt; n(wrong),Playback(vm-incorrect)<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; same =&gt; n,Hangup()<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; same =&gt; n(ok),Playback(auth-thankyou)<BR>
<BR>
Then in trunk ld I call the macro this way (all the passwords start with *1 (for example *1252525252, *1545288362): <BR>
<BR>
[trunkld]<BR>
<BR>
exten =&gt; _9X1NXXXXXXXXX,1,Macro(ask-pass)<BR>
exten =&gt; _*1.,1,Macro(verify-pass,restricted,unlimited)<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; same =&gt; n,Set(FILENAME=g${CALLERID(all)}-${EXTEN}-${STRFTIME(${EPOCH},GMT+5,%C%y%m%d%H%M)}-${UNIQUEID})<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; same =&gt; n,Macro(dundi-e164,${ORI:1})<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; same =&gt; n,MixMonitor(${MONDIR}${FILENAME}.wav,b)<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; same =&gt; n,Dial(${GLOBAL(TRUNK)}/${ORI:${GLOBAL(TRUNKMSD)}})<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; same =&gt; n,StopMixMonitor()<BR>
<BR>
<B>In the func_odbc.conf</B><BR>
[PASS]<BR>
dsn=asterisk<BR>
readsql=select count(*) from ast_passwd where passwd = '${SQL_ESC(${ARG1})}' and user_profile in ('${SQL_ESC(${ARG2})}','${SQL_ESC(${ARG3})}')<BR>
<BR>
<BR>
I do not know if this is the better way to achieve this but this works, and ask password every time some one call to long distance number.<BR>
<BR>
<BR>
I hope this helps.<BR>
<BR>
Regards,<BR>
Sergio Basurto<BR>
<BR>
On Mon, 2013-05-20 at 13:02 +0000, Felix Vazquez wrote:
<BLOCKQUOTE TYPE=CITE>
    How do I make a user dial a passcode if he wants to make an international call?<BR>
    <BR>
    &nbsp;<BR>
    <BR>
    <BR>
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=CITE>
    <BR>
    
<HR ALIGN="center">
<BR>
    <BR>
    <FONT SIZE="1"><FONT COLOR="#bebebe">This electronic message contains information from BOSH Global Services which may be company sensitive, proprietary, privileged or otherwise protected from disclosure. The information is intended to be used solely by the recipient(s) named above. If you are not an intended recipient, be aware that any review, disclosure, copying, distribution or use of this transmission or its contents is prohibited. If you have received this transmission in error, please notify the sender immediately.</FONT></FONT>
<PRE>
--
_____________________________________________________________________
-- Bandwidth and Colocation Provided by <A HREF="http://www.api-digital.com">http://www.api-digital.com</A> --
New to Asterisk? Join us for a live introductory webinar every Thurs:
               <A HREF="http://www.asterisk.org/hello">http://www.asterisk.org/hello</A>

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   <A HREF="http://lists.digium.com/mailman/listinfo/asterisk-users">http://lists.digium.com/mailman/listinfo/asterisk-users</A>
</PRE>
</BLOCKQUOTE>
<BR>
</BODY>
</HTML>