[asterisk-commits] branch oej/moduletest r9289 - in /team/oej/moduletest: ./ apps/ cdr/ channels...

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Thu Feb 9 07:58:27 MST 2006


Author: oej
Date: Thu Feb  9 08:58:18 2006
New Revision: 9289

URL: http://svn.digium.com/view/asterisk?rev=9289&view=rev
Log:

Up to date and ready for automerge

Modified:
    team/oej/moduletest/   (props changed)
    team/oej/moduletest/Makefile
    team/oej/moduletest/apps/Makefile
    team/oej/moduletest/apps/app_macro.c
    team/oej/moduletest/cdr/Makefile
    team/oej/moduletest/channels/chan_iax2.c
    team/oej/moduletest/channels/chan_oss.c
    team/oej/moduletest/channels/chan_zap.c
    team/oej/moduletest/logger.c
    team/oej/moduletest/res/res_odbc.c

Propchange: team/oej/moduletest/
------------------------------------------------------------------------------
    automerge = go-man-go

Propchange: team/oej/moduletest/
------------------------------------------------------------------------------
    automerge-email = oej at edvina.net

Propchange: team/oej/moduletest/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Thu Feb  9 08:58:18 2006
@@ -1,1 +1,1 @@
-/branches/1.2:1-7496,7498-8893
+/branches/1.2:1-7496,7498-9288

Modified: team/oej/moduletest/Makefile
URL: http://svn.digium.com/view/asterisk/team/oej/moduletest/Makefile?rev=9289&r1=9288&r2=9289&view=diff
==============================================================================
--- team/oej/moduletest/Makefile (original)
+++ team/oej/moduletest/Makefile Thu Feb  9 08:58:18 2006
@@ -328,8 +328,6 @@
   ifneq ($(wildcard .svn),)
     ASTERISKVERSIONNUM=999999
     ASTERISKVERSION=SVN-$(shell build_tools/make_svn_branch_name)
-  else
-    ASTERISKVERSIONNUM=000000
   endif
 endif
 

Modified: team/oej/moduletest/apps/Makefile
URL: http://svn.digium.com/view/asterisk/team/oej/moduletest/apps/Makefile?rev=9289&r1=9288&r2=9289&view=diff
==============================================================================
--- team/oej/moduletest/apps/Makefile (original)
+++ team/oej/moduletest/apps/Makefile Thu Feb  9 08:58:18 2006
@@ -98,7 +98,7 @@
 	$(CC) $(SOLINK) -o $@ ${CYGSOLINK} $< ${CYGSOLIB} $(CURLLIBS)
 
 app_sql_postgres.o: app_sql_postgres.c
-	$(CC) -pipe -I/usr/local/pgsql/include $(CFLAGS) -c -o app_sql_postgres.o app_sql_postgres.c
+	$(CC) -pipe -I$(CROSS_COMPILE_TARGET)/usr/local/pgsql/include -I$(CROSS_COMPILE_TARGET)/usr/include/postgresql $(CFLAGS) -c -o app_sql_postgres.o app_sql_postgres.c
 
 app_sql_postgres.so: app_sql_postgres.o
 	$(CC) $(SOLINK) -o $@ ${CYGSOLINK} $< ${CYGSOLIB} -L/usr/local/pgsql/lib -lpq

Modified: team/oej/moduletest/apps/app_macro.c
URL: http://svn.digium.com/view/asterisk/team/oej/moduletest/apps/app_macro.c?rev=9289&r1=9288&r2=9289&view=diff
==============================================================================
--- team/oej/moduletest/apps/app_macro.c (original)
+++ team/oej/moduletest/apps/app_macro.c Thu Feb  9 08:58:18 2006
@@ -110,7 +110,7 @@
 	char oldcontext[AST_MAX_CONTEXT] = "";
 	int offset, depth = 0;
 	int setmacrocontext=0;
-	int autoloopflag;
+	int autoloopflag, dead = 0;
   
 	char *save_macro_exten;
 	char *save_macro_context;
