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

Chih-Wei Huang cwhuang at citron.com.tw
Wed Mar 23 01:44:07 MST 2005


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/
  ^`~'^
-------------- next part --------------
A non-text attachment was scrubbed...
Name: rtp.diff
Type: text/x-patch
Size: 4672 bytes
Desc: not available
Url : http://lists.digium.com/pipermail/asterisk-dev/attachments/20050323/9a2da746/rtp.bin


More information about the asterisk-dev mailing list