[asterisk-bugs] [JIRA] (ASTERISK-24500) Regression introduced in chan_mgcp by SVN revision r227276

Rusty Newton (JIRA) noreply at issues.asterisk.org
Wed Nov 5 16:56:29 CST 2014


     [ https://issues.asterisk.org/jira/browse/ASTERISK-24500?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Rusty Newton updated ASTERISK-24500:
------------------------------------

    Assignee: Xavier Hienne
      Status: Waiting for Feedback  (was: Triage)

Xavier would you like to provide a patch and testing notes?  Since chan_mgcp is extended support (supported by the broader community) and not used by many it'll have a greater chance of getting fixed if you can assist.

See the [Patch Contribution Process|https://wiki.asterisk.org/wiki/display/AST/Patch+Contribution+Process] if you are interested!

> Regression introduced in chan_mgcp by SVN revision r227276
> ----------------------------------------------------------
>
>                 Key: ASTERISK-24500
>                 URL: https://issues.asterisk.org/jira/browse/ASTERISK-24500
>             Project: Asterisk
>          Issue Type: Bug
>      Security Level: None
>          Components: Channels/chan_mgcp
>    Affects Versions: SVN, 1.8.32.0, 11.14.0, 12.6.1, 13.0.0
>            Reporter: Xavier Hienne
>            Assignee: Xavier Hienne
>
> In SVN revision r227276, a while() loop was turned into a for() loop.
> {code}
> @@ -1804,14 +1737,12 @@
>         if (at && (at[0] == '[')) {
>                 at++;
>                 c = strrchr(at, ']');
> -               if (c)
> +               if (c) {
>                         *c = '\0';
> +               }
>         }
> -       g = gateways;
> -       if(!g)
> -               g = find_realtime_gw(name, at, sin);
> -       while(g) {
> -               if ((!name || !strcasecmp(g->name, at)) && 
> +       for (g = gateways ? gateways : find_realtime_gw(name, at, sin); g; g = g->next ? g->next : find_realtime_gw(name, at, sin)) {
> +               if ((!name || !strcasecmp(g->name, at)) &&
> {code}
> Following this, parts of the code like the chunk below were removed since it's now done in the for() line:
> {code}
> @@ -1841,48 +1770,21 @@
>                                         continue;
>                                 }
>                         } else {
> -                               if(!g->next)
> -                                       g = find_realtime_gw(name, at, sin);
> -                               else
> -                                       g = g->next;
>                                 continue;
>                         }
> {code}
> The problem is that one such code chunk was forgotten and is still here in the "else if (!name && sin)" block, duplicating what is already done in the for() line.
> The end result is that instead of going through the linked list of MGCP gateways one by one, when a static unnamed MGCP GW is encountered in the list, the next GW is skipped.



--
This message was sent by Atlassian JIRA
(v6.2#6252)



More information about the asterisk-bugs mailing list