Class OverSIP::SIP:Uac
NEW in 1.3.x
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 (just the 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::RequestorOverSIP::SIP::UacRequestinstance 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).
NOTE: If the given request is an instance of OverSIP::SIP::UacRequest with a String passed as :ruri value, then dst_host parameter must be given to this route() method. This is: the Request-URI implies the request destination just if:
- No
dst_hostis given. requestparameter is:- a received SIP request (instance of
OverSIP::SIP::Request), or - an instance of
OverSIP::SIP::UacRequestwhich was created by passing aOverSIP::SIP::Urior aOverSIP::SIP::NameAddrfor the:rurifield.
- a received SIP request (instance of
Examples
# Take the received SIP request and route it in parallel to other destination
# acting as a UAC.
uac.route request, "myserver.example.net", 8060, :tcp
# Create a UacRequest and route it.
uac.route my_uac_request, "1.2.3.4"