<span style="font-family:arial, sans-serif;font-size:13px;background-color:rgb(255, 255, 255)">Olá meninada (*)<div><br></div><div>Tenho um problema com um script que criei na central, não funciona, o objetivo é fazer com que o operador troque o "Gateway default" do servidor em caso de um dos links estiverem OFFLINE utilizando um ramal. Para isto criei dois scripts bash um <b>gvt.sh</b> e outro<b> ebt.sh</b> e coloquei no <b>extencion_custom.conf</b> (USO O ELASTIX) as seguintes linhas:</div>
<div><br></div><div><div><b>[trocar_gateway]</b></div><div><b>exten => 123,n,Answer()</b></div><div><b>exten => 123,n,Authenticate(123456||6)</b></div><div><b>exten => 123,n,Background(beep)</b></div><div><b>exten => 123,n,Read(GTW,,1)</b></div>
<div><b>exten => 123,n,GotoIf($[${GTW}=1]?GVT:EBT)</b></div><div><b>exten => 123,n(GVT),System(/root/bin/gvt.sh)</b></div><div><b>exten => 123,n,Hangup()</b></div><div><b>exten => 123,n(EBT),System(/root/bin/ebt.sh)</b></div>
<div><b>exten => 123,n,Hangup()</b></div></div><div><br></div><div>1 - Pelo log no CLI, verifico que funciona as funções acima, porém o Gateway não é modificado - Versão (Asterisk 1.4.26.1)</div><div>2 - Executando os arquivos *.sh mencionado acima manualmente, funciona normalmente. </div>
<div><br></div><div>Segue Abaixo o Log:</div><div><br></div><div><div> <b>-- Executing [123@NIVEL4:1] ResetCDR("SIP/3002-085bb950", "") in new stack</b></div><div><b> -- Executing [123@NIVEL4:2] Answer("SIP/3002-085bb950", "") in new stack</b></div>
<div><b> -- Executing [123@NIVEL4:3] Authenticate("SIP/3002-085bb950", "123456||6") in new stack</b></div><div><b> -- <SIP/3002-085bb950> Playing 'agent-pass' (language 'pt_BR')</b></div>
<div><b> -- <SIP/3002-085bb950> Playing 'auth-thankyou' (language 'pt_BR')</b></div><div><b> -- Executing [123@NIVEL4:4] BackGround("SIP/3002-085bb950", "beep") in new stack</b></div>
<div><b> -- <SIP/3002-085bb950> Playing 'beep' (language 'pt_BR')</b></div><div><b> -- Executing [123@NIVEL4:5] Read("SIP/3002-085bb950", "GTW||1") in new stack</b></div><div>
<b> -- Accepting a maximum of 1 digits.</b></div><div><b> -- User entered '1'</b></div><div><b> -- Executing [123@NIVEL4:6] GotoIf("SIP/3002-085bb950", "1?GVT:EBT") in new stack</b></div>
<div><b> -- Goto (NIVEL4,123,7)</b></div><div><b> -- Executing [123@NIVEL4:7] System("SIP/3002-085bb950", "/root/bin/gvt.sh") in new stack</b></div><div><b> -- Executing [123@NIVEL4:8] Hangup("SIP/3002-085bb950", "") in new stack</b></div>
<div><b> == Spawn extension (NIVEL4, 123, 8) exited non-zero on 'SIP/3002-085bb950'</b></div><div><b> -- Executing [h@NIVEL4:1] Macro("SIP/3002-085bb950", "hangupcall|") in new stack</b></div>
<div><b> -- Executing [s@macro-hangupcall:1] GotoIf("SIP/3002-085bb950", "1?skiprg") in new stack</b></div><div><b> -- Goto (macro-hangupcall,s,4)</b></div><div><b> -- Executing [s@macro-hangupcall:4] GotoIf("SIP/3002-085bb950", "1?skipblkvm") in new stack</b></div>
<div><b> -- Goto (macro-hangupcall,s,7)</b></div><div><b> -- Executing [s@macro-hangupcall:7] GotoIf("SIP/3002-085bb950", "1?theend") in new stack</b></div><div><b> -- Goto (macro-hangupcall,s,9)</b></div>
<div><b> -- Executing [s@macro-hangupcall:9] Hangup("SIP/3002-085bb950", "") in new stack</b></div><div><b> == Spawn extension (macro-hangupcall, s, 9) exited non-zero on 'SIP/3002-085bb950' in macro 'hangupcall'</b></div>
<div><b> == Spawn extension (NIVEL4, h, 1) exited non-zero on 'SIP/3002-085bb950'</b></div><div><br></div><div><br></div><div>Ajudem-me! por favor</div><div><br></div><div>Abraços</div><div><span style="font-size:13.3px;font-family:Verdana, Arial, Helvetica, sans-serif"><p style="margin-top:0px;margin-right:0px;margin-bottom:8px;margin-left:0px;text-align:left">
<strong><span style="font-family:verdana, geneva">Maurício Magalhães</span></strong></p></span></div></div></span><br clear="all"><br><br><div><span style="font-size:13.3px;font-family:Verdana, Arial, Helvetica, sans-serif"><p style="margin-top:0px;margin-right:0px;margin-bottom:8px;margin-left:0px;text-align:left">
<strong><span style="font-family:verdana, geneva">Maurício Magalhães.</span></strong></p></span></div><br>
<div name="sig_d41d8cd98f" style="margin-top: 0pt; margin-right: 0pt; margin-bottom: 0pt; margin-left: 0pt; "></div>