Book Image

Freeswitch 1.6 Cookbook

Book Image

Freeswitch 1.6 Cookbook

Overview of this book

Table of Contents (14 chapters)
FreeSWITCH 1.6 Cookbook
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Preface
Index

Launching a call with an inbound event socket connection


Using an inbound event socket connection to launch a call is a common requirement for some applications, such as outbound IVRs. In a case such as this, it is advantageous to handle the generation of calls in a nonblocking manner using the ESL connection object's bgapi() method. This recipe discusses how to use the bgapi() method with the corresponding "Background-Job UUID."

Getting ready

Be sure that you have configured ESL for your system and that you have followed the steps in the Establishing an inbound event socket connection recipe earlier in this chapter. The examples here are written in Perl, but the principles apply to any ESL-enabled language. Of course, you will need a text editor and a SIP phone registered to your FreeSWITCH server in order to test this example.

How to do it...

Start by creating the new script:

  1. Create the scripts/ib_bgapi.pl file in a text editor, and add these lines:

    #!/usr/bin/perl
    use strict;
    use warnings;...