No subject
Mon Jan 10 01:51:56 CST 2011
ociated with the AoR. The responsibility for updating local endpoints falls=
to the {{RegistrarListeners}}. <br></td></tr>
<tr><td class=3D"diff-unchanged" > <br>h1. Operation <br></td><=
/tr>
<tr><td class=3D"diff-snipped" >...<br></td></tr>
=20
</table>
</div> <h4>Full Content</h4>
<div class=3D"notificationGreySide">
<div class=3D'panelMacro'><table class=3D'warningMacro'><colgroup><=
col width=3D'24'><col></colgroup><tr><td valign=3D'top'><img src=3D"/wiki/i=
mages/icons/emoticons/forbidden.gif" width=3D"16" height=3D"16" align=3D"ab=
smiddle" alt=3D"" border=3D"0"></td><td>Work in progress</td></tr></table><=
/div>
<h1><a name=3D"Registrar-Registrar%27sDuties"></a>Registrar's Duties</h1>
<p>The SIP registrar's job is to maintain a mapping of addresses-of-record =
(AoRs) to contact URIs. The registrar is responsible for letting other SIP =
services within a cluster know of updates to this mapping. The registrar po=
pulates this mapping based on incoming SIP REGISTER requests it receives.</=
p>
<h1><a name=3D"Registrar-Endpoints"></a>Endpoints</h1>
<p>SIP endpoints will be configured to determine which AoRs they are associ=
ated with. For instance, if a SIP endpoint named "Bob" were to be configure=
d to be associated with the AoR "sip:bob at example.com" then this would imply=
the following things:</p>
<ol>
=09<li>REGISTER requests from Bob would be permitted to add and remove bind=
ings for the AoR sip:bob at example.com</li>
=09<li>SIP Requests targeted at sip:bob at example.com would be targeted for B=
ob.</li>
</ol>
<p>An endpoint may be associated with multiple AoRs and multiple endpoints =
may be associated with the same AoR.</p>
<h1><a name=3D"Registrar-Registrationdata"></a>Registration data</h1>
<p>A binding in Asterisk SCF is a single contact URI that is bound to an Ao=
R. A single AoR may have multiple bindings associated with it, and a single=
REGISTER message may create multiple bindings in Asterisk SCF.</p>
<p>The <tt>Binding</tt> object is defined in Slice since the registrar's st=
ate will need to be replicated.</p>
<div class=3D"code panel" style=3D"border-width: 1px;"><div class=3D"codeCo=
ntent panelContent">
<script type=3D"syntaxhighlighter" class=3D"toolbar: false; theme: Confluen=
ce; brush: java; gutter: false"><![CDATA[
class Binding
{
/**
* The contact URI associated with this particular Binding.
*/
string contact;
/**
* The Call-ID from the latest successful Binding.
*/
string callid;
/**
* The CSeq from the latest successful Binding.
*/
int cseq;
/**
* A UNIX timestamp indicating when the Binding is set
* to expire
*/
int expiration;
};
sequence<Binding> BindingSeq;
dictionary<string, BindingSeq> BindingDict;
]]></script>
</div></div>
<p>The <tt>Binding</tt> object represents all the state data that needs to =
be replicated between registrars. Individual registrars will be responsible=
for scheduling destruction of their local <tt>Bindings</tt> based on the b=
inding's expiration.</p>
<h1><a name=3D"Registrar-Interfaces"></a>Interfaces</h1>
<p>The registrar will not have much in the way of public interfaces since t=
he data it makes available is pushed out to the other SIP services.</p>
<div class=3D"code panel" style=3D"border-width: 1px;"><div class=3D"codeCo=
ntent panelContent">
<script type=3D"syntaxhighlighter" class=3D"toolbar: false; theme: Confluen=
ce; brush: java; gutter: false"><![CDATA[
struct BindingUpdate
{
/**
* The AoR for which bindings have been updated
*/
string aor;
/**
* The contacts from all bindings for this AoR
*/
StringSeq contacts;
}
/**
* A RegistrarListener is updated when a binding changes.
* Typical RegistrarListeners will be SIP services that
* require up-to-date information.
*/
interface RegistrarListener
{
/**
* Alerts the listener that contacts have been added.
* The AoR may be new or it may have previous
* bindings.
*/
void contactsAdded(BindingUpdate contacts);
/**
* Alerts the listener that contacts have been removed.
* There is no specific call for indicating that an AoR
* no longer has contacts associated with it. After this
* method has been called, listeners should take
* appropriate action if the AoR has no bound contacts.
*/
void contactsRemoved(BindingUpdate contacts);
};
interface Registrar
{
/**
* Add a new listener to the registrar.
* The return value is the map of all AoRs and their
* bindings.
*/
ContactDict addListener(RegistrarListener *listener);
/**
* Remove a listener.
*/
void removeListener(RegistrarLister *listener);
/**
* Get the mapping of all active registrations.
*/
BindingDict getAllBindings();
/**
* Get all bindings associated with a particular AoR
*/
BindingSeq getAORBindings(string aor);
};
]]></script>
</div></div>
<p>A <tt>RegistrarListener</tt> registers itself with the <tt>Registrar</tt=
> in order to receive updates about the <tt>Registrar</tt>'s bindings. Most=
<tt>RegistrarListeners</tt> will be other SIP services that need to use th=
e registrar's data. A <tt>RegistrarListener</tt> is always provided with a =
<tt>BindingUpdate</tt> instead of a <tt>BindingDict</tt> because informatio=
n besides the contact in a <tt>Binding</tt> is not useful outside the regis=
trar service. If a component wishes to get a full <tt>Binding</tt> it may u=
se a variant of <tt>getBindings</tt> to do so.</p>
<p>SIP endpoints are not referenced in these interfaces. The reason is that=
, as of this article's creation, there is no such thing as a SIP endpoint d=
efined in Slice, much less a method of retrieving a list of SIP endpoints b=
ased on AoRs. As such, when a REGISTER is received, the registrar may use t=
he routing service's endpoint location feature to locate an endpoint based =
on data in the From header. The registrar will not be able to find any othe=
r endpoints associated with the AoR. The responsibility for updating local =
endpoints falls to the <tt>RegistrarListeners</tt>.</p>
<h1><a name=3D"Registrar-Operation"></a>Operation</h1>
<p><span class=3D"image-wrap" style=3D""><img src=3D"/wiki/download/attachm=
ents/12550396/Registration.png?version=3D1&modificationDate=3D129901854=
3697" style=3D"border: 0px solid black" /></span></p>
<p>The diagram shows that when contacts are added or removed from the regis=
trar, the <tt>RegistrarListener</tt> is notified. The third REGISTER transa=
ction does not notify the listener. This is because the REGISTER was refres=
hing the expiration period for a previously established contact. While this=
results in internal changes to the registrar and its replicas, <tt>Registr=
arListeners</tt> do not need to be updated.</p>
<h1><a name=3D"Registrar-Otherideas"></a>Other ideas</h1>
<ul>
=09<li>The registrar specification does not currently authorize third party=
registrations. By this, I mean that an endpoint can only be configured to =
update bindings for his own AoRs, not bindings for AoRs associated with oth=
er endpoints. This could be allowed, but the configuration would become mor=
e complex for a feature that is not widely used.</li>
</ul>
<ul>
=09<li>Once SIP configuration interfaces and objects have stabilized, the s=
ection about <tt>RegistrarListeners</tt> may change. If it becomes practica=
l, there may not be a need for <tt>RegistrationListeners</tt> if the regist=
rar is able to push configuration updates to endpoints directly.</li>
</ul>
<ul>
=09<li>Providing a mechanism for default AoRs may be desirable. For instanc=
e, if there is an endpoint named "Bob" and his endpoint belongs to the doma=
ins "example1.com" and "example2.com" then it may be reasonable to automati=
cally associate Bob with the AoRs "sip:bob at example1.com" and "sip:bob at examp=
le2.com." Implicit behavior is typically discouraged in Asterisk SCF, which=
is why default AoRs are not currently defined.</li>
</ul>
</div>
<div id=3D"commentsSection" class=3D"wiki-content pageSection">
<div style=3D"float: right;">
<a href=3D"https://wiki.asterisk.org/wiki/users/viewnotificatio=
ns.action" class=3D"grey">Change Notification Preferences</a>
</div>
<a href=3D"https://wiki.asterisk.org/wiki/display/TOP/Registrar">Vi=
ew Online</a>
|
<a href=3D"https://wiki.asterisk.org/wiki/pages/diffpagesbyversion.=
action?pageId=3D12550396&revisedVersion=3D8&originalVersion=3D7">View Chang=
es</a>
|
<a href=3D"https://wiki.asterisk.org/wiki/display/TOP/Registrar?sho=
wComments=3Dtrue&showCommentArea=3Dtrue#addcomment">Add Comment</a>
</div>
</div>
</div>
</div>
</div>
</body>
</html>
More information about the asterisk-scf-wiki-changes
mailing list