@@ -211,8 +211,8 @@
 				break;
 			}
 			switch(res) {
-	        	case MACRO_EXIT_RESULT:
-                        	res = 0;
+			case MACRO_EXIT_RESULT:
+				res = 0;
 				goto out;
 			case AST_PBX_KEEPALIVE:
 				if (option_debug)
@@ -226,6 +226,7 @@
 					ast_log(LOG_DEBUG, "Spawn extension (%s,%s,%d) exited non-zero on '%s' in macro '%s'\n", chan->context, chan->exten, chan->priority, chan->name, macro);
 				else if (option_verbose > 1)
 					ast_verbose( VERBOSE_PREFIX_2 "Spawn extension (%s, %s, %d) exited non-zero on '%s' in macro '%s'\n", chan->context, chan->exten, chan->priority, chan->name, macro);
+				dead = 1;
 				goto out;
 			}
 		}
@@ -245,37 +246,44 @@
 	out:
 	/* Reset the depth back to what it was when the routine was entered (like if we called Macro recursively) */
 	snprintf(depthc, sizeof(depthc), "%d", depth);
-	pbx_builtin_setvar_helper(chan, "MACRO_DEPTH", depthc);
-
-	ast_set2_flag(chan, autoloopflag, AST_FLAG_IN_AUTOLOOP);
-  	for (x=1; x<argc; x++) {
+	if (!dead) {
+		pbx_builtin_setvar_helper(chan, "MACRO_DEPTH", depthc);
+
+		ast_set2_flag(chan, autoloopflag, AST_FLAG_IN_AUTOLOOP);
+	}
+
+  	for (x = 1; x < argc; x++) {
   		/* Restore old arguments and delete ours */
 		snprintf(varname, sizeof(varname), "ARG%d", x);
   		if (oldargs[x]) {
-			pbx_builtin_setvar_helper(chan, varname, oldargs[x]);
+			if (!dead)
+				pbx_builtin_setvar_helper(chan, varname, oldargs[x]);
 			free(oldargs[x]);
-		} else {
+		} else if (!dead) {
 			pbx_builtin_setvar_helper(chan, varname, NULL);
 		}
   	}
 
 	/* Restore macro variables */
-	pbx_builtin_setvar_helper(chan, "MACRO_EXTEN", save_macro_exten);
+	if (!dead) {
+		pbx_builtin_setvar_helper(chan, "MACRO_EXTEN", save_macro_exten);
+		pbx_builtin_setvar_helper(chan, "MACRO_CONTEXT", save_macro_context);
+		pbx_builtin_setvar_helper(chan, "MACRO_PRIORITY", save_macro_priority);
+	}
 	if (save_macro_exten)
 		free(save_macro_exten);
-	pbx_builtin_setvar_helper(chan, "MACRO_CONTEXT", save_macro_context);
 	if (save_macro_context)
 		free(save_macro_context);
-	pbx_builtin_setvar_helper(chan, "MACRO_PRIORITY", save_macro_priority);
 	if (save_macro_priority)
 		free(save_macro_priority);
-	if (setmacrocontext) {
+
+	if (!dead && setmacrocontext) {
 		chan->macrocontext[0] = '\0';
 		chan->macroexten[0] = '\0';
 		chan->macropriority = 0;
 	}
 
-	if (!strcasecmp(chan->context, fullmacro)) {
+	if (!dead && !strcasecmp(chan->context, fullmacro)) {
   		/* If we're leaving the macro normally, restore original information */
 		chan->priority = oldpriority;
 		ast_copy_string(chan->context, oldcontext, sizeof(chan->context));
@@ -295,7 +303,8 @@
 		}
 	}
 
-	pbx_builtin_setvar_helper(chan, "MACRO_OFFSET", save_macro_offset);
+	if (!dead)
+		pbx_builtin_setvar_helper(chan, "MACRO_OFFSET", save_macro_offset);
 	if (save_macro_offset)
 		free(save_macro_offset);
 	LOCAL_USER_REMOVE(u);

Modified: team/oej/moduletest/cdr/Makefile
URL: http://svn.digium.com/view/asterisk/team/oej/moduletest/cdr/Makefile?rev=9289&r1=9288&r2=9289&view=diff
==============================================================================
--- team/oej/moduletest/cdr/Makefile (original)
+++ team/oej/moduletest/cdr/Makefile Thu Feb  9 08:58:18 2006
@@ -45,11 +45,11 @@
 #
 # FreeTDS stuff...
 #
-ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/include/tds.h)$(wildcard $(CROSS_COMPILE_TARGET)/usr/local/include/tds.h),)
-  ifeq ($(shell grep -s TDS_VERSION_NO $(CROSS_COMPILE_TARGET)/usr/include/tdsver.h $(CROSS_COMPILE_TARGET)/usr/local/include/tdsver.h | grep -c 0.63),1)
+ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/include/tds.h)$(wildcard $(CROSS_COMPILE_TARGET)/usr/local/include/tds.h)$(wildcard $(CROSS_COMPILE_TARGET)/usr/include/freetds/tds.h),)
+  ifeq ($(shell grep -s TDS_VERSION_NO $(CROSS_COMPILE_TARGET)/usr/include/tdsver.h $(CROSS_COMPILE_TARGET)/usr/local/include/tdsver.h $(CROSS_COMPILE_TARGET)/usr/include/freetds/tdsver.h | grep -c 0.63),1)
     CFLAGS += -DFREETDS_0_63
   else
