Commit 6969ee61 authored by rennoch's avatar rennoch
Browse files

modified type SipUrl

-	new subtypes (UriComponents, SipUriComponents, UrnUriComponents, TelUriComponents)

new type RequestUnion

New header fields: SessionId, SIP_ETag, SIP_If_Match

Removal (to be included from/via new import LibSip_MessageBodyTypes)
-	import of LibSip_SDPTypes, LibSip_XMLTypes, LibSip_SimpleMsgSummaryTypes
-	types MessageBody, MIMETypes 
parent 1b967b46
Loading
Loading
Loading
Loading
+1181 −1145
Original line number Diff line number Diff line
@@ -16,9 +16,7 @@

module LibSip_SIPTypesAndValues
{
	import from LibSip_SDPTypes all;
	import from LibSip_XMLTypes all;
    import from LibSip_SimpleMsgSummaryTypes all;
  import from LibSip_MessageBodyTypes all;

group Constants
{
@@ -39,6 +37,9 @@ group SimpleConstants
      // TEL scheme
      const charstring c_telScheme := "tel";
      
      // URN schema
      const charstring c_urnScheme := "urn";

      // TAG_ID
      const charstring c_tagId := "tag";
      
@@ -216,12 +217,17 @@ group HeaderFieldConstants {

    const From  c_empty_From := {
      fieldName := FROM_E,
	  addressField := {nameAddr := 
		{displayName := omit,
      addressField := {
        nameAddr := {
          displayName := omit,
          addrSpec := {
            scheme  := c_sipScheme,
            components := {
              sip := {
                userInfo := omit ,
			hostPort := {host:="127.0.0.1", portField:=c_defaultSipPort},
                hostPort := {host:="127.0.0.1", portField:=c_defaultSipPort}
              }
            },
            urlParameters := omit,
            headers := omit
          }
@@ -235,8 +241,12 @@ group HeaderFieldConstants {
    const SipUrl c_empty_RequestUri :=
    {
      scheme  := c_sipScheme,
      components := {
        sip := {
          userInfo := omit ,
	  hostPort := {host:="127.0.0.1", portField:=c_defaultSipPort},
          hostPort := {host:="127.0.0.1", portField:=c_defaultSipPort}
        }
      },
      urlParameters := omit,
      headers := omit
    };
@@ -244,8 +254,12 @@ group HeaderFieldConstants {
    const SipUrl c_unavailableUri :=
    {
      scheme  := c_sipScheme,
      components := {
        sip := {
          userInfo := {userOrTelephoneSubscriber:="unavailable", password:=omit},
			hostPort := {host:="anonymous.invalid", portField:=c_defaultSipPort},
          hostPort := {host:="anonymous.invalid", portField:=c_defaultSipPort}
        }
      },
      urlParameters := omit,
      headers := omit
    };
@@ -253,16 +267,17 @@ group HeaderFieldConstants {
    const To    c_empty_To :=
    { // value of To header
      fieldName := TO_E,
	  addressField := 
	  {
		nameAddr := 
		{
      addressField := {
        nameAddr := {
          displayName := omit,
		  addrSpec := 
		  {
          addrSpec := {
            scheme  := c_sipScheme,
            components := {
              sip := {
                userInfo := omit ,
			hostPort := {host:="127.0.0.1", portField:=c_defaultSipPort},
                hostPort := {host:="127.0.0.1", portField:=c_defaultSipPort}
              }
            },
            urlParameters := omit,
            headers := omit
          }
@@ -300,7 +315,7 @@ group StatusLines
    {
        const StatusLine c_statusLine100    :=  {c_sipNameVersion, 100, "Trying"};
        const StatusLine c_statusLine180    :=  {c_sipNameVersion, 180, "Ringing"};
		const StatusLine c_statusLine181	:=	{c_sipNameVersion, 181, "Call Is Being Forwarded"};
        const StatusLine c_statusLine181    :=  {c_sipNameVersion, 181, "Call is Being Forwarded"};
        const StatusLine c_statusLine182    :=  {c_sipNameVersion, 182, "Queued"};
        const StatusLine c_statusLine183    :=  {c_sipNameVersion, 183, "Session Progress"};

@@ -503,7 +518,12 @@ group SubTypes{// Subtypes
        //Transporting User to User Call Control Information in SIP for ISDN Interworking
        USER_TO_USER_E,
        
        GEOLOCATION_E // draft-ietf-sipcore-location-conveyance-04
        GEOLOCATION_E, // draft-ietf-sipcore-location-conveyance-04
        
        SESSION_ID_E,
        
        SIP_ETAG_E,
        SIP_IF_MATCH_E
      }
      
      // [7.1]
@@ -574,11 +594,32 @@ group SubTypes{// Subtypes
 * @member urlParameters Contains either SIP or TEL URL parameters, separated by semicolons, e.g. transport=tcp or user=phone
 * @member headers Additional information added after the parameters, e.g. priority=urgent
 */

      type record SipUriComponents {   // sip-uri acc. to RFC 3261 cl. 19.1
        UserInfo        userInfo optional,
        HostPort        hostPort
      }

      type record TelUriComponents {   // tel-uri acc. to RFC 3966
        charstring      subscriber
      }
    
      type record UrnUriComponents {   // urn-uri acc. to RFC 2141
        charstring      namespaceId,   // e.g. "service" as acc. to RFC 5031
        charstring      namespaceSpecificString    // e.g. "sos"
      }
    
      type union UriComponents {
        SipUriComponents   sip,    // scheme: "sip" or sips"
        TelUriComponents   tel,    // scheme: "tel"
        UrnUriComponents   urn,    // scheme: "urn"
        charstring         other   // scheme: none of the above schemes
      }
        
      type record SipUrl
      {
        charstring      scheme,          // e.g "sip" or "tel"
        UserInfo		userInfo optional,
        HostPort		hostPort optional,
        UriComponents   components,      // corresponding to the scheme
        SemicolonParam_List urlParameters optional,
        AmpersandParam_List headers optional
      }
@@ -1255,6 +1296,17 @@ group SubTypes{// Subtypes
      }
      }//end group RFC3515HeaderFieldTypes


      group  RFC4488HeaderFieldTypes
      {
      // [4488]
      type record ReferSub {
        FieldName fieldName(REFER_SUB_E),
        boolean referSubValue,
        SemicolonParam_List referSubParams optional
      }
      }//end group RFC4488HeaderFieldTypes

      group RFC3329HeaderFieldTypes
      {
      // [RFC3329/2.2]
@@ -1343,17 +1395,6 @@ group SubTypes{// Subtypes
      }
      }//end group RFC3515HeaderFieldTypes

	  group  RFC4488HeaderFieldTypes {
	      
	  // [4488]
	  type record ReferSub {
		  FieldName fieldName(REFER_SUB_E),
		  boolean referSubValue,
		  SemicolonParam_List referSubParams optional
	  }
	      
	  }//end group RFC4488HeaderFieldTypes

      group RFC3608HeaderFieldTypes
      {
      // [3608]
@@ -1434,6 +1475,7 @@ group SubTypes{// Subtypes

      type record of HistoryInfoEntry HistoryInfo_List;


      type record of charstring StringList;

      type record HistoryInfoEntry {
@@ -1470,6 +1512,7 @@ group SubTypes{// Subtypes
          FieldName fieldName(P_ASSERTED_SERVICE_E),
          PAssertedServiceValue pAssertedServiceValue
      }

      type record Geolocation {       // draft-ietf-sipcore-location-conveyance-04 clause 4.1
        FieldName fieldName(GEOLOCATION_E),
        SipUrl    addrSpec,
@@ -1477,6 +1520,25 @@ group SubTypes{// Subtypes
        SemicolonParam_List geolocParam optional
      }

      type charstring SessIdString length(32);

      type record SessionId {
        FieldName fieldName (SESSION_ID_E),
        SessIdString sessid,
        GenericParam sessidParam optional
      }

      type charstring EntityTag;

      type record SIP_ETag {
        FieldName fieldName (SIP_ETAG_E),
        EntityTag entityTag
      }

      type record SIP_If_Match {
        FieldName fieldName (SIP_IF_MATCH_E),
        EntityTag entityTag
      }

    } // end group HeaderFieldTypes
    
@@ -1554,6 +1616,9 @@ group SubTypes{// Subtypes
        Server              server optional, // only in responses
        ServiceRoute        serviceRoute optional, // 3608
        SessionExpires      sessionExpires optional, // 4028
        SessionId           sessionId optional,
        SIP_ETag            sipETag optional,
        SIP_If_Match        sipIfMatch optional,
        Subject             subject optional, // only in requests
        SubscriptionState   subscriptionState optional, // 3265/7.2
        Supported           supported optional,
@@ -1786,6 +1851,21 @@ group SubTypes{// Subtypes
        Payload         payload optional
      } with { encode "SIPCodec"}

      type union RequestUnion {
        REGISTER_Request            Register,
        INVITE_Request              Invite,
        OPTIONS_Request             Options,
        BYE_Request                 Bye,
        CANCEL_Request              Cancel,
        ACK_Request                 Ack,
        PRACK_Request               Prack,
        NOTIFY_Request              Notify,
        SUBSCRIBE_Request           Subscribe,
        PUBLISH_Request             Publish,
        UPDATE_Request              Update,
        REFER_Request               Refer,
        MESSAGE_Request             Message
      } with { encode "SIPCodec"}

    }  //with { encode "SIPCodec" }// end group RequestTypes
    
@@ -1808,6 +1888,7 @@ group SubTypes{// Subtypes
        MessageBody     messageBody optional,
        Payload         payload     optional
      }  with { encode "SIPCodec"}

    } //with { encode "SIPCodec" }// end group ResponseTypes
    
    // This MSG type is defined for sending synctactic variations, ans syntactically
@@ -1819,51 +1900,6 @@ group SubTypes{// Subtypes
    
    // This type is defined for particular SIP message body types like SDP

	group MessageBodyTypes
	{
	  type union MessageBody{
		SDP_Message sdpMessageBody, 	// if there is only SDP part
//		XMLMessage xmlMessage,          // if there is XML message (with header and body)
        XmlBody xmlBody,				// if there is XML body
		MIME_Message mimeMessageBody, 	// if there is SDP and encapsulated ISUP part
		charstring sipfrag, 			// if content-Type is message/sipfrag (cp. NOTIFY, cp TS124147 A.4.3.1.2)
		charstring textplain,			// if content type is text/plain (for testing long messages)
		SimpleMsgSummary simpleMsgSummary, // RFC 3842
		octetstring smsMessage          // encoded SMS message 3GPP 23.040, 24.011
	  };
 
	} // end group MessageBodyTypes
		
 	group MIMETypes
  	{  	
	  group SubMIMETypes
	  {
    	
		type union MIME_Encapsulated_Parts {
		  SDP_Message 	sdpMessageBody,
          XmlBody xmlBody					// if there is XML body
//          XMLMessage 	xmlMessage          // if there is XML message (with header and body)
		} 
		
		type record MIME_Encapsulated_Part {
		  charstring 				content_type,
		  charstring				content_disposition optional,
		  MIME_Encapsulated_Parts 	mime_encapsulated_part
		}
	  }//end group SubMIMETypes

	  group MessageTypes {
 
	    type record MIME_Message {
		  charstring boundary, // len: 
		  MimeEncapsulatedList mimeEncapsulatedList
	    } with { encode "MimeBodyCodec" }
	  
	    type record of MIME_Encapsulated_Part MimeEncapsulatedList;

	  } // group MessageTypes
    } // group MIMETypes
    
  }// end group MSGTypes
}// end group Types