Commit e2a57f6c authored by poglitsch's avatar poglitsch
Browse files

conference functions added

parent a5e48aad
Loading
Loading
Loading
Loading
+136 −0
Original line number Diff line number Diff line
@@ -389,6 +389,117 @@ module AtsNIT_SipSip_Steps {
			));
		}
		
		/* 
		 * @desc invites a user to a conference
		 * @param p_cSeq CSeq number
		 * @param p_to_user user
		 * @param p_conferenceUri conference uri
		 */		
		function f_referConference(
			inout CSeq p_cSeq, 
			in integer p_to_user, 
			in SipUrl p_conferenceUri
		) runs on ImsComponent {
			LibIms_Steps.f_setHeadersREFER_conf(p_cSeq, p_conferenceUri);
			
			f_SendREFER(m_REFER_Request_Base(
				vc_requestUri, 
            	vc_callId, 
    			vc_cSeq,
    			vc_contact, 
    			vc_from, 
    			vc_to, 
    			vc_via, 
    			m_ReferTo_SipUrl(f_initSipUrl(p_to_user)),
    			omit 
			));
			
			f_awaitingResponse(mw_Response_Base(
    			c_statusLine202, 
    			vc_callId, 
    			p_cSeq
    		));
			
			//await NOTIFY and send reply 200 OK
	  		f_awaitingNOTIFY_sendReply(mw_NOTIFY_Request(
				vc_callId,
				"active",
				"application/message/sipfrag",
				m_Event_refer,
				m_MBody_sipfrag("SIP/2.0 100 Trying")
			));
			
			//await NOTIFY and send reply 200 OK
	  		f_awaitingNOTIFY_sendReply(mw_NOTIFY_Request(
				vc_callId,
				"terminated",
				"application/message/sipfrag",
				m_Event_refer,
				m_MBody_sipfrag("SIP/2.0 200 OK")
			));
		}
		
		
		/* 
		 * @desc invites a user to a conference
		 * @param p_cSeq CSeq number
		 * @param p_to_user user
		 * @param p_conferenceUri conference uri
		 */		
		function f_referConference_replaceCall(
			inout CSeq p_cSeq, 
			in integer p_to_user, 
			in SipUrl p_conferenceUri,
			in SessionDialog p_dialog
		) runs on ImsComponent {
			var SipUrl v_uri := f_initSipUrl(p_to_user);
			var charstring v_callId := p_dialog.callId.callid;
			var charstring v_toTag := p_dialog.calleeTo.toParams[0].paramValue;
			var charstring v_fromTag := p_dialog.calleeFrom.fromParams[0].paramValue;
			
			v_uri.urlParameters := {
				{id := "Replaces", paramValue := v_callId & "%3B" & v_toTag & "%3B" & v_fromTag}
			}
			
			LibIms_Steps.f_setHeadersREFER_conf(p_cSeq, p_conferenceUri);
			
			f_SendREFER(m_REFER_Request_Base(
				vc_requestUri, 
            	vc_callId, 
    			vc_cSeq,
    			vc_contact, 
    			vc_from, 
    			vc_to, 
    			vc_via, 
    			m_ReferTo_SipUrl(v_uri),
    			omit 
			));
			
			f_awaitingResponse(mw_Response_Base(
    			c_statusLine202, 
    			vc_callId, 
    			p_cSeq
    		));
			
			//await NOTIFY and send reply 200 OK
	  		f_awaitingNOTIFY_sendReply(mw_NOTIFY_Request(
				vc_callId,
				"active",
				"application/message/sipfrag",
				m_Event_refer,
				m_MBody_sipfrag("SIP/2.0 100 Trying")
			));
			
			//await NOTIFY and send reply 200 OK
	  		f_awaitingNOTIFY_sendReply(mw_NOTIFY_Request(
				vc_callId,
				"terminated",
				"application/message/sipfrag",
				m_Event_refer,
				m_MBody_sipfrag("SIP/2.0 200 OK")
			));
		}
		
		/**
		 * 
		 * @desc join a conference  
@@ -477,5 +588,30 @@ module AtsNIT_SipSip_Steps {
			// 200 OK NOTIFY
			f_awaitingOkResponse(vc_cSeq);
		}
		
		/**
		 * @desc Accepts invitation for conference call.
		 */
		function f_acceptConference() runs on ImsComponent {
			// await INVITE 
			f_awaitingINVITE(mw_INVITE_Request_Base); 
			
			// 200 OK
			// send 200 OK
			f_sendResponse(m_Response_2xxonINVITE_UE(
				c_statusLine200,
				vc_callId, 
				vc_cSeq,
				vc_caller_From, 
				vc_caller_To, 
				vc_via,
				vc_contact,
				f_route(),
				valueof(m_MBody_SDP(vc_sdp_local))
			));
			
			// await ACK
			f_awaitingACK(mw_ACK_Request_Base(vc_callId));
		}
	}
}
 No newline at end of file