From fbe6024753fb0e4852563602acdce440b2f9f836 Mon Sep 17 00:00:00 2001 From: Mark Spencer Date: Sun, 1 Aug 2004 03:59:13 +0000 Subject: [PATCH] Fix reload with wildcard endpoint git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3559 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- channels/chan_mgcp.c | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/channels/chan_mgcp.c b/channels/chan_mgcp.c index 50f873a956..d0d22ed4c3 100755 --- a/channels/chan_mgcp.c +++ b/channels/chan_mgcp.c @@ -3592,17 +3592,19 @@ static struct mgcp_gateway *build_gateway(char *cat, struct ast_variable *v) return NULL; } } - /* Make out subs a circular linked list so we can always sping through the whole bunch */ - sub = e->sub; - /* find the end of the list */ - while(sub->next){ - sub = sub->next; - } - /* set the last sub->next to the first sub */ - sub->next = e->sub; + if (!ep_reload) { + /* Make out subs a circular linked list so we can always sping through the whole bunch */ + sub = e->sub; + /* find the end of the list */ + while(sub->next){ + sub = sub->next; + } + /* set the last sub->next to the first sub */ + sub->next = e->sub; - e->next = gw->endpoints; - gw->endpoints = e; + e->next = gw->endpoints; + gw->endpoints = e; + } } } else if (!strcasecmp(v->name, "trunk") || !strcasecmp(v->name, "line")) {