[Asterisk-Dev] Re: Asterisk H.323 driver

Charles Wang lazy.charles at gmail.com
Wed Mar 23 12:23:04 MST 2005


Hi, Chih-Wei:

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); 


On Wed, 23 Mar 2005 16:44:07 +0800, Chih-Wei Huang
<cwhuang at citron.com.tw> wrote:
> Attach another patch that fixes the RTP problem.
> 
> * Change rtp_info to avoid returning a pointer to a static buffer
> 
> typedef struct rtp_info {
>         struct sockaddr_in rtp_addr;
> } rtp_info_t;
> 
> * If no valid IP returned from on_external_rtp_create,
> try to determine IP by Openh323 stack.
> Now you need not to specify bindaddr in conf so the driver
> can work on a host with multiple network interfaces.
> 
> * Eliminate the usage of MyH323_ExternalRTPChannel.
> The class is unnecessary since original H323_ExternalRTPChannel
> is already good enough. Basically speaking, you override two methods
> of H323_ExternalRTPChannel to do two tasks in MyH323_ExternalRTPChannel:
>  1. Start(): call on_start_rtp_channel to start RTP thread
>  2. OnReceivedAckPDU(): also call on_start_rtp_channel
> 
> 1 is unnecessary since H323_ExternalRTPChannel::Start() just calls
> H323Channel::Open, which calls H323Connection::OnStartLogicalChannel.
> We can move all tasks into OnStartLogicalChannel.
> And 2 is also unnecessary because it duplicates the work done
> by Start(), and it will not be called on faststart situation.
> (On faststart you won't get OLCAck)
> In conclusion, we can move all tasks to do into OnStartLogicalChannel
> and use original H323_ExternalRTPChannel.
> 
> This approach is more like your old code in 1.0.5.
> Of course the old code is buggy, since it didn't correctly determine
> which situation to call on_start_rtp_channel.
> I like this approach since it call on_start_rtp_channel
> via a unique entry. The code is more compact and elegant(hopefully).
> 
> --
>    ~     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/
>  ^`~'^
> 
> 
> _______________________________________________
> Asterisk-Dev mailing list
> Asterisk-Dev at lists.digium.com
> http://lists.digium.com/mailman/listinfo/asterisk-dev
> To UNSUBSCRIBE or update options visit:
>   http://lists.digium.com/mailman/listinfo/asterisk-dev
> 
> 
> 


-- 

Best Regards
Charles



More information about the asterisk-dev mailing list