[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 18:52:21 CDT 2010


branch "master" has been updated
       via  0a151d36fffbf3d967e6faa71a99fb107a1647a1 (commit)
      from  0817d6977185da73da1d1a90564b64099cfb2860 (commit)

Summary of changes:
 src/PJSipManager.cpp       |    2 +-
 src/PJSipSessionModule.cpp |   63 +++++++++++++++++++++++++++++++++++++++++++-
 2 files changed, 63 insertions(+), 2 deletions(-)


- Log -----------------------------------------------------------------
commit 0a151d36fffbf3d967e6faa71a99fb107a1647a1
Author: Mark Michelson <mmichelson at digium.com>
Date:   Mon Aug 23 18:53:17 2010 -0500

    Add some to the onReceiveRequest stub in PJSipSessionModule.cpp.

diff --git a/src/PJSipManager.cpp b/src/PJSipManager.cpp
index fdd1fe6..398d5fd 100644
--- a/src/PJSipManager.cpp
+++ b/src/PJSipManager.cpp
@@ -104,11 +104,11 @@ bool PJSipManager::setTransports(pjsip_endpoint *endpoint)
 	//addresses to be specified.
 	pj_sockaddr udpAddr;
 	pj_status_t status;
-	//UNSPEC family means "you figure out the address family, pjlib!"
 	//XXX Hard-coded local addr for the time being. This will be a variable
 	//to read from a config at some point
 	char ip[] = "127.0.0.1";
 	pj_str_t udpString = pj_str(ip);
+	//UNSPEC family means "you figure out the address family, pjlib!"
 	pj_sockaddr_parse(pj_AF_UNSPEC(), 0, &udpString, &udpAddr);
 	if (udpAddr.addr.sa_family == pj_AF_INET())
 	{
diff --git a/src/PJSipSessionModule.cpp b/src/PJSipSessionModule.cpp
index 90b207e..3788514 100644
--- a/src/PJSipSessionModule.cpp
+++ b/src/PJSipSessionModule.cpp
@@ -32,7 +32,68 @@ static pj_status_t sessionUnload()
 
 static pj_bool_t sessionOnReceiveRequest(pjsip_rx_data *rdata)
 {
-	//stub
+	pjsip_dialog *dlg = pjsip_rdata_get_dlg(rdata);
+	switch (rdata->msg->line.request.method.id)
+	{
+	case PJSIP_INVITE_METHOD:
+	{
+		if (dlg == NULL)
+		{
+			// New incoming INVITE.
+			// This is where some really good
+			// meaty goodness will be. Oh yeah.
+		}
+		else
+		{
+			// Reinvite!
+		}
+		break;
+	}
+	case PJSIP_BYE_METHOD:
+	{
+		if (dlg == NULL)
+		{
+			// Send a 481
+		}
+		else
+		{
+			// Ending the call for realsies.
+		}
+		break;
+	}
+	case PJSIP_ACK_METHOD:
+	{
+		//Perhaps will need to handle an SDP answer.
+		break;
+	}
+	case PJSIP_CANCEL_METHOD:
+	{
+		if (dlg == NULL)
+		{
+			// Send a 481
+		}
+		else
+		{
+			// Let the other side know we changed our minds.
+		}
+		break;
+	}
+	case PJSIP_PRACK_METHOD:
+	{
+		//Potentially need to handle some SDP changes here.
+		break;
+	}
+	case PJSIP_UPDATE_METHOD:
+	{
+		//Potentially need to handle some SDP changes here.
+		break;
+	}
+	default:
+	{
+		//Other methods are not handled by this PJSIP module. Well,
+		//INFO may very well be, but that's a later addition.
+		return PJ_FALSE;
+	}
 	return PJ_TRUE;
 }
 

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


-- 
asterisk-scf/integration/sip.git



More information about the asterisk-scf-commits mailing list