[asterisk-commits] russell: trunk r59257 - in /trunk: ./ channels/chan_sip.c funcs/func_channel.c

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Tue Mar 27 09:25:02 MST 2007


Author: russell
Date: Tue Mar 27 11:25:02 2007
New Revision: 59257

URL: http://svn.digium.com/view/asterisk?view=rev&rev=59257
Log:
Merged revisions 59256 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r59256 | russell | 2007-03-27 11:20:53 -0500 (Tue, 27 Mar 2007) | 4 lines

Convert the RTPQOS function to just be additional parameter of the CHANNEL
function.  This way, it will be possible for other RTP based channel drivers
to expose this information in the future.

........

Modified:
    trunk/   (props changed)
    trunk/channels/chan_sip.c
    trunk/funcs/func_channel.c

Propchange: trunk/
------------------------------------------------------------------------------
Binary property 'branch-1.4-merged' - no diff available.

Modified: trunk/channels/chan_sip.c
URL: http://svn.digium.com/view/asterisk/trunk/channels/chan_sip.c?view=diff&rev=59257&r1=59256&r2=59257
==============================================================================
--- trunk/channels/chan_sip.c (original)
+++ trunk/channels/chan_sip.c Tue Mar 27 11:25:02 2007
@@ -1428,6 +1428,7 @@
 static int sip_addheader(struct ast_channel *chan, void *data);
 static int sip_do_reload(enum channelreloadreason reason);
 static int sip_reload(int fd, int argc, char *argv[]);
+static int acf_channel_read(struct ast_channel *chan, const char *funcname, char *preparse, char *buf, size_t buflen);
 
 /*--- Debugging 
 	Functions for enabling debug per IP or fully, or enabling history logging for
@@ -1593,6 +1594,7 @@
 	.bridge = ast_rtp_bridge,
 	.early_bridge = ast_rtp_early_bridge,
 	.send_text = sip_sendtext,
+	.func_channel_read = acf_channel_read,
 };
 
 /*! \brief This version of the sip channel tech has no send_digit_begin
@@ -14800,12 +14802,13 @@
 	}
 }
 
-static int acf_rtpqos_read(struct ast_channel *chan, const char *funcname, char *preparse, char *buf, size_t buflen)
+static int acf_channel_read(struct ast_channel *chan, const char *funcname, char *preparse, char *buf, size_t buflen)
 {
 	struct ast_rtp_quality qos;
 	struct sip_pvt *p = chan->tech_pvt;
 	char *all = "", *parse = ast_strdupa(preparse);
 	AST_DECLARE_APP_ARGS(args,
+		AST_APP_ARG(param);
 		AST_APP_ARG(type);
 		AST_APP_ARG(field);
 	);
@@ -14814,7 +14817,11 @@
 	/* Sanity check */
 	if (chan->tech != &sip_tech && chan->tech != &sip_tech_info) {
 		ast_log(LOG_ERROR, "Cannot call %s on a non-SIP channel\n", funcname);
-	}
+		return 0;
+	}
+
+	if (!strcasecmp(args.param, "rtpqos"))
+		return 0;
 
 	memset(buf, 0, buflen);
 	memset(&qos, 0, sizeof(qos));
@@ -18135,27 +18142,6 @@
 	sip_reload_usage },
 };
 
