diff --git a/conf/vanilla/autoload_configs/msrp.conf.xml b/conf/vanilla/autoload_configs/msrp.conf.xml index 8b9e03e300..65c2d61976 100644 --- a/conf/vanilla/autoload_configs/msrp.conf.xml +++ b/conf/vanilla/autoload_configs/msrp.conf.xml @@ -1,8 +1,8 @@ - - + + diff --git a/src/include/switch_msrp.h b/src/include/switch_msrp.h index 0b114c02fa..9ec9243664 100644 --- a/src/include/switch_msrp.h +++ b/src/include/switch_msrp.h @@ -34,9 +34,6 @@ #include -#define MSRP_LISTEN_PORT 2855 -#define MSRP_SSL_LISTEN_PORT 2856 - enum { MSRP_ST_WAIT_HEADER, MSRP_ST_PARSE_HEADER, diff --git a/src/switch_msrp.c b/src/switch_msrp.c index bc680d11ca..da5e288dc0 100644 --- a/src/switch_msrp.c +++ b/src/switch_msrp.c @@ -36,8 +36,6 @@ #define MSRP_BUFF_SIZE (SWITCH_RTP_MAX_BUF_LEN - 32) #define DEBUG_MSRP 0 -#define MSRP_LISTEN_PORT 2855 -#define MSRP_SSL_LISTEN_PORT 2856 struct msrp_socket_s { switch_port_t port; @@ -297,35 +295,41 @@ SWITCH_DECLARE(switch_status_t) switch_msrp_init() memset(&globals, 0, sizeof(globals)); set_global_ip("0.0.0.0"); globals.pool = pool; - globals.msock.port = (switch_port_t)MSRP_LISTEN_PORT; - globals.msock_ssl.port = (switch_port_t)MSRP_SSL_LISTEN_PORT; + globals.msock.port = (switch_port_t)0; + globals.msock_ssl.port = (switch_port_t)0; globals.msock_ssl.secure = 1; globals.message_buffer_size = 50; globals.debug = DEBUG_MSRP; load_config(); - globals.running = 1; + if (globals.msock.port) { + globals.running = 1; - status = msock_init(globals.ip, globals.msock.port, &globals.msock.sock, pool); + status = msock_init(globals.ip, globals.msock.port, &globals.msock.sock, pool); - if (status == SWITCH_STATUS_SUCCESS) { - switch_threadattr_create(&thd_attr, pool); - // switch_threadattr_detach_set(thd_attr, 1); - switch_threadattr_stacksize_set(thd_attr, SWITCH_THREAD_STACKSIZE); - switch_thread_create(&thread, thd_attr, msrp_listener, &globals.msock, pool); - globals.msock.thread = thread; + if (status == SWITCH_STATUS_SUCCESS) { + switch_threadattr_create(&thd_attr, pool); + // switch_threadattr_detach_set(thd_attr, 1); + switch_threadattr_stacksize_set(thd_attr, SWITCH_THREAD_STACKSIZE); + switch_thread_create(&thread, thd_attr, msrp_listener, &globals.msock, pool); + globals.msock.thread = thread; + } } - msrp_init_ssl(); - status = msock_init(globals.ip, globals.msock_ssl.port, &globals.msock_ssl.sock, pool); + if (globals.msock_ssl.port) { + globals.running = 1; - if (status == SWITCH_STATUS_SUCCESS) { - switch_threadattr_create(&thd_attr, pool); - // switch_threadattr_detach_set(thd_attr, 1); - switch_threadattr_stacksize_set(thd_attr, SWITCH_THREAD_STACKSIZE); - switch_thread_create(&thread, thd_attr, msrp_listener, &globals.msock_ssl, pool); - globals.msock_ssl.thread = thread; + msrp_init_ssl(); + status = msock_init(globals.ip, globals.msock_ssl.port, &globals.msock_ssl.sock, pool); + + if (status == SWITCH_STATUS_SUCCESS) { + switch_threadattr_create(&thd_attr, pool); + // switch_threadattr_detach_set(thd_attr, 1); + switch_threadattr_stacksize_set(thd_attr, SWITCH_THREAD_STACKSIZE); + switch_thread_create(&thread, thd_attr, msrp_listener, &globals.msock_ssl, pool); + globals.msock_ssl.thread = thread; + } } return SWITCH_STATUS_SUCCESS; @@ -411,7 +415,7 @@ SWITCH_DECLARE(switch_status_t) switch_msrp_session_destroy(switch_msrp_session_ switch_status_t switch_msrp_session_push_msg(switch_msrp_session_t *ms, switch_msrp_msg_t *msg) { switch_mutex_lock(ms->mutex); - + if (ms->last_msg == NULL) { ms->last_msg = msg; ms->msrp_msg = msg;