[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 19:46:59 CDT 2010


branch "master" has been updated
       via  5fbe85c8aafee7209499d1cc4f7b20ad701431a5 (commit)
      from  0a151d36fffbf3d967e6faa71a99fb107a1647a1 (commit)

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


- Log -----------------------------------------------------------------
commit 5fbe85c8aafee7209499d1cc4f7b20ad701431a5
Author: Mark Michelson <mmichelson at digium.com>
Date:   Mon Aug 23 19:46:40 2010 -0500

    Stub out onReceiveResponse function somewhat.

diff --git a/src/PJSipSessionModule.cpp b/src/PJSipSessionModule.cpp
index 3788514..9bed2a9 100644
--- a/src/PJSipSessionModule.cpp
+++ b/src/PJSipSessionModule.cpp
@@ -90,8 +90,9 @@ static pj_bool_t sessionOnReceiveRequest(pjsip_rx_data *rdata)
 	}
 	default:
 	{
-		//Other methods are not handled by this PJSIP module. Well,
-		//INFO may very well be, but that's a later addition.
+		//This is all for now. Later we'll have support for
+		//REFER and INFO. SUBSCRIBE, NOTIFY, REGISTER, and
+		//PUBLISH fall into other modules' responsibilities.
 		return PJ_FALSE;
 	}
 	return PJ_TRUE;
@@ -100,6 +101,63 @@ static pj_bool_t sessionOnReceiveRequest(pjsip_rx_data *rdata)
 static pj_bool_t sessionOnReceiveResponse(pjsip_rx_data *rdata)
 {
 	//stub
+	pjsip_dialog *dlg = pjsip_rdata_get_dlg(rdata);
+	if (dlg == NULL)
+	{
+		//Out of dialog response? Ouch!
+	}
+	//Message is in dialog. So now let's find out what
+	//method we're dealing with here so we'll know how to 
+	//handle the message.
+	switch (rdata->msg->line.request.method.id)
+	{
+	case PJSIP_INVITE_METHOD:
+	{
+		//Let's see...(This will probably be in its own function)
+		//180: Tell the bridge to ring() the other side
+		//183: Tell the bridge to progress() the other side
+		//Other 1XX, treat like a 180, I guess.
+		//2XX: There had better be an SDP. Parse and give it
+		//to the media layer. Send an ACK. If necessary put
+		//an SDP answer in the ACK.
+		//3XX: Hm, good question. I suppose I should essentially
+		//treat this as a new incoming call to the URI in the
+		//Contact header. Also terminate the previous outgoing
+		//dialog.
+		//400-699: Unless it's a 401 or 407, that means to
+		//terminate the call.
+		break;
+	}
+	case PJSIP_UPDATE_METHOD:
+	{
+		//On a 200 OK, we'll want to check the SDP for changes.
+		//Most other responses we won't care about. 401 and 407
+		//mean it's auth time.
+		break;
+	}
+	case PJSIP_PRACK_METHOD:
+	{
+		//Same as UPDATE, afaik.
+		break;
+	}
+	case PJSIP_BYE_METHOD:
+	{
+		//We'll mostly not care about this response, except for
+		//the 401/407 of course.
+		break;
+	}
+	case PJSIP_CANCEL_METHOD:
+	{
+		//Same as BYE, afaik.
+		break;
+	}
+	default:
+	{
+		//Like with the request reception function, we'll need
+		//to handle INFO and REFER in the future.
+		break;
+	}
+	}
 	return PJ_TRUE;
 }
 

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


-- 
asterisk-scf/integration/sip.git



More information about the asterisk-scf-commits mailing list