|
@@ -341,6 +341,7 @@ static int *rtpp_socks = 0;
|
|
|
unsigned int *natping_state=0;
|
|
|
|
|
|
static str timeout_socket_str = {0, 0};
|
|
|
+static int timeout_socket_type = 1;
|
|
|
|
|
|
static cmd_export_t cmds[] = {
|
|
|
{"set_rtp_proxy_set", (cmd_function)set_rtp_proxy_set_f, 1,
|
|
@@ -408,6 +409,7 @@ static param_export_t params[] = {
|
|
|
{"rtpproxy_retr", INT_PARAM, &rtpproxy_retr },
|
|
|
{"rtpproxy_tout", INT_PARAM, &rtpproxy_tout },
|
|
|
{"timeout_socket", STR_PARAM, &timeout_socket_str.s },
|
|
|
+ {"timeout_socket_type", INT_PARAM, &timeout_socket_type },
|
|
|
{0, 0, 0}
|
|
|
};
|
|
|
|
|
@@ -1816,14 +1818,16 @@ force_rtp_proxy(struct sip_msg* msg, char* str1, char* str2, int offer)
|
|
|
{";", 1}, /* separator */
|
|
|
{NULL, 0}, /* medianum */
|
|
|
{" ", 1}, /* separator */
|
|
|
+ {NULL, 0}, /* Type of timeout-socket: 1 Kamailio-XML-RPC */
|
|
|
+ {" ", 1}, /* separator */
|
|
|
{NULL, 0}, /* Timeout-Socket */
|
|
|
};
|
|
|
int iovec_param_count;
|
|
|
|
|
|
char *c1p, *c2p, *bodylimit, *o1p;
|
|
|
- char medianum_buf[20];
|
|
|
+ char itoabuf_buf[20];
|
|
|
int medianum, media_multi;
|
|
|
- str medianum_str;
|
|
|
+ str itoabuf_str;
|
|
|
int c1p_altered;
|
|
|
static int swap_warned = 0;
|
|
|
|
|
@@ -2102,14 +2106,14 @@ force_rtp_proxy(struct sip_msg* msg, char* str1, char* str2, int offer)
|
|
|
#endif
|
|
|
if (1 || media_multi) /* XXX netch: can't choose now*/
|
|
|
{
|
|
|
- snprintf(medianum_buf, sizeof medianum_buf, "%d", medianum);
|
|
|
- medianum_str.s = medianum_buf;
|
|
|
- medianum_str.len = strlen(medianum_buf);
|
|
|
- STR2IOVEC(medianum_str, v[13]);
|
|
|
- STR2IOVEC(medianum_str, v[17]);
|
|
|
+ snprintf(itoabuf_buf, sizeof itoabuf_buf, "%d", medianum);
|
|
|
+ itoabuf_str.s = itoabuf_buf;
|
|
|
+ itoabuf_str.len = strlen(itoabuf_buf);
|
|
|
+ STR2IOVEC(itoabuf_str, v[13]);
|
|
|
+ STR2IOVEC(itoabuf_str, v[17]);
|
|
|
#ifdef EXTRA_DEBUG
|
|
|
- LM_DBG("STR2IOVEC(medianum_str, v[13])\n");
|
|
|
- LM_DBG("STR2IOVEC(medianum_str, v[17])\n");
|
|
|
+ LM_DBG("STR2IOVEC(itoabuf_str, v[13])\n");
|
|
|
+ LM_DBG("STR2IOVEC(itoabuf_str, v[17])\n");
|
|
|
#endif
|
|
|
} else {
|
|
|
v[12].iov_len = v[13].iov_len = 0;
|
|
@@ -2174,8 +2178,12 @@ force_rtp_proxy(struct sip_msg* msg, char* str1, char* str2, int offer)
|
|
|
if (to_tag.len > 0) {
|
|
|
iovec_param_count = 18;
|
|
|
if (timeout_socket_str.len > 0) {
|
|
|
- iovec_param_count = 20;
|
|
|
- STR2IOVEC(timeout_socket_str, v[19]);
|
|
|
+ iovec_param_count = 22;
|
|
|
+ snprintf(itoabuf_buf, sizeof itoabuf_buf, "%d", timeout_socket_type);
|
|
|
+ itoabuf_str.s = itoabuf_buf;
|
|
|
+ itoabuf_str.len = strlen(itoabuf_buf);
|
|
|
+ STR2IOVEC(itoabuf_str, v[19]);
|
|
|
+ STR2IOVEC(timeout_socket_str, v[21]);
|
|
|
}
|
|
|
} else {
|
|
|
iovec_param_count = 14;
|