From 3a918f3333be90172df2a039815d1358a220c59a Mon Sep 17 00:00:00 2001 From: Moises Silva Date: Thu, 26 May 2011 17:41:17 -0400 Subject: [PATCH] mod_sangoma_codec: do not use the provided session void* to store the rtp port --- src/mod/codecs/mod_sangoma_codec/mod_sangoma_codec.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/mod/codecs/mod_sangoma_codec/mod_sangoma_codec.c b/src/mod/codecs/mod_sangoma_codec/mod_sangoma_codec.c index 52782ad983..322da31272 100644 --- a/src/mod/codecs/mod_sangoma_codec/mod_sangoma_codec.c +++ b/src/mod/codecs/mod_sangoma_codec/mod_sangoma_codec.c @@ -224,7 +224,7 @@ static int sangoma_create_rtp_port(void *usr_priv, uint32_t host_ip, uint32_t *p switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "New allocated port %d for IP %s/%d.%d.%d.%d\n", rtp_port, local_ip, SNGTC_NIPV4(host_ip)); *p_rtp_port = rtp_port; - *rtp_fd = (void *)(long)rtp_port; + *rtp_fd = NULL; return 0; } @@ -259,6 +259,9 @@ static int sangoma_create_rtp(void *usr_priv, sngtc_codec_request_leg_t *codec_r switch_port_t rtp_port; struct sangoma_transcoding_session *sess = usr_priv; + rtp_port = codec_req_leg->host_udp_port; + *rtp_fd = NULL; + /* * We *MUST* use a new pool * Do not use the session pool since the session may go away while the RTP socket should linger around @@ -271,11 +274,6 @@ static int sangoma_create_rtp(void *usr_priv, sngtc_codec_request_leg_t *codec_r return -1; } - rtp_port = (switch_port_t)(long)*rtp_fd; - *rtp_fd = NULL; - - codec_req_leg->host_udp_port = rtp_port; - local_ip_addr.s_addr = htonl(codec_req_leg->host_ip); switch_inet_ntop(AF_INET, &local_ip_addr, local_ip, sizeof(local_ip)); sngtc_codec_ipv4_hex_to_str(codec_reply_leg->codec_ip, codec_ip);