使用星号拨打电话

时间:2019-12-18 11:36:29

标签: php asterisk pbx 3cx

我想使用星号(AMI)拨打外部电话 我正在使用PAMI脚本https://github.com/marcelog/PAMI

当我执行此代码时

 <?php
   require __DIR__ . '/vendor/autoload.php';

   $pamiClientOptions = array(
      'host' => '192.168.1.240',
      'scheme' => 'tcp://',
      'port' => 7777,
      'username' => 'epiltech',
      'secret' => 'Epiltech2019',
      'connect_timeout' => 140000,
      'read_timeout' => 140000
   );
   use PAMI\Client\Impl\ClientImpl as PamiClient;
   use PAMI\Message\Action\OriginateAction;
  $pamiClient = new PamiClient($pamiClientOptions);

  // Open the connection
  $pamiClient->open();

  $originateMsg = new OriginateAction('PJSIP/3000');
  $originateMsg->setContext('from-trunk');
  $originateMsg->setPriority('1');
  $originateMsg->setCallerId('0603532326');
  $originateMsg->setExtension('3000');
  var_dump($pamiClient->send($originateMsg));

  // Close the connection
  $pamiClient->close();

给我这个错误

  

响应:成功操作ID:1576668706.6746消息:身份验证   接受事件:SuccessAuth特权:安全,所有时间戳记:   1576668703.239024 EventTV:2019-12-18T12:31:43.238 + 0100严重性:信息服务:AMI EventVersion:1帐户ID:epiltech   会话ID:0x48c9aecc本地地址IPV4 / TCP / 0.0.0.0 / 7777   RemoteAddress:IPV4 / TCP / 192.168.1.10 / 60552 UsingPassword:0 SessionTV:   2019-12-18T12:31:43.238 + 0100响应:错误ActionID:1576668706.6866   消息:原始错误   object(PAMI \ Message \ Response \ ResponseMessage)#6(9){   [“事件”:“ PAMI \ Message \ Response \ ResponseMessage”:专用] =>数组(0)   {} [“已完成”:“ PAMI \ Message \ Response \ ResponseMessage”:专用] =>   bool(true)[“ rawContent”:protected] => string(68)“响应:错误   ActionID:1576668706.6866消息:原始错误”   [“ channelVariables”:protected] => array(1){[“” default“] => array(0){}   } [“行”:受保护] => array(0){} [“变量”:受保护] =>   array(0){} [“ keys”:protected] => array(3){[“ response”] => string(5)   “错误” [“ actionid”] =>字符串(15)“ 1576668706.6866” [“消息”] =>   string(15)“原始错误”} [“ createdDate”:保护] =>   int(1576668706)[“ eventsCount”] => int(0)}

你能帮我吗

0 个答案:

没有答案