[asterisk-commits] dhubbard: branch dhubbard/pinecowbell r169151 - /team/dhubbard/pinecowbell/ch...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri Jan 16 23:59:54 CST 2009


Author: dhubbard
Date: Fri Jan 16 23:59:54 2009
New Revision: 169151

URL: http://svn.digium.com/svn-view/asterisk?view=rev&rev=169151
Log:
find the correct channel out-of-service reason

Modified:
    team/dhubbard/pinecowbell/channels/chan_dahdi.c

Modified: team/dhubbard/pinecowbell/channels/chan_dahdi.c
URL: http://svn.digium.com/svn-view/asterisk/team/dhubbard/pinecowbell/channels/chan_dahdi.c?view=diff&rev=169151&r1=169150&r2=169151
==============================================================================
--- team/dhubbard/pinecowbell/channels/chan_dahdi.c (original)
+++ team/dhubbard/pinecowbell/channels/chan_dahdi.c Fri Jan 16 23:59:54 2009
@@ -11000,15 +11000,17 @@
 					else {
 #ifdef HAVE_PRI_SERVICE_MESSAGES
 						char db_chan_name[20], db_answer[5], state;
-						int why;
-						int skipit = 0;
+						int why, skipit = 0;
 						
-						snprintf(db_chan_name, sizeof(db_chan_name), "%s/%d", dahdi_db, e->restart.channel);
+						ast_mutex_lock(&pri->pvts[chanpos]->lock);
+						snprintf(db_chan_name, sizeof(db_chan_name), "%s/%d", dahdi_db, pri->pvts[chanpos]->channel);
+						ast_mutex_unlock(&pri->pvts[chanpos]->lock);
+
 						if (!ast_db_get(db_chan_name, SRVST_DBKEY, db_answer, sizeof(db_answer))) {
 							sscanf(db_answer, "%c:%d", &state, &why);
 							if (why) {
-								ast_log(LOG_NOTICE, "channel '%d' out-of-service (reason: %s), ignoring RESTART\n", e->restart.channel, 
-									(why & SRVST_FAREND) ? (why & SRVST_NEAREND) ? "both ends" : "far end" : "near end");
+								ast_log(LOG_NOTICE, "span '%d' channel '%d' out-of-service (reason: %s), ignoring RESTART\n", pri->span,
+									e->restart.channel, (why & SRVST_FAREND) ? (why & SRVST_NEAREND) ? "both ends" : "far end" : "near end");
 								skipit = 1;
 							} else {
 								ast_db_del(db_chan_name, SRVST_DBKEY);




More information about the asterisk-commits mailing list