how to make outgoing call from freeswitch and play file after destination answer call?

Ahmad Dehnavi picture Ahmad Dehnavi · Apr 25, 2017 · Viewed 7.7k times · Source

I want to write a web app that connects to freeswitch and makes outgoing call to some destination number (gateway for landline or internal sip devices) and plays some sounds (may be do some logic in lua script).

After reading freeswitch wiki, I found originate command but it doesn't work for me (I just test for internal sip number - sofia/internal/username@ip ). If originate command can do this, how to use it properly? If there is another way please tell me.

Answer

suren picture suren · Jun 14, 2017

Originate command is used to make the call and bridge command is used to bridge the call. You can call originate command externally by using esl socket.

Examples:

 originate {ignore_early_media=true,originate_timeout=60}sofia/gateway/name/number &playback(message)

Refer to this for esl written in node.js https://github.com/englercj/node-esl