> 97 is what the far end want to call RFC2833. 97 is what we want to call
> iLBC. There is no conflict.
My far end can't say about its preferences, so 97 processed as iLBC :(
Less destructive patch is applied - Huawei-style DTMF processing can
be tuned on/off now by ./configure
--
Regards,
Eugene Prokopiev
configure.ac | 10 ++++++++++
corelib/rtp.c | 7 ++++++-
include/callweaver/rtp.h | 4 +++-
3 files changed, 19 insertions(+), 2 deletions(-)
diff --git a/configure.ac b/configure.ac
index de2b037..c65aaf0 100755
--- a/configure.ac
+++ b/configure.ac
@@ -822,6 +822,16 @@ if test "${enable_rtp_payload_2}" = "yes"; then
fi
AM_CONDITIONAL([USE_DEPRECATED_G726],[test "${enable_rtp_payload_2}" = "yes"])
+
+dnl Enable Huawei-style RTP payload type 97 handling for DTMF
+AC_ARG_ENABLE(rtp-payload-97,
+ [AC_HELP_STRING([--enable-rtp-payload-97],[Enable Huawei-style RTP payload type 97 handling for DTMF (default=no)])],,[enable_rtp_payload_97="no"])
+
+if test "${enable_rtp_payload_97}" = "yes"; then
+ AC_DEFINE([USE_HUAWEI_DTMF],[],[Enable Huawei-style RTP payload type 97 handling for DTMF])
+fi
+AM_CONDITIONAL([USE_HUAWEI_DTMF],[test "${enable_rtp_payload_97}" = "yes"])
+
dnl Enable debugging
AC_ARG_ENABLE(debug,
[AC_HELP_STRING([--enable-debug],[build with debug information])],,[enable_debug="no"])
diff --git a/corelib/rtp.c b/corelib/rtp.c
index 13db6b8..78914af 100644
--- a/corelib/rtp.c
+++ b/corelib/rtp.c
@@ -1118,7 +1118,7 @@ struct cw_frame *cw_rtp_read(struct cw_rtp *rtp)
if (!rtpPT.is_cw_format)
{
/* This is special in-band data that's not one of our codecs */
- if (rtpPT.code == CW_RTP_DTMF)
+ if (rtpPT.code == CW_RTP_DTMF || rtpPT.code == CW_RTP_HUAWEI_DTMF)
{
/* It's special -- rfc2833 process it */
if (rtp_debug_test_addr(&sin))
@@ -1257,6 +1257,7 @@ static struct
{{1, CW_FORMAT_ILBC}, "audio", "iLBC"},
{{0, CW_RTP_DTMF}, "audio", "telephone-event"},
{{0, CW_RTP_CISCO_DTMF}, "audio", "cisco-telephone-event"},
+ {{0, CW_RTP_HUAWEI_DTMF}, "audio", "huawei-telephone-event"},
{{0, CW_RTP_CN}, "audio", "CN"},
{{1, CW_FORMAT_JPEG}, "video", "JPEG"},
{{1, CW_FORMAT_PNG}, "video", "PNG"},
@@ -1292,7 +1293,11 @@ static struct rtpPayloadType static_RTP_PT[MAX_RTP_PT] =
[31] = {1, CW_FORMAT_H261},
[34] = {1, CW_FORMAT_H263},
[103] = {1, CW_FORMAT_H263_PLUS},
+#ifdef USE_HUAWEI_DTMF
+ [97] = {0, CW_RTP_HUAWEI_DTMF},
+#else
[97] = {1, CW_FORMAT_ILBC},
+#endif
[99] = {1, CW_FORMAT_H264},
[101] = {0, CW_RTP_DTMF},
[110] = {1, CW_FORMAT_SPEEX},
diff --git a/include/callweaver/rtp.h b/include/callweaver/rtp.h
index 2e9b535..dca86bf 100644
--- a/include/callweaver/rtp.h
+++ b/include/callweaver/rtp.h
@@ -53,8 +53,10 @@ extern "C" {
#define CW_RTP_CN (1 << 1)
/*! DTMF (Cisco Proprietary) */
#define CW_RTP_CISCO_DTMF (1 << 2)
+/*! DTMF (Huawei Proprietary) */
+#define CW_RTP_HUAWEI_DTMF (1 << 3)
/*! Maximum RTP-specific code */
-#define CW_RTP_MAX CW_RTP_CISCO_DTMF
+#define CW_RTP_MAX CW_RTP_HUAWEI_DTMF
#define MAX_RTP_PT 256
_______________________________________________
Callweaver-dev mailing list
[email protected]
http://lists.callweaver.org/mailman/listinfo/callweaver-dev