July 2017
Intermediate to advanced
434 pages
12h 59m
English
bgapi($command[, $arguments][,$custom_job_uuid])
Send a background API command to the FreeSWITCH server to be executed in its own thread. This will be executed in its own thread, and is non-blocking.
bgapi($command, $args) is identical to sendRecv("bgapi $command $args")
Here is a Perl snippet that demonstrates the custom Job-UUID setting (works for all swigged languages):
my $command = shift;
my $args = join("", @ARGV);
my $con = new ESL::ESLconnection("127.0.0.1", "8021", "ClueCon");
my $e = $con->bgapi($command, $args, "my-job-id");
print $e->serialize("json");
This code returns:
{
"Event-Name": "SOCKET_DATA",
"Content-Type": "command/reply",
"Reply-Text": "+OK Job-UUID: my-job-id",
"Job-UUID": "my-job-id"
}
Read now
Unlock full access