Freeswitch-mod event socket

From 탱이의 잡동사니
Jump to navigation Jump to search


Freeswitch mod_event_socket 모듈 내용 정리


Inbound mode

Inbound mode means you run your application (in whatever languages) as client, and connect to the Freeswitch server to invoke commands and control Freeswitch.

In inbound mode, your application connects to the Freeswitch server on the given port and sends commands.

If you would like to handle incoming calls using inbound mode, you should add the uuid_park command to your dialplan. Otherwise the dialplan might complete executing before your client can send commands to the event socket.

Outbound mode

Outbound mode means you make a daemon(with whatever language), and then have Freeswitch connect to it. You add an extension to the dialplan, and put <action application="socket" data="ip:port sync full"/> and create a script that runs on that ip:port and answer, playback and everything else you need on the script. Since revision git-8c794ac, you can connect to IPv6 addresses. When using IPv6 addresses the port parameter is required:<action application="socket" data="::1:8021"/> connects to ::1 on port 8021. Since this revision hostnames resolving to IPv6 addresses can be used.

In outbound mode, also known as the "socket application"(or socket client), Freeswitch makes outbound connections to another process (similar to Asterisk's FAGI model). Using outbound connections you can have Freeswitch call your own application(s) when particular events occur.

See more detail(



api 명령을 전송한다(blocking mode).

api <command> <arg>


api show calls

Content-Type: api/response
Content-Length: 7329

b5f031ca-af47-11e7-85f8-e75cb83de8fb,inbound,2017-10-12 14:20:18,1507810818,sofia/internal/asterisk@,CS_EXECUTE,asterisk,asterisk,,user_501,,,ACTIVE,,,,,localhost,,,,,,,,,,,,,,,,,,,,,

30 total


api 명령을 back ground 로 실행한다.



telnet 으로도 접속이 가능하다. 8021 포트로 접속하며 되며, 기본 password 는 'ClueCon' 이다.

telent 접속 후, auth 명령어와 설정한 password 를 입력하면 접속이 된다.

auth <password>


telnet localhost 8021
Trying ::1...
telnet: connect to address ::1: Connection refused
Connected to localhost.
Escape character is '^]'.
Content-Type: auth/request

auth ClueCon

Content-Type: command/reply
Reply-Text: +OK accepted

See also