<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <title>JSDoc: Class: Number</title>
    
    <script src="scripts/prettify/prettify.js"> </script>
    <script src="scripts/prettify/lang-css.js"> </script>
    <!--[if lt IE 9]>
      <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
    <![endif]-->
    <link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
    <link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
</head>

<body>

<div id="main">
    
    <h1 class="page-title">Class: Number</h1>
    
    



<section>
    
<header>
    <h2>
        <span class="ancestors"><a href="Retreaver.html">Retreaver</a>.</span>
    
    Number
    </h2>
    
</header>  

<article>
    <div class="container-overview">
    
    
    
        
<dt>
    <h4 class="name" id="Number"><span class="type-signature"></span>new Number<span class="signature">(attributes)</span><span class="type-signature"></span></h4>
    
    
</dt>
<dd>
    
    

    
    
    
    
    
        <h5>Parameters:</h5>
        

<table class="params">
    <thead>
	<tr>
		
		<th>Name</th>
		
		
		<th>Type</th>
		
		
		
		
		
		<th class="last">Description</th>
	</tr>
	</thead>
	
	<tbody>
	
	
        <tr>
            
                <td class="name"><code>attributes</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">Object</span>


            
            </td>
            
            
            
            
            
            <td class="description last">Attributes</td>
        </tr>
	
	
	</tbody>
</table>
    
    
    
<dl class="details">
    
        
        <h5 class="subsection-title">Properties:</h5>
        
        <dl>

<table class="props">
    <thead>
	<tr>
		
		<th>Name</th>
		
		
		<th>Type</th>
		
		
		
		
		
		<th class="last">Description</th>
	</tr>
	</thead>
	
	<tbody>
	
	
        <tr>
            
                <td class="name"><code>attributes</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">Object</span>


            
            </td>
            
            
            
            
            
            <td class="description last">
                <h6>Properties</h6>

<table class="props">
    <thead>
	<tr>
		
		<th>Name</th>
		
		
		<th>Type</th>
		
		
		
		
		
		<th class="last">Description</th>
	</tr>
	</thead>
	
	<tbody>
	
	
        <tr>
            
                <td class="name"><code>id</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">Number</span>


            
            </td>
            
            
            
            
            
            <td class="description last">The CallPixels internal number ID.</td>
        </tr>
	
	
	
        <tr>
            
                <td class="name"><code>formatted_number</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">String</span>


            
            </td>
            
            
            
            
            
            <td class="description last">Nationally formatted phone number.</td>
        </tr>
	
	
	
        <tr>
            
                <td class="name"><code>number</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">String</span>


            
            </td>
            
            
            
            
            
            <td class="description last">E.164 formatted phone number.</td>
        </tr>
	
	
	
        <tr>
            
                <td class="name"><code>extension</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">String</span>


            
            </td>
            
            
            
            
            
            <td class="description last">The extension number.</td>
        </tr>
	
	
	
        <tr>
            
                <td class="name"><code>plain_number</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">String</span>


            
            </td>
            
            
            
            
            
            <td class="description last">The unformatted phone number digits.</td>
        </tr>
	
	
	
        <tr>
            
                <td class="name"><code>number_extension</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">String</span>


            
            </td>
            
            
            
            
            
            <td class="description last">The phone number digits with extension.</td>
        </tr>
	
	
	
        <tr>
            
                <td class="name"><code>target_open</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">Boolean</span>


            
            </td>
            
            
            
            
            
            <td class="description last">Whether there is an open, available target.</td>
        </tr>
	
	
	</tbody>
</table>
            </td>
        </tr>
	
	
	</tbody>
</table></dl>
        
    
        
    
    
    

    
    
    
    
    
    
    
    
    
    
    
    
    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="number.js.html">retreaver/number.js</a>, <a href="number.js.html#line18">line 18</a>
    </li></ul></dd>
    
    
    
    
    
    
    
</dl>

    
    

    

    
    
    
    
    
    
    
</dd>

    
    </div>
    
    
    
    
    
    
    
    
    
    
    
    
    
    
        <h3 class="subsection-title">Methods</h3>
        
        <dl>
            
<dt>
    <h4 class="name" id="add_tags"><span class="type-signature"></span>add_tags<span class="signature">(tags, callback)</span><span class="type-signature"></span></h4>
    
    
</dt>
<dd>
    
    
    <div class="description">
        Add tags to a number.
    </div>
    

    
    
    
    
    
        <h5>Parameters:</h5>
        

