elixir_mod_event v0.0.6 FSModEvent.Connection

Connection process. A GenServer that you can plug into your own supervisor tree.

See: https://freeswitch.org/confluence/display/FREESWITCH/mod_event_socket

Copyright 2015 Marcelo Gornstein marcelog@gmail.com

Licensed under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Summary

Functions

Executes an API command in background. Returns a Job ID. The calling process will receive a message like {:fs_job_result, job_id, packet} with the result

This will always prepend your list with “plain”

This will always prepend your list with “plain”

Suppress the specified type of event

Starts a connection to FreeSWITCH

Starts and links a connection to FreeSWITCH

Registers the caller process as a receiver for all the events for which the filter_fun returns true

Unregisters the caller process as a listener

Functions

bgapi(name, command, args \\ "")

Executes an API command in background. Returns a Job ID. The calling process will receive a message like {:fs_job_result, job_id, packet} with the result.

See: https://freeswitch.org/confluence/display/FREESWITCH/mod_event_socket#mod_event_socket-bgapi

event(name, events)

This will always prepend your list with “plain”.

See: https://freeswitch.org/confluence/display/FREESWITCH/mod_event_socket#mod_event_socket-event

myevents(name, uuid)

This will always prepend your list with “plain”.

See: https://freeswitch.org/confluence/display/FREESWITCH/mod_event_socket#mod_event_socket-SpecialCase-'myevents

sendmsg_unicast(name, uuid, transport \\ "tcp", flags \\ "native", local_ip \\ "127.0.0.1", local_port \\ 8025, remote_ip \\ "127.0.0.1", remote_port \\ 8026)

See: https://freeswitch.org/confluence/display/FREESWITCH/mod_event_socket#mod_event_socket-sendmsg

start(name, host, port, password)

Specs

Starts a connection to FreeSWITCH.

start_link(name, host, port, password)

Specs

Starts and links a connection to FreeSWITCH.

start_listening(name, filter_fun \\ fn _ -> true end)

Specs

start_listening(GenServer.server, (... -> any)) :: :ok

Registers the caller process as a receiver for all the events for which the filter_fun returns true.

stop_listening(name)

Specs

stop_listening(GenServer.server) :: :ok

Unregisters the caller process as a listener.