[Home]

Summary:ASTERISK-10844: [patch] CHANNELS dialplan function, get channel list in the dialplan
Reporter:Ben Winslow (rain)Labels:
Date Opened:2007-11-20 15:54:35.000-0600Date Closed:2008-06-03 19:27:36
Priority:MajorRegression?No
Status:Closed/CompleteComponents:Functions/NewFeature
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:( 0) func_channel-channel_list_function.diff
Description:There is currently no clean way to get a list of active channels from within the dialplan -- the cleanest method that's currently possible is an AGI script, which requires the extra overhead of spawning a new process.  Since I need to fetch the channel list for each call attempt to an agent (from app_queue), the wasted CPU time would be substantial.
Comments:By: Ben Winslow (rain) 2007-11-20 15:57:29.000-0600

The attached patch adds a function named CHANNELS() to funcs/func_channel.c, which will return all active channels matching the regular expression passed as an argument, or the entire list of active channels if no argument is specified.

By: Ben Winslow (rain) 2007-11-20 15:59:53.000-0600

The category for this bug should probably be Functions/NewFeature, which I overlooked when submitting the bug.

By: Tilghman Lesher (tilghman) 2007-11-21 10:46:56.000-0600

I would suggest that instead of making this a separate function, that you make this an argument of the CHANNEL function, i.e. CHANNEL(list)

By: Ben Winslow (rain) 2007-11-21 12:11:47.000-0600

I created a separate function so that no argument parsing was necessary (to avoid regexp quoting issues), and because everything CHANNEL() currently does is oriented around the current channel.