<table class="params">
    <thead>
	<tr>
		
		<th>Name</th>
		
		
		<th>Type</th>
		
		
		
		
		
		<th class="last">Description</th>
	</tr>
	</thead>
	
	<tbody>
	
	
        <tr>
            
                <td class="name"><code>tags</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">Object</span>


            
            </td>
            
            
            
            
            
            <td class="description last">A collection of tags {key: 'value', tag2: 'value2'}</td>
        </tr>
	
	
	
        <tr>
            
                <td class="name"><code>callback</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">function</span>


            
            </td>
            
            
            
            
            
            <td class="description last">Callback that will be fired after request.</td>
        </tr>
	
	
	</tbody>
</table>
    
    
    
<dl class="details">
    
        
    
    
    

    
    
    
    
    
    
    
    
    
    
    
    
    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="number.js.html">retreaver/number.js</a>, <a href="number.js.html#line28">line 28</a>
    </li></ul></dd>
    
    
    
    
    
    
    
</dl>

    
    

    

    
    
    
    <h5>Throws:</h5>
    
            

    <div class="param-desc">
    
        Will throw an error if attempting to modify tags on a number that doesn't belong to a number pool
with per-visitor numbers enabled.
    
    </div>


        
    
    
    
    
</dd>

        
            
<dt>
    <h4 class="name" id="clear_tags"><span class="type-signature"></span>clear_tags<span class="signature">(callback)</span><span class="type-signature"></span></h4>
    
    
</dt>
<dd>
    
    
    <div class="description">
        Clear all tags from a number.
    </div>
    

    
    
    
    
    
        <h5>Parameters:</h5>
        

<table class="params">
    <thead>
	<tr>
		
		<th>Name</th>
		
		
		<th>Type</th>
		
		
		
		
		
		<th class="last">Description</th>
	</tr>
	</thead>
	
	<tbody>
	
	
        <tr>
            
                <td class="name"><code>callback</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">function</span>


            
            </td>
            
            
            
            
            
            <td class="description last">Callback that will be fired after request.</td>
        </tr>
	
	
	</tbody>
</table>
    
    
    
<dl class="details">
    
        
    
    
    

    
    
    
    
    
    
    
    
    
    
    
    
    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="number.js.html">retreaver/number.js</a>, <a href="number.js.html#line95">line 95</a>
    </li></ul></dd>
    
    
    
    
    
    
    
</dl>

    
    

    

    
    
    
    <h5>Throws:</h5>
    
            

    <div class="param-desc">
    
        Will throw an error if attempting to modify tags on a number that doesn't belong to a number pool
with per-visitor numbers enabled.
    
    </div>


        
    
    
    
    
</dd>

        
            
<dt>
    <h4 class="name" id="initiate_call"><span class="type-signature"></span>initiate_call<span class="signature">(dial, payload, callback)</span><span class="type-signature"></span></h4>
    
    
</dt>
<dd>
    
    
    <div class="description">
        Start a call immediately by having a campaign target dial the visitor.
    </div>
    

    
    
    
    
    
        <h5>Parameters:</h5>
        

<table class="params">
    <thead>
	<tr>
		
		<th>Name</th>
		
		
		<th>Type</th>
		
		
		
		
		
		<th class="last">Description</th>
	</tr>
	</thead>
	
	<tbody>
	
	
        <tr>
            
                <td class="name"><code>dial</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">String</span>


            
            </td>
            
            
            
            
            
            <td class="description last">The number to call.</td>
        </tr>
	
	
	
        <tr>
            
                <td class="name"><code>payload</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">Object</span>


            
            </td>
            
            
            
            
            
            <td class="description last">A collection of tags as key-value pairs and optional secure override properties.
                <h6>Properties</h6>
                

<table class="params">
    <thead>
	<tr>
		
		<th>Name</th>
		
		
		<th>Type</th>
		
		
		<th>Argument</th>
		
		
		
		
		<th class="last">Description</th>
	</tr>
	</thead>
	
	<tbody>
	
	
        <tr>
            
                <td class="name"><code>target_map</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">string</span>


            
            </td>
            
            
                <td class="attributes">
                
                    &lt;optional><br>
                
                    
                
                    
                
                </td>
            
            
            
            
            <td class="description last">A string mapping a placeholder number to a phone number.</td>
        </tr>
	
	
	
        <tr>
            
                <td class="name"><code>target_map_cs</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">string</span>


            
            </td>
            
            
                <td class="attributes">
                
                    &lt;optional><br>
                
                    
                
                    
                
                </td>
            
            
            
            
            <td class="description last">A SHA1 checksum of the target_map concatenated with your CallPixels API
