LibSip_SIPTypesAndValues.ttcn 46 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000
/*
 *	@author 	STF 346
 *  @version    $Id$
 *	@desc		This module provides the types and constants used by the test component 
 *              for SIP tests. Module become from STF306 and STF334-336
 */

module LibSip_SIPTypesAndValues
{
	//	SipAts
	import from LibSip_SDPTypes all;
	import from LibSip_XMLTypes all;

group Constants 
{	
group SimpleConstants
    {
      // SIP name protocol plus version
      const charstring c_sipNameVersion := "SIP/2.0";
      
      // SIP name protocol
      const charstring c_sipName := "SIP";
      
      // SIP version
      const charstring c_sipVersion := "2.0";
      
      // SIP scheme
      const charstring c_sipScheme := "sip";
      
	  // TEL scheme
	  const charstring c_telScheme := "tel";
      
      // TAG_ID
      const charstring c_tagId := "tag";
      
      // BRANCH_ID
      const charstring c_branchId := "branch";
      
      // BRANCH_COOKIE
      const charstring c_brenchCookie := "z9hG4bK";
      
      // EXPIRES_ID
      const charstring c_expiresId := "expires";
      
      // MADDR_ID
      const charstring c_maddrId := "maddr";
      
      // METHOD_ID
      const charstring c_methodId := "method";
      
      // RECEIVED_ID
      const charstring c_receivedId := "received";
      
      // TTL_ID
      const charstring c_ttlId := "ttl";
      
      // USER_ID
      const charstring c_userId := "user";
      
      // SDP name application
      const charstring c_sdpAplication := "application/sdp";
      
	  // XML name application
	  const charstring c_xmlAplication := "application/xml";
      
	  // MIME name application
	  const charstring c_mimeMultipart := "multipart/mixed";
      
	  // OCTET-STREAM name application
	  const charstring c_octetAplication := "application/octet-stream";
	  
      // PLAIN-TEXT name application
	  const charstring c_plainText := "text/plain";
	  
	  //text content of 1300 bytes for messages with message body
	  const charstring c_longMessageContent_1300Bytes :=
	  "0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789"&
	  "0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789"&
	  "0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789"&
	  "0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789"&
	  "0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789"&
	  "0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789"&
	  "0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789"&
	  "0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789"&
	  "0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789"&
	  "0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789"&
	  "0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789"&
	  "0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789"&
	  "0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789";
	  
 
      // Default SIP port number : 5060
      const integer c_defaultSipPort := 5060;
      
      // Default SIP protocol : UDP
      const charstring c_defaultSipProt := "UDP";
      
      // Fixed IP multicast address
      const charstring c_mcastSipIpaddr := "224.0.1.75";
      
      // Short delta-second used in expires parameter to acknowledge a registration
      const charstring c_shortRegistration := "3600";
      
	  // option tag 100rel (reliable provisional response [RFC3262])
	  const charstring c_tag100rel := "100rel";
      
	  // option tag precondition (ch.11 [RFC3312])
	  const charstring c_tagPrecond := "precondition";

	  // due to problem with TAU compiler because hardcoded return statement constant is created
	  const HostPort c_hostport_dummy := {host:="", portField:=c_defaultSipPort};

	  // CLIP/CLIR information
	  const PrivacyValue c_privacy_none := "none";		
	  const PrivacyValue c_privacy_id := "id";
	  const PrivacyValue c_privacy_header := "header";
	  const PrivacyValue c_privacy_user := "user";
	  
	  // @ (at) sign
	  const charstring c_AT := "@";
	  
	  // * (wildchard) sign
	  const charstring c_WILDCARD := "*";
	  
	  const integer c_CRlen := 2; // length of new line (0d0a)

	  const GenericParam c_Integrity_protected_yes := {"Integrity protected","yes"}
	  const GenericParam c_Integrity_protected_no := {"Integrity protected","no"}

} //end group SimpleConstants

group AuthorizationConstants {
	
	const charstring c_ik := "";
	const charstring c_ck := "";
	const charstring c_algorithm := "MD5";
	const charstring c_nonce := ""

} //end group AuthorizationConstants

group HeaderFieldConstants {

	const CallId	c_empty_CallId :=
	{
	  fieldName := CALL_ID_E,
	  callid := ""
	};
		  
	const CSeq	c_empty_cSeq := {
		fieldName := CSEQ_E, 
		seqNumber:=0, 
		method:="" };
	
	const From	c_empty_From := { 
	  fieldName := FROM_E,
	  addressField := {nameAddr := 
		{displayName := omit,
		  addrSpec := {
			scheme  := c_sipScheme,
			userInfo := omit ,
			hostPort := {host:="", portField:=c_defaultSipPort},
			urlParameters := omit,
			headers := omit
		  }
		}
	  },
	  fromParams := omit
	};
	
	const MaxForwards c_maxForwards70 := {fieldName:=MAX_FORWARDS_E, forwards:=70}
	
	const SipUrl c_empty_RequestUri :=
	{
	  scheme  := c_sipScheme,
	  userInfo := omit ,
	  hostPort := {host:="", portField:=c_defaultSipPort},
	  urlParameters := omit,
	  headers := omit
	};

	const SipUrl c_unavailableUri :=
	{
			scheme  := c_sipScheme,
			userInfo := {userOrTelephoneSubscriber:="unavailable", password:=omit},
			hostPort := {host:="anonymous.invalid", portField:=c_defaultSipPort},
			urlParameters := omit,
			headers := omit
	};

	const To	c_empty_To := 
	{ // value of To header
	  fieldName := TO_E,
	  addressField := 
	  {
		nameAddr := 
		{
		  displayName := omit,
		  addrSpec := 
		  {
			scheme  := c_sipScheme,
			userInfo := omit ,
			hostPort := {host:="", portField:=c_defaultSipPort},
			urlParameters := omit,
			headers := omit
		  }
		}
	  },
	  toParams := omit
	};
	
	const Via c_empty_Via := {
	  fieldName := VIA_E,
	  viaBody :={
		{sentProtocol := {
			protocolName := c_sipName,
			protocolVersion := c_sipVersion,
			transport := c_defaultSipProt
		  },
		  sentBy := {host:="", portField:=c_defaultSipPort},
		  viaParams:= omit
		}
	  }};
		

}


group UserProfileConstants
{
	  // number of user profile from 1-10 for SIP profile
	  const integer c_userProfile_SIP1_home := 1;
	  const integer c_userProfile_SIP2_home := 2;

} //end group UserProfileConstants

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_statusLine182	:=	{c_sipNameVersion, 182, "Queued"};
		const StatusLine c_statusLine183	:=	{c_sipNameVersion, 183, "Session Progress"};

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

		const StatusLine c_statusLine300	:=	{c_sipNameVersion, 300, "Multible Choices"};
		const StatusLine c_statusLine301	:=	{c_sipNameVersion, 301, "Moved Permanently"};
		const StatusLine c_statusLine302	:=	{c_sipNameVersion, 302, "Move Temporarily"};
		const StatusLine c_statusLine305	:=	{c_sipNameVersion, 305, "Use Proxy"};
		const StatusLine c_statusLine380	:=	{c_sipNameVersion, 380, "Alternative Service"};

		const StatusLine c_statusLine400	:=	{c_sipNameVersion, 400, "Bad Request"};
		const StatusLine c_statusLine401	:=	{c_sipNameVersion, 401, "Unauthorised"};
		const StatusLine c_statusLine402	:=	{c_sipNameVersion, 402, "Payment Required"};
		const StatusLine c_statusLine403	:=	{c_sipNameVersion, 403, "Forbidden"};
		const StatusLine c_statusLine404	:=	{c_sipNameVersion, 404, "Not Found"};
		const StatusLine c_statusLine405	:=	{c_sipNameVersion, 405, "Method Not Alllowed"};
		const StatusLine c_statusLine406	:=	{c_sipNameVersion, 406, "Not Accetable"};
		const StatusLine c_statusLine407	:=	{c_sipNameVersion, 407, "Proxy authentication required"};
		const StatusLine c_statusLine408	:=	{c_sipNameVersion, 408, "Request Timeout"};
		const StatusLine c_statusLine410	:=	{c_sipNameVersion, 410, "Gone"};
		const StatusLine c_statusLine413	:=	{c_sipNameVersion, 413, "Request Entity too long"};
		const StatusLine c_statusLine414	:=	{c_sipNameVersion, 414, "Request-uri too long"};
		const StatusLine c_statusLine415	:=	{c_sipNameVersion, 415, "Unsupported Media type"};
		const StatusLine c_statusLine416	:=	{c_sipNameVersion, 416, "Unsupported URI scheme"};
		const StatusLine c_statusLine420	:=	{c_sipNameVersion, 420, "Bad Extension"};
		const StatusLine c_statusLine421	:=	{c_sipNameVersion, 421, "Extension required"};
		const StatusLine c_statusLine422	:=	{c_sipNameVersion, 422, "Session Interval Too Small"};
		const StatusLine c_statusLine423	:=	{c_sipNameVersion, 423, "Interval Too Brief"};		
		const StatusLine c_statusLine480	:=	{c_sipNameVersion, 480, "Temporatily Unavailable"};
		const StatusLine c_statusLine481	:=	{c_sipNameVersion, 481, "Call/Transaction doesnot exist"};
		const StatusLine c_statusLine482	:=	{c_sipNameVersion, 482, "Loop Detected"};
		const StatusLine c_statusLine483	:=	{c_sipNameVersion, 483, "Too many hops"};
		const StatusLine c_statusLine484	:=	{c_sipNameVersion, 484, "Address Incomplete"};
		const StatusLine c_statusLine485	:=	{c_sipNameVersion, 485, "Ambiguous"};
		const StatusLine c_statusLine486	:=	{c_sipNameVersion, 486, "Busy Here"};
		const StatusLine c_statusLine487	:=	{c_sipNameVersion, 487, "Request Terminated"};
		const StatusLine c_statusLine488	:=	{c_sipNameVersion, 488, "Not acceptable here"};
		const StatusLine c_statusLine493	:=	{c_sipNameVersion, 493, "Undecipherable"};
		const StatusLine c_statusLine500	:=	{c_sipNameVersion, 500, "Server Internal error"};
		const StatusLine c_statusLine501	:=	{c_sipNameVersion, 501, "Not implemented"};
		const StatusLine c_statusLine502	:=	{c_sipNameVersion, 502, "Bad Gateway"};
		const StatusLine c_statusLine503	:=	{c_sipNameVersion, 503, "Service Unavailable"};
		const StatusLine c_statusLine504	:=	{c_sipNameVersion, 504, "Server timeout"};
		const StatusLine c_statusLine505	:=	{c_sipNameVersion, 505, "Version not supported"};
		const StatusLine c_statusLine513	:=	{c_sipNameVersion, 513, "Message too long"};
		const StatusLine c_statusLine580	:=	{c_sipNameVersion, 580, "Precondition failure"};
		const StatusLine c_statusLine600	:=	{c_sipNameVersion, 600, "Busy Everywhere"};
		const StatusLine c_statusLine603	:=	{c_sipNameVersion, 603, "Decline"};
		const StatusLine c_statusLine604	:=	{c_sipNameVersion, 604, "Does not exist anywhere"};
		const StatusLine c_statusLine606	:=	{c_sipNameVersion, 606, "Not acceptable"};
		
} //end StatusLines
} //end group Constants

