ekiga r6134 - in trunk: . src/endpoints



Author: dsandras
Date: Sun Apr  6 18:55:29 2008
New Revision: 6134
URL: http://svn.gnome.org/viewvc/ekiga?rev=6134&view=rev

Log:
First changes in order to make the SIP and H.323 EndPoints become a
CallManager implementation instead of the GMManager. Having the
GMManager being a CallManager was not a good idea for several reasons.
(difference of features between protocols).


Modified:
   trunk/ChangeLog
   trunk/src/endpoints/manager.cpp
   trunk/src/endpoints/manager.h
   trunk/src/endpoints/opal-main.cpp
   trunk/src/endpoints/sip.cpp
   trunk/src/endpoints/sip.h

Modified: trunk/src/endpoints/manager.cpp
==============================================================================
--- trunk/src/endpoints/manager.cpp	(original)
+++ trunk/src/endpoints/manager.cpp	Sun Apr  6 18:55:29 2008
@@ -271,19 +271,6 @@
 }
 
 
-bool GMManager::send_message (const std::string uri, const std::string message)
-{
-  if (uri.find ("sip:") == 0 || uri.find (":") == string::npos) {
-
-    if (!uri.empty () && !message.empty ())
-      sipEP->Message (uri.c_str (), message.c_str ());
-
-    return true;
-  }
-
-  return false;
-}
-
 void GMManager::set_fullname (const std::string name)
 {
   SetDefaultDisplayName (name.c_str ());
@@ -299,69 +286,6 @@
 }
 
 
-bool
-GMManager::populate_menu (Ekiga::Contact &contact,
-                          Ekiga::MenuBuilder &builder)
-{
-  std::string name = contact.get_name ();
-  std::map<std::string, std::string> uris = contact.get_uris ();
-
-  return menu_builder_add_actions (name, uris, builder);
-}
-
-
-bool 
-GMManager::populate_menu (const std::string uri,
-                          Ekiga::MenuBuilder & builder)
-{
-  std::map<std::string, std::string> uris; 
-  uris [""] = uri;
-
-  return menu_builder_add_actions ("", uris, builder);
-}
-
-
-bool 
-GMManager::menu_builder_add_actions (const std::string & fullname,
-                                     std::map<std::string,std::string> & uris,
-                                     Ekiga::MenuBuilder & builder)
-{
-  bool populated = false;
-
-  /* Add actions of type "call" for all uris */
-  for (std::map<std::string, std::string>::const_iterator iter = uris.begin ();
-       iter != uris.end ();
-       iter++) {
-
-    std::string action = _("Call");
-
-    if (!iter->first.empty ())
-      action = action + " [" + iter->first + "]";
-
-    builder.add_action ("call", action, sigc::bind (sigc::mem_fun (this, &GMManager::on_dial), iter->second));
-
-    populated = true;
-  }
-
-  /* Add actions of type "message" for all uris */
-  for (std::map<std::string, std::string>::const_iterator iter = uris.begin ();
-       iter != uris.end ();
-       iter++) {
-
-    std::string action = _("Message");
-
-    if (!iter->first.empty ())
-      action = action + " [" + iter->first + "]";
-
-    builder.add_action ("message", action, sigc::bind (sigc::mem_fun (this, &GMManager::on_message), fullname, iter->second));
-
-    populated = true;
-  }
-
-  return populated;
-}
-
-
 void GMManager::get_jitter_buffer_size (unsigned & min_val,
                                         unsigned & max_val)
 {
@@ -1027,8 +951,6 @@
 
   call = new Opal::Call (*this, core);
 
-  runtime.run_in_main (sigc::bind (new_call, call));
-
   return dynamic_cast<OpalCall *> (call);
 }
 
@@ -1135,47 +1057,6 @@
   re_audio_codec = tr_audio_codec = re_video_codec = tr_video_codec = "";
 }
 
-
-void 
-GMManager::OnMessageReceived (const SIPURL & _from,
-                              const PString & _body)
-{
-  SIPURL from = _from;
-  std::string display_name = (const char *) from.GetDisplayName ();
-  from.AdjustForRequestURI ();
-  std::string uri = (const char *) from.AsString ();
-  std::string message = (const char *) _body;
-
-  audiooutput_core.play_event("new_message_sound");
-
-  runtime.run_in_main (sigc::bind (im_received.make_slot (), display_name, uri, message));
-}
-
-
-void 
-GMManager::OnMessageFailed (const SIPURL & _to,
-                            G_GNUC_UNUSED SIP_PDU::StatusCodes reason)
-{
-  SIPURL to = _to;
-  to.AdjustForRequestURI ();
-  std::string uri = (const char *) to.AsString ();
-  runtime.run_in_main (sigc::bind (im_failed.make_slot (), uri, 
-                                   _("Could not send message")));
-}
-
-
-void 
-GMManager::OnMessageSent (const PString & _to,
-                          const PString & body)
-{
-  SIPURL to = _to;
-  to.AdjustForRequestURI ();
-  std::string uri = (const char *) to.AsString ();
-  std::string message = (const char *) body;
-  runtime.run_in_main (sigc::bind (im_sent.make_slot (), uri, message));
-}
-
-
 void
 GMManager::Init ()
 {
@@ -1461,20 +1342,6 @@
   return err;
 }
 
-void
-GMManager::on_dial (std::string uri)
-{
-  dial (uri);
-}
-
-
-void
-GMManager::on_message (std::string name,
-                       std::string uri)
-{
-  runtime.run_in_main (sigc::bind (new_chat.make_slot (), name, uri));
-}
-
 
 void
 GMManager::OnMWIReceived (const PString & account,

Modified: trunk/src/endpoints/manager.h
==============================================================================
--- trunk/src/endpoints/manager.h	(original)
+++ trunk/src/endpoints/manager.h	Sun Apr  6 18:55:29 2008
@@ -57,8 +57,8 @@
 #include "runtime.h"
 #include "contact-core.h"
 #include "presence-core.h"
-#include "call-manager.h"
 #include "call-core.h"
+#include "call-manager.h"
 #include "call.h"
 #include "audiooutput-core.h"
 
@@ -82,11 +82,8 @@
  */
 
 class GMManager: 
-    public OpalManager,
     public Ekiga::Service,
-    public Ekiga::ContactDecorator,
-    public Ekiga::PresentityDecorator,
-    public Ekiga::CallManager
+    public OpalManager
 {
   PCLASSINFO(GMManager, OpalManager);
 
@@ -122,16 +119,6 @@
   const std::string get_description () const
     { return "\tObject bringing in Opal support (calls, text messaging, sip, h323, ...)"; }
 
-  bool populate_menu (Ekiga::Contact &contact,
-                      Ekiga::MenuBuilder &builder);
-
-  bool populate_menu (const std::string uri,
-                      Ekiga::MenuBuilder & builder);
-
-  bool menu_builder_add_actions (const std::string & fullname,
-                                 std::map<std::string, std::string> & uris,
-                                 Ekiga::MenuBuilder & builder);
-
   void get_jitter_buffer_size (unsigned & min_val,
                                unsigned & max_val);
   void set_jitter_buffer_size (unsigned min_val,
@@ -180,9 +167,6 @@
   /**/
   bool dial (const std::string uri); 
 
-  bool send_message (const std::string uri, 
-                     const std::string message);
-
   /**/
   void set_fullname (const std::string name);
   const std::string get_fullname () const;
@@ -274,21 +258,6 @@
   void OnClearedCall (OpalCall &);
 
 
-  /* DESCRIPTION  :  Called when a message has been received.
-   * BEHAVIOR     :  Updates the text chat window, updates the tray icon in
-   * 		     flashing state if the text chat window is hidden.
-   * PRE          :  /
-   */
-  void OnMessageReceived (const SIPURL & from,
-			  const PString & body);
-
-  void OnMessageFailed (const SIPURL & messageUrl,
-                        SIP_PDU::StatusCodes reason);
-
-  void OnMessageSent (const PString & to,
-                      const PString & body);
-
-
   /** Return the list of available codecs
    * @return a set of the codecs and their descriptions
    */
@@ -484,10 +453,6 @@
   sigc::signal<void, std::string, std::string, unsigned int> mwi_event;
 
  private:
-  void on_dial (std::string uri);
-
-  void on_message (std::string name,
-                   std::string uri);
 
   
  protected:

Modified: trunk/src/endpoints/opal-main.cpp
==============================================================================
--- trunk/src/endpoints/opal-main.cpp	(original)
+++ trunk/src/endpoints/opal-main.cpp	Sun Apr  6 18:55:29 2008
@@ -74,17 +74,17 @@
   GMManager *manager = new GMManager (core);
   GMSIPEndpoint *sipEP = manager->GetSIPEndpoint ();
 
-  call_core->add_manager (*manager);
+  call_core->add_manager (*sipEP);
   core.add (*manager); // FIXME temporary
 
   if (contact_core != NULL) 
-    contact_core->add_contact_decorator (*manager);
+    contact_core->add_contact_decorator (*sipEP);
   else
     return false;
 
   if (presence_core != NULL) {
 
-    presence_core->add_presentity_decorator (*manager);
+    presence_core->add_presentity_decorator (*sipEP);
     presence_core->add_supported_uri (sigc::ptr_fun (is_sip_address));
     presence_core->add_presence_fetcher (*sipEP);
     presence_core->add_presence_publisher (*sipEP);

Modified: trunk/src/endpoints/sip.cpp
==============================================================================
--- trunk/src/endpoints/sip.cpp	(original)
+++ trunk/src/endpoints/sip.cpp	Sun Apr  6 18:55:29 2008
@@ -49,9 +49,10 @@
 /* The class */
 GMSIPEndpoint::GMSIPEndpoint (GMManager & ep, Ekiga::ServiceCore & _core)
 : SIPEndPoint (ep), 
-    Ekiga::PresencePublisher (_core), 
-    endpoint (ep), 
-    core (_core)
+  Ekiga::PresencePublisher (_core), 
+  endpoint (ep), 
+  core (_core),
+  runtime (*(dynamic_cast<Ekiga::Runtime *> (core.get ("runtime"))))
 {
   uri_prefix = "sip:";
 
@@ -66,8 +67,6 @@
   /* Update the User Agent */
   SetUserAgent ("Ekiga/" PACKAGE_VERSION);
 
-  NoAnswerTimer.SetNotifier (PCREATE_NOTIFIER (OnNoAnswerTimeout));
-
   Ekiga::PersonalDetails *details = dynamic_cast<Ekiga::PersonalDetails *> (_core.get ("personal-details"));
   if (details)
     publish (*details);
@@ -79,6 +78,96 @@
 }
 
 
+bool GMSIPEndpoint::dial (const std::string uri)
+{
+  return endpoint.dial (uri);
+}
+
+
+bool GMSIPEndpoint::send_message (const std::string uri, const std::string message)
+{
+  if (!uri.empty () && !message.empty ()) {
+    Message (uri.c_str (), message.c_str ());
+
+    return true;
+  }
+
+  return false;
+}
+
+
+Ekiga::CodecList GMSIPEndpoint::get_codecs ()
+{
+  return endpoint.get_codecs ();
+}
+
+
+void GMSIPEndpoint::set_codecs (Ekiga::CodecList & _codecs)
+{
+  endpoint.set_codecs (_codecs);
+}
+
+bool GMSIPEndpoint::populate_menu (Ekiga::Contact &contact,
+                                   Ekiga::MenuBuilder &builder)
+{
+  std::string name = contact.get_name ();
+  std::map<std::string, std::string> uris = contact.get_uris ();
+
+  return menu_builder_add_actions (name, uris, builder);
+}
+
+
+bool GMSIPEndpoint::populate_menu (const std::string uri,
+                                   Ekiga::MenuBuilder & builder)
+{
+  std::map<std::string, std::string> uris; 
+  uris [""] = uri;
+
+  return menu_builder_add_actions ("", uris, builder);
+}
+
+
+bool GMSIPEndpoint::menu_builder_add_actions (const std::string & fullname,
+                                              std::map<std::string,std::string> & uris,
+                                              Ekiga::MenuBuilder & builder)
+{
+  bool populated = false;
+
+  /* Add actions of type "call" for all uris */
+  for (std::map<std::string, std::string>::const_iterator iter = uris.begin ();
+       iter != uris.end ();
+       iter++) {
+
+    std::string action = _("Call");
+
+    if (!iter->first.empty ())
+      action = action + " [" + iter->first + "]";
+
+    builder.add_action ("call", action, sigc::bind (sigc::mem_fun (this, &GMSIPEndpoint::on_dial), iter->second));
+
+    populated = true;
+  }
+
+  /* Add actions of type "message" for all uris */
+  for (std::map<std::string, std::string>::const_iterator iter = uris.begin ();
+       iter != uris.end ();
+       iter++) {
+
+    std::string action = _("Message");
+
+    if (!iter->first.empty ())
+      action = action + " [" + iter->first + "]";
+
+    builder.add_action ("message", action, sigc::bind (sigc::mem_fun (this, &GMSIPEndpoint::on_message), fullname, iter->second));
+
+    populated = true;
+  }
+
+  return populated;
+}
+
+
+
 void
 GMSIPEndpoint::fetch (const std::string _uri)
 {
@@ -88,8 +177,8 @@
   if (loc != string::npos) 
     domain = _uri.substr (loc+1);
 
-  if (std::find (uris.begin (), uris.end (), _uri) == uris.end ())
-    uris.push_back (_uri);
+  if (std::find (subscribed_uris.begin (), subscribed_uris.end (), _uri) == subscribed_uris.end ())
+    subscribed_uris.push_back (_uri);
 
   if (std::find (domains.begin (), domains.end (), domain) != domains.end ()
       && !IsSubscribed (SIPSubscribe::Presence, _uri.c_str ())) {
@@ -108,7 +197,7 @@
     SIPSubscribe::SubscribeType type = SIPSubscribe::Presence;
     Subscribe (type, 0, PString (uri.c_str ()));
 
-    uris.remove (uri);
+    subscribed_uris.remove (uri);
   }
 }
 
@@ -361,8 +450,8 @@
     if (!was_registering && std::find (domains.begin (), domains.end (), server) != domains.end ()) 
       domains.remove (server);
 
-    for (std::list<std::string>::const_iterator iter = uris.begin (); 
-         iter != uris.end () ; 
+    for (std::list<std::string>::const_iterator iter = subscribed_uris.begin (); 
+         iter != subscribed_uris.end () ; 
          iter++) {
 
       found = (*iter).find (server, 0);
@@ -373,7 +462,7 @@
         SIPSubscribe::SubscribeType type = SIPSubscribe::Presence;
         Subscribe (type, was_registering ? 500 : 0, PString ((*iter).c_str ()));
         if (!was_registering)
-          uris.remove (*iter);
+          subscribed_uris.remove (*iter);
       }
     }
   }
@@ -386,6 +475,19 @@
 }
 
 
+bool GMSIPEndpoint::MakeConnection (OpalCall & _call,
+                                    const PString &party,
+                                    void *userData,
+                                    unsigned int options,
+                                    OpalConnection::StringOptions *stringOptions)
+{
+  Ekiga::Call *call = dynamic_cast<Ekiga::Call *> (&_call);
+  runtime.run_in_main (sigc::bind (new_call, call));
+
+  return SIPEndPoint::MakeConnection (_call, party, userData, options, stringOptions);
+}
+
+
 void
 GMSIPEndpoint::OnRegistrationFailed (const PString & _aor,
                                      SIP_PDU::StatusCodes r,
@@ -524,9 +626,6 @@
   else
     reason = 0; // Ask the user
 
-  if (reason == 0)
-    NoAnswerTimer.SetInterval (0, PMIN (no_answer_timeout, 60));
-
   return endpoint.OnIncomingConnection (connection, reason, forward_uri.c_str ());
 }
 
@@ -561,25 +660,44 @@
 
     val = new PString (pdu.GetMIME ().GetCallID ());
     msgData.SetAt (SIPURL (from).AsString (), val);
-    endpoint.OnMessageReceived(from, pdu.GetEntityBody());
+
+    SIPURL uri = from;
+    std::string display_name = (const char *) uri.GetDisplayName ();
+    uri.AdjustForRequestURI ();
+    std::string message_uri = (const char *) uri.AsString ();
+    std::string message = (const char *) pdu.GetEntityBody ();
+
+    // FIXME should be a signal
+    //audiooutput_core.play_event("new_message_sound");
+
+    runtime.run_in_main (sigc::bind (im_received.make_slot (), display_name, message_uri, message));
   }
 }
 
 
 void 
 GMSIPEndpoint::OnMessageFailed (const SIPURL & messageUrl,
-                                SIP_PDU::StatusCodes reason)
+                                SIP_PDU::StatusCodes /*reason*/)
 {
-  endpoint.OnMessageFailed (messageUrl, reason);
+  SIPURL to = messageUrl;
+  to.AdjustForRequestURI ();
+  std::string uri = (const char *) to.AsString ();
+  runtime.run_in_main (sigc::bind (im_failed.make_slot (), uri, 
+                                   _("Could not send message")));
 }
 
 
 void
-GMSIPEndpoint::Message (const PString & to,
+GMSIPEndpoint::Message (const PString & _to,
                         const PString & body)
 {
-  SIPEndPoint::Message (to, body);
-  endpoint.OnMessageSent (to, body);
+  SIPEndPoint::Message (_to, body);
+
+  SIPURL to = _to;
+  to.AdjustForRequestURI ();
+  std::string uri = (const char *) to.AsString ();
+  std::string message = (const char *) body;
+  runtime.run_in_main (sigc::bind (im_sent.make_slot (), uri, message));
 }
 
 
@@ -641,8 +759,6 @@
 void 
 GMSIPEndpoint::OnEstablished (OpalConnection &connection)
 {
-  NoAnswerTimer.Stop ();
-
   PTRACE (3, "GMSIPEndpoint\t SIP connection established");
   SIPEndPoint::OnEstablished (connection);
 }
@@ -651,8 +767,6 @@
 void 
 GMSIPEndpoint::OnReleased (OpalConnection &connection)
 {
-  NoAnswerTimer.Stop ();
-
   PTRACE (3, "GMSIPEndpoint\t SIP connection released");
   SIPEndPoint::OnReleased (connection);
 }
@@ -697,39 +811,24 @@
 
   Ekiga::PresenceCore *presence_core =
     dynamic_cast<Ekiga::PresenceCore *>(core.get ("presence-core"));
-  Ekiga::Runtime *runtime = 
-    dynamic_cast<Ekiga::Runtime *> (core.get ("runtime")); 
 
-  if (runtime) {
-   
-    /**
-     * TODO
-     * Wouldn't it be convenient to emit the signal and have the presence core listen to it ?
-     */
-    runtime->run_in_main (sigc::bind (presence_core->presence_received.make_slot (), _uri, presence));
-    runtime->run_in_main (sigc::bind (presence_core->status_received.make_slot (), _uri, status));
-  }
+  /**
+   * TODO
+   * Wouldn't it be convenient to emit the signal and have the presence core listen to it ?
+   */
+  runtime.run_in_main (sigc::bind (presence_core->presence_received.make_slot (), _uri, presence));
+  runtime.run_in_main (sigc::bind (presence_core->status_received.make_slot (), _uri, status));
 }
 
 
-void
-GMSIPEndpoint::OnNoAnswerTimeout (PTimer &,
-                                  INT) 
+void GMSIPEndpoint::on_dial (std::string uri)
 {
-  if (endpoint.GetCallingState () == GMManager::Called) {
-   
-    if (!forward_uri.empty () && forward_on_no_answer) {
-      
-      PSafePtr<OpalCall> call = 
-        endpoint.FindCallWithLock (endpoint.GetCurrentCallToken ());
-      PSafePtr<OpalConnection> con = 
-        endpoint.GetConnection (call, TRUE);
-    
-      con->ForwardCall (forward_uri.c_str ());
-    }
-    else
-      ClearAllCalls (OpalConnection::EndedByNoAnswer, FALSE);
-  }
+  endpoint.dial (uri);
 }
 
 
+void GMSIPEndpoint::on_message (std::string name,
+                                std::string uri)
+{
+  runtime.run_in_main (sigc::bind (new_chat.make_slot (), name, uri));
+}

Modified: trunk/src/endpoints/sip.h
==============================================================================
--- trunk/src/endpoints/sip.h	(original)
+++ trunk/src/endpoints/sip.h	Sun Apr  6 18:55:29 2008
@@ -46,6 +46,7 @@
 
 #include "manager.h"
 #include "presence-core.h"
+#include "call-manager.h"
 
 
 PDICTIONARY (msgDict, PString, PString);
@@ -54,30 +55,44 @@
 class Ekiga::PersonalDetails;
 
 
-/* Minimal SIP endpoint implementation */
 class GMSIPEndpoint 
 :   public SIPEndPoint, 
     public Ekiga::PresenceFetcher,
-    public Ekiga::PresencePublisher
+    public Ekiga::PresencePublisher,
+    public Ekiga::PresentityDecorator,
+    public Ekiga::ContactDecorator,
+    public Ekiga::CallManager
 {
   PCLASSINFO(GMSIPEndpoint, SIPEndPoint);
 
- public:
+public:
 
-  /* DESCRIPTION  :  The constructor.
-   * BEHAVIOR     :  Creates the H.323 Endpoint 
-   * 		     and initialises the variables
-   * PRE          :  /
-   */
   GMSIPEndpoint (GMManager &ep, Ekiga::ServiceCore & core);
 
-  
-  /* DESCRIPTION  :  The destructor.
-   * BEHAVIOR     :  /
-   * PRE          :  /
-   */
   ~GMSIPEndpoint ();
-  
+
+  /**/
+  bool dial (const std::string uri); 
+
+  bool send_message (const std::string uri, 
+                     const std::string message);
+
+  Ekiga::CodecList get_codecs ();
+
+  void set_codecs (Ekiga::CodecList & codecs); 
+
+  /***/
+  bool populate_menu (Ekiga::Contact &contact,
+                      Ekiga::MenuBuilder &builder);
+
+  bool populate_menu (const std::string uri,
+                      Ekiga::MenuBuilder & builder);
+
+  bool menu_builder_add_actions (const std::string & fullname,
+                                 std::map<std::string, std::string> & uris,
+                                 Ekiga::MenuBuilder & builder);
+  /***/
+
   /***/
   void fetch (const std::string uri);
   void unfetch (const std::string uri);
@@ -99,7 +114,7 @@
   void set_forward_on_no_answer (const bool enabled);
   void set_no_answer_timeout (const unsigned timeout);
 
-  
+
   /* DESCRIPTION  :  /
    * BEHAVIOR     :  Starts the listener thread on the port choosen 
    *                 in the options after having removed old listeners.
@@ -107,9 +122,9 @@
    * PRE          :  The interface.
    */
   bool StartListener (PString iface,
-		      WORD port);
+                      WORD port);
+
 
-  
   /* DESCRIPTION  :  /
    * BEHAVIOR     :  Register the SIP endpoint to the given SIP server. 
    * PRE          :  Correct parameters.
@@ -120,24 +135,30 @@
                  unsigned int expires,
                  bool unregister);
 
-  
+
   /* DESCRIPTION  :  Called when the registration is successful. 
    * BEHAVIOR     :  Displays a message in the status bar and history. 
    * PRE          :  /
    */
   void OnRegistered (const PString & aor,
-		     bool wasRegistering);
-  
-  
+                     bool wasRegistering);
+
+
   /* DESCRIPTION  :  Called when the registration fails.
    * BEHAVIOR     :  Displays a message in the status bar and history. 
    * PRE          :  /
    */
   void OnRegistrationFailed (const PString & aor,
-			     SIP_PDU::StatusCodes reason,
-			     bool wasRegistering);
-  
-  
+                             SIP_PDU::StatusCodes reason,
+                             bool wasRegistering);
+
+  bool MakeConnection(OpalCall & call,
+                      const PString & party,
+                      void * userData = NULL,
+                      unsigned int options = 0,
+                      OpalConnection::StringOptions *stringOptions = NULL);
+
+
   /* DESCRIPTION  :  Called when there is an incoming SIP connection.
    * BEHAVIOR     :  Checks if the connection must be rejected or forwarded
    * 		     and call the manager function of the same name
@@ -158,10 +179,10 @@
    * PRE          :  /
    */
   void OnMWIReceived (const PString & to,
-		      SIPSubscribe::MWIType type,
-		      const PString & msgs);
+                      SIPSubscribe::MWIType type,
+                      const PString & msgs);
+
 
-  
   /* DESCRIPTION  :  Called when presence information has been received.
    * BEHAVIOR     :  Updates the roster.
    * PRE          :  /
@@ -170,26 +191,26 @@
                                        const PString & basic,
                                        const PString & note);
 
-  
+
   /* DESCRIPTION  :  Called when a message has been received.
    * BEHAVIOR     :  Checks if we already received the message and call
    * 		     OnMessageReceived.
    * PRE          :  /
    */
   virtual void OnReceivedMESSAGE (OpalTransport & transport,
-				  SIP_PDU & pdu);
+                                  SIP_PDU & pdu);
+
 
-  
   /* DESCRIPTION  :  Called when sending a message fails. 
    * BEHAVIOR     :  /
    * PRE          :  /
    */
   void OnMessageFailed (const SIPURL & messageUrl,
-			SIP_PDU::StatusCodes reason);
+                        SIP_PDU::StatusCodes reason);
 
   void Message (const PString & to,
                 const PString & body);
-      
+
 
   /* DESCRIPTION  :  / 
    * BEHAVIOR     :  Returns the account to use for outgoing PDU's.
@@ -205,7 +226,7 @@
    */
   void OnEstablished (OpalConnection &);
 
-  
+
   /* DESCRIPTION  :  This callback is called when a connection to a remote
    *                 endpoint is cleared.
    * BEHAVIOR     :  Stops the timers.
@@ -214,27 +235,23 @@
   void OnReleased (OpalConnection &);
 
 
- private:
-  
-  /* DESCRIPTION  :  Notifier called when an incoming call
-   *                 has not been answered in the required time.
-   * BEHAVIOR     :  Reject the call, or forward if forward on no answer is
-   *                 enabled in the config database.
-   * PRE          :  /
-   */
-  PDECLARE_NOTIFIER(PTimer, GMSIPEndpoint, OnNoAnswerTimeout);
+private:
+  void on_dial (std::string uri);
+
+  void on_message (std::string name,
+                   std::string uri);
 
-  PTimer NoAnswerTimer;
 
   GMManager & endpoint;
 
   PMutex msgDataMutex;
   msgDict msgData;
 
-  std::list<std::string> uris;    // List of subscribed uris
+  std::list<std::string> subscribed_uris;    // List of subscribed uris
   std::list<std::string> domains; // List of registered domains
   std::list<std::string> aors;     // List of registered aor
   Ekiga::ServiceCore & core;
+  Ekiga::Runtime & runtime;
 
   std::string uri_prefix;
   std::string forward_uri;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]