[asterisk-scf-commits] asterisk-scf/integration/sip.git branch "indicate" created.
Commits to the Asterisk SCF project code repositories
asterisk-scf-commits at lists.digium.com
Thu Apr 7 08:17:31 CDT 2011
branch "indicate" has been created
at dd6f1be516148b8f328adf3f174c43fe949a1b61 (commit)
- Log -----------------------------------------------------------------
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&);
commit 0024d93bcf841b13eec471b2d3f726cdbe686978
Merge: db6b640 827fc66
Author: Brent Eagles <beagles at digium.com>
Date: Fri Apr 1 13:20:31 2011 -0230
Merge branch 'code-conventions'
commit db6b6404ec286000fcb921edfe080fc6c2cc1c9d
Author: Brent Eagles <beagles at digium.com>
Date: Thu Mar 31 11:08:16 2011 -0230
Add unsliceable keyword to classes deriving from an unsliceable parent.
diff --git a/local-slice/SipStateReplicationIf.ice b/local-slice/SipStateReplicationIf.ice
index 80d9fae..c7d16d9 100644
--- a/local-slice/SipStateReplicationIf.ice
+++ b/local-slice/SipStateReplicationIf.ice
@@ -31,7 +31,7 @@ module V1
const string StateReplicatorComponentCategory = "SipStateReplicatorComponent";
const string StateReplicatorDiscoveryCategory = "SipStateReplicator";
- class SipStateReplicatorParams extends AsteriskSCF::Core::Discovery::V1::ServiceLocatorParams
+ unsliceable class SipStateReplicatorParams extends AsteriskSCF::Core::Discovery::V1::ServiceLocatorParams
{
string mName;
};
-----------------------------------------------------------------------
--
asterisk-scf/integration/sip.git
More information about the asterisk-scf-commits
mailing list