Commit 99e01060 authored by poglitsch's avatar poglitsch
Browse files

functions and templates for conference added

parent a877f816
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -255,6 +255,7 @@ group StatusLines
		const StatusLine c_statusLine183	:=	{c_sipNameVersion, 183, "Session Progress"};

		const StatusLine c_statusLine200	:=	{c_sipNameVersion, 200, "OK"};
		const StatusLine c_statusLine202	:=	{c_sipNameVersion, 202, "Acceoted"};

		const StatusLine c_statusLine300	:=	{c_sipNameVersion, 300, "Multible Choices"};
		const StatusLine c_statusLine301	:=	{c_sipNameVersion, 301, "Moved Permanently"};
+52 −0
Original line number Diff line number Diff line
@@ -1160,6 +1160,28 @@ group SetHeaders {
      
	}// end function setHeaders_SUBSCRIBE
	
	
	/**
	 * 
	 * @desc setting of general and basic REFER header fields
	 * 		in additon to the addresses (To, From, ReqUri)
	 * @param p_cSeq_s
	 */
	function f_setHeadersREFER(inout CSeq p_cSeq_s) runs on SipComponent
	{      
	  f_setHeadersGeneral(p_cSeq_s, "REFER"); // cseq, contact, branch, via

	  vc_callId := { fieldName:=CALL_ID_E, callid:=f_getRndCallId(p_cSeq_s) & c_AT & vc_userprofile.currIpaddr };

	  vc_cancel_To := vc_to;
	  vc_caller_To := vc_to;
      
	  vc_caller_From := vc_from;
            
	  vc_reqHostPort := vc_requestUri.hostPort;
      
	}// end function f_setHeadersREFER

	/**
	 * 
	 * @desc This function reads all necessary headers from the received REGISTER message and generate the tag for the answer
@@ -2660,6 +2682,25 @@ group AwaitingMessage {

	} // end of f_awaitingUPDATE_sendReply
	
		
	/** 
	*  @desc await REFER request
	*/
	function f_awaitingREFER(in template REFER_Request p_MSG) runs on SipComponent
	{
		var REFER_Request v_MSG;
  
		tc_resp.start(PX_SIP_TRESP);
		alt
		{
			[] SIPP.receive(p_MSG)-> value v_MSG sender vc_sent_label
			{
					tc_resp.stop;
					f_setHeadersOnReceiptOfRequest(v_MSG);
			}
		}
	} // end of f_awaitingUPDATE
	
} // end AwaitingMessage

group SendMessage {
@@ -2785,6 +2826,17 @@ group SendMessage {
		SIPP.send(p_request) to vc_sent_label;	  
	}
	
		
	/**
	* 
	* @desc  send REFER message
	* @param p_request template of the message to be sent
	*/	
	function f_SendREFER(template REFER_Request p_request) runs on SipComponent
	{
		SIPP.send(p_request) to vc_sent_label;
	}
		
	/**
	* 
	* @desc  send 200 OK
+69 −3
Original line number Diff line number Diff line
@@ -447,6 +447,13 @@ module LibSip_Templates
				fromParams := omit
		};
		
		template Event m_Event_refer := 
		{
			fieldName := EVENT_E,
			eventType := "refer",
			eventParams := omit
		};

		template Event m_Event_conference := 
		{
			fieldName := EVENT_E,
@@ -748,6 +755,20 @@ module LibSip_Templates
			optionsTags:= superset(c_tag100rel)
		}
		
		template Contact mw_Contact_conference :=
		{
		  fieldName := CONTACT_E,
		  contactBody :=
		  {
			contactAddresses :=
			{
			  {
				addressField := *,
				contactParams := {{"isfocus",*}}
			  }
			}
		  } 
		}
	} //*  end of group HeaderFieldTemplates


@@ -1685,8 +1706,39 @@ group request_send {
		}
	  }
	  


	  template NOTIFY_Request m_NOTIFY_Request_sipfrag (
	  	SipUrl p_requestUri, 
	  	CallId p_callId, 
	  	CSeq p_cSeq,
		From p_from, 
		To p_to, 
		Via p_via, 
		charstring p_state, 
		charstring p_sipfrag
	) modifies m_NOTIFY_Request_Base := {
			requestLine	:=
			{
				method := NOTIFY_E,
				requestUri :=
				{
					hostPort:= p_requestUri.hostPort
				}
			},
			msgHeader :=
			{
				contentLength	:= {fieldName := CONTENT_LENGTH_E, len:= lengthof(p_sipfrag)},
				contentType := {fieldName := CONTENT_TYPE_E, mediaType :=  "message/sipfrag"},
				subscriptionState := {
					fieldName := SUBSCRIPTION_STATE_E,
    				subState := p_state,
    				substateParams := omit	
				},
				event := m_Event_refer
			},
			messageBody := {
				sipfrag := 	p_sipfrag
			}
		}

} //*  end group request_send	

@@ -1848,6 +1900,16 @@ group response_receive {
	  }
	}
	
	template Response mw_Response_Contact (template StatusLine p_statusLine, template CallId p_callId,
		template CSeq p_cSeq, template Contact p_contact) modifies mw_Response_Base:=
	{
		statusLine := {sipVersion := c_sipNameVersion, statusCode := p_statusLine.statusCode, reasonPhrase := ?},
		msgHeader :=
		{
			contact := p_contact
	  }
	}
	
	template Response mw_Response_messageBody (
		template StatusLine p_statusLine, 
		template CallId p_callId,
@@ -2246,6 +2308,10 @@ group MessageBodies {
		textplain :=  p_plaitext
	};
	
	template MessageBody m_MBody_sipfrag(charstring p_sipfrag) := {
		sipfrag := p_sipfrag	
	} 
	
	template MessageBody m_MBody_MIMESdpXml(template SDP_Message p_sdp, template XmlBody p_xmlBody):=
	{
		mimeMessageBody := {boundary:="PX_SIP_MIME_Boundary",