SwitchX.Connection.Outbound (SwitchX v1.0.0)

View Source

Outbound mode means you make a daemon, and then have FreeSWITCH connect to it. You add an extension to the dialplan, and put <action application="socket" data="ip:port sync full"/>

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 Event Socket Outbound for more details regarding things specific to outbound mode.

Summary

Functions

Returns a specification to start this module under a supervisor.

Starts a new outbound server.

Functions

child_spec(arg)

Returns a specification to start this module under a supervisor.

arg is passed as the argument to Task.start_link/1 in the :start field of the spec.

For more information, see the Supervisor module, the Supervisor.child_spec/2 function and the Supervisor.child_spec/0 type.

start_link(module, opts)

@spec start_link(module :: Module, opts :: Keyword) ::
  {:ok, server_pid :: Pid} | {:error, term()}

Starts a new outbound server.

Returns {:ok, Pid}

Examples

iex> parameters [
  host: "127.0.0.1",
  port: 9998,
]
iex> SwitchX.Connection.Outbound.start_link(Examples.OutboundSession, parameters)
{:ok, server_pid}