[asterisk-commits] kpfleming: branch 1.2 r65682 - /branches/1.2/channels/chan_sip.c

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Wed May 23 13:46:22 MST 2007


Author: kpfleming
Date: Wed May 23 15:46:22 2007
New Revision: 65682

URL: http://svn.digium.com/view/asterisk?view=rev&rev=65682
Log:
ensure that variables are set on a newly created channel before we start a PBX on it

Modified:
    branches/1.2/channels/chan_sip.c

Modified: branches/1.2/channels/chan_sip.c
URL: http://svn.digium.com/view/asterisk/branches/1.2/channels/chan_sip.c?view=diff&rev=65682&r1=65681&r2=65682
==============================================================================
--- branches/1.2/channels/chan_sip.c (original)
+++ branches/1.2/channels/chan_sip.c Wed May 23 15:46:22 2007
@@ -2880,6 +2880,11 @@
 	pbx_builtin_setvar_helper(tmp, "OSPPEER", peer);
 #endif
 	ast_setstate(tmp, state);
+
+	/* Set channel variables for this call from configuration */
+	for (v = i->chanvars ; v ; v = v->next)
+		pbx_builtin_setvar_helper(tmp, v->name, v->value);
+				
 	if (state != AST_STATE_DOWN) {
 		if (ast_pbx_start(tmp)) {
 			ast_log(LOG_WARNING, "Unable to start PBX on %s\n", tmp->name);
@@ -2887,10 +2892,7 @@
 			tmp = NULL;
 		}
 	}
-	/* Set channel variables for this call from configuration */
-	for (v = i->chanvars ; v ; v = v->next)
-		pbx_builtin_setvar_helper(tmp,v->name,v->value);
-				
+
 	ast_mutex_lock(&usecnt_lock);
 	usecnt++;
 	ast_mutex_unlock(&usecnt_lock);



More information about the asterisk-commits mailing list