]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
chan_dahdi: Clarify scope of callgroup/pickupgroup.
authorNaveen Albert <asterisk@phreaknet.org>
Mon, 4 Sep 2023 11:58:23 +0000 (07:58 -0400)
committerNaveen Albert <asterisk@phreaknet.org>
Thu, 5 Oct 2023 14:43:15 +0000 (14:43 +0000)
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

channels/chan_dahdi.c
configs/samples/chan_dahdi.conf.sample

index 3b3f12474c08bd050fdd896a918560ce3fb366d2..d15b664b7917a4a92bd11eb16a6daf10f33cc4fb 100644 (file)
@@ -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) {
index c9f5aa4fd07da7903fc058513dca3dc107d0ee61..3979a7648f0da354c13ed8c72fe593c46c506df2 100644 (file)
@@ -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
 ;