[asterisk-scf-commits] asterisk-scf/integration/slice.git branch "sip-registrar" created.

Commits to the Asterisk SCF project code repositories asterisk-scf-commits at lists.digium.com
Fri Mar 25 17:16:15 CDT 2011


branch "sip-registrar" has been created
        at  2b555571b4b13f4de4b60f42b5b7058f2f692ca3 (commit)

- Log -----------------------------------------------------------------
commit 2b555571b4b13f4de4b60f42b5b7058f2f692ca3
Author: Mark Michelson <mmichelson at digium.com>
Date:   Fri Mar 25 17:15:25 2011 -0500

    Copy Registrar interface from wiki.

diff --git a/AsteriskSCF/SIP/SIPRegistrarIf.ice b/AsteriskSCF/SIP/SIPRegistrarIf.ice
new file mode 100644
index 0000000..508871c
--- /dev/null
+++ b/AsteriskSCF/SIP/SIPRegistrarIf.ice
@@ -0,0 +1,125 @@
+/*
+ * Asterisk SCF -- An open-source communications framework.
+ *
+ * Copyright (C) 2011, Digium, Inc.
+ *
+ * See http://www.asterisk.org for more information about
+ * the Asterisk SCF project. Please do not directly contact
+ * any of the maintainers of this project for assistance;
+ * the project provides a web site, mailing lists and IRC
+ * channels for your use.
+ *
+ * This program is free software, distributed under the terms of
+ * the GNU General Public License Version 2. See the LICENSE.txt file
+ * at the top of the source tree.
+ */
+
+#pragma once
+
+#include <Ice/BuiltinSequences.ice>
+
+module AsteriskSCF
+{
+
+module SIP
+{
+
+module Registration
+{
+
+["suppress"]
+module V1
+{
+
+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;
+
+struct BindingUpdate
+{
+    /**
+     * The AoR for which bindings have been updated
+     */
+    string aor;
+    /**
+     * The contacts from all bindings for this AoR
+     */
+    Ice::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);
+};
+
+/**
+ * A dictionary mapping
+ * AoRs to their bound contacts
+ */
+dictionary<string, Ice::StringSeq> ContactDict;
+
+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(RegistrarListener *listener);
+     /**
+      * Get the mapping of all active registrations.
+      */
+     BindingDict getAllBindings();
+     /**
+      * Get all bindings associated with a particular AoR
+      */
+     BindingSeq getAORBindings(string aor);
+};
+
+}; // end module V1
+}; // end module Registration
+}; // end module SIP
+}; // end module AsteriskSCF

-----------------------------------------------------------------------


-- 
asterisk-scf/integration/slice.git



More information about the asterisk-scf-commits mailing list