-struct ast_custom_function acf_rtpqos = {
-	.name = "RTPQOS",
-	.synopsis = "Retrieve statistics about an RTP stream",
-	.desc =
-"The following statistics may be retrieved:\n"
-"  local_ssrc         - Local SSRC (stream ID)\n"
-"  local_lostpackets  - Local lost packets\n"
-"  local_jitter       - Local calculated jitter\n"
-"  local_count        - Number of received packets\n"
-"  remote_ssrc        - Remote SSRC (stream ID)\n"
-"  remote_lostpackets - Remote lost packets\n"
-"  remote_jitter      - Remote reported jitter\n"
-"  remote_count       - Number of transmitted packets\n"
-"  rtt                - Round trip time\n"
-"  all                - All statistics (in a form suited to logging, but not for parsing)\n"
-"\n"
-"Type may be specified as \"audio\", \"video\", or \"text\".\n",
-	.syntax = "RTPQOS(<type>|<field>)",
-	.read = acf_rtpqos_read,
-};
-
 /*! \brief PBX load module - initialization */
 static int load_module(void)
 {
@@ -18205,7 +18191,6 @@
 	ast_custom_function_register(&sippeer_function);
 	ast_custom_function_register(&sipchaninfo_function);
 	ast_custom_function_register(&checksipdomain_function);
-	ast_custom_function_register(&acf_rtpqos);
 
 	/* Register manager commands */
 	ast_manager_register2("SIPpeers", EVENT_FLAG_SYSTEM, manager_sip_show_peers,
@@ -18235,7 +18220,6 @@
 	ast_custom_function_unregister(&sippeer_function);
 	ast_custom_function_unregister(&sip_header_function);
 	ast_custom_function_unregister(&checksipdomain_function);
-	ast_custom_function_unregister(&acf_rtpqos);
 
 	/* Unregister dial plan applications */
 	ast_unregister_application(app_dtmfmode);

Modified: trunk/funcs/func_channel.c
URL: http://svn.digium.com/view/asterisk/trunk/funcs/func_channel.c?view=diff&rev=59257&r1=59256&r2=59257
==============================================================================
--- trunk/funcs/func_channel.c (original)
+++ trunk/funcs/func_channel.c Tue Mar 27 11:25:02 2007
@@ -150,18 +150,37 @@
 	.syntax = "CHANNEL(item)",
 	.desc = "Gets/set various pieces of information about the channel.\n"
 		"Standard items (provided by all channel technologies) are:\n"
-		"R/O	audioreadformat		format currently being read\n"
-		"R/O	audionativeformat 	format used natively for audio\n"
-		"R/O	audiowriteformat 	format currently being written\n"
-		"R/W	callgroup		call groups for call pickup\n"
-		"R/O	channeltype		technology used for channel\n"
-		"R/W	language 		language for sounds played\n"
-		"R/W	musicclass 		class (from musiconhold.conf) for hold music\n"
-		"R/W	rxgain			set rxgain level on channel drivers that support it\n"
-		"R/O	state			state for channel\n"
-		"R/W	tonezone 		zone for indications played\n"
-		"R/W	txgain			set txgain level on channel drivers that support it\n"
-		"R/O	videonativeformat 	format used natively for video\n"
+		"R/O	audioreadformat    format currently being read\n"
+		"R/O	audionativeformat  format used natively for audio\n"
+		"R/O	audiowriteformat   format currently being written\n"
+		"R/W	callgroup          call groups for call pickup\n"
+		"R/O	channeltype        technology used for channel\n"
+		"R/W	language           language for sounds played\n"
+		"R/W	musicclass         class (from musiconhold.conf) for hold music\n"
+		"R/W	rxgain             set rxgain level on channel drivers that support it\n"
+		"R/O	state              state for channel\n"
+		"R/W	tonezone           zone for indications played\n"
+		"R/W	txgain             set txgain level on channel drivers that support it\n"
+		"R/O	videonativeformat  format used natively for video\n"
+		"\n"
+		"chan_sip provides the following additional options:\n"
+		"R/O    rtpqos             Get QOS information about the RTP stream\n"
+		"       This option takes two additional arguments:\n"
+		"  Argument 1:\n"
+		"    audio                 Get data about the audio stream\n"
+		"    video                 Get data about the video stream\n"
+		"    text                  Get data about the text stream\n"
+		"  Argument 2:\n"
+		"    local_ssrc            Local SSRC (stream ID)\n"
+		"    local_lostpackets     Local lost packets\n"
+		"    local_jitter          Local calculated jitter\n"
+		"    local_count           Number of received packets\n"
+		"    remote_ssrc           Remote SSRC (stream ID)\n"
+		"    remote_lostpackets    Remote lost packets\n"
+		"    remote_jitter         Remote reported jitter\n"
+		"    remote_count          Number of transmitted packets\n"
+		"    rtt                   Round trip time\n"
+		"    all                   All statistics (in a form suited to logging, but not for parsing)\n"
 		"\n"
 		"Additional items may be available from the channel driver providing\n"
 		"the channel; see its documentation for details.\n"



More information about the asterisk-commits mailing list