[asterisk-commits] kmoore: branch kmoore/pjsip_path_support r403326 - in /team/kmoore/pjsip_path...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Dec 3 11:30:04 CST 2013


Author: kmoore
Date: Tue Dec  3 11:29:57 2013
New Revision: 403326

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=403326
Log:
Fix merge conflict

Modified:
    team/kmoore/pjsip_path_support/   (props changed)
    team/kmoore/pjsip_path_support/addons/chan_mobile.c
    team/kmoore/pjsip_path_support/addons/chan_ooh323.c
    team/kmoore/pjsip_path_support/apps/app_agent_pool.c
    team/kmoore/pjsip_path_support/apps/app_confbridge.c
    team/kmoore/pjsip_path_support/apps/app_dial.c
    team/kmoore/pjsip_path_support/apps/app_disa.c
    team/kmoore/pjsip_path_support/apps/app_meetme.c
    team/kmoore/pjsip_path_support/apps/app_queue.c
    team/kmoore/pjsip_path_support/apps/app_userevent.c
    team/kmoore/pjsip_path_support/apps/app_voicemail.c
    team/kmoore/pjsip_path_support/channels/chan_alsa.c
    team/kmoore/pjsip_path_support/channels/chan_console.c
    team/kmoore/pjsip_path_support/channels/chan_dahdi.c
    team/kmoore/pjsip_path_support/channels/chan_gtalk.c
    team/kmoore/pjsip_path_support/channels/chan_h323.c
    team/kmoore/pjsip_path_support/channels/chan_iax2.c
    team/kmoore/pjsip_path_support/channels/chan_jingle.c
    team/kmoore/pjsip_path_support/channels/chan_mgcp.c
    team/kmoore/pjsip_path_support/channels/chan_misdn.c
    team/kmoore/pjsip_path_support/channels/chan_motif.c
    team/kmoore/pjsip_path_support/channels/chan_nbs.c
    team/kmoore/pjsip_path_support/channels/chan_oss.c
    team/kmoore/pjsip_path_support/channels/chan_phone.c
    team/kmoore/pjsip_path_support/channels/chan_pjsip.c
    team/kmoore/pjsip_path_support/channels/chan_sip.c
    team/kmoore/pjsip_path_support/channels/chan_skinny.c
    team/kmoore/pjsip_path_support/channels/chan_unistim.c
    team/kmoore/pjsip_path_support/channels/chan_vpb.cc
    team/kmoore/pjsip_path_support/channels/sig_analog.c
    team/kmoore/pjsip_path_support/channels/sig_pri.c
    team/kmoore/pjsip_path_support/funcs/func_timeout.c
    team/kmoore/pjsip_path_support/include/asterisk/aoc.h
    team/kmoore/pjsip_path_support/include/asterisk/channel.h
    team/kmoore/pjsip_path_support/include/asterisk/channelstate.h
    team/kmoore/pjsip_path_support/include/asterisk/res_pjsip.h
    team/kmoore/pjsip_path_support/include/asterisk/stasis_bridges.h
    team/kmoore/pjsip_path_support/include/asterisk/stasis_channels.h
    team/kmoore/pjsip_path_support/main/bridge.c
    team/kmoore/pjsip_path_support/main/bridge_channel.c
    team/kmoore/pjsip_path_support/main/cel.c
    team/kmoore/pjsip_path_support/main/channel.c
    team/kmoore/pjsip_path_support/main/core_local.c
    team/kmoore/pjsip_path_support/main/core_unreal.c
    team/kmoore/pjsip_path_support/main/dial.c
    team/kmoore/pjsip_path_support/main/endpoints.c
    team/kmoore/pjsip_path_support/main/media_index.c
    team/kmoore/pjsip_path_support/main/pbx.c
    team/kmoore/pjsip_path_support/main/pickup.c
    team/kmoore/pjsip_path_support/main/stasis_bridges.c
    team/kmoore/pjsip_path_support/main/stasis_channels.c
    team/kmoore/pjsip_path_support/pbx/pbx_realtime.c
    team/kmoore/pjsip_path_support/res/parking/parking_bridge_features.c
    team/kmoore/pjsip_path_support/res/parking/parking_manager.c
    team/kmoore/pjsip_path_support/res/res_agi.c
    team/kmoore/pjsip_path_support/res/res_pjsip.c
    team/kmoore/pjsip_path_support/res/res_pjsip/location.c
    team/kmoore/pjsip_path_support/res/res_pjsip/pjsip_options.c
    team/kmoore/pjsip_path_support/res/res_pjsip/security_events.c
    team/kmoore/pjsip_path_support/res/res_pjsip_refer.c
    team/kmoore/pjsip_path_support/res/res_pjsip_session.c
    team/kmoore/pjsip_path_support/res/res_pjsip_t38.c
    team/kmoore/pjsip_path_support/res/res_pjsip_transport_websocket.c
    team/kmoore/pjsip_path_support/res/res_stasis.c
    team/kmoore/pjsip_path_support/tests/test_cdr.c
    team/kmoore/pjsip_path_support/tests/test_cel.c
    team/kmoore/pjsip_path_support/tests/test_stasis_channels.c

Propchange: team/kmoore/pjsip_path_support/
------------------------------------------------------------------------------
    automerge = *

Propchange: team/kmoore/pjsip_path_support/
------------------------------------------------------------------------------
--- branch-12-merged (original)
+++ branch-12-merged Tue Dec  3 11:29:57 2013
@@ -1,1 +1,1 @@
-/branches/12:1-398558,398560-398577,398579-399305,399307-401390,401392-403175,403179,403207,403209,403221,403223,403240
+/branches/12:1-398558,398560-398577,398579-399305,399307-401390,401392-403175,403179,403207,403209,403221,403223,403240,403256,403258,403271,403290,403311-403312

Propchange: team/kmoore/pjsip_path_support/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Tue Dec  3 11:29:57 2013
@@ -1,1 +1,1 @@
-/trunk:1-403242
+/trunk:1-403325

Modified: team/kmoore/pjsip_path_support/addons/chan_mobile.c
URL: http://svnview.digium.com/svn/asterisk/team/kmoore/pjsip_path_support/addons/chan_mobile.c?view=diff&rev=403326&r1=403325&r2=403326
==============================================================================
--- team/kmoore/pjsip_path_support/addons/chan_mobile.c (original)
+++ team/kmoore/pjsip_path_support/addons/chan_mobile.c Tue Dec  3 11:29:57 2013
@@ -861,6 +861,7 @@
 		goto e_return;
 	}
 