It'd certainly be possible to merge it into CHANNEL(), but that'd require argument parsing for CHANNEL() (which isn't done now) and probably non-standard argument parsing (e.g. what REGEX() currently does.)

By: Michiel van Baak (mvanbaak) 2008-02-07 15:15:35.000-0600

which way do we go?

By: jmls (jmls) 2008-05-03 14:26:08

ping. Any comments on this ? It seems a worthwhile addition ..

By: Digium Subversion (svnbot) 2008-06-03 18:11:10

Repository: asterisk
Revision: 120230

U   trunk/funcs/func_channel.c

------------------------------------------------------------------------
r120230 | tilghman | 2008-06-03 18:11:09 -0500 (Tue, 03 Jun 2008) | 7 lines

Add a function, CHANNELS(), which retrieves a list of all active channels.
(closes issue ASTERISK-10844)
Reported by: rain
Patches:
      func_channel-channel_list_function.diff uploaded by rain (license 327)
      (with some additional changes by me, mostly to meet coding guidelines)

------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=120230

By: Digium Subversion (svnbot) 2008-06-03 18:11:35

Repository: asterisk
Revision: 120234

_U  branches/1.6.0/

------------------------------------------------------------------------
r120234 | tilghman | 2008-06-03 18:11:35 -0500 (Tue, 03 Jun 2008) | 14 lines

Blocked revisions 120230 via svnmerge

........
r120230 | tilghman | 2008-06-03 18:17:33 -0500 (Tue, 03 Jun 2008) | 7 lines

Add a function, CHANNELS(), which retrieves a list of all active channels.
(closes issue ASTERISK-10844)
Reported by: rain
Patches:
      func_channel-channel_list_function.diff uploaded by rain (license 327)
      (with some additional changes by me, mostly to meet coding guidelines)

........

------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=120234

By: Digium Subversion (svnbot) 2008-06-03 19:27:36

Repository: asterisk
Revision: 120279

_U  team/seanbright/resolve-shadow-warnings/
U   team/seanbright/resolve-shadow-warnings/CHANGES
U   team/seanbright/resolve-shadow-warnings/Makefile
U   team/seanbright/resolve-shadow-warnings/apps/app_queue.c
U   team/seanbright/resolve-shadow-warnings/channels/chan_iax2.c
D   team/seanbright/resolve-shadow-warnings/configs/pbx_realtime.conf
U   team/seanbright/resolve-shadow-warnings/funcs/func_channel.c
U   team/seanbright/resolve-shadow-warnings/include/asterisk/options.h
U   team/seanbright/resolve-shadow-warnings/main/asterisk.c
U   team/seanbright/resolve-shadow-warnings/main/config.c
U   team/seanbright/resolve-shadow-warnings/main/pbx.c
U   team/seanbright/resolve-shadow-warnings/pbx/pbx_loopback.c
U   team/seanbright/resolve-shadow-warnings/pbx/pbx_realtime.c
U   team/seanbright/resolve-shadow-warnings/res/res_agi.c

------------------------------------------------------------------------
r120279 | seanbright | 2008-06-03 19:27:31 -0500 (Tue, 03 Jun 2008) | 90 lines

Merged revisions 120166,120169,120171,120174,120227,120230 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk

................
r120166 | mmichelson | 2008-06-03 17:22:52 -0400 (Tue, 03 Jun 2008) | 13 lines

Adding two new queue log events. The ADDMEMBER event is logged when
a dynamic realtime queue member is added to the queue, and the
REMOVEMEMBER event is logged when a dynamic realtime member is
removed. Since no calling channel is associated with these events
the string "REALTIME" is placed where the channel's unique id is
normally placed.

(closes issue ASTERISK-12128)
Reported by: atis
Patches:
     queue_log_rt_members.patch uploaded by atis (license 242)


................
r120169 | russell | 2008-06-03 17:35:11 -0400 (Tue, 03 Jun 2008) | 12 lines

Merged revisions 120168 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r120168 | russell | 2008-06-03 16:34:55 -0500 (Tue, 03 Jun 2008) | 4 lines

Fix another place where peer->callno could change at a very bad time, and also
fix a place where a peer was used after the reference was released.
(inspired by rev 120001)

........

................
r120171 | tilghman | 2008-06-03 18:05:16 -0400 (Tue, 03 Jun 2008) | 5 lines

Move compatibility options into asterisk.conf, default them to on for upgrades,
and off for new installations.  This includes the translation from pipes to commas
for pbx_realtime and the EXEC command for AGI, as well as the change to the Set
application not to support multiple variables at once.

................
r120174 | jpeeler | 2008-06-03 18:17:07 -0400 (Tue, 03 Jun 2008) | 14 lines

Merged revisions 120173 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r120173 | jpeeler | 2008-06-03 17:15:33 -0500 (Tue, 03 Jun 2008) | 6 lines

(closes issue ASTERISK-11077)
Reported by: yem
Tested by: yem

This change decreases the buffer size allocated on the stack substantially in config_text_file_load when LOW_MEMORY is turned on. This change combined with the fix from revision 117462 (making mkintf not copy the zt_chan_conf structure) was enough to prevent the crash.

........

................
r120227 | tilghman | 2008-06-03 18:42:03 -0400 (Tue, 03 Jun 2008) | 16 lines

Merged revisions 120226 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r120226 | tilghman | 2008-06-03 17:41:04 -0500 (Tue, 03 Jun 2008) | 8 lines

Due to incorrect use of the AST_LIST_INSERT_HEAD() macro the loopback switch
cannot perform any translation on the extension number before searching for it
in the target context.
(closes issue ASTERISK-11875)
Reported by: chappell
Patches:
      pbx_loopback.c.diff uploaded by chappell (license 8)

........

................
r120230 | tilghman | 2008-06-03 19:17:33 -0400 (Tue, 03 Jun 2008) | 7 lines

Add a function, CHANNELS(), which retrieves a list of all active channels.
(closes issue ASTERISK-10844)
Reported by: rain
Patches:
      func_channel-channel_list_function.diff uploaded by rain (license 327)
      (with some additional changes by me, mostly to meet coding guidelines)

................

------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=120279