Summary:ASTERISK-08554: SIP message 420 Bad extension sent out malformed.
Reporter:Tomas Muehlhoff (tmuehlhoff)Labels:
Date Opened:2007-01-11 06:11:08.000-0600Date Closed:2007-01-12 10:01:52.000-0600
Versions:Frequency of
Environment:Attachments:( 0) debug_8793_post.pcap
( 1) debug_8793_pre.pcap
( 2) verbosedebug_1_2_14_post_debug_en.txt
( 3) verbosedebug_1_2_14_post.txt
( 4) verbosedebug_1_2_14_pre_debug_en.txt
( 5) verbosedebug_1_2_14_pre.txt
Description:SIP message 420 Bad extension sent out malformed, in case of SIP option
"100rel" is sent as required.
Reply message contains header without body, should be tailed by double CR/LF instead of single CR/LF (0x0d0a)
INVITE sender can't fallback to option not required, so call can't be established.


clone of bug report 0008768 (on asterisk
Comments:By: Tomas Muehlhoff (tmuehlhoff) 2007-01-11 06:24:09.000-0600

This is what I changed in order to get the response message out properly. Compare attached pre- and post-files.

[root@sipsrv2 asterisk-1.2.14]# diff -c  channels/chan_sip.c.original channels/chan_sip.c
*** channels/chan_sip.c.original        2007-01-11 13:19:53.000000000 +0100
--- channels/chan_sip.c 2007-01-11 13:07:14.000000000 +0100
*** 4345,4350 ****
--- 4345,4352 ----
       respprep(&resp, p, msg, req);
       add_header(&resp, "Unsupported", unsupported);
+ /* added due to fault on SIP respone 420 Bad Extension */
+       add_line(&resp,"");
       return send_response(p, &resp, 0, 0);
[root@sipsrv2 asterisk-1.2.14]#

By: Serge Vecher (serge-v) 2007-01-11 09:17:47.000-0600

ok, you've forgotten to enter 'sip debug' as per step 4 ;)

By: Olle Johansson (oej) 2007-01-11 12:11:52.000-0600

Different fix committed to 1.2 svn rev 50517.

Thank you for your detailed bug report!

By: Serge Vecher (serge-v) 2007-01-11 12:16:22.000-0600

Ok, great. Thanks for finding the fix ... Since this is a one-liner the next step is not required, but would be appreciated, especially if you plan on contributing more involved fixes/new features in the future.

1. Could you please get a disclaimer on file (see bottom of http://bugs.digium.com/main_page.php) and confirm with a note here when done?
2. It would be great if you could upload your change as a patch-file. See  http://www.asterisk.org/developers/Patch_Howto

By: Tomas Muehlhoff (tmuehlhoff) 2007-01-12 02:27:59.000-0600

I have no test machine where I can install the SVN whenever I want. Working in a test environment, and in my case the *OTHER* machine is the one under test, I can't change the environment whenever I want, sorry.

Note: Please review the code for more appearances of this fault. I also worry, whether my added line is *really correct*, in my eyes it is just a quick fix that causes the right result in the end. For that reason I don't sign this disclaimer right now, but promise to do so whenever I'll provide more code, which is less likely than just reporting bugs ;)

You would probably need to test the SIP stack with a protocol tester like codenomicon.

By: Serge Vecher (serge-v) 2007-01-12 10:01:42.000-0600


thanks for the heads up, chan_sip is being tested regularly, including at events like SIPit.

the S.O.P here is that once a specific issue is identified, it is fixed and closed. If later tests reveal that the bug has not been fixed, the issue is reopened for inspection.

If you identify new bugs in chan_sip, feel free to open additional reports with debugging information as per instruction in this bug.