Don't use dynamic mode when scanning all gateways
authorMark Spencer <markster@digium.com>
Fri, 5 Dec 2003 16:50:30 +0000 (16:50 +0000)
committerMark Spencer <markster@digium.com>
Fri, 5 Dec 2003 16:50:30 +0000 (16:50 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@1831 65c4cc65-6c06-0410-ace0-fbb531ad65f3

channels/chan_mgcp.c

index 5871d04..f55141e 100755 (executable)
@@ -1048,7 +1048,7 @@ static struct mgcp_subchannel *find_subchannel(char *name, int msgid, struct soc
                if ((!name || !strcasecmp(g->name, at)) && 
                    (sin || g->addr.sin_addr.s_addr || g->defaddr.sin_addr.s_addr)) {
                        /* Found the gateway.  If it's dynamic, save it's address -- now for the endpoint */
-                       if (sin && g->dynamic) {
+                       if (sin && g->dynamic && name) {
                                if ((g->addr.sin_addr.s_addr != sin->sin_addr.s_addr) ||
                                        (g->addr.sin_port != sin->sin_port)) {
                                        memcpy(&g->addr, sin, sizeof(g->addr));