[asterisk-commits] kharwell: branch 11 r408729 - in /branches/11: contrib/scripts/ main/

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri Feb 21 12:25:54 CST 2014


Author: kharwell
Date: Fri Feb 21 12:25:51 2014
New Revision: 408729

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=408729
Log:
rtp_engine: Dynamic payload change in rtp mapping not supported

Asterisk didn't support the dynamic payload change in rtp mapping in the 200
OK response.

Scenario:
Asterisk sends the INVITE proposing alaw and telephone-event, it proposes
rtpmap:101 for telephone-event.  Peer responds with 2xx, it answers with
alaw and telephone-event also, but it proposes a different rtpmap number
(rtpmap:103) for telephone-event.

Expected Behaviour:
Asterisk should honour the rtpmapping in the response and send DTMF packets
using 103 as payload type for DTMF.

Actual Behaviour: Asterisk sends DTMF packets using payload type 101.

With this patch asterisk now supports changes that can occur in the rtp mapping
in the response.

(closes issue ASTERISK-23279)
Reported by: NITESH BANSAL
Review: https://reviewboard.asterisk.org/r/3225/
Patches:
     dynamic_payload_change.patch uploaded by nbansal (license 6418)

Modified:
    branches/11/contrib/scripts/install_prereq
    branches/11/main/rtp_engine.c

Modified: branches/11/contrib/scripts/install_prereq
URL: http://svnview.digium.com/svn/asterisk/branches/11/contrib/scripts/install_prereq?view=diff&rev=408729&r1=408728&r2=408729
==============================================================================
--- branches/11/contrib/scripts/install_prereq (original)
+++ branches/11/contrib/scripts/install_prereq Fri Feb 21 12:25:51 2014
@@ -21,7 +21,7 @@
 # Basic build system:
 PACKAGES_DEBIAN="build-essential"
 # Asterisk: basic requirements:
-PACKAGES_DEBIAN="$PACKAGES_DEBIAN libncurses-dev libz-dev libssl-dev libxml2-dev libsqlite3-dev"
+PACKAGES_DEBIAN="$PACKAGES_DEBIAN libncurses-dev libz-dev libssl-dev libxml2-dev libsqlite3-dev uuid-dev"
 # Asterisk: for addons:
 PACKAGES_DEBIAN="$PACKAGES_DEBIAN libcurl-dev libspeex-dev libspeexdsp-dev libogg-dev libvorbis-dev libasound2-dev portaudio19-dev libcurl4-openssl-dev"
 PACKAGES_DEBIAN="$PACKAGES_DEBIAN libpq-dev unixodbc-dev libsqlite0-dev libmysqlclient15-dev libneon27-dev libgmime-dev libusb-dev liblua5.1-0-dev lua5.1"

Modified: branches/11/main/rtp_engine.c
URL: http://svnview.digium.com/svn/asterisk/branches/11/main/rtp_engine.c?view=diff&rev=408729&r1=408728&r2=408729
==============================================================================
--- branches/11/main/rtp_engine.c (original)
+++ branches/11/main/rtp_engine.c Fri Feb 21 12:25:51 2014
@@ -731,6 +731,14 @@
 	return (type->asterisk_format && (ast_format_cmp(&type->format, format) != AST_FORMAT_CMP_NOT_EQUAL)) ? CMP_MATCH | CMP_STOP : 0;
 }
 
+static int rtp_payload_type_find_nonast_format(void *obj, void *arg, int flags)
+{
+	struct ast_rtp_payload_type *type = obj;
+	int *rtp_code = arg;
+
+	return ((!type->asterisk_format && (type->rtp_code == *rtp_code)) ? CMP_MATCH | CMP_STOP : 0);
+}
+
 int ast_rtp_codecs_payload_code(struct ast_rtp_codecs *codecs, int asterisk_format, const struct ast_format *format, int code)
 {
 	struct ast_rtp_payload_type *type;
@@ -740,7 +748,7 @@
 		res = type->payload;
 		ao2_ref(type, -1);
 		return res;
-	} else if (!asterisk_format && (type = ao2_find(codecs->payloads, &code, OBJ_NOLOCK | OBJ_KEY))) {
+	} else if (!asterisk_format && (type = ao2_callback(codecs->payloads, OBJ_NOLOCK, rtp_payload_type_find_nonast_format, (void*)&code))) {
 		res = type->payload;
 		ao2_ref(type, -1);
 		return res;




More information about the asterisk-commits mailing list