[Twisted-Python] SIP protocol Via header doesn't compatible with SIP RFC3261.
hrqiang at gmail.com
Fri Jul 6 15:49:44 EDT 2012
Via header is different between RFC2543 and RFC3261.
Based on RFC3261, Via header BNF is
Via = ( "Via" / "v" ) HCOLON via-parm *(COMMA via-parm)
via-parm = sent-protocol LWS sent-by *( SEMI via-params )
via-params = via-ttl / via-maddr
/ via-received / via-branch
via-ttl = "ttl" EQUAL ttl
via-maddr = "maddr" EQUAL host
via-received = "received" EQUAL (IPv4address / IPv6address)
via-branch = "branch" EQUAL token
via-extension = generic-param
That means parseViaHeader should return a tuple, instead of single via object.
Top via will be parse first via header and first element in the tuple.
This fix is required because if message coming from Via, and it inject
Via header like this
current SIP stack cannot send the response to 22.214.171.124:5060.
Instead, it sends to 126.96.36.199:13582 that never get to the other side.
So I fixed this to have my SIP program working with proxy.
I have a patch for this. Please let me know how to submit to SVN.
More information about the Twisted-Python