aboutsummaryrefslogtreecommitdiffstats
path: root/channels/chan_local.c
diff options
context:
space:
mode:
authormarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2003-10-08 02:21:09 +0000
committermarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2003-10-08 02:21:09 +0000
commita05adac17e144c7f2916f3df28b4e0fe9850e7fa (patch)
treea509b4f84c31f2dc1fd0dd7c9a618450ea9454da /channels/chan_local.c
parentaf2f9e4edda61e46324272f73149e032d53bcd73 (diff)
Handle without context
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@1620 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels/chan_local.c')
-rwxr-xr-xchannels/chan_local.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/channels/chan_local.c b/channels/chan_local.c
index 55e2e9acb..8cc057b81 100755
--- a/channels/chan_local.c
+++ b/channels/chan_local.c
@@ -333,6 +333,13 @@ static struct local_pvt *local_alloc(char *data, int format)
memset(tmp, 0, sizeof(struct local_pvt));
ast_mutex_init(&tmp->lock);
strncpy(tmp->exten, data, sizeof(tmp->exten) - 1);
+ opts = strchr(tmp->exten, '/');
+ if (opts) {
+ *opts='\0';
+ opts++;
+ if (strchr(opts, 'n'))
+ tmp->nooptimization = 1;
+ }
c = strchr(tmp->exten, '@');
if (c) {
*c = '\0';
@@ -340,13 +347,6 @@ 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);