summaryrefslogtreecommitdiff
path: root/channels/chan_misdn.c
diff options
context:
space:
mode:
authorMatthew Jordan <mjordan@digium.com>2012-08-07 12:46:36 +0000
committerMatthew Jordan <mjordan@digium.com>2012-08-07 12:46:36 +0000
commit5c4578f4ad9af0d13638ec72a2bc141227ec8b3c (patch)
tree77427fe11562062a59774f755a23ffc82c5cbff5 /channels/chan_misdn.c
parent096baa0897f556b2de6bfb8fa0acc09a504e39a4 (diff)
Add named callgroups/pickupgroups
This patch adds named calledgroups/pickupgroups to Asterisk. Named groups are implemented in parallel to the existing numbered callgroup/pickupgroup implementation. However, unlike the existing implementation, which is limited to a maximum of 64 defined groups, the number of defined groups allowed for named callgroups/pickupgroups is effectively unlimited. Named groups are configured with the keywords "namedcallgroup" and "namedpickupgroup". This corresponds to the numbered group definitions of "callgroup" and "pickupgroup". Note that as the implementation of named groups coexists with the existing numbered implementation, a defined named group of "4" does not equate to numbered group 4. Support for the named groups has been added to the SIP, DAHDI, and mISDN channel drivers. Review: https://reviewboard.asterisk.org/r/2043 Uploaded by: Guenther Kelleter(license #6372) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@370831 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'channels/chan_misdn.c')
-rw-r--r--channels/chan_misdn.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/channels/chan_misdn.c b/channels/chan_misdn.c
index 82939614a..ce654ee41 100644
--- a/channels/chan_misdn.c
+++ b/channels/chan_misdn.c
@@ -5904,6 +5904,9 @@ static int read_config(struct chan_list *ch)
char buf2[256];
ast_group_t pg;
ast_group_t cg;
+ struct ast_namedgroups *npg;
+ struct ast_namedgroups *ncg;
+ struct ast_str *tmp_str;
if (!ch) {
ast_log(LOG_WARNING, "Cannot configure without chanlist\n");
@@ -5987,6 +5990,20 @@ static int read_config(struct chan_list *ch)
ast_channel_pickupgroup_set(ast, pg);
ast_channel_callgroup_set(ast, cg);
+ misdn_cfg_get(port, MISDN_CFG_NAMEDPICKUPGROUP, &npg, sizeof(npg));
+ misdn_cfg_get(port, MISDN_CFG_NAMEDCALLGROUP, &ncg, sizeof(ncg));
+
+ tmp_str = ast_str_create(1024);
+ if (tmp_str) {
+ chan_misdn_log(5, port, " --> * NamedCallGrp:%s\n", ast_print_namedgroups(&tmp_str, ncg));
+ ast_str_reset(tmp_str);
+ chan_misdn_log(5, port, " --> * NamedPickupGrp:%s\n", ast_print_namedgroups(&tmp_str, npg));
+ ast_free(tmp_str);
+ }
+
+ ast_channel_named_pickupgroups_set(ast, npg);
+ ast_channel_named_callgroups_set(ast, ncg);
+
if (ch->originator == ORG_AST) {
char callerid[BUFFERSIZE + 1];