Module: sip-router
Branch: master
Commit: 8ad53ff31e15ace4600f32da94925c4667ee7754
URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=8ad53ff…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: Fri Aug 19 14:46:48 2011 +0200
sdpops: make delim char a parameter for function to search codec
---
modules/sdpops/sdpops_mod.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/modules/sdpops/sdpops_mod.c b/modules/sdpops/sdpops_mod.c
index 29ee993..eca4558 100644
--- a/modules/sdpops/sdpops_mod.c
+++ b/modules/sdpops/sdpops_mod.c
@@ -175,7 +175,7 @@ int sdp_remove_str_codec_id_attrs(sip_msg_t* msg,
/**
*
*/
-int sdp_codec_in_str(str *allcodecs, str* codec)
+int sdp_codec_in_str(str *allcodecs, str* codec, char delim)
{
int i;
int cmp;
@@ -191,7 +191,7 @@ int sdp_codec_in_str(str *allcodecs, str* codec)
if(strncmp(&allcodecs->s[i], codec->s, codec->len)==0) {
if(&allcodecs->s[i+codec->len]
== &allcodecs->s[allcodecs->len]
- || allcodecs->s[i+codec->len] == ' ') {
+ || allcodecs->s[i+codec->len] == delim) {
/* match */
return 1;
}
@@ -434,7 +434,7 @@ int sdp_keep_codecs_by_id(sip_msg_t* msg, str* codecs)
tmp_codecs.len -=(int)(&rm_codec.s[rm_codec.len]-tmp_codecs.s);
tmp_codecs.s = rm_codec.s + rm_codec.len;
- if(sdp_codec_in_str(codecs, &rm_codec)==0) {
+ if(sdp_codec_in_str(codecs, &rm_codec, ',')==0) {
LM_DBG("codecs [%.*s] - remove [%.*s]\n",
sdp_codecs.len, sdp_codecs.s,
rm_codec.len, rm_codec.s);