-	ifeq ($(shell grep -s TDS_VERSION_NO $(CROSS_COMPILE_TARGET)/usr/include/tdsver.h $(CROSS_COMPILE_TARGET)/usr/local/include/tdsver.h | grep -c 0.62),1)
+	ifeq ($(shell grep -s TDS_VERSION_NO $(CROSS_COMPILE_TARGET)/usr/include/tdsver.h $(CROSS_COMPILE_TARGET)/usr/local/include/tdsver.h $(CROSS_COMPILE_TARGET)/usr/include/freetds/tdsver.h | grep -c 0.62),1)
       CFLAGS += -DFREETDS_0_62
     else
       CFLAGS += -DFREETDS_PRE_0_62

Modified: team/oej/moduletest/channels/chan_iax2.c
URL: http://svn.digium.com/view/asterisk/team/oej/moduletest/channels/chan_iax2.c?rev=9289&r1=9288&r2=9289&view=diff
==============================================================================
--- team/oej/moduletest/channels/chan_iax2.c (original)
+++ team/oej/moduletest/channels/chan_iax2.c Thu Feb  9 08:58:18 2006
@@ -8151,6 +8151,7 @@
 		peer->pokefreqok = DEFAULT_FREQ_OK;
 		peer->pokefreqnotok = DEFAULT_FREQ_NOTOK;
 		peer->context[0] = '\0';
