Bom dia, segue o debug do agi, o extensions e o scirpt.<div><br></div><div>Debug:</div><div><div> -- Executing [1111@from-internal:1] Answer("SIP/1000-00000000", "") in new stack</div><div> -- Executing [1111@from-internal:2] AGI("SIP/1000-00000000", "mysql_connect.sh,1000") in new stack</div>
<div> -- Launched AGI Script /var/lib/asterisk/agi-bin/mysql_connect.sh</div><div><SIP/1000-00000000>AGI Tx >> agi_request: mysql_connect.sh</div><div><SIP/1000-00000000>AGI Tx >> agi_channel: SIP/1000-00000000</div>
<div><SIP/1000-00000000>AGI Tx >> agi_language: en</div><div><SIP/1000-00000000>AGI Tx >> agi_type: SIP</div><div><SIP/1000-00000000>AGI Tx >> agi_uniqueid: 1339414586.0</div><div><SIP/1000-00000000>AGI Tx >> agi_version: 1.8.11.0</div>
<div><SIP/1000-00000000>AGI Tx >> agi_callerid: 1000</div><div><SIP/1000-00000000>AGI Tx >> agi_calleridname: device</div><div><SIP/1000-00000000>AGI Tx >> agi_callingpres: 0</div><div>
<SIP/1000-00000000>AGI Tx >> agi_callingani2: 0</div><div><SIP/1000-00000000>AGI Tx >> agi_callington: 0</div><div><SIP/1000-00000000>AGI Tx >> agi_callingtns: 0</div><div><SIP/1000-00000000>AGI Tx >> agi_dnid: 1111</div>
<div><SIP/1000-00000000>AGI Tx >> agi_rdnis: unknown</div><div><SIP/1000-00000000>AGI Tx >> agi_context: from-internal</div><div><SIP/1000-00000000>AGI Tx >> agi_extension: 1111</div><div>
<SIP/1000-00000000>AGI Tx >> agi_priority: 2</div><div><SIP/1000-00000000>AGI Tx >> agi_enhanced: 0.0</div><div><SIP/1000-00000000>AGI Tx >> agi_accountcode:</div><div><SIP/1000-00000000>AGI Tx >> agi_threadid: -1223001200</div>
<div><SIP/1000-00000000>AGI Tx >> agi_arg_1: 1000</div><div><SIP/1000-00000000>AGI Tx >></div><div><SIP/1000-00000000>AGI Rx << SET VARIABLE CALL ""</div><div><SIP/1000-00000000>AGI Tx >> 200 result=1</div>
<div> -- <SIP/1000-00000000>AGI Script mysql_connect.sh completed, returning 0</div><div> -- Executing [1111@from-internal:3] NoOp("SIP/1000-00000000", "CALL: ") in new stack</div><div> -- Executing [1111@from-internal:4] Hangup("SIP/1000-00000000", "") in new stack</div>
<div><br></div><div><br></div><div>Extensions:</div><div><br></div><div><div>[agi-teste]</div><div>exten => 1111,1,Answer()</div><div>exten => 1111,n,Agi(mysql_connect.sh,${CALLERID(num)})</div><div>exten => 1111,n,NoOp(CALL: ${CALL})</div>
<div>exten => 1111,n,Hangup()</div></div><div><br></div><div><br></div><div>Script:</div><div><br></div><div><div>mysql -u bruno -e "SELECT permit_call FROM user WHERE ramal = $1" test > /root/permit_call/$1</div>
<div>call=`tail -n 1 /root/permit_call/$1`</div><div><br></div><div>echo "SET VARIABLE CALL \"$call\" "</div></div><div><br></div><div>Desculpe a demora pra enviar, é que não tive muito tempo pra postar durante o fds.</div>
<div><br></div><div>Muito obrigado pela atenção de todos.</div><div><br></div><div><br></div>ATT.<div>Bruno Gerotto<div><br></div></div><br>
</div>