|
|
@ -283,7 +283,8 @@ static int alter_mediaport(struct sip_msg *, str *, str *, str *, int);
|
|
|
|
static int alter_rtcp(struct sip_msg *msg, str *body, str *oldport, str *newport);
|
|
|
|
static int alter_rtcp(struct sip_msg *msg, str *body, str *oldport, str *newport);
|
|
|
|
static char *gencookie();
|
|
|
|
static char *gencookie();
|
|
|
|
static int rtpp_test(struct rtpp_node*, int, int);
|
|
|
|
static int rtpp_test(struct rtpp_node*, int, int);
|
|
|
|
static int unforce_rtp_proxy_f(struct sip_msg *, char *, char *);
|
|
|
|
static int unforce_rtp_proxy0_f(struct sip_msg *, char *, char *);
|
|
|
|
|
|
|
|
static int unforce_rtp_proxy1_f(struct sip_msg *, char *, char *);
|
|
|
|
static int force_rtp_proxy(struct sip_msg *, char *, char *, int, int);
|
|
|
|
static int force_rtp_proxy(struct sip_msg *, char *, char *, int, int);
|
|
|
|
static int start_recording_f(struct sip_msg *, char *, char *);
|
|
|
|
static int start_recording_f(struct sip_msg *, char *, char *);
|
|
|
|
static int rtpproxy_answer1_f(struct sip_msg *, char *, char *);
|
|
|
|
static int rtpproxy_answer1_f(struct sip_msg *, char *, char *);
|
|
|
@ -349,10 +350,16 @@ static cmd_export_t cmds[] = {
|
|
|
|
{"set_rtp_proxy_set", (cmd_function)set_rtp_proxy_set_f, 1,
|
|
|
|
{"set_rtp_proxy_set", (cmd_function)set_rtp_proxy_set_f, 1,
|
|
|
|
fixup_set_id, 0,
|
|
|
|
fixup_set_id, 0,
|
|
|
|
ANY_ROUTE},
|
|
|
|
ANY_ROUTE},
|
|
|
|
{"unforce_rtp_proxy", (cmd_function)unforce_rtp_proxy_f, 0,
|
|
|
|
{"unforce_rtp_proxy", (cmd_function)unforce_rtp_proxy0_f, 0,
|
|
|
|
0, 0,
|
|
|
|
0, 0,
|
|
|
|
ANY_ROUTE},
|
|
|
|
ANY_ROUTE},
|
|
|
|
{"rtpproxy_destroy", (cmd_function)unforce_rtp_proxy_f, 0,
|
|
|
|
{"unforce_rtp_proxy", (cmd_function)unforce_rtp_proxy1_f, 1,
|
|
|
|
|
|
|
|
0, 0,
|
|
|
|
|
|
|
|
ANY_ROUTE},
|
|
|
|
|
|
|
|
{"rtpproxy_destroy", (cmd_function)unforce_rtp_proxy0_f, 0,
|
|
|
|
|
|
|
|
0, 0,
|
|
|
|
|
|
|
|
ANY_ROUTE},
|
|
|
|
|
|
|
|
{"rtpproxy_destroy", (cmd_function)unforce_rtp_proxy1_f, 1,
|
|
|
|
0, 0,
|
|
|
|
0, 0,
|
|
|
|
ANY_ROUTE},
|
|
|
|
ANY_ROUTE},
|
|
|
|
{"start_recording", (cmd_function)start_recording_f, 0,
|
|
|
|
{"start_recording", (cmd_function)start_recording_f, 0,
|
|
|
@ -1638,7 +1645,14 @@ found:
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static int
|
|
|
|
static int
|
|
|
|
unforce_rtp_proxy_f(struct sip_msg* msg, char* str1, char* str2)
|
|
|
|
unforce_rtp_proxy0_f(struct sip_msg* msg, char* str1, char* str2)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
char arg[1] = {'\0'};
|
|
|
|
|
|
|
|
return unforce_rtp_proxy1_f(msg, arg, str2);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static int
|
|
|
|
|
|
|
|
unforce_rtp_proxy1_f(struct sip_msg* msg, char* str1, char* str2)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
str callid, from_tag, to_tag, viabranch;
|
|
|
|
str callid, from_tag, to_tag, viabranch;
|
|
|
|
char *cp;
|
|
|
|
char *cp;
|
|
|
@ -1740,7 +1754,7 @@ rtpproxy_manage(struct sip_msg *msg, char *flags, char *ip)
|
|
|
|
return -1;
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
|
|
|
|
if(method==METHOD_CANCEL || method==METHOD_BYE)
|
|
|
|
if(method==METHOD_CANCEL || method==METHOD_BYE)
|
|
|
|
return unforce_rtp_proxy_f(msg, 0, 0);
|
|
|
|
return unforce_rtp_proxy0_f(msg, 0, 0);
|
|
|
|
|
|
|
|
|
|
|
|
if(ip==NULL)
|
|
|
|
if(ip==NULL)
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -1766,13 +1780,13 @@ rtpproxy_manage(struct sip_msg *msg, char *flags, char *ip)
|
|
|
|
&& tmb.t_gett()!=T_UNDEFINED)
|
|
|
|
&& tmb.t_gett()!=T_UNDEFINED)
|
|
|
|
tmb.t_gett()->uas.request->msg_flags |= FL_SDP_BODY;
|
|
|
|
tmb.t_gett()->uas.request->msg_flags |= FL_SDP_BODY;
|
|
|
|
if(route_type==FAILURE_ROUTE)
|
|
|
|
if(route_type==FAILURE_ROUTE)
|
|
|
|
return unforce_rtp_proxy_f(msg, 0, 0);
|
|
|
|
return unforce_rtp_proxy0_f(msg, 0, 0);
|
|
|
|
return force_rtp_proxy(msg, flags, (cp!=NULL)?newip:ip, 1,
|
|
|
|
return force_rtp_proxy(msg, flags, (cp!=NULL)?newip:ip, 1,
|
|
|
|
(ip!=NULL)?1:0);
|
|
|
|
(ip!=NULL)?1:0);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else if(msg->first_line.type == SIP_REPLY) {
|
|
|
|
} else if(msg->first_line.type == SIP_REPLY) {
|
|
|
|
if(msg->first_line.u.reply.statuscode>=300)
|
|
|
|
if(msg->first_line.u.reply.statuscode>=300)
|
|
|
|
return unforce_rtp_proxy_f(msg, 0, 0);
|
|
|
|
return unforce_rtp_proxy0_f(msg, 0, 0);
|
|
|
|
if(nosdp==0) {
|
|
|
|
if(nosdp==0) {
|
|
|
|
if(method==METHOD_UPDATE)
|
|
|
|
if(method==METHOD_UPDATE)
|
|
|
|
return force_rtp_proxy(msg, flags, (cp!=NULL)?newip:ip, 0,
|
|
|
|
return force_rtp_proxy(msg, flags, (cp!=NULL)?newip:ip, 0,
|
|
|
|