Este script no funciona en asterisk v1.6.0.9

0
(0)

He probado con todo éxito el siguiente programa en asterisk 1.4.22 y funciona sin ningún problema pero en la versión 1.6.0.9 no funciona, no tengo idea del porque ya el el verbosity de la consola solo emite lo siguiente:

== Manager ‘admin’ logged on from 127.0.0.1
== Manager ‘admin’ logged off from 127.0.0.1

es decir aparentemente se autentifica correctamente la aplicación , no ejecuta el comando ORIGINATE o no encuentra el contexto y  se sale, el contexto que siempre me ha funcionado es FROM-LOCAL. He intentado con LOCAL pero no tengo idea del porqué no funciona con la nueva versión del asterisk. Si alguen tiene alguna idea del porqué no funciona lo agradeceré mucho. Gracias.

<code>

<?php
$strHost = “127.0.0.1”;
$strUser = “admin”;
$strSecret = “amp111”;
#specify the channel (extension) you want to receive the call requests with
#e.g. SIP/XXX, IAX2/XXXX, ZAP/XXXX, etc
$strChannel = “SIP/3006@from-internal”;
$strContext = “from-internal”;
$strWaitTime = “30”;
$strPriority = “1”;
$strExten = 3006;
$strCallerId = “Web Call <$strExten>”;
$oSocket = fsockopen($strHost, 5038, $errnum, $errdesc) or die(“Connection to host failed”);
fputs($oSocket, “Action: login\r\n”);
fputs($oSocket, “Events: off\r\n”);
fputs($oSocket, “Username: $strUser\r\n”);
fputs($oSocket, “Secret: $strSecret\r\n\r\n”);
fputs($oSocket, “Action: originate\r\n”);
fputs($oSocket, “Channel: $strChannel\r\n”);
fputs($oSocket, “WaitTime: $strWaitTime\r\n”);
fputs($oSocket, “CallerId: $strCallerId\r\n”);
fputs($oSocket, “Exten: $strExten\r\n”);
fputs($oSocket, “Context: $strContext\r\n”);
fputs($oSocket, “Priority: $strPriority\r\n\r\n”);
fputs($oSocket, “Action: Logoff\r\n\r\n”);
fclose($oSocket);
?>

</code>

How useful was this post?

Click on a star to rate it!

Average rating 0 / 5. Vote count: 0

No votes so far! Be the first to rate this post.

2 thoughts on “Este script no funciona en asterisk v1.6.0.9

  1. umm y ya checaste los permisos en manager.conf?

    EN la rama 1.6 de *, los permisos son más atómicos y hay que especificar si quieres hacer marcado:

    ; Authorization for various classes
    ;
    ; Read authorization permits you to receive asynchronous events, in general.
    ; Write authorization permits you to send commands and get back responses. The
    ; following classes exist:
    ;
    ; system – General information about the system and ability to run system
    ; management commands, such as Shutdown, Restart, and Reload.
    ; call – Information about channels and ability to set information in a
    ; running channel.
    ; log – Logging information. Read-only.
    ; verbose – Verbose information. Read-only.
    ; agent – Information about queues and agents and ability to add queue
    ; members to a queue.
    ; user – Permission to send and receive UserEvent.
    ; config – Ability to read and write configuration files.
    ; command – Permission to run CLI commands. Write-only.
    ; dtmf – Receive DTMF events. Read-only.
    ; reporting – Ability to get information about the system.
    ; cdr – Output of cdr_manager, if loaded. Read-only.
    ; dialplan – Receive NewExten and VarSet events. Read-only.
    ; originate – Permission to originate new calls. Write-only.

    ;read = system,call,log,verbose,agent,user,config,dtmf,reporting,cdr,dialplan
    ;write = system,call,agent,user,config,command,reporting,originate

    1. !!!!! Gracias !!! Pop Efectivamente con ese cambio funcionó.

      [admin]
      secret = amp111
      deny=0.0.0.0/0.0.0.0
      permit=127.0.0.1/255.255.255.0
      permit=10.5.4.0/255.255.255.0
      read = system,call,log,verbose,command,agent,user,config,dtmf,reporting,cdr,dialplan
      write = system,call,log,verbose,command,agent,user,config,command,reporting,originate

Leave a Reply