[Asterisk-Dev] IAX2 Spec?
Steve Kann
stevek at stevek.com
Fri Apr 8 19:40:09 MST 2005
On Apr 8, 2005, at 10:05 PM, Johnathan Corgan wrote:
> Steve Kann wrote:
>
>> It's fun, especially when the receive side is mostly implemented in
>> one 1300 line function (socket_read()) :)
>
> Yeah, I was digging through this to try to tease out some of the inner
> workings of the protocol.
>
> One thing I did notice, and was curious about. A mini-frame only has
> the sender conversation number. This is used to as in index for the
> connection in iaxs[]. Since this is assigned by the sender and not
> the receiver, isn't it possible for there to be a collision? I would
> think that only the combination of scallno:dcallno would be guaranteed
> to be unique.
>
> Or am I missing something really simple?
The receiver knows what the sender's callno is, and it _also knows who
the sender is_, by virtue of where the packet came from.
So, the receiver's call number gets looked up right here (in
chan_iax2.c, anyway).
6228 if (!fr.callno)
6229 fr.callno = find_callno(ntohs(mh->callno) &
~IAX_FLAG_FULL, dcallno, &sin, new, 1, fd);
Also, you can look at libiax2.c's implementation, which is very
similar, but somewhat simpler than chan_iax2.
-SteveK
More information about the asterisk-dev
mailing list