[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
Sun Aug 22 17:21:32 CDT 2010


branch "master" has been updated
       via  266aad7869b404559ddec68ce3cdff9a8d221b1a (commit)
      from  1c6fc6e9212a809ac4321e67edb859ea12772dea (commit)

Summary of changes:
 src/SipEndpoint.cpp |  110 ++++++++++++++++++++++++++++++++++++++++++++++++++-
 src/SipEndpoint.h   |   12 +++---
 2 files changed, 115 insertions(+), 7 deletions(-)


- Log -----------------------------------------------------------------
commit 266aad7869b404559ddec68ce3cdff9a8d221b1a
Author: Mark Michelson <mmichelson at digium.com>
Date:   Sun Aug 22 17:21:15 2010 -0500

    Make some modifications to SipEndpoint.
    
    First, SipEndpoint inherits from SessionEndpoint so that it has
    all the proper SignalCallback and SignalCommand properties.
    
    Next, I started to fill in the SignalCallback and SignalCommand
    functions with comments instructing me on how to handle everything.

diff --git a/src/SipEndpoint.cpp b/src/SipEndpoint.cpp
index f3657a7..339dbcc 100644
--- a/src/SipEndpoint.cpp
+++ b/src/SipEndpoint.cpp
@@ -5,12 +5,120 @@ namespace Hydra
 namespace SipChannelService
 {
 
+class SipSignalCommands : public Hydra::Session::V1::SignalCommands
+{
+	bool call(Core::Endpoint::V1::EndpointId caller, Core::Endpoint::V1::EndpointId destination, SignalCallback callback)
+	{
+		//stub
+		//I'm not sure what this callback is supposed to do. Am
+		//I supposed to make an outgoing call? If so, what am
+		//I supposed to do with the "caller" and "callback"
+		//parameters?
+	}
+	void terminate(Core::Endpoint::V1::EndpointId caller)
+	{
+		//stub
+		//What's the difference between this and
+		//SignalCallback::terminated()?
+	}
+} _sipSignalCommands;
+
+class SipSignalCallback : public Hydra::Session::V1::SignalCallback
+{
+	void ring(Core::Endpoint::V1::EndpointId ep)
+	{
+		//stub
+		//Look up SipSessionEndpoint
+		//Get PJSipManager, and get the pjsip_endpoint
+		//Get INVITE transaction and dialog
+		//	(pjsip_endpt_find_tsx)
+		//	(pjsip_tsx_get_dlg)
+		//Double check current INVITE state to be sure
+		//	it makes sense to send a ringing message
+		//Send 180 response
+		//  (pjsip_dlg_create_response)
+		//  (pjsip_dlg_send_response)
+		//In order to create response I have to have the
+		//rx_data from the incoming INVITE. I suppose I
+		//can save that in the transaction's mod_data?
+		//Actually, I'll probably have already sent a 100
+		//response when I received the INVITE, so I can
+		//just modify the previous transaction's tdata
+		//as shown in PJSIP developer's guide 10.3.1
+	}
+	void connected(Core::Endpoint::V1::EndpointId ep)
+	{
+		//stub
+		//Similar to ring()
+		//Except here, I'll most likely also be
+		//including an SDP answer, or an SDP offer
+		//in some odd situations.
+	}
+	void terminated(Core::Endpoint::V1::EndpointId ep, ResponseCode response)
+	{
+		//stub
+		//There was some confusion about this when Ken and
+		//I were talking recently. Depending on how this
+		//works, I'll either generate a BYE request, or
+		//respond to an BYE request with a 200 OK.
+		//For generating BYE:
+		//Look up SessionEndpoint
+		//Get PJSipManager and get pjsip_endpoint
+		//Get INVITE transaction and dialog
+		//pjsip_dlg_create_request
+		//pjsip_dlg_send_request
+		//pjsip_dlg_dec_session
+	}
+	void busy(Core::Endpoint::V1::EndpointId ep)
+	{
+		//stub
+		//Similar to ring, but send a 486
+	}
+	void congestion(Core::Endpoint::V1::EndpointId ep, ResponseCode response)
+	{
+		//stub
+		//Similar to ring, but send a 500
+	}
+	void hold(Core::Endpoint::V1::EndpointId ep)
+	{
+		//stub
+		//This one's interesting. Like with
+		//terminated(), we'll be sending a request.
+		//However, we'll be sending a reinvite instead
+		//and attaching an SDP with a sendonly attribute.
+		//Now that I'm looking at PJSIP some more, it
+		//may be worthwhile to use the INVITE session
+		//API instead of the base dialog API. It may
+		//be a bit inflexible though.
+	}
+	void unhold(Core::Endpoint::V1::EndpointId ep)
+	{
+		//stub
+		//Similar to hold() but use sendrcv attribute
+		//for reinvite.
+	{
+	void flash(Core::Endpoint::V1::EndpointId ep)
+	{
+		//stub
+		//I...don't know :(
+	}
+	void progress(Core::Endpoint::V1::EndpointId ep, ResponseCode response)
+	{
+		//stub
+		//Similar to connected(), but the response code
+		//will be 183 instead of 200.
+	}
+} _sipSignalCallback;
 /**
  * Default constructor. 
  */
 SipEndpoint::SipEndpoint()
 {
+	command = &_sipSignalCommands;
+	callback = &_sipSignalCallback;
+	// XXX Should also set the id field here, too, and add it to
+	// a list of endpoints. Maybe that's what the factory does?
 }
 
 }; // end SipChannelService
-}; // end Hydra
\ No newline at end of file
+}; // end Hydra
diff --git a/src/SipEndpoint.h b/src/SipEndpoint.h
index 3bf4fab..bc77d2e 100644
--- a/src/SipEndpoint.h
+++ b/src/SipEndpoint.h
@@ -6,18 +6,18 @@
 namespace Hydra
 {
 
-namespace SIP
+namespace SipChannelService
 {
 
-class SipEndpoint : public Hydra::Core::Endpoint::BaseEndpoint
+class SipSignalCommands;
+class SipSignalCallback;
+
+class SipEndpoint : public Hydra::Session::V1::SessionEndpoint
 {
 public:
 	SipEndpoint();
-	class SipSessionManager : public Hydra::Session::SessionManager;
-	class SipSignalCommand : public Hydra::Session::SignalCommand;
-	class SipSignalCallbacks : public Hydra::Session::SignalCallbacks;
 };
 
-}; //End namespace SIP
+}; //End namespace SipChannelService
 
 }; //End namespace Hydra

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


-- 
asterisk-scf/integration/sip.git



More information about the asterisk-scf-commits mailing list