|
|
b9a4805 |
From: Peter Lemenkov <lemenkov@gmail.com>
|
|
|
b9a4805 |
Date: Fri, 11 Jan 2013 14:40:08 +0400
|
|
|
fa3f242 |
Subject: [PATCH] Return actual payload ID in case of a dynamic payload
|
|
|
b9a4805 |
|
|
|
b9a4805 |
Signed-off-by: Peter Lemenkov <lemenkov@gmail.com>
|
|
|
b9a4805 |
|
|
|
b9a4805 |
diff --git a/modules/sipmsgops/codecs.c b/modules/sipmsgops/codecs.c
|
|
|
aa419c5 |
index 9270ecb..0fe0a1c 100644
|
|
|
b9a4805 |
--- a/modules/sipmsgops/codecs.c
|
|
|
b9a4805 |
+++ b/modules/sipmsgops/codecs.c
|
|
|
b9a4805 |
@@ -34,6 +34,7 @@
|
|
|
b9a4805 |
#include "codecs.h"
|
|
|
b9a4805 |
#include "../../route.h"
|
|
|
b9a4805 |
#include "../../mod_fix.h"
|
|
|
b9a4805 |
+#include "../../ut.h"
|
|
|
b9a4805 |
|
|
|
b9a4805 |
#define MAX_STREAMS 64
|
|
|
b9a4805 |
|
|
|
b9a4805 |
@@ -528,7 +529,9 @@ static int stream_process(struct sip_msg * msg, struct sdp_stream_cell *cell,
|
|
|
b9a4805 |
|
|
|
b9a4805 |
if(op == FIND)
|
|
|
b9a4805 |
{
|
|
|
b9a4805 |
- ret = 1;
|
|
|
b9a4805 |
+ str2sint(&(payload->rtp_payload), &ret;;
|
|
|
b9a4805 |
+ if( (ret >= 0) && (ret <= 34) ) /* if a fixed payload ID then just return 1 */
|
|
|
b9a4805 |
+ ret = 1;
|
|
|
b9a4805 |
goto end;
|
|
|
b9a4805 |
}
|
|
|
b9a4805 |
|
|
|
a0d9bac |
@@ -685,22 +688,12 @@ int codec_find (struct sip_msg* msg, char* str1 )
|
|
|
b9a4805 |
|
|
|
b9a4805 |
LM_DBG("searching for codec <%.*s> \n",res.len,res.s);
|
|
|
b9a4805 |
|
|
|
b9a4805 |
- if( do_for_all_streams( msg, &res, NULL, NULL,
|
|
|
b9a4805 |
- FIND, DESC_NAME) <= 0)
|
|
|
b9a4805 |
- return -1;
|
|
|
b9a4805 |
-
|
|
|
b9a4805 |
- return 1;
|
|
|
b9a4805 |
-
|
|
|
b9a4805 |
+ return do_for_all_streams( msg, &res, NULL, NULL, FIND, DESC_NAME);
|
|
|
b9a4805 |
}
|
|
|
b9a4805 |
|
|
|
b9a4805 |
int codec_find_re (struct sip_msg* msg, char* str1 )
|
|
|
b9a4805 |
{
|
|
|
b9a4805 |
-
|
|
|
b9a4805 |
- if( do_for_all_streams(msg, NULL, NULL, (regex_t*)str1,
|
|
|
b9a4805 |
- FIND, DESC_REGEXP) <= 0)
|
|
|
b9a4805 |
- return -1;
|
|
|
b9a4805 |
-
|
|
|
b9a4805 |
- return 1;
|
|
|
b9a4805 |
+ return do_for_all_streams(msg, NULL, NULL, (regex_t*)str1, FIND, DESC_REGEXP);
|
|
|
b9a4805 |
}
|
|
|
b9a4805 |
|
|
|
b9a4805 |
|
|
|
a0d9bac |
@@ -723,11 +716,7 @@ int codec_find_clock (struct sip_msg* msg, char* str1,char * str2 )
|
|
|
b9a4805 |
LM_DBG("searching for codec <%.*s> with clock <%.*s> \n",
|
|
|
b9a4805 |
codec.len,codec.s,clock.len,clock.s);
|
|
|
b9a4805 |
|
|
|
b9a4805 |
- if( do_for_all_streams( msg, &codec, &clock, NULL,
|
|
|
b9a4805 |
- FIND, DESC_NAME_AND_CLOCK) <= 0)
|
|
|
b9a4805 |
- return -1;
|
|
|
b9a4805 |
-
|
|
|
b9a4805 |
- return 1;
|
|
|
b9a4805 |
+ return do_for_all_streams( msg, &codec, &clock, NULL, FIND, DESC_NAME_AND_CLOCK);
|
|
|
b9a4805 |
}
|
|
|
b9a4805 |
|
|
|
b9a4805 |
|