Fix one-way audio issues with CCM and possibly other [broken] endpoints. Bug #4135
authorJeremy McNamara <jj@nufone.net>
Tue, 3 May 2005 18:58:50 +0000 (18:58 +0000)
committerJeremy McNamara <jj@nufone.net>
Tue, 3 May 2005 18:58:50 +0000 (18:58 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@5560 65c4cc65-6c06-0410-ace0-fbb531ad65f3

channels/chan_h323.c

index a91a4e7..1d8b08e 100755 (executable)
@@ -1321,7 +1321,6 @@ struct rtp_info *external_rtp_create(unsigned call_reference, const char * token
        struct oh323_pvt *pvt;
        struct sockaddr_in us;
        struct rtp_info *info;
        struct oh323_pvt *pvt;
        struct sockaddr_in us;
        struct rtp_info *info;
-       char iabuf[INET_ADDRSTRLEN];
 
        info = (struct rtp_info *)malloc(sizeof(struct rtp_info));
        if (!info) {
 
        info = (struct rtp_info *)malloc(sizeof(struct rtp_info));
        if (!info) {
@@ -1330,6 +1329,7 @@ struct rtp_info *external_rtp_create(unsigned call_reference, const char * token
        }
        pvt = find_call(call_reference, token); 
        if (!pvt) {
        }
        pvt = find_call(call_reference, token); 
        if (!pvt) {
+               free(info);
                ast_log(LOG_ERROR, "Unable to find call %s(%d)\n", token, call_reference);
                return NULL;
        }
                ast_log(LOG_ERROR, "Unable to find call %s(%d)\n", token, call_reference);
                return NULL;
        }
@@ -1338,7 +1338,7 @@ struct rtp_info *external_rtp_create(unsigned call_reference, const char * token
        ast_rtp_get_us(pvt->rtp, &us);
        ast_mutex_unlock(&pvt->lock);
        /* evil hack, until I (or someone?) figures out a better way */
        ast_rtp_get_us(pvt->rtp, &us);
        ast_mutex_unlock(&pvt->lock);
        /* evil hack, until I (or someone?) figures out a better way */
-       info->addr = ast_inet_ntoa(iabuf, sizeof(iabuf), bindaddr.sin_addr);
+       ast_inet_ntoa(info->addr, sizeof(info->addr), bindaddr.sin_addr);
        info->port = ntohs(us.sin_port);
        ast_log(LOG_DEBUG, "Sending RTP 'US' %s:%d\n", info->addr, info->port);
        return info;
        info->port = ntohs(us.sin_port);
        ast_log(LOG_DEBUG, "Sending RTP 'US' %s:%d\n", info->addr, info->port);
        return info;