+	ast_channel_lock(chn);
 	ast_channel_tech_set(chn, &mbl_tech);
 	ast_format_cap_add(ast_channel_nativeformats(chn), &prefformat);
 	ast_format_copy(ast_channel_rawreadformat(chn), &prefformat);
@@ -878,6 +879,7 @@
 	if (pvt->sco_socket != -1) {
 		ast_channel_set_fd(chn, 0, pvt->sco_socket);
 	}
+	ast_channel_unlock(chn);
 
 	return chn;
 

Modified: team/kmoore/pjsip_path_support/addons/chan_ooh323.c
URL: http://svnview.digium.com/svn/asterisk/team/kmoore/pjsip_path_support/addons/chan_ooh323.c?view=diff&rev=403326&r1=403325&r2=403326
==============================================================================
--- team/kmoore/pjsip_path_support/addons/chan_ooh323.c (original)
+++ team/kmoore/pjsip_path_support/addons/chan_ooh323.c Tue Dec  3 11:29:57 2013
@@ -2153,8 +2153,8 @@
 			}
 
 			ast_queue_control(c, AST_CONTROL_ANSWER);
-   			ast_channel_unlock(p->owner);
 			ast_publish_channel_state(c);
+			ast_channel_unlock(p->owner);
 		}
 		ast_mutex_unlock(&p->lock);
 
