For those of you who want to follow along, the packet dump in question
is at
http://strike.dclg.ca/~dgilbert/22-3-filtered ... it's a pcap
format file.
I'm using a 0.9.4 copy of ser, compiled by hand on debian stable.
Only the core portion of ser is being used, and I have simple config
file (attached).
So, roughly, a call comes in level3, they make it SIP and forward it
to my SER on port 5070. SER turns around and forwarded it to asterisk
on port 5060 of the same machine and then asterisk forwards it on to a
linksys ATA.
In short, the problem is that level3 abuses the RFC by sending from a
port and expecting you to reply on another port (specified in the
Contact: header). This goes almost right except for level3's equally
literal read of the Contact header that SER sends.
Packet Sip Command Contact
====== =========== =======
level3:38999 ser:5070 INVITE sip:+1416...@<level3 ip>:5060
ser:5070 level3:38999 100 Trying sip:+1866...@<ser ip>
(ser invites asterisk, not in dump)
asterisk:5060 ata:5060 INVITE sip:+1416...@<asterisk ip>
ata:5060 asterisk:5060 100 Trying None
ata:5060 asterisk:5060 180 Ringing None
(asterisk relays 180 to ser, not in dump)
ser:5070 level3:38999 180 Ringing sip:+1866...@<ser ip>
ata:5060 asterisk:5060 200 OK sip:604...@<ata ip>:5060
asterisk:5060 ata:5060 ACK sip:+1416...@<asterisk ip>
(asterisk relays 200 OK to ser, not in dump)
ser:5070 level3:5060 200 OK sip:+1866...@<ser ip>
level3:5060 ser:5060 !?! ACK sip:+1866...@<level3 ip>:5060
Now... the problem is that each time ser repsonds, the contact line
should be appended with ":5070" and it is not. Therefore, being the
literal people they are, level3 repsonds to port 5060 with their ACK.
This means that the ACK goes directly to asterisk rather than to SER
and it means that when the call ends, the BYE notification from
asterisk goes directly to the wrong port at level3.
Dave.
--
============================================================================
|David Gilbert, Independent Contractor. | Two things can only be |
|Mail: dave(a)daveg.ca | equal if and only if they |
|http://daveg.ca | are precisely opposite. |
=========================================================GLO================