+		peer->peercontext[0] = '\0';
 		while(v) {
 			if (!strcasecmp(v->name, "secret")) {
 				if (!ast_strlen_zero(peer->secret)) {

Modified: team/oej/moduletest/channels/chan_oss.c
URL: http://svn.digium.com/view/asterisk/team/oej/moduletest/channels/chan_oss.c?rev=9289&r1=9288&r2=9289&view=diff
==============================================================================
--- team/oej/moduletest/channels/chan_oss.c (original)
+++ team/oej/moduletest/channels/chan_oss.c Thu Feb  9 08:58:18 2006
@@ -1392,6 +1392,9 @@
 			store_config(cfg, ctg);
 		} while ( (ctg = ast_category_browse(cfg, ctg)) != NULL);
 		ast_config_destroy(cfg);
+	} else {
+		 ast_log(LOG_NOTICE, "Unable to load config oss.conf\n");
+		 return -1;
 	}
 	if (find_desc(oss_active) == NULL) {
 		ast_log(LOG_NOTICE, "Device %s not found\n", oss_active);

Modified: team/oej/moduletest/channels/chan_zap.c
URL: http://svn.digium.com/view/asterisk/team/oej/moduletest/channels/chan_zap.c?rev=9289&r1=9288&r2=9289&view=diff
==============================================================================
--- team/oej/moduletest/channels/chan_zap.c (original)
+++ team/oej/moduletest/channels/chan_zap.c Thu Feb  9 08:58:18 2006
@@ -106,6 +106,9 @@
 #define ZT_EVENT_DTMFDOWN 0
 #define ZT_EVENT_DTMFUP 0
 #endif
+
+/* define this to send PRI user-user information elements */
+#undef SUPPORT_USERUSER
 
 /*! 
  * \note Define ZHONE_HACK to cause us to go off hook and then back on hook when
@@ -2004,7 +2007,9 @@
 #ifdef ZAPATA_PRI
 	if (p->pri) {
 		struct pri_sr *sr;
-		const char *useruser;
+#ifdef SUPPORT_USERUSER
+		char *useruser;
+#endif
 		int pridialplan;
 		int dp_strip;
 		int prilocaldialplan;
@@ -2118,11 +2123,14 @@
 					l ? (p->use_callingpres ? ast->cid.cid_pres : PRES_ALLOWED_USER_NUMBER_PASSED_SCREEN) : 
 						 PRES_NUMBER_NOT_AVAILABLE);
 		pri_sr_set_redirecting(sr, ast->cid.cid_rdnis, p->pri->localdialplan - 1, PRES_ALLOWED_USER_NUMBER_PASSED_SCREEN, PRI_REDIR_UNCONDITIONAL);
+
+#ifdef SUPPORT_USERUSER
 		/* User-user info */
 		useruser = pbx_builtin_getvar_helper(p->owner, "USERUSERINFO");
 
 		if (useruser)
 			pri_sr_set_useruser(sr, useruser);
+#endif
 
 		if (pri_setup(p->pri->pri, p->call,  sr)) {
  			ast_log(LOG_WARNING, "Unable to setup call to %s (using %s)\n", 
@@ -2510,13 +2518,20 @@
 		/* Perform low level hangup if no owner left */
 #ifdef ZAPATA_PRI
 		if (p->pri) {
-			const char *useruser = pbx_builtin_getvar_helper(ast,"USERUSERINFO");
+#ifdef SUPPORT_USERUSER
+			char *useruser = pbx_builtin_getvar_helper(ast,"USERUSERINFO");
+#endif
+
 			/* Make sure we have a call (or REALLY have a call in the case of a PRI) */
 			if (p->call && (!p->bearer || (p->bearer->call == p->call))) {
 				if (!pri_grab(p, p->pri)) {
 					if (p->alreadyhungup) {
 						ast_log(LOG_DEBUG, "Already hungup...  Calling hangup once, and clearing call\n");
+
+#ifdef SUPPORT_USERUSER
 						pri_call_set_useruser(p->call, useruser);
+#endif
+
 						pri_hangup(p->pri->pri, p->call, -1);
 						p->call = NULL;
 						if (p->bearer) 
@@ -2525,7 +2540,11 @@
 						const char *cause = pbx_builtin_getvar_helper(ast,"PRI_CAUSE");
 						int icause = ast->hangupcause ? ast->hangupcause : -1;
 						ast_log(LOG_DEBUG, "Not yet hungup...  Calling hangup once with icause, and clearing call\n");
+
+#ifdef SUPPORT_USERUSER
 						pri_call_set_useruser(p->call, useruser);
+#endif
+
 						p->alreadyhungup = 1;
 						if (p->bearer)
 							p->bearer->alreadyhungup = 1;
@@ -8555,9 +8574,13 @@
 								snprintf(ani2str, 5, "%.2d", e->ring.ani2);
 								pbx_builtin_setvar_helper(c, "ANI2", ani2str);
 							}
+
+#ifdef SUPPORT_USERUSER
 							if (!ast_strlen_zero(e->ring.useruserinfo)) {
 								pbx_builtin_setvar_helper(c, "USERUSERINFO", e->ring.useruserinfo);
 							}
+#endif
+
 							snprintf(calledtonstr, sizeof(calledtonstr)-1, "%d", e->ring.calledplan);
 							pbx_builtin_setvar_helper(c, "CALLEDTON", calledtonstr);
 							if (e->ring.redirectingreason >= 0)
@@ -8590,9 +8613,13 @@
 									snprintf(ani2str, 5, "%d", e->ring.ani2);
 									pbx_builtin_setvar_helper(c, "ANI2", ani2str);
 								}
+
+#ifdef SUPPORT_USERUSER
 								if (!ast_strlen_zero(e->ring.useruserinfo)) {
 									pbx_builtin_setvar_helper(c, "USERUSERINFO", e->ring.useruserinfo);
 								}
+#endif
+
 								if (e->ring.redirectingreason >= 0)
 									pbx_builtin_setvar_helper(c, "PRIREDIRECTREASON", redirectingreason2str(e->ring.redirectingreason));
 							
@@ -8658,9 +8685,13 @@
 								pri->pvts[chanpos]->dsp_features = 0;
 							}
 						}
+
+#ifdef SUPPORT_USERUSER
 						if (!ast_strlen_zero(e->ringing.useruserinfo)) {
 							pbx_builtin_setvar_helper(pri->pvts[chanpos]->owner, "USERUSERINFO", e->ringing.useruserinfo);
 						}
+#endif
+
 						ast_mutex_unlock(&pri->pvts[chanpos]->lock);
 					}
 				}
@@ -8815,9 +8846,13 @@
 							/* Enable echo cancellation if it's not on already */
 							zt_enable_ec(pri->pvts[chanpos]);
 						}
+
+#ifdef SUPPORT_USERUSER
 						if (!ast_strlen_zero(e->answer.useruserinfo)) {
 							pbx_builtin_setvar_helper(pri->pvts[chanpos]->owner, "USERUSERINFO", e->answer.useruserinfo);
 						}
+#endif
+
 						ast_mutex_unlock(&pri->pvts[chanpos]->lock);
 					}
 				}