@@ -2487,11 +2487,23 @@
 					return NULL;
 				}
 			} else if (!strcasecmp(v->name, "e164")) {
-				if (!(peer->e164 = ast_strdup(v->value))) {
-					ast_log(LOG_ERROR, "Could not allocate memory for e164 of "
+				int valid = 1;
+				const char *tmp;
+				for(tmp = v->value; *tmp; tmp++) {
+					if (!isdigit(*tmp)) {
+						valid = 0;
+						break;
+					}
+				}
+				if (valid) {
+					if (!(peer->e164 = ast_strdup(v->value))) {
+						ast_log(LOG_ERROR, "Could not allocate memory for e164 of "
 											 "peer %s\n", name);
-					ooh323_delete_peer(peer);
-					return NULL;
+						ooh323_delete_peer(peer);
+						return NULL;
+					}
+				} else {
+					ast_log(LOG_ERROR, "Invalid e164: %s for peer %s\n", v->value, name);
 				}
 			} else  if (!strcasecmp(v->name, "email")) {
 				if (!(peer->email = ast_strdup(v->value))) {
@@ -2622,6 +2634,9 @@
 
 static int ooh323_do_reload(void)
 {
+	struct ooAliases * pNewAlias = NULL;
+	struct ooh323_peer *peer = NULL;
+
 	if (gH323Debug) {
 		ast_verb(0, "---   ooh323_do_reload\n");
 	}
@@ -2640,6 +2655,46 @@
 								gGatekeeper : 0, 0);
 		ooGkClientStart(gH323ep.gkClient);
 	}
+
+	/* Set aliases if any */
+	if (gH323Debug) {
+		ast_verb(0, "updating local aliases\n");
+	}
+
+	for (pNewAlias = gAliasList; pNewAlias; pNewAlias = pNewAlias->next) {
+		switch (pNewAlias->type) {
+		case T_H225AliasAddress_h323_ID:
+			ooH323EpAddAliasH323ID(pNewAlias->value);
+			break;
+		case T_H225AliasAddress_dialedDigits:	
+			ooH323EpAddAliasDialedDigits(pNewAlias->value);
+			break;
+		case T_H225AliasAddress_email_ID:	
+			ooH323EpAddAliasEmailID(pNewAlias->value);
+			break;
+		default:
+            		;
+		}
+	}
+
+	ast_mutex_lock(&peerl.lock);
+	peer = peerl.peers;
+	while (peer) {
+		if(peer->h323id) {
+			ooH323EpAddAliasH323ID(peer->h323id);
+		}
+		if(peer->email) {
+			ooH323EpAddAliasEmailID(peer->email);
+		}
+		if(peer->e164) {
+			ooH323EpAddAliasDialedDigits(peer->e164);
+		}
+       		if(peer->url) {
+			ooH323EpAddAliasURLID(peer->url);
+		}
+		peer = peer->next;
+	}
+	ast_mutex_unlock(&peerl.lock);
 
 	if (gH323Debug) {
 		ast_verb(0, "+++   ooh323_do_reload\n");
@@ -2724,6 +2779,7 @@
 	  		free(prev);
 		}
 		gAliasList = NULL;
+		ooH323EpClearAllAliases();
 	}
 
 	/* Inintialize everything to default */
@@ -2840,17 +2896,29 @@
 			gAliasList = pNewAlias;
 			pNewAlias = NULL;
 		} else if (!strcasecmp(v->name, "e164")) {
-         		pNewAlias = ast_calloc(1, sizeof(struct ooAliases));
-			if (!pNewAlias) {
-				ast_log(LOG_ERROR, "Failed to allocate memory for e164 alias\n");
-				ast_config_destroy(cfg);
-				return 1;
+			int valid = 1;
+			const char *tmp;
+			for(tmp = v->value; *tmp; tmp++) {
+				if (!isdigit(*tmp)) {
+					valid = 0;
+					break;
+				}
 			}
-			pNewAlias->type =  T_H225AliasAddress_dialedDigits;
-			pNewAlias->value = strdup(v->value);
-			pNewAlias->next = gAliasList;
-			gAliasList = pNewAlias;
-			pNewAlias = NULL;
+			if (valid) {
+         			pNewAlias = ast_calloc(1, sizeof(struct ooAliases));
+				if (!pNewAlias) {
+					ast_log(LOG_ERROR, "Failed to allocate memory for e164 alias\n");
+					ast_config_destroy(cfg);
+					return 1;
+				}
+				pNewAlias->type =  T_H225AliasAddress_dialedDigits;
+				pNewAlias->value = strdup(v->value);
+				pNewAlias->next = gAliasList;
+				gAliasList = pNewAlias;
+				pNewAlias = NULL;
+			} else {
+				ast_log(LOG_ERROR, "Invalid e164: %s\n", v->value);
+			}
 		} else if (!strcasecmp(v->name, "email")) {
          		pNewAlias = ast_calloc(1, sizeof(struct ooAliases));
 			if (!pNewAlias) {

Modified: team/kmoore/pjsip_path_support/apps/app_agent_pool.c
URL: http://svnview.digium.com/svn/asterisk/team/kmoore/pjsip_path_support/apps/app_agent_pool.c?view=diff&rev=403326&r1=403325&r2=403326
==============================================================================
--- team/kmoore/pjsip_path_support/apps/app_agent_pool.c (original)
+++ team/kmoore/pjsip_path_support/apps/app_agent_pool.c Tue Dec  3 11:29:57 2013
@@ -1464,7 +1464,9 @@
 		ast_bridge_destroy(caller_bridge, AST_CAUSE_USER_BUSY);
 	}
 
+	ast_channel_lock(logged);
 	send_agent_logoff(logged, agent->username, time_logged_in);
+	ast_channel_unlock(logged);
 	ast_verb(2, "Agent '%s' logged out.  Logged in for %ld seconds.\n",
 		agent->username, time_logged_in);
 	ast_channel_unref(logged);
@@ -2045,7 +2047,9 @@
 	ast_verb(2, "Agent '%s' logged in (format %s/%s)\n", agent->username,
 		ast_getformatname(ast_channel_readformat(chan)),
 		ast_getformatname(ast_channel_writeformat(chan)));
+	ast_channel_lock(chan);
 	send_agent_login(chan, agent->username);
+	ast_channel_unlock(chan);
 
 	agent_run(agent, chan);
 	return -1;

Modified: team/kmoore/pjsip_path_support/apps/app_confbridge.c
URL: http://svnview.digium.com/svn/asterisk/team/kmoore/pjsip_path_support/apps/app_confbridge.c?view=diff&rev=403326&r1=403325&r2=403326
==============================================================================
--- team/kmoore/pjsip_path_support/apps/app_confbridge.c (original)
+++ team/kmoore/pjsip_path_support/apps/app_confbridge.c Tue Dec  3 11:29:57 2013
@@ -1368,7 +1368,9 @@
 	}
 
 	/* To make sure playback_chan has the same language of that profile */
+	ast_channel_lock(conference->playback_chan);
 	ast_channel_language_set(conference->playback_chan, conference->b_profile.language);
+	ast_channel_unlock(conference->playback_chan);
 
 	ast_debug(1, "Created announcer channel '%s' to conference bridge '%s'\n",
 		ast_channel_name(conference->playback_chan), conference->name);

Modified: team/kmoore/pjsip_path_support/apps/app_dial.c
URL: http://svnview.digium.com/svn/asterisk/team/kmoore/pjsip_path_support/apps/app_dial.c?view=diff&rev=403326&r1=403325&r2=403326
==============================================================================
--- team/kmoore/pjsip_path_support/apps/app_dial.c (original)
+++ team/kmoore/pjsip_path_support/apps/app_dial.c Tue Dec  3 11:29:57 2013
@@ -2104,6 +2104,7 @@
 	struct ast_party_caller caller;
 
 	/* Reset all DIAL variables back to blank, to prevent confusion (in case we don't reset all of them). */
+	ast_channel_lock(chan);
 	ast_channel_stage_snapshot(chan);
 	pbx_builtin_setvar_helper(chan, "DIALSTATUS", "");
 	pbx_builtin_setvar_helper(chan, "DIALEDPEERNUMBER", "");
@@ -2111,6 +2112,7 @@
 	pbx_builtin_setvar_helper(chan, "ANSWEREDTIME", "");
 	pbx_builtin_setvar_helper(chan, "DIALEDTIME", "");
 	ast_channel_stage_snapshot_done(chan);
+	ast_channel_unlock(chan);
 
 	if (ast_strlen_zero(data)) {
 		ast_log(LOG_WARNING, "Dial requires an argument (technology/resource)\n");
@@ -2443,15 +2445,17 @@
 			continue;
 		}
 
+		ast_channel_lock(tc);
 		ast_channel_stage_snapshot(tc);
+		ast_channel_unlock(tc);
 
 		ast_channel_get_device_name(tc, device_name, sizeof(device_name));
 		if (!ignore_cc) {
 			ast_cc_extension_monitor_add_dialstring(chan, tmp->interface, device_name);
 		}
+
+		ast_channel_lock_both(tc, chan);
 		pbx_builtin_setvar_helper(tc, "DIALEDPEERNUMBER", tmp->number);
-
-		ast_channel_lock_both(tc, chan);
 
 		/* Setup outgoing SDP to match incoming one */
 		if (!AST_LIST_FIRST(&out_chans) && !rest && CAN_EARLY_BRIDGE(peerflags, chan, tc)) {
@@ -2724,8 +2728,10 @@
 			number = ast_strdupa(number);
 		}
 		ast_channel_unlock(peer);
+		ast_channel_lock(chan);
 		pbx_builtin_setvar_helper(chan, "DIALEDPEERNUMBER", number);
 		ast_channel_stage_snapshot_done(chan);
+		ast_channel_unlock(chan);
 
 		if (!ast_strlen_zero(args.url) && ast_channel_supports_html(peer) ) {
 			ast_debug(1, "app_dial: sendurl=%s.\n", args.url);
@@ -2811,16 +2817,18 @@
 			/* chan and peer are going into the PBX; as such neither are considered
 			 * outgoing channels any longer */
 			ast_clear_flag(ast_channel_flags(chan), AST_FLAG_OUTGOING);
-			ast_channel_stage_snapshot(peer);
-			ast_clear_flag(ast_channel_flags(peer), AST_FLAG_OUTGOING);
 
 			ast_replace_subargument_delimiter(opt_args[OPT_ARG_GOTO]);
 			ast_parseable_goto(chan, opt_args[OPT_ARG_GOTO]);
 			/* peer goes to the same context and extension as chan, so just copy info from chan*/
+			ast_channel_lock(peer);
+			ast_channel_stage_snapshot(peer);
+			ast_clear_flag(ast_channel_flags(peer), AST_FLAG_OUTGOING);
 			ast_channel_context_set(peer, ast_channel_context(chan));
 			ast_channel_exten_set(peer, ast_channel_exten(chan));
 			ast_channel_priority_set(peer, ast_channel_priority(chan) + 2);
 			ast_channel_stage_snapshot_done(peer);
+			ast_channel_unlock(peer);
 			if (ast_pbx_start(peer)) {
 				ast_autoservice_chan_hangup_peer(chan, peer);
 			}
@@ -2970,7 +2978,9 @@
 		if (!res) {
 			if (!ast_tvzero(calldurationlimit)) {
 				struct timeval whentohangup = ast_tvadd(ast_tvnow(), calldurationlimit);
+				ast_channel_lock(peer);
 				ast_channel_whentohangup_set(peer, &whentohangup);
+				ast_channel_unlock(peer);
 			}
 			if (!ast_strlen_zero(dtmfcalled)) {
 				ast_verb(3, "Sending DTMF '%s' to the called party.\n", dtmfcalled);

Modified: team/kmoore/pjsip_path_support/apps/app_disa.c
URL: http://svnview.digium.com/svn/asterisk/team/kmoore/pjsip_path_support/apps/app_disa.c?view=diff&rev=403326&r1=403325&r2=403326
==============================================================================
--- team/kmoore/pjsip_path_support/apps/app_disa.c (original)
+++ team/kmoore/pjsip_path_support/apps/app_disa.c Tue Dec  3 11:29:57 2013
@@ -381,8 +381,11 @@
 				ast_set_callerid(chan, ourcidnum, ourcidname, ourcidnum);
 			}
 
-			if (!ast_strlen_zero(acctcode))
+			if (!ast_strlen_zero(acctcode)) {
+				ast_channel_lock(chan);
 				ast_channel_accountcode_set(chan, acctcode);
+				ast_channel_unlock(chan);
+			}
 
 			if (special_noanswer) {
 				ast_clear_flag(&cdr_flags, AST_CDR_FLAG_DISABLE);

Modified: team/kmoore/pjsip_path_support/apps/app_meetme.c
URL: http://svnview.digium.com/svn/asterisk/team/kmoore/pjsip_path_support/apps/app_meetme.c?view=diff&rev=403326&r1=403325&r2=403326
==============================================================================
--- team/kmoore/pjsip_path_support/apps/app_meetme.c (original)
+++ team/kmoore/pjsip_path_support/apps/app_meetme.c Tue Dec  3 11:29:57 2013
@@ -1384,7 +1384,9 @@
 		}
 	}
 
+	ast_channel_lock(chan);
 	msg = ast_channel_blob_create(chan, message_type, json_object);
+	ast_channel_unlock(chan);
 
 	if (!msg) {
 		return;

Modified: team/kmoore/pjsip_path_support/apps/app_queue.c
URL: http://svnview.digium.com/svn/asterisk/team/kmoore/pjsip_path_support/apps/app_queue.c?view=diff&rev=403326&r1=403325&r2=403326
==============================================================================
--- team/kmoore/pjsip_path_support/apps/app_queue.c (original)
+++ team/kmoore/pjsip_path_support/apps/app_queue.c Tue Dec  3 11:29:57 2013
@@ -2040,8 +2040,12 @@
 	RAII_VAR(struct ast_channel_snapshot *, caller_snapshot, NULL, ao2_cleanup);
 	RAII_VAR(struct ast_channel_snapshot *, agent_snapshot, NULL, ao2_cleanup);
 
+	ast_channel_lock(caller);
 	caller_snapshot = ast_channel_snapshot_create(caller);
+	ast_channel_unlock(caller);
+	ast_channel_lock(agent);
 	agent_snapshot = ast_channel_snapshot_create(agent);
+	ast_channel_unlock(agent);
 
 	if (!caller_snapshot || !agent_snapshot) {
 		return;
@@ -3452,7 +3456,9 @@
 				     "Queue", q->name,
 				     "Position", qe->pos,
 				     "Count", q->count);
+		ast_channel_lock(qe->chan);
 		ast_channel_publish_blob(qe->chan, queue_caller_join_type(), blob);
+		ast_channel_unlock(qe->chan);
 		ast_debug(1, "Queue '%s' Join, Channel '%s', Position '%d'\n", q->name, ast_channel_name(qe->chan), qe->pos );
 	}
 	ao2_unlock(q);
@@ -3731,7 +3737,9 @@
 					     "Queue", q->name,
 					     "Position", qe->pos,
 					     "Count", q->count);
+			ast_channel_lock(qe->chan);
 			ast_channel_publish_blob(qe->chan, queue_caller_leave_type(), blob);
+			ast_channel_unlock(qe->chan);
 			ast_debug(1, "Queue '%s' Leave, Channel '%s'\n", q->name, ast_channel_name(qe->chan));
 			/* Take us out of the queue */
 			if (prev) {
@@ -4329,10 +4337,13 @@
 			     "Position", qe->pos,
 			     "OriginalPosition", qe->opos,
 			     "HoldTime", (int)(time(NULL) - qe->start));
-	ast_channel_publish_blob(qe->chan, queue_caller_abandon_type(), blob);
 
 	qe->parent->callsabandoned++;
 	ao2_unlock(qe->parent);
+
+	ast_channel_lock(qe->chan);
+	ast_channel_publish_blob(qe->chan, queue_caller_abandon_type(), blob);
+	ast_channel_unlock(qe->chan);
 }
 
 /*! \brief RNA == Ring No Answer. Common code that is executed when we try a queue member and they don't answer. */

Modified: team/kmoore/pjsip_path_support/apps/app_userevent.c
URL: http://svnview.digium.com/svn/asterisk/team/kmoore/pjsip_path_support/apps/app_userevent.c?view=diff&rev=403326&r1=403325&r2=403326
==============================================================================
--- team/kmoore/pjsip_path_support/apps/app_userevent.c (original)
+++ team/kmoore/pjsip_path_support/apps/app_userevent.c Tue Dec  3 11:29:57 2013
@@ -114,7 +114,9 @@
 		}
 	}
 
