[Asterisk-Dev] Re: Asterisk H.323 driver
Chih-Wei Huang
cwhuang at citron.com.tw
Wed Mar 23 18:32:26 MST 2005
Charles Wang wrote:
>
> I guess that you foget to patch the chan_h323.c under "channels/" too.
> Such as:
>
> channels/chan_h323.c lines 1179 to 1181
> info->addr = ast_inet_ntoa(iabuf, sizeof(iabuf), bindaddr.sin_addr);
> info->port = ntohs(us.sin_port);
> ast_log(LOG_DEBUG, "Sending RTP 'US' %s:%d\n", info->addr, info->port);
Yes, you are right.
I forgot the changes in chan_h323.c. Very sorry!
Here it is:
Index: chan_h323.c
===================================================================
RCS file: /usr/cvsroot/asterisk/channels/chan_h323.c,v
retrieving revision 1.106
diff -u -r1.106 chan_h323.c
--- chan_h323.c 17 Mar 2005 21:30:19 -0000 1.106
+++ chan_h323.c 24 Mar 2005 01:25:58 -0000
@@ -1159,9 +1160,7 @@
struct rtp_info *external_rtp_create(unsigned call_reference, const
char * token)
{
struct oh323_pvt *pvt;
- struct sockaddr_in us;
struct rtp_info *info;
- static char iabuf[INET_ADDRSTRLEN];
info = (struct rtp_info *)malloc(sizeof(struct rtp_info));
if (!info) {
@@ -1174,11 +1173,8 @@
return NULL;
}
/* figure out our local RTP port and tell the H.323 stack about
it */
- ast_rtp_get_us(pvt->rtp, &us);
- /* evil hack, until I (or someone?) figures out a better way */
- info->addr = ast_inet_ntoa(iabuf, sizeof(iabuf), bindaddr.sin_addr);
- info->port = ntohs(us.sin_port);
- ast_log(LOG_DEBUG, "Sending RTP 'US' %s:%d\n", info->addr,
info->port);
+ ast_rtp_get_us(pvt->rtp, &info->rtp_addr);
+ info->rtp_addr.sin_addr = bindaddr.sin_addr; /* hmm... do we
need this? */
return info;
}
--
~ Chih-Wei Huang (cwhuang at citron.com.tw)
'v' CTO, Citron Network Inc. ( http://www.citron.com.tw/ )
// \\ GnuGK Project : http://www.gnugk.org/ (Developer)
/( )\ HomePage : http://www.linux.org.tw/~cwhuang/
^`~'^
More information about the asterisk-dev
mailing list