Module sipsocket

Transport layer processes supervisor, and sipsocket interface functions.

Introduced in: 21 Mar 2004 by Fredrik Thulin <ft@it.su.se>

Behaviours: supervisor.

Authors: Fredrik Thulin (ft@it.su.se).

Description

Transport layer processes supervisor, and sipsocket interface functions.

Data Types

proto()

proto() = tcp | tcp6 | udp | udp6 | tls | tls6 | yxa_test | yxa_test6

Transport layer protocol.

Function Index

add_listener_info/3 Add an entry to ETS table yxa_sipsocket_info and sweep it for stale entrys.
close_socket/1 Close a socket.
default_port/2 Yucky function returning a "default port number" as an integer, based on input Proto and Port.
get_all_listenports/0 Returns a list of all ports we listen on.
get_listenport/1 Return the port we would listen on for a Proto, regardless of if we in fact are listening on the port or not.
get_raw_socket/1 Get the raw TCP/UDP/TLS socket from the socket handler.
get_remote_peer/1 Get informaion about 'who' is on the other side of a specific socket.
get_socket/1 Get a socket, cached or new, useable to send messages to Dst using protocol Proto.
get_specific_socket/1 Get a specific socket.
is_good_socket/1 Check if a socket is still potentially useable.
is_reliable_transport/1 Call the sipsocket module in specified in Socket and let it tell the caller if it is a reliable transport or not.
proto2viastr/1 Get the Via string (e.g.
send/5 Locate a sipsocket module through the Socket record(), and then ask that sipsocket module to send Message to Host, port Port using protocol Proto.
start_link/0 Starts the supervisor.
viastr2proto/1 Turn a SIP/2.0/TCP or similar string into an atom corresponding to our internal representation of that protocol.

Function Details

add_listener_info/3

add_listener_info(Proto, Addr, Port) -> ok

Add an entry to ETS table yxa_sipsocket_info and sweep it for stale entrys.

close_socket/1

close_socket(Socket) -> ok | {error, Reason}

Close a socket.

default_port/2

default_port(Proto, Port) -> Port

Yucky function returning a "default port number" as an integer, based on input Proto and Port.

get_all_listenports/0

get_all_listenports() -> PortList

Returns a list of all ports we listen on. In some places, we need to get a list of all ports which are valid for this proxy. Notes : Perhaps this problem can't be solved this easilly - what if we have multiple interfaces and listen on different ports on them?

get_listenport/1

get_listenport(Proto) -> Port

Return the port we would listen on for a Proto, regardless of if we in fact are listening on the port or not.

get_raw_socket/1

get_raw_socket(Socket) -> {ok, RawSocket} | {error, Reason}

Get the raw TCP/UDP/TLS socket from the socket handler. Be careful with what you do with the raw socket - don't use it for sending/receiving for example. Intended for use in extractin certificate information of an SSL socket or similar.

get_remote_peer/1

get_remote_peer(Socket) -> {ok, Proto, Addr, Port} | not_applicable

Get informaion about 'who' is on the other side of a specific socket.

get_socket/1

get_socket(Dst) -> SipSocket | {error, Reason}

Get a socket, cached or new, useable to send messages to Dst using protocol Proto.

get_specific_socket/1

get_specific_socket(Ob_id::Id) -> SipSocket | {error, Reason}

Get a specific socket. Don't try to open a new connection if the requested one does not exist.

is_good_socket/1

is_good_socket(Socket) -> true | false

Check if a socket is still potentially useable. Does not guarantee that sending using the socket in question will be successfull, but indicates if it is worth trying to use the socket at all or not.

is_reliable_transport/1

is_reliable_transport(Sipsocket::Socket) -> true | false

Call the sipsocket module in specified in Socket and let it tell the caller if it is a reliable transport or not.

proto2viastr/1

proto2viastr(Socket) -> ViaStr

Get the Via string (e.g. "SIP/2.0/TCP") for a transport layer protocol.

send/5

send(Socket, Proto, Host, Port, Message) -> Res

Locate a sipsocket module through the Socket record(), and then ask that sipsocket module to send Message to Host, port Port using protocol Proto. Currently, none of our sipsocket modules accept different protocol in the Socket record() and Proto.

start_link/0

start_link() -> term()

Starts the supervisor

viastr2proto/1

viastr2proto(X1::Str) -> Proto

Turn a SIP/2.0/TCP or similar string into an atom corresponding to our internal representation of that protocol.


Generated by EDoc, Oct 17 2007, 16:48:21.