[Asterisk-Dev] (E)AGI Threads

Ousmane Wilane wilane at omnicron.us
Tue Oct 14 09:40:06 MST 2003


Hi,
I'm trying to run a Dial command in a child process and let the parent
go on processing. I can't make it to work since the parent always wait
for the Dial to hangup before processing.

int pid;
pid = fork();
if(pid == 0) {
  fprintf(stderr, "Child process\n");
  res = run_command("EXEC DIAL SIP/502");
  if (!res) {
    fprintf(stderr, "Failed to execute command\n");
    exit;
  }
} else {
  if(pid < 0) {
    fprintf(stderr, "Fork Failed\n");
    exit;
  }
}
// Why this have to wait for the kid to exit??? Pls help!
fprintf(stderr, "Parent process child is %d\n", pid);


Any help/advice will be greatly appreciated

Sorry if this is the wrong list to post this kind of question.

Kind regard

--
Ousmane WIlane



More information about the asterisk-dev mailing list