diff options
author | seanbright <seanbright@f38db490-d61c-443f-a65b-d21fe96a405b> | 2008-10-07 21:34:44 +0000 |
---|---|---|
committer | seanbright <seanbright@f38db490-d61c-443f-a65b-d21fe96a405b> | 2008-10-07 21:34:44 +0000 |
commit | 146f94185f32dd26a759cb749c370867428cf043 (patch) | |
tree | cb72cff67faa04e477b37e94b6d57d823da67fb0 | |
parent | ed8f9a868441cd506682fbfa71e43c5d6be8b921 (diff) |
Move the DAHDI-to-DAHDI operator mode check from app_dial into chan_dahdi
so we don't have to hardcode anything.
(closes issue #13636)
Reported by: seanbright
Patches:
13636.diff uploaded by seanbright (license 71)
Reviewed by: russellb, putnopvut
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@147388 f38db490-d61c-443f-a65b-d21fe96a405b
-rw-r--r-- | apps/app_dial.c | 6 | ||||
-rw-r--r-- | channels/chan_dahdi.c | 7 | ||||
-rw-r--r-- | channels/chan_iax2.c | 3 |
3 files changed, 11 insertions, 5 deletions
diff --git a/apps/app_dial.c b/apps/app_dial.c index df2dd5fe5..b26f9ddd2 100644 --- a/apps/app_dial.c +++ b/apps/app_dial.c @@ -1926,11 +1926,7 @@ static int dial_exec_full(struct ast_channel *chan, void *data, struct ast_flags res = -1; goto done; } - if (opermode && !strncmp(chan->tech->type, "DAHDI", 5) && !strncmp(peer->name, "DAHDI", 5)) { - /* what's this special handling for dahdi <-> dahdi ? - * A: dahdi to dahdi calls are natively bridged at the kernel driver - * level, so we need to ensure that this mode gets propagated - * all the way down. */ + if (opermode) { struct oprmode oprmode; oprmode.peer = peer; diff --git a/channels/chan_dahdi.c b/channels/chan_dahdi.c index db24a6d1c..552b9841d 100644 --- a/channels/chan_dahdi.c +++ b/channels/chan_dahdi.c @@ -3638,6 +3638,13 @@ static int dahdi_setoption(struct ast_channel *chan, int option, void *data, int break; case AST_OPTION_OPRMODE: /* Operator services mode */ oprmode = (struct oprmode *) data; + /* We don't support operator mode across technologies */ + if (strcasecmp(chan->tech->type, oprmode->peer->tech->type)) { + ast_log(LOG_NOTICE, "Operator mode not supported on %s to %s calls.\n", + chan->tech->type, oprmode->peer->tech->type); + errno = EINVAL; + return -1; + } pp = oprmode->peer->tech_pvt; p->oprmode = pp->oprmode = 0; /* setup peers */ diff --git a/channels/chan_iax2.c b/channels/chan_iax2.c index 9282aed89..116c13ace 100644 --- a/channels/chan_iax2.c +++ b/channels/chan_iax2.c @@ -3823,6 +3823,9 @@ static int iax2_setoption(struct ast_channel *c, int option, void *data, int dat /* these two cannot be sent, because they require a result */ errno = ENOSYS; return -1; + case AST_OPTION_OPRMODE: + errno = EINVAL; + return -1; default: if (!(h = ast_malloc(datalen + sizeof(*h)))) return -1; |