[AsteriskBrasil] Script função System() - Não funciona!

Mauricio Magalhães mauriciommagalhaes em gmail.com
Quinta Setembro 1 00:44:29 BRT 2011


Olá meninada (*)

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 *gvt.sh* e outro* ebt.sh* e coloquei no *
extencion_custom.conf* (USO O ELASTIX) as seguintes linhas:

*[trocar_gateway]*
*exten => 123,n,Answer()*
*exten => 123,n,Authenticate(123456||6)*
*exten => 123,n,Background(beep)*
*exten => 123,n,Read(GTW,,1)*
*exten => 123,n,GotoIf($[${GTW}=1]?GVT:EBT)*
*exten => 123,n(GVT),System(/root/bin/gvt.sh)*
*exten => 123,n,Hangup()*
*exten => 123,n(EBT),System(/root/bin/ebt.sh)*
*exten => 123,n,Hangup()*

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)
2 - Executando os arquivos *.sh mencionado acima manualmente, funciona
normalmente.

Segue Abaixo o Log:

 *-- Executing [123 em NIVEL4:1] ResetCDR("SIP/3002-085bb950", "") in new stack
*
*    -- Executing [123 em NIVEL4:2] Answer("SIP/3002-085bb950", "") in new
stack*
*    -- Executing [123 em NIVEL4:3] Authenticate("SIP/3002-085bb950",
"123456||6") in new stack*
*    -- <SIP/3002-085bb950> Playing 'agent-pass' (language 'pt_BR')*
*    -- <SIP/3002-085bb950> Playing 'auth-thankyou' (language 'pt_BR')*
*    -- Executing [123 em NIVEL4:4] BackGround("SIP/3002-085bb950", "beep") in
new stack*
*    -- <SIP/3002-085bb950> Playing 'beep' (language 'pt_BR')*
*    -- Executing [123 em NIVEL4:5] Read("SIP/3002-085bb950", "GTW||1") in new
stack*
*    -- Accepting a maximum of 1 digits.*
*    -- User entered '1'*
*    -- Executing [123 em NIVEL4:6] GotoIf("SIP/3002-085bb950", "1?GVT:EBT") in
new stack*
*    -- Goto (NIVEL4,123,7)*
*    -- Executing [123 em NIVEL4:7] System("SIP/3002-085bb950",
"/root/bin/gvt.sh") in new stack*
*    -- Executing [123 em NIVEL4:8] Hangup("SIP/3002-085bb950", "") in new
stack*
*  == Spawn extension (NIVEL4, 123, 8) exited non-zero on
'SIP/3002-085bb950'*
*    -- Executing [h em NIVEL4:1] Macro("SIP/3002-085bb950", "hangupcall|") in
new stack*
*    -- Executing [s em macro-hangupcall:1] GotoIf("SIP/3002-085bb950",
"1?skiprg") in new stack*
*    -- Goto (macro-hangupcall,s,4)*
*    -- Executing [s em macro-hangupcall:4] GotoIf("SIP/3002-085bb950",
"1?skipblkvm") in new stack*
*    -- Goto (macro-hangupcall,s,7)*
*    -- Executing [s em macro-hangupcall:7] GotoIf("SIP/3002-085bb950",
"1?theend") in new stack*
*    -- Goto (macro-hangupcall,s,9)*
*    -- Executing [s em macro-hangupcall:9] Hangup("SIP/3002-085bb950", "") in
new stack*
*  == Spawn extension (macro-hangupcall, s, 9) exited non-zero on
'SIP/3002-085bb950' in macro 'hangupcall'*
*  == Spawn extension (NIVEL4, h, 1) exited non-zero on 'SIP/3002-085bb950'*


Ajudem-me! por favor

Abraços

*Maurício Magalhães*



*Maurício  Magalhães.*
-------------- Próxima Parte ----------
Um anexo em HTML foi limpo...
URL: http://listas.asteriskbrasil.org/pipermail/asteriskbrasil/attachments/20110901/45bacb43/attachment.htm 


Mais detalhes sobre a lista de discussão AsteriskBrasil