key.</td>
        </tr>
	
	
	
        <tr>
            
                <td class="name"><code>timer_offset</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">number</span>


            
            </td>
            
            
                <td class="attributes">
                
                    &lt;optional><br>
                
                    
                
                    
                
                </td>
            
            
            
            
            <td class="description last">Number of seconds to offset the "connect" duration timers by.</td>
        </tr>
	
	
	
        <tr>
            
                <td class="name"><code>timer_offset_cs</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">string</span>


            
            </td>
            
            
                <td class="attributes">
                
                    &lt;optional><br>
                
                    
                
                    
                
                </td>
            
            
            
            
            <td class="description last">An SHA1 checksum of the timer_offset concatenated with your
CallPixels API key.</td>
        </tr>
	
	
	
        <tr>
            
                <td class="name"><code>*</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">string</span>
|

<span class="param-type">number</span>


            
            </td>
            
            
                <td class="attributes">
                
                    &lt;optional><br>
                
                    
                
                    
                
                </td>
            
            
            
            
            <td class="description last">Key value pairs treated as tags.</td>
        </tr>
	
	
	</tbody>
</table>
            </td>
        </tr>
	
	
	
        <tr>
            
                <td class="name"><code>callback</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">function</span>


            
            </td>
            
            
            
            
            
            <td class="description last">Callback that will be fired after request.</td>
        </tr>
	
	
	</tbody>
</table>
    
    
    
<dl class="details">
    
        
    
    
    

    
    
    
    
    
    
    
    
    
    
    
    
    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="number.js.html">retreaver/number.js</a>, <a href="number.js.html#line124">line 124</a>
    </li></ul></dd>
    
    
    
    
    
    
    
</dl>

    
    

    

    
    
    
    
    
    
    
        <h5>Example</h5>
        
    <pre class="prettyprint"><code>number.initiate_call('4166686980', {company_name: 'CallPixels'}, function (call) {
    alert('Call started with UUID ' + call.uuid)
});</code></pre>

    
</dd>

        
            
<dt>
    <h4 class="name" id="release"><span class="type-signature"></span>release<span class="signature">()</span><span class="type-signature"></span></h4>
    
    
</dt>
<dd>
    
    
    <div class="description">
        Release number back to pool.
    </div>
    

    
    
    
    
    
    
    
<dl class="details">
    
        
    
    
    

    
    
    
    
    
    
    
    
    
    
    
    
    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="number.js.html">retreaver/number.js</a>, <a href="number.js.html#line114">line 114</a>
    </li></ul></dd>
    
    
    
    
    
    
    
</dl>

    
    

    

    
    
    
    
    
    
    
</dd>

        
            
<dt>
    <h4 class="name" id="remove_tags"><span class="type-signature"></span>remove_tags<span class="signature">(tags, callback)</span><span class="type-signature"></span></h4>
    
    
</dt>
<dd>
    
    
    <div class="description">
        Remove tags from a number.
    </div>
    

    
    
    
    
    
        <h5>Parameters:</h5>
        

<table class="params">
    <thead>
	<tr>
		
		<th>Name</th>
		
		
		<th>Type</th>
		
		
		
		
		
		<th class="last">Description</th>
	</tr>
	</thead>
	
	<tbody>
	
	
        <tr>
            
                <td class="name"><code>tags</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">Object</span>


            
            </td>
            
            
            
            
            
            <td class="description last">A collection of tags {key: 'value', tag2: 'value2'}</td>
        </tr>
	
	
	
        <tr>
            
                <td class="name"><code>callback</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">function</span>


            
            </td>
            
            
            
            
            
            <td class="description last">Callback that will be fired after request.</td>
        </tr>
	
	
	</tbody>
</table>
    
    
    
<dl class="details">
    
        
    
    
    

    
    
    
    
    
    
    
    
    
    
    
    
    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="number.js.html">retreaver/number.js</a>, <a href="number.js.html#line59">line 59</a>
    </li></ul></dd>
    
    
    
    
    
    
    
