2

也许你们中的一些人可能知道如何实现这一点。我想要这样的东西:

  1. 点击链接/按钮
  2. 我的电话响了,我接起来
  3. Asterisk 为我拨号码
  4. 收件人电话响起

我正在使用星号1.2

我试过拨出。但我唯一能做的就是打电话给一侧。

提前致谢。

4

2 回答 2

4

您可以使用call files. 请阅读:Asterisk 自动拨出

我制作了简单的 CGI 脚本,通过 Web 服务器调用创建调用文件(记住使用临时目录),然后将其移动到/var/spool/asterisk/outgoingAsterisk 完成其余的工作。从用户的角度来看,它如您所描述的那样工作。还要记住规范化电话号码(在我的网页上它们可以有空格、连字符等,而在通话文件中它们必须看起来像可拨打的号码)。

于 2010-11-17T06:54:02.693 回答
1

你可以看到我用 PHP 编写的一个调用脚本,它打开了一个传真文件,但它会满足你的需要。在这里查看完整的脚本:http ://www.csrdu.org/nauman/2010/10/18/web-fax-for-asterisk/

$faxHeader = $_POST["faxHeader"];
$localID = $_POST["localID"];
$email = $_POST["email"];
$dest = $_POST["dest"];

$outbound_route = "@outbound-allroutes";
$outboundfax_context = "outboundfax";

$callfile = "Channel: Local/$dest$outbound_route\n" .
   "MaxRetries: 1\n" .
   "RetryTime: 60\n" .
   "WaitTime: 60\n"  .
   "Archive: yes\n"  .
   "Context: $outboundfax_context \n"  .
   "Extension: s\n" .
   "Priority: 1\n" .
   "Set: FAXFILE=$input_file_tif\n" .
   "Set: FAXHEADER=$faxHeader\n" .
   "Set: TIMESTAMP=" . date("d/m/y : H:i:s",time()) . "\n" .
   "Set: DESTINATION=$dest\n".
   "Set: LOCALID=$localID\n" .
   "Set: EMAIL=$email\n";

// create the call file in /tmp
$callfilename = unique_name("/tmp", ".call");
$f = fopen($callfilename, "w");
fwrite($f, $callfile);
fclose($f);

// $asterisk_spool_folder is usually /var/spool/asterisk/outgoing
rename($callfilename, $asterisk_spool_folder .  "/" . substr($callfilename,4));

请在 callfile 页面上阅读为什么我们需要移动文件而不是直接在星号假脱机文件夹中打开和写入文件。

于 2011-01-02T11:09:46.293 回答