[asterisk-commits] rmudgett: branch 1.8 r325212 - /branches/1.8/channels/chan_dahdi.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Jun 28 12:30:20 CDT 2011


Author: rmudgett
Date: Tue Jun 28 12:30:16 2011
New Revision: 325212

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=325212
Log:
Use the device name and not the channel name to initialize the device state.

Correct ASTERISK-11323 implementation as I don't see how it ever worked as
claimed when it used the channel name and not the device name.

(issue ASTERISK-11323)

Modified:
    branches/1.8/channels/chan_dahdi.c

Modified: branches/1.8/channels/chan_dahdi.c
URL: http://svnview.digium.com/svn/asterisk/branches/1.8/channels/chan_dahdi.c?view=diff&rev=325212&r1=325211&r2=325212
==============================================================================
--- branches/1.8/channels/chan_dahdi.c (original)
+++ branches/1.8/channels/chan_dahdi.c Tue Jun 28 12:30:16 2011
@@ -9409,6 +9409,8 @@
 	int features;
 	struct ast_str *chan_name;
 	struct ast_variable *v;
+	char *dashptr;
+	char device_name[AST_CHANNEL_NAME];
 
 	if (i->subs[idx].owner) {
 		ast_log(LOG_WARNING, "Channel %d already has a %s call\n", i->channel,subnames[idx]);
@@ -9589,7 +9591,13 @@
 	/* Configure the new channel jb */
 	ast_jb_configure(tmp, &global_jbconf);
 
-	ast_devstate_changed_literal(ast_state_chan2dev(state), tmp->name);
+	/* Set initial device state */
+	ast_copy_string(device_name, tmp->name, sizeof(device_name));
+	dashptr = strrchr(device_name, '-');
+	if (dashptr) {
+		*dashptr = '\0';
+	}
+	ast_devstate_changed_literal(AST_DEVICE_UNKNOWN, device_name);
 
 	for (v = i->vars ; v ; v = v->next)
 		pbx_builtin_setvar_helper(tmp, v->name, v->value);




More information about the asterisk-commits mailing list