</dl>

    
    

    

    
    
    
    <h5>Throws:</h5>
    
            

    <div class="param-desc">
    
        Will throw an error if attempting to modify tags on a number that doesn't belong to a number pool
with per-visitor numbers enabled.
    
    </div>


        
    
    
    
    
</dd>

        
            
<dt>
    <h4 class="name" id="remove_tags_by_keys"><span class="type-signature"></span>remove_tags_by_keys<span class="signature">(keys, callback)</span><span class="type-signature"></span></h4>
    
    
</dt>
<dd>
    
    
    <div class="description">
        Removes all tags with given keys from a number.
    </div>
    

    
    
    
    
    
        <h5>Parameters:</h5>
        

<table class="params">
    <thead>
	<tr>
		
		<th>Name</th>
		
		
		<th>Type</th>
		
		
		
		
		
		<th class="last">Description</th>
	</tr>
	</thead>
	
	<tbody>
	
	
        <tr>
            
                <td class="name"><code>keys</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">Array</span>


            
            </td>
            
            
            
            
            
            <td class="description last">An array of keys to remove. eg: ['key1', 'key2']</td>
        </tr>
	
	
	
        <tr>
            
                <td class="name"><code>callback</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">function</span>


            
            </td>
            
            
            
            
            
            <td class="description last">Callback that will be fired after request.</td>
        </tr>
	
	
	</tbody>
</table>
    
    
    
<dl class="details">
    
        
    
    
    

    
    
    
    
    
    
    
    
    
    
    
    
    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="number.js.html">retreaver/number.js</a>, <a href="number.js.html#line74">line 74</a>
    </li></ul></dd>
    
    
    
    
    
    
    
</dl>

    
    

    

    
    
    
    <h5>Throws:</h5>
    
            

    <div class="param-desc">
    
        Will throw an error if attempting to modify tags on a number that doesn't belong to a number pool
with per-visitor numbers enabled.
    
    </div>


        
    
    
    
    
</dd>

        
            
<dt>
    <h4 class="name" id="replace_tags"><span class="type-signature"></span>replace_tags<span class="signature">(tags, callback)</span><span class="type-signature"></span></h4>
    
    
</dt>
<dd>
    
    
    <div class="description">
        Replace tags on a number. Any tags that already exist on the number that match the given keys will be
removed. This can be used instead of calling remove_tags and then add_tags.
    </div>
    

    
    
    
    
    
        <h5>Parameters:</h5>
        

<table class="params">
    <thead>
	<tr>
		
		<th>Name</th>
		
		
		<th>Type</th>
		
		
		
		
		
		<th class="last">Description</th>
	</tr>
	</thead>
	
	<tbody>
	
	
        <tr>
            
                <td class="name"><code>tags</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">Object</span>


            
            </td>
            
            
            
            
            
            <td class="description last">A collection of tags {key: 'value', tag2: 'value2'}</td>
        </tr>
	
	
	
        <tr>
            
                <td class="name"><code>callback</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">function</span>


            
            </td>
            
            
            
            
            
            <td class="description last">Callback that will be fired after request.</td>
        </tr>
	
	
	</tbody>
</table>
    
    
    
<dl class="details">
    
        
    
    
    

    
    
    
    
    
    
    
    
    
    
    
    
    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="number.js.html">retreaver/number.js</a>, <a href="number.js.html#line43">line 43</a>
    </li></ul></dd>
    
    
    
    
    
    
    
</dl>

    
    

    

    
    
    
    <h5>Throws:</h5>
    
            

    <div class="param-desc">
    
        Will throw an error if attempting to modify tags on a number that doesn't belong to a number pool
with per-visitor numbers enabled.
    
    </div>


        
    
    
    
    
</dd>

        </dl>
    
    
    
    
    
</article>

</section>  




</div>

<nav>
    <h2><a href="index.html">Index</a></h2><h3>Classes</h3><ul><li><a href="Retreaver.Campaign.html">Campaign</a></li><li><a href="Retreaver.Number.html">Number</a></li></ul><h3>Namespaces</h3><ul><li><a href="Retreaver.html">Retreaver</a></li></ul><h3><a href="global.html">Global</a></h3>
</nav>

<br clear="both">

<footer>
    Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.2.2</a> on Tue Jul 23 2024 10:47:40 GMT+0300 (EEST)
</footer>

<script> prettyPrint(); </script>
<script src="scripts/linenumber.js"> </script>
</body>
</html>