Fabio! Segue o teste... oque voce acha???<br><br><b>eu montei em cima da sua logica assim:</b><br><br>[custom-amfa]<br>exten => s,1,Set(LANGUAGE()=pt_BR)<br>exten => s,2,NoOp(351)<br>exten => s,3,ChanIsAvail(SIP/351)<br>
exten => s,4,NoOP(AVAILSTATUS IS ${AVAILSTATUS})<br>exten => s,5,GotoIf($["${AVAILSTATUS}" = "0"]?6:9)<br>exten => s,6,Playback(custom/amfa_online)<br>exten => s,7,Congestion(3)<br>exten => s,8,Hangup()<br>
exten => s,9,Playback(custom/amfa_offline)<br>exten => s,10,Congestion(3)<br>exten => s,11,Hangup()<br><br><br><br><b> e funcionou bem avisando qdo o ramal está online veja o log:</b><br><br> -- Executing DBdel("DGV/5", "") in new stack<br>
-- Executing Set("DGV/5", "__NODEST=") in new stack<br> -- Executing Goto("DGV/5", "custom-amfa|s|1") in new stack<br> -- Goto (custom-amfa,s,1)<br> -- Executing Set("DGV/5", "LANGUAGE()=pt_BR") in new stack<br>
-- Executing NoOp("DGV/5", "351") in new stack<br> -- Executing ChanIsAvail("DGV/5", "SIP/350") in new stack<br> -- Executing NoOp("DGV/5", "AVAILSTATUS IS 0") in new stack<br>
-- Executing GotoIf("DGV/5", "1?6:9") in new stack<br> -- Goto (custom-amfa,s,6)<br> -- Executing Playback("DGV/5", "custom/amfa_online") in new stack<br> -- Playing 'custom/amfa_online' (language 'pt_BR')<br>
-- Executing Congestion("DGV/5", "3") in new stack<br> == Spawn extension (custom-amfa, s, 7) exited non-zero on 'DGV/5'<br><br><br><br><b>Mas qdo ele está offline, ele da hangup sem nem chegar no NoOp e sem fazer o playback, veja:</b><br>
<br> -- Executing DBdel("DGV/5", "") in new stack<br> -- Executing Set("DGV/5", "__NODEST=") in new stack<br> -- Executing Goto("DGV/5", "custom-amfa|s|1") in new stack<br>
-- Goto (custom-amfa,s,1)<br> -- Executing Set("DGV/5", "LANGUAGE()=pt_BR") in new stack<br> -- Executing NoOp("DGV/5", "351") in new stack<br> -- Executing ChanIsAvail("DGV/5", "SIP/351") in new stack<br>
== Spawn extension (custom-amfa, s, 3) exited non-zero on 'DGV/5'<br><br><br><br><div class="gmail_quote">2009/8/19 Fabio Guilherme <span dir="ltr"><<a href="mailto:fabioguilhermed@gmail.com">fabioguilhermed@gmail.com</a>></span><br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div link="blue" vlink="purple" lang="PT-BR">
<div>
<p style=""><span style="font-size: 9pt; font-family: "Courier New";">Ola João tudo bem??</span></p>
<p style=""><span style="font-size: 9pt; font-family: "Courier New";">Se fosse eu faria assim..</span></p>
<p style=""><span style="font-size: 9pt; font-family: "Courier New";">Caso não de para sua aplicação segue a lógica,
abraços e boa sorte.</span></p>
<p style=""><span style="font-size: 9pt; font-family: "Courier New";"> </span></p>
<p style=""><span style="font-size: 9pt; font-family: "Courier New";">exten => _99,1,Set(LANGUAGE()=pt_BR)</span></p>
<p style=""><span style="font-size: 9pt; font-family: "Courier New";">exten => _99,2,Background(digiteoramal)</span></p>
<p style=""><span style="font-size: 9pt; font-family: "Courier New";">exten => _99,3,Read(ramal)</span></p>
<p style=""><span style="font-size: 9pt; font-family: "Courier New";">exten => _99,4,NoOp(${ramal})</span></p>
<p style=""><span style="font-size: 9pt; font-family: "Courier New";">exten => _99,5,ChanIsAvail(SIP/${ramal})</span></p>
<p style=""><span style="font-size: 9pt; font-family: "Courier New";">exten => _99,6,NoOP(AVAILSTATUS IS
${AVAILSTATUS})</span></p>
<p style=""><span style="font-size: 9pt; font-family: "Courier New";">exten =>
_99,7,GotoIf($["${AVAILSTATUS}" = "0"]?8:11)</span></p>
<p style=""><span style="font-size: 9pt; font-family: "Courier New";">exten => _99,8,Playback(ramalconectado)</span></p>
<p style=""><span style="font-size: 9pt; font-family: "Courier New";">exten => _99,9,Congestion(3)</span></p>
<p style=""><span style="font-size: 9pt; font-family: "Courier New";">exten => _99,10,Hangup()</span></p>
<p style=""><span style="font-size: 9pt; font-family: "Courier New";">exten => _99,11,Playback(ramaldesconectado)</span></p>
<p style=""><span style="font-size: 9pt; font-family: "Courier New";">exten => _99,12,Congestion(3)</span></p>
<p style=""><span style="font-size: 9pt; font-family: "Courier New";">exten => _99,13,Hangup()</span></p>
<p><span style="font-size: 11pt; color: rgb(31, 73, 125);"> </span></p>
<p><span style="font-size: 11pt; color: rgb(31, 73, 125);"> </span></p>
<div style="border-style: solid none none; border-color: rgb(181, 196, 223) -moz-use-text-color -moz-use-text-color; border-width: 1pt medium medium; padding: 3pt 0cm 0cm;">
<p><b><span style="font-size: 10pt;">De:</span></b><span style="font-size: 10pt;"> <a href="mailto:asteriskbrasil-bounces@listas.asteriskbrasil.org" target="_blank">asteriskbrasil-bounces@listas.asteriskbrasil.org</a>
[mailto:<a href="mailto:asteriskbrasil-bounces@listas.asteriskbrasil.org" target="_blank">asteriskbrasil-bounces@listas.asteriskbrasil.org</a>] <b>Em nome de </b>João
Claudio F. Andrade<br>
<b>Enviada em:</b> quarta-feira, 19 de agosto de 2009 01:35<br>
<b>Para:</b> <a href="mailto:asteriskbrasil@listas.asteriskbrasil.org" target="_blank">asteriskbrasil@listas.asteriskbrasil.org</a><br>
<b>Assunto:</b> [AsteriskBrasil] Iniciante com exten, alguem da uma dica?</span></p>
</div><div><div></div><div class="h5">
<p> </p>
<p>Mestres, com a extenção a seguir eu consigo saber se o ramal
esta online... (ele executa o playback)<br>
mas se ele esta offline ele nao executa o playback... fiz algo errado?<br>
<br>
<br>
[custom-amfa]<br>
include => macro-dialout-trunk<br>
exten => s,1,Answer<br>
exten => s,n,Wait,1<br>
exten => s,n,ChanIsAvail(SIP/350)<br>
exten => s,n,GotoIf($["${AVAILSTATUS}" != "0"]?offline)<br>
exten => s,n,GotoIf($["${AVAILSTATUS}" = "0"]?online)<br>
exten => s,n(offline),Playback(custom/</p>
<div>
<p>amfa_offline)<br>
exten => s,n,HangUp<br>
exten => s,n(online),Playback(custom/amfa_online)<br>
exten => s,n,HangUp</p>
</div>
</div></div></div>
</div>
<br><br>
_______________________________________________<br>
Participe do IV Encontro VoIPCenter, 16 a 18 de setembro - São Paulo.<br>
VoIP, Asterisk e Convergência de Redes.<br>
<a href="http://www.encontrovoipcenter.com.br" target="_blank">http://www.encontrovoipcenter.com.br</a><br>
<br>
Compre uma camiseta da AsteriskBrasil.org!<br>
<a href="http://www.voipmania.com.br" target="_blank">http://www.voipmania.com.br</a><br>
<br>
Acesse o canal IRC de discussão sobre Asterisk em Português Brasileiro na rede Freenode.net: #asterisk-br<br>
_______________________________________________<br>
Lista de discussões AsteriskBrasil.org<br>
<a href="mailto:AsteriskBrasil@listas.asteriskbrasil.org">AsteriskBrasil@listas.asteriskbrasil.org</a><br>
<a href="http://listas.asteriskbrasil.org/mailman/listinfo/asteriskbrasil" target="_blank">http://listas.asteriskbrasil.org/mailman/listinfo/asteriskbrasil</a><br></blockquote></div><br>