📄 megaco_per_bin_media_gateway_control_v1.erl
字号:
'dec_PackagesDescriptor'(Bytes,_) ->{Num,Bytes1} = ?RT_PER:decode_length(Bytes,undefined),'dec_PackagesDescriptor_components'(Num, Bytes1, telltype, []).'dec_PackagesDescriptor_components'(0, Bytes, _, Acc) -> {lists:reverse(Acc), Bytes};'dec_PackagesDescriptor_components'(Num, Bytes, _, Acc) -> {Term,Remain} = 'dec_PackagesItem'(Bytes,telltype), 'dec_PackagesDescriptor_components'(Num-1, Remain, telltype, [Term|Acc]).'enc_ServiceChangeProfile'(Val) ->Val1 = ?RT_PER:list_to_record('ServiceChangeProfile', Val),[%% attribute number 1 with type IA5String?RT_PER:encode_IA5String([{'SizeConstraint',{1,67}}],?RT_PER:cindex(2,Val1,profileName))].'dec_ServiceChangeProfile'(Bytes,_) ->%% attribute number 1 with type IA5String{Term1,Bytes1} = ?RT_PER:decode_IA5String(Bytes,[{'SizeConstraint',{1,67}}]),{{'ServiceChangeProfile',Term1},Bytes1}.'enc_ServiceChangeMethod'({'ServiceChangeMethod',Val}) ->'enc_ServiceChangeMethod'(Val);'enc_ServiceChangeMethod'(Val) ->case (case Val of {_,_}->element(2,Val);_->Val end) of'failover' -> [{bit,0},?RT_PER:encode_integer([{'ValueRange',{0,5}}], 0)];'forced' -> [{bit,0},?RT_PER:encode_integer([{'ValueRange',{0,5}}], 1)];'graceful' -> [{bit,0},?RT_PER:encode_integer([{'ValueRange',{0,5}}], 2)];'restart' -> [{bit,0},?RT_PER:encode_integer([{'ValueRange',{0,5}}], 3)];'disconnected' -> [{bit,0},?RT_PER:encode_integer([{'ValueRange',{0,5}}], 4)];'handOff' -> [{bit,0},?RT_PER:encode_integer([{'ValueRange',{0,5}}], 5)];{asn1_enum,EnumV} when integer(EnumV), EnumV > 5 -> [{bit,1},?RT_PER:encode_small_number(EnumV)];EnumVal -> exit({error,{asn1, {enumerated_not_in_range, EnumVal}}})end.'dec_ServiceChangeMethod'(Bytes,_) ->?RT_PER:decode_enumerated(Bytes,[{'ValueRange',{0,5}}],{{failover,forced,graceful,restart,disconnected,handOff},{}}).'enc_ServiceChangeResParm'(Val) ->{Val1,Opt} = ?RT_PER:fixoptionals([2,3,4,5,6],5,Val),[?RT_PER:setext(false), Opt,case ?RT_PER:cindex(2,Val1,serviceChangeMgcId) ofasn1_NOVALUE -> [];Tmpval1 ->%% attribute number 1 with type Externaltypereference900megaco_per_bin_media_gateway_control_v1MId'enc_MId'(Tmpval1)end,case ?RT_PER:cindex(3,Val1,serviceChangeAddress) ofasn1_NOVALUE -> [];Tmpval2 ->%% attribute number 2 with type Externaltypereference901megaco_per_bin_media_gateway_control_v1ServiceChangeAddress'enc_ServiceChangeAddress'(Tmpval2)end,case ?RT_PER:cindex(4,Val1,serviceChangeVersion) ofasn1_NOVALUE -> [];Tmpval3 ->%% attribute number 3 with type INTEGER?RT_PER:encode_integer([{'ValueRange',{0,99}}],Tmpval3)end,case ?RT_PER:cindex(5,Val1,serviceChangeProfile) ofasn1_NOVALUE -> [];Tmpval4 ->%% attribute number 4 with type Externaltypereference903megaco_per_bin_media_gateway_control_v1ServiceChangeProfile'enc_ServiceChangeProfile'(Tmpval4)end,case ?RT_PER:cindex(6,Val1,timeStamp) ofasn1_NOVALUE -> [];Tmpval5 ->%% attribute number 5 with type Externaltypereference904megaco_per_bin_media_gateway_control_v1TimeNotation'enc_TimeNotation'(Tmpval5)end].'dec_ServiceChangeResParm'(Bytes,_) ->{Ext,Bytes1} = ?RT_PER:getext(Bytes),{Opt,Bytes2} = ?RT_PER:getoptionals2(Bytes1,5), %% attribute number 1 with type MId{Term1,Bytes3} = case Opt band (1 bsl 4) of_Opt1 when _Opt1 > 0 ->'dec_MId'(Bytes2,telltype);0 ->{asn1_NOVALUE,Bytes2}end,%% attribute number 2 with type ServiceChangeAddress{Term2,Bytes4} = case Opt band (1 bsl 3) of_Opt2 when _Opt2 > 0 ->'dec_ServiceChangeAddress'(Bytes3,telltype);0 ->{asn1_NOVALUE,Bytes3}end,%% attribute number 3 with type INTEGER{Term3,Bytes5} = case Opt band (1 bsl 2) of_Opt3 when _Opt3 > 0 ->?RT_PER:decode_integer(Bytes4,[{'ValueRange',{0,99}}]);0 ->{asn1_NOVALUE,Bytes4}end,%% attribute number 4 with type ServiceChangeProfile{Term4,Bytes6} = case Opt band (1 bsl 1) of_Opt4 when _Opt4 > 0 ->'dec_ServiceChangeProfile'(Bytes5,telltype);0 ->{asn1_NOVALUE,Bytes5}end,%% attribute number 5 with type TimeNotation{Term5,Bytes7} = case Opt band (1 bsl 0) of_Opt5 when _Opt5 > 0 ->'dec_TimeNotation'(Bytes6,telltype);0 ->{asn1_NOVALUE,Bytes6}end,{Extensions,Bytes8} = ?RT_PER:getextension(Ext,Bytes7),Bytes9= ?RT_PER:skipextensions(Bytes8,1,Extensions),{{'ServiceChangeResParm',Term1,Term2,Term3,Term4,Term5},Bytes9}.'enc_ServiceChangeAddress'({'ServiceChangeAddress',Val}) ->'enc_ServiceChangeAddress'(Val);'enc_ServiceChangeAddress'(Val) ->[?RT_PER:set_choice(element(1,Val),{[portNumber,ip4Address,ip6Address,domainName,deviceName,mtpAddress],[]}, {6,0}),case element(1,Val) ofportNumber ->?RT_PER:encode_integer([{'ValueRange',{0,65535}}],element(2,Val));ip4Address ->'enc_IP4Address'(element(2,Val));ip6Address ->'enc_IP6Address'(element(2,Val));domainName ->'enc_DomainName'(element(2,Val));deviceName ->?RT_PER:encode_IA5String([{'SizeConstraint',{1,64}}],element(2,Val));mtpAddress ->?RT_PER:encode_octet_string([{'SizeConstraint',{2,4}}],element(2,Val))end].'dec_ServiceChangeAddress'(Bytes,_) ->{Ext,Bytes1} = ?RT_PER:getbit(Bytes),{Choice,Bytes2} = ?RT_PER:getchoice(Bytes1,6,Ext ),{Cname,{Val,NewBytes}} = case Choice + Ext*6 of0 -> {portNumber,?RT_PER:decode_integer(Bytes2,[{'ValueRange',{0,65535}}])};1 -> {ip4Address,'dec_IP4Address'(Bytes2,telltype)};2 -> {ip6Address,'dec_IP6Address'(Bytes2,telltype)};3 -> {domainName,'dec_DomainName'(Bytes2,telltype)};4 -> {deviceName,?RT_PER:decode_IA5String(Bytes2,[{'SizeConstraint',{1,64}}])};5 -> {mtpAddress,?RT_PER:decode_octet_string(Bytes2,[{'SizeConstraint',{2,4}}])};_ -> {asn1_ExtAlt, ?RT_PER:decode_open_type(Bytes2,[])}end,{{Cname,Val},NewBytes}.'enc_ServiceChangeParm'(Val) ->{Val1,Opt} = ?RT_PER:fixoptionals([3,4,5,7,8,9,10],7,Val),[?RT_PER:setext(false), Opt,%% attribute number 1 with type ENUMERATEDcase (case ?RT_PER:cindex(2,Val1,serviceChangeMethod) of {_,_}->element(2,?RT_PER:cindex(2,Val1,serviceChangeMethod));_->?RT_PER:cindex(2,Val1,serviceChangeMethod) end) of'failover' -> [{bit,0},?RT_PER:encode_integer([{'ValueRange',{0,5}}], 0)];'forced' -> [{bit,0},?RT_PER:encode_integer([{'ValueRange',{0,5}}], 1)];'graceful' -> [{bit,0},?RT_PER:encode_integer([{'ValueRange',{0,5}}], 2)];'restart' -> [{bit,0},?RT_PER:encode_integer([{'ValueRange',{0,5}}], 3)];'disconnected' -> [{bit,0},?RT_PER:encode_integer([{'ValueRange',{0,5}}], 4)];'handOff' -> [{bit,0},?RT_PER:encode_integer([{'ValueRange',{0,5}}], 5)];{asn1_enum,EnumV} when integer(EnumV), EnumV > 5 -> [{bit,1},?RT_PER:encode_small_number(EnumV)];EnumVal -> exit({error,{asn1, {enumerated_not_in_range, EnumVal}}})end,case ?RT_PER:cindex(3,Val1,serviceChangeAddress) ofasn1_NOVALUE -> [];Tmpval1 ->%% attribute number 2 with type Externaltypereference875megaco_per_bin_media_gateway_control_v1ServiceChangeAddress'enc_ServiceChangeAddress'(Tmpval1)end,case ?RT_PER:cindex(4,Val1,serviceChangeVersion) ofasn1_NOVALUE -> [];Tmpval2 ->%% attribute number 3 with type INTEGER?RT_PER:encode_integer([{'ValueRange',{0,99}}],Tmpval2)end,case ?RT_PER:cindex(5,Val1,serviceChangeProfile) ofasn1_NOVALUE -> [];Tmpval3 ->%% attribute number 4 with type Externaltypereference877megaco_per_bin_media_gateway_control_v1ServiceChangeProfile'enc_ServiceChangeProfile'(Tmpval3)end,%% attribute number 5 with type Externaltypereference878megaco_per_bin_media_gateway_control_v1Value'enc_Value'(?RT_PER:cindex(6,Val1,serviceChangeReason)),case ?RT_PER:cindex(7,Val1,serviceChangeDelay) ofasn1_NOVALUE -> [];Tmpval4 ->%% attribute number 6 with type INTEGER?RT_PER:encode_integer([{'ValueRange',{0,4294967295}}],Tmpval4)end,case ?RT_PER:cindex(8,Val1,serviceChangeMgcId) ofasn1_NOVALUE -> [];Tmpval5 ->%% attribute number 7 with type Externaltypereference881megaco_per_bin_media_gateway_control_v1MId'enc_MId'(Tmpval5)end,case ?RT_PER:cindex(9,Val1,timeStamp) ofasn1_NOVALUE -> [];Tmpval6 ->%% attribute number 8 with type Externaltypereference882megaco_per_bin_media_gateway_control_v1TimeNotation'enc_TimeNotation'(Tmpval6)end,case ?RT_PER:cindex(10,Val1,nonStandardData) ofasn1_NOVALUE -> [];Tmpval7 ->%% attribute number 9 with type Externaltypereference883megaco_per_bin_media_gateway_control_v1NonStandardData'enc_NonStandardData'(Tmpval7)end].'dec_ServiceChangeParm'(Bytes,_) ->{Ext,Bytes1} = ?RT_PER:getext(Bytes),{Opt,Bytes2} = ?RT_PER:getoptionals2(Bytes1,7), %% attribute number 1 with type ENUMERATED{Term1,Bytes3} = ?RT_PER:decode_enumerated(Bytes2,[{'ValueRange',{0,5}}],{{failover,forced,graceful,restart,disconnected,handOff},{}}),%% attribute number 2 with type ServiceChangeAddress{Term2,Bytes4} = case Opt band (1 bsl 6) of_Opt1 when _Opt1 > 0 ->'dec_ServiceChangeAddress'(Bytes3,telltype);0 ->{asn1_NOVALUE,Bytes3}end,%% attribute number 3 with type INTEGER{Term3,Bytes5} = case Opt band (1 bsl 5) of_Opt2 when _Opt2 > 0 ->?RT_PER:decode_integer(Bytes4,[{'ValueRange',{0,99}}]);0 ->{asn1_NOVALUE,Bytes4}end,%% attribute number 4 with type ServiceChangeProfile{Term4,Bytes6} = case Opt band (1 bsl 4) of_Opt3 when _Opt3 > 0 ->'dec_ServiceChangeProfile'(Bytes5,telltype);0 ->{asn1_NOVALUE,Bytes5}end,%% attribute number 5 with type Value{Term5,Bytes7} = 'dec_Value'(Bytes6,telltype),%% attribute number 6 with type INTEGER{Term6,Bytes8} = case Opt band (1 bsl 3) of_Opt4 when _Opt4 > 0 ->?RT_PER:decode_integer(Bytes7,[{'ValueRange',{0,4294967295}}]);0 ->{asn1_NOVALUE,Bytes7}end,%% attribute number 7 with type MId{Term7,Bytes9} = case Opt band (1 bsl 2) of_Opt5 when _Opt5 > 0 ->'dec_MId'(Bytes8,telltype);0 ->{asn1_NOVALUE,Bytes8}end,%% attribute number 8 with type TimeNotation{Term8,Bytes10} = case Opt band (1 bsl 1) of_Opt6 when _Opt6 > 0 ->'dec_TimeNotation'(Bytes9,telltype);0 ->{asn1_NOVALUE,Bytes9}end,%% attribute number 9 with type NonStandardData{Term9,Bytes11} = case Opt band (1 bsl 0) of_Opt7 when _Opt7 > 0 ->'dec_NonStandardData'(Bytes10,telltype);0 ->{asn1_NOVALUE,Bytes10}end,{Extensions,Bytes12} = ?RT_PER:getextension(Ext,Bytes11),Bytes13= ?RT_PER:skipextensions(Bytes12,1,Extensions),{{'ServiceChangeParm',Term1,Term2,Term3,Term4,Term5,Term6,Term7,Term8,Term9},Bytes13}.'enc_DigitMapValue'(Val) ->{Val1,Opt} = ?RT_PER:fixoptionals([2,3,4],3,Val),[?RT_PER:setext(false), Opt,case ?RT_PER:cindex(2,Val1,startTimer) ofasn1_NOVALUE -> [];Tmpval1 ->%% attribute number 1 with type INTEGER?RT_PER:encode_integer([{'ValueRange',{0,99}}],Tmpval1)end,case ?RT_PER:cindex(3,Val1,shortTimer) ofasn1_NOVALUE -> [];Tmpval2 ->%% attribute number 2 with type INTEGER?RT_PER:encode_integer([{'ValueRange',{0,99}}],Tmpval2)end,case ?RT_PER:cindex(4,Val1,longTimer) ofasn1_NOVALUE -> [];Tmpval3 ->%% attribute number 3 with type INTEGER?RT_PER:encode_integer([{'ValueRange',{0,99}}],Tmpval3)end,%% attribute number 4 with type IA5String?RT_PER:encode_IA5String([],?RT_PER:cindex(5,Val1,digitMapBody))].'dec_DigitMapValue'(Bytes,_) ->{Ext,Bytes1} = ?RT_PER:getext(Bytes),{Opt,Bytes2} = ?RT_PER:getoptionals2(Bytes1,3), %% attribute number 1 with type INTEGER{Term1,Bytes3} = case Opt band (1 bsl 2) of_Opt1 when _Opt1 > 0 ->?RT_PER:decode_integer(Bytes2,[{'ValueRange',{0,99}}]);0 ->{asn1_NOVALUE,Bytes2}end,%% attribute number 2 with type INTEGER{Term2,Bytes4} = case Opt band (1 bsl 1) of_Opt2 when _Opt2 > 0 ->?RT_PER:decode_integer(Bytes3,[{'ValueRange',{0,99}}]);0 ->{asn1_NOVALUE,Bytes3}end,%% attribute number 3 with type INTEGER{Term3,Bytes5} = case Opt band (1 bsl 0) of_Opt3 when _Opt3 > 0 ->?RT_PER:decode_integer(Bytes4,[{'ValueRange',{0,99}}]);0 ->{asn1_NOVALUE,Bytes4}end,%% attribute number 4 with type IA5String{Term4,Bytes6} = ?RT_PER:decode_IA5String(Bytes5,[]),{Extensions,Bytes7} = ?RT_PER:getextension(Ext,Bytes6),Bytes8= ?RT_PER:skipextensions(Bytes7,1,Extensions),{{'DigitMapValue',Term1,Term2,Term3,Term4},Bytes8}.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -