[Home]

Summary:ASTERISK-00573: enum.c misparses E2U+IAX2
Reporter:ww (ww)Labels:
Date Opened:2003-11-25 21:29:50.000-0600Date Closed:2004-09-25 02:49:15
Priority:MajorRegression?No
Status:Closed/CompleteComponents:Core/General
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:( 0) enum.c.3.diff
( 1) enum.c.diff
Description:Where enum service is specified per RFC2916bis
as E2U+<tech> rather than <tech>+E2U, enum.c
matches E2U+IAX2 as E2U+IAX and incorrectly determines
the technology to use to be IAX. Solution is to try
to match for IAX2 first as in the attached patch

****** ADDITIONAL INFORMATION ******

This patch fixes it

Index: enum.c
===================================================================
RCS file: /usr/cvsroot/asterisk/enum.c,v
retrieving revision 1.13
diff -u -r1.13 enum.c
--- enum.c      8 Nov 2003 23:06:59 -0000       1.13
+++ enum.c      26 Nov 2003 03:52:14 -0000
@@ -125,12 +125,12 @@
       } else if ((!strncasecmp(services, "e2u+h323", 8)) ||
           (!strncasecmp(services, "h323+e2u", 8))) {
               strncpy(tech, "h323", techsize -1);
-       } else if ((!strncasecmp(services, "e2u+iax", 7)) ||
-           (!strncasecmp(services, "iax+e2u", 7))) {
-               strncpy(tech, "iax", techsize -1);
       } else if ((!strncasecmp(services, "e2u+iax2", 8)) ||
           (!strncasecmp(services, "iax2+e2u", 8))) {
               strncpy(tech, "iax2", techsize -1);
+       } else if ((!strncasecmp(services, "e2u+iax", 7)) ||
+           (!strncasecmp(services, "iax+e2u", 7))) {
+               strncpy(tech, "iax", techsize -1);
       } else if ((!strncasecmp(services, "e2u+tel", 7)) ||
           (!strncasecmp(services, "tel+e2u", 7))) {
               strncpy(tech, "tel", techsize -1);
Comments:By: ww (ww) 2003-11-25 21:36:28.000-0600

Patch updated to address using X-IAX2 and X-IAX per
RFC2916bis and Lawrence Conroy's suggestion on the list
as well as parsing bug.

The new patch is attached

By: ww (ww) 2003-11-26 12:45:56.000-0600

Ok. try again. my bad. The last patch was incorrect.
Here we are done proberly: enum.c.3.diff preserves
backwards compatibility and counts the length of the
static strings properly. And, for fixing the original
bug, considers iax2 before iax.

By: Brian West (bkw918) 2003-11-26 12:56:31.000-0600

applied to CVS.