diff options
author | markster <markster@f38db490-d61c-443f-a65b-d21fe96a405b> | 2004-08-01 21:25:35 +0000 |
---|---|---|
committer | markster <markster@f38db490-d61c-443f-a65b-d21fe96a405b> | 2004-08-01 21:25:35 +0000 |
commit | d96b7e454b949252955775613ed8622d1078f355 (patch) | |
tree | 3e2bba6f3385489f7f6ed56912f552a0a8d8e386 /channels/chan_mgcp.c | |
parent | 71e6f3bccfef5de2c6bd914f44850441458a482d (diff) |
Don't reload subchannels of wild card endpoint on reload.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@3566 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels/chan_mgcp.c')
-rwxr-xr-x | channels/chan_mgcp.c | 44 |
1 files changed, 22 insertions, 22 deletions
diff --git a/channels/chan_mgcp.c b/channels/chan_mgcp.c index 4073a7e6d..295328e3a 100755 --- a/channels/chan_mgcp.c +++ b/channels/chan_mgcp.c @@ -3570,29 +3570,29 @@ static struct mgcp_gateway *build_gateway(char *cat, struct ast_variable *v) e->onhooktime = time(NULL); /* ASSUME we're onhook */ e->hookstate = MGCP_ONHOOK; - /*snprintf(txident, sizeof(txident), "%08x", rand());*/ - for (i = 0; i < MAX_SUBS; i++) { - sub = malloc(sizeof(struct mgcp_subchannel)); - if (sub) { - ast_verbose(VERBOSE_PREFIX_3 "Allocating subchannel '%d' on %s@%s\n", i, e->name, gw->name); - memset(sub, 0, sizeof(struct mgcp_subchannel)); - ast_mutex_init(&sub->lock); - ast_mutex_init(&sub->cx_queue_lock); - sub->parent = e; - sub->id = i; - snprintf(sub->txident, sizeof(sub->txident), "%08x", rand()); - /*stnrcpy(sub->txident, txident, sizeof(sub->txident) - 1);*/ - sub->cxmode = MGCP_CX_INACTIVE; - sub->nat = nat; - sub->next = e->sub; - e->sub = sub; - } else { - /* XXX Should find a way to clean up our memory */ - ast_log(LOG_WARNING, "Out of memory allocating subchannel"); - return NULL; - } - } if (!ep_reload) { + /*snprintf(txident, sizeof(txident), "%08x", rand());*/ + for (i = 0; i < MAX_SUBS; i++) { + sub = malloc(sizeof(struct mgcp_subchannel)); + if (sub) { + ast_verbose(VERBOSE_PREFIX_3 "Allocating subchannel '%d' on %s@%s\n", i, e->name, gw->name); + memset(sub, 0, sizeof(struct mgcp_subchannel)); + ast_mutex_init(&sub->lock); + ast_mutex_init(&sub->cx_queue_lock); + sub->parent = e; + sub->id = i; + snprintf(sub->txident, sizeof(sub->txident), "%08x", rand()); + /*stnrcpy(sub->txident, txident, sizeof(sub->txident) - 1);*/ + sub->cxmode = MGCP_CX_INACTIVE; + sub->nat = nat; + sub->next = e->sub; + e->sub = sub; + } else { + /* XXX Should find a way to clean up our memory */ + ast_log(LOG_WARNING, "Out of memory allocating subchannel"); + 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 */ |