[asterisk-scf-commits] asterisk-scf/integration/sip.git branch "master" updated.

Commits to the Asterisk SCF project code repositories asterisk-scf-commits at lists.digium.com
Mon Aug 23 11:13:27 CDT 2010


branch "master" has been updated
       via  bbcd0748bdf2595e6da8fb7eb1c3597061a04790 (commit)
      from  85db09a3fac15c227cddf8e04807542a73baea41 (commit)

Summary of changes:
 src/PJSipSessionModule.cpp |   86 ++++++++++++++++++++++++++++++++++++++++++++
 src/PJSipSessionModule.h   |   16 ++++++++
 2 files changed, 102 insertions(+), 0 deletions(-)
 create mode 100644 src/PJSipSessionModule.cpp
 create mode 100644 src/PJSipSessionModule.h


- Log -----------------------------------------------------------------
commit bbcd0748bdf2595e6da8fb7eb1c3597061a04790
Author: Mark Michelson <mmichelson at digium.com>
Date:   Mon Aug 23 11:09:43 2010 -0500

    Add PJSipSessionModule files.
    
    In the interest of moving forward, I'm making the PJSip session
    module in the most basic way, in other words by pretty much manipulating
    the pjsip_module directly. Since there will be other pjsip_modules that
    will be created in due time for other purposes and that will have
    very similar setups, there will likely be a base class created in
    the near future.
    
    For now, we're only dealing with the one PJSIP module, so I'm just
    creating it as a concrete class.

diff --git a/src/PJSipSessionModule.cpp b/src/PJSipSessionModule.cpp
new file mode 100644
index 0000000..90b207e
--- /dev/null
+++ b/src/PJSipSessionModule.cpp
@@ -0,0 +1,86 @@
+#include "PJSipModule.h"
+
+namespace Hydra
+{
+
+namespace SipChannelService
+{
+
+static pj_status_t sessionLoad(pjsip_endpoint *endpt)
+{
+	//stub
+	return PJ_SUCCESS;
+}
+
+static pj_status_t sessionStart()
+{
+	//stub
+	return PJ_SUCCESS;
+}
+
+static pj_status_t sessionStop()
+{
+	//stub
+	return PJ_SUCCESS;
+}
+
+static pj_status_t sessionUnload()
+{
+	//stub
+	return PJ_SUCCESS;
+}
+
+static pj_bool_t sessionOnReceiveRequest(pjsip_rx_data *rdata)
+{
+	//stub
+	return PJ_TRUE;
+}
+
+static pj_bool_t sessionOnReceiveResponse(pjsip_rx_data *rdata)
+{
+	//stub
+	return PJ_TRUE;
+}
+
+static pj_status_t sessionOnTransmitRequest(pjsip_tx_data *data)
+{
+	//stub
+	return PJ_SUCCESS;
+}
+
+static pj_status_t sessionOnTrasmitResponse(pjsip_tx_data *data)
+{
+	//stub
+	return PJ_SUCCESS;
+}
+
+static pj_status_t sessionOnTransactionStateChange(pjsip_transaction *tsx, pjsip_event *event)
+{
+	//stub
+	return PJ_SUCCESS;
+}
+
+PJSipModule::PJSipModule()
+{
+	mModule.name = "Session Module";
+	// XXX I'm a bit hazy on whether this should be dialog
+	// usage or application priority.
+	mModule.priority = PJSIP_MOD_PRIORITY_DIALOG_USAGE;
+	mModule.load = sessionLoad;
+	mModule.start = sessionStart;
+	mModule.stop = sessionStop;
+	mModule.unload = sessionUnload;
+	mModule.on_rx_request = sessionOnReceiveRequest;
+	mModule.on_rx_response = sessionOnReceiveResponse;
+	mModule.on_tx_request = sessionOnTransmitRequest;
+	mModule.on_tx_response = sessionOnTramsmitResponse;
+	mModule.on_tx_response = sessionOnTramsmitResponse;
+	mModule.on_tsx_state = sessionOnTransactionStateChange;
+	
+	Boost::shared_ptr<PJSipManager> manager = PJSipManager::getInstance();
+	pjsip_endpoint *endpt = manager.getEndpoint();
+	pjsip_endpt_register_module(endpt, &mModule);
+}
+
+}; //end namespace SipChannelService
+}; //end namespace Hydra
diff --git a/src/PJSipSessionModule.h b/src/PJSipSessionModule.h
new file mode 100644
index 0000000..b497837
--- /dev/null
+++ b/src/PJSipSessionModule.h
@@ -0,0 +1,16 @@
+namespace Hydra
+{
+
+namespace SipChannelService
+{
+
+class PJSipSessionModule
+{
+public:
+	PJSipSessionModule();
+private:
+	pjsip_module mModule;
+};
+
+}; //end namespace SipChannelService
+}; //end namespace Hydra

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


-- 
asterisk-scf/integration/sip.git



More information about the asterisk-scf-commits mailing list