[asterisk-dev] asterisk and iaxclient
Scott Gifford
sgifford at suspectclass.com
Thu Jun 1 15:19:41 MST 2006
Hello,
I seem to be having trouble getting iaxclient to talk to asterisk.
I'm currently using SVN trunk pulls from yesterday for both packages.
I'd like to use MozPhone or a phone based on JIAXPhone, both of which
are built in top of iaxclient. For now, I'm testing with "testcall",
included with iaxclient.
The client will connect and register OK to begin with, but then after
a minute or so of doing nothing (usually shortly after the client
re-registers), something will go wrong with the registration, and
Asterisk will report the client as unreachable; sometimes it will
become reachable again shortly after that, and sometimes not. Looking
at the situation with debugging enabled and/or with Ethereal, it seems
to be problems with PINGs, POKEs, and PONGs.
This seems like a pretty basic setup, and it breaks in a pretty
visible way. So my first question is: Does this work for other
people?
Here's what I've run into so far:
1. iaxclient sends PING requests for the new session. There are no
active calls, so Asterisk responds with INVAL. Not sure if this
is a real problem, but it clutters up the debug output, so I
commented out line 2086 in iax.c from iaxclient.
2. Asterisk sends a POKE, then sends another one before iaxclient
can respond. Asterisk gets upset by the second PONG, and sends
EINVAL. Again, not sure if this is a real problem, but
increasing MIN_RETRY_TIME to 100 in iax.c seemed to fix it.
So that brings me about to where I am now:
After a while, Asterisk will send a POKE with both ISeqno and OSeqno
set to 0. iaxclient ignores this as a retransmission, and eventually
Asterisk times it out. Here's what I see from the client:
Rx-Frame Retry[ No] -- OSeqno: 000 ISeqno: 000 Type: IAX Subclass: POKE
Timestamp: 00003ms SCall: 00002 DCall: 00000 [209.254.52.149:4569]
libiax2/src/iax.c line 2423 in iax_header_to_event: Received iseqno 0 not within window 1->1
libiax2/src/iax.c line 2450 in iax_header_to_event: Packet arrived out of order (expecting 2, got 0) (frametype = 6, subclass = 30)
libiax2/src/iax.c line 2458 in iax_header_to_event: Acking anyway
libiax2/src/iax.c line 839 in iax_xmit_frame: Transmitting frame
Tx-Frame Retry[-01] -- OSeqno: 000 ISeqno: 002 Type: IAX Subclass: ACK
Timestamp: 00003ms SCall: 00001 DCall: 00002 [209.254.52.149:4569]
Which brings me to my second question. Because POKE messages and the
responding PONGs aren't associated with a call, it's not clear to me
how sequence numbers should be handled, or what the SCall and DCall
fields should be in the PONG response. Is this documented somewhere,
or can somebody help me figure it out?
Thanks!
----ScottG.
More information about the asterisk-dev
mailing list