Class OverSIP::SIP:Uac
An OverSIP::SIP::Uac class instance is created for sending a SIP request acting as a UAC.
Parent class
OverSIP::SIP::Uac inherits all the methods of OverSIP::SIP::Client.
Class instance methods
new(proxy_profile=:default_proxy)
Creates an instance of OverSIP::SIP::Uac with the given profile. It is provided with a Proxy profile (the same as for OverSIP::SIP::Proxy class).
Parameters
proxy_profile- Must be a
SymbolorStringwith a Proxy profile name existing inproxies.conf. Otherwise anOverSIP::RuntimeErroris raised. If no value is given then:default_proxyprofile is used.
Example
uac = OverSIP::SIP::Uac.new :proxy_out
route(request, dst_host=nil, dst_port=nil, dst_transport=nil)
Routes the given SIP request to the given destination (if given) or by following common SIP routing procedures with the information retrieved from the SIP Request-URI.
NOTE: If the SIP method of the request being routed is an INVITE, then the OverSIP::SIP::Uac instance is able to generate an ACK for a [3456]XX final response received from the remote peer, but it will not handle a 2XX to an INVITE (and thus no ACK will be sent unless the user codes it manually in the on_success_response() callback).
Parameters
request- The
OverSIP::SIP::UacRequestorOverSIP::SIP::Requestinstance being routed. dst_host- The destination host. A domain or IP (
String). dst_port- The destination port (
Fixnum). dst_transport- The transport to use for sending the request (
:udp,:tcpor:tlsSymbols).
Examples
# Take the received SIP request and route it in parallel to "tcp:myserver.example.net:8060"
# acting as a UAC.
uac.route request, "myserver.example.net", 8060, :tcp
# Create a #{my_lib_link_to "uac_request"} and route it based on its Request-URI .
uac.route my_uac_request