【发布时间】:2013-02-18 20:41:02
【问题描述】:
我在 PHP 中使用 Asterisk 管理接口 (AMI) 发起出站呼叫。下面是我正在使用的代码的 sn-p:
// snippet
// $num is the number to dial e.g. 0207 121 3456
// $ext is the extension use to make the call e.g. 101
// $name is the name of the caller e.g. Fred Flintstone
//
fputs($socket, "Action: Originate\r\n" );
fputs($socket, "Channel: SIP/$ext\r\n" );
fputs($socket, "Exten: $num\r\n" );
fputs($socket, "Context: from-internal\r\n");
fputs($socket, "Priority: 1\r\n" );
fputs($socket, "CallerID: \"".$name."\" <".$num.">\r\n" );
fputs($socket, "Async: yes\r\n\r\n" );
如何设置呼叫者姓名 ($name) 或写入 asteriskcdrdb 的其他详细信息以用于发起脚本中的出站呼叫?理想情况下,我想以与设置呼入字段相同的方式设置 dst 字段。
【问题讨论】: