<div dir="ltr"><div>Sorry for that.</div><div> </div><div>I believe that, dialplan misbehave only when you didn't get the result right?...then instead of below</div><div> </div><div>exten=_XXXXXX,n,GotoIf($["${ODBC_FETCH}" = "FAILURE"]?cleanup,1) </div>
<div> </div><div>try this...</div><div> </div><div>exten=_XXXXXX,n,GotoIf($["${ODBC_FETCH_STATUS}" = "FAILURE"]?cleanup,1) </div><div> </div><div>Hope it helps you out.</div><div> </div><div>Regards,</div>
<div> </div><div>Bharat Lalcheta</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Apr 18, 2013 at 5:36 PM, Pat Collins <span dir="ltr"><<a href="mailto:drdialtone@optonline.net" target="_blank">drdialtone@optonline.net</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div lang="EN-US" vlink="purple" link="blue"><div><p class="MsoNormal"><span style="color:rgb(31,73,125);font-family:"Calibri","sans-serif";font-size:11pt">Thank you Bharat.<u></u><u></u></span></p>
<p class="MsoNormal"><span style="color:rgb(31,73,125);font-family:"Calibri","sans-serif";font-size:11pt">Sadly, that made no difference.<u></u><u></u></span></p><p class="MsoNormal"><span style="color:rgb(31,73,125);font-family:"Calibri","sans-serif";font-size:11pt"><u></u> <u></u></span></p>
<div style="border-width:1pt medium medium;border-style:solid none none;border-color:rgb(181,196,223) currentColor currentColor;padding:3pt 0in 0in"><p class="MsoNormal"><b><span style="font-family:"Tahoma","sans-serif";font-size:10pt">From:</span></b><span style="font-family:"Tahoma","sans-serif";font-size:10pt"> <a href="mailto:asterisk-users-bounces@lists.digium.com" target="_blank">asterisk-users-bounces@lists.digium.com</a> [mailto:<a href="mailto:asterisk-users-bounces@lists.digium.com" target="_blank">asterisk-users-bounces@lists.digium.com</a>] <b>On Behalf Of </b>Bharat Lalcheta<br>
<b>Sent:</b> Thursday, April 18, 2013 7:33 AM<br><b>To:</b> Asterisk Users Mailing List - Non-Commercial Discussion<br><b>Subject:</b> Re: [asterisk-users] ODBC dialplan looping problem<u></u><u></u></span></p></div><p class="MsoNormal">
<u></u> <u></u></p><div><div><p>I think there is no problem with asterisk. <u></u><u></u></p><p>exten=_XXXXXX,n,GotoIf($["${ODBC_FETCH}" = "FAILURE"]?cleanup,1) <u></u><u></u></p><p>exten=_XXXXXX,n,GotoIf($["${ROW_RESULT}" = "${CONF_PIN}"]?good_exten,1)<u></u><u></u></p>
<p>It should be,<u></u><u></u></p><p>exten=_XXXXXX,n,GotoIf($["${ODBC_FETCH}" = "FAILURE"]?getpin,cleanup,1)<br>exten=_XXXXXX,n,GotoIf($["${ROW_RESULT}" = "${CONF_PIN}"]?getpin,good_exten,1)<u></u><u></u></p>
<p>Hope it helps,<u></u><u></u></p><p>Regards,<u></u><u></u></p><p> <u></u><u></u></p><p>Bharat Lalcheta<u></u><u></u></p><div><p class="MsoNormal">On Thu, Apr 18, 2013 at 4:45 PM, Pat Collins <<a href="mailto:drdialtone@optonline.net" target="_blank">drdialtone@optonline.net</a>> wrote:<u></u><u></u></p>
<div><div><p>All,<u></u><u></u></p><p>Thank you in advance for any help.<u></u><u></u></p><p>I have a customer in need of a conferencing system. A requirement is for users to each have their own PIN for the same bridge.<u></u><u></u></p>
<p>So, I put the list of users, PINs bridges into a MYSQL DB and used an ODBC connector to parse the table.<u></u><u></u></p><p>Asterisk is connected and reads the rows as expected. The problem is that if a user enters a PIN that is NOT in the table, asterisk goes crazy and continues to loop forever.<u></u><u></u></p>
<p>Please have a look and tell me where I went so wrong.<u></u><u></u></p><p>Func_odbc.conf looks like this:<u></u><u></u></p><p>[PIN]<u></u><u></u></p><p>dsn=BRIDGE<u></u><u></u></p><p>mode=multirow<u></u><u></u></p><p>readsql=SELECT pin from users WHERE confid='${SQL_ESC(${CONF_ID})}'<u></u><u></u></p>
<p> <u></u><u></u></p><p>extensions.conf section:<u></u><u></u></p><p>[infromhost] ;Host dials 8888 over SIP trunk exten=8888,1,Answer<u></u><u></u></p><p>exten=8888,n,Background(conf-getconfno)<u></u><u></u></p><p>exten=8888,n,WaitExten(10)<u></u><u></u></p>
<p>exten=8888,n,Hangup<u></u><u></u></p><p>exten=_XXXXXX,1,Set(GLOBAL(CONF_ID)=${EXTEN})<u></u><u></u></p><p>exten=_XXXXXX,n,GoTo(rooms,${EXTEN},1)<u></u><u></u></p><p>;<u></u><u></u></p><p>[rooms]<u></u><u></u></p><p>exten=_XXXXXX,1,Set(CONF_ID=${EXTEN})<u></u><u></u></p>
<p>exten=_XXXXXX,n,Background(conf-getpin)<u></u><u></u></p><p>exten=_XXXXXX,n,WaitExten(5)<u></u><u></u></p><p>exten=_XXXXXX,n,Hangup<u></u><u></u></p><p>exten=_1XXXXX,1,Goto(getpin,${EXTEN},1)<u></u><u></u></p><p>exten=_2XXXXX,1,Goto(getpin,${EXTEN},1)<u></u><u></u></p>
<p>exten=_3XXXXX,1,Goto(getpin,${EXTEN},1)<u></u><u></u></p><p>exten=_4XXXXX,1,Goto(getpin,${EXTEN},1)<u></u><u></u></p><p>exten=_5XXXXX,1,Goto(getpin,${EXTEN},1)<u></u><u></u></p><p>exten=_6XXXXX,1,Goto(getpin,${EXTEN},1)<u></u><u></u></p>
<p>exten=_7XXXXX,1,Goto(getpin,${EXTEN},1)<u></u><u></u></p><p>exten=_8XXXXX,1,Goto(getpin,${EXTEN},1)<u></u><u></u></p><p>exten=_9XXXXX,1,Goto(getpin,${EXTEN},1)<u></u><u></u></p><p>exten=i,1,Goto(getpin,${CONF_PIN},1)<u></u><u></u></p>
<p>;<u></u><u></u></p><p>[getpin]<u></u><u></u></p><p>exten=_XXXXXX,1,Set(GLOBAL(CONF_PIN)=${EXTEN})<u></u><u></u></p><p>exten=_XXXXXX,n,Set(ODBC_ID=${ODBC_PIN(1)})<u></u><u></u></p><p>exten=_XXXXXX,n(loop_start),NoOp()<u></u><u></u></p>
<p>exten=_XXXXXX,n,Set(ROW_RESULT=${ODBC_FETCH(${ODBC_ID})})<u></u><u></u></p><p>exten=_XXXXXX,n,GotoIf($["${ODBC_FETCH}" = "FAILURE"]?cleanup,1) <u></u><u></u></p><p>exten=_XXXXXX,n,GotoIf($["${ROW_RESULT}" = "${CONF_PIN}"]?good_exten,1)<u></u><u></u></p>
<p>exten=_XXXXXX,n,Goto(loop_start)<u></u><u></u></p><p>;<u></u><u></u></p><p>exten=cleanup,1,Verbose(1,Finish up)<u></u><u></u></p><p>same=n,Verbose(1,PIN not found)<u></u><u></u></p><p>same=n,ODBCFinish(${ODBC_ID})<u></u><u></u></p>
<p>same=n,playback(conf-invalidpin)<u></u><u></u></p><p>same=n,Goto(rooms,${CONF_ID}1)<u></u><u></u></p><p>same=n,Hangup()<u></u><u></u></p><p>;<u></u><u></u></p><p>exten=good_exten,1,Verbose(1,The PIN is available)<u></u><u></u></p>
<p>same=n,ODBCFinish(${ODBC_ID})<u></u><u></u></p><p>same=n,Verbose(1,Drop Caller into the bridge)<u></u><u></u></p><p>same=n,Set(CONFBRIDGE(user,template)=default_user)<u></u><u></u></p><p>same=n,ConfBridge(${CONF_ID},default_bridge,,sample_user_menu)<u></u><u></u></p>
<p>same=n,Hangup()<u></u><u></u></p><p>;<u></u><u></u></p><p> <u></u><u></u></p><p>The log shows the 3 existing DB table rows are found but continues to cycle indefinitely if the PIN is NOT found.<u></u><u></u></p><p>First few rows of the console log:<u></u><u></u></p>
<p>=========================================================================<u></u><u></u></p><p>Connected to Asterisk 11.3.0 currently running on atpconf001 (pid = 1695) atpconf001*CLI><u></u><u></u></p><p> == Using SIP RTP CoS mark 5<u></u><u></u></p>
<p> <u></u><u></u></p><p>atpconf001*CLI> <u></u><u></u></p><p> -- Executing [067740@default:1] Set("SIP/testbridge2-00000021", "GLOBAL(CONF_ID)=067740") in new stack<u></u><u></u></p><p> == Setting global variable 'CONF_ID' to '067740'<u></u><u></u></p>
<p> -- Executing [067740@default:2] Goto("SIP/testbridge2-00000021", "rooms,067740,1") in new stack<u></u><u></u></p><p> <u></u><u></u></p><p>atpconf001*CLI> <u></u><u></u></p><p> -- Goto (rooms,067740,1)<u></u><u></u></p>
<p> -- Executing [067740@rooms:1] Set("SIP/testbridge2-00000021", "CONF_ID=067740") in new stack<u></u><u></u></p><p> -- Executing [067740@rooms:2] BackGround("SIP/testbridge2-00000021", "conf-getpin") in new stack<u></u><u></u></p>
<p> <u></u><u></u></p><p>atpconf001*CLI> <u></u><u></u></p><p> -- <SIP/testbridge2-00000021> Playing 'conf-getpin.slin' (language 'en')<u></u><u></u></p><p> <u></u><u></u></p><p>atpconf001*CLI> <u></u><u></u></p>
<p> -- Executing [067740@rooms:3] WaitExten("SIP/testbridge2-00000021", "5") in new stack<u></u><u></u></p><p> <u></u><u></u></p><p>atpconf001*CLI><u></u><u></u></p><p> == CDR updated on SIP/testbridge2-00000021<u></u><u></u></p>
<p> -- Executing [444999@rooms:1] Goto("SIP/testbridge2-00000021", "getpin,444999,1") in new stack<u></u><u></u></p><p> -- Goto (getpin,444999,1)<u></u><u></u></p><p> -- Executing [444999@getpin:1] Set("SIP/testbridge2-00000021", "GLOBAL(CONF_PIN)=444999") in new stack<u></u><u></u></p>
<p> == Setting global variable 'CONF_PIN' to '444999'<u></u><u></u></p><p> <u></u><u></u></p><p>atpconf001*CLI> <u></u><u></u></p><p> -- Executing [444999@getpin:2] Set("SIP/testbridge2-00000021", "ODBC_ID=32") in new stack<u></u><u></u></p>
<p> -- Executing [444999@getpin:3] NoOp("SIP/testbridge2-00000021", "") in new stack<u></u><u></u></p><p> -- Executing [444999@getpin:4] Set("SIP/testbridge2-00000021", "ROW_RESULT=112233") in new stack<u></u><u></u></p>
<p> <u></u><u></u></p><p>atpconf001*CLI> <u></u><u></u></p><p> -- Executing [444999@getpin:5] GotoIf("SIP/testbridge2-00000021", "0?cleanup,1") in new stack<u></u><u></u></p><p> -- Executing [444999@getpin:6] GotoIf("SIP/testbridge2-00000021", "0?good_exten,1") in new stack<u></u><u></u></p>
<p> -- Executing [444999@getpin:7] Goto("SIP/testbridge2-00000021", "loop_start") in new stack<u></u><u></u></p><p> -- Goto (getpin,444999,3)<u></u><u></u></p><p> -- Executing [444999@getpin:3] NoOp("SIP/testbridge2-00000021", "") in new stack<u></u><u></u></p>
<p> -- Executing [444999@getpin:4] Set("SIP/testbridge2-00000021", "ROW_RESULT=333333") in new stack<u></u><u></u></p><p> -- Executing [444999@getpin:5] GotoIf("SIP/testbridge2-00000021", "0?cleanup,1") in new stack<u></u><u></u></p>
<p> -- Executing [444999@getpin:6] GotoIf("SIP/testbridge2-00000021", "0?good_exten,1") in new stack<u></u><u></u></p><p> -- Executing [444999@getpin:7] Goto("SIP/testbridge2-00000021", "loop_start") in new stack<u></u><u></u></p>
<p> -- Goto (getpin,444999,3)<u></u><u></u></p><p> -- Executing [444999@getpin:3] NoOp("SIP/testbridge2-00000021", "") in new stack<u></u><u></u></p><p> -- Executing [444999@getpin:4] Set("SIP/testbridge2-00000021", "ROW_RESULT=135792") in new stack //LAST GOOD RESULT!!!<u></u><u></u></p>
<p> <u></u><u></u></p><p>atpconf001*CLI> <u></u><u></u></p><p> -- Executing [444999@getpin:5] GotoIf("SIP/testbridge2-00000021", "0?cleanup,1") in new stack<u></u><u></u></p><p> -- Executing [444999@getpin:6] GotoIf("SIP/testbridge2-00000021", "0?good_exten,1") in new stack<u></u><u></u></p>
<p> -- Executing [444999@getpin:7] Goto("SIP/testbridge2-00000021", "loop_start") in new stack<u></u><u></u></p><p> <u></u><u></u></p><p>atpconf001*CLI> <u></u><u></u></p><p> -- Goto (getpin,444999,3)<u></u><u></u></p>
<p> -- Executing [444999@getpin:3] NoOp("SIP/testbridge2-00000021", "") in new stack<u></u><u></u></p><p> <u></u><u></u></p><p>atpconf001*CLI> <u></u><u></u></p><p> -- Executing [444999@getpin:4] Set("SIP/testbridge2-00000021", "ROW_RESULT=") in new stack //BAD RESULTS FOREVER!!!<u></u><u></u></p>
<p> <u></u><u></u></p><p>atpconf001*CLI> <u></u><u></u></p><p> -- Executing [444999@getpin:5] GotoIf("SIP/testbridge2-00000021", "0?cleanup,1") in new stack<u></u><u></u></p><p> <u></u><u></u></p>
<p>atpconf001*CLI> <u></u><u></u></p><p> -- Executing [444999@getpin:6] GotoIf("SIP/testbridge2-00000021", "0?good_exten,1") in new stack<u></u><u></u></p><p> <u></u><u></u></p><p>atpconf001*CLI> <u></u><u></u></p>
<p> -- Executing [444999@getpin:7] Goto("SIP/testbridge2-00000021", "loop_start") in new stack<u></u><u></u></p><p> -- Goto (getpin,444999,3)<u></u><u></u></p><p> -- Executing [444999@getpin:3] NoOp("SIP/testbridge2-00000021", "") in new stack //AND SO ON........<u></u><u></u></p>
<p> <u></u><u></u></p><p>Thank you!!<u></u><u></u></p><p><span style="color:rgb(136,136,136)">Pat Collins...<u></u><u></u></span></p><p><span style="color:rgb(136,136,136)"> <u></u><u></u></span></p><p><span style="color:rgb(136,136,136)"> <u></u><u></u></span></p>
<p><span style="color:rgb(136,136,136)"> <u></u><u></u></span></p></div></div><p class="MsoNormal"><br>--<br>_____________________________________________________________________<br>-- Bandwidth and Colocation Provided by <a href="http://www.api-digital.com" target="_blank">http://www.api-digital.com</a> --<br>
New to Asterisk? Join us for a live introductory webinar every Thurs:<br> <a href="http://www.asterisk.org/hello" target="_blank">http://www.asterisk.org/hello</a><br><br>asterisk-users mailing list<br>To UNSUBSCRIBE or update options visit:<br>
<a href="http://lists.digium.com/mailman/listinfo/asterisk-users" target="_blank">http://lists.digium.com/mailman/listinfo/asterisk-users</a><span class="HOEnZb"><font color="#888888"><u></u><u></u></font></span></p></div>
<span class="HOEnZb"><font color="#888888"><p class="MsoNormal"><br><br clear="all"><br>-- <br>Bharat Lalcheta <u></u><u></u></p></font></span></div></div></div></div><br>--<br>
_____________________________________________________________________<br>
-- Bandwidth and Colocation Provided by <a href="http://www.api-digital.com" target="_blank">http://www.api-digital.com</a> --<br>
New to Asterisk? Join us for a live introductory webinar every Thurs:<br>
<a href="http://www.asterisk.org/hello" target="_blank">http://www.asterisk.org/hello</a><br>
<br>
asterisk-users mailing list<br>
To UNSUBSCRIBE or update options visit:<br>
<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>Bharat Lalcheta
</div>