[Asterisk-code-review] res pjsip sdp rtp: Properly set packetization on the codec (asterisk[13])
Robert Cripps
asteriskteam at digium.com
Wed Oct 17 08:53:25 CDT 2018
Robert Cripps has uploaded this change for review. ( https://gerrit.asterisk.org/10495
Change subject: res_pjsip_sdp_rtp: Properly set packetization on the codec
......................................................................
res_pjsip_sdp_rtp: Properly set packetization on the codec
In the transcode case (Alaw to Ulaw) the ptime was being discarded.
res_rtp_asterisk:
In the native bridge case the framing was never checked.
ASTERISK-28110 #close
Change-Id: Ic64b8fc6a140a93fbdb2f97550a40d0ff334e607
---
M res/res_pjsip_sdp_rtp.c
M res/res_rtp_asterisk.c
2 files changed, 11 insertions(+), 1 deletion(-)
git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/95/10495/1
diff --git a/res/res_pjsip_sdp_rtp.c b/res/res_pjsip_sdp_rtp.c
index 7c7040e..d74c90c 100644
--- a/res/res_pjsip_sdp_rtp.c
+++ b/res/res_pjsip_sdp_rtp.c
@@ -392,7 +392,10 @@
if (!ast_format_cap_count(joint)) {
struct ast_str *usbuf = ast_str_alloca(AST_FORMAT_CAP_NAMES_LEN);
struct ast_str *thembuf = ast_str_alloca(AST_FORMAT_CAP_NAMES_LEN);
-
+ if(codecs.framing) {
+ /* Copy the codecs framing ms even though there is no match */
+ ast_rtp_codecs_set_framing(ast_rtp_instance_get_codecs(session_media->rtp),codecs.framing);
+ }
ast_rtp_codecs_payloads_destroy(&codecs);
ast_log(LOG_NOTICE, "No joint capabilities for '%s' media stream between our configuration(%s) and incoming SDP(%s)\n",
session_media->stream_type,
diff --git a/res/res_rtp_asterisk.c b/res/res_rtp_asterisk.c
index 7b006ce..26d4845 100644
--- a/res/res_rtp_asterisk.c
+++ b/res/res_rtp_asterisk.c
@@ -5160,6 +5160,13 @@
return -1;
}
+ /* In p2p mode the framing ms values for both must be equal. If bridged is zero we don't care */
+ unsigned framing1 = ast_rtp_codecs_get_framing(ast_rtp_instance_get_codecs(instance1));
+ unsigned framing = ast_rtp_codecs_get_framing(ast_rtp_instance_get_codecs(instance));
+ if (framing1 != 0 && framing != framing1) {
+ return -1;
+ }
+
/* Otherwise adjust bridged payload to match */
bridged_payload = ast_rtp_codecs_payload_code(ast_rtp_instance_get_codecs(instance1), payload_type->asterisk_format, payload_type->format, payload_type->rtp_code);
--
To view, visit https://gerrit.asterisk.org/10495
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings
Gerrit-Project: asterisk
Gerrit-Branch: 13
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic64b8fc6a140a93fbdb2f97550a40d0ff334e607
Gerrit-Change-Number: 10495
Gerrit-PatchSet: 1
Gerrit-Owner: Robert Cripps <rcripps at voxbone.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20181017/b868b7a3/attachment-0001.html>
More information about the asterisk-code-review
mailing list