[svn-commits] kmoore: branch kmoore/channel_event_refactor r392845 - in /team/kmoore/channe...

SVN commits to the Digium repositories svn-commits at lists.digium.com
Tue Jun 25 09:01:29 CDT 2013


Author: kmoore
Date: Tue Jun 25 09:01:26 2013
New Revision: 392845

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=392845
Log:
Address most of Matt's comments

Modified:
    team/kmoore/channel_event_refactor/CHANGES
    team/kmoore/channel_event_refactor/channels/chan_dahdi.c
    team/kmoore/channel_event_refactor/channels/chan_sip.c
    team/kmoore/channel_event_refactor/channels/sig_analog.c

Modified: team/kmoore/channel_event_refactor/CHANGES
URL: http://svnview.digium.com/svn/asterisk/team/kmoore/channel_event_refactor/CHANGES?view=diff&rev=392845&r1=392844&r2=392845
==============================================================================
--- team/kmoore/channel_event_refactor/CHANGES (original)
+++ team/kmoore/channel_event_refactor/CHANGES Tue Jun 25 09:01:26 2013
@@ -246,6 +246,9 @@
 
  * The "Agentlogin" and "Agentlogoff" events have been renamed "AgentLogin" and
    "AgentLogoff" respectively.
+
+ * The "Channel" key used in the "AlarmClear", "Alarm", and "DNDState" has been
+   renamed "DAHDIChannel" since it does not convey an Asterisk channel name.
 
 AGI (Asterisk Gateway Interface)
 ------------------

Modified: team/kmoore/channel_event_refactor/channels/chan_dahdi.c
URL: http://svnview.digium.com/svn/asterisk/team/kmoore/channel_event_refactor/channels/chan_dahdi.c?view=diff&rev=392845&r1=392844&r2=392845
==============================================================================
--- team/kmoore/channel_event_refactor/channels/chan_dahdi.c (original)
+++ team/kmoore/channel_event_refactor/channels/chan_dahdi.c Tue Jun 25 09:01:26 2013
@@ -301,8 +301,9 @@
 		<managerEventInstance class="EVENT_FLAG_SYSTEM">
 			<synopsis>Raised when an alarm is cleared on a DAHDI channel.</synopsis>
 			<syntax>
-				<parameter name="Channel">
-					<para>The channel on which the alarm was cleared.</para>
+				<parameter name="DAHDIChannel">
+					<para>The DAHDI channel on which the alarm was cleared.</para>
+					<note><para>This is not an Asterisk channel identifier.</para></note>
 				</parameter>
 			</syntax>
 		</managerEventInstance>
@@ -321,8 +322,9 @@
 		<managerEventInstance class="EVENT_FLAG_SYSTEM">
 			<synopsis>Raised when the Do Not Disturb state is changed on a DAHDI channel.</synopsis>
 			<syntax>
-				<parameter name="Channel">
-					<para>The DAHDI channel on which DND status changed prefixed with <literal>DAHDI/</literal>.</para>
+				<parameter name="DAHDIChannel">
+					<para>The DAHDI channel on which DND status changed.</para>
+					<note><para>This is not an Asterisk channel identifier.</para></note>
 				</parameter>
 				<parameter name="Status">
 					<enumlist>
@@ -337,8 +339,9 @@
 		<managerEventInstance class="EVENT_FLAG_SYSTEM">
 			<synopsis>Raised when an alarm is set on a DAHDI channel.</synopsis>
 			<syntax>
-				<parameter name="Channel">
+				<parameter name="DAHDIChannel">
 					<para>The channel on which the alarm occurred.</para>
+					<note><para>This is not an Asterisk channel identifier.</para></note>
 				</parameter>
 				<parameter name="Alarm">
 					<para>A textual description of the alarm that occurred.</para>
@@ -4067,13 +4070,18 @@
 static void publish_channel_alarm_clear(int channel)
 {
 	RAII_VAR(struct ast_json *, body, NULL, ast_json_unref);
-
-	ast_log(LOG_NOTICE, "Alarm cleared on channel %d\n", channel);
-	body = ast_json_pack("{s: i}", "Channel", channel);
+	RAII_VAR(struct ast_str *, dahdi_chan, ast_str_create(32), ast_free);
+	if (!dahdi_chan) {
+		return;
+	}
+
+	ast_str_set(&dahdi_chan, 0, "%d", channel);
+	ast_log(LOG_NOTICE, "Alarm cleared on channel DAHDI/%d\n", channel);
+	body = ast_json_pack("{s: s}", "DAHDIChannel", ast_str_buffer(dahdi_chan));
 	if (!body) {
 		return;
 	}
-	
+
 	ast_manager_publish_event("AlarmClear", EVENT_FLAG_SYSTEM, body);
 }
 
