From: Naveen Albert Date: Mon, 4 Sep 2023 11:58:23 +0000 (-0400) Subject: chan_dahdi: Clarify scope of callgroup/pickupgroup. X-Git-Tag: 21.1.0-rc1~73 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c58d5e9190e5360082dc0dab70ecd9023cb23351;p=thirdparty%2Fasterisk.git chan_dahdi: Clarify scope of callgroup/pickupgroup. Internally, chan_dahdi only applies callgroup and pickupgroup to FXO signalled channels, but this is not documented anywhere. This is now documented in the sample config, and a warning is emitted if a user tries configuring these settings for channel types that do not support these settings, since they will not have any effect. Resolves: #294 (cherry picked from commit 5b89e40541ccf40cb3703cc00ef5fa9815f896ca) --- diff --git a/channels/chan_dahdi.c b/channels/chan_dahdi.c index 3b3f12474c..d15b664b79 100644 --- a/channels/chan_dahdi.c +++ b/channels/chan_dahdi.c @@ -18434,18 +18434,30 @@ static int process_dahdi(struct dahdi_chan_conf *confp, const char *cat, struct } else if (!strcasecmp(v->name, "group")) { confp->chan.group = ast_get_group(v->value); } else if (!strcasecmp(v->name, "callgroup")) { + if (!((confp->chan.sig == SIG_FXOKS) || (confp->chan.sig == SIG_FXOGS) || (confp->chan.sig == SIG_FXOLS))) { + ast_log(LOG_WARNING, "Only FXO signalled channels may belong to a call group\n"); + } if (!strcasecmp(v->value, "none")) confp->chan.callgroup = 0; else confp->chan.callgroup = ast_get_group(v->value); } else if (!strcasecmp(v->name, "pickupgroup")) { + if (!((confp->chan.sig == SIG_FXOKS) || (confp->chan.sig == SIG_FXOGS) || (confp->chan.sig == SIG_FXOLS))) { + ast_log(LOG_WARNING, "Only FXO signalled channels may belong to a pickup group\n"); + } if (!strcasecmp(v->value, "none")) confp->chan.pickupgroup = 0; else confp->chan.pickupgroup = ast_get_group(v->value); } else if (!strcasecmp(v->name, "namedcallgroup")) { + if (!((confp->chan.sig == SIG_FXOKS) || (confp->chan.sig == SIG_FXOGS) || (confp->chan.sig == SIG_FXOLS))) { + ast_log(LOG_WARNING, "Only FXO signalled channels may belong to a named call group\n"); + } confp->chan.named_callgroups = ast_get_namedgroups(v->value); } else if (!strcasecmp(v->name, "namedpickupgroup")) { + if (!((confp->chan.sig == SIG_FXOKS) || (confp->chan.sig == SIG_FXOGS) || (confp->chan.sig == SIG_FXOLS))) { + ast_log(LOG_WARNING, "Only FXO signalled channels may belong to a named pickup group\n"); + } confp->chan.named_pickupgroups = ast_get_namedgroups(v->value); } else if (!strcasecmp(v->name, "setvar")) { if (v->value) { diff --git a/configs/samples/chan_dahdi.conf.sample b/configs/samples/chan_dahdi.conf.sample index c9f5aa4fd0..3979a7648f 100644 --- a/configs/samples/chan_dahdi.conf.sample +++ b/configs/samples/chan_dahdi.conf.sample @@ -944,6 +944,10 @@ group=1 ; you can answer it by picking up and dialing *8#. For simple offices, just ; make these both the same. Groups range from 0 to 63. ; +; Call groups and pickup groups may only be specified for FXO signalled channels. +; If you need to pick up an FXS signalled channel directly, you can have it +; dial a Local channel and pick up the ;1 side of the Local channel instead. +; callgroup=1 pickupgroup=1 ;