[asterisk-scf-commits] asterisk-scf/integration/sip.git branch "party-id" updated.
Commits to the Asterisk SCF project code repositories
asterisk-scf-commits at lists.digium.com
Tue Nov 22 15:12:32 CST 2011
branch "party-id" has been updated
via ddf99b1e738d692d8b82b77006e5890180fc4d09 (commit)
via 60758ac259a1f15fcbb8d8293085215a808d0c51 (commit)
from cb74d1811198e4b47d128852a887bd2aef79dc67 (commit)
Summary of changes:
src/SipSession.cpp | 75 ++++++++++++++++++++++++++++++++++++--------------
src/SipSession.h | 7 +++++
src/SipTransfer.cpp | 3 +-
3 files changed, 63 insertions(+), 22 deletions(-)
- Log -----------------------------------------------------------------
commit ddf99b1e738d692d8b82b77006e5890180fc4d09
Author: Mark Michelson <mmichelson at digium.com>
Date: Wed Nov 9 10:35:01 2011 -0600
I was sending incorrect information to the routing service. Oops.
diff --git a/src/SipSession.cpp b/src/SipSession.cpp
index dfc75e4..16bc912 100755
--- a/src/SipSession.cpp
+++ b/src/SipSession.cpp
@@ -946,6 +946,7 @@ void SipSession::setSelfAsCaller()
void SipSession::setSessionOwnerId(const SessionOwnerIdPtr& owner)
{
+ lg(Debug) << "!!!!!! Setting owner id on session " << mImplPriv->mEndpoint->getName();
mImplPriv->mSessionCookies[owner->ice_id()] = owner;
mImplPriv->cookiesUpdated();
}
@@ -2377,20 +2378,23 @@ void SipSession::getSessionOwnerId_async(const AMD_Session_getSessionOwnerIdPtr&
}
/**
- * Gets the SessionId party identification record for this Session.
+ * Gets the ConnectedLine party identification record for this Session.
* This is an internal method, intended to be called from within a queued operation.
*/
-SessionOwnerIdPtr SipSession::getSessionOwnerId()
+ConnectedLinePtr SipSession::getConnectedLine()
{
- SessionOwnerIdPtr id = 0;
- SessionOwnerIdPtr toFind(new SessionOwnerId());
+
+ lg(Debug) << "!!!!!!! Getting ConnectedLine for session " << mImplPriv->mEndpoint->getName();
+
+ ConnectedLinePtr id = 0;
AsteriskSCF::SessionCommunications::V1::SessionCookies cookies;
- cookies.push_back(toFind);
+ cookies.push_back(new ConnectedLine());
AsteriskSCF::SessionCommunications::V1::SessionCookies results = getCookies(cookies);
if (!results.empty())
{
- id = SessionOwnerIdPtr::dynamicCast(results.front());
+ lg(Debug) << "!!!!!!!!! Found ConnectedLine";
+ id = ConnectedLinePtr::dynamicCast(results.front());
}
return id;
diff --git a/src/SipSession.h b/src/SipSession.h
index bc9ebb6..9dfe0a3 100644
--- a/src/SipSession.h
+++ b/src/SipSession.h
@@ -230,10 +230,10 @@ public:
void getRedirections_async(const AsteriskSCF::SessionCommunications::V1::AMD_Session_getRedirectionsPtr& cb, const Ice::Current& );
/**
- * Gets the SessionOwnerId for the session.
+ * Gets the ConnectedLine for the session.
* This is an internal method and should only be called from queued operations
*/
- AsteriskSCF::SessionCommunications::PartyIdentification::V1::SessionOwnerIdPtr getSessionOwnerId();
+ AsteriskSCF::SessionCommunications::PartyIdentification::V1::ConnectedLinePtr getConnectedLine();
void getStreams_async(
const AsteriskSCF::SessionCommunications::V1::AMD_Session_getStreamsPtr&,
diff --git a/src/SipTransfer.cpp b/src/SipTransfer.cpp
index 9c9b3fc..ee2bcaf 100644
--- a/src/SipTransfer.cpp
+++ b/src/SipTransfer.cpp
@@ -480,12 +480,7 @@ SuspendableWorkResult HandleReferOperation::initial(const SuspendableWorkListene
lg(Debug) << "handleRefer() calling router connectBridgedSessions(). ";
- ConnectedLineSeq connectedLines;
- SessionOwnerIdPtr sessionOwnerId = other_session->getSessionOwnerId();
- ConnectedLinePtr connectedLine(new ConnectedLine(sessionOwnerId->ids));
- connectedLines.push_back(connectedLine);
-
- mSessionRouter->begin_connectBridgedSessions(operationId, mSession->getSessionProxy(), other_session->getSessionProxy(), false, connectedLines, d);
+ mSessionRouter->begin_connectBridgedSessions(operationId, mSession->getSessionProxy(), other_session->getSessionProxy(), false, other_session->getConnectedLine(), d);
pjsip_dlg_dec_lock(other_dlg);
return Complete;
}
commit 60758ac259a1f15fcbb8d8293085215a808d0c51
Author: Mark Michelson <mmichelson at digium.com>
Date: Tue Nov 8 13:45:59 2011 -0600
Provide connected line information to the routing service when doing an attended transfer.
diff --git a/src/SipSession.cpp b/src/SipSession.cpp
index edd975a..dfc75e4 100755
--- a/src/SipSession.cpp
+++ b/src/SipSession.cpp
@@ -2376,6 +2376,26 @@ void SipSession::getSessionOwnerId_async(const AMD_Session_getSessionOwnerIdPtr&
enqueueSessionWork(new GetCookieAmdOperation<AMD_Session_getSessionOwnerIdPtr, SessionOwnerId, SessionOwnerIdPtr>(cb, mImplPriv));
}
+/**
+ * Gets the SessionId party identification record for this Session.
+ * This is an internal method, intended to be called from within a queued operation.
+ */
+SessionOwnerIdPtr SipSession::getSessionOwnerId()
+{
+ SessionOwnerIdPtr id = 0;
+ SessionOwnerIdPtr toFind(new SessionOwnerId());
+ AsteriskSCF::SessionCommunications::V1::SessionCookies cookies;
+ cookies.push_back(toFind);
+ AsteriskSCF::SessionCommunications::V1::SessionCookies results = getCookies(cookies);
+
+ if (!results.empty())
+ {
+ id = SessionOwnerIdPtr::dynamicCast(results.front());
+ }
+
+ return id;
+}
+
/**
* Gets the ConnectedLine party identification record for this Session.
*/
@@ -2463,8 +2483,8 @@ public:
*/
GetCookiesOperation(const AsteriskSCF::SessionCommunications::V1::AMD_Session_getCookiesPtr& cb,
const AsteriskSCF::SessionCommunications::V1::SessionCookies& cookieTypes,
- const SipSessionPrivPtr& sessionPriv)
- : mCb(cb), mCookieTypes(cookieTypes), mImplPriv(sessionPriv)
+ const SipSessionPtr& session)
+ : mCb(cb), mCookieTypes(cookieTypes), mSession(session)
{
}
@@ -2472,23 +2492,7 @@ public:
{
lg(Debug) << "Executing a GetCookies operation";
- AsteriskSCF::SessionCommunications::V1::SessionCookies results;
-
- for (AsteriskSCF::SessionCommunications::V1::SessionCookies::const_iterator i = mCookieTypes.begin();
- i != mCookieTypes.end(); ++i)
- {
- AsteriskSCF::SessionCommunications::V1::SessionCookieDict::const_iterator foundItem =
- mImplPriv->mSessionCookies.find((*i)->ice_id());
-
- if (foundItem == mImplPriv->mSessionCookies.end())
- {
- continue;
- }
-
- results.push_back(foundItem->second);
- }
-
- mCb->ice_response(results);
+ mCb->ice_response(mSession->getCookies(mCookieTypes));
return Complete;
}
@@ -2496,7 +2500,7 @@ public:
private:
AsteriskSCF::SessionCommunications::V1::AMD_Session_getCookiesPtr mCb;
AsteriskSCF::SessionCommunications::V1::SessionCookies mCookieTypes;
- SipSessionPrivPtr mImplPriv;
+ SipSessionPtr mSession;
};
/**
@@ -2508,7 +2512,32 @@ void SipSession::getCookies_async(
const AsteriskSCF::SessionCommunications::V1::SessionCookies& cookieTypes,
const Ice::Current&)
{
- enqueueSessionWork(new GetCookiesOperation(cb, cookieTypes, mImplPriv));
+ enqueueSessionWork(new GetCookiesOperation(cb, cookieTypes, this));
+}
+
+/**
+ * Get specific cookie types.
+ * This is an internal function and should be called from queued operations
+ */
+AsteriskSCF::SessionCommunications::V1::SessionCookies SipSession::getCookies(const AsteriskSCF::SessionCommunications::V1::SessionCookies& cookieTypes)
+{
+ AsteriskSCF::SessionCommunications::V1::SessionCookies results;
+
+ for (AsteriskSCF::SessionCommunications::V1::SessionCookies::const_iterator i = cookieTypes.begin();
+ i != cookieTypes.end(); ++i)
+ {
+ AsteriskSCF::SessionCommunications::V1::SessionCookieDict::const_iterator foundItem =
+ mImplPriv->mSessionCookies.find((*i)->ice_id());
+
+ if (foundItem == mImplPriv->mSessionCookies.end())
+ {
+ continue;
+ }
+
+ results.push_back(foundItem->second);
+ }
+
+ return results;
}
/**
diff --git a/src/SipSession.h b/src/SipSession.h
index 8568f7a..bc9ebb6 100644
--- a/src/SipSession.h
+++ b/src/SipSession.h
@@ -217,6 +217,7 @@ public:
const ::AsteriskSCF::SessionCommunications::V1::AMD_Session_getCookiesPtr&,
const AsteriskSCF::SessionCommunications::V1::SessionCookies&,
const Ice::Current&);
+ AsteriskSCF::SessionCommunications::V1::SessionCookies getCookies(const AsteriskSCF::SessionCommunications::V1::SessionCookies&);
AsteriskSCF::SessionCommunications::V1::SessionCookies getCookies();
AsteriskSCF::SessionCommunications::V1::SessionCookieDict getAllCookies();
@@ -228,6 +229,12 @@ public:
void getConnectedLine_async(const AsteriskSCF::SessionCommunications::V1::AMD_Session_getConnectedLinePtr& cb, const ::Ice::Current&);
void getRedirections_async(const AsteriskSCF::SessionCommunications::V1::AMD_Session_getRedirectionsPtr& cb, const Ice::Current& );
+ /**
+ * Gets the SessionOwnerId for the session.
+ * This is an internal method and should only be called from queued operations
+ */
+ AsteriskSCF::SessionCommunications::PartyIdentification::V1::SessionOwnerIdPtr getSessionOwnerId();
+
void getStreams_async(
const AsteriskSCF::SessionCommunications::V1::AMD_Session_getStreamsPtr&,
const Ice::Current&);
diff --git a/src/SipTransfer.cpp b/src/SipTransfer.cpp
index 455aef5..9c9b3fc 100644
--- a/src/SipTransfer.cpp
+++ b/src/SipTransfer.cpp
@@ -23,6 +23,7 @@
#include <AsteriskSCF/SessionCookies/SipSessionManager/SipSessionCookiesIf.h>
using namespace AsteriskSCF::System::Logging;
+using namespace AsteriskSCF::SessionCommunications::PartyIdentification::V1;
namespace
{
@@ -479,7 +480,12 @@ SuspendableWorkResult HandleReferOperation::initial(const SuspendableWorkListene
lg(Debug) << "handleRefer() calling router connectBridgedSessions(). ";
- mSessionRouter->begin_connectBridgedSessions(operationId, mSession->getSessionProxy(), other_session->getSessionProxy(), false, d);
+ ConnectedLineSeq connectedLines;
+ SessionOwnerIdPtr sessionOwnerId = other_session->getSessionOwnerId();
+ ConnectedLinePtr connectedLine(new ConnectedLine(sessionOwnerId->ids));
+ connectedLines.push_back(connectedLine);
+
+ mSessionRouter->begin_connectBridgedSessions(operationId, mSession->getSessionProxy(), other_session->getSessionProxy(), false, connectedLines, d);
pjsip_dlg_dec_lock(other_dlg);
return Complete;
}
-----------------------------------------------------------------------
--
asterisk-scf/integration/sip.git
More information about the asterisk-scf-commits
mailing list