+	ast_channel_lock(chan);
 	ast_channel_publish_blob(chan, ast_channel_user_event_type(), blob);
+	ast_channel_unlock(chan);
 	return 0;
 }
 

Modified: team/kmoore/pjsip_path_support/apps/app_voicemail.c
URL: http://svnview.digium.com/svn/asterisk/team/kmoore/pjsip_path_support/apps/app_voicemail.c?view=diff&rev=403326&r1=403325&r2=403326
==============================================================================
--- team/kmoore/pjsip_path_support/apps/app_voicemail.c (original)
+++ team/kmoore/pjsip_path_support/apps/app_voicemail.c Tue Dec  3 11:29:57 2013
@@ -10958,8 +10958,11 @@
 #endif
 
 	/* Set language from config to override channel language */
-	if (!ast_strlen_zero(vmu->language))
+	if (!ast_strlen_zero(vmu->language)) {
+		ast_channel_lock(chan);
 		ast_channel_language_set(chan, vmu->language);
+		ast_channel_unlock(chan);
+	}
 
 	/* Retrieve urgent, old and new message counts */
 	ast_debug(1, "Before open_mailbox\n");

Modified: team/kmoore/pjsip_path_support/channels/chan_alsa.c
URL: http://svnview.digium.com/svn/asterisk/team/kmoore/pjsip_path_support/channels/chan_alsa.c?view=diff&rev=403326&r1=403325&r2=403326
==============================================================================
--- team/kmoore/pjsip_path_support/channels/chan_alsa.c (original)
+++ team/kmoore/pjsip_path_support/channels/chan_alsa.c Tue Dec  3 11:29:57 2013
@@ -581,6 +581,7 @@
 	if (!(tmp = ast_channel_alloc(1, state, 0, 0, "", p->exten, p->context, linkedid, 0, "ALSA/%s", indevname)))
 		return NULL;
 