@@ -4086,7 +4094,7 @@
 	if (!body) {
 		return;
 	}
-	
+
 	ast_manager_publish_event("SpanAlarmClear", EVENT_FLAG_SYSTEM, body);
 }
 
@@ -8169,21 +8177,26 @@
 	if (!body) {
 		return;
 	}
-	
+
 	ast_manager_publish_event("SpanAlarm", EVENT_FLAG_SYSTEM, body);
 }
 
 static void publish_channel_alarm(int channel, const char *alarm_txt)
 {
 	RAII_VAR(struct ast_json *, body, NULL, ast_json_unref);
-
-	body = ast_json_pack("{s: i, s: s}",
-		"Channel", channel,
+	RAII_VAR(struct ast_str *, dahdi_chan, ast_str_create(32), ast_free);
+	if (!dahdi_chan) {
+		return;
+	}
+
+	ast_str_set(&dahdi_chan, 0, "%d", channel);
+	body = ast_json_pack("{s: s, s: s}",
+		"DAHDIChannel", ast_str_buffer(dahdi_chan),
 		"Alarm", alarm_txt);
 	if (!body) {
 		return;
 	}
-	
+
 	ast_manager_publish_event("Alarm", EVENT_FLAG_SYSTEM, body);
 }
 
@@ -10225,16 +10238,16 @@
 		return;
 	}
 
-	ast_str_set(&dahdichan, 0, "DAHDI/%d", channel);
-
-	ast_log(LOG_NOTICE, "Alarm cleared on channel %d\n", channel);
+	ast_str_set(&dahdichan, 0, "%d", channel);
+
+	ast_log(LOG_NOTICE, "Alarm cleared on channel DAHDI/%d\n", channel);
 	body = ast_json_pack("{s: s, s: s}",
-		"Channel", ast_str_buffer(dahdichan),
+		"DAHDIChannel", ast_str_buffer(dahdichan),
 		"Status", status);
 	if (!body) {
 		return;
 	}
-	
+
 	ast_manager_publish_event("DNDState", EVENT_FLAG_SYSTEM, body);
 }
 
@@ -10263,11 +10276,6 @@
 			flag? "Enabled" : "Disabled",
 			dahdichan->channel);
 	publish_dnd_state(dahdichan->channel, flag ? "enabled" : "disabled");
-	manager_event(EVENT_FLAG_SYSTEM, "DNDState",
-			"Channel: DAHDI/%d\r\n"
-			"Status: %s\r\n", dahdichan->channel,
-			flag? "enabled" : "disabled");
-
 	return 0;
 }
 

Modified: team/kmoore/channel_event_refactor/channels/chan_sip.c
URL: http://svnview.digium.com/svn/asterisk/team/kmoore/channel_event_refactor/channels/chan_sip.c?view=diff&rev=392845&r1=392844&r2=392845
==============================================================================
--- team/kmoore/channel_event_refactor/channels/chan_sip.c (original)
+++ team/kmoore/channel_event_refactor/channels/chan_sip.c Tue Jun 25 09:01:26 2013
@@ -645,6 +645,10 @@
 				<xi:include xpointer="xpointer(/docs/managerEvent[@name='Newchannel']/managerEventInstance/syntax/parameter)" />
 				<parameter name="Source">
 					<para>The source of the session timeout.</para>
+					<enumlist>
+						<enum name="RTPTimeout" />
+						<enum name="SIPSessionTimer" />
+					</enumlist>
 				</parameter>
 			</syntax>
 		</managerEventInstance>
@@ -20052,7 +20056,7 @@
 	if (!body) {
 		return;
 	}
-	
+
 	ast_manager_publish_event("SIPQualifyPeerDone", EVENT_FLAG_CALL, body);
 }
 

Modified: team/kmoore/channel_event_refactor/channels/sig_analog.c
URL: http://svnview.digium.com/svn/asterisk/team/kmoore/channel_event_refactor/channels/sig_analog.c?view=diff&rev=392845&r1=392844&r2=392845
==============================================================================
--- team/kmoore/channel_event_refactor/channels/sig_analog.c (original)
+++ team/kmoore/channel_event_refactor/channels/sig_analog.c Tue Jun 25 09:01:26 2013
@@ -2631,7 +2631,7 @@
 	if (!body) {
 		return;
 	}
-	
+
 	ast_manager_publish_event("AlarmClear", EVENT_FLAG_SYSTEM, body);
 }
 
@@ -3961,7 +3961,7 @@
 	if (!body) {
 		return;
 	}
-	
+
 	ast_manager_publish_event("DNDState", EVENT_FLAG_SYSTEM, body);
 }
 




More information about the svn-commits mailing list