DTMF Detection
Asterisk 的 DSP 有 DTMF 偵測功能。準備工作:用 ast_dsp_new() 取得一個 DSP 處理的 instance,並設定有 DTMF 偵測功能 -- ast_dsp_set_features(dsp, DSP_FEATURE_DIGIT_DETECT)。
每 voice frame 丟給 ast_dsp_process() 處理,如果有偵測到 DTMF,會回 AST_FRAME_DTMF_BEGIN 的 frame,到回 AST_FRAME_DTMF (或 AST_FRAME_DTMF_END) 結束。
DTMF Generation
相關函數struct ast_channel_tech 的
- send_digit_begin():沒提供此函數則完全不能送 DTMF。回傳 0 表示自己產生 DTMF,回傳其它值 (通常為 -1) 表示由 Asterisk 產生 DTMF。
- send_digit_end
ast_senddigit_begin():ast_playtones_start
ast_senddigit_end():ast_playtones_stop
ast_rtp_instance_dtmf_begin
ast_rtp_instance_dtmf_end
沒有留言:
張貼留言