[Asterisk-Dev] Strange Bug programing an AGI Script and C

Dalabera Rush dalabera at yahoo.com
Fri Sep 10 07:17:51 MST 2004


I'm modifying and old script that was developed in C
by a coworker , the strange thing is that I have a
function that set the language to SP and I have to
call it twice since the first time it always return
"510 Invalid or unknown command".
here is a snap of the code:

static int setLanguage(void)
{
       char *res;
	   
	   res = run_command("EXEC SETLANGUAGE sp");
	          if (!res) {
               fprintf(stderr, "Failed to execute
command\n");
               return -1;
       }

       res = run_command("EXEC SETLANGUAGE sp");
	          if (!res) {
               fprintf(stderr, "Failed to execute
command\n");
               return -1;
       }
return 0;
}

static char *run_command(char *command)
{
fprintf(stdout, "%s\n", command);
return wait_result();
}


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 



More information about the asterisk-dev mailing list