用户在 Asterisk 挂机时录制的文件丢失 [英] Recorded files lost when user hangs up in Asterisk

查看:25
本文介绍了用户在 Asterisk 挂机时录制的文件丢失的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个语音应用程序,我想在其中保存录制的声音文件.我的代码是:

I have one voice application in which I want to save a recorded sound file. My code is:

$record_file= $dir_path . "recordfile_".$file_count;
$this->obj_agi->exec("Record","$record_file.wav,5,$maxsecs");

每次我在录音过程中挂断电话,录音应用程序都无法执行和挂断电话.

Whenever I hang up during recording, the recording application can not execute and hangup the call.

有谁知道如何在挂断时管理这个录音功能?

Does anyone have any idea how to manage this record function while hanging up?

推荐答案

录音应用程序正常处理录音,即使挂断.

The record application process the record normally even when you hangup.

然而,在 AGI 内部,捕获挂断的最好方法是捕获从 Asterisk 发送到 AGI 进程的信号.通过捕获您的 SIGHUP,您可以为所欲为(计费、触摸文件、插入数据库等).

However, inside AGI, the best way to trap hangup is to trap the signal sent from Asterisk to your AGI process. By trapping your SIGHUP, you can do whatever you want (billing, touch files, insert in DB, etc).

默认情况下,将发送 SIGHUP.

By default, a SIGHUP will be sent.

要获取更多信息,这里是核心展示应用程序 AGI(来自 CLI)的输出

to get more infos, here's an output from the core show application AGI (from the CLI)

     A locally executed AGI script will receive SIGHUP
     on hangup from the channel except when using DeadAGI. A fast AGI server will
     correspondingly receive a HANGUP inline with the command dialog. Both of theses
     signals may be disabled by setting the ${AGISIGHUP} channel variable to 'no'
     before executing the AGI application. Alternatively, if you would like the
     AGI application to exit immediately after a channel hangup is detected, set
     the ${AGIEXITONHANGUP} variable to 'yes'.

这篇关于用户在 Asterisk 挂机时录制的文件丢失的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