|invoke_callback ( CALLBACK, @ARGS )||
Invokes callback CALLBACK with additional args @ARGS.
CALLBACK can be:
|create_socket_to ( ADDR, [ PROTO ] )||
Creates socket with protocol PROTO (default udp) on a local interface,
from where ADDR is reachable.
This is done by first creating a UDP socket with target
ADDR and using getsockname(2) to find out the local address of this
socket. The newly created socket than will be bound to this address.
It will try to bind the socket to port 5060 (default SIP port). If this fails it will try port 5062..5100 and if it cannot bind to any of these ports it will just use any port which gets assigned by the OS.
For multihomed hosts where several addresses are bound to the same interface it will just use one of these addresses. If you need more control about the address the socket is bound to (and which will be used as the local IP in outgoing packets) you need to create the socket yourself.
In scalar context it just returns the newly created socket. In array context it will return the socket and the "ip:port" the created socket is bound to. If the creation of the socket fails it will return () and set $!.
|create_rtp_sockets ( LADDR, [ RANGE, MINPORT, MAXPORT, TRIES ] )||
This tries to allocate sockets for RTP. RTP consists usually of a data
socket on an even port number and a control socket (RTCP) and the following
port. It will try to create these sockets. MINPORT is the minimal
port number to use (default 2000), MAXPORT the highest port (default
MINPORT+10000), TRIES is the number of attempts it makes to create such
socket pairs and defaults to 1000.
RANGE is the number of consecutive ports it needs to allocate and defaults to 2 (e.g. data and control socket).
Allocation will be done by choosing a random even number between MINPORT and MAXPORT and then trying to allocate all the sockets on this and the following port numbers.
If the allocation fails after TRIES attempts were made it will return (), otherwise it will return an array with at first the starting port number followed by all the allocated sockets.
|sip_hdrval2parts ( KEY, VALUE )||
Interprets VALUE as a value for the SIP header field KEY and splits
it into the parts (prefix, parameter). Because for most keys the
delimiter is ;, but for some keys , the field name KEY need to
KEY needs to be normalized already (lower case, no abbrevation).
Returns array with initial data (up to first delimiter) and the parameters as hash.
Example for key to:
Example for key www-authenticate:
|sip_parts2hdrval ( KEY, PREFIX, \%PARAMETER )||Inverse function to <B>sip_hdrval2partsB>, e.g constructs header value for KEY from PREFIX and %PARAMETER and returns value.|
|sip_uri2parts ( URI )||
Returns parts from URI. If called in scalar context it returns only the domain
part. In array context it returns an array with the following values:
|sip_uri_eq ( URI1, URI2 )||Returns true if both URIs point to the same SIP address. This compares user part case sensitive, domain part case insensitive (does no DNS resolution) protocol and ports in domain (assumes default ports for protocol if no port is given).|
|perl v5.20.3||NET::SIP::UTIL (3)||2010-02-02|