📄 megaco_ber_media_gateway_control_prev3b.erl
字号:
'dec_ServiceChangeResParm'(Bytes, OptOrMand, TagIn) -> %%------------------------------------------------- %% decode tag and length %%------------------------------------------------- {{_,Len},Bytes1,Rb1} = ?RT_BER:check_tags(TagIn ++ [{tag,0,16,'IMPLICIT',32}], Bytes, OptOrMand), {Bytes2,RemBytes} = ?RT_BER:split_list(Bytes1,Len),%%-------------------------------------------------%% attribute number 1 External megaco_ber_media_gateway_control_prev3b:MId OPTIONAL%%------------------------------------------------- {Term1,Bytes3,Rb2} = case Bytes2 of<<2:2,_:1,0:5,_/binary>> ->'dec_MId'(Bytes2, opt_or_default, [{tag,128,0,'EXPLICIT',32}]);_ ->{ asn1_NOVALUE, Bytes2, 0 }end,%%-------------------------------------------------%% attribute number 2 External megaco_ber_media_gateway_control_prev3b:ServiceChangeAddress OPTIONAL%%------------------------------------------------- {Term2,Bytes4,Rb3} = case Bytes3 of<<2:2,_:1,1:5,_/binary>> ->'dec_ServiceChangeAddress'(Bytes3, opt_or_default, [{tag,128,1,'EXPLICIT',32}]);_ ->{ asn1_NOVALUE, Bytes3, 0 }end,%%-------------------------------------------------%% attribute number 3 with type INTEGER OPTIONAL%%------------------------------------------------- {Term3,Bytes5,Rb4} = case Bytes4 of<<2:2,_:1,2:5,_/binary>> ->?RT_BER:decode_integer(Bytes4,{0,99},[{tag,128,2,'IMPLICIT',0}], mandatory);_ ->{ asn1_NOVALUE, Bytes4, 0 }end,%%-------------------------------------------------%% attribute number 4 External megaco_ber_media_gateway_control_prev3b:ServiceChangeProfile OPTIONAL%%------------------------------------------------- {Term4,Bytes6,Rb5} = case Bytes5 of<<2:2,_:1,3:5,_/binary>> ->'dec_ServiceChangeProfile'(Bytes5, opt_or_default, [{tag,128,3,'IMPLICIT',0}]);_ ->{ asn1_NOVALUE, Bytes5, 0 }end,%%-------------------------------------------------%% attribute number 5 External megaco_ber_media_gateway_control_prev3b:TimeNotation OPTIONAL%%------------------------------------------------- {Term5,Bytes7,Rb6} = case Bytes6 of<<2:2,_:1,4:5,_/binary>> ->'dec_TimeNotation'(Bytes6, opt_or_default, [{tag,128,4,'IMPLICIT',0}]);_ ->{ asn1_NOVALUE, Bytes6, 0 }end, {Bytes8,Rb7} = ?RT_BER:restbytes2(RemBytes, Bytes7,ext), {{'ServiceChangeResParm', Term1, Term2, Term3, Term4, Term5}, Bytes8, Rb1+Rb2+Rb3+Rb4+Rb5+Rb6+Rb7}.%%================================%% ServiceChangeAddress%%================================'enc_ServiceChangeAddress'({'ServiceChangeAddress',Val}, TagIn) -> 'enc_ServiceChangeAddress'(Val, TagIn);'enc_ServiceChangeAddress'(Val, TagIn) -> {EncBytes,EncLen} = case element(1,Val) of portNumber -> ?RT_BER:encode_integer([], element(2,Val), [{tag,128,0,'IMPLICIT',0}]); ip4Address -> 'enc_IP4Address'(element(2,Val), [{tag,128,1,'IMPLICIT',0}]); ip6Address -> 'enc_IP6Address'(element(2,Val), [{tag,128,2,'IMPLICIT',0}]); domainName -> 'enc_DomainName'(element(2,Val), [{tag,128,3,'IMPLICIT',0}]); deviceName -> ?RT_BER:encode_restricted_string([], element(2,Val), 22, [{tag,128,4,'IMPLICIT',0}]); mtpAddress -> ?RT_BER:encode_octet_string([], element(2,Val), [{tag,128,5,'IMPLICIT',0}]); Else -> exit({error,{asn1,{invalid_choice_type,Else}}}) end,?RT_BER:encode_tags(TagIn ++[], EncBytes, EncLen).'dec_ServiceChangeAddress'(Bytes, OptOrMand) -> 'dec_ServiceChangeAddress'(Bytes, OptOrMand, []).'dec_ServiceChangeAddress'(Bytes, OptOrMand, TagIn) -> {{_,Len},Bytes1, RbExp} = ?RT_BER:check_tags(TagIn++[], Bytes, OptOrMand), IndefEndBytes = fun(indefinite,<<0,0,R/binary>>)-> R; (_,B)-> B end, IndefEndRb = fun(indefinite,<<0,0,_R/binary>>)-> 2; (_,_)-> 0 end, case Bytes1 of%% 'portNumber' <<2:2,_:1,0:5,_/binary>> -> {Dec, Rest, RbCho} = ?RT_BER:decode_integer(Bytes1,{0,65535},[{tag,128,0,'IMPLICIT',0}], mandatory), {{portNumber, Dec}, IndefEndBytes(Len,Rest), RbExp + RbCho + IndefEndRb(Len,Rest)};%% 'ip4Address' <<2:2,_:1,1:5,_/binary>> -> {Dec, Rest, RbCho} = 'dec_IP4Address'(Bytes1, mandatory, [{tag,128,1,'IMPLICIT',0}]), {{ip4Address, Dec}, IndefEndBytes(Len,Rest), RbExp + RbCho + IndefEndRb(Len,Rest)};%% 'ip6Address' <<2:2,_:1,2:5,_/binary>> -> {Dec, Rest, RbCho} = 'dec_IP6Address'(Bytes1, mandatory, [{tag,128,2,'IMPLICIT',0}]), {{ip6Address, Dec}, IndefEndBytes(Len,Rest), RbExp + RbCho + IndefEndRb(Len,Rest)};%% 'domainName' <<2:2,_:1,3:5,_/binary>> -> {Dec, Rest, RbCho} = 'dec_DomainName'(Bytes1, mandatory, [{tag,128,3,'IMPLICIT',0}]), {{domainName, Dec}, IndefEndBytes(Len,Rest), RbExp + RbCho + IndefEndRb(Len,Rest)};%% 'deviceName' <<2:2,_:1,4:5,_/binary>> -> {Dec, Rest, RbCho} = ?RT_BER:decode_restricted_string(Bytes1,{1,64},22,[{tag,128,4,'IMPLICIT',0}], no_length, mandatory), {{deviceName, Dec}, IndefEndBytes(Len,Rest), RbExp + RbCho + IndefEndRb(Len,Rest)};%% 'mtpAddress' <<2:2,_:1,5:5,_/binary>> -> {Dec, Rest, RbCho} = ?RT_BER:decode_octet_string(Bytes1,{2,4},[{tag,128,5,'IMPLICIT',0}], no_length, mandatory), {{mtpAddress, Dec}, IndefEndBytes(Len,Rest), RbExp + RbCho + IndefEndRb(Len,Rest)}; _ -> {{asn1_ExtAlt,Bytes1},<<>>, RbExp} end.%%================================%% ServiceChangeParm%%================================'enc_ServiceChangeParm'(Val, TagIn) ->%%-------------------------------------------------%% attribute number 1 with type ENUMERATED%%------------------------------------------------- {EncBytes1,EncLen1} = case (case ?RT_BER:cindex(2,Val,serviceChangeMethod) of {asn1_enum,_}->?RT_BER:cindex(2,Val,serviceChangeMethod);{_,_}->element(2,?RT_BER:cindex(2,Val,serviceChangeMethod));_->?RT_BER:cindex(2,Val,serviceChangeMethod) end) offailover -> ?RT_BER:encode_enumerated(0,[{tag,128,0,'IMPLICIT',0}]);forced -> ?RT_BER:encode_enumerated(1,[{tag,128,0,'IMPLICIT',0}]);graceful -> ?RT_BER:encode_enumerated(2,[{tag,128,0,'IMPLICIT',0}]);restart -> ?RT_BER:encode_enumerated(3,[{tag,128,0,'IMPLICIT',0}]);disconnected -> ?RT_BER:encode_enumerated(4,[{tag,128,0,'IMPLICIT',0}]);handOff -> ?RT_BER:encode_enumerated(5,[{tag,128,0,'IMPLICIT',0}]);{asn1_enum,Enumval1} -> ?RT_BER:encode_enumerated(Enumval1,[{tag,128,0,'IMPLICIT',0}]);Enumval2 -> exit({error,{asn1, {enumerated_not_in_range,Enumval2}}})end,%%-------------------------------------------------%% attribute number 2 External megaco_ber_media_gateway_control_prev3b:ServiceChangeAddress OPTIONAL%%------------------------------------------------- {EncBytes2,EncLen2} = case ?RT_BER:cindex(3,Val,serviceChangeAddress) of asn1_NOVALUE -> {<<>>,0}; _ -> 'enc_ServiceChangeAddress'(?RT_BER:cindex(3,Val,serviceChangeAddress), [{tag,128,1,'EXPLICIT',32}]) end,%%-------------------------------------------------%% attribute number 3 with type INTEGER OPTIONAL%%------------------------------------------------- {EncBytes3,EncLen3} = case ?RT_BER:cindex(4,Val,serviceChangeVersion) of asn1_NOVALUE -> {<<>>,0}; _ -> ?RT_BER:encode_integer([], ?RT_BER:cindex(4,Val,serviceChangeVersion), [{tag,128,2,'IMPLICIT',0}]) end,%%-------------------------------------------------%% attribute number 4 External megaco_ber_media_gateway_control_prev3b:ServiceChangeProfile OPTIONAL%%------------------------------------------------- {EncBytes4,EncLen4} = case ?RT_BER:cindex(5,Val,serviceChangeProfile) of asn1_NOVALUE -> {<<>>,0}; _ -> 'enc_ServiceChangeProfile'(?RT_BER:cindex(5,Val,serviceChangeProfile), [{tag,128,3,'IMPLICIT',0}]) end,%%-------------------------------------------------%% attribute number 5 External megaco_ber_media_gateway_control_prev3b:Value%%------------------------------------------------- {EncBytes5,EncLen5} = 'enc_Value'(?RT_BER:cindex(6,Val,serviceChangeReason), [{tag,128,4,'IMPLICIT',0}]),%%-------------------------------------------------%% attribute number 6 with type INTEGER OPTIONAL%%------------------------------------------------- {EncBytes6,EncLen6} = case ?RT_BER:cindex(7,Val,serviceChangeDelay) of asn1_NOVALUE -> {<<>>,0}; _ -> ?RT_BER:encode_integer([], ?RT_BER:cindex(7,Val,serviceChangeDelay), [{tag,128,5,'IMPLICIT',0}]) end,%%-------------------------------------------------%% attribute number 7 External megaco_ber_media_gateway_control_prev3b:MId OPTIONAL%%------------------------------------------------- {EncBytes7,EncLen7} = case ?RT_BER:cindex(8,Val,serviceChangeMgcId) of asn1_NOVALUE -> {<<>>,0}; _ -> 'enc_MId'(?RT_BER:cindex(8,Val,serviceChangeMgcId), [{tag,128,6,'EXPLICIT',32}]) end,%%-------------------------------------------------%% attribute number 8 External megaco_ber_media_gateway_control_prev3b:TimeNotation OPTIONAL%%------------------------------------------------- {EncBytes8,EncLen8} = case ?RT_BER:cindex(9,Val,timeStamp) of asn1_NOVALUE -> {<<>>,0}; _ -> 'enc_TimeNotation'(?RT_BER:cindex(9,Val,timeStamp), [{tag,128,7,'IMPLICIT',0}]) end,%%-------------------------------------------------%% attribute number 9 External megaco_ber_media_gateway_control_prev3b:NonStandardData OPTIONAL%%------------------------------------------------- {EncBytes9,EncLen9} = case ?RT_BER:cindex(10,Val,nonStandardData) of asn1_NOVALUE -> {<<>>,0}; _ -> 'enc_NonStandardData'(?RT_BER:cindex(10,Val,nonStandardData), [{tag,128,8,'IMPLICIT',0}]) end,%%-------------------------------------------------%% attribute number 10 External megaco_ber_media_gateway_control_prev3b:AuditDescriptor OPTIONAL%%------------------------------------------------- {EncBytes10,EncLen10} = case ?RT_BER:cindex(11,Val,serviceChangeInfo) of asn1_NOVALUE -> {<<>>,0}; _ -> 'enc_AuditDescriptor'(?RT_BER:cindex(11,Val,serviceChangeInfo), [{tag,128,9,'IMPLICIT',0}]) end,%%-------------------------------------------------%% attribute number 11 with type NULL OPTIONAL%%------------------------------------------------- {EncBytes11,EncLen11} = case ?RT_BER:cindex(12,Val,serviceChangeIncompleteFlag) of asn1_NOVALUE -> {<<>>,0}; _ -> ?RT_BER:encode_null(?RT_BER:cindex(12,Val,serviceChangeIncompleteFlag), [{tag,128,10,'IMPLICIT',0}]) end, BytesSoFar = [EncBytes1, EncBytes2, EncBytes3, EncBytes4, EncBytes5, EncBytes6, EncBytes7, EncBytes8, EncBytes9, EncBytes10, EncBytes11], LenSoFar = EncLen1 + EncLen2 + EncLen3 + EncLen4 + EncLen5 + EncLen6 + EncLen7 + EncLen8 + EncLen9 + EncLen10 + EncLen11, ?RT_BER:encode_tags(TagIn ++ [{tag,0,16,'IMPLICIT',32}], BytesSoFar, LenSoFar).'dec_ServiceChangeParm'(Bytes, OptOrMand) -> 'dec_ServiceChangeParm'(Bytes, OptOrMand, []).'dec_ServiceChangeParm'(Bytes, OptOrMand, TagIn) -> %%------------------------------------------------- %% decode tag and length %%------------------------------------------------- {{_,Len},Bytes1,Rb1} = ?RT_BER:check_tags(TagIn ++ [{tag,0,16,'IMPLICIT',32}], Bytes, OptOrMand), {Bytes2,RemBytes} = ?RT_BER:split_list(Bytes1,Len),%%-------------------------------------------------%% attribute number 1 with type ENUMERATED%%------------------------------------------------- {Term1,Bytes3,Rb2} = ?RT_BER:decode_enumerated(Bytes2,[],{[{failover,0},{forced,1},{graceful,2},{restart,3},{disconnected,4},{handOff,5}],[]},[{tag,128,0,'IMPLICIT',0}], mandatory),%%-------------------------------------------------%% attribute number 2 External megaco_ber_media_gateway_control_prev3b:ServiceChangeAddress OPTIONAL%%------------------------------------------------- {Term2,Bytes4,Rb3} = case Bytes3 of<<2:2,_:1,1:5,_/binary>> ->'dec_ServiceChangeAddress'(Bytes3, opt_or_default, [{tag,128,1,'EXPLICIT',32}]);_ ->{ asn1_NOVALUE, Bytes3, 0 }end,%%-------------------------------------------------%% attribute number 3 with type INTEGER OPTIONAL%%------------------------------------------------- {Term3,Bytes5,Rb4} = case Bytes4 of<<2:2,_:1,2:5,_/binary>> ->?RT_BER:decode_integer(Bytes4,{0,99},[{tag,128,2,'IMPLICIT',0}], mandatory);_ ->{ asn1_NOVALUE, Bytes4, 0 }end,%%-------------------------------------------------%% attribute number 4 External megaco_ber_media_gateway_control_prev3b:ServiceChangeProfile OPTIONAL%%------------------------------------------------- {Term4,Bytes6,Rb5} = case Bytes5 of<<2:2,_:1,3:5,_/binary>> ->'dec_ServiceChangeProfile'(Bytes5, opt_or_default, [{tag,128,3,'IMPLICIT',0}]);_ ->{ asn1_NOVALUE, Bytes5, 0 }end,%%-------------------------------------------------%% attribute number 5 External megaco_ber_media_gateway_control_prev3b:Value%%------------------------------------------------- {Term5,Bytes7,Rb6} = 'dec_Value'(Bytes6, mandatory, [{tag,128,4,'IMPLICIT',0}]),%%-------------------------------------------------%% attribute number 6 with type INTEGER OPTIONAL%%------------------------------------------------- {Term6,Bytes8,Rb7} = case Bytes7 of<<2:2,_:1,5:5,_/binary>> ->?RT_BER:decode_integer(Byt
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -