i made call sdp_keep_codecs_by_name("PCMU,PCMA,speex"); on an invite request and it didn't keep speex although it was in the sdp:
Session Description Protocol Session Description Protocol Version (v): 0 Owner/Creator, Session Id (o): sems 1 1 IN IP4 192.98.102.10 Session Name (s): sems Connection Information (c): IN IP4 192.98.102.10 Time Description, active time (t): 0 0 Media Description, name and address (m): audio 40000 RTP/AVP 101 102 8 0 3 2 9 96 97 98 99 100 Media Attribute (a): rtpmap:101 iLBC/8000 Media Attribute (a): rtpmap:102 speex/8000 Media Attribute (a): rtpmap:8 PCMA/8000 Media Attribute (a): rtpmap:0 PCMU/8000 Media Attribute (a): rtpmap:3 GSM/8000 Media Attribute (a): rtpmap:2 G721/8000 Media Attribute (a): rtpmap:9 g722/8000 Media Attribute (a): rtpmap:96 telephone-event/8000 Media Attribute (a): rtpmap:97 G726-32/8000 Media Attribute (a): rtpmap:98 G726-24/8000 Media Attribute (a): rtpmap:99 G726-40/8000 Media Attribute (a): rtpmap:100 G726-16/8000
it is so that sdpops module does not support codecs, whose ids are dynamic, but only codecs with static ids?
-- juha
Hello,
Right now is working only for non-dynamic codecs ids, indeed. There was a bug in the sdp parser that prevented implementing it in the first place, but when I fixed that before the 3.2.0 release, I forgot about this one. I will try to add it asap.
Cheers, Daniel
On 10/22/11 3:20 PM, Juha Heinanen wrote:
i made call sdp_keep_codecs_by_name("PCMU,PCMA,speex"); on an invite request and it didn't keep speex although it was in the sdp:
Session Description Protocol Session Description Protocol Version (v): 0 Owner/Creator, Session Id (o): sems 1 1 IN IP4 192.98.102.10 Session Name (s): sems Connection Information (c): IN IP4 192.98.102.10 Time Description, active time (t): 0 0 Media Description, name and address (m): audio 40000 RTP/AVP 101 102 8 0 3 2 9 96 97 98 99 100 Media Attribute (a): rtpmap:101 iLBC/8000 Media Attribute (a): rtpmap:102 speex/8000 Media Attribute (a): rtpmap:8 PCMA/8000 Media Attribute (a): rtpmap:0 PCMU/8000 Media Attribute (a): rtpmap:3 GSM/8000 Media Attribute (a): rtpmap:2 G721/8000 Media Attribute (a): rtpmap:9 g722/8000 Media Attribute (a): rtpmap:96 telephone-event/8000 Media Attribute (a): rtpmap:97 G726-32/8000 Media Attribute (a): rtpmap:98 G726-24/8000 Media Attribute (a): rtpmap:99 G726-40/8000 Media Attribute (a): rtpmap:100 G726-16/8000
it is so that sdpops module does not support codecs, whose ids are dynamic, but only codecs with static ids?
-- juha
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
Hello,
I committed on master branch the code for support of dynamic codecs ids:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=511dc62e...
I tested and seemed ok, but could try many options, so if you can give it a try as well would be good before backporting. I may be offline due to traveling, so if all ok and you need it in 3.2 quickly, feel free to cherry pick it to stable branch.
Thanks, Daniel
On 10/22/11 8:25 PM, Daniel-Constantin Mierla wrote:
Hello,
Right now is working only for non-dynamic codecs ids, indeed. There was a bug in the sdp parser that prevented implementing it in the first place, but when I fixed that before the 3.2.0 release, I forgot about this one. I will try to add it asap.
Cheers, Daniel
On 10/22/11 3:20 PM, Juha Heinanen wrote:
i made call sdp_keep_codecs_by_name("PCMU,PCMA,speex"); on an invite request and it didn't keep speex although it was in the sdp:
Session Description Protocol Session Description Protocol Version (v): 0 Owner/Creator, Session Id (o): sems 1 1 IN IP4
192.98.102.10 Session Name (s): sems Connection Information (c): IN IP4 192.98.102.10 Time Description, active time (t): 0 0 Media Description, name and address (m): audio 40000 RTP/AVP 101 102 8 0 3 2 9 96 97 98 99 100 Media Attribute (a): rtpmap:101 iLBC/8000 Media Attribute (a): rtpmap:102 speex/8000 Media Attribute (a): rtpmap:8 PCMA/8000 Media Attribute (a): rtpmap:0 PCMU/8000 Media Attribute (a): rtpmap:3 GSM/8000 Media Attribute (a): rtpmap:2 G721/8000 Media Attribute (a): rtpmap:9 g722/8000 Media Attribute (a): rtpmap:96 telephone-event/8000 Media Attribute (a): rtpmap:97 G726-32/8000 Media Attribute (a): rtpmap:98 G726-24/8000 Media Attribute (a): rtpmap:99 G726-40/8000 Media Attribute (a): rtpmap:100 G726-16/8000
it is so that sdpops module does not support codecs, whose ids are dynamic, but only codecs with static ids?
-- juha
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
Daniel-Constantin Mierla writes:
I committed on master branch the code for support of dynamic codecs ids:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=511dc62e...
I tested and seemed ok, but could try many options, so if you can give it a try as well would be good before backporting. I may be offline due to traveling, so if all ok and you need it in 3.2 quickly, feel free to cherry pick it to stable branch.
daniel,
i gave it a try and got crash when sdp_keep_codecs_by_name() was called on subscribe request that didn't contain body.
-- juha
(gdb) where #0 get_sdp_session_sdp (sdp=0x0, session_num=0) at parser/sdp/sdp.c:260 #1 0xb6e0424d in sdpops_sdp_get_ids_by_name (sdp=0x0, cname=0xbf9ea0f0, cid=0xbf9ea0e8) at sdpops_data.c:154 #2 0xb6e0450f in sdpops_build_ids_list (sdp=0x0, names=0xbf9ea1a8, ids=0xbf9ea158) at sdpops_data.c:213 #3 0xb6e064ba in sdp_keep_codecs_by_name (msg=0xb7426920, codecs=0xbf9ea1a8) at sdpops_mod.c:494 #4 0xb6e066b4 in w_sdp_keep_codecs_by_name (msg=0xb7426920, codecs=0xb75b0860 "@\215(\267 ", bar=0x0) at sdpops_mod.c:523 #5 0x0805b309 in do_action (h=0xbf9ea478, a=0xb7289ce0, msg=0xb7426920) at action.c:1122 #6 0x08062016 in run_actions (h=0xbf9ea478, a=0xb7287bd0, msg=0xb7426920) at action.c:1610 #7 0x080622c4 in run_top_route (a=0xb7287bd0, msg=0xb7426920, c=0x0) at action.c:1683 #8 0x080b5785 in receive_msg ( buf=0xb49fb770 "SUBSCRIBE sip:test@test.fi SIP/2.0\r\nVia: SIP/2.0/TCP 192.98.102.10:5074;rport;branch=z9hG4bKwgssaikv\r\nMax-Forwards: 69\r\nTo: sip:test@test.fi\r\nFrom: "Juha Heinanen" sip:jh@test.fi;tag=hdatd\r\nCall-I"..., len=422, rcv_info=0xb49fb5c4) at receive.c:206 #9 0x0811c47a in tcp_read_req (con=0xb49fb5b0, bytes_read=0xbf9ea738, read_flags=0xbf9ea734) at tcp_read.c:978 #10 0x0811df68 in handle_io (fm=<value optimized out>, events=<value optimized out>, idx=<value optimized out>) at tcp_read.c:1150 #11 0x0811f881 in io_wait_loop_epoll (unix_sock=39) at io_wait.h:1092 #12 tcp_receive_loop (unix_sock=39) at tcp_read.c:1319 #13 0x080fa747 in tcp_init_children () at tcp_main.c:4827 #14 0x08093b57 in main_loop () at main.c:1697 #15 0x080950ae in main (argc=17, argv=0xbf9eaac4) at main.c:2508
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
daniel,
it is possible to call both keep_codecs_by_name and keep_codecs_by_id, since 101 does not have name:
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.
-- juha
Hello,
On 10/29/11 6:43 PM, Juha Heinanen wrote:
Juha Heinanen writes:
it is possible to call both keep_codecs_by_name and keep_codecs_by_id, since 101 does not have name:
sorry, 101 does have name (telephone-event), so there is no problem.
btw, since I haven't spotted if you said it in previous emails, does keep_codecs_by_name() work now ok with codecs that have dynamic ids?
Thanks, Daniel
Daniel-Constantin Mierla writes:
btw, since I haven't spotted if you said it in previous emails, does keep_codecs_by_name() work now ok with codecs that have dynamic ids?
no, as i mentioned, it doesn't work. sdp_keep_codecs_by_name("PCMU,PCMA,speex"); on
Session Description Protocol Version (v): 0 Owner/Creator, Session Id (o): twinkle 1962716457 1676699914 IN IP4 192.98.102.10 Session Name (s): - Connection Information (c): IN IP4 192.98.102.10 Time Description, active time (t): 0 0 Media Description, name and address (m): audio 8000 RTP/AVP 99 97 8 0 3 101 Media Attribute (a): rtpmap:99 speex/32000 Media Attribute (a): rtpmap:97 speex/8000 Media Attribute (a): rtpmap:8 PCMA/8000 Media Attribute (a): rtpmap:0 PCMU/8000 Media Attribute (a): rtpmap:3 GSM/8000 Media Attribute (a): rtpmap:101 telephone-event/8000 Media Attribute (a): fmtp:101 0-15 Media Attribute (a): ptime:20 Media Attribute (a): zrtp
gives
Session Description Protocol Session Description Protocol Version (v): 0 Owner/Creator, Session Id (o): twinkle 1962716457 1676699914 IN IP4 192.98.102.10 Session Name (s): - Connection Information (c): IN IP4 192.98.102.10 Time Description, active time (t): 0 0 Media Description, name and address (m): audio 8000 RTP/AVP 0 Media Attribute (a): rtpmap:0 PCMU/8000 Media Attribute (a): ptime:20 Media Attribute (a): zrtp
-- juha
Hello,
On 10/31/11 7:59 PM, Juha Heinanen wrote:
Daniel-Constantin Mierla writes:
btw, since I haven't spotted if you said it in previous emails, does keep_codecs_by_name() work now ok with codecs that have dynamic ids?
no, as i mentioned,
ok, I missed that, being after the report of the no-sdp issue.
This one should be fixed as well now, after my last commit. There was a copy&paste mistake that didn't used provided delimiter to search in a codec list, but space ' ', where it was a comma separated list.
Try again with master and let me know if now is working fine.
Cheers, Daniel
it doesn't work. sdp_keep_codecs_by_name("PCMU,PCMA,speex"); on
Session Description Protocol Version (v): 0 Owner/Creator, Session Id (o): twinkle 1962716457 1676699914 IN IP4 192.98.102.10 Session Name (s): - Connection Information (c): IN IP4 192.98.102.10 Time Description, active time (t): 0 0 Media Description, name and address (m): audio 8000 RTP/AVP 99 97 8 0 3 101 Media Attribute (a): rtpmap:99 speex/32000 Media Attribute (a): rtpmap:97 speex/8000 Media Attribute (a): rtpmap:8 PCMA/8000 Media Attribute (a): rtpmap:0 PCMU/8000 Media Attribute (a): rtpmap:3 GSM/8000 Media Attribute (a): rtpmap:101 telephone-event/8000 Media Attribute (a): fmtp:101 0-15 Media Attribute (a): ptime:20 Media Attribute (a): zrtp
gives
Session Description Protocol Session Description Protocol Version (v): 0 Owner/Creator, Session Id (o): twinkle 1962716457 1676699914 IN IP4 192.98.102.10 Session Name (s): - Connection Information (c): IN IP4 192.98.102.10 Time Description, active time (t): 0 0 Media Description, name and address (m): audio 8000 RTP/AVP 0 Media Attribute (a): rtpmap:0 PCMU/8000 Media Attribute (a): ptime:20 Media Attribute (a): zrtp
-- juha
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
Daniel-Constantin Mierla writes:
Try again with master and let me know if now is working fine.
it is getting better, but not quite working yet.
in:
v=0. o=twinkle 1072425606 342738659 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.
out:
v=0. o=twinkle 1072425606 342738659 IN IP4 192.98.102.10. s=-. c=IN IP4 192.98.102.10. t=0 0. m=audio 8000 RTP/AVP 97 8 0. a=rtpmap:97 speex/8000. a=rtpmap:8 PCMA/8000. a=rtpmap:0 PCMU/8000. a=ptime:20. a=zrtp.
i.e., speex/32000 is missing from output.
-- juha
Hello,
ok, I see. In this case there are different ids for same name. The search of codec ID stops at first match on name and I think the sdp parser keep the list in reverse order (adding a= lines as first element in a list always). I will look over it.
Cheers, Daniel
On 11/1/11 12:35 PM, Juha Heinanen wrote:
Daniel-Constantin Mierla writes:
Try again with master and let me know if now is working fine.
it is getting better, but not quite working yet.
in:
v=0. o=twinkle 1072425606 342738659 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.
out:
v=0. o=twinkle 1072425606 342738659 IN IP4 192.98.102.10. s=-. c=IN IP4 192.98.102.10. t=0 0. m=audio 8000 RTP/AVP 97 8 0. a=rtpmap:97 speex/8000. a=rtpmap:8 PCMA/8000. a=rtpmap:0 PCMU/8000. a=ptime:20. a=zrtp.
i.e., speex/32000 is missing from output.
-- juha
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@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
For the record, this should be working fine for latest master branch, soon to be backported to 3.2, as reported by Juha after the last commits to sdpops module.
Cheers, Daniel
On 11/1/11 12:45 PM, Daniel-Constantin Mierla wrote:
Hello,
ok, I see. In this case there are different ids for same name. The search of codec ID stops at first match on name and I think the sdp parser keep the list in reverse order (adding a= lines as first element in a list always). I will look over it.
Cheers, Daniel
On 11/1/11 12:35 PM, Juha Heinanen wrote:
Daniel-Constantin Mierla writes:
Try again with master and let me know if now is working fine.
it is getting better, but not quite working yet.
in:
v=0. o=twinkle 1072425606 342738659 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.
out:
v=0. o=twinkle 1072425606 342738659 IN IP4 192.98.102.10. s=-. c=IN IP4 192.98.102.10. t=0 0. m=audio 8000 RTP/AVP 97 8 0. a=rtpmap:97 speex/8000. a=rtpmap:8 PCMA/8000. a=rtpmap:0 PCMU/8000. a=ptime:20. a=zrtp.
i.e., speex/32000 is missing from output.
-- juha
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@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
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
Hello,
On 10/29/11 6:40 PM, Juha Heinanen wrote:
daniel,
it is possible to call both keep_codecs_by_name and keep_codecs_by_id,
yes, it is possible. Practically calling many times functions removing same part of a SIP message is safe always. When adding results in duplicates of the content.
Cheers, Daniel
since 101 does not have name:
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.
-- juha
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
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@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users