group Types {
group SubTypes{// Subtypes
    
    group TokenTypes // TokensTypes
    {
      // [20]
      type enumerated FieldName
      {
        ACCEPT_E,
        ACCEPT_ENCODING_E,
        ACCEPT_LANGUAGE_E,
        ALERT_INFO_E,
        ALLOW_E,
        AUTHENTICATION_INFO_E,
        AUTHORIZATION_E,
        CALL_ID_E,
        CALL_INFO_E,
        CONTACT_E,
        CONTENT_DISPOSITION_E,
        CONTENT_ENCODING_E,
        CONTENT_LANGUAGE_E,
        CONTENT_LENGTH_E,
        CONTENT_TYPE_E,
        CSEQ_E,
        DATE_E,
        ERROR_INFO_E,
        EXPIRES_E,
        FROM_E,
        IN_REPLY_TO_E,
        MAX_FORWARDS_E,
        MIME_VERSION_E,
        MIN_EXPIRES_E,
        ORGANIZATION_E,
        PRIORITY_E,
        PROXY_AUTHENTICATE_E,
        PROXY_AUTHORIZATION_E,
        PROXY_REQUIRE_E,
        RECORD_ROUTE_E,
        REPLY_TO_E,
        REQUIRE_E,
        RETRY_AFTER_E,
        ROUTE_E,
        SERVER_E,
        SUBJECT_E,
        SUPPORTED_E,
        TIMESTAMP_E,
        TO_E,
        UNSUPPORTED_E,
        USER_AGENT_E,
        VIA_E,
        WARNING_E,
        WWW_AUTHENTICATE_E,
        
		// [3262/7.1]
		RACK_E,
		RSEQ_E,
		
		// [3265/7.2]
		ALLOW_EVENTS_E,
		EVENT_E,
		SUBSCRIPTION_STATE_E,
		
		// [3313]
		P_MEDIA_AUTHORIZATION_E,
		
		// [3323]
		PRIVACY_E,
		
		// [3325]
		P_ASSERTED_ID_E,
		P_PREFERRED_ID_E, 
		       
		// [3326]
		REASON_E,

		// [3515] - REFER method
		REFER_TO_E,
		
		// [3892] - REFER method
		REFERRED_BY_E,
		
		// [4244]
		HISTORY_INFO_E,
		
		// [3313]
		P_MEDIA_AUTH_E,
		
		// [3327]
		PATH_E,	
		
		// [3329]
		SECURITY_CLIENT_E,	
		SECURITY_SERVER_E,
		SECURITY_VERIFY_E,  
		 
		// [3455]
		P_ACCESS_NETWORK_INFO_E,
		P_ASSOCIATED_URI_E,
		P_CALLED_PARTY_E,
		P_CHARGING_FUNCTION_ADDRESSES_E,
		P_CHARGING_VECTOR_E,
		P_VISITED_NETWORK_E,
		
		// [3608]
		SERVICE_ROUTE_E,
		
		// [3841]
		ACCEPT_CONTACT_E,
		
		// [4028]
		MIN_SE_E,
		SESSION_EXPIRES_E,
	
		P_ASSERTED_SERVICE_E,
		
		//[5009]
		P_EARLY_MEDIA_E
		
      }
      
	  // [7.1]
	  type enumerated Method {
		  ACK_E,
		  BYE_E,
		  CANCEL_E,
		  INVITE_E,
		  OPTIONS_E,
		  REGISTER_E,
		  PRACK_E, // Note: this element is not defined in [5]
		  SUBSCRIBE_E, NOTIFY_E, // [3265]
		  PUBLISH_E, // [3903/12]
		  REFER_E, // [3515]
		  UPDATE_E, // [3311]
		  MESSAGE_E, // [3428]
		  INFO_E	// [2976]
		  }
	        
      // [20.1, 20.3, 20.4, 20.7, 20.9, 20.10, 20.11, 20.18, 20.20, 20.27, 20.28, 20.30, 20.31,
      // 20.33, 20.34, 20.39, 20.42, 20.44]
      type record GenericParam
      {
        charstring                 id,
        charstring                paramValue optional
      }
      
      // [?]
      type set of GenericParam SemicolonParam_List;
      
      // [?]
      type set of GenericParam AmpersandParam_List;
      
      // [?]
      type set of GenericParam CommaParam_List;
      
      // [20.10, 20.20, 20.30, 20.31, 20.34, 20.39, 20.42, 20.43]
      type record HostPort
      {
        charstring             host optional,                // hostname, IPv4 or IPv6
        integer                portField optional        // represented as an integer
      }
      
      // [20.10, 20.20, 20.30, 20.31, 20.34, 20.39]
      type record UserInfo
      {
        charstring	       userOrTelephoneSubscriber,
        charstring	       password optional
      }
      
      // [19.1.1 ;used in: 20.10, 20.20, 20.30, 20.31, 20.34, 20.39]
      type record SipUrl
      {
        charstring		scheme,  // contains "sip:"
        UserInfo		userInfo optional,
        HostPort		hostPort optional,
        SemicolonParam_List	urlParameters optional,
        AmpersandParam_List	headers optional
      }
      
      // [20.1, RFC2616 14.1]
      type record AcceptBody
      {
        charstring 		mediaRange,
        SemicolonParam_List	acceptParam optional
      }
      
      // [20.1, RFC2616 14.1]
      type set of AcceptBody AcceptBody_List;
      
      // [20.4]
      type record AlertInfoBody
      {
        charstring			url,	// any URI
        SemicolonParam_List	genericParams optional
      }
      
      // [20.4]
      type set of AlertInfoBody AlertInfoBody_List;
      
      // [20.8]
      type charstring CallidString;    // token ["@" token]
      
      // [20.8]
      type set of CallidString CallidString_List;
      
      // [20.9]
      type record CallInfoBody
      {
        charstring	 		url,	// any URI
        SemicolonParam_List		infoParams optional
      }
      
      // [20.9]
      type set of CallInfoBody CallInfoBody_List;
      
      // [20.27, 20.44, .......10.32, 10.48; RFC2616 14.33, 14.47; RFC2617 1.2]
      type union Challenge
      {
        CommaParam_List digestCln,
        OtherAuth	otherChallenge
      }
      
      // [20.10, 20.20, 20.30, 20.31, 20.34, 20.39]
      type record NameAddr
      {
        charstring	displayName optional,
        SipUrl		addrSpec
      }
      
      // [20.10, 20.20, 20.31, 20.39]
      type union Addr_Union
      {
        NameAddr	nameAddr,
        SipUrl		addrSpecUnion // STS: "Union" added to filed name to avoid dangerous name equivalence with 2nd NameAddr field
      }
      
      // [20.10]
      type record ContactAddress
      {
        Addr_Union 		addressField,
        SemicolonParam_List	contactParams optional
      }
      
      // [20.10]
      type set of ContactAddress ContactAddress_List; // 1 or more elements
      
      // [20.10]
      type union ContactBody
      {
        charstring		wildcard,
        ContactAddress_List	contactAddresses
      }
      
      // [20.2, 20.12; RFC2616 14.3, 14.11]
      type charstring ContentCoding;
      
      // [20.2, 20.12; RFC2616 14.3, 14.11]
      type set of ContentCoding ContentCoding_List;
      
      // [20.7, 20.28; RFC2616 14.35 RFC2617 1.2]
      type union Credentials
      {
        CommaParam_List	digestResponse,
        OtherAuth  	    otherResponse
      }
      
      // [20.19, 20.23, 20.33]
      type charstring	DeltaSec;	// an external operation can handle this field
      
      // [20.18]
      type record ErrorInfoBody
      {
        charstring			uri,		// any URI
        SemicolonParam_List		genericParams optional
      }
      
      // [20.18]
      type set of ErrorInfoBody ErrorInfoBody_List;
      
      // [20.3 RFC2616 14.4]
      type record LanguageBody
      {
        charstring 		languageRange,
        SemicolonParam_List	acceptParam optional
      }
      
      // [20.3 RFC2616 14.4]
      type set of LanguageBody LanguageBody_List;
      
      // [20.13; RFC2616 14.12]
      type charstring LanguageTag;
      
      // [20.13; RFC2616 14.12]
      type set of LanguageTag LanguageTag_List;
      
      // [20.5]
      type set of charstring Method_List;
      
      
      // [20.29, 20.32, 20.37, 20.40]
      type charstring OptionTag;
      
      // [20.29, 20.32, 20.37, 20.40]
      type set of OptionTag OptionTag_List;
      
      
      // [20.7, 20.27, 20.28, 20.44  ; RFC2616 14.33, 14.47; RFC2617 1.2]
      type record OtherAuth
      {
        charstring		authScheme,
        CommaParam_List	authParams
      }
      
      type record Payload
      {
        integer		payloadlength,
        charstring 		payloadvalue
      }
      
      // [20.30,20.34]
      type record RouteBody
      {
        NameAddr			nameAddr,
        SemicolonParam_List	rrParam optional
      }
      
      // [20.30,20.34]
      type record of RouteBody RouteBody_List;
      
      // [20.42]
      type record SentProtocol
      {
        charstring		protocolName,
        charstring		protocolVersion,
        charstring		transport
      }
      
      // [20.35, 20.41; RFC2616 14.43]
      type charstring ServerVal;
      
      // [20.35, 20.41; RFC2616 14.43]
      type set of ServerVal ServerVal_List;
      
      // [20.38]
      type record TimeValue
      {
        integer			majorDigit,		// represented as an integer
        integer			minorDigit optional	// represented as an integer
      }
      
      // [20.42]
      type record ViaBody
      {
        SentProtocol	sentProtocol,
        HostPort		sentBy,
        SemicolonParam_List	viaParams optional
      }
      
      // [20.42]
      type record of ViaBody ViaBody_List;
      
      // [20.43]
      type union WarnAgent
      {
        HostPort		hostPort,
        charstring		pseudonym
      }
      
      // [20.43]
      type record WarningValue
      {
        integer		warnCode,	// represented as an integer
        WarnAgent		warnAgent,
        charstring		WarnText
      }
      
      // [20.43]
      type set of WarningValue WarningValue_List;

	  type Addr_Union PAssertedIDValue;
      
	  type record of PAssertedIDValue PAssertedIDValue_List;

	  type charstring PAssertedServiceValue;

	  type Addr_Union PPreferredIDValue;
      
	  type record of PPreferredIDValue PPreferredIDValue_List;

	  type charstring PrivacyValue;
      
	  type record of PrivacyValue PrivacyValue_List;

      
    } // end group TokensType
    
    
    group HeaderFieldTypes  // Header Fields
    {
	group CommonHeaderFieldTypes
    {
      // [20.1, RFC2616 14.1]
      type record Accept
      {
        FieldName		fieldName (ACCEPT_E),
        AcceptBody_List	        acceptArgs optional
      }
      
      // [20.2, RFC2616 14.3]
      type record AcceptEncoding
      {
        FieldName		fieldName (ACCEPT_ENCODING_E),
        ContentCoding_List	contentCoding optional
      }
      
      // [20.3, RFC2616 14.4]
      type record AcceptLanguage
      {
        FieldName		fieldName (ACCEPT_LANGUAGE_E),
        LanguageBody_List	languageBody optional
      }
      
      // [20.4]
      type record AlertInfo
      {
        FieldName		fieldName (ALERT_INFO_E),
        AlertInfoBody_List	alertInfoBody optional
      }
      
      // [20.5]
      type record Allow
      {
        FieldName		fieldName (ALLOW_E),
        Method_List		methods optional
      }
      
      // [20.6]
      type record AuthenticationInfo
      {
        FieldName		fieldName (AUTHENTICATION_INFO_E),
        CommaParam_List	ainfo
      }
      
      // [20.7 RFC2617 3.2.2]
      type record Authorization
      {
        FieldName		fieldName (AUTHORIZATION_E),
        Credentials		body
      }
      
      // [20.8]
      type record CallId
      {
        FieldName		fieldName (CALL_ID_E),
        CallidString       	callid
      }
      
      // [20.9]
      type record CallInfo
      {
        FieldName		fieldName (CALL_INFO_E),
        CallInfoBody_List	callInfoBody optional
      }
      
      // [20.10]
      type record Contact
      {
        FieldName		fieldName (CONTACT_E),
        ContactBody		contactBody
      }
      
      // [20.11]
      type record ContentDisposition
      {
        FieldName		fieldName (CONTENT_DISPOSITION_E),
        charstring		dispositionType,
        SemicolonParam_List	dispositionParams optional
      }
      
      // [20.12 RFC2616 14.11]
      type record ContentEncoding
      {
        FieldName		fieldName (CONTENT_ENCODING_E),
        ContentCoding_List	contentCoding
      }
      
      // [20.13 RFC2616 14.12]
      type record ContentLanguage
      {
        FieldName		fieldName (CONTENT_LANGUAGE_E),
        LanguageTag_List	languageTag
      }
      
      // [20.14]
      type record ContentLength
      {
        FieldName		fieldName (CONTENT_LENGTH_E),
        integer		len	// this field is represented as an integer
      }
      
      // [20.15]
      type record ContentType
      {
        FieldName		fieldName (CONTENT_TYPE_E),
        charstring		mediaType
      }
      
      // [20.16]
      type record CSeq
      {
        FieldName		fieldName (CSEQ_E),
        integer		seqNumber,	// this field is represented as an integer
        charstring   	method
      }
      
      // [20.17]
      type record Date
      {
        FieldName		fieldName (DATE_E),
        charstring		sipDate
      }
      
      // [20.18]
      type record ErrorInfo
      {
        FieldName		fieldName (ERROR_INFO_E),
        ErrorInfoBody_List	errorInfo optional
      }
      
      // [20.19]
      type record Expires
      {
        FieldName		fieldName (EXPIRES_E),
        DeltaSec		deltaSec
      }
      
      // [20.20]
      type record From
      {
        FieldName		fieldName (FROM_E),
        Addr_Union    	addressField,
        SemicolonParam_List	fromParams optional
      }
      
      // [20.21]
      type record InReplyTo
      {
        FieldName		fieldName (IN_REPLY_TO_E),
        CallidString_List	callids
      }
      
      // [20.22]
      type record MaxForwards
      {
        FieldName		fieldName (MAX_FORWARDS_E),
        integer		forwards	// this field is represented as an integer
      }
      
      // [20.23]
      type record MinExpires
      {
        FieldName		fieldName (MIN_EXPIRES_E),
        DeltaSec		deltaSec
      }
      
      // [20.24 RFC2616 19.4.1]
      type record MimeVersion
      {
        FieldName		fieldName (MIME_VERSION_E),
        integer		majorNumber,	// this field is represented as an integer
        integer		minorNumber	// this field is represented as an integer
      }
      
      // [20.25]
      type record Organization
      {
        FieldName		fieldName (ORGANIZATION_E),
        charstring		organization
      }
      
      // [20.26]
      type record Priority
      {
        FieldName		fieldName (PRIORITY_E),
        charstring		priorityValue
      }
      
      // [20.27 RFC2616 14.33 RFC2617 1.2]
      type record ProxyAuthenticate
      {
        FieldName		fieldName (PROXY_AUTHENTICATE_E),
        Challenge		challenge
      }
      
      // [20.28 RFC2616 14.35 RFC2617 1.2]
      type record ProxyAuthorization
      {
        FieldName		fieldName (PROXY_AUTHORIZATION_E),
        Credentials		credentials
      }
      
      // [20.29]
      type record ProxyRequire
      {
        FieldName		fieldName (PROXY_REQUIRE_E),
        OptionTag_List	optionsTags
      }
      
      // [20.30]
      type record RecordRoute
      {
        FieldName		fieldName (RECORD_ROUTE_E),
        RouteBody_List	routeBody
      }
      
      // [20.31]
      type record ReplyTo
      {
        FieldName		fieldName (REPLY_TO_E),
        Addr_Union    	addressField,
        SemicolonParam_List	replyToParams optional
      }
      
      // [20.32]
      type record Require
      {
        FieldName		fieldName (REQUIRE_E),
        OptionTag_List	optionsTags
      }
      
      // [20.33]
      type record RetryAfter
      {
        FieldName		fieldName (RETRY_AFTER_E),
        DeltaSec    	deltaSec,
        charstring		comment optional,
        SemicolonParam_List	retryParams optional
      }
      
      // [20.34]
      type record Route
      {
        FieldName		fieldName (ROUTE_E),
        RouteBody_List	routeBody
      }
      
      // [20.35 RFC2616 14.38]
      type record Server
      {
        FieldName		fieldName (SERVER_E),
        ServerVal_List	serverBody
      }
      
      // [20.36]
      type record Subject
      {
        FieldName		fieldName (SUBJECT_E),
        charstring		summary
      }
      
      // [20.37]
      type record Supported
      {
        FieldName		fieldName (SUPPORTED_E),
        OptionTag_List	optionsTags optional
      }
      
      // [20.38]
      type record Timestamp
      {
        FieldName		fieldName (TIMESTAMP_E),
        TimeValue		timeValue optional,
        TimeValue		delay optional
      }
      
      // [20.39]
      type record To
      {
        FieldName		fieldName (TO_E),
        Addr_Union      	addressField,
        SemicolonParam_List	toParams optional
      }
      
      // [20.40]
      type record Unsupported
      {
        FieldName		fieldName (UNSUPPORTED_E),
        OptionTag_List		optionsTags
      }
      
      // Undefined header field
      type record UndefinedHeader
      {
        charstring		headerName,
        charstring		headerValue
      }
      
      type set of UndefinedHeader UndefinedHeader_List;
      
      // [20.41 RFC2616 14.43]
      type record UserAgent
      {
        FieldName		fieldName (USER_AGENT_E),
        ServerVal_List 	userAgentBody
      }