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.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@59256 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Russell Bryant
2007-03-27 16:20:53 +00:00
parent 10760fce2c
commit c0aca26f30
2 changed files with 38 additions and 36 deletions

View File

@@ -1384,6 +1384,7 @@ static int sip_dtmfmode(struct ast_channel *chan, void *data);
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, char *funcname, char *preparse, char *buf, size_t buflen);
/*--- Debugging
Functions for enabling debug per IP or fully, or enabling history logging for
@@ -1548,6 +1549,7 @@ static const struct ast_channel_tech sip_tech = {
.send_digit_end = sip_senddigit_end,
.bridge = ast_rtp_bridge,
.send_text = sip_sendtext,
.func_channel_read = acf_channel_read,
};
/*! \brief This version of the sip channel tech has no send_digit_begin
@@ -14127,12 +14129,13 @@ static int handle_request_cancel(struct sip_pvt *p, struct sip_request *req)
}
}
static int acf_rtpqos_read(struct ast_channel *chan, char *funcname, char *preparse, char *buf, size_t buflen)
static int acf_channel_read(struct ast_channel *chan, 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);
);
@@ -14141,8 +14144,12 @@ static int acf_rtpqos_read(struct ast_channel *chan, char *funcname, char *prepa
/* 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));
@@ -17373,27 +17380,6 @@ static struct ast_cli_entry cli_sip[] = {
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\" or \"video\".\n",
.syntax = "RTPQOS(<type>|<field>)",
.read = acf_rtpqos_read,
};
/*! \brief PBX load module - initialization */
static int load_module(void)
{
@@ -17443,7 +17429,6 @@ static int load_module(void)
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,
@@ -17473,7 +17458,6 @@ static int unload_module(void)
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);