Files
metasploit-gs/api/Rex/Proto/SIP/Response.html
T
jenkins-metasploit c3f5bd3de2 Reboot gh-pages
2026-05-08 17:08:43 +00:00

548 lines
14 KiB
HTML

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>
Class: Rex::Proto::SIP::Response
&mdash; Documentation by YARD 0.9.37
</title>
<link rel="stylesheet" href="../../../css/style.css" type="text/css" />
<link rel="stylesheet" href="../../../css/common.css" type="text/css" />
<script type="text/javascript">
pathId = "Rex::Proto::SIP::Response";
relpath = '../../../';
</script>
<script type="text/javascript" charset="utf-8" src="../../../js/jquery.js"></script>
<script type="text/javascript" charset="utf-8" src="../../../js/app.js"></script>
</head>
<body>
<div class="nav_wrap">
<iframe id="nav" src="../../../class_list.html?1"></iframe>
<div id="resizer"></div>
</div>
<div id="main" tabindex="-1">
<div id="header">
<div id="menu">
<a href="../../../_index.html">Index (R)</a> &raquo;
<span class='title'><span class='object_link'><a href="../../../Rex.html" title="Rex (module)">Rex</a></span></span> &raquo; <span class='title'><span class='object_link'><a href="../../Proto.html" title="Rex::Proto (module)">Proto</a></span></span> &raquo; <span class='title'><span class='object_link'><a href="../SIP.html" title="Rex::Proto::SIP (module)">SIP</a></span></span>
&raquo;
<span class="title">Response</span>
</div>
<div id="search">
<a class="full_list_link" id="class_list_link"
href="../../../class_list.html">
<svg width="24" height="24">
<rect x="0" y="4" width="24" height="4" rx="1" ry="1"></rect>
<rect x="0" y="12" width="24" height="4" rx="1" ry="1"></rect>
<rect x="0" y="20" width="24" height="4" rx="1" ry="1"></rect>
</svg>
</a>
</div>
<div class="clear"></div>
</div>
<div id="content"><h1>Class: Rex::Proto::SIP::Response
</h1>
<div class="box_info">
<dl>
<dt>Inherits:</dt>
<dd>
<span class="inheritName"><span class='object_link'><a href="Message.html" title="Rex::Proto::SIP::Message (class)">Message</a></span></span>
<ul class="fullTree">
<li>Object</li>
<li class="next"><span class='object_link'><a href="Message.html" title="Rex::Proto::SIP::Message (class)">Message</a></span></li>
<li class="next">Rex::Proto::SIP::Response</li>
</ul>
<a href="#" class="inheritanceTree">show all</a>
</dd>
</dl>
<dl>
<dt>Defined in:</dt>
<dd>lib/rex/proto/sip/response.rb</dd>
</dl>
</div>
<h2>Overview</h2><div class="docstring">
<div class="discussion">
<p>Represents a SIP response message</p>
</div>
</div>
<div class="tags">
</div>
<h2>Instance Attribute Summary <small><a href="#" class="summary_toggle">collapse</a></small></h2>
<ul class="summary">
<li class="public ">
<span class="summary_signature">
<a href="#code-instance_method" title="#code (instance method)">#<strong>code</strong> &#x21d2; Object </a>
</span>
<span class="summary_desc"><div class='inline'>
<p>Returns the value of attribute code.</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#message-instance_method" title="#message (instance method)">#<strong>message</strong> &#x21d2; Object </a>
</span>
<span class="summary_desc"><div class='inline'>
<p>Returns the value of attribute message.</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#status_line-instance_method" title="#status_line (instance method)">#<strong>status_line</strong> &#x21d2; Object </a>
</span>
<span class="summary_desc"><div class='inline'>
<p>Returns the value of attribute status_line.</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#version-instance_method" title="#version (instance method)">#<strong>version</strong> &#x21d2; Object </a>
</span>
<span class="summary_desc"><div class='inline'>
<p>Returns the value of attribute version.</p>
</div></span>
</li>
</ul>
<h3 class="inherited">Attributes inherited from <span class='object_link'><a href="Message.html" title="Rex::Proto::SIP::Message (class)">Message</a></span></h3>
<p class="inherited"><span class='object_link'><a href="Message.html#headers-instance_method" title="Rex::Proto::SIP::Message#headers (method)">#headers</a></span></p>
<h2>
Class Method Summary
<small><a href="#" class="summary_toggle">collapse</a></small>
</h2>
<ul class="summary">
<li class="public ">
<span class="summary_signature">
<a href="#parse-class_method" title="parse (class method)">.<strong>parse</strong>(data) &#x21d2; Object </a>
</span>
<span class="summary_desc"><div class='inline'>
<p>Parses <code>data</code>, constructs and returns a Response.</p>
</div></span>
</li>
</ul>
<h3 class="inherited">Methods inherited from <span class='object_link'><a href="Message.html" title="Rex::Proto::SIP::Message (class)">Message</a></span></h3>
<p class="inherited"><span class='object_link'><a href="Message.html#extract_headers-class_method" title="Rex::Proto::SIP::Message.extract_headers (method)">extract_headers</a></span>, <span class='object_link'><a href="Message.html#header-instance_method" title="Rex::Proto::SIP::Message#header (method)">#header</a></span>, <span class='object_link'><a href="Message.html#initialize-instance_method" title="Rex::Proto::SIP::Message#initialize (method)">#initialize</a></span></p>
<div id="constructor_details" class="method_details_list">
<h2>Constructor Details</h2>
<p class="notice">This class inherits a constructor from <span class='object_link'><a href="Message.html#initialize-instance_method" title="Rex::Proto::SIP::Message#initialize (method)">Rex::Proto::SIP::Message</a></span></p>
</div>
<div id="instance_attr_details" class="attr_details">
<h2>Instance Attribute Details</h2>
<span id="code=-instance_method"></span>
<div class="method_details first">
<h3 class="signature first" id="code-instance_method">
#<strong>code</strong> &#x21d2; <tt>Object</tt>
</h3><div class="docstring">
<div class="discussion">
<p>Returns the value of attribute code.</p>
</div>
</div>
<div class="tags">
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
42
43
44</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/rex/proto/sip/response.rb', line 42</span>
<span class='kw'>def</span> <span class='id identifier rubyid_code'>code</span>
<span class='ivar'>@code</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<span id="message=-instance_method"></span>
<div class="method_details ">
<h3 class="signature " id="message-instance_method">
#<strong>message</strong> &#x21d2; <tt>Object</tt>
</h3><div class="docstring">
<div class="discussion">
<p>Returns the value of attribute message.</p>
</div>
</div>
<div class="tags">
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
42
43
44</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/rex/proto/sip/response.rb', line 42</span>
<span class='kw'>def</span> <span class='id identifier rubyid_message'>message</span>
<span class='ivar'>@message</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<span id="status_line=-instance_method"></span>
<div class="method_details ">
<h3 class="signature " id="status_line-instance_method">
#<strong>status_line</strong> &#x21d2; <tt>Object</tt>
</h3><div class="docstring">
<div class="discussion">
<p>Returns the value of attribute status_line.</p>
</div>
</div>
<div class="tags">
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
42
43
44</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/rex/proto/sip/response.rb', line 42</span>
<span class='kw'>def</span> <span class='id identifier rubyid_status_line'>status_line</span>
<span class='ivar'>@status_line</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<span id="version=-instance_method"></span>
<div class="method_details ">
<h3 class="signature " id="version-instance_method">
#<strong>version</strong> &#x21d2; <tt>Object</tt>
</h3><div class="docstring">
<div class="discussion">
<p>Returns the value of attribute version.</p>
</div>
</div>
<div class="tags">
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
42
43
44</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/rex/proto/sip/response.rb', line 42</span>
<span class='kw'>def</span> <span class='id identifier rubyid_version'>version</span>
<span class='ivar'>@version</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
</div>
<div id="class_method_details" class="method_details_list">
<h2>Class Method Details</h2>
<div class="method_details first">
<h3 class="signature first" id="parse-class_method">
.<strong>parse</strong>(data) &#x21d2; <tt>Object</tt>
</h3><div class="docstring">
<div class="discussion">
<p>Parses <code>data</code>, constructs and returns a Response</p>
</div>
</div>
<div class="tags">
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
45
46
47
48
49
50
51
52
53
54
55
56
57</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/rex/proto/sip/response.rb', line 45</span>
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_parse'>parse</span><span class='lparen'>(</span><span class='id identifier rubyid_data'>data</span><span class='rparen'>)</span>
<span class='id identifier rubyid_response'>response</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="" title="Rex::Proto::SIP::Response (class)">Response</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="Message.html#initialize-instance_method" title="Rex::Proto::SIP::Message#initialize (method)">new</a></span></span>
<span class='comment'># do some basic sanity checking on this response to ensure that it is SIP
</span> <span class='id identifier rubyid_response'>response</span><span class='period'>.</span><span class='id identifier rubyid_status_line'>status_line</span> <span class='op'>=</span> <span class='id identifier rubyid_data'>data</span><span class='period'>.</span><span class='id identifier rubyid_split'>split</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>\r\n</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span><span class='lbracket'>[</span><span class='int'>0</span><span class='rbracket'>]</span>
<span class='kw'>unless</span> <span class='id identifier rubyid_response'>response</span><span class='period'>.</span><span class='id identifier rubyid_status_line'>status_line</span> <span class='op'>&amp;&amp;</span> <span class='id identifier rubyid_response'>response</span><span class='period'>.</span><span class='id identifier rubyid_status_line'>status_line</span> <span class='op'>=~</span> <span class='const'><span class='object_link'><a href="../SIP.html#SIP_STATUS_REGEX-constant" title="Rex::Proto::SIP::SIP_STATUS_REGEX (constant)">SIP_STATUS_REGEX</a></span></span>
<span class='id identifier rubyid_fail'>fail</span><span class='lparen'>(</span><span class='const'>ArgumentError</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>Invalid SIP status line: </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_response'>response</span><span class='period'>.</span><span class='id identifier rubyid_status_line'>status_line</span><span class='embexpr_end'>}</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='id identifier rubyid_response'>response</span><span class='period'>.</span><span class='id identifier rubyid_version'>version</span> <span class='op'>=</span> <span class='const'>Regexp</span><span class='period'>.</span><span class='id identifier rubyid_last_match'>last_match</span><span class='lparen'>(</span><span class='int'>1</span><span class='rparen'>)</span>
<span class='id identifier rubyid_response'>response</span><span class='period'>.</span><span class='id identifier rubyid_code'>code</span> <span class='op'>=</span> <span class='const'>Regexp</span><span class='period'>.</span><span class='id identifier rubyid_last_match'>last_match</span><span class='lparen'>(</span><span class='int'>2</span><span class='rparen'>)</span>
<span class='id identifier rubyid_response'>response</span><span class='period'>.</span><span class='id identifier rubyid_message'>message</span> <span class='op'>=</span> <span class='const'>Regexp</span><span class='period'>.</span><span class='id identifier rubyid_last_match'>last_match</span><span class='lparen'>(</span><span class='int'>3</span><span class='rparen'>)</span>
<span class='id identifier rubyid_response'>response</span><span class='period'>.</span><span class='id identifier rubyid_headers'>headers</span> <span class='op'>=</span> <span class='id identifier rubyid_extract_headers'>extract_headers</span><span class='lparen'>(</span><span class='id identifier rubyid_data'>data</span><span class='rparen'>)</span>
<span class='id identifier rubyid_response'>response</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
</div>
</div>
<div id="footer">
Generated on Fri May 8 17:04:14 2026 by
<a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
0.9.37 (ruby-3.1.5).
</div>
</div>
</body>
</html>