diff options
author | markster <markster@f38db490-d61c-443f-a65b-d21fe96a405b> | 2003-10-08 02:11:56 +0000 |
---|---|---|
committer | markster <markster@f38db490-d61c-443f-a65b-d21fe96a405b> | 2003-10-08 02:11:56 +0000 |
commit | af2f9e4edda61e46324272f73149e032d53bcd73 (patch) | |
tree | fbda168a92cb6f74cc50364780ac88ff15ec0ffe /channels/chan_local.c | |
parent | 01a9b7f321eec8bb13c2a8f1be8049ec0ad68fbc (diff) |
Add "n" option to allow disabling of masq optimization
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@1619 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels/chan_local.c')
-rwxr-xr-x | channels/chan_local.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/channels/chan_local.c b/channels/chan_local.c index 533ed8e77..55e2e9acb 100755 --- a/channels/chan_local.c +++ b/channels/chan_local.c @@ -65,6 +65,7 @@ static struct local_pvt { int cancelqueue; /* Cancel queue */ int alreadymasqed; /* Already masqueraded */ int launchedpbx; /* Did we launch the PBX */ + int nooptimization; struct ast_channel *owner; /* Master Channel */ struct ast_channel *chan; /* Outbound channel */ struct local_pvt *next; /* Next entity */ @@ -131,7 +132,7 @@ static int local_answer(struct ast_channel *ast) static void check_bridge(struct local_pvt *p, int isoutbound) { - if (p->alreadymasqed) + if (p->alreadymasqed || p->nooptimization) return; if (isoutbound && p->chan && p->chan->bridge && p->owner) { /* Masquerade bridged channel into owner */ @@ -326,6 +327,7 @@ static struct local_pvt *local_alloc(char *data, int format) { struct local_pvt *tmp; char *c; + char *opts; tmp = malloc(sizeof(struct local_pvt)); if (tmp) { memset(tmp, 0, sizeof(struct local_pvt)); @@ -338,6 +340,13 @@ static struct local_pvt *local_alloc(char *data, int format) strncpy(tmp->context, c, sizeof(tmp->context) - 1); } else strncpy(tmp->context, "default", sizeof(tmp->context) - 1); + opts = strchr(tmp->context, '/'); + if (opts) { + *opts='\0'; + opts++; + if (strchr(opts, 'n')) + tmp->nooptimization = 1; + } tmp->reqformat = format; if (!ast_exists_extension(NULL, tmp->context, tmp->exten, 1, NULL)) { ast_log(LOG_NOTICE, "No such extension/context %s@%s creating local channel\n", tmp->context, tmp->exten); |