[Asterisk-Dev] ast_callerid_parse

Kevin P. Fleming kpfleming at digium.com
Thu Dec 29 12:40:21 MST 2005


Brian Capouch wrote:

> I don't know whether the problem is in the ast_ stuff or in the SIP 
> channel driver, but it's a major PIA, that's for sure.  Even if the SPA 
> is sending something in a mangled fashion, it would seem best to just 
> ignore the CID info and proceed with the call. . . .

SIP uses RFC-2822 standard headers. RFC-2822 standard headers have very 
well understood rules for quoting. A header (in this case From:) that 
does not follow those rules for quoting is broken and cannot be used. 
The same thing would be true if your mail client generated improperly 
quoted From: headers and you sent that message to a mail server; it 
would fail to be processed (possibly in a spectacular fashion, depending 
on the mail server).

The example you posted showed a From: header with an unterminated quoted 
string; exactly how do we find where that string was supposed to end, 
since all characters except double-quotes are fair game to be used 
inside the quoted string? Do we just guess where it was supposed to end? 
If we guess wrong and the call is not handled properly is that really 
better than rejecting it outright? This information is _not_ strictly 
caller ID; it's the From: header and contains other bits of information 
that are necessary to handling the call in some cases, so it cannot just 
be 'ignored'.



More information about the asterisk-dev mailing list