+	ast_channel_lock(tmp);
 	ast_channel_stage_snapshot(tmp);
 
 	ast_channel_tech_set(tmp, &alsa_tech);
@@ -601,6 +602,7 @@
 	ast_jb_configure(tmp, &global_jbconf);
 
 	ast_channel_stage_snapshot_done(tmp);
+	ast_channel_unlock(tmp);
 
 	if (state != AST_STATE_DOWN) {
 		if (ast_pbx_start(tmp)) {

Modified: team/kmoore/pjsip_path_support/channels/chan_console.c
URL: http://svnview.digium.com/svn/asterisk/team/kmoore/pjsip_path_support/channels/chan_console.c?view=diff&rev=403326&r1=403325&r2=403326
==============================================================================
--- team/kmoore/pjsip_path_support/channels/chan_console.c (original)
+++ team/kmoore/pjsip_path_support/channels/chan_console.c Tue Dec  3 11:29:57 2013
@@ -428,6 +428,7 @@
 		return NULL;
 	}
 
+	ast_channel_lock(chan);
 	ast_channel_stage_snapshot(chan);
 
 	ast_channel_tech_set(chan, &console_tech);
@@ -444,6 +445,7 @@
 	ast_jb_configure(chan, &global_jbconf);
 
 	ast_channel_stage_snapshot_done(chan);
+	ast_channel_unlock(chan);
 
 	if (state != AST_STATE_DOWN) {
 		if (ast_pbx_start(chan)) {

Modified: team/kmoore/pjsip_path_support/channels/chan_dahdi.c
URL: http://svnview.digium.com/svn/asterisk/team/kmoore/pjsip_path_support/channels/chan_dahdi.c?view=diff&rev=403326&r1=403325&r2=403326
==============================================================================
--- team/kmoore/pjsip_path_support/channels/chan_dahdi.c (original)
+++ team/kmoore/pjsip_path_support/channels/chan_dahdi.c Tue Dec  3 11:29:57 2013
@@ -1667,7 +1667,9 @@
 		return;
 	}
 
+	ast_channel_lock(chan);
 	ast_channel_publish_blob(chan, dahdichannel_type(), blob);
+	ast_channel_unlock(chan);
 }
 
 /*!
@@ -8916,6 +8918,7 @@
 		return NULL;
 	}
 
+	ast_channel_lock(tmp);
 	ast_channel_stage_snapshot(tmp);
 
 	if (callid) {
@@ -9096,6 +9099,7 @@
 		pbx_builtin_setvar_helper(tmp, v->name, v->value);
 
 	ast_channel_stage_snapshot_done(tmp);
+	ast_channel_unlock(tmp);
 
 	ast_module_ref(ast_module_info->self);
 
@@ -9614,6 +9618,7 @@
 						getforward = 0;
 					} else {
 						res = tone_zone_play_tone(p->subs[idx].dfd, -1);
+						ast_channel_lock(chan);
 						ast_channel_exten_set(chan, exten);
 						if (!ast_strlen_zero(p->cid_num)) {
 							if (!p->hidecallerid)
@@ -9626,6 +9631,7 @@
 								ast_set_callerid(chan, NULL, p->cid_name, NULL);
 						}
 						ast_setstate(chan, AST_STATE_RING);
+						ast_channel_unlock(chan);
 						dahdi_ec_enable(p);
 						res = ast_pbx_run(chan);
 						if (res) {
@@ -10389,8 +10395,10 @@
 
 		my_handle_notify_message(chan, p, flags, -1);
 
+		ast_channel_lock(chan);
 		ast_setstate(chan, AST_STATE_RING);
 		ast_channel_rings_set(chan, 1);
+		ast_channel_unlock(chan);
 		p->ringt = p->ringt_base;
 		res = ast_pbx_run(chan);
 		if (res) {

Modified: team/kmoore/pjsip_path_support/channels/chan_gtalk.c
URL: http://svnview.digium.com/svn/asterisk/team/kmoore/pjsip_path_support/channels/chan_gtalk.c?view=diff&rev=403326&r1=403325&r2=403326
==============================================================================
--- team/kmoore/pjsip_path_support/channels/chan_gtalk.c (original)
+++ team/kmoore/pjsip_path_support/channels/chan_gtalk.c Tue Dec  3 11:29:57 2013
@@ -1150,6 +1150,7 @@
 		return NULL;
 	}
 
+	ast_channel_lock(tmp);
 	ast_channel_stage_snapshot(tmp);
 
 	ast_channel_tech_set(tmp, &gtalk_tech);
@@ -1226,6 +1227,7 @@
 		ast_jb_configure(tmp, &global_jbconf);
 
 	ast_channel_stage_snapshot_done(tmp);
+	ast_channel_unlock(tmp);
 
 	if (state != AST_STATE_DOWN && ast_pbx_start(tmp)) {
 		ast_log(LOG_WARNING, "Unable to start PBX on %s\n", ast_channel_name(tmp));
@@ -1419,7 +1421,9 @@
 	ast_format_cap_joint_copy(p->cap, p->peercap, p->jointcap);
 	ast_mutex_unlock(&p->lock);
 
+	ast_channel_lock(chan);
 	ast_setstate(chan, AST_STATE_RING);
+	ast_channel_unlock(chan);
 	if (ast_format_cap_is_empty(p->jointcap)) {
 		ast_log(LOG_WARNING, "Capabilities don't match : us - %s, peer - %s, combined - %s \n", ast_getformatname_multiple(s1, BUFSIZ, p->cap),
 			ast_getformatname_multiple(s2, BUFSIZ, p->peercap),

Modified: team/kmoore/pjsip_path_support/channels/chan_h323.c
URL: http://svnview.digium.com/svn/asterisk/team/kmoore/pjsip_path_support/channels/chan_h323.c?view=diff&rev=403326&r1=403325&r2=403326
==============================================================================
--- team/kmoore/pjsip_path_support/channels/chan_h323.c (original)
+++ team/kmoore/pjsip_path_support/channels/chan_h323.c Tue Dec  3 11:29:57 2013
@@ -1061,6 +1061,9 @@
 	ch = ast_channel_alloc(1, state, cid_num, cid_name, pvt->accountcode, pvt->exten, pvt->context, linkedid, pvt->amaflags, "H323/%s", host);
 	/* Update usage counter */
 	ast_module_ref(ast_module_info->self);
+	if (ch) {
+		ast_channel_lock(ch);
+	}
 	ast_mutex_lock(&pvt->lock);
 	if (ch) {
 		ast_channel_tech_set(ch, &oh323_tech);
@@ -1139,6 +1142,7 @@
 		}
 		if (pvt->cd.transfer_capability >= 0)
 			ast_channel_transfercapability_set(ch, pvt->cd.transfer_capability);
+		ast_channel_unlock(ch);
 		if (state != AST_STATE_DOWN) {
 			if (ast_pbx_start(ch)) {
 				ast_log(LOG_WARNING, "Unable to start PBX on %s\n", ast_channel_name(ch));

Modified: team/kmoore/pjsip_path_support/channels/chan_iax2.c
URL: http://svnview.digium.com/svn/asterisk/team/kmoore/pjsip_path_support/channels/chan_iax2.c?view=diff&rev=403326&r1=403325&r2=403326
==============================================================================
--- team/kmoore/pjsip_path_support/channels/chan_iax2.c (original)
+++ team/kmoore/pjsip_path_support/channels/chan_iax2.c Tue Dec  3 11:29:57 2013
@@ -5689,11 +5689,15 @@
 	/* Don't hold call lock */
 	ast_mutex_unlock(&iaxsl[callno]);
 	tmp = ast_channel_alloc(1, state, i->cid_num, i->cid_name, i->accountcode, i->exten, i->context, linkedid, i->amaflags, "IAX2/%s-%d", i->host, i->callno);
+	if (tmp) {
+		ast_channel_lock(tmp);
+	}
 	ast_mutex_lock(&iaxsl[callno]);
 	if (i != iaxs[callno]) {
 		if (tmp) {
 			/* unlock and relock iaxsl[callno] to preserve locking order */
 			ast_mutex_unlock(&iaxsl[callno]);
+			ast_channel_unlock(tmp);
 			tmp = ast_channel_release(tmp);
 			ast_mutex_lock(&iaxsl[callno]);
 		}
@@ -5803,6 +5807,7 @@
 	}
 
 	ast_channel_stage_snapshot_done(tmp);
+	ast_channel_unlock(tmp);
 
 	if (state != AST_STATE_DOWN) {
 		if (ast_pbx_start(tmp)) {
@@ -12234,7 +12239,9 @@
 	if (c) {
 		struct ast_format_cap *joint;
 		if (callid) {
+			ast_channel_lock(c);
 			ast_channel_callid_set(c, callid);
+			ast_channel_unlock(c);
 		}
 
 		/* Choose a format we can live with */

Modified: team/kmoore/pjsip_path_support/channels/chan_jingle.c
URL: http://svnview.digium.com/svn/asterisk/team/kmoore/pjsip_path_support/channels/chan_jingle.c?view=diff&rev=403326&r1=403325&r2=403326
==============================================================================
--- team/kmoore/pjsip_path_support/channels/chan_jingle.c (original)
+++ team/kmoore/pjsip_path_support/channels/chan_jingle.c Tue Dec  3 11:29:57 2013
@@ -864,6 +864,7 @@
 		return NULL;
 	}
 
+	ast_channel_lock(tmp);
 	ast_channel_stage_snapshot(tmp);
 
 	ast_channel_tech_set(tmp, &jingle_tech);
@@ -941,6 +942,7 @@
 		ast_jb_configure(tmp, &global_jbconf);
 
 	ast_channel_stage_snapshot_done(tmp);
+	ast_channel_unlock(tmp);
 
 	if (state != AST_STATE_DOWN && ast_pbx_start(tmp)) {
 		ast_log(LOG_WARNING, "Unable to start PBX on %s\n", ast_channel_name(tmp));
@@ -1115,7 +1117,9 @@
 	}
 
 	ast_mutex_unlock(&p->lock);
+	ast_channel_lock(chan);
 	ast_setstate(chan, AST_STATE_RING);
+	ast_channel_unlock(chan);
 	res = ast_pbx_start(chan);
 	
 	switch (res) {

Modified: team/kmoore/pjsip_path_support/channels/chan_mgcp.c
URL: http://svnview.digium.com/svn/asterisk/team/kmoore/pjsip_path_support/channels/chan_mgcp.c?view=diff&rev=403326&r1=403325&r2=403326
==============================================================================
--- team/kmoore/pjsip_path_support/channels/chan_mgcp.c (original)
+++ team/kmoore/pjsip_path_support/channels/chan_mgcp.c Tue Dec  3 11:29:57 2013
@@ -1507,6 +1507,7 @@
 
 	tmp = ast_channel_alloc(1, state, i->cid_num, i->cid_name, linkedid, i->accountcode, i->exten, i->context, i->amaflags, "MGCP/%s@%s-%d", i->name, i->parent->name, sub->id);
 	if (tmp) {
+		ast_channel_lock(tmp);
 		ast_channel_stage_snapshot(tmp);
 		ast_channel_tech_set(tmp, &mgcp_tech);
 		ast_format_cap_copy(ast_channel_nativeformats(tmp), i->cap);
@@ -1570,6 +1571,7 @@
 		}
 
 		ast_channel_stage_snapshot_done(tmp);
+		ast_channel_unlock(tmp);
 
 		if (state != AST_STATE_DOWN) {
 			if (ast_pbx_start(tmp)) {
@@ -3046,6 +3048,7 @@
 				} else {
 					/*res = tone_zone_play_tone(p->subs[index].zfd, -1);*/
 					ast_indicate(chan, -1);
+					ast_channel_lock(chan);
 					ast_channel_exten_set(chan, p->dtmf_buf);
 					ast_channel_dialed(chan)->number.str = ast_strdup(p->dtmf_buf);
 					memset(p->dtmf_buf, 0, sizeof(p->dtmf_buf));
@@ -3054,6 +3057,7 @@
 						p->hidecallerid ? "" : p->cid_name,
 						ast_channel_caller(chan)->ani.number.valid ? NULL : p->cid_num);
 					ast_setstate(chan, AST_STATE_RING);
+					ast_channel_unlock(chan);
 					if (p->dtmfmode & MGCP_DTMF_HYBRID) {
 						p->dtmfmode |= MGCP_DTMF_INBAND;
 						ast_indicate(chan, -1);

Modified: team/kmoore/pjsip_path_support/channels/chan_misdn.c
URL: http://svnview.digium.com/svn/asterisk/team/kmoore/pjsip_path_support/channels/chan_misdn.c?view=diff&rev=403326&r1=403325&r2=403326
==============================================================================
--- team/kmoore/pjsip_path_support/channels/chan_misdn.c (original)
+++ team/kmoore/pjsip_path_support/channels/chan_misdn.c Tue Dec  3 11:29:57 2013
@@ -5954,7 +5954,9 @@
 	chan_misdn_log(1, port, "read_config: Getting Config\n");
 
 	misdn_cfg_get(port, MISDN_CFG_LANGUAGE, lang, sizeof(lang));
+	ast_channel_lock(ast);
 	ast_channel_language_set(ast, lang);
+	ast_channel_unlock(ast);
 
 	misdn_cfg_get(port, MISDN_CFG_MUSICCLASS, ch->mohinterpret, sizeof(ch->mohinterpret));
 
@@ -6000,7 +6002,9 @@
 
 	misdn_cfg_get(bc->port, MISDN_CFG_CONTEXT, ch->context, sizeof(ch->context));
 
+	ast_channel_lock(ast);
 	ast_channel_context_set(ast, ch->context);
+	ast_channel_unlock(ast);
 
 #ifdef MISDN_1_2
 	update_pipeline_config(bc);
@@ -6017,8 +6021,10 @@
 	misdn_cfg_get(port, MISDN_CFG_PICKUPGROUP, &pg, sizeof(pg));
 	misdn_cfg_get(port, MISDN_CFG_CALLGROUP, &cg, sizeof(cg));
 	chan_misdn_log(5, port, " --> * CallGrp:%s PickupGrp:%s\n", ast_print_group(buf, sizeof(buf), cg), ast_print_group(buf2, sizeof(buf2), pg));
+	ast_channel_lock(ast);
 	ast_channel_pickupgroup_set(ast, pg);
 	ast_channel_callgroup_set(ast, cg);
+	ast_channel_unlock(ast);
 
 	misdn_cfg_get(port, MISDN_CFG_NAMEDPICKUPGROUP, &npg, sizeof(npg));
 	misdn_cfg_get(port, MISDN_CFG_NAMEDCALLGROUP, &ncg, sizeof(ncg));
@@ -6031,8 +6037,10 @@
 		ast_free(tmp_str);
 	}
 
+	ast_channel_lock(ast);
 	ast_channel_named_pickupgroups_set(ast, npg);
 	ast_channel_named_callgroups_set(ast, ncg);
+	ast_channel_unlock(ast);
 
 	if (ch->originator == ORG_AST) {
 		char callerid[BUFFERSIZE + 1];
@@ -6086,7 +6094,9 @@
 		/* Add configured prefix to dialed.number */
 		misdn_add_number_prefix(bc->port, bc->dialed.number_type, bc->dialed.number, sizeof(bc->dialed.number));
 
+		ast_channel_lock(ast);
 		ast_channel_exten_set(ast, bc->dialed.number);
+		ast_channel_unlock(ast);
 
 		misdn_cfg_get(bc->port, MISDN_CFG_OVERLAP_DIAL, &ch->overlap_dial, sizeof(ch->overlap_dial));
 		ast_mutex_init(&ch->overlap_tv_lock);
@@ -10228,8 +10238,10 @@
 
 		export_ch(chan, bc, ch);
 
+		ast_channel_lock(ch->ast);
 		ast_channel_rings_set(ch->ast, 1);
 		ast_setstate(ch->ast, AST_STATE_RINGING);
+		ast_channel_unlock(ch->ast);
 
 		/* Update asterisk channel caller information */
 		chan_misdn_log(2, bc->port, " --> TON: %s(%d)\n", misdn_to_str_ton(bc->caller.number_type), bc->caller.number_type);
@@ -10528,7 +10540,9 @@
 		}
 
 		ast_queue_control(ch->ast, AST_CONTROL_RINGING);
+		ast_channel_lock(ch->ast);
 		ast_setstate(ch->ast, AST_STATE_RINGING);
+		ast_channel_unlock(ch->ast);
 
 		cb_log(7, bc->port, " --> Set State Ringing\n");
 

Modified: team/kmoore/pjsip_path_support/channels/chan_motif.c
URL: http://svnview.digium.com/svn/asterisk/team/kmoore/pjsip_path_support/channels/chan_motif.c?view=diff&rev=403326&r1=403325&r2=403326
==============================================================================
--- team/kmoore/pjsip_path_support/channels/chan_motif.c (original)
+++ team/kmoore/pjsip_path_support/channels/chan_motif.c Tue Dec  3 11:29:57 2013
@@ -785,6 +785,7 @@
 	if (!(chan = ast_channel_alloc(1, state, S_OR(title, ""), S_OR(cid_name, ""), "", "", "", linkedid, 0, "Motif/%s-%04lx", str, ast_random() & 0xffff))) {
 		return NULL;
 	}
+	ast_channel_lock(chan);
 
 	ast_channel_stage_snapshot(chan);
 
@@ -852,6 +853,7 @@
 	ao2_unlock(endpoint);
 
 	ast_channel_stage_snapshot_done(chan);
+	ast_channel_unlock(chan);
 
 	return chan;
 }
@@ -2412,7 +2414,9 @@
 
 	ao2_link(endpoint->state->sessions, session);
 
+	ast_channel_lock(chan);
 	ast_setstate(chan, AST_STATE_RING);
+	ast_channel_unlock(chan);
 	res = ast_pbx_start(chan);
 
 	switch (res) {

Modified: team/kmoore/pjsip_path_support/channels/chan_nbs.c
URL: http://svnview.digium.com/svn/asterisk/team/kmoore/pjsip_path_support/channels/chan_nbs.c?view=diff&rev=403326&r1=403325&r2=403326
==============================================================================
--- team/kmoore/pjsip_path_support/channels/chan_nbs.c (original)
+++ team/kmoore/pjsip_path_support/channels/chan_nbs.c Tue Dec  3 11:29:57 2013
@@ -223,6 +223,7 @@
 	struct ast_channel *tmp;
 	tmp = ast_channel_alloc(1, state, 0, 0, "", "s", context, linkedid, 0, "NBS/%s", i->stream);
 	if (tmp) {
+		ast_channel_lock(tmp);
 		ast_channel_tech_set(tmp, &nbs_tech);
 		ast_channel_set_fd(tmp, 0, nbs_fd(i->nbs));
 
@@ -239,6 +240,7 @@
 		ast_channel_language_set(tmp, "");
 		i->owner = tmp;
 		i->u = ast_module_user_add(tmp);
+		ast_channel_unlock(tmp);
 		if (state != AST_STATE_DOWN) {
 			if (ast_pbx_start(tmp)) {
 				ast_log(LOG_WARNING, "Unable to start PBX on %s\n", ast_channel_name(tmp));

Modified: team/kmoore/pjsip_path_support/channels/chan_oss.c
URL: http://svnview.digium.com/svn/asterisk/team/kmoore/pjsip_path_support/channels/chan_oss.c?view=diff&rev=403326&r1=403325&r2=403326
==============================================================================
--- team/kmoore/pjsip_path_support/channels/chan_oss.c (original)
+++ team/kmoore/pjsip_path_support/channels/chan_oss.c Tue Dec  3 11:29:57 2013
@@ -799,6 +799,7 @@
 	c = ast_channel_alloc(1, state, o->cid_num, o->cid_name, "", ext, ctx, linkedid, 0, "Console/%s", o->device + 5);
 	if (c == NULL)
 		return NULL;
+	ast_channel_lock(c);
 	ast_channel_tech_set(c, &oss_tech);
 	if (o->sounddev < 0)
 		setformat(o, O_RDWR);
@@ -829,6 +830,7 @@
 	o->owner = c;
 	ast_module_ref(ast_module_info->self);
 	ast_jb_configure(c, &global_jbconf);
+	ast_channel_unlock(c);
 	if (state != AST_STATE_DOWN) {
 		if (ast_pbx_start(c)) {
 			ast_log(LOG_WARNING, "Unable to start PBX on %s\n", ast_channel_name(c));

Modified: team/kmoore/pjsip_path_support/channels/chan_phone.c
URL: http://svnview.digium.com/svn/asterisk/team/kmoore/pjsip_path_support/channels/chan_phone.c?view=diff&rev=403326&r1=403325&r2=403326
==============================================================================
--- team/kmoore/pjsip_path_support/channels/chan_phone.c (original)
+++ team/kmoore/pjsip_path_support/channels/chan_phone.c Tue Dec  3 11:29:57 2013
@@ -862,6 +862,7 @@
 	struct ast_format tmpfmt;
 	tmp = ast_channel_alloc(1, state, i->cid_num, i->cid_name, "", i->ext, i->context, linkedid, 0, "Phone/%s", i->dev + 5);
 	if (tmp) {
+		ast_channel_lock(tmp);
 		ast_channel_tech_set(tmp, cur_tech);
 		ast_channel_set_fd(tmp, 0, i->fd);
 		/* XXX Switching formats silently causes kernel panics XXX */
@@ -898,6 +899,7 @@
 			ast_channel_caller(tmp)->ani.number.valid = 1;
 			ast_channel_caller(tmp)->ani.number.str = ast_strdup(i->cid_num);
 		}
+		ast_channel_unlock(tmp);
 
 		i->owner = tmp;
 		ast_module_ref(ast_module_info->self);

Modified: team/kmoore/pjsip_path_support/channels/chan_pjsip.c
URL: http://svnview.digium.com/svn/asterisk/team/kmoore/pjsip_path_support/channels/chan_pjsip.c?view=diff&rev=403326&r1=403325&r2=403326
==============================================================================
--- team/kmoore/pjsip_path_support/channels/chan_pjsip.c (original)
+++ team/kmoore/pjsip_path_support/channels/chan_pjsip.c Tue Dec  3 11:29:57 2013
@@ -577,13 +577,15 @@
 		return NULL;
 	}
 
-	ast_channel_stage_snapshot(chan);
-
 	/* If res_pjsip_session is ever updated to create/destroy ast_sip_session_media
 	 * during a call such as if multiple same-type stream support is introduced,
 	 * these will need to be recaptured as well */
 	pvt->media[SIP_MEDIA_AUDIO] = ao2_find(session->media, "audio", OBJ_KEY);
 	pvt->media[SIP_MEDIA_VIDEO] = ao2_find(session->media, "video", OBJ_KEY);
+
+	ast_channel_lock(chan);
+	ast_channel_stage_snapshot(chan);
+
 	ast_channel_tech_pvt_set(chan, channel);
 	if (pvt->media[SIP_MEDIA_AUDIO] && pvt->media[SIP_MEDIA_AUDIO]->rtp) {
 		ast_rtp_instance_set_channel_id(pvt->media[SIP_MEDIA_AUDIO]->rtp, ast_channel_uniqueid(chan));
@@ -632,9 +634,10 @@
 		ast_channel_zone_set(chan, zone);
 	}
 
+	ast_channel_stage_snapshot_done(chan);
+	ast_channel_unlock(chan);
+
 	ast_endpoint_add_channel(session->endpoint->persistent, chan);
-
-	ast_channel_stage_snapshot_done(chan);
 
 	return chan;
 }
@@ -2030,9 +2033,11 @@
 	switch (status.code) {
 	case 180:
 		ast_queue_control(session->channel, AST_CONTROL_RINGING);
+		ast_channel_lock(session->channel);
 		if (ast_channel_state(session->channel) != AST_STATE_UP) {
 			ast_setstate(session->channel, AST_STATE_RINGING);
 		}
+		ast_channel_unlock(session->channel);
 		break;
 	case 183:
 		ast_queue_control(session->channel, AST_CONTROL_PROGRESS);

Modified: team/kmoore/pjsip_path_support/channels/chan_sip.c
URL: http://svnview.digium.com/svn/asterisk/team/kmoore/pjsip_path_support/channels/chan_sip.c?view=diff&rev=403326&r1=403325&r2=403326
==============================================================================
--- team/kmoore/pjsip_path_support/channels/chan_sip.c (original)
+++ team/kmoore/pjsip_path_support/channels/chan_sip.c Tue Dec  3 11:29:57 2013
@@ -8106,6 +8106,7 @@
 		}
 	}
 
+	ast_channel_lock(tmp);
 	ast_channel_stage_snapshot(tmp);
 
 	/* If we sent in a callid, bind it to the channel. */
@@ -8113,7 +8114,6 @@
 		ast_channel_callid_set(tmp, callid);
 	}
 
-	ast_channel_lock(tmp);
 	sip_pvt_lock(i);
 	ast_channel_cc_params_init(tmp, i->cc_params);
 	ast_channel_caller(tmp)->id.tag = ast_strdup(i->cid_tag);

Modified: team/kmoore/pjsip_path_support/channels/chan_skinny.c
URL: http://svnview.digium.com/svn/asterisk/team/kmoore/pjsip_path_support/channels/chan_skinny.c?view=diff&rev=403326&r1=403325&r2=403326
==============================================================================
--- team/kmoore/pjsip_path_support/channels/chan_skinny.c (original)

[... 1946 lines stripped ...]



More information about the asterisk-commits mailing list