[asterisk-commits] kmoore: branch kmoore/pimp_sip_srtp r386335 - /team/kmoore/pimp_sip_srtp/res/
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Tue Apr 23 09:24:29 CDT 2013
Author: kmoore
Date: Tue Apr 23 09:24:26 2013
New Revision: 386335
URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=386335
Log:
Another tweak to get things working
Modified:
team/kmoore/pimp_sip_srtp/res/res_sip_sdp_rtp.c
Modified: team/kmoore/pimp_sip_srtp/res/res_sip_sdp_rtp.c
URL: http://svnview.digium.com/svn/asterisk/team/kmoore/pimp_sip_srtp/res/res_sip_sdp_rtp.c?view=diff&rev=386335&r1=386334&r2=386335
==============================================================================
--- team/kmoore/pimp_sip_srtp/res/res_sip_sdp_rtp.c (original)
+++ team/kmoore/pimp_sip_srtp/res/res_sip_sdp_rtp.c Tue Apr 23 09:24:26 2013
@@ -594,9 +594,10 @@
{
pj_str_t stmp;
pjmedia_sdp_attr *attr;
- const char *crypto_attribute = ast_sdp_srtp_get_attrib(&session_media->srtp,
+ int crypto_len;
+ char *crypto_attribute = ast_strdupa(ast_sdp_srtp_get_attrib(&session_media->srtp,
0 /* DTLS can not be enabled for res_sip */,
- 0 /* don't prefer 32byte tag length */);
+ 0 /* don't prefer 32byte tag length */));
if (!crypto_attribute) {
/* No crypto attribute to add */
@@ -604,6 +605,10 @@
}
/* skip over a=crypto: since it will be added by pjsip */
crypto_attribute += strlen("a=crypto:");
+
+ /* remove the trailing \r\n */
+ crypto_len = strlen(crypto_attribute);
+ crypto_attribute[crypto_len - 2] = '\0';
attr = pjmedia_sdp_attr_create(pool, "crypto", pj_cstr(&stmp, crypto_attribute));
media->attr[media->attr_count++] = attr;
More information about the asterisk-commits
mailing list