📄 megaco_ber_media_gateway_control_v1.erl
字号:
%% '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_v1: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_v1: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_v1: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_v1: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_v1: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_v1: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, BytesSoFar = [EncBytes1, EncBytes2, EncBytes3, EncBytes4, EncBytes5, EncBytes6, EncBytes7, EncBytes8, EncBytes9], LenSoFar = EncLen1 + EncLen2 + EncLen3 + EncLen4 + EncLen5 + EncLen6 + EncLen7 + EncLen8 + EncLen9, ?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_v1: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_v1: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_v1: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(Bytes7,{0,4294967295},[{tag,128,5,'IMPLICIT',0}], mandatory);_ ->{ asn1_NOVALUE, Bytes7, 0 }end,%%-------------------------------------------------%% attribute number 7 External megaco_ber_media_gateway_control_v1:MId OPTIONAL%%------------------------------------------------- {Term7,Bytes9,Rb8} = case Bytes8 of<<2:2,_:1,6:5,_/binary>> ->'dec_MId'(Bytes8, opt_or_default, [{tag,128,6,'EXPLICIT',32}]);_ ->{ asn1_NOVALUE, Bytes8, 0 }end,%%-------------------------------------------------%% attribute number 8 External megaco_ber_media_gateway_control_v1:TimeNotation OPTIONAL%%------------------------------------------------- {Term8,Bytes10,Rb9} = case Bytes9 of<<2:2,_:1,7:5,_/binary>> ->'dec_TimeNotation'(Bytes9, opt_or_default, [{tag,128,7,'IMPLICIT',0}]);_ ->{ asn1_NOVALUE, Bytes9, 0 }end,%%-------------------------------------------------%% attribute number 9 External megaco_ber_media_gateway_control_v1:NonStandardData OPTIONAL%%------------------------------------------------- {Term9,Bytes11,Rb10} = case Bytes10 of<<2:2,_:1,8:5,_/binary>> ->'dec_NonStandardData'(Bytes10, opt_or_default, [{tag,128,8,'IMPLICIT',0}]);_ ->{ asn1_NOVALUE, Bytes10, 0 }end, {Bytes12,Rb11} = ?RT_BER:restbytes2(RemBytes, Bytes11,ext), {{'ServiceChangeParm', Term1, Term2, Term3, Term4, Term5, Term6, Term7, Term8, Term9}, Bytes12, Rb1+Rb2+Rb3+Rb4+Rb5+Rb6+Rb7+Rb8+Rb9+Rb10+Rb11}.%%================================%% DigitMapValue%%================================'enc_DigitMapValue'(Val, TagIn) ->%%-------------------------------------------------%% attribute number 1 with type INTEGER OPTIONAL%%------------------------------------------------- {EncBytes1,EncLen1} = case ?RT_BER:cindex(2,Val,startTimer) of asn1_NOVALUE -> {<<>>,0}; _ -> ?RT_BER:encode_integer([], ?RT_BER:cindex(2,Val,startTimer), [{tag,128,0,'IMPLICIT',0}]) end,%%-------------------------------------------------%% attribute number 2 with type INTEGER OPTIONAL%%------------------------------------------------- {EncBytes2,EncLen2} = case ?RT_BER:cindex(3,Val,shortTimer) of asn1_NOVALUE -> {<<>>,0}; _ -> ?RT_BER:encode_integer([], ?RT_BER:cindex(3,Val,shortTimer), [{tag,128,1,'IMPLICIT',0}]) end,%%-------------------------------------------------%% attribute number 3 with type INTEGER OPTIONAL%%------------------------------------------------- {EncBytes3,EncLen3} = case ?RT_BER:cindex(4,Val,longTimer) of asn1_NOVALUE -> {<<>>,0}; _ -> ?RT_BER:encode_integer([], ?RT_BER:cindex(4,Val,longTimer), [{tag,128,2,'IMPLICIT',0}]) end,%%-------------------------------------------------%% attribute number 4 with type IA5String%%------------------------------------------------- {EncBytes4,EncLen4} = ?RT_BER:encode_restricted_string([], ?RT_BER:cindex(5,Val,digitMapBody), 22, [{tag,128,3,'IMPLICIT',0}]), BytesSoFar = [EncBytes1, EncBytes2, EncBytes3, EncBytes4], LenSoFar = EncLen1 + EncLen2 + EncLen3 + EncLen4, ?RT_BER:encode_tags(TagIn ++ [{tag,0,16,'IMPLICIT',32}], BytesSoFar, LenSoFar).'dec_DigitMapValue'(Bytes, OptOrMand) -> 'dec_DigitMapValue'(Bytes, OptOrMand, []).'dec_DigitMapValue'(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 INTEGER OPTIONAL%%------------------------------------------------- {Term1,Bytes3,Rb2} = case Bytes2 of<<2:2,_:1,0:5,_/binary>> ->?RT_BER:decode_integer(Bytes2,{0,99},[{tag,128,0,'IMPLICIT',0}], mandatory);_ ->{ asn1_NOVALUE, Bytes2, 0 }end,%%-------------------------------------------------%% attribute number 2 with type INTEGER OPTIONAL%%------------------------------------------------- {Term2,Bytes4,Rb3} = case Bytes3 of<<2:2,_:1,1:5,_/binary>> ->?RT_BER:decode_integer(Bytes3,{0,99},[{tag,128,1,'IMPLICIT',0}], mandatory);_ ->{ 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 with type IA5String%%------------------------------------------------- {Term4,Bytes6,Rb5} = ?RT_BER:decode_restricted_string(Bytes5,[],22,[{tag,128,3,'IMPLICIT',0}], no_length, mandatory), {Bytes7,Rb6} = ?RT_BER:restbytes2(RemBytes, Bytes6,ext), {{'DigitMapValue', Term1, Term2, Term3, Term4}, Bytes7, Rb1+Rb2+Rb3+Rb4+Rb5+Rb6}.%%================================%% DigitMapName%%================================'enc_DigitMapName'({'DigitMapName',Val}, TagIn) -> 'enc_DigitMapName'(Val, TagIn);'enc_DigitMapName'(Val, TagIn) ->?RT_BER:encode_octet_string([], Val, TagIn ++ []).'dec_DigitMapName'(Bytes, OptOrMand) -> 'dec_DigitMapName'(Bytes, OptOrMand, []).'dec_DigitMapName'(Bytes, OptOrMand, TagIn) ->?RT_BER:decode_octet_string(Bytes,2,TagIn++[], no_length, OptOrMand).%%================================%% DigitMapDescriptor%%================================'enc_DigitMapDescriptor'(Val, TagIn) ->%%-------------------------------------------------%% attribute number 1 with type OCTET STRING OPTIONAL%%------------------------------------------------- {EncBytes1,EncLen1} = case ?RT_BER:cindex(2,Val,digitMapName) of asn1_NOVALUE ->
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -