Examples
Important
These examples are for demonstration purposes only and are not production-ready.
Practical examples demonstrating how to use Genesis in real-world scenarios.
Examples environment
This project includes a ready-to-use FreeSWITCH Docker environment for testing and development. If you want to test the examples or develop your own applications, you can start the FreeSWITCH container with the following steps:
Starting FreeSWITCH with Docker
- Clone the repository:
git clone https://github.com/Otoru/Genesis.git
cd Genesis- Navigate to the Docker directory:
cd docker/freeswitch- Start the FreeSWITCH container:
docker-compose up -d- Verify it’s running:
docker ps | grep genesis-freeswitchThe FreeSWITCH instance will be available at:
- ESL Host:
127.0.0.1 - ESL Port:
8021 - ESL Password:
ClueCon - Outbound Socket Port:
9696
To stop the FreeSWITCH container:
docker-compose downFor more details about the Docker setup, see the docker/freeswitch/README.md file.
Testing with a SIP Client
You can test the examples using a SIP client (e.g. Linphone, Zoiper, or X-Lite):
Configure your SIP client to connect to FreeSWITCH:
- Server:
127.0.0.1:5060 - Username:
1000or1001 - Password:
1000or1001(same as username) - Domain:
127.0.0.1
- Server:
Register the SIP client.
Dialplan Configuration
The Docker environment includes a dialplan entry that routes calls to 9999 to the outbound socket:
<extension name="outbound_socket_test">
<condition field="destination_number" expression="^(9999)$">
<action application="socket" data="127.0.0.1:9696 async full"/>
</condition>
</extension>Calls to 9999 trigger FreeSWITCH to connect to your application at 127.0.0.1:9696.