@@ -8875,9 +8910,13 @@
 							if (option_verbose > 2)
 								ast_verbose(VERBOSE_PREFIX_3 "Channel %d/%d, span %d received AOC-E charging %d unit%s\n",
 									pri->pvts[chanpos]->logicalspan, pri->pvts[chanpos]->prioffset, pri->span, (int)e->hangup.aoc_units, (e->hangup.aoc_units == 1) ? "" : "s");
+
+#ifdef SUPPORT_USERUSER
 						if (!ast_strlen_zero(e->hangup.useruserinfo)) {
 							pbx_builtin_setvar_helper(pri->pvts[chanpos]->owner, "USERUSERINFO", e->hangup.useruserinfo);
 						}
+#endif
+
 						ast_mutex_unlock(&pri->pvts[chanpos]->lock);
 					} else {
 						ast_log(LOG_WARNING, "Hangup on bad channel %d/%d on span %d\n", 
@@ -8935,9 +8974,13 @@
 							pri_reset(pri->pri, PVT_TO_CHANNEL(pri->pvts[chanpos]));
 							pri->pvts[chanpos]->resetting = 1;
 						}
+
+#ifdef SUPPORT_USERUSER
 						if (!ast_strlen_zero(e->hangup.useruserinfo)) {
 							pbx_builtin_setvar_helper(pri->pvts[chanpos]->owner, "USERUSERINFO", e->hangup.useruserinfo);
 						}
+#endif
+
 						ast_mutex_unlock(&pri->pvts[chanpos]->lock);
 					} else {
 						ast_log(LOG_WARNING, "Hangup REQ on bad channel %d/%d on span %d\n", PRI_SPAN(e->hangup.channel), PRI_CHANNEL(e->hangup.channel), pri->span);
@@ -8961,9 +9004,13 @@
 							if (option_verbose > 2) 
 								ast_verbose(VERBOSE_PREFIX_3 "Channel %d/%d, span %d got hangup ACK\n", PRI_SPAN(e->hangup.channel), PRI_CHANNEL(e->hangup.channel), pri->span);
 						}
