diff options
author | markster <markster@f38db490-d61c-443f-a65b-d21fe96a405b> | 2003-08-14 21:27:24 +0000 |
---|---|---|
committer | markster <markster@f38db490-d61c-443f-a65b-d21fe96a405b> | 2003-08-14 21:27:24 +0000 |
commit | 19a8cdd5b46dcfcd47fdbef03f677d1e4c07d414 (patch) | |
tree | c94909ea9bc1c1c2f213ca542751c7f2937ebdfd /channels/chan_agent.c | |
parent | 064d0829b1ce2f34fcbc6e9487611008f2009d4f (diff) |
Allow AgentCallbackLogin to specify new location (bug #46)
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@1334 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels/chan_agent.c')
-rwxr-xr-x | channels/chan_agent.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/channels/chan_agent.c b/channels/chan_agent.c index 6a04aa560..ff0fa06df 100755 --- a/channels/chan_agent.c +++ b/channels/chan_agent.c @@ -915,6 +915,7 @@ static int __login_exec(struct ast_channel *chan, void *data, int callbackmode) char *opt_user = NULL; char *options = NULL; char *context = NULL; + char *exten = NULL; int play_announcement; char *filename = "agent-loginok"; @@ -934,6 +935,10 @@ static int __login_exec(struct ast_channel *chan, void *data, int callbackmode) *context = '\0'; context++; } + exten = options; + while(*exten && ((*exten < '0') || (*exten > '9'))) exten++; + if (!*exten) + exten = NULL; } } } @@ -979,7 +984,11 @@ static int __login_exec(struct ast_channel *chan, void *data, int callbackmode) if (callbackmode) { char tmpchan[256] = ""; /* Retrieve login chan */ - res = ast_app_getdata(chan, "agent-newlocation", tmpchan, sizeof(tmpchan) - 1, 0); + if (exten) { + strncpy(tmpchan, exten, sizeof(tmpchan) - 1); + res = 0; + } else + res = ast_app_getdata(chan, "agent-newlocation", tmpchan, sizeof(tmpchan) - 1, 0); if (!res) { if (context && strlen(context) && strlen(tmpchan)) snprintf(p->loginchan, sizeof(p->loginchan), "%s@%s", tmpchan, context); |