<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=us-ascii"><meta name=Generator content="Microsoft Word 12 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Consolas;
        panose-1:2 11 6 9 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
p.MsoPlainText, li.MsoPlainText, div.MsoPlainText
        {mso-style-priority:99;
        mso-style-link:"Plain Text Char";
        margin:0in;
        margin-bottom:.0001pt;
        font-size:10.5pt;
        font-family:Consolas;}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
span.PlainTextChar
        {mso-style-name:"Plain Text Char";
        mso-style-priority:99;
        mso-style-link:"Plain Text";
        font-family:Consolas;}
.MsoChpDefault
        {mso-style-type:export-only;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=EN-US link=blue vlink=purple><div class=WordSection1><p class=MsoPlainText>All,<o:p></o:p></p><p class=MsoPlainText>Thank you in advance for any help.<o:p></o:p></p><p class=MsoPlainText>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.<o:p></o:p></p><p class=MsoPlainText>So, I put the list of users, PINs bridges into a MYSQL DB and used an ODBC connector to parse the table.<o:p></o:p></p><p class=MsoPlainText>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.<o:p></o:p></p><p class=MsoPlainText>Please have a look and tell me where I went so wrong.<o:p></o:p></p><p class=MsoPlainText>Func_odbc.conf looks like this:<o:p></o:p></p><p class=MsoPlainText>[PIN]<o:p></o:p></p><p class=MsoPlainText>dsn=BRIDGE<o:p></o:p></p><p class=MsoPlainText>mode=multirow<o:p></o:p></p><p class=MsoPlainText>readsql=SELECT pin from users WHERE confid='${SQL_ESC(${CONF_ID})}'<o:p></o:p></p><p class=MsoPlainText><o:p> </o:p></p><p class=MsoPlainText>extensions.conf section:<o:p></o:p></p><p class=MsoPlainText>[infromhost] ;Host dials 8888 over SIP trunk exten=8888,1,Answer<o:p></o:p></p><p class=MsoPlainText>exten=8888,n,Background(conf-getconfno)<o:p></o:p></p><p class=MsoPlainText>exten=8888,n,WaitExten(10)<o:p></o:p></p><p class=MsoPlainText>exten=8888,n,Hangup<o:p></o:p></p><p class=MsoPlainText>exten=_XXXXXX,1,Set(GLOBAL(CONF_ID)=${EXTEN})<o:p></o:p></p><p class=MsoPlainText>exten=_XXXXXX,n,GoTo(rooms,${EXTEN},1)<o:p></o:p></p><p class=MsoPlainText>;<o:p></o:p></p><p class=MsoPlainText>[rooms]<o:p></o:p></p><p class=MsoPlainText>exten=_XXXXXX,1,Set(CONF_ID=${EXTEN})<o:p></o:p></p><p class=MsoPlainText>exten=_XXXXXX,n,Background(conf-getpin)<o:p></o:p></p><p class=MsoPlainText>exten=_XXXXXX,n,WaitExten(5)<o:p></o:p></p><p class=MsoPlainText>exten=_XXXXXX,n,Hangup<o:p></o:p></p><p class=MsoPlainText>exten=_1XXXXX,1,Goto(getpin,${EXTEN},1)<o:p></o:p></p><p class=MsoPlainText>exten=_2XXXXX,1,Goto(getpin,${EXTEN},1)<o:p></o:p></p><p class=MsoPlainText>exten=_3XXXXX,1,Goto(getpin,${EXTEN},1)<o:p></o:p></p><p class=MsoPlainText>exten=_4XXXXX,1,Goto(getpin,${EXTEN},1)<o:p></o:p></p><p class=MsoPlainText>exten=_5XXXXX,1,Goto(getpin,${EXTEN},1)<o:p></o:p></p><p class=MsoPlainText>exten=_6XXXXX,1,Goto(getpin,${EXTEN},1)<o:p></o:p></p><p class=MsoPlainText>exten=_7XXXXX,1,Goto(getpin,${EXTEN},1)<o:p></o:p></p><p class=MsoPlainText>exten=_8XXXXX,1,Goto(getpin,${EXTEN},1)<o:p></o:p></p><p class=MsoPlainText>exten=_9XXXXX,1,Goto(getpin,${EXTEN},1)<o:p></o:p></p><p class=MsoPlainText>exten=i,1,Goto(getpin,${CONF_PIN},1)<o:p></o:p></p><p class=MsoPlainText>;<o:p></o:p></p><p class=MsoPlainText>[getpin]<o:p></o:p></p><p class=MsoPlainText>exten=_XXXXXX,1,Set(GLOBAL(CONF_PIN)=${EXTEN})<o:p></o:p></p><p class=MsoPlainText>exten=_XXXXXX,n,Set(ODBC_ID=${ODBC_PIN(1)})<o:p></o:p></p><p class=MsoPlainText>exten=_XXXXXX,n(loop_start),NoOp()<o:p></o:p></p><p class=MsoPlainText>exten=_XXXXXX,n,Set(ROW_RESULT=${ODBC_FETCH(${ODBC_ID})})<o:p></o:p></p><p class=MsoPlainText>exten=_XXXXXX,n,GotoIf($["${ODBC_FETCH}" = "FAILURE"]?cleanup,1) <o:p></o:p></p><p class=MsoPlainText>exten=_XXXXXX,n,GotoIf($["${ROW_RESULT}" = "${CONF_PIN}"]?good_exten,1)<o:p></o:p></p><p class=MsoPlainText>exten=_XXXXXX,n,Goto(loop_start)<o:p></o:p></p><p class=MsoPlainText>;<o:p></o:p></p><p class=MsoPlainText>exten=cleanup,1,Verbose(1,Finish up)<o:p></o:p></p><p class=MsoPlainText>same=n,Verbose(1,PIN not found)<o:p></o:p></p><p class=MsoPlainText>same=n,ODBCFinish(${ODBC_ID})<o:p></o:p></p><p class=MsoPlainText>same=n,playback(conf-invalidpin)<o:p></o:p></p><p class=MsoPlainText>same=n,Goto(rooms,${CONF_ID}1)<o:p></o:p></p><p class=MsoPlainText>same=n,Hangup()<o:p></o:p></p><p class=MsoPlainText>;<o:p></o:p></p><p class=MsoPlainText>exten=good_exten,1,Verbose(1,The PIN is available)<o:p></o:p></p><p class=MsoPlainText>same=n,ODBCFinish(${ODBC_ID})<o:p></o:p></p><p class=MsoPlainText>same=n,Verbose(1,Drop Caller into the bridge)<o:p></o:p></p><p class=MsoPlainText>same=n,Set(CONFBRIDGE(user,template)=default_user)<o:p></o:p></p><p class=MsoPlainText>same=n,ConfBridge(${CONF_ID},default_bridge,,sample_user_menu)<o:p></o:p></p><p class=MsoPlainText>same=n,Hangup()<o:p></o:p></p><p class=MsoPlainText>;<o:p></o:p></p><p class=MsoPlainText><o:p> </o:p></p><p class=MsoPlainText>The log shows the 3 existing DB table rows are found but continues to cycle indefinitely if the PIN is NOT found.<o:p></o:p></p><p class=MsoPlainText>First few rows of the console log:<o:p></o:p></p><p class=MsoPlainText>=========================================================================<o:p></o:p></p><p class=MsoPlainText>Connected to Asterisk 11.3.0 currently running on atpconf001 (pid = 1695) atpconf001*CLI><o:p></o:p></p><p class=MsoPlainText> == Using SIP RTP CoS mark 5<o:p></o:p></p><p class=MsoPlainText><o:p> </o:p></p><p class=MsoPlainText>atpconf001*CLI> <o:p></o:p></p><p class=MsoPlainText> -- Executing [067740@default:1] Set("SIP/testbridge2-00000021", "GLOBAL(CONF_ID)=067740") in new stack<o:p></o:p></p><p class=MsoPlainText> == Setting global variable 'CONF_ID' to '067740'<o:p></o:p></p><p class=MsoPlainText> -- Executing [067740@default:2] Goto("SIP/testbridge2-00000021", "rooms,067740,1") in new stack<o:p></o:p></p><p class=MsoPlainText><o:p> </o:p></p><p class=MsoPlainText>atpconf001*CLI> <o:p></o:p></p><p class=MsoPlainText> -- Goto (rooms,067740,1)<o:p></o:p></p><p class=MsoPlainText> -- Executing [067740@rooms:1] Set("SIP/testbridge2-00000021", "CONF_ID=067740") in new stack<o:p></o:p></p><p class=MsoPlainText> -- Executing [067740@rooms:2] BackGround("SIP/testbridge2-00000021", "conf-getpin") in new stack<o:p></o:p></p><p class=MsoPlainText><o:p> </o:p></p><p class=MsoPlainText>atpconf001*CLI> <o:p></o:p></p><p class=MsoPlainText> -- <SIP/testbridge2-00000021> Playing 'conf-getpin.slin' (language 'en')<o:p></o:p></p><p class=MsoPlainText><o:p> </o:p></p><p class=MsoPlainText>atpconf001*CLI> <o:p></o:p></p><p class=MsoPlainText> -- Executing [067740@rooms:3] WaitExten("SIP/testbridge2-00000021", "5") in new stack<o:p></o:p></p><p class=MsoPlainText><o:p> </o:p></p><p class=MsoPlainText>atpconf001*CLI><o:p></o:p></p><p class=MsoPlainText> == CDR updated on SIP/testbridge2-00000021<o:p></o:p></p><p class=MsoPlainText> -- Executing [444999@rooms:1] Goto("SIP/testbridge2-00000021", "getpin,444999,1") in new stack<o:p></o:p></p><p class=MsoPlainText> -- Goto (getpin,444999,1)<o:p></o:p></p><p class=MsoPlainText> -- Executing [444999@getpin:1] Set("SIP/testbridge2-00000021", "GLOBAL(CONF_PIN)=444999") in new stack<o:p></o:p></p><p class=MsoPlainText> == Setting global variable 'CONF_PIN' to '444999'<o:p></o:p></p><p class=MsoPlainText><o:p> </o:p></p><p class=MsoPlainText>atpconf001*CLI> <o:p></o:p></p><p class=MsoPlainText> -- Executing [444999@getpin:2] Set("SIP/testbridge2-00000021", "ODBC_ID=32") in new stack<o:p></o:p></p><p class=MsoPlainText> -- Executing [444999@getpin:3] NoOp("SIP/testbridge2-00000021", "") in new stack<o:p></o:p></p><p class=MsoPlainText> -- Executing [444999@getpin:4] Set("SIP/testbridge2-00000021", "ROW_RESULT=112233") in new stack<o:p></o:p></p><p class=MsoPlainText><o:p> </o:p></p><p class=MsoPlainText>atpconf001*CLI> <o:p></o:p></p><p class=MsoPlainText> -- Executing [444999@getpin:5] GotoIf("SIP/testbridge2-00000021", "0?cleanup,1") in new stack<o:p></o:p></p><p class=MsoPlainText> -- Executing [444999@getpin:6] GotoIf("SIP/testbridge2-00000021", "0?good_exten,1") in new stack<o:p></o:p></p><p class=MsoPlainText> -- Executing [444999@getpin:7] Goto("SIP/testbridge2-00000021", "loop_start") in new stack<o:p></o:p></p><p class=MsoPlainText> -- Goto (getpin,444999,3)<o:p></o:p></p><p class=MsoPlainText> -- Executing [444999@getpin:3] NoOp("SIP/testbridge2-00000021", "") in new stack<o:p></o:p></p><p class=MsoPlainText> -- Executing [444999@getpin:4] Set("SIP/testbridge2-00000021", "ROW_RESULT=333333") in new stack<o:p></o:p></p><p class=MsoPlainText> -- Executing [444999@getpin:5] GotoIf("SIP/testbridge2-00000021", "0?cleanup,1") in new stack<o:p></o:p></p><p class=MsoPlainText> -- Executing [444999@getpin:6] GotoIf("SIP/testbridge2-00000021", "0?good_exten,1") in new stack<o:p></o:p></p><p class=MsoPlainText> -- Executing [444999@getpin:7] Goto("SIP/testbridge2-00000021", "loop_start") in new stack<o:p></o:p></p><p class=MsoPlainText> -- Goto (getpin,444999,3)<o:p></o:p></p><p class=MsoPlainText> -- Executing [444999@getpin:3] NoOp("SIP/testbridge2-00000021", "") in new stack<o:p></o:p></p><p class=MsoPlainText> -- Executing [444999@getpin:4] Set("SIP/testbridge2-00000021", "ROW_RESULT=135792") in new stack //LAST GOOD RESULT!!!<o:p></o:p></p><p class=MsoPlainText><o:p> </o:p></p><p class=MsoPlainText>atpconf001*CLI> <o:p></o:p></p><p class=MsoPlainText> -- Executing [444999@getpin:5] GotoIf("SIP/testbridge2-00000021", "0?cleanup,1") in new stack<o:p></o:p></p><p class=MsoPlainText> -- Executing [444999@getpin:6] GotoIf("SIP/testbridge2-00000021", "0?good_exten,1") in new stack<o:p></o:p></p><p class=MsoPlainText> -- Executing [444999@getpin:7] Goto("SIP/testbridge2-00000021", "loop_start") in new stack<o:p></o:p></p><p class=MsoPlainText><o:p> </o:p></p><p class=MsoPlainText>atpconf001*CLI> <o:p></o:p></p><p class=MsoPlainText> -- Goto (getpin,444999,3)<o:p></o:p></p><p class=MsoPlainText> -- Executing [444999@getpin:3] NoOp("SIP/testbridge2-00000021", "") in new stack<o:p></o:p></p><p class=MsoPlainText><o:p> </o:p></p><p class=MsoPlainText>atpconf001*CLI> <o:p></o:p></p><p class=MsoPlainText> -- Executing [444999@getpin:4] Set("SIP/testbridge2-00000021", "ROW_RESULT=") in new stack //BAD RESULTS FOREVER!!!<o:p></o:p></p><p class=MsoPlainText><o:p> </o:p></p><p class=MsoPlainText>atpconf001*CLI> <o:p></o:p></p><p class=MsoPlainText> -- Executing [444999@getpin:5] GotoIf("SIP/testbridge2-00000021", "0?cleanup,1") in new stack<o:p></o:p></p><p class=MsoPlainText><o:p> </o:p></p><p class=MsoPlainText>atpconf001*CLI> <o:p></o:p></p><p class=MsoPlainText> -- Executing [444999@getpin:6] GotoIf("SIP/testbridge2-00000021", "0?good_exten,1") in new stack<o:p></o:p></p><p class=MsoPlainText><o:p> </o:p></p><p class=MsoPlainText>atpconf001*CLI> <o:p></o:p></p><p class=MsoPlainText> -- Executing [444999@getpin:7] Goto("SIP/testbridge2-00000021", "loop_start") in new stack<o:p></o:p></p><p class=MsoPlainText> -- Goto (getpin,444999,3)<o:p></o:p></p><p class=MsoPlainText> -- Executing [444999@getpin:3] NoOp("SIP/testbridge2-00000021", "") in new stack //AND SO ON........<o:p></o:p></p><p class=MsoPlainText><o:p> </o:p></p><p class=MsoPlainText>Thank you!!<o:p></o:p></p><p class=MsoPlainText>Pat Collins...<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><o:p> </o:p></p></div></body></html>