+
+#ifdef SUPPORT_USERUSER
 						if (!ast_strlen_zero(e->hangup.useruserinfo)) {
 							pbx_builtin_setvar_helper(pri->pvts[chanpos]->owner, "USERUSERINFO", e->hangup.useruserinfo);
 						}
+#endif
+
 						ast_mutex_unlock(&pri->pvts[chanpos]->lock);
 					}
 				}

Modified: team/oej/moduletest/logger.c
URL: http://svn.digium.com/view/asterisk/team/oej/moduletest/logger.c?rev=9289&r1=9288&r2=9289&view=diff
==============================================================================
--- team/oej/moduletest/logger.c (original)
+++ team/oej/moduletest/logger.c Thu Feb  9 08:58:18 2006
@@ -309,9 +309,18 @@
 	
 	cfg = ast_config_load("logger.conf");
 	
-	/* If no config file, we're fine */
-	if (!cfg)
+	/* If no config file, we're fine, set default options. */
+	if (!cfg) {
+		fprintf(stderr, "Unable to open logger.conf: %s\n", strerror(errno));
+		chan = malloc(sizeof(struct logchannel));
+		memset(chan, 0, sizeof(struct logchannel));
+		chan->type = LOGTYPE_CONSOLE;
+		chan->logmask = 28; /*warning,notice,error */
+		chan->next = logchannels;
+		logchannels = chan;
+		global_logmask |= chan->logmask;
 		return;
+	}
 	
 	ast_mutex_lock(&loglock);
 	if ((s = ast_variable_retrieve(cfg, "general", "appendhostname"))) {

Modified: team/oej/moduletest/res/res_odbc.c
URL: http://svn.digium.com/view/asterisk/team/oej/moduletest/res/res_odbc.c?rev=9289&r1=9288&r2=9289&view=diff
==============================================================================
--- team/oej/moduletest/res/res_odbc.c (original)
+++ team/oej/moduletest/res/res_odbc.c Thu Feb  9 08:58:18 2006
@@ -428,39 +428,41 @@
 {
 	static odbc_obj *new;
 
-	new = malloc(sizeof(odbc_obj));
-	if (!new)
-		return NULL;
-	memset(new, 0, sizeof(odbc_obj));
-	new->env = SQL_NULL_HANDLE;
-
-	new->name = malloc(strlen(name) + 1);
-	if (new->name == NULL)
-		return NULL;
-
-	new->dsn = malloc(strlen(dsn) + 1);
-	if (new->dsn == NULL)
-		return NULL;
+	if (!(new = calloc(1, sizeof(*new))) || 
+	    !(new->name = malloc(strlen(name) + 1)) || 
+	    !(new->dsn = malloc(strlen(dsn) + 1)))
+	    	goto cleanup;
 
 	if (username) {
-		new->username = malloc(strlen(username) + 1);
-		if (new->username == NULL)
-			return NULL;
+		if (!(new->username = malloc(strlen(username) + 1)))
+			goto cleanup;
 		strcpy(new->username, username);
 	}
 
 	if (password) {
-		new->password = malloc(strlen(password) + 1);
-		if (new->password == NULL)
-			return NULL;
+		if (!(new->password = malloc(strlen(password) + 1)))
+			goto cleanup;
 		strcpy(new->password, password);
 	}
 
 	strcpy(new->name, name);
 	strcpy(new->dsn, dsn);
+	new->env = SQL_NULL_HANDLE;
 	new->up = 0;
 	ast_mutex_init(&new->lock);
 	return new;
+
+cleanup:
+	if (new) {
+		free(new->name);
+		free(new->dsn);
+		free(new->username);
+		free(new->password);
+
+		free(new);	
+	}
+
+	return NULL;
 }
 
 void destroy_odbc_obj(odbc_obj **obj)



More information about the asterisk-commits mailing list