<html>
<head>
    <base href="https://wiki.asterisk.org/wiki">
            <link rel="stylesheet" href="/wiki/s/2041/1/7/_/styles/combined.css?spaceKey=TOP&amp;forWysiwyg=true" type="text/css">
    </head>
<body style="background: white;" bgcolor="white" class="email-body">
<div id="pageContent">
<div id="notificationFormat">
<div class="wiki-content">
<div class="email">
    <h2><a href="https://wiki.asterisk.org/wiki/display/TOP/Registrar">Registrar</a></h2>
    <h4>Page <b>edited</b> by             <a href="https://wiki.asterisk.org/wiki/display/~mmichelson">Mark Michelson</a>
    </h4>
        <br/>
                         <h4>Changes (32)</h4>
                                 
    
<div id="page-diffs">
                    <table class="diff" cellpadding="0" cellspacing="0">
    
            <tr><td class="diff-snipped" >...<br></td></tr>
            <tr><td class="diff-unchanged" >h1. Registration data <br> <br></td></tr>
            <tr><td class="diff-deleted-lines" style="color:#999;background-color:#fdd;text-decoration:line-through;">A registration in Asterisk SCF is a single contact URI that is bound to an AoR. We can infer from this that a single AoR may have multiple registrations associated with it, and a single REGISTER message may create multiple registrations in Asterisk SCF. <br></td></tr>
            <tr><td class="diff-added-lines" style="background-color: #dfd;">A binding in Asterisk SCF is a single contact URI that is bound to an AoR. A single AoR may have multiple bindings associated with it, and a single REGISTER message may create multiple bindings in Asterisk SCF. <br></td></tr>
            <tr><td class="diff-unchanged" > <br></td></tr>
            <tr><td class="diff-changed-lines" >The <span class="diff-deleted-words"style="color:#999;background-color:#fdd;text-decoration:line-through;">Registration</span> <span class="diff-added-words"style="background-color: #dfd;">{{Binding}}</span> object is defined in <span class="diff-changed-words"><span class="diff-deleted-chars"style="color:#999;background-color:#fdd;text-decoration:line-through;">s</span><span class="diff-added-chars"style="background-color: #dfd;">S</span>lice</span> since the registrar&#39;s state will need to be replicated. <br></td></tr>
            <tr><td class="diff-unchanged" > <br>{code: language=slice} <br></td></tr>
            <tr><td class="diff-changed-lines" >class <span class="diff-deleted-words"style="color:#999;background-color:#fdd;text-decoration:line-through;">Registration</span> <span class="diff-added-words"style="background-color: #dfd;">Binding</span> <br></td></tr>
            <tr><td class="diff-unchanged" >{ <br>    /** <br></td></tr>
            <tr><td class="diff-changed-lines" >* The contact URI associated with this particular <span class="diff-deleted-words"style="color:#999;background-color:#fdd;text-decoration:line-through;">registration.</span> <span class="diff-added-words"style="background-color: #dfd;">Binding.</span> <br></td></tr>
            <tr><td class="diff-unchanged" >     */ <br>    string contact; <br>    /** <br></td></tr>
            <tr><td class="diff-changed-lines" >* The Call-ID from the latest successful <span class="diff-deleted-words"style="color:#999;background-color:#fdd;text-decoration:line-through;">registration.</span> <span class="diff-added-words"style="background-color: #dfd;">Binding.</span> <br></td></tr>
            <tr><td class="diff-unchanged" >     */ <br>    string callid; <br>    /** <br></td></tr>
            <tr><td class="diff-changed-lines" >* The CSeq from the latest successful <span class="diff-deleted-words"style="color:#999;background-color:#fdd;text-decoration:line-through;">registration.</span> <span class="diff-added-words"style="background-color: #dfd;">Binding.</span> <br></td></tr>
            <tr><td class="diff-unchanged" >     */ <br>    int cseq; <br>    /** <br></td></tr>
            <tr><td class="diff-changed-lines" >* A UNIX timestamp indicating when the <span class="diff-deleted-words"style="color:#999;background-color:#fdd;text-decoration:line-through;">registration</span> <span class="diff-added-words"style="background-color: #dfd;">Binding</span> is set <br></td></tr>
            <tr><td class="diff-unchanged" >     * to expire <br>     */ <br></td></tr>
            <tr><td class="diff-snipped" >...<br></td></tr>
            <tr><td class="diff-unchanged" >}; <br> <br></td></tr>
            <tr><td class="diff-deleted-lines" style="color:#999;background-color:#fdd;text-decoration:line-through;">sequence&lt;Registration&gt; RegistrationSeq; <br></td></tr>
            <tr><td class="diff-added-lines" style="background-color: #dfd;">sequence&lt;Binding&gt; BindingSeq; <br></td></tr>
            <tr><td class="diff-unchanged" > <br></td></tr>
            <tr><td class="diff-deleted-lines" style="color:#999;background-color:#fdd;text-decoration:line-through;">dictionary&lt;string, RegistrationSeq&gt; RegistrationDict; <br></td></tr>
            <tr><td class="diff-added-lines" style="background-color: #dfd;">dictionary&lt;string, BindingSeq&gt; BindingDict; <br></td></tr>
            <tr><td class="diff-unchanged" > <br>{code} <br> <br></td></tr>
            <tr><td class="diff-changed-lines" >The <span class="diff-deleted-words"style="color:#999;background-color:#fdd;text-decoration:line-through;">{{Registration}}</span> <span class="diff-added-words"style="background-color: #dfd;">{{Binding}}</span> object represents all the state data that needs to be replicated between registrars. Individual registrars will be responsible for scheduling destruction of their local <span class="diff-deleted-words"style="color:#999;background-color:#fdd;text-decoration:line-through;">registration objects</span> <span class="diff-added-words"style="background-color: #dfd;">{{Bindings}}</span> based on the <span class="diff-deleted-words"style="color:#999;background-color:#fdd;text-decoration:line-through;">registration&#39;s</span> <span class="diff-added-words"style="background-color: #dfd;">binding&#39;s</span> expiration. <br></td></tr>
            <tr><td class="diff-unchanged" > <br>h1. Interfaces <br></td></tr>
            <tr><td class="diff-snipped" >...<br></td></tr>
            <tr><td class="diff-unchanged" >{code: language=slice} <br> <br></td></tr>
            <tr><td class="diff-added-lines" style="background-color: #dfd;">struct BindingUpdate <br></td></tr>
            <tr><td class="diff-changed-lines" ><span class="diff-deleted-words"style="color:#999;background-color:#fdd;text-decoration:line-through;">/**</span> <span class="diff-added-words"style="background-color: #dfd;">{</span> <br></td></tr>
            <tr><td class="diff-deleted-lines" style="color:#999;background-color:#fdd;text-decoration:line-through;"> * The first string in the dictionary is an AoR. <br> * The string sequence is a list of all contacts <br> * bound to the particular AoR. <br></td></tr>
            <tr><td class="diff-changed-lines" ><span class="diff-deleted-words"style="color:#999;background-color:#fdd;text-decoration:line-through;">*/</span> <span class="diff-added-words"style="background-color: #dfd;">/**</span> <br></td></tr>
            <tr><td class="diff-deleted-lines" style="color:#999;background-color:#fdd;text-decoration:line-through;">dictionary&lt;string, StringSeq&gt; ContactDict; <br></td></tr>
            <tr><td class="diff-added-lines" style="background-color: #dfd;">     * The AoR for which bindings have been updated <br>     */ <br>    string aor; <br>    /** <br>     * The contacts from all bindings for this AoR <br>     */ <br>    StringSeq contacts; <br>} <br></td></tr>
            <tr><td class="diff-unchanged" > <br>/** <br></td></tr>
            <tr><td class="diff-changed-lines" >* A RegistrarListener is updated when <span class="diff-deleted-words"style="color:#999;background-color:#fdd;text-decoration:line-through;">registration</span> <span class="diff-added-words"style="background-color: #dfd;">a binding changes.</span> <br></td></tr>
            <tr><td class="diff-deleted-lines" style="color:#999;background-color:#fdd;text-decoration:line-through;"> * information changes. Typical RegistrarListeners will <br> * be SIP services that require up-to-date registration <br></td></tr>
            <tr><td class="diff-added-lines" style="background-color: #dfd;"> * Typical RegistrarListeners will be SIP services that <br></td></tr>
            <tr><td class="diff-changed-lines" >* <span class="diff-added-words"style="background-color: #dfd;">require up-to-date</span> information. <br></td></tr>
            <tr><td class="diff-unchanged" > */ <br>interface RegistrarListener <br></td></tr>
            <tr><td class="diff-snipped" >...<br></td></tr>
            <tr><td class="diff-unchanged" >     * bindings. <br>     */ <br></td></tr>
            <tr><td class="diff-changed-lines" >void <span class="diff-deleted-words"style="color:#999;background-color:#fdd;text-decoration:line-through;">contactsAdded(ContactDict</span> <span class="diff-added-words"style="background-color: #dfd;">contactsAdded(BindingUpdate</span> contacts); <br></td></tr>
            <tr><td class="diff-unchanged" >    /** <br>     * Alerts the listener that contacts have been removed. <br></td></tr>
            <tr><td class="diff-snipped" >...<br></td></tr>
            <tr><td class="diff-unchanged" >     * appropriate action if the AoR has no bound contacts. <br>     */ <br></td></tr>
            <tr><td class="diff-changed-lines" >void <span class="diff-deleted-words"style="color:#999;background-color:#fdd;text-decoration:line-through;">contactsRemoved(ContactDict</span> <span class="diff-added-words"style="background-color: #dfd;">contactsRemoved(BindingUpdate</span> contacts); <br></td></tr>
            <tr><td class="diff-unchanged" >}; <br> <br></td></tr>
            <tr><td class="diff-snipped" >...<br></td></tr>
            <tr><td class="diff-unchanged" >     * Get the mapping of all active registrations. <br>     */ <br></td></tr>
            <tr><td class="diff-deleted-lines" style="color:#999;background-color:#fdd;text-decoration:line-through;">    RegistrationDict getAllRegistrations(); <br></td></tr>
            <tr><td class="diff-added-lines" style="background-color: #dfd;">    BindingDict getAllBindings(); <br></td></tr>
            <tr><td class="diff-unchanged" >    /** <br></td></tr>
            <tr><td class="diff-changed-lines" >* Get all <span class="diff-deleted-words"style="color:#999;background-color:#fdd;text-decoration:line-through;">registrations</span> <span class="diff-added-words"style="background-color: #dfd;">bindings</span> associated with a particular AoR <br></td></tr>
            <tr><td class="diff-unchanged" >     */ <br></td></tr>
            <tr><td class="diff-deleted-lines" style="color:#999;background-color:#fdd;text-decoration:line-through;">    RegistrationSeq getAORRegistrations(string aor); <br></td></tr>
            <tr><td class="diff-added-lines" style="background-color: #dfd;">    BindingSeq getAORBindings(string aor); <br></td></tr>
            <tr><td class="diff-unchanged" >}; <br>{code} <br> <br></td></tr>
            <tr><td class="diff-changed-lines" >A <span class="diff-deleted-words"style="color:#999;background-color:#fdd;text-decoration:line-through;">{{RegistrationListener}}</span> <span class="diff-added-words"style="background-color: #dfd;">{{RegistrarListener}}</span> registers itself with the {{Registrar}} in order to receive updates about the {{Registrar}}&#39;s bindings. Most {{RegistrarListeners}} will be other SIP services that need to use the <span class="diff-deleted-words"style="color:#999;background-color:#fdd;text-decoration:line-through;">registration</span> <span class="diff-added-words"style="background-color: #dfd;">registrar&#39;s</span> data. A {{RegistrarListener}} is always provided with a <span class="diff-deleted-words"style="color:#999;background-color:#fdd;text-decoration:line-through;">{{ContactDict}}</span> <span class="diff-added-words"style="background-color: #dfd;">{{BindingUpdate}}</span> instead of a <span class="diff-deleted-words"style="color:#999;background-color:#fdd;text-decoration:line-through;">{{RegistrationDict}}</span> <span class="diff-added-words"style="background-color: #dfd;">{{BindingDict}}</span> because information besides the contact in a <span class="diff-deleted-words"style="color:#999;background-color:#fdd;text-decoration:line-through;">{{Registration}}</span> <span class="diff-added-words"style="background-color: #dfd;">{{Binding}}</span> is not useful outside the registrar service. If a component wishes to get a full <span class="diff-deleted-words"style="color:#999;background-color:#fdd;text-decoration:line-through;">{{Registration}}</span> <span class="diff-added-words"style="background-color: #dfd;">{{Binding}}</span> it may use a variant of <span class="diff-deleted-words"style="color:#999;background-color:#fdd;text-decoration:line-through;">{{getRegistrations}}</span> <span class="diff-added-words"style="background-color: #dfd;">{{getBindings}}</span> to do so. <br></td></tr>
            <tr><td class="diff-unchanged" > <br></td></tr>
            <tr><td class="diff-changed-lines" >SIP endpoints are not referenced in these interfaces. The reason is that, as of this article&#39;s creation, there is no such thing as a SIP endpoint defined in <span class="diff-changed-words"><span class="diff-deleted-chars"style="color:#999;background-color:#fdd;text-decoration:line-through;">s</span><span class="diff-added-chars"style="background-color: #dfd;">S</span>lice,</span> much less a method of retrieving a list of SIP endpoints based on AoRs. As such, when a REGISTER is received, the registrar may use the routing service&#39;s endpoint location feature to locate an endpoint based on data in the