Class OverSIP::SIP::UacRequest
An instance of the OverSIP::SIP::UacRequest class contains a locally generated SIP request for being sent via a OverSIP::SIP::Uac instance.
Class instance methods
initialize(data, extra_headers=[], body=nil)
Initializer method for the OverSIP::SIP::UacRequest instance.
Parameters
data- A
Hashwith data for building the SIP request.
Mandatory fields are:sip_method(SymbolorString) and:ruri(aString, aOverSIP::SIP::Urior aOverSIP::SIP::NameAddr).
Optional fields are:fromand:to(aString, aOverSIP::SIP::Urior aOverSIP::SIP::NameAddr),:from_tagand:to_tag(String),:call_id(String),:cseq(Fixnum) and:max_forwards(Fixnum). extra_header- An
Arrayof extra headers (Strings) to append to the request. body- Body (
String) for the request.
Examples
uac_request = OverSIP::SIP::UacRequest.new(
{
:sip_method => :OPTIONS,
:ruri => "sip:server@example.net",
:from => "sip:uac@oversip.net"
}
)
uac_request = OverSIP::SIP::UacRequest.new(
{
:sip_method => :MESSAGE,
:ruri => OverSIP::SIP::Uri.new(:sip, "alice", "example.net")
},
[ "Content-Type: text/plain" ],
"Hi Alice, I'm processing a call from #{request.from.uri}"
)
tvars
Transaction variables. A Hash for storing custom key / values associated to the client transaction initiated by OverSIP if this request is sent. The same Hash can be later retrieved from the SIP responses replied by peers for this request via the same instance method tvars of the OverSIP::SIP::Response class.