char *opt_user = NULL;
char *options = NULL;
char *context = NULL;
+ char *exten = NULL;
int play_announcement;
char *filename = "agent-loginok";
*context = '\0';
context++;
}
+ exten = options;
+ while(*exten && ((*exten < '0') || (*exten > '9'))) exten++;
+ if (!*exten)
+ exten = NULL;
}
}
}
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);