[asterisk-dev] [Code Review] RFC compliant uri and display-nameencode/decode

Nick Lewis Nick.Lewis at atltelecom.com
Wed Jan 27 05:40:45 CST 2010


>The following is a valid From header in name-addr format:
>  From: "Alice \"<sip:123 at domain.org>\" and
>Bob"<sip:alice.bob at domain.net>;tag=1234
>where the display-name is:
>  "Alice \"<sip:123 at domain.org>\" and Bob"
>Would Asterisk parse it correctly with this commit?

Sometimes yes. It depends on the sip method and which part is being got
for what purpose. Where get_in_brackets, parse_uri and get_callerid_name
are used correctly then yes. However for many combinations of sip
method,  header type and part being got the answer is no. 

Also a variation of your example
  From: "Alice \"<sip:123 at domain.org>\" and
Bob"<sip:alice%20and%20bob at domain.net>;tag=1234
shows the importance of the correct use of the uri decode function too


For all these reasons I believe that ast_uri_decode needs to be called
from within parse_uri (for parsing the abnf structure "URI") and there
needs to be a high level function that uses the now working functions in
the correct way to parse the "name-andor-addr" abnf structure (i.e. the
abnf structure for which I have coined the name "name-andor-addr" and
for which the abnf is "name-andor-addr = name-addr / addr-spec").

-- N_L

_____________________________________________________________________
This message has been checked for all known viruses by Star Internet delivered through the MessageLabs Virus Control Centre.
_____________________________________________________________________
Disclaimer of Liability
ATL Telecom Ltd shall not be held liable for any improper or incorrect use of the  information described and/or contained herein and assumes no responsibility for anyones use  of the information. In no event shall ATL Telecom Ltd be liable for any direct, indirect,  incidental, special, exemplary, or consequential damages (including, but not limited to,  procurement or substitute goods or services; loss of use, data, or profits; or business  interruption) however caused and on any theory of liability, whether in contract, strict  liability, or tort (including negligence or otherwise) arising in any way out of the use of  this system, even if advised of the possibility of such damage.

Registered Office: ATL Telecom Ltd, Fountain Lane, St. Mellons Cardiff, CF3 0FB
Registered in Wales Number 4335781

All goods and services supplied by ATL Telecom Ltd are supplied subject to ATL Telecom Ltd standard terms and conditions, available upon request.



More information about the asterisk-dev mailing list