[asterisk-dev] mmichelson: branch 1.2 r620 - in /branches/1.2/asterisk-ooh323c: ooh323c/src/...

Tony Mountifield tony at softins.clara.co.uk
Wed Jun 4 16:44:35 CDT 2008


In article <E1K3wHH-0005CF-Lm at lists.digium.com>,
SVN commits to the Digium repositories <svn-commits at lists.digium.com> wrote:
> Author: mmichelson
> Date: Wed Jun  4 11:55:58 2008
> New Revision: 620
> 
> URL: http://svn.digium.com/view/asterisk-addons?view=rev&rev=620
> Log:
> A few changes:
> 
> [...]
> 2. (1.2 only) There was a char * being used before being set. This was causing an almost
>    immediate crash when ooh323 would load. This commit fixes that issue.

Please see below...

> [...]
> Modified: branches/1.2/asterisk-ooh323c/src/chan_h323.c
> URL:
> http://svn.digium.com/view/asterisk-addons/branches/1.2/asterisk-ooh323c/src/chan_h323.c?view=diff&rev=620&r1=619&r2=620
> ==============================================================================
> --- branches/1.2/asterisk-ooh323c/src/chan_h323.c (original)
> +++ branches/1.2/asterisk-ooh323c/src/chan_h323.c Wed Jun  4 11:55:58 2008
> @@ -1887,8 +1887,12 @@
>     ooconfig.mTCPPortStart = 12030;
>     ooconfig.mTCPPortEnd = 12230;
>  
> +   ast_log(LOG_NOTICE, "Check 1\n");
> +
>     v = ast_variable_browse(cfg, "general");
>     while(v) {
> +
> +	   ast_log(LOG_NOTICE, "v is %s\n", v->name);
>     
>        if (!strcasecmp(v->name, "port")) {
>           gPort = (int)strtol(v->value, NULL, 10);
> @@ -2046,6 +2050,7 @@
>           ast_parse_allow_disallow(&gPrefs, &gCapability, tcodecs, 1);
>        }
>        else if (!strcasecmp(v->name, "dtmfmode")) {
> +		  ast_log(LOG_NOTICE, "v's value is %s\n", v->value);
>           if (!strcasecmp(v->value, "inband"))
>              gDTMFMode=H323_DTMF_INBAND;
>           else if (!strcasecmp(v->value, "rfc2833"))

Are the above changes left-over debugging statements?

> @@ -2070,8 +2075,9 @@
>     {
>        if(strcasecmp(cat, "general")) 
>        {
> -         int friend_type = strcasecmp(utype, "friend");
> +         int friend_type;
>           utype = ast_variable_retrieve(cfg, cat, "type");
> +		 friend_type = strcasecmp(utype, "friend");
>           if(utype)
>           {
>              if(!strcmp(utype, "user") || 0 == friend_type)

It's good to see this bug fixed in 1.2, as I also found it myself recently,
but the strcasecmp with utype should really go inside the if(utype){ },
else a missing type= line would still crash Asterisk.

1.4 and later are already correct in this respect.

Cheers
Tony
-- 
Tony Mountifield
Work: tony at softins.co.uk - http://www.softins.co.uk
Play: tony at mountifield.org - http://tony.mountifield.org



More information about the asterisk-dev mailing list