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

Establishing an outbound event socket connection


An outbound event socket connection lets you control a call leg from a program that sits and waits for a TCP connection on a specific port. The dialplan socket application sends control of the call to the process listening on the specified TCP port. This recipe will guide you through the steps necessary to get a simple call control script up and running. You may find it easier to understand the information presented here if you are at least somewhat familiar with the concept of TCP sockets.

Getting ready

You will need a text editor and a telephone connected to FreeSWITCH, as well as access to the fs_cli for your system. You will also need to have ESL compiled and working for your scripting language of choice (see Setting up the event socket library earlier in this chapter). The language used in this is example is Perl. However, the principles apply to all ESL-enabled languages. When we are through, we will have a simple script that will listen...