[asterisk-scf-commits] asterisk-scf/release/sip.git branch "master" updated.
Commits to the Asterisk SCF project code repositories
asterisk-scf-commits at lists.digium.com
Thu Apr 21 11:45:26 CDT 2011
branch "master" has been updated
via 0791f44ddb97bced3ded5da19580ba16966e9f63 (commit)
via 413bb6369fb40c99a952305fa924dc087da7792c (commit)
via 626ae7f220d8b0ad44820a5110eeceb61248d032 (commit)
via ab478a5684fed6d71a1169104ff9067a240b1e81 (commit)
via dd6f1be516148b8f328adf3f174c43fe949a1b61 (commit)
from 2d535b3c8813521ba060c544c80baabc2b452f76 (commit)
Summary of changes:
src/PJSipSessionModule.cpp | 24 +++++----
src/SipSession.cpp | 125 +++++++++++++++++---------------------------
src/SipSession.h | 1 +
3 files changed, 63 insertions(+), 87 deletions(-)
- Log -----------------------------------------------------------------
commit 0791f44ddb97bced3ded5da19580ba16966e9f63
Merge: 2d535b3 413bb63
Author: Joshua Colp <jcolp at digium.com>
Date: Thu Apr 21 12:14:12 2011 -0300
Merge branch 'indicate'
commit 413bb6369fb40c99a952305fa924dc087da7792c
Author: Joshua Colp <jcolp at digium.com>
Date: Thu Apr 7 11:37:50 2011 -0300
Remove old code.
diff --git a/src/SipSession.cpp b/src/SipSession.cpp
index 0354394..6fb6409 100644
--- a/src/SipSession.cpp
+++ b/src/SipSession.cpp
@@ -293,29 +293,6 @@ void SipSession::indicate(const AsteriskSCF::SessionCommunications::V1::Indicati
}
/**
- * An implementation of the connect method as defined in SessionCommunications.ice which sends
- * a 200 OK with SDP to the SIP endpoint.
- */
-void SipSession::connect(const Ice::Current&)
-{
- pjmedia_sdp_session *sdp = createSDPOffer();
- pjsip_tx_data *packet;
- if ((pjsip_inv_answer(mImplPriv->mInviteSession, 200, NULL, sdp, &packet)) == PJ_SUCCESS)
- {
- pjsip_inv_send_msg(mImplPriv->mInviteSession, packet);
- }
-}
-
-/**
- * An implementation of the flash method as defined in SessionCommunications.ice which sends
- * nothing, presently, to the SIP endpoint.
- */
-void SipSession::flash(const Ice::Current&)
-{
- // This is usually transported using INFO or RFC2833, so for now just pretend it does not exist
-}
-
-/**
* An implementation of the getEndpoint method as defined in SessionCommunications.ice
*/
AsteriskSCF::SessionCommunications::V1::SessionEndpointPrx SipSession::getEndpoint(const Ice::Current&)
@@ -427,37 +404,6 @@ void SipSession::removeBridge(const AsteriskSCF::SessionCommunications::V1::Sess
}
/**
- * An implementation of the hold method as defined in SessionCommunications.ice which sends
- * a reinvite with sendonly attribute and no connection info to the SIP endpoint.
- */
-void SipSession::hold(const Ice::Current&)
-{
- // TODO: Update SDP with sendonly attribute and no IP
-
- // TODO: This is actually passing the hold through, we will need to support local generation
-
- pjsip_tx_data *packet;
- if ((pjsip_inv_reinvite(mImplPriv->mInviteSession, NULL, NULL, &packet)) == PJ_SUCCESS)
- {
- pjsip_inv_send_msg(mImplPriv->mInviteSession, packet);
- }
-}
-
-/**
- * An implementation of the progress method as defined in SessionCommunications.ice which sends
- * a 183 Session Progress with SDP to the SIP endpoint.
- */
-void SipSession::progress(const AsteriskSCF::SessionCommunications::V1::ResponseCodePtr&, const Ice::Current&)
-{
- pjmedia_sdp_session *sdp = createSDPOffer();
- pjsip_tx_data *packet;
- if ((pjsip_inv_answer(mImplPriv->mInviteSession, 183, NULL, sdp, &packet)) == PJ_SUCCESS)
- {
- pjsip_inv_send_msg(mImplPriv->mInviteSession, packet);
- }
-}
-
-/**
* An implementation of the removeListener method as defined in SessionCommunications.ice
*/
void SipSession::removeListener(const AsteriskSCF::SessionCommunications::V1::SessionListenerPrx& listener, const Ice::Current&)
@@ -477,20 +423,6 @@ void SipSession::removeListener(const AsteriskSCF::SessionCommunications::V1::Se
}
/**
- * An implementation of the ring method as defined in SessionCommunications.ice which sends
- * a 180 Ringing without SDP to the SIP endpoint.
- */
-void SipSession::ring(const Ice::Current&)
-{
- pjsip_tx_data *packet;
-
- if ((pjsip_inv_answer(mImplPriv->mInviteSession, 180, NULL, NULL, &packet)) == PJ_SUCCESS)
- {
- pjsip_inv_send_msg(mImplPriv->mInviteSession, packet);
- }
-}
-
-/**
* An implementation of the start method as defined in SessionCommunications.ice which sends
* an INVITE with SDP to the SIP endpoint.
*/
@@ -586,23 +518,6 @@ void SipSession::stop(const AsteriskSCF::SessionCommunications::V1::ResponseCode
}
/**
- * An implementation of the unhold method as defined in SessionCommunications.ice which sends
- * a reinvite with sendrecv attribute and connection information to the SIP endpoint.
- */
-void SipSession::unhold(const Ice::Current&)
-{
- // TODO: Update SDP with sendrecv and IP
-
- // TODO: This is actually passing the unhold through, we will need to support local generation
-
- pjsip_tx_data *packet;
- if ((pjsip_inv_reinvite(mImplPriv->mInviteSession, NULL, NULL, &packet)) == PJ_SUCCESS)
- {
- pjsip_inv_send_msg(mImplPriv->mInviteSession, packet);
- }
-}
-
-/**
* Internal function called to destroy an endpoint. This is controlled by signaling.
*/
void SipSession::destroy()
commit 626ae7f220d8b0ad44820a5110eeceb61248d032
Author: Joshua Colp <jcolp at digium.com>
Date: Thu Apr 7 11:20:21 2011 -0300
Finish migration to new indicate support.
diff --git a/src/PJSipSessionModule.cpp b/src/PJSipSessionModule.cpp
index b04d252..3b818f1 100644
--- a/src/PJSipSessionModule.cpp
+++ b/src/PJSipSessionModule.cpp
@@ -918,6 +918,8 @@ void PJSipSessionModule::invOnStateChanged(pjsip_inv_session *inv, pjsip_event *
}
std::vector<AsteriskSCF::SessionCommunications::V1::SessionListenerPrx> listeners = session->getListeners();
lg(Debug) << "Relating stopped state to " << listeners.size() << " listeners";
+ AsteriskSCF::SessionCommunications::V1::StoppedIndicationPtr stopped(new AsteriskSCF::SessionCommunications::V1::StoppedIndication());
+ stopped->response = response;
for (std::vector<AsteriskSCF::SessionCommunications::V1::SessionListenerPrx>::iterator listener =
listeners.begin();
listener != listeners.end();
@@ -925,7 +927,7 @@ void PJSipSessionModule::invOnStateChanged(pjsip_inv_session *inv, pjsip_event *
{
try
{
- (*listener)->stopped(session->getSessionProxy(), response);
+ (*listener)->indicated(session->getSessionProxy(), stopped);
}
catch (const Ice::Exception &ex)
{
commit ab478a5684fed6d71a1169104ff9067a240b1e81
Author: Joshua Colp <jcolp at digium.com>
Date: Thu Apr 7 10:37:38 2011 -0300
Use new method to send indications.
diff --git a/src/PJSipSessionModule.cpp b/src/PJSipSessionModule.cpp
index 58a30c5..b04d252 100644
--- a/src/PJSipSessionModule.cpp
+++ b/src/PJSipSessionModule.cpp
@@ -823,9 +823,9 @@ void PJSipSessionModule::handleInviteResponse(pjsip_inv_session *inv,
try
{
ListenerCallbackPtr cb(new ListenerCallback(RingingCallbackName));
- Callback_SessionListener_ringingPtr ringingCB =
- newCallback_SessionListener_ringing(cb, &ListenerCallback::failure);
- (*listener)->begin_ringing(session->getSessionProxy(), ringingCB);
+ Callback_SessionListener_indicatedPtr ringingCB =
+ newCallback_SessionListener_indicated(cb, &ListenerCallback::failure);
+ (*listener)->begin_indicated(session->getSessionProxy(), new RingingIndication(), ringingCB);
}
catch (const Ice::Exception &ex)
{
@@ -846,9 +846,11 @@ void PJSipSessionModule::handleInviteResponse(pjsip_inv_session *inv,
try
{
ListenerCallbackPtr cb(new ListenerCallback(ProgressingCallbackName));
- Callback_SessionListener_progressingPtr progressingCB =
- newCallback_SessionListener_progressing(cb, &ListenerCallback::failure);
- (*listener)->begin_progressing(session->getSessionProxy(), response, progressingCB);
+ Callback_SessionListener_indicatedPtr progressingCB =
+ newCallback_SessionListener_indicated(cb, &ListenerCallback::failure);
+ ProgressingIndicationPtr progressing(new ProgressingIndication());
+ progressing->response = response;
+ (*listener)->begin_indicated(session->getSessionProxy(), progressing, progressingCB);
}
catch (const Ice::Exception &ex)
{
@@ -869,9 +871,9 @@ void PJSipSessionModule::handleInviteResponse(pjsip_inv_session *inv,
try
{
ListenerCallbackPtr cb(new ListenerCallback(ConnectedCallbackName));
- Callback_SessionListener_connectedPtr connectedCB =
- newCallback_SessionListener_connected(cb, &ListenerCallback::failure);
- (*listener)->begin_connected(session->getSessionProxy(), connectedCB);
+ Callback_SessionListener_indicatedPtr connectedCB =
+ newCallback_SessionListener_indicated(cb, &ListenerCallback::failure);
+ (*listener)->begin_indicated(session->getSessionProxy(), new ConnectedIndication(), connectedCB);
}
catch (const Ice::Exception &ex)
{
commit dd6f1be516148b8f328adf3f174c43fe949a1b61
Author: Joshua Colp <jcolp at digium.com>
Date: Thu Apr 7 10:18:30 2011 -0300
Add new indicate support.
diff --git a/src/SipSession.cpp b/src/SipSession.cpp
index cd003e3..0354394 100644
--- a/src/SipSession.cpp
+++ b/src/SipSession.cpp
@@ -237,6 +237,62 @@ AsteriskSCF::SessionCommunications::V1::SessionInfoPtr SipSession::addListener(
}
/**
+ * An implementation of the indicate method as defined in SessionCommunications.ice
+ */
+void SipSession::indicate(const AsteriskSCF::SessionCommunications::V1::IndicationPtr& indication, const Ice::Current&)
+{
+ AsteriskSCF::SessionCommunications::V1::ConnectIndicationPtr connect;
+ AsteriskSCF::SessionCommunications::V1::FlashIndicationPtr flash;
+ AsteriskSCF::SessionCommunications::V1::HoldIndicationPtr hold;
+ AsteriskSCF::SessionCommunications::V1::ProgressIndicationPtr progress;
+ AsteriskSCF::SessionCommunications::V1::RingIndicationPtr ring;
+ AsteriskSCF::SessionCommunications::V1::UnholdIndicationPtr unhold;
+ pjsip_tx_data *packet = NULL;
+ pj_status_t status = -1;
+
+ if ((connect = AsteriskSCF::SessionCommunications::V1::ConnectIndicationPtr::dynamicCast(indication)))
+ {
+ pjmedia_sdp_session *sdp = createSDPOffer();
+ status = pjsip_inv_answer(mImplPriv->mInviteSession, 200, NULL, sdp, &packet);
+ }
+ else if ((flash = AsteriskSCF::SessionCommunications::V1::FlashIndicationPtr::dynamicCast(indication)))
+ {
+ // This is usually transported using INFO or RFC2833, so for now just pretend it does not exist
+ }
+ else if ((hold = AsteriskSCF::SessionCommunications::V1::HoldIndicationPtr::dynamicCast(indication)))
+ {
+ // TODO: Update SDP with sendonly attribute and no IP
+
+ // TODO: This is actually passing the hold through, we will need to support local generation
+
+ status = pjsip_inv_reinvite(mImplPriv->mInviteSession, NULL, NULL, &packet);
+ }
+ else if ((progress = AsteriskSCF::SessionCommunications::V1::ProgressIndicationPtr::dynamicCast(indication)))
+ {
+ pjmedia_sdp_session *sdp = createSDPOffer();
+ status = pjsip_inv_answer(mImplPriv->mInviteSession, 183, NULL, sdp, &packet);
+ }
+ else if ((ring = AsteriskSCF::SessionCommunications::V1::RingIndicationPtr::dynamicCast(indication)))
+ {
+ status = pjsip_inv_answer(mImplPriv->mInviteSession, 180, NULL, NULL, &packet);
+ }
+ else if ((unhold = AsteriskSCF::SessionCommunications::V1::UnholdIndicationPtr::dynamicCast(indication)))
+ {
+ // TODO: Update SDP with sendrecv and IP
+
+ // TODO: This is actually passing the unhold through, we will need to support local generation
+
+ status = pjsip_inv_reinvite(mImplPriv->mInviteSession, NULL, NULL, &packet);
+ }
+
+ // If the indication produced a packet send it out
+ if (status == PJ_SUCCESS)
+ {
+ pjsip_inv_send_msg(mImplPriv->mInviteSession, packet);
+ }
+}
+
+/**
* An implementation of the connect method as defined in SessionCommunications.ice which sends
* a 200 OK with SDP to the SIP endpoint.
*/
diff --git a/src/SipSession.h b/src/SipSession.h
index 9466267..3596260 100644
--- a/src/SipSession.h
+++ b/src/SipSession.h
@@ -77,6 +77,7 @@ public:
*/
AsteriskSCF::SessionCommunications::V1::SessionInfoPtr
addListener(const AsteriskSCF::SessionCommunications::V1::SessionListenerPrx&, const Ice::Current&);
+ void indicate(const AsteriskSCF::SessionCommunications::V1::IndicationPtr&, const Ice::Current&);
void connect(const Ice::Current&);
void flash(const Ice::Current&);
AsteriskSCF::SessionCommunications::V1::SessionEndpointPrx getEndpoint(const Ice::Current&);
-----------------------------------------------------------------------
--
asterisk-scf/release/sip.git
More information about the asterisk-scf-commits
mailing list