diff options
Diffstat (limited to 'apps/app_disa.c')
-rwxr-xr-x | apps/app_disa.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/apps/app_disa.c b/apps/app_disa.c index 89d956deb..978336936 100755 --- a/apps/app_disa.c +++ b/apps/app_disa.c @@ -251,7 +251,7 @@ static int disa_exec(struct ast_channel *chan, void *data) tmp[0] = 0; while(fgets(tmp,sizeof(tmp) - 1,fp)) { - char *stringp=NULL; + char *stringp=NULL,*stringp2; if (!tmp[0]) continue; if (tmp[strlen(tmp) - 1] == '\n') tmp[strlen(tmp) - 1] = 0; @@ -261,9 +261,12 @@ static int disa_exec(struct ast_channel *chan, void *data) if (tmp[0] == ';') continue; stringp=tmp; strsep(&stringp, "|"); - /* save 2nd arg as clid */ - ourcallerid = arg2; - ourcontext = strsep(&stringp, "|"); + stringp2=strsep(&stringp, "|"); + if (stringp2) { + ourcontext=stringp2; + stringp2=strsep(&stringp, "|"); + if (stringp2) ourcallerid=stringp2; + } /* password must be in valid format (numeric) */ if (sscanf(tmp,"%d",&j) < 1) continue; /* if we got it */ |