[Asterisk-cvs] asterisk/channels chan_mgcp.c,1.67,1.68

markster at lists.digium.com markster at lists.digium.com
Sun Aug 1 17:39:33 CDT 2004


Update of /usr/cvsroot/asterisk/channels
In directory localhost.localdomain:/tmp/cvs-serv26810/channels

Modified Files:
	chan_mgcp.c 
Log Message:
Don't reload subchannels of wild card endpoint on reload.


Index: chan_mgcp.c
===================================================================
RCS file: /usr/cvsroot/asterisk/channels/chan_mgcp.c,v
retrieving revision 1.67
retrieving revision 1.68
diff -u -d -r1.67 -r1.68
--- chan_mgcp.c	1 Aug 2004 18:26:41 -0000	1.67
+++ chan_mgcp.c	1 Aug 2004 21:25:35 -0000	1.68
@@ -3570,29 +3570,29 @@
             		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 */




More information about the svn-commits mailing list