Summary:ASTERISK-02037: [patch] 7960 rejecting from field with :0 port description
Reporter:Terry Wilson (twilson)Labels:
Date Opened:2004-07-16 13:30:08Date Closed:2011-06-07 14:10:16
Versions:Frequency of
Environment:Attachments:( 0) bad_from.txt
( 1) chan_sip.c.patch
Description:When getting an incoming call off of a Zap channel and transmitting it as SIP to a Cisco 7960 phone that is registered to an SER proxy (which is record-routing), the 7960 is rejecting the call with a "400 Bad Request" error.  The message header shows "399 - Bad Request Malformed/Missing FROM: field".


Attatched are the INVITE and 400 response packets that were captured on the SER proxy.  You'll notice that the From: field on the invite shows:

From: "5555551212" <sip:5555551212@XXX.XXX.XXX.XXX:0>;tag=as179a9554

Obviously, if a call comes off of a ZAP channel it won't have a TCP port number.  Apparently, the Cisco 7960 (firmware 7.1 SIP) doesn't like the ':0' in the from field.  I have tested it with other SIP endpoints that worked fine with the ':0'.  Attached is a patch that changes the checks for default port (or 5060) in chan_sip.c to checks for port 5060 and not 0.

It seems to work without any adverse effects on my systems.  
Comments:By: Olle Johansson (oej) 2004-07-16 13:38:11

Could you please add your sip.conf [general] section?

By: Olle Johansson (oej) 2004-07-16 13:38:44

Also, are you running the latest cvs head?

By: Terry Wilson (twilson) 2004-07-16 13:39:58

Sorry, I meant to add:

XXX.XXX.XXX.XXX == asterisk-pstn gateway
YYY.YYY.YYY.YYY == Cisco 7960 phone

There are actually two INVITES and two BAD REQUESTS (since we are using the proxy in the middle), but I figured the two I captured should be sufficient to describe the problem.  Hope this helps.

By: Terry Wilson (twilson) 2004-07-16 14:10:53

Ahh... good call.  Using res_config and aparently forgot to export general section over to the test server... :-) I guess that port= line is important then?  :-)  Ah well, my patch at least fixes an issue for people like more who aren't too bright!

Fixed general section and reverted from patch and all works fine.

By: Olle Johansson (oej) 2004-07-16 14:14:43

COnfiguration issue. Thank you for quick responses! /O