⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 megaco_binary_name_resolver_v1.erl

📁 OTP是开放电信平台的简称
💻 ERL
📖 第 1 页 / 共 4 页
字号:
%%----------------------------------------------------------------------%% Name:    ct - Basic Continuity Package%% Version: 1%% Extends: None%% Purpose: This package defines events and signals for continuity test.%%          The continuity test includes provision of either a loopback%%          or transceiver functionality.%%----------------------------------------------------------------------capabilities_ct() ->    [     {event,  "cmp"},     {signal, "ct"},     {signal, "rsp"}    ].encode_ct(event, Item) ->    case Item of	"cmp" -> [16#00, 16#05]    end;encode_ct({event_parameter, Item}, SubItem) ->    case Item of        "cmp" ->            case SubItem of                "res" -> [16#00, 16#08]            end    end;encode_ct(signal, Item) ->    case Item of	"ct"  -> [16#00, 16#03];	"rsp" -> [16#00, 16#04]    end.decode_ct(event, Item) ->    case Item of	[16#00, 16#05] -> "cmp"    end;decode_ct({event_parameter, Item}, SubItem) ->    case Item of        [16#00, 16#05] -> % Event cmp            case SubItem of                [16#00, 16#08] -> "res"            end    end;decode_ct(signal, Item) ->    case Item of	[16#00, 16#03] -> "ct";	[16#00, 16#04] -> "rsp"    end.%%----------------------------------------------------------------------%% Name:    nt - Network Package%% Version: 1%% Extends: None%% Purpose: This package defines properties of network terminations%%          independent of network type.%%----------------------------------------------------------------------capabilities_nt() ->    [     {property,   "jit"},     {event,      "netfail"},     {event,      "qualert"},     {statistics, "dur"},     {statistics, "os"},     {statistics, "or"}    ].encode_nt(property, Item) ->    case Item of	"jit" -> [16#00, 16#07]    end;encode_nt(event, Item) ->    case Item of	"netfail" -> [16#00, 16#05];	"qualert" -> [16#00, 16#06]    end;encode_nt({event_parameter, Item}, SubItem) ->    case Item of        "netfail" ->            case SubItem of                "cs" -> [16#00, 16#01]            end;        "qualert" ->            case SubItem of                "th"  -> [16#00, 16#01]            end    end;encode_nt(statistics, Item) ->    case Item of	"dur" -> [16#00, 16#01];	"os"  -> [16#00, 16#02];	"or"  -> [16#00, 16#03]    end.decode_nt(property, Item) ->    case Item of	[16#00, 16#07] -> "jit"    end;decode_nt(event, Item) ->    case Item of	[16#00, 16#05] -> "netfail";	[16#00, 16#06] -> "qualert"    end;decode_nt({event_parameter, Item}, SubItem) ->    case Item of        [16#00, 16#05] -> % Event netfail            case SubItem of                [16#00, 16#01] -> "cs"            end;        [16#00, 16#06] -> % Event qualert            case Item of                [16#00, 16#01] -> "th"            end	end;decode_nt(statistics, Item) ->    case Item of	[16#00, 16#01] -> "dur";	[16#00, 16#02] -> "os";	[16#00, 16#03] -> "or"    end.%%----------------------------------------------------------------------%% Name:    rtp - RTP Package%% Version: 1%% Extends: nt version 1%% Purpose: This package is used to support packet based multimedia%%          data transfer by means of the Real-time Transport Protocol%%          (RTP) [RFC 1889].%%----------------------------------------------------------------------capabilities_rtp() ->    [     {event,      "pltrans"},     {statistics, "ps"},     {statistics, "pr"},     {statistics, "pl"},     {statistics, "jit"},     {statistics, "delay"}    ].encode_rtp(event, Item) ->    case Item of	"pltrans" -> [16#00, 16#01]    end;encode_rtp({event_parameter, Item}, SubItem) ->    case Item of        "pltrans" ->            case SubItem of                "rtppltype" -> [16#00, 16#01]            end    end;encode_rtp(statistics, Item) ->    case Item of	"ps"    -> [16#00, 16#04];	"pr"    -> [16#00, 16#05];	"pl"    -> [16#00, 16#06];	"jit"   -> [16#00, 16#07];	"delay" -> [16#00, 16#08]    end.decode_rtp(event, Item) ->    case Item of	[16#00, 16#01] -> "pltrans"    end;decode_rtp({event_parameter, Item}, SubItem) ->    case Item of        [16#00, 16#01] -> % Event pltrans            case SubItem of                [16#00, 16#01] -> "rtppltype"            end    end;decode_rtp(statistics, Item) ->    case Item of	[16#00, 16#04] -> "ps";	[16#00, 16#05] -> "pr";	[16#00, 16#06] -> "pl";	[16#00, 16#07] -> "jit";	[16#00, 16#08] -> "delay"    end.%%----------------------------------------------------------------------%% Name:    tdmc - TDM Circuit Package%% Version: 1%% Extends: nt version 1%% Purpose: This package is used to support TDM circuit terminations.%%----------------------------------------------------------------------capabilities_tdmc() ->    [     {property, "ec"},     {property, "gain"}    ].encode_tdmc(Scope, Item) ->    case Scope of        property ->            case Item of                "ec"   -> [16#00, 16#08];                "gain" -> [16#00, 16#0a]            end    end.decode_tdmc(Scope, Item) ->    case Scope of        property ->            case Item of                [16#00, 16#08] -> "ec";                [16#00, 16#0a] -> "gain"            end    end.%%----------------------------------------------------------------------%% Name:    swb - SwitchBoard Package%% Version: 1%% Extends: none%% Purpose: This package is used to support SwitchBoard specials%%----------------------------------------------------------------------capabilities_swb() ->    [     {statistics, "fs"}, % Free slots     {statistics, "as"}  % Allocated slots    ].encode_swb(Scope, Item) ->    case Scope of        statistics ->            case Item of                "fs" -> [16#00, 16#00];                "as" -> [16#00, 16#01]            end    end.decode_swb(Scope, Item) ->    case Scope of        statistics ->            case Item of                [16#00, 16#00] -> "fs";                [16#00, 16#01] -> "as"            end    end.%%----------------------------------------------------------------------%% Name:  native -  Pseudo package  %% Version: 1%% Extends: None%% Purpose: Native tags for media stream properties%%%% Parameters for Local descriptors and Remote descriptors are%% specified as tag-value pairs if binary encoding is used for the%% protocol.  This annex contains the property names (PropertyID), the%% tags (Property Tag), type of the property (Type) and the values%% (Value).Values presented in the Value field when the field contains%% references shall be regarded as "information". The reference%% contains the normative values.  If a value field does not contain a%% reference then the values in that field can be considered as%% "normative".%% %% Tags are given as hexadecimal numbers in this annex. When setting%% the value of a property, a MGC may underspecify the value according%% to one of the mechanisms specified in section 7.1.1.%% %% For type "enumeration" the value is represented by the value in brack-%% ets, e.g., Send(0), Receive(1).%%----------------------------------------------------------------------%% %% C.6.  IP%% %%     ________________________________________________________________%%    | PropertyID|  Tag       |  Type        |  Value                |%%    | IPv4      |  6001      |  32 BITS     |  Ipv4Address          |%%    | IPv6      |  6002      |  128 BITS    |  IPv6 Address         |%%    | Port      |  6003      |  Unsigned Int|  Port                 |%%    | Porttype  |  6004      |  Enumerated  |  TCP(0),UDP(1),SCTP(2)|%%    |___________|____________|______________|_______________________|%%    %% %% C.11.  SDP Equivalents%% %%      ______________________________________________________________%%     | PropertyID|  Tag |  Type  |  Value                          |%%     | SDP_V     |  B001|  STRING|  Protocol Version               |%%     | SDP_O     |  B002|  STRING|  Owner-creator and session ID   |%%     | SDP_S     |  B003|  STRING|  Sesson name                    |%%     | SDP_I     |  B004|  STRING|  Session identifier             |%%     | SDP_U     |  B005|  STRING|  URI of descriptor              |%%     | SDC_E     |  B006|  STRING|  email address                  |%%     | SDP_P     |  B007|  STRING|  phone number                   |%%     | SDP_C     |  B008|  STRING|  Connection information         |%%     | SDP_B     |  B009|  STRING|  Bandwidth Information          |%%     | SDP_Z     |  B00A|  STRING|  time zone adjustment           |%%     | SDP_K     |  B00B|  STRING|  Encryption Key                 |%%     | SDP_A     |  B00C|  STRING|  Zero or more session attributes|%%     | SDP_T     |  B00D|  STRING|  Active Session Time            |%%     | SDP_R     |  B00E|  STRING|  Zero or more repeat times      |%%     | SDP_M     |  B00F|  STRING|  Media name and transport addr  |%%     |           |      |        |  Reference: IETF RFC 2327       |%%     |___________|______|________|_________________________________|%% %%----------------------------------------------------------------------capabilities_native() ->    [     %% C.6.  IP      {property, "IPv4"},     {property, "IPv6"},     {property, "Port"},     {property, "Porttype"},     %% C.11. SDP Equivalents     {property, "v"},     {property, "o"},     {property, "s"},     {property, "i"},     {property, "u"},     {property, "e"},     {property, "p"},     {property, "c"},     {property, "b"},     {property, "z"},     {property, "k"},     {property, "a"},     {property, "t"},     {property, "r"},     {property, "m"}    ].encode_native(Scope, Item) ->    case Scope of        property ->	    case Item of		%% IP		"IPv4"     -> [16#60, 16#01];		"IPv6"     -> [16#60, 16#02];		"Port"     -> [16#60, 16#03];		"Porttype" -> [16#60, 16#04];		%% SDP		"v" -> [16#b0, 16#01];		"o" -> [16#b0, 16#02];		"s" -> [16#b0, 16#03];		"i" -> [16#b0, 16#04];		"u" -> [16#b0, 16#05];		"e" -> [16#b0, 16#06];		"p" -> [16#b0, 16#07];		"c" -> [16#b0, 16#08];		"b" -> [16#b0, 16#09];		"z" -> [16#b0, 16#0a];		"k" -> [16#b0, 16#0b];		"a" -> [16#b0, 16#0c];		"t" -> [16#b0, 16#0d];		"r" -> [16#b0, 16#0e];		"m" -> [16#b0, 16#0f] 	    end    end.decode_native(Scope, [Type, Item]) ->    case Scope of        property ->            case Type of		16#60 ->		    case Item of			16#01 -> "IPv4";			16#02 -> "IPv6";			16#03 -> "Port";			16#04 -> "Porttype"		    end;                16#b0 ->		    case Item of			16#01 -> "v";			16#02 -> "o";			16#03 -> "s";			16#04 -> "i";			16#05 -> "u";			16#06 -> "e";			16#07 -> "p";			16#08 -> "c";			16#09 -> "b";			16#0a -> "z";			16#0b -> "k";			16#0c -> "a";			16#0d -> "t";			16#0e -> "r";			16#0f -> "m"		    end            end    end.%% -------------------------------------------------------------------% error(Reason) ->%     erlang:fault(Reason). 

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -