[asterisk-scf-commits] asterisk-scf/release/sip.git branch "ami" updated.

Commits to the Asterisk SCF project code repositories asterisk-scf-commits at lists.digium.com
Mon Dec 20 23:21:16 UTC 2010


branch "ami" has been updated
       via  0095b3345f23bf536ea6bf4d2d723416c756dff3 (commit)
       via  f0246dd250fa953edce9645238637afefe22a1bc (commit)
       via  88d4397327816c943d91b233d52366215277ca9e (commit)
       via  5d0fdae7f906f499dcc729a4a21f28bf9f51c06c (commit)
       via  33ada269b15d47a1f4cb54b88175be1741074a89 (commit)
       via  a8911b4af0c2ffb706f78848765c82226af87120 (commit)
       via  85469f206455ec5f19481e6fc25b9600614b4a6c (commit)
       via  99d7471b6dd6acdbe5260ebe9f9d03fa0577b162 (commit)
      from  8ee7a5420a736690e8614aad55c474ca0c2b4679 (commit)

Summary of changes:
 src/CMakeLists.txt                     |    6 +-
 src/PJSipManager.cpp                   |    4 +-
 src/PJSipManager.h                     |    6 +-
 src/PJSipSessionModule.cpp             |   72 +++++++++++++++++++++++++++++---
 src/PJSipSessionModule.h               |   10 ++--
 src/PJSipSessionModuleConstruction.cpp |    4 +-
 src/SipSessionManagerApp.cpp           |   16 ++++----
 src/SipStateReplicatorListener.cpp     |    2 +-
 8 files changed, 90 insertions(+), 30 deletions(-)


- Log -----------------------------------------------------------------
commit 0095b3345f23bf536ea6bf4d2d723416c756dff3
Author: Mark Michelson <mmichelson at digium.com>
Date:   Mon Dec 20 17:27:12 2010 -0600

    Make SessionListener invocations use typesafe AMI.

diff --git a/src/PJSipSessionModule.cpp b/src/PJSipSessionModule.cpp
index 8018833..d259974 100644
--- a/src/PJSipSessionModule.cpp
+++ b/src/PJSipSessionModule.cpp
@@ -150,6 +150,54 @@ private:
 
 typedef IceUtil::Handle<ConnectBridgedSessionsWithDestinationCallback> ConnectBridgedSessionsWithDestinationCallbackPtr;
 
+class StoppedCallback : public IceUtil::Shared
+{
+public:
+    StoppedCallback() {}
+    void failure(const Ice::Exception &ex)
+    {
+        lg(Error) << "Ice exception when attempting to relate stopped state: " << ex.what() << std::endl;
+    }
+};
+
+typedef IceUtil::Handle<StoppedCallback> StoppedCallbackPtr;
+
+class RingingCallback : public IceUtil::Shared
+{
+public:
+    RingingCallback() {}
+    void failure(const Ice::Exception &ex)
+    {
+        lg(Error) << "Ice exception when attempting to relate ringing state: " << ex.what() << std::endl;
+    }
+};
+
+typedef IceUtil::Handle<RingingCallback> RingingCallbackPtr;
+
+class ProgressingCallback : public IceUtil::Shared
+{
+public:
+    ProgressingCallback() {}
+    void failure(const Ice::Exception &ex)
+    {
+        lg(Error) << "Ice exception when attempting to relate progressing state: " << ex.what() << std::endl;
+    }
+};
+
+typedef IceUtil::Handle<ProgressingCallback> ProgressingCallbackPtr;
+
+class ConnectedCallback : public IceUtil::Shared
+{
+public:
+    ConnectedCallback() {}
+    void failure(const Ice::Exception &ex)
+    {
+        lg(Error) << "Ice exception when attempting to relate connected state: " << ex.what() << std::endl;
+    }
+};
+
+typedef IceUtil::Handle<ConnectedCallback> ConnectedCallbackPtr;
+
 PJSipSessionModInfo::PJSipSessionModInfo(pjsip_inv_session *inv_session,
     SipSessionPtr session)
     :
@@ -792,7 +840,10 @@ void PJSipSessionModule::handleInviteResponse(pjsip_inv_session *inv,
         {
             try
             {
-                (*listener)->ringing(session->getSessionProxy());
+                RingingCallbackPtr cb(new RingingCallback());
+                Callback_SessionListener_ringingPtr ringingCB =
+                    newCallback_SessionListener_ringing(cb, &RingingCallback::failure);
+                (*listener)->begin_ringing(session->getSessionProxy(), ringingCB);
             }
             catch (const Ice::Exception &ex)
             {
@@ -812,7 +863,10 @@ void PJSipSessionModule::handleInviteResponse(pjsip_inv_session *inv,
         {
             try
             {
-                (*listener)->progressing(session->getSessionProxy(), response);
+                ProgressingCallbackPtr cb(new ProgressingCallback());
+                Callback_SessionListener_progressingPtr progressingCB =
+                    newCallback_SessionListener_progressing(cb, &ProgressingCallback::failure);
+                (*listener)->begin_progressing(session->getSessionProxy(), response, progressingCB);
             }
             catch (const Ice::Exception &ex)
             {
@@ -832,7 +886,10 @@ void PJSipSessionModule::handleInviteResponse(pjsip_inv_session *inv,
             {
                 try
                 {
-                    (*listener)->connected(session->getSessionProxy());
+                    ConnectedCallbackPtr cb(new ConnectedCallback());
+                    Callback_SessionListener_connectedPtr connectedCB =
+                        newCallback_SessionListener_connected(cb, &ConnectedCallback::failure);
+                    (*listener)->begin_connected(session->getSessionProxy(), connectedCB);
                 }
                 catch (const Ice::Exception &ex)
                 {
@@ -882,7 +939,10 @@ void PJSipSessionModule::invOnStateChanged(pjsip_inv_session *inv, pjsip_event *
         {
             try
             {
-                (*listener)->stopped(session->getSessionProxy(), response);
+                StoppedCallbackPtr cb(new StoppedCallback());
+                Callback_SessionListener_stoppedPtr stoppedCB =
+                    newCallback_SessionListener_stopped(cb, &StoppedCallback::failure);
+                (*listener)->begin_stopped(session->getSessionProxy(), response, stoppedCB);
             }
             catch (const Ice::Exception &ex)
             {

commit f0246dd250fa953edce9645238637afefe22a1bc
Merge: 8ee7a54 88d4397
Author: Mark Michelson <mmichelson at digium.com>
Date:   Mon Dec 20 16:51:55 2010 -0600

    Merge branches 'master' and 'ami' into ami


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


-- 
asterisk-scf/release/sip.git



More information about the asterisk-scf-commits mailing list