[Asterisk-Users] Problem parsing unusual SIP/SDP

Stewart Nelson sn at scgroup.com
Thu Mar 24 22:43:38 MST 2005


>> I'm running Asterisk at Home (Asterisk 1.0).  Is it possible that this bug
>> has already been fixed in a later version (I can't find anything that
>> seems relevant at bugs.digium.com)?

> This issue (multiple c= lines) has already been fixed in CVS HEAD (if 
> 'pedantic' SIP parsing is enabled), but the fix was not backported to 
> the stable branch.

Kevin, many thanks for the advice.  The good news is that I got it to
work!  However, there is quite a bit of bad news:

First, there seems to be something about Asterisk at Home that is
incompatible with CVS.  After I did the checkout, there were errors
at install time, resulting from an out-of-date sounds.txt file.
Deleting the file and rerunning CVS resulted in the same wrong version.
I manually retrieved the latest sounds.txt, and the install ran ok,
but there were other old files, including the chan_sip.c that I needed.
So, I deleted the zaptel, libpri and asterisk directories, and ran CVS
from scratch.  Asterisk now built ok, and ran with no obvious problems.

However, when I set pedantic=yes, I can't call out at all via the
provider, though I can still call from one SIP extension to another.
It appears that the 183 Progress is not being "seen" by Asterisk,
because the "SIP/provider-xxxx is making progress passing it ..."
message does not appear, and the provider keeps retransmitting the 183.
Unfortunately, nothing in the log looks like an error report, and I
don't know how to debug this further.

So, I left out the pedantic=yes, and in chan_sip.c where it says
 /* Check for Media-description-level-address for audio */
I patched:
 if (pedanticsipchecking) {
to:
 if (1) {
and it now works fine with this provider.

> You are welcome to enter a bug in the Mantis bugtracker to request that 
> the same fix be put into the stable branch, but there may be some 
> opposition since that would potentially change existing behavior there.

I doubt that this fix would "break" any SDP from another device, because
RFC 2327 clearly states that a media-level c= should override a
session-level c=, and e.g. the ATA 186 follows that rule.
However, the code calls ast_gethostbyname to get the IP, with comment:
/* XXX This could block for a long time, and block the main thread! XXX */
so maybe it's not a good idea to have it on by default (in typical cases,
though, the IP would be numeric and there would be no blocking).

And, the fix would do me no good, unless the problem with pedantic=yes
also gets found and fixed somehow.

How should I proceed?  IMO, this provider offers an excellent combination
of price, reliability, quality, and support, and I believe that many in
Asterisk community would want to use them.  AFAICT, their SIP/SDP does
not actually violate any RFCs.

[I have not identified them, because they are not a BYOD company,
although their TOS does not prohibit alternative interface devices.
I want to get their permission first, but would like to approach them
with "Your system works great with Asterisk ..."]

Thanks,

Stewart




More information about the asterisk-users mailing list