VOIP中关于DTMF数据的处理方法和发送方式-实际用法(linphone)

VOIP中关于DTMF数据的处理方法和发送方式-实际用法(linphone)

  1. 目前传送DTMF信号普遍有三种方式:

A.通过通信协议传输(SIP info)
B. 通过RTP的数据内容传输(Inband)
C. 通过rfc2833的规则和格式包传输

  1. 结合抓包分析SIP INFO
  2. 集合抓包分析rfc2833

截图
由payload=101是由SDP协商的,后期过滤这个101就可以得到rfc2833的事件。

  1. linphone中如何实现?
    linphone_core_set_use_rfc2833_for_dtmf(marie->lc, use_rfc2833);
    linphone_core_set_use_info_for_dtmf(marie->lc, use_sipinfo);
    linphone_core_set_use_rfc2833_for_dtmf(pauline->lc, use_rfc2833);
    linphone_core_set_use_info_for_dtmf(pauline->lc, use_sipinfo);
    以上接口在建立通话初期需要调用,表示启用改功能;
    linphone_call_send_dtmfs(marie_call, dtmf_seq);
    linphone_call_send_dtmf(marie_call, dtmf_seq);
    以上接口是正常的发送接口,用来发送dtmf数据;
  2. linphone中给的示例:
/*
	liblinphone_tester - liblinphone test suite
	Copyright (C) 2013  Belledonne Communications SARL

	This program is free software: you can redistribute it and/or modify
	it under the terms of the GNU General Public License as published by
	the Free Software Foundation, either version 2 of the License, or
	(at your option) any later version.

	This program is distributed in the hope that it will be useful,
	but WITHOUT ANY WARRANTY; without even the implied warranty of
	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
	GNU General Public License for more details.

	You should have received a copy of the GNU General Public License
	along with this program.  If not, see <http://www.gnu.org/licenses/>.
*/

#include "liblinphone_tester.h"
#include "private.h"

LinphoneCoreManager* marie;
LinphoneCoreManager* pauline;
LinphoneCall *marie_call;

void dtmf_received(LinphoneCore *lc, LinphoneCall *call, int dtmf) {
   
	stats* counters = get_stats(lc);
	char** dst = &counters->dtmf_list_received;
	*dst = *dst ?
				ms_strcat_printf(*dst, "%c", dtmf)
				: ms_strdup_printf("%c", dtmf);
	counters->dtmf_count++;
}

void send_dtmf_base(bool_t use_rfc2833, bool_t use_sipinfo, char dtmf, char* dtmf_seq) {
   
	char* expected = NULL;
	int dtmf_count_prev;
	marie = linphone_core_manager_new( "marie_rc");
	pauline = linphone_core_manager_new( "pauline_rc");

	linphone_core_set_use_rfc2833_for_dtmf(marie->lc, use_rfc2833);
	linphone_core_set_use_info_
  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

ShaYQ

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值