[SR-Users] sdpops and dynamic codec ids

Daniel-Constantin Mierla miconda at gmail.com
Mon Oct 31 11:48:14 CET 2011


Hello,

there was a positive return code for the case of no-body in SIP message, 
like it was for SUBSCRIBE. I updated all the other functions as well, 
since they faced same issue. The fix is slightly different, practically 
checking for the sdp structure not to be null, since at some point is a 
return of a code returned from other function -- I thought is safer over 
all.

Thanks,
Daniel

On 10/29/11 6:36 PM, Juha Heinanen wrote:
> daniel,
>
> i fixed the crash like this:
>
> ***************
> *** 482,495 ****
>    int sdp_keep_codecs_by_name(sip_msg_t* msg, str* codecs)
>    {
>    	str idslist;
>
> ! 	if(parse_sdp(msg)<  0) {
>    		LM_ERR("Unable to parse sdp\n");
>    		return -1;
>    	}
>
> ! 	LM_ERR("attempting to keep codecs in sdp: [%.*s]\n",
> ! 			codecs->len, codecs->s);
>
>    	if(sdpops_build_ids_list((sdp_info_t*)msg->body, codecs,&idslist)<0)
>    		return -1;
> --- 482,498 ----
>    int sdp_keep_codecs_by_name(sip_msg_t* msg, str* codecs)
>    {
>    	str idslist;
> + 	int res;
>
> ! 	res = parse_sdp(msg);
> ! 	if(res<  0) {
>    		LM_ERR("Unable to parse sdp\n");
>    		return -1;
>    	}
> + 	if(res == 1) return 0;
>
> ! 	LM_DBG("attempting to keep codecs in sdp: [%.*s]\n",
> ! 	       codecs->len, codecs->s);
>
>    	if(sdpops_build_ids_list((sdp_info_t*)msg->body, codecs,&idslist)<0)
>    		return -1;
>
> and tried again sdp_keep_codecs_by_name("PCMU,PCMA,speex"); on
>
> v=0.
> o=twinkle 1548176998 229186862 IN IP4 192.98.102.10.
> s=-.
> c=IN IP4 192.98.102.10.
> t=0 0.
> m=audio 8000 RTP/AVP 99 97 8 0 3 101.
> a=rtpmap:99 speex/32000.
> a=rtpmap:97 speex/8000.
> a=rtpmap:8 PCMA/8000.
> a=rtpmap:0 PCMU/8000.
> a=rtpmap:3 GSM/8000.
> a=rtpmap:101 telephone-event/8000.
> a=fmtp:101 0-15.
> a=ptime:20.
> a=zrtp.
>
> the result was
>
> v=0.
> o=twinkle 1548176998 229186862 IN IP4 192.98.102.10.
> s=-.
> c=IN IP4 192.98.102.10.
> t=0 0.
> m=audio 8000 RTP/AVP 0.
> a=rtpmap:0 PCMU/8000.
> a=ptime:20.
> a=zrtp.
>
> your turn.
>
> -- juha
>
> _______________________________________________
> SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
> sr-users at lists.sip-router.org
> http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users

-- 
Daniel-Constantin Mierla -- http://www.asipto.com
Kamailio Advanced Training, Dec 5-8, Berlin: http://asipto.com/u/kat
http://linkedin.com/in/miconda -- http://twitter.com/miconda




More information about the sr-users mailing list