VoIP Mailing List Archives
Mailing list archives for the VoIP community |
|
View previous topic :: View next topic |
Author |
Message |
regs at kinetix.gr Guest
|
Posted: Thu Jul 16, 2009 9:43 am Post subject: [Freeswitch-users] "show channels" command with du |
|
|
Now that I come to think of it...
It would be useful if we had the timestamp (and epoch)
of the events PROGRESS and PROGRESS WITH MEDIA so that we can extract
the PDD (Post Dial Delay) which is a very useful statistic.
Adding the user's (for the incoming) and the gateway's (for the
outbound) id would also be useful. In case these fields are empty the
show channels command could ommit the (empty string).
Are you planning to implement them yourselves or should I begin looking
at the code?
Anthony Minessale wrote:
Quote: | I'm ok with the idea as long as it's thoroughly tested.
If there is any more info you want to save from those events you should
consider it now while we are modifying it.
On Thu, Jul 16, 2009 at 9:02 AM, <freeswitch-users@lists.freeswitch.org
<mailto:freeswitch-users@lists.freeswitch.org>> wrote:
Hi,
I usually find it very useful when I can retrieve a list of the
currents calls along with durations. I noticed that the 'show
channels' format does not include the duration (or the answered
timestamp - so that one can extract it from there). So, I made a
patch that includes the answered timestamp, the answered timestamp
in epoch, and the duration in seconds. Of course these fields remain
empty when the call hasn't been
answered yet.
I don't know if anyone else finds this functionality useful, so I am
posting this patch here first (instead of JIRA) in order to get
feedback from the users. If many of you (or the maintainers) find it
interesting I can then proceed in posting it to JIRA.
--
-------------------------------------------
Apostolos Pantsiopoulos
Kinetix Tele.com R & D
email: regs@kinetix.gr <mailto:regs@kinetix.gr>
-------------------------------------------
Index: src/mod/applications/mod_commands/mod_commands.c
===================================================================
--- src/mod/applications/mod_commands/mod_commands.c (revision 14256)
+++ src/mod/applications/mod_commands/mod_commands.c (working copy)
@@ -2827,10 +2827,10 @@
}
}
if (strchr(argv[2], '%')) {
- sprintf(sql, "select * from channels
where uuid like '%s' or name like '%s' or cid_name like '%s' or
cid_num like '%s' order by created_epoch",
+ sprintf(sql, "select
*,strftime('%%s',DATETIME('NOW'))-answered_epoch as duration from
channels where uuid like '%s' or name like '%s' or cid_name like
'%s' or cid_num like '%s' order by created_epoch",
argv[2], argv[2],
argv[2], argv[2]);
} else {
- sprintf(sql, "select * from channels
where uuid like '%%%s%%' or name like '%%%s%%' or cid_name like
'%%%s%%' or cid_num like '%%%s%%' order by created_epoch",
+ sprintf(sql, "select
*,strftime('%%s',DATETIME('NOW'))-answered_epoch as duration from
channels where uuid like '%%%s%%' or name like '%%%s%%' or cid_name
like '%%%s%%' or cid_num like '%%%s%%' order by created_epoch",
argv[2], argv[2],
argv[2], argv[2]);
}
@@ -2839,10 +2839,10 @@
as = argv[4];
}
} else {
- sprintf(sql, "select * from channels order
by created_epoch");
+ sprintf(sql, "select
*,strftime('%%s',DATETIME('NOW'))-answered_epoch as duration from
channels order by created_epoch");
}
} else if (!strcasecmp(command, "channels")) {
- sprintf(sql, "select * from channels order by
created_epoch");
+ sprintf(sql, "select
*,strftime('%%s',DATETIME('NOW'))-answered_epoch as duration from
channels order by created_epoch");
if (argv[1] && !strcasecmp(argv[1],"count")) {
holder.justcount = 1;
if (argv[3] && !strcasecmp(argv[2], "as")) {
@@ -2850,7 +2850,7 @@
}
}
} else if (!strcasecmp(command, "distinct_channels")) {
- sprintf(sql, "select * from channels left join calls
on "
+ sprintf(sql, "select
*,strftime('%%s',DATETIME('NOW'))-answered_epoch as duration from
channels left join calls on "
"channels.uuid=calls.caller_uuid
where channels.uuid not in (select callee_uuid from calls) order by
created_epoch");
if (argv[2] && !strcasecmp(argv[1], "as")) {
as = argv[2];
Index: src/switch_core_sqldb.c
===================================================================
--- src/switch_core_sqldb.c (revision 14256)
+++ src/switch_core_sqldb.c (working copy)
@@ -309,9 +309,21 @@
);
break;
+ case SWITCH_EVENT_CHANNEL_ANSWER:
+ {
+
+ sql = switch_mprintf("update channels set
answered='%s',answered_epoch='%ld' where uuid='%s'",
+
switch_event_get_header_nil(event, "event-date-local"),
+
(long)switch_epoch_time_now(NULL),
+
switch_event_get_header_nil(event, "unique-id")
+ );
+
+ }
+ break;
case SWITCH_EVENT_CHANNEL_STATE:
{
char *state =
switch_event_get_header_nil(event, "channel-state-number");
+
switch_channel_state_t state_i = CS_DESTROY;
if (!switch_strlen_zero(state)) {
@@ -492,7 +504,9 @@
" read_rate VARCHAR(255),\n"
" write_codec VARCHAR(255),\n"
" write_rate VARCHAR(255),\n"
- " secure VARCHAR(255)\n"
+ " secure VARCHAR(255),\n"
+ " answered VARCHAR(255),\n"
+ " answered_epoch INTEGER\n"
");\ncreate index uuindex on channels (uuid);\n";
char create_calls_sql[] =
"CREATE TABLE calls (\n"
_______________________________________________
FreeSWITCH-users mailing list
FreeSWITCH-users@lists.freeswitch.org
<mailto:FreeSWITCH-users@lists.freeswitch.org>
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org
--
Anthony Minessale II
FreeSWITCH http://www.freeswitch.org/
ClueCon http://www.cluecon.com/
Twitter: http://twitter.com/FreeSWITCH_wire
AIM: anthm
MSN:anthony_minessale@hotmail.com
<mailto:MSN%3Aanthony_minessale@hotmail.com>
GTALK/JABBER/PAYPAL:anthony.minessale@gmail.com
<mailto:PAYPAL%3Aanthony.minessale@gmail.com>
IRC: irc.freenode.net <http://irc.freenode.net> #freeswitch
FreeSWITCH Developer Conference
sip:888@conference.freeswitch.org
<mailto:sip%3A888@conference.freeswitch.org>
iax:guest@conference.freeswitch.org/888
<http://iax:guest@conference.freeswitch.org/888>
googletalk:conf+888@conference.freeswitch.org
<mailto:googletalk%3Aconf%2B888@conference.freeswitch.org>
pstn:213-799-1400
------------------------------------------------------------------------
_______________________________________________
FreeSWITCH-users mailing list
FreeSWITCH-users@lists.freeswitch.org
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org
|
--
-------------------------------------------
Apostolos Pantsiopoulos
Kinetix Tele.com R & D
email: regs@kinetix.gr
-------------------------------------------
_______________________________________________
FreeSWITCH-users mailing list
FreeSWITCH-users@lists.freeswitch.org
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org |
|
Back to top |
|
|
msc at freeswitch.org Guest
|
Posted: Thu Jul 16, 2009 9:57 am Post subject: [Freeswitch-users] "show channels" command with du |
|
|
I wonder if it would make sense to create a separate sub-command like
"show channels stats" or something. That way we could put all sorts of
nifty info there without breaking the existing command.
Thoughts?
-MC
Sent from my iPhone
On Jul 16, 2009, at 7:37 AM, Apostolos Pantsiopoulos <regs@kinetix.gr>
wrote:
Quote: | Now that I come to think of it...
It would be useful if we had the timestamp (and epoch)
of the events PROGRESS and PROGRESS WITH MEDIA so that we can extract
the PDD (Post Dial Delay) which is a very useful statistic.
Adding the user's (for the incoming) and the gateway's (for the
outbound) id would also be useful. In case these fields are empty the
show channels command could ommit the (empty string).
Are you planning to implement them yourselves or should I begin
looking
at the code?
Anthony Minessale wrote:
Quote: | I'm ok with the idea as long as it's thoroughly tested.
If there is any more info you want to save from those events you
should
consider it now while we are modifying it.
On Thu, Jul 16, 2009 at 9:02 AM, <freeswitch-users@lists.freeswitch.org
<mailto:freeswitch-users@lists.freeswitch.org>> wrote:
Hi,
I usually find it very useful when I can retrieve a list of the
currents calls along with durations. I noticed that the 'show
channels' format does not include the duration (or the answered
timestamp - so that one can extract it from there). So, I made a
patch that includes the answered timestamp, the answered timestamp
in epoch, and the duration in seconds. Of course these fields
remain
empty when the call hasn't been
answered yet.
I don't know if anyone else finds this functionality useful, so
I am
posting this patch here first (instead of JIRA) in order to get
feedback from the users. If many of you (or the maintainers)
find it
interesting I can then proceed in posting it to JIRA.
--
-------------------------------------------
Apostolos Pantsiopoulos
Kinetix Tele.com R & D
email: regs@kinetix.gr <mailto:regs@kinetix.gr>
-------------------------------------------
Index: src/mod/applications/mod_commands/mod_commands.c
===================================================================
--- src/mod/applications/mod_commands/mod_commands.c
(revision 14256)
+++ src/mod/applications/mod_commands/mod_commands.c (working
copy)
@@ -2827,10 +2827,10 @@
}
}
if (strchr(argv[2], '%')) {
- sprintf(sql, "select * from
channels
where uuid like '%s' or name like '%s' or cid_name like '%s' or
cid_num like '%s' order by created_epoch",
+ sprintf(sql, "select
*,strftime('%%s',DATETIME('NOW'))-answered_epoch as duration from
channels where uuid like '%s' or name like '%s' or cid_name like
'%s' or cid_num like '%s' order by created_epoch",
argv[2], argv[2],
argv[2], argv[2]);
} else {
- sprintf(sql, "select * from
channels
where uuid like '%%%s%%' or name like '%%%s%%' or cid_name like
'%%%s%%' or cid_num like '%%%s%%' order by created_epoch",
+ sprintf(sql, "select
*,strftime('%%s',DATETIME('NOW'))-answered_epoch as duration from
channels where uuid like '%%%s%%' or name like '%%%s%%' or
cid_name
like '%%%s%%' or cid_num like '%%%s%%' order by created_epoch",
argv[2], argv[2],
argv[2], argv[2]);
}
@@ -2839,10 +2839,10 @@
as = argv[4];
}
} else {
- sprintf(sql, "select * from channels order
by created_epoch");
+ sprintf(sql, "select
*,strftime('%%s',DATETIME('NOW'))-answered_epoch as duration from
channels order by created_epoch");
}
} else if (!strcasecmp(command, "channels")) {
- sprintf(sql, "select * from channels order by
created_epoch");
+ sprintf(sql, "select
*,strftime('%%s',DATETIME('NOW'))-answered_epoch as duration from
channels order by created_epoch");
if (argv[1] && !strcasecmp(argv[1],"count")) {
holder.justcount = 1;
if (argv[3] && !strcasecmp(argv[2], "as")) {
@@ -2850,7 +2850,7 @@
}
}
} else if (!strcasecmp(command, "distinct_channels")) {
- sprintf(sql, "select * from channels left join
calls
on "
+ sprintf(sql, "select
*,strftime('%%s',DATETIME('NOW'))-answered_epoch as duration from
channels left join calls on "
"channels.uuid=calls.caller_uuid
where channels.uuid not in (select callee_uuid from calls) order
by
created_epoch");
if (argv[2] && !strcasecmp(argv[1], "as")) {
as = argv[2];
Index: src/switch_core_sqldb.c
===================================================================
--- src/switch_core_sqldb.c (revision 14256)
+++ src/switch_core_sqldb.c (working copy)
@@ -309,9 +309,21 @@
);
break;
+ case SWITCH_EVENT_CHANNEL_ANSWER:
+ {
+
+ sql = switch_mprintf("update channels set
answered='%s',answered_epoch='%ld' where uuid='%s'",
+
switch_event_get_header_nil(event, "event-date-local"),
+
(long)switch_epoch_time_now(NULL),
+
switch_event_get_header_nil(event, "unique-id")
+ );
+
+ }
+ break;
case SWITCH_EVENT_CHANNEL_STATE:
{
char *state =
switch_event_get_header_nil(event, "channel-state-number");
+
switch_channel_state_t state_i =
CS_DESTROY;
if (!switch_strlen_zero(state)) {
@@ -492,7 +504,9 @@
" read_rate VARCHAR(255),\n"
" write_codec VARCHAR(255),\n"
" write_rate VARCHAR(255),\n"
- " secure VARCHAR(255)\n"
+ " secure VARCHAR(255),\n"
+ " answered VARCHAR(255),\n"
+ " answered_epoch INTEGER\n"
");\ncreate index uuindex on channels
(uuid);\n";
char create_calls_sql[] =
"CREATE TABLE calls (\n"
_______________________________________________
FreeSWITCH-users mailing list
FreeSWITCH-users@lists.freeswitch.org
<mailto:FreeSWITCH-users@lists.freeswitch.org>
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org
--
Anthony Minessale II
FreeSWITCH http://www.freeswitch.org/
ClueCon http://www.cluecon.com/
Twitter: http://twitter.com/FreeSWITCH_wire
AIM: anthm
MSN:anthony_minessale@hotmail.com
<mailto:MSN%3Aanthony_minessale@hotmail.com>
GTALK/JABBER/PAYPAL:anthony.minessale@gmail.com
<mailto:PAYPAL%3Aanthony.minessale@gmail.com>
IRC: irc.freenode.net <http://irc.freenode.net> #freeswitch
FreeSWITCH Developer Conference
sip:888@conference.freeswitch.org
<mailto:sip%3A888@conference.freeswitch.org>
iax:guest@conference.freeswitch.org/888
<http://iax:guest@conference.freeswitch.org/888>
googletalk:conf+888@conference.freeswitch.org
<mailto:googletalk%3Aconf%2B888@conference.freeswitch.org>
pstn:213-799-1400
---
---------------------------------------------------------------------
_______________________________________________
FreeSWITCH-users mailing list
FreeSWITCH-users@lists.freeswitch.org
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org
|
--
-------------------------------------------
Apostolos Pantsiopoulos
Kinetix Tele.com R & D
email: regs@kinetix.gr
-------------------------------------------
_______________________________________________
FreeSWITCH-users mailing list
FreeSWITCH-users@lists.freeswitch.org
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org
|
_______________________________________________
FreeSWITCH-users mailing list
FreeSWITCH-users@lists.freeswitch.org
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org |
|
Back to top |
|
|
regs at kinetix.gr Guest
|
Posted: Thu Jul 16, 2009 10:17 am Post subject: [Freeswitch-users] "show channels" command with du |
|
|
OK I 'll start implementing the progress timestamp field.
The only reason I mentioned the user/gateway id field is that FS admins
gain a lot by looking at a row of "show channels" result and be able to
see who is the caller and who is the callee.
Anthony Minessale wrote:
Quote: | it doesn't really break anything to add more fields besides the ability
to read it but it's already fairly wide as it is.
Thats why we have "show channels as xml"
On Thu, Jul 16, 2009 at 9:50 AM, Michael S Collins <msc@freeswitch.org
<mailto:msc@freeswitch.org>> wrote:
I wonder if it would make sense to create a separate sub-command like
"show channels stats" or something. That way we could put all sorts of
nifty info there without breaking the existing command.
Thoughts?
-MC
Sent from my iPhone
On Jul 16, 2009, at 7:37 AM, Apostolos Pantsiopoulos
<regs@kinetix.gr <mailto:regs@kinetix.gr>>
wrote:
Quote: | Now that I come to think of it...
It would be useful if we had the timestamp (and epoch)
of the events PROGRESS and PROGRESS WITH MEDIA so that we can extract
the PDD (Post Dial Delay) which is a very useful statistic.
Adding the user's (for the incoming) and the gateway's (for the
outbound) id would also be useful. In case these fields are empty the
show channels command could ommit the (empty string).
Are you planning to implement them yourselves or should I begin
looking
at the code?
Anthony Minessale wrote:
Quote: | I'm ok with the idea as long as it's thoroughly tested.
If there is any more info you want to save from those events you
should
consider it now while we are modifying it.
On Thu, Jul 16, 2009 at 9:02 AM,
|
| <freeswitch-users@lists.freeswitch.org
<mailto:freeswitch-users@lists.freeswitch.org>
Quote: | Quote: | <mailto:freeswitch-users@lists.freeswitch.org
|
| <mailto:freeswitch-users@lists.freeswitch.org>>> wrote:
Quote: | Quote: |
Hi,
I usually find it very useful when I can retrieve a list of the
currents calls along with durations. I noticed that the 'show
channels' format does not include the duration (or the answered
timestamp - so that one can extract it from there). So, I made a
patch that includes the answered timestamp, the answered
|
| timestamp
Quote: | Quote: | in epoch, and the duration in seconds. Of course these fields
remain
empty when the call hasn't been
answered yet.
I don't know if anyone else finds this functionality useful, so
I am
posting this patch here first (instead of JIRA) in order to get
feedback from the users. If many of you (or the maintainers)
find it
interesting I can then proceed in posting it to JIRA.
--
-------------------------------------------
Apostolos Pantsiopoulos
Kinetix Tele.com R & D
email: regs@kinetix.gr <mailto:regs@kinetix.gr>
|
| <mailto:regs@kinetix.gr <mailto:regs@kinetix.gr>>
Quote: | Quote: | -------------------------------------------
Index: src/mod/applications/mod_commands/mod_commands.c
===================================================================
--- src/mod/applications/mod_commands/mod_commands.c
(revision 14256)
+++ src/mod/applications/mod_commands/mod_commands.c (working
copy)
@@ -2827,10 +2827,10 @@
}
}
if (strchr(argv[2], '%')) {
- sprintf(sql, "select * from
channels
where uuid like '%s' or name like '%s' or cid_name like '%s' or
cid_num like '%s' order by created_epoch",
+ sprintf(sql, "select
*,strftime('%%s',DATETIME('NOW'))-answered_epoch as duration from
channels where uuid like '%s' or name like '%s' or cid_name like
'%s' or cid_num like '%s' order by created_epoch",
argv[2], argv[2],
argv[2], argv[2]);
} else {
- sprintf(sql, "select * from
channels
where uuid like '%%%s%%' or name like '%%%s%%' or cid_name like
'%%%s%%' or cid_num like '%%%s%%' order by created_epoch",
+ sprintf(sql, "select
*,strftime('%%s',DATETIME('NOW'))-answered_epoch as duration from
channels where uuid like '%%%s%%' or name like '%%%s%%' or
cid_name
like '%%%s%%' or cid_num like '%%%s%%' order by created_epoch",
argv[2], argv[2],
argv[2], argv[2]);
}
@@ -2839,10 +2839,10 @@
as = argv[4];
}
} else {
- sprintf(sql, "select * from channels
|
| order
Quote: | Quote: | by created_epoch");
+ sprintf(sql, "select
*,strftime('%%s',DATETIME('NOW'))-answered_epoch as duration from
channels order by created_epoch");
}
} else if (!strcasecmp(command, "channels")) {
- sprintf(sql, "select * from channels order by
created_epoch");
+ sprintf(sql, "select
*,strftime('%%s',DATETIME('NOW'))-answered_epoch as duration from
channels order by created_epoch");
if (argv[1] && !strcasecmp(argv[1],"count")) {
holder.justcount = 1;
if (argv[3] && !strcasecmp(argv[2], "as")) {
@@ -2850,7 +2850,7 @@
}
}
} else if (!strcasecmp(command, "distinct_channels")) {
- sprintf(sql, "select * from channels left join
calls
on "
+ sprintf(sql, "select
*,strftime('%%s',DATETIME('NOW'))-answered_epoch as duration from
channels left join calls on "
"channels.uuid=calls.caller_uuid
where channels.uuid not in (select callee_uuid from calls) order
by
created_epoch");
if (argv[2] && !strcasecmp(argv[1], "as")) {
as = argv[2];
Index: src/switch_core_sqldb.c
===================================================================
--- src/switch_core_sqldb.c (revision 14256)
+++ src/switch_core_sqldb.c (working copy)
@@ -309,9 +309,21 @@
);
break;
+ case SWITCH_EVENT_CHANNEL_ANSWER:
+ {
+
+ sql = switch_mprintf("update channels set
answered='%s',answered_epoch='%ld' where uuid='%s'",
+
switch_event_get_header_nil(event, "event-date-local"),
+
(long)switch_epoch_time_now(NULL),
+
switch_event_get_header_nil(event, "unique-id")
+ );
+
+ }
+ break;
case SWITCH_EVENT_CHANNEL_STATE:
{
char *state =
switch_event_get_header_nil(event, "channel-state-number");
+
switch_channel_state_t state_i =
CS_DESTROY;
if (!switch_strlen_zero(state)) {
@@ -492,7 +504,9 @@
" read_rate VARCHAR(255),\n"
" write_codec VARCHAR(255),\n"
" write_rate VARCHAR(255),\n"
- " secure VARCHAR(255)\n"
+ " secure VARCHAR(255),\n"
+ " answered VARCHAR(255),\n"
+ " answered_epoch INTEGER\n"
");\ncreate index uuindex on channels
(uuid);\n";
char create_calls_sql[] =
"CREATE TABLE calls (\n"
_______________________________________________
FreeSWITCH-users mailing list
FreeSWITCH-users@lists.freeswitch.org
|
| <mailto:FreeSWITCH-users@lists.freeswitch.org>
Quote: | Quote: | <mailto:FreeSWITCH-users@lists.freeswitch.org
|
| <mailto:FreeSWITCH-users@lists.freeswitch.org>>
Quote: | Quote: | http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
|
| UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
<mailto:MSN%3Aanthony_minessale@hotmail.com>
Quote: | Quote: | <mailto:MSN%3Aanthony_minessale@hotmail.com
|
| <mailto:MSN%253Aanthony_minessale@hotmail.com>>
Quote: | Quote: | GTALK/JABBER/PAYPAL:anthony.minessale@gmail.com
|
| <mailto:PAYPAL%3Aanthony.minessale@gmail.com>
Quote: | Quote: | <mailto:PAYPAL%3Aanthony.minessale@gmail.com
|
| <mailto:PAYPAL%253Aanthony.minessale@gmail.com>>
Quote: | Quote: | IRC: irc.freenode.net <http://irc.freenode.net>
|
| <http://irc.freenode.net> #freeswitch
Quote: | Quote: |
FreeSWITCH Developer Conference
sip:888@conference.freeswitch.org
|
| <mailto:sip%3A888@conference.freeswitch.org>
Quote: | Quote: | <mailto:sip%3A888@conference.freeswitch.org
|
| <mailto:sip%253A888@conference.freeswitch.org>>
Quote: | Quote: | iax:guest@conference.freeswitch.org/888
|
| <http://iax:guest@conference.freeswitch.org/888>
Quote: | Quote: | <http://iax:guest@conference.freeswitch.org/888>
googletalk:conf+888@conference.freeswitch.org
|
| <mailto:googletalk%3Aconf%2B888@conference.freeswitch.org>
Quote: | Quote: | <mailto:googletalk%3Aconf%2B888@conference.freeswitch.org
|
| <mailto:googletalk%253Aconf%252B888@conference.freeswitch.org>>
Quote: | Quote: | pstn:213-799-1400
---
|
| ---------------------------------------------------------------------
<mailto:FreeSWITCH-users@lists.freeswitch.org>
Quote: | Quote: | http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
|
| UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
Quote: | Quote: | http://www.freeswitch.org
|
--
-------------------------------------------
Apostolos Pantsiopoulos
Kinetix Tele.com R & D
email: regs@kinetix.gr <mailto:regs@kinetix.gr>
-------------------------------------------
_______________________________________________
FreeSWITCH-users mailing list
FreeSWITCH-users@lists.freeswitch.org
| <mailto:FreeSWITCH-users@lists.freeswitch.org>
Quote: | http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
| UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
Quote: | http://www.freeswitch.org
|
_______________________________________________
FreeSWITCH-users mailing list
FreeSWITCH-users@lists.freeswitch.org
<mailto:FreeSWITCH-users@lists.freeswitch.org>
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org
--
Anthony Minessale II
FreeSWITCH http://www.freeswitch.org/
ClueCon http://www.cluecon.com/
Twitter: http://twitter.com/FreeSWITCH_wire
AIM: anthm
MSN:anthony_minessale@hotmail.com
<mailto:MSN%3Aanthony_minessale@hotmail.com>
GTALK/JABBER/PAYPAL:anthony.minessale@gmail.com
<mailto:PAYPAL%3Aanthony.minessale@gmail.com>
IRC: irc.freenode.net <http://irc.freenode.net> #freeswitch
FreeSWITCH Developer Conference
sip:888@conference.freeswitch.org
<mailto:sip%3A888@conference.freeswitch.org>
iax:guest@conference.freeswitch.org/888
<http://iax:guest@conference.freeswitch.org/888>
googletalk:conf+888@conference.freeswitch.org
<mailto:googletalk%3Aconf%2B888@conference.freeswitch.org>
pstn:213-799-1400
------------------------------------------------------------------------
_______________________________________________
FreeSWITCH-users mailing list
FreeSWITCH-users@lists.freeswitch.org
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org
|
--
-------------------------------------------
Apostolos Pantsiopoulos
Kinetix Tele.com R & D
email: regs@kinetix.gr
-------------------------------------------
_______________________________________________
FreeSWITCH-users mailing list
FreeSWITCH-users@lists.freeswitch.org
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org |
|
Back to top |
|
|
mrene_lists at avgs.ca Guest
|
Posted: Thu Jul 16, 2009 10:48 am Post subject: [Freeswitch-users] "show channels" command with du |
|
|
If you want to use , within a { } block you can escape it with \,
Mathieu Rene
Avant-Garde Solutions Inc
Office: + 1 (514) 664-1044 x100
Cell: +1 (514) 664-1044 x200
mrene@avgs.ca
Am 16-Jul-09 um 11:38 AM schrieb Saeed Ahmed:
Quote: | Hi,
its very useful feature for monitoring, I am doing it with XML RPC and
getting the result on webpage.
There is one issue which is nothing to do with that patch but in
general: if
we are using absolute_codec_string variable and codes are like
G729,G723
then this *comma* between codec ruin the array. I think there should
be
other separator.
- Saeed
-----Original Message-----
From: freeswitch-users-bounces@lists.freeswitch.org
[mailto:freeswitch-users-bounces@lists.freeswitch.org] On Behalf Of
Apostolos Pantsiopoulos
Sent: Thursday, July 16, 2009 5:11 PM
To: freeswitch-users@lists.freeswitch.org
Subject: Re: [Freeswitch-users] "show channels" command with
duration -
patch included
OK I 'll start implementing the progress timestamp field.
The only reason I mentioned the user/gateway id field is that FS
admins
gain a lot by looking at a row of "show channels" result and be able
to
see who is the caller and who is the callee.
Anthony Minessale wrote:
Quote: | it doesn't really break anything to add more fields besides the
ability
to read it but it's already fairly wide as it is.
Thats why we have "show channels as xml"
On Thu, Jul 16, 2009 at 9:50 AM, Michael S Collins
<msc@freeswitch.org
<mailto:msc@freeswitch.org>> wrote:
I wonder if it would make sense to create a separate sub-command
like
"show channels stats" or something. That way we could put all
sorts of
nifty info there without breaking the existing command.
Thoughts?
-MC
Sent from my iPhone
On Jul 16, 2009, at 7:37 AM, Apostolos Pantsiopoulos
<regs@kinetix.gr <mailto:regs@kinetix.gr>>
wrote:
Quote: | Now that I come to think of it...
It would be useful if we had the timestamp (and epoch)
of the events PROGRESS and PROGRESS WITH MEDIA so that we can
|
| extract
Quote: | Quote: | the PDD (Post Dial Delay) which is a very useful statistic.
Adding the user's (for the incoming) and the gateway's (for the
outbound) id would also be useful. In case these fields are empty
|
| the
Quote: | Quote: | show channels command could ommit the (empty string).
Are you planning to implement them yourselves or should I begin
looking
at the code?
Anthony Minessale wrote:
Quote: | I'm ok with the idea as long as it's thoroughly tested.
If there is any more info you want to save from those events you
should
consider it now while we are modifying it.
On Thu, Jul 16, 2009 at 9:02 AM,
|
| <freeswitch-users@lists.freeswitch.org
<mailto:freeswitch-users@lists.freeswitch.org>
Quote: | Quote: | <mailto:freeswitch-users@lists.freeswitch.org
|
| <mailto:freeswitch-users@lists.freeswitch.org>>> wrote:
Quote: | Quote: |
Hi,
I usually find it very useful when I can retrieve a list of the
currents calls along with durations. I noticed that the 'show
channels' format does not include the duration (or the answered
timestamp - so that one can extract it from there). So, I made
|
|
| a
Quote: | Quote: | Quote: | patch that includes the answered timestamp, the answered
|
| timestamp
Quote: | Quote: | in epoch, and the duration in seconds. Of course these fields
remain
empty when the call hasn't been
answered yet.
I don't know if anyone else finds this functionality useful, so
I am
posting this patch here first (instead of JIRA) in order to get
feedback from the users. If many of you (or the maintainers)
find it
interesting I can then proceed in posting it to JIRA.
--
-------------------------------------------
Apostolos Pantsiopoulos
Kinetix Tele.com R & D
email: regs@kinetix.gr <mailto:regs@kinetix.gr>
|
| <mailto:regs@kinetix.gr <mailto:regs@kinetix.gr>>
Quote: | Quote: | -------------------------------------------
Index: src/mod/applications/mod_commands/mod_commands.c
|
|
| ===================================================================
Quote: | Quote: | Quote: | --- src/mod/applications/mod_commands/mod_commands.c
(revision 14256)
+++ src/mod/applications/mod_commands/mod_commands.c
|
|
| (working
Quote: | Quote: | Quote: | copy)
@@ -2827,10 +2827,10 @@
}
}
if (strchr(argv[2], '%')) {
- sprintf(sql, "select * from
channels
where uuid like '%s' or name like '%s' or cid_name like '%s' or
cid_num like '%s' order by created_epoch",
+ sprintf(sql, "select
*,strftime('%%s',DATETIME('NOW'))-answered_epoch as duration
|
|
| from
Quote: | Quote: | Quote: | channels where uuid like '%s' or name like '%s' or cid_name
|
|
| like
Quote: | Quote: | Quote: | '%s' or cid_num like '%s' order by created_epoch",
argv[2],
|
|
| argv[2],
Quote: | Quote: | Quote: | argv[2], argv[2]);
} else {
- sprintf(sql, "select * from
channels
where uuid like '%%%s%%' or name like '%%%s%%' or cid_name like
'%%%s%%' or cid_num like '%%%s%%' order by created_epoch",
+ sprintf(sql, "select
*,strftime('%%s',DATETIME('NOW'))-answered_epoch as duration
|
|
| from
Quote: | Quote: | Quote: | channels where uuid like '%%%s%%' or name like '%%%s%%' or
cid_name
like '%%%s%%' or cid_num like '%%%s%%' order by created_epoch",
argv[2],
|
|
| argv[2],
Quote: | Quote: | Quote: | argv[2], argv[2]);
}
@@ -2839,10 +2839,10 @@
as = argv[4];
}
} else {
- sprintf(sql, "select * from channels
|
| order
Quote: | Quote: | by created_epoch");
+ sprintf(sql, "select
*,strftime('%%s',DATETIME('NOW'))-answered_epoch as duration
|
|
| from
Quote: | Quote: | Quote: | channels order by created_epoch");
}
} else if (!strcasecmp(command, "channels")) {
- sprintf(sql, "select * from channels order by
created_epoch");
+ sprintf(sql, "select
*,strftime('%%s',DATETIME('NOW'))-answered_epoch as duration
|
|
| from
Quote: | Quote: | Quote: | channels order by created_epoch");
if (argv[1] && !strcasecmp(argv[1],"count")) {
holder.justcount = 1;
if (argv[3] && !strcasecmp(argv[2], "as")) {
@@ -2850,7 +2850,7 @@
}
}
} else if (!strcasecmp(command, "distinct_channels")) {
- sprintf(sql, "select * from channels left join
calls
on "
+ sprintf(sql, "select
*,strftime('%%s',DATETIME('NOW'))-answered_epoch as duration
|
|
| from
Quote: | Quote: | Quote: | channels left join calls on "
"channels.uuid=calls.caller_uuid
where channels.uuid not in (select callee_uuid from calls)
|
|
| order
Quote: | Quote: | Quote: | by
created_epoch");
if (argv[2] && !strcasecmp(argv[1], "as")) {
as = argv[2];
Index: src/switch_core_sqldb.c
|
|
| ===================================================================
Quote: | Quote: | Quote: | --- src/switch_core_sqldb.c (revision 14256)
+++ src/switch_core_sqldb.c (working copy)
@@ -309,9 +309,21 @@
);
break;
+ case SWITCH_EVENT_CHANNEL_ANSWER:
+ {
+
+ sql = switch_mprintf("update channels
|
|
| set
Quote: | Quote: | Quote: | answered='%s',answered_epoch='%ld' where uuid='%s'",
+
switch_event_get_header_nil(event, "event-date-local"),
+
(long)switch_epoch_time_now(NULL),
+
switch_event_get_header_nil(event, "unique-id")
+ );
+
+ }
+ break;
case SWITCH_EVENT_CHANNEL_STATE:
{
char *state =
switch_event_get_header_nil(event, "channel-state-number");
+
switch_channel_state_t state_i =
CS_DESTROY;
if (!switch_strlen_zero(state)) {
@@ -492,7 +504,9 @@
" read_rate VARCHAR(255),\n"
" write_codec VARCHAR(255),\n"
" write_rate VARCHAR(255),\n"
- " secure VARCHAR(255)\n"
+ " secure VARCHAR(255),\n"
+ " answered VARCHAR(255),\n"
+ " answered_epoch INTEGER\n"
");\ncreate index uuindex on channels
(uuid);\n";
char create_calls_sql[] =
"CREATE TABLE calls (\n"
_______________________________________________
FreeSWITCH-users mailing list
FreeSWITCH-users@lists.freeswitch.org
|
| <mailto:FreeSWITCH-users@lists.freeswitch.org>
Quote: | Quote: | <mailto:FreeSWITCH-users@lists.freeswitch.org
|
| <mailto:FreeSWITCH-users@lists.freeswitch.org>>
Quote: | Quote: | http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
|
|
| UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
Quote: | <mailto:MSN%3Aanthony_minessale@hotmail.com>
Quote: | Quote: | <mailto:MSN%3Aanthony_minessale@hotmail.com
|
| <mailto:MSN%253Aanthony_minessale@hotmail.com>>
Quote: | Quote: | GTALK/JABBER/PAYPAL:anthony.minessale@gmail.com
|
| <mailto:PAYPAL%3Aanthony.minessale@gmail.com>
Quote: | Quote: | <mailto:PAYPAL%3Aanthony.minessale@gmail.com
|
| <mailto:PAYPAL%253Aanthony.minessale@gmail.com>>
Quote: | Quote: | IRC: irc.freenode.net <http://irc.freenode.net>
|
| <http://irc.freenode.net> #freeswitch
Quote: | Quote: |
FreeSWITCH Developer Conference
sip:888@conference.freeswitch.org
|
| <mailto:sip%3A888@conference.freeswitch.org>
Quote: | Quote: | <mailto:sip%3A888@conference.freeswitch.org
|
| <mailto:sip%253A888@conference.freeswitch.org>>
Quote: | Quote: | iax:guest@conference.freeswitch.org/888
|
| <http://iax:guest@conference.freeswitch.org/888>
Quote: | Quote: | <http://iax:guest@conference.freeswitch.org/888>
googletalk:conf+888@conference.freeswitch.org
|
| <mailto:googletalk%3Aconf%2B888@conference.freeswitch.org>
Quote: | Quote: | <mailto:googletalk%3Aconf%2B888@conference.freeswitch.org
|
| <mailto:googletalk%253Aconf%252B888@conference.freeswitch.org>>
Quote: | Quote: | pstn:213-799-1400
---
|
|
---------------------------------------------------------------------
<mailto:FreeSWITCH-users@lists.freeswitch.org>
Quote: | Quote: | http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
|
|
| UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
Quote: | Quote: | Quote: | http://www.freeswitch.org
|
--
-------------------------------------------
Apostolos Pantsiopoulos
Kinetix Tele.com R & D
email: regs@kinetix.gr <mailto:regs@kinetix.gr>
-------------------------------------------
_______________________________________________
FreeSWITCH-users mailing list
FreeSWITCH-users@lists.freeswitch.org
| <mailto:FreeSWITCH-users@lists.freeswitch.org>
Quote: | http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
|
| UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
Quote: | http://www.freeswitch.org
--
Anthony Minessale II
FreeSWITCH http://www.freeswitch.org/
ClueCon http://www.cluecon.com/
Twitter: http://twitter.com/FreeSWITCH_wire
AIM: anthm
MSN:anthony_minessale@hotmail.com
<mailto:MSN%3Aanthony_minessale@hotmail.com>
GTALK/JABBER/PAYPAL:anthony.minessale@gmail.com
<mailto:PAYPAL%3Aanthony.minessale@gmail.com>
IRC: irc.freenode.net <http://irc.freenode.net> #freeswitch
FreeSWITCH Developer Conference
sip:888@conference.freeswitch.org
<mailto:sip%3A888@conference.freeswitch.org>
iax:guest@conference.freeswitch.org/888
<http://iax:guest@conference.freeswitch.org/888>
googletalk:conf+888@conference.freeswitch.org
<mailto:googletalk%3Aconf%2B888@conference.freeswitch.org>
pstn:213-799-1400
------------------------------------------------------------------------
_______________________________________________
FreeSWITCH-users mailing list
FreeSWITCH-users@lists.freeswitch.org
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org
|
--
-------------------------------------------
Apostolos Pantsiopoulos
Kinetix Tele.com R & D
email: regs@kinetix.gr
-------------------------------------------
_______________________________________________
FreeSWITCH-users mailing list
FreeSWITCH-users@lists.freeswitch.org
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org
_______________________________________________
FreeSWITCH-users mailing list
FreeSWITCH-users@lists.freeswitch.org
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org
|
_______________________________________________
FreeSWITCH-users mailing list
FreeSWITCH-users@lists.freeswitch.org
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org |
|
Back to top |
|
|
saeedahmad1981 at gmai... Guest
|
Posted: Thu Jul 16, 2009 10:50 am Post subject: [Freeswitch-users] "show channels" command with du |
|
|
Hi,
its very useful feature for monitoring, I am doing it with XML RPC and
getting the result on webpage.
There is one issue which is nothing to do with that patch but in general: if
we are using absolute_codec_string variable and codes are like G729,G723
then this *comma* between codec ruin the array. I think there should be
other separator.
- Saeed
-----Original Message-----
From: freeswitch-users-bounces@lists.freeswitch.org
[mailto:freeswitch-users-bounces@lists.freeswitch.org] On Behalf Of
Apostolos Pantsiopoulos
Sent: Thursday, July 16, 2009 5:11 PM
To: freeswitch-users@lists.freeswitch.org
Subject: Re: [Freeswitch-users] "show channels" command with duration -
patch included
OK I 'll start implementing the progress timestamp field.
The only reason I mentioned the user/gateway id field is that FS admins
gain a lot by looking at a row of "show channels" result and be able to
see who is the caller and who is the callee.
Anthony Minessale wrote:
Quote: | it doesn't really break anything to add more fields besides the ability
to read it but it's already fairly wide as it is.
Thats why we have "show channels as xml"
On Thu, Jul 16, 2009 at 9:50 AM, Michael S Collins <msc@freeswitch.org
<mailto:msc@freeswitch.org>> wrote:
I wonder if it would make sense to create a separate sub-command like
"show channels stats" or something. That way we could put all sorts of
nifty info there without breaking the existing command.
Thoughts?
-MC
Sent from my iPhone
On Jul 16, 2009, at 7:37 AM, Apostolos Pantsiopoulos
<regs@kinetix.gr <mailto:regs@kinetix.gr>>
wrote:
Quote: | Now that I come to think of it...
It would be useful if we had the timestamp (and epoch)
of the events PROGRESS and PROGRESS WITH MEDIA so that we can
|
| extract
Quote: | Quote: | the PDD (Post Dial Delay) which is a very useful statistic.
Adding the user's (for the incoming) and the gateway's (for the
outbound) id would also be useful. In case these fields are empty
|
| the
Quote: | Quote: | show channels command could ommit the (empty string).
Are you planning to implement them yourselves or should I begin
looking
at the code?
Anthony Minessale wrote:
Quote: | I'm ok with the idea as long as it's thoroughly tested.
If there is any more info you want to save from those events you
should
consider it now while we are modifying it.
On Thu, Jul 16, 2009 at 9:02 AM,
|
| <freeswitch-users@lists.freeswitch.org
<mailto:freeswitch-users@lists.freeswitch.org>
Quote: | Quote: | <mailto:freeswitch-users@lists.freeswitch.org
|
| <mailto:freeswitch-users@lists.freeswitch.org>>> wrote:
Quote: | Quote: |
Hi,
I usually find it very useful when I can retrieve a list of the
currents calls along with durations. I noticed that the 'show
channels' format does not include the duration (or the answered
timestamp - so that one can extract it from there). So, I made
|
|
| a
Quote: | Quote: | Quote: | patch that includes the answered timestamp, the answered
|
| timestamp
Quote: | Quote: | in epoch, and the duration in seconds. Of course these fields
remain
empty when the call hasn't been
answered yet.
I don't know if anyone else finds this functionality useful, so
I am
posting this patch here first (instead of JIRA) in order to get
feedback from the users. If many of you (or the maintainers)
find it
interesting I can then proceed in posting it to JIRA.
--
-------------------------------------------
Apostolos Pantsiopoulos
Kinetix Tele.com R & D
email: regs@kinetix.gr <mailto:regs@kinetix.gr>
|
| <mailto:regs@kinetix.gr <mailto:regs@kinetix.gr>>
Quote: | Quote: | -------------------------------------------
Index: src/mod/applications/mod_commands/mod_commands.c
|
|
| ===================================================================
Quote: | Quote: | Quote: | --- src/mod/applications/mod_commands/mod_commands.c
(revision 14256)
+++ src/mod/applications/mod_commands/mod_commands.c
|
|
| (working
Quote: | Quote: | Quote: | copy)
@@ -2827,10 +2827,10 @@
}
}
if (strchr(argv[2], '%')) {
- sprintf(sql, "select * from
channels
where uuid like '%s' or name like '%s' or cid_name like '%s' or
cid_num like '%s' order by created_epoch",
+ sprintf(sql, "select
*,strftime('%%s',DATETIME('NOW'))-answered_epoch as duration
|
|
| from
Quote: | Quote: | Quote: | channels where uuid like '%s' or name like '%s' or cid_name
|
|
| like
Quote: | Quote: | Quote: | '%s' or cid_num like '%s' order by created_epoch",
argv[2],
|
|
| argv[2],
Quote: | Quote: | Quote: | argv[2], argv[2]);
} else {
- sprintf(sql, "select * from
channels
where uuid like '%%%s%%' or name like '%%%s%%' or cid_name like
'%%%s%%' or cid_num like '%%%s%%' order by created_epoch",
+ sprintf(sql, "select
*,strftime('%%s',DATETIME('NOW'))-answered_epoch as duration
|
|
| from
Quote: | Quote: | Quote: | channels where uuid like '%%%s%%' or name like '%%%s%%' or
cid_name
like '%%%s%%' or cid_num like '%%%s%%' order by created_epoch",
argv[2],
|
|
| argv[2],
Quote: | Quote: | Quote: | argv[2], argv[2]);
}
@@ -2839,10 +2839,10 @@
as = argv[4];
}
} else {
- sprintf(sql, "select * from channels
|
| order
Quote: | Quote: | by created_epoch");
+ sprintf(sql, "select
*,strftime('%%s',DATETIME('NOW'))-answered_epoch as duration
|
|
| from
Quote: | Quote: | Quote: | channels order by created_epoch");
}
} else if (!strcasecmp(command, "channels")) {
- sprintf(sql, "select * from channels order by
created_epoch");
+ sprintf(sql, "select
*,strftime('%%s',DATETIME('NOW'))-answered_epoch as duration
|
|
| from
Quote: | Quote: | Quote: | channels order by created_epoch");
if (argv[1] && !strcasecmp(argv[1],"count")) {
holder.justcount = 1;
if (argv[3] && !strcasecmp(argv[2], "as")) {
@@ -2850,7 +2850,7 @@
}
}
} else if (!strcasecmp(command, "distinct_channels")) {
- sprintf(sql, "select * from channels left join
calls
on "
+ sprintf(sql, "select
*,strftime('%%s',DATETIME('NOW'))-answered_epoch as duration
|
|
| from
Quote: | Quote: | Quote: | channels left join calls on "
"channels.uuid=calls.caller_uuid
where channels.uuid not in (select callee_uuid from calls)
|
|
| order
Quote: | Quote: | Quote: | by
created_epoch");
if (argv[2] && !strcasecmp(argv[1], "as")) {
as = argv[2];
Index: src/switch_core_sqldb.c
|
|
| ===================================================================
Quote: | Quote: | Quote: | --- src/switch_core_sqldb.c (revision 14256)
+++ src/switch_core_sqldb.c (working copy)
@@ -309,9 +309,21 @@
);
break;
+ case SWITCH_EVENT_CHANNEL_ANSWER:
+ {
+
+ sql = switch_mprintf("update channels
|
|
| set
Quote: | Quote: | Quote: | answered='%s',answered_epoch='%ld' where uuid='%s'",
+
switch_event_get_header_nil(event, "event-date-local"),
+
(long)switch_epoch_time_now(NULL),
+
switch_event_get_header_nil(event, "unique-id")
+ );
+
+ }
+ break;
case SWITCH_EVENT_CHANNEL_STATE:
{
char *state =
switch_event_get_header_nil(event, "channel-state-number");
+
switch_channel_state_t state_i =
CS_DESTROY;
if (!switch_strlen_zero(state)) {
@@ -492,7 +504,9 @@
" read_rate VARCHAR(255),\n"
" write_codec VARCHAR(255),\n"
" write_rate VARCHAR(255),\n"
- " secure VARCHAR(255)\n"
+ " secure VARCHAR(255),\n"
+ " answered VARCHAR(255),\n"
+ " answered_epoch INTEGER\n"
");\ncreate index uuindex on channels
(uuid);\n";
char create_calls_sql[] =
"CREATE TABLE calls (\n"
_______________________________________________
FreeSWITCH-users mailing list
FreeSWITCH-users@lists.freeswitch.org
|
| <mailto:FreeSWITCH-users@lists.freeswitch.org>
Quote: | Quote: | <mailto:FreeSWITCH-users@lists.freeswitch.org
|
| <mailto:FreeSWITCH-users@lists.freeswitch.org>>
Quote: | Quote: | http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
|
|
| UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
Quote: | <mailto:MSN%3Aanthony_minessale@hotmail.com>
Quote: | Quote: | <mailto:MSN%3Aanthony_minessale@hotmail.com
|
| <mailto:MSN%253Aanthony_minessale@hotmail.com>>
Quote: | Quote: | GTALK/JABBER/PAYPAL:anthony.minessale@gmail.com
|
| <mailto:PAYPAL%3Aanthony.minessale@gmail.com>
Quote: | Quote: | <mailto:PAYPAL%3Aanthony.minessale@gmail.com
|
| <mailto:PAYPAL%253Aanthony.minessale@gmail.com>>
Quote: | Quote: | IRC: irc.freenode.net <http://irc.freenode.net>
|
| <http://irc.freenode.net> #freeswitch
Quote: | Quote: |
FreeSWITCH Developer Conference
sip:888@conference.freeswitch.org
|
| <mailto:sip%3A888@conference.freeswitch.org>
Quote: | Quote: | <mailto:sip%3A888@conference.freeswitch.org
|
| <mailto:sip%253A888@conference.freeswitch.org>>
Quote: | Quote: | iax:guest@conference.freeswitch.org/888
|
| <http://iax:guest@conference.freeswitch.org/888>
Quote: | Quote: | <http://iax:guest@conference.freeswitch.org/888>
googletalk:conf+888@conference.freeswitch.org
|
| <mailto:googletalk%3Aconf%2B888@conference.freeswitch.org>
Quote: | Quote: | <mailto:googletalk%3Aconf%2B888@conference.freeswitch.org
|
| <mailto:googletalk%253Aconf%252B888@conference.freeswitch.org>>
Quote: | Quote: | pstn:213-799-1400
---
|
| ---------------------------------------------------------------------
<mailto:FreeSWITCH-users@lists.freeswitch.org>
Quote: | Quote: | http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
|
|
| UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
Quote: | Quote: | Quote: | http://www.freeswitch.org
|
--
-------------------------------------------
Apostolos Pantsiopoulos
Kinetix Tele.com R & D
email: regs@kinetix.gr <mailto:regs@kinetix.gr>
-------------------------------------------
_______________________________________________
FreeSWITCH-users mailing list
FreeSWITCH-users@lists.freeswitch.org
| <mailto:FreeSWITCH-users@lists.freeswitch.org>
Quote: | http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
|
| UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
Quote: | http://www.freeswitch.org
--
Anthony Minessale II
FreeSWITCH http://www.freeswitch.org/
ClueCon http://www.cluecon.com/
Twitter: http://twitter.com/FreeSWITCH_wire
AIM: anthm
MSN:anthony_minessale@hotmail.com
<mailto:MSN%3Aanthony_minessale@hotmail.com>
GTALK/JABBER/PAYPAL:anthony.minessale@gmail.com
<mailto:PAYPAL%3Aanthony.minessale@gmail.com>
IRC: irc.freenode.net <http://irc.freenode.net> #freeswitch
FreeSWITCH Developer Conference
sip:888@conference.freeswitch.org
<mailto:sip%3A888@conference.freeswitch.org>
iax:guest@conference.freeswitch.org/888
<http://iax:guest@conference.freeswitch.org/888>
googletalk:conf+888@conference.freeswitch.org
<mailto:googletalk%3Aconf%2B888@conference.freeswitch.org>
pstn:213-799-1400
------------------------------------------------------------------------
_______________________________________________
FreeSWITCH-users mailing list
FreeSWITCH-users@lists.freeswitch.org
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org
|
--
-------------------------------------------
Apostolos Pantsiopoulos
Kinetix Tele.com R & D
email: regs@kinetix.gr
-------------------------------------------
_______________________________________________
FreeSWITCH-users mailing list
FreeSWITCH-users@lists.freeswitch.org
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org
_______________________________________________
FreeSWITCH-users mailing list
FreeSWITCH-users@lists.freeswitch.org
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org |
|
Back to top |
|
|
regs at kinetix.gr Guest
|
Posted: Thu Jul 16, 2009 10:54 am Post subject: [Freeswitch-users] "show channels" command with du |
|
|
On a second thought... I am starting to agree with Michael.
Nobody really collects stats about PDD from the 'show channels'
command. This is usually done by using the cdrs.
So, forget about the second request. The patch I sent earlier covers
my needs (and I hope everybody else's too.)
Apostolos Pantsiopoulos wrote:
Quote: | OK I 'll start implementing the progress timestamp field.
The only reason I mentioned the user/gateway id field is that FS admins
gain a lot by looking at a row of "show channels" result and be able to
see who is the caller and who is the callee.
Anthony Minessale wrote:
Quote: | it doesn't really break anything to add more fields besides the ability
to read it but it's already fairly wide as it is.
Thats why we have "show channels as xml"
On Thu, Jul 16, 2009 at 9:50 AM, Michael S Collins <msc@freeswitch.org
<mailto:msc@freeswitch.org>> wrote:
I wonder if it would make sense to create a separate sub-command like
"show channels stats" or something. That way we could put all sorts of
nifty info there without breaking the existing command.
Thoughts?
-MC
Sent from my iPhone
On Jul 16, 2009, at 7:37 AM, Apostolos Pantsiopoulos
<regs@kinetix.gr <mailto:regs@kinetix.gr>>
wrote:
Quote: | Now that I come to think of it...
It would be useful if we had the timestamp (and epoch)
of the events PROGRESS and PROGRESS WITH MEDIA so that we can extract
the PDD (Post Dial Delay) which is a very useful statistic.
Adding the user's (for the incoming) and the gateway's (for the
outbound) id would also be useful. In case these fields are empty the
show channels command could ommit the (empty string).
Are you planning to implement them yourselves or should I begin
looking
at the code?
Anthony Minessale wrote:
Quote: | I'm ok with the idea as long as it's thoroughly tested.
If there is any more info you want to save from those events you
should
consider it now while we are modifying it.
On Thu, Jul 16, 2009 at 9:02 AM,
|
| <freeswitch-users@lists.freeswitch.org
<mailto:freeswitch-users@lists.freeswitch.org>
Quote: | Quote: | <mailto:freeswitch-users@lists.freeswitch.org
|
| <mailto:freeswitch-users@lists.freeswitch.org>>> wrote:
Quote: | Quote: |
Hi,
I usually find it very useful when I can retrieve a list of the
currents calls along with durations. I noticed that the 'show
channels' format does not include the duration (or the answered
timestamp - so that one can extract it from there). So, I made a
patch that includes the answered timestamp, the answered
|
| timestamp
Quote: | Quote: | in epoch, and the duration in seconds. Of course these fields
remain
empty when the call hasn't been
answered yet.
I don't know if anyone else finds this functionality useful, so
I am
posting this patch here first (instead of JIRA) in order to get
feedback from the users. If many of you (or the maintainers)
find it
interesting I can then proceed in posting it to JIRA.
--
-------------------------------------------
Apostolos Pantsiopoulos
Kinetix Tele.com R & D
email: regs@kinetix.gr <mailto:regs@kinetix.gr>
|
| <mailto:regs@kinetix.gr <mailto:regs@kinetix.gr>>
Quote: | Quote: | -------------------------------------------
Index: src/mod/applications/mod_commands/mod_commands.c
===================================================================
--- src/mod/applications/mod_commands/mod_commands.c
(revision 14256)
+++ src/mod/applications/mod_commands/mod_commands.c (working
copy)
@@ -2827,10 +2827,10 @@
}
}
if (strchr(argv[2], '%')) {
- sprintf(sql, "select * from
channels
where uuid like '%s' or name like '%s' or cid_name like '%s' or
cid_num like '%s' order by created_epoch",
+ sprintf(sql, "select
*,strftime('%%s',DATETIME('NOW'))-answered_epoch as duration from
channels where uuid like '%s' or name like '%s' or cid_name like
'%s' or cid_num like '%s' order by created_epoch",
argv[2], argv[2],
argv[2], argv[2]);
} else {
- sprintf(sql, "select * from
channels
where uuid like '%%%s%%' or name like '%%%s%%' or cid_name like
'%%%s%%' or cid_num like '%%%s%%' order by created_epoch",
+ sprintf(sql, "select
*,strftime('%%s',DATETIME('NOW'))-answered_epoch as duration from
channels where uuid like '%%%s%%' or name like '%%%s%%' or
cid_name
like '%%%s%%' or cid_num like '%%%s%%' order by created_epoch",
argv[2], argv[2],
argv[2], argv[2]);
}
@@ -2839,10 +2839,10 @@
as = argv[4];
}
} else {
- sprintf(sql, "select * from channels
|
| order
Quote: | Quote: | by created_epoch");
+ sprintf(sql, "select
*,strftime('%%s',DATETIME('NOW'))-answered_epoch as duration from
channels order by created_epoch");
}
} else if (!strcasecmp(command, "channels")) {
- sprintf(sql, "select * from channels order by
created_epoch");
+ sprintf(sql, "select
*,strftime('%%s',DATETIME('NOW'))-answered_epoch as duration from
channels order by created_epoch");
if (argv[1] && !strcasecmp(argv[1],"count")) {
holder.justcount = 1;
if (argv[3] && !strcasecmp(argv[2], "as")) {
@@ -2850,7 +2850,7 @@
}
}
} else if (!strcasecmp(command, "distinct_channels")) {
- sprintf(sql, "select * from channels left join
calls
on "
+ sprintf(sql, "select
*,strftime('%%s',DATETIME('NOW'))-answered_epoch as duration from
channels left join calls on "
"channels.uuid=calls.caller_uuid
where channels.uuid not in (select callee_uuid from calls) order
by
created_epoch");
if (argv[2] && !strcasecmp(argv[1], "as")) {
as = argv[2];
Index: src/switch_core_sqldb.c
===================================================================
--- src/switch_core_sqldb.c (revision 14256)
+++ src/switch_core_sqldb.c (working copy)
@@ -309,9 +309,21 @@
);
break;
+ case SWITCH_EVENT_CHANNEL_ANSWER:
+ {
+
+ sql = switch_mprintf("update channels set
answered='%s',answered_epoch='%ld' where uuid='%s'",
+
switch_event_get_header_nil(event, "event-date-local"),
+
(long)switch_epoch_time_now(NULL),
+
switch_event_get_header_nil(event, "unique-id")
+ );
+
+ }
+ break;
case SWITCH_EVENT_CHANNEL_STATE:
{
char *state =
switch_event_get_header_nil(event, "channel-state-number");
+
switch_channel_state_t state_i =
CS_DESTROY;
if (!switch_strlen_zero(state)) {
@@ -492,7 +504,9 @@
" read_rate VARCHAR(255),\n"
" write_codec VARCHAR(255),\n"
" write_rate VARCHAR(255),\n"
- " secure VARCHAR(255)\n"
+ " secure VARCHAR(255),\n"
+ " answered VARCHAR(255),\n"
+ " answered_epoch INTEGER\n"
");\ncreate index uuindex on channels
(uuid);\n";
char create_calls_sql[] =
"CREATE TABLE calls (\n"
_______________________________________________
FreeSWITCH-users mailing list
FreeSWITCH-users@lists.freeswitch.org
|
| <mailto:FreeSWITCH-users@lists.freeswitch.org>
Quote: | Quote: | <mailto:FreeSWITCH-users@lists.freeswitch.org
|
| <mailto:FreeSWITCH-users@lists.freeswitch.org>>
Quote: | Quote: | http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
|
| UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
<mailto:MSN%3Aanthony_minessale@hotmail.com>
Quote: | Quote: | <mailto:MSN%3Aanthony_minessale@hotmail.com
|
| <mailto:MSN%253Aanthony_minessale@hotmail.com>>
Quote: | Quote: | GTALK/JABBER/PAYPAL:anthony.minessale@gmail.com
|
| <mailto:PAYPAL%3Aanthony.minessale@gmail.com>
Quote: | Quote: | <mailto:PAYPAL%3Aanthony.minessale@gmail.com
|
| <mailto:PAYPAL%253Aanthony.minessale@gmail.com>>
Quote: | Quote: | IRC: irc.freenode.net <http://irc.freenode.net>
|
| <http://irc.freenode.net> #freeswitch
Quote: | Quote: |
FreeSWITCH Developer Conference
sip:888@conference.freeswitch.org
|
| <mailto:sip%3A888@conference.freeswitch.org>
Quote: | Quote: | <mailto:sip%3A888@conference.freeswitch.org
|
| <mailto:sip%253A888@conference.freeswitch.org>>
Quote: | Quote: | iax:guest@conference.freeswitch.org/888
|
| <http://iax:guest@conference.freeswitch.org/888>
Quote: | Quote: | <http://iax:guest@conference.freeswitch.org/888>
googletalk:conf+888@conference.freeswitch.org
|
| <mailto:googletalk%3Aconf%2B888@conference.freeswitch.org>
Quote: | Quote: | <mailto:googletalk%3Aconf%2B888@conference.freeswitch.org
|
| <mailto:googletalk%253Aconf%252B888@conference.freeswitch.org>>
Quote: | Quote: | pstn:213-799-1400
---
|
| ---------------------------------------------------------------------
<mailto:FreeSWITCH-users@lists.freeswitch.org>
Quote: | Quote: | http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
|
| UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
Quote: | Quote: | http://www.freeswitch.org
|
--
-------------------------------------------
Apostolos Pantsiopoulos
Kinetix Tele.com R & D
email: regs@kinetix.gr <mailto:regs@kinetix.gr>
-------------------------------------------
_______________________________________________
FreeSWITCH-users mailing list
FreeSWITCH-users@lists.freeswitch.org
| <mailto:FreeSWITCH-users@lists.freeswitch.org>
Quote: | http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
| UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
Quote: | http://www.freeswitch.org
|
_______________________________________________
FreeSWITCH-users mailing list
FreeSWITCH-users@lists.freeswitch.org
<mailto:FreeSWITCH-users@lists.freeswitch.org>
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org
--
Anthony Minessale II
FreeSWITCH http://www.freeswitch.org/
ClueCon http://www.cluecon.com/
Twitter: http://twitter.com/FreeSWITCH_wire
AIM: anthm
MSN:anthony_minessale@hotmail.com
<mailto:MSN%3Aanthony_minessale@hotmail.com>
GTALK/JABBER/PAYPAL:anthony.minessale@gmail.com
<mailto:PAYPAL%3Aanthony.minessale@gmail.com>
IRC: irc.freenode.net <http://irc.freenode.net> #freeswitch
FreeSWITCH Developer Conference
sip:888@conference.freeswitch.org
<mailto:sip%3A888@conference.freeswitch.org>
iax:guest@conference.freeswitch.org/888
<http://iax:guest@conference.freeswitch.org/888>
googletalk:conf+888@conference.freeswitch.org
<mailto:googletalk%3Aconf%2B888@conference.freeswitch.org>
pstn:213-799-1400
------------------------------------------------------------------------
_______________________________________________
FreeSWITCH-users mailing list
FreeSWITCH-users@lists.freeswitch.org
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org
|
|
--
-------------------------------------------
Apostolos Pantsiopoulos
Kinetix Tele.com R & D
email: regs@kinetix.gr
-------------------------------------------
_______________________________________________
FreeSWITCH-users mailing list
FreeSWITCH-users@lists.freeswitch.org
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org |
|
Back to top |
|
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|