|
@@ -64,6 +64,7 @@
|
|
#include "../../parser/parse_methods.h"
|
|
#include "../../parser/parse_methods.h"
|
|
#include "../../parser/parse_content.h"
|
|
#include "../../parser/parse_content.h"
|
|
#include "../../parser/parse_param.h"
|
|
#include "../../parser/parse_param.h"
|
|
|
|
+#include "../../parser/sdp/sdp.h"
|
|
#include "../../lib/kcore/parse_privacy.h"
|
|
#include "../../lib/kcore/parse_privacy.h"
|
|
#include "../../msg_translator.h"
|
|
#include "../../msg_translator.h"
|
|
#include "../../ut.h"
|
|
#include "../../ut.h"
|
|
@@ -93,6 +94,9 @@ MODULE_VERSION
|
|
#define TIME_FORMAT "Date: %a, %d %b %Y %H:%M:%S GMT"
|
|
#define TIME_FORMAT "Date: %a, %d %b %Y %H:%M:%S GMT"
|
|
#define MAX_TIME 64
|
|
#define MAX_TIME 64
|
|
|
|
|
|
|
|
+#define AUDIO_STR "audio"
|
|
|
|
+#define AUDIO_STR_LEN 5
|
|
|
|
+
|
|
|
|
|
|
static int search_body_f(struct sip_msg*, char*, char*);
|
|
static int search_body_f(struct sip_msg*, char*, char*);
|
|
static int replace_f(struct sip_msg*, char*, char*);
|
|
static int replace_f(struct sip_msg*, char*, char*);
|
|
@@ -124,7 +128,7 @@ static int cmp_istr_f(struct sip_msg *msg, char *str1, char *str2 );
|
|
static int starts_with_f(struct sip_msg *msg, char *str1, char *str2 );
|
|
static int starts_with_f(struct sip_msg *msg, char *str1, char *str2 );
|
|
static int remove_hf_re_f(struct sip_msg* msg, char* key, char* foo);
|
|
static int remove_hf_re_f(struct sip_msg* msg, char* key, char* foo);
|
|
static int is_present_hf_re_f(struct sip_msg* msg, char* key, char* foo);
|
|
static int is_present_hf_re_f(struct sip_msg* msg, char* key, char* foo);
|
|
-
|
|
|
|
|
|
+static int is_audio_on_hold_f(struct sip_msg *msg, char *str1, char *str2 );
|
|
static int fixup_substre(void**, int);
|
|
static int fixup_substre(void**, int);
|
|
static int hname_fixup(void** param, int param_no);
|
|
static int hname_fixup(void** param, int param_no);
|
|
static int free_hname_fixup(void** param, int param_no);
|
|
static int free_hname_fixup(void** param, int param_no);
|
|
@@ -246,6 +250,9 @@ static cmd_export_t cmds[]={
|
|
{"starts_with", (cmd_function)starts_with_f, 2,
|
|
{"starts_with", (cmd_function)starts_with_f, 2,
|
|
fixup_spve_spve, 0,
|
|
fixup_spve_spve, 0,
|
|
REQUEST_ROUTE|ONREPLY_ROUTE|FAILURE_ROUTE|BRANCH_ROUTE|LOCAL_ROUTE},
|
|
REQUEST_ROUTE|ONREPLY_ROUTE|FAILURE_ROUTE|BRANCH_ROUTE|LOCAL_ROUTE},
|
|
|
|
+ {"is_audio_on_hold", (cmd_function)is_audio_on_hold_f, 0,
|
|
|
|
+ 0, 0,
|
|
|
|
+ REQUEST_ROUTE|ONREPLY_ROUTE|FAILURE_ROUTE|BRANCH_ROUTE|LOCAL_ROUTE},
|
|
|
|
|
|
{0,0,0,0,0,0}
|
|
{0,0,0,0,0,0}
|
|
};
|
|
};
|
|
@@ -1874,6 +1881,32 @@ static int starts_with_f(struct sip_msg *msg, char *str1, char *str2 )
|
|
return -2;
|
|
return -2;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+static int is_audio_on_hold_f(struct sip_msg *msg, char *str1, char *str2 )
|
|
|
|
+{
|
|
|
|
+ int sdp_session_num = 0, sdp_stream_num;
|
|
|
|
+ sdp_session_cell_t* sdp_session;
|
|
|
|
+ sdp_stream_cell_t* sdp_stream;
|
|
|
|
+
|
|
|
|
+ if (0 == parse_sdp(msg)) {
|
|
|
|
+ for(;;) {
|
|
|
|
+ sdp_session = get_sdp_session(msg, sdp_session_num);
|
|
|
|
+ if(!sdp_session) break;
|
|
|
|
+ sdp_stream_num = 0;
|
|
|
|
+ for(;;) {
|
|
|
|
+ sdp_stream = get_sdp_stream(msg, sdp_session_num, sdp_stream_num);
|
|
|
|
+ if(!sdp_stream) break;
|
|
|
|
+ if(sdp_stream->media.len==AUDIO_STR_LEN &&
|
|
|
|
+ strncmp(sdp_stream->media.s,AUDIO_STR,AUDIO_STR_LEN)==0 &&
|
|
|
|
+ sdp_stream->is_on_hold)
|
|
|
|
+ return 1;
|
|
|
|
+ sdp_stream_num++;
|
|
|
|
+ }
|
|
|
|
+ sdp_session_num++;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ return -1;
|
|
|
|
+}
|
|
|
|
+
|
|
int fixup_regexpNL_none(void** param, int param_no)
|
|
int fixup_regexpNL_none(void** param, int param_no)
|
|
{
|
|
{
|
|
regex_t* re;
|
|
regex_t* re;
|