📄 megaco_ber_bin_drv_media_gateway_control_v1.erl
字号:
end,%%-------------------------------------------------%% attribute timeStamp(5) External megaco_ber_bin_drv_media_gateway_control_v1:TimeNotation OPTIONAL%%------------------------------------------------- {EncBytes5,EncLen5} = case Cindex5 of asn1_NOVALUE -> {<<>>,0}; _ -> 'enc_TimeNotation'(Cindex5, [<<164>>]) end, BytesSoFar = [EncBytes1, EncBytes2, EncBytes3, EncBytes4, EncBytes5],LenSoFar = EncLen1 + EncLen2 + EncLen3 + EncLen4 + EncLen5,?RT_BER:encode_tags(TagIn, BytesSoFar, LenSoFar).'dec_ServiceChangeResParm'(Tlv) -> 'dec_ServiceChangeResParm'(Tlv, [16]).'dec_ServiceChangeResParm'(Tlv, TagIn) -> %%------------------------------------------------- %% decode tag and length %%-------------------------------------------------Tlv1 = ?RT_BER:match_tags(Tlv,TagIn), %%-------------------------------------------------%% attribute serviceChangeMgcId(1) External megaco_ber_bin_drv_media_gateway_control_v1:MId OPTIONAL%%-------------------------------------------------{Term1,Tlv2} = case Tlv1 of[{131072,V1}|TempTlv2] -> {'dec_MId'(V1, []), TempTlv2}; _ -> { asn1_NOVALUE, Tlv1}end,%%-------------------------------------------------%% attribute serviceChangeAddress(2) External megaco_ber_bin_drv_media_gateway_control_v1:ServiceChangeAddress OPTIONAL%%-------------------------------------------------{Term2,Tlv3} = case Tlv2 of[{131073,V2}|TempTlv3] -> {'dec_ServiceChangeAddress'(V2, []), TempTlv3}; _ -> { asn1_NOVALUE, Tlv2}end,%%-------------------------------------------------%% attribute serviceChangeVersion(3) with type INTEGER OPTIONAL%%-------------------------------------------------{Term3,Tlv4} = case Tlv3 of[{131074,V3}|TempTlv4] -> {?RT_BER:decode_integer(V3,{0,99},[]), TempTlv4}; _ -> { asn1_NOVALUE, Tlv3}end,%%-------------------------------------------------%% attribute serviceChangeProfile(4) External megaco_ber_bin_drv_media_gateway_control_v1:ServiceChangeProfile OPTIONAL%%-------------------------------------------------{Term4,Tlv5} = case Tlv4 of[{131075,V4}|TempTlv5] -> {'dec_ServiceChangeProfile'(V4, []), TempTlv5}; _ -> { asn1_NOVALUE, Tlv4}end,%%-------------------------------------------------%% attribute timeStamp(5) External megaco_ber_bin_drv_media_gateway_control_v1:TimeNotation OPTIONAL%%-------------------------------------------------{Term5,Tlv6} = case Tlv5 of[{131076,V5}|TempTlv6] -> {'dec_TimeNotation'(V5, []), TempTlv6}; _ -> { asn1_NOVALUE, Tlv5}end,case Tlv6 of [] -> true; _ -> true end, % ... extra fields skipped {'ServiceChangeResParm', Term1, Term2, Term3, Term4, Term5}.%%================================%% ServiceChangeAddress%%================================'enc_ServiceChangeAddress'(Val) -> 'enc_ServiceChangeAddress'(Val, []).'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), [<<128>>]); ip4Address -> 'enc_IP4Address'(element(2,Val), [<<161>>]); ip6Address -> 'enc_IP6Address'(element(2,Val), [<<162>>]); domainName -> 'enc_DomainName'(element(2,Val), [<<163>>]); deviceName -> ?RT_BER:encode_restricted_string([], element(2,Val), 22, [<<132>>]); mtpAddress -> ?RT_BER:encode_octet_string([], element(2,Val), [<<133>>]); Else -> exit({error,{asn1,{invalid_choice_type,Else}}}) end,?RT_BER:encode_tags(TagIn, EncBytes, EncLen).'dec_ServiceChangeAddress'(Tlv) -> 'dec_ServiceChangeAddress'(Tlv, []).'dec_ServiceChangeAddress'(Tlv, TagIn) ->Tlv1 = ?RT_BER:match_tags(Tlv,TagIn), case (case Tlv1 of [CtempTlv1] -> CtempTlv1; _ -> Tlv1 end) of%% 'portNumber' {131072, V1} -> {portNumber, ?RT_BER:decode_integer(V1,{0,65535},[])};%% 'ip4Address' {131073, V1} -> {ip4Address, 'dec_IP4Address'(V1, [])};%% 'ip6Address' {131074, V1} -> {ip6Address, 'dec_IP6Address'(V1, [])};%% 'domainName' {131075, V1} -> {domainName, 'dec_DomainName'(V1, [])};%% 'deviceName' {131076, V1} -> {deviceName, ?RT_BER:decode_restricted_string(V1,{1,64},22,[])};%% 'mtpAddress' {131077, V1} -> {mtpAddress, ?RT_BER:decode_octet_string(V1,{2,4},[])}; Else -> {asn1_ExtAlt, ?RT_BER:encode(Else)} end.%%================================%% ServiceChangeParm%%================================'enc_ServiceChangeParm'(Val) -> 'enc_ServiceChangeParm'(Val, [<<48>>]).'enc_ServiceChangeParm'(Val, TagIn) ->{_,Cindex1, Cindex2, Cindex3, Cindex4, Cindex5, Cindex6, Cindex7, Cindex8, Cindex9} = Val,%%-------------------------------------------------%% attribute serviceChangeMethod(1) with type ENUMERATED%%------------------------------------------------- {EncBytes1,EncLen1} = case (case Cindex1 of {asn1_enum,_}->Cindex1;{_,_}->element(2,Cindex1);_->Cindex1 end) offailover -> ?RT_BER:encode_enumerated(0,[<<128>>]);forced -> ?RT_BER:encode_enumerated(1,[<<128>>]);graceful -> ?RT_BER:encode_enumerated(2,[<<128>>]);restart -> ?RT_BER:encode_enumerated(3,[<<128>>]);disconnected -> ?RT_BER:encode_enumerated(4,[<<128>>]);handOff -> ?RT_BER:encode_enumerated(5,[<<128>>]);{asn1_enum,Enumval1} -> ?RT_BER:encode_enumerated(Enumval1,[<<128>>]);Enumval2 -> exit({error,{asn1, {enumerated_not_in_range,Enumval2}}})end,%%-------------------------------------------------%% attribute serviceChangeAddress(2) External megaco_ber_bin_drv_media_gateway_control_v1:ServiceChangeAddress OPTIONAL%%------------------------------------------------- {EncBytes2,EncLen2} = case Cindex2 of asn1_NOVALUE -> {<<>>,0}; _ -> 'enc_ServiceChangeAddress'(Cindex2, [<<161>>]) end,%%-------------------------------------------------%% attribute serviceChangeVersion(3) with type INTEGER OPTIONAL%%------------------------------------------------- {EncBytes3,EncLen3} = case Cindex3 of asn1_NOVALUE -> {<<>>,0}; _ -> ?RT_BER:encode_integer([], Cindex3, [<<130>>]) end,%%-------------------------------------------------%% attribute serviceChangeProfile(4) External megaco_ber_bin_drv_media_gateway_control_v1:ServiceChangeProfile OPTIONAL%%------------------------------------------------- {EncBytes4,EncLen4} = case Cindex4 of asn1_NOVALUE -> {<<>>,0}; _ -> 'enc_ServiceChangeProfile'(Cindex4, [<<163>>]) end,%%-------------------------------------------------%% attribute serviceChangeReason(5) External megaco_ber_bin_drv_media_gateway_control_v1:Value%%------------------------------------------------- {EncBytes5,EncLen5} = 'enc_Value'(Cindex5, [<<164>>]),%%-------------------------------------------------%% attribute serviceChangeDelay(6) with type INTEGER OPTIONAL%%------------------------------------------------- {EncBytes6,EncLen6} = case Cindex6 of asn1_NOVALUE -> {<<>>,0}; _ -> ?RT_BER:encode_integer([], Cindex6, [<<133>>]) end,%%-------------------------------------------------%% attribute serviceChangeMgcId(7) External megaco_ber_bin_drv_media_gateway_control_v1:MId OPTIONAL%%------------------------------------------------- {EncBytes7,EncLen7} = case Cindex7 of asn1_NOVALUE -> {<<>>,0}; _ -> 'enc_MId'(Cindex7, [<<166>>]) end,%%-------------------------------------------------%% attribute timeStamp(8) External megaco_ber_bin_drv_media_gateway_control_v1:TimeNotation OPTIONAL%%------------------------------------------------- {EncBytes8,EncLen8} = case Cindex8 of asn1_NOVALUE -> {<<>>,0}; _ -> 'enc_TimeNotation'(Cindex8, [<<167>>]) end,%%-------------------------------------------------%% attribute nonStandardData(9) External megaco_ber_bin_drv_media_gateway_control_v1:NonStandardData OPTIONAL%%------------------------------------------------- {EncBytes9,EncLen9} = case Cindex9 of asn1_NOVALUE -> {<<>>,0}; _ -> 'enc_NonStandardData'(Cindex9, [<<168>>]) 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, BytesSoFar, LenSoFar).'dec_ServiceChangeParm'(Tlv) -> 'dec_ServiceChangeParm'(Tlv, [16]).'dec_ServiceChangeParm'(Tlv, TagIn) -> %%------------------------------------------------- %% decode tag and length %%-------------------------------------------------Tlv1 = ?RT_BER:match_tags(Tlv,TagIn), %%-------------------------------------------------%% attribute serviceChangeMethod(1) with type ENUMERATED%%-------------------------------------------------[V1|Tlv2] = Tlv1, Term1 = ?RT_BER:decode_enumerated(V1,[],{[{failover,0},{forced,1},{graceful,2},{restart,3},{disconnected,4},{handOff,5}],[]},[131072]),%%-------------------------------------------------%% attribute serviceChangeAddress(2) External megaco_ber_bin_drv_media_gateway_control_v1:ServiceChangeAddress OPTIONAL%%-------------------------------------------------{Term2,Tlv3} = case Tlv2 of[{131073,V2}|TempTlv3] -> {'dec_ServiceChangeAddress'(V2, []), TempTlv3}; _ -> { asn1_NOVALUE, Tlv2}end,%%-------------------------------------------------%% attribute serviceChangeVersion(3) with type INTEGER OPTIONAL%%-------------------------------------------------{Term3,Tlv4} = case Tlv3 of[{131074,V3}|TempTlv4] -> {?RT_BER:decode_integer(V3,{0,99},[]), TempTlv4}; _ -> { asn1_NOVALUE, Tlv3}end,%%-------------------------------------------------%% attribute serviceChangeProfile(4) External megaco_ber_bin_drv_media_gateway_control_v1:ServiceChangeProfile OPTIONAL%%-------------------------------------------------{Term4,Tlv5} = case Tlv4 of[{131075,V4}|TempTlv5] -> {'dec_ServiceChangeProfile'(V4, []), TempTlv5}; _ -> { asn1_NOVALUE, Tlv4}end,%%-------------------------------------------------%% attribute serviceChangeReason(5) External megaco_ber_bin_drv_media_gateway_control_v1:Value%%-------------------------------------------------[V5|Tlv6] = Tlv5, Term5 = 'dec_Value'(V5, [131076]),%%-------------------------------------------------%% attribute serviceChangeDelay(6) with type INTEGER OPTIONAL%%-------------------------------------------------{Term6,Tlv7} = case Tlv6 of[{131077,V6}|TempTlv7] -> {?RT_BER:decode_integer(V6,{0,4294967295},[]), TempTlv7}; _ -> { asn1_NOVALUE, Tlv6}end,%%-------------------------------------------------%% attribute serviceChangeMgcId(7) External megaco_ber_bin_drv_media_gateway_control_v1:MId OPTIONAL%%-------------------------------------------------{Term7,Tlv8} = case Tlv7 of[{131078,V7}|TempTlv8] -> {'dec_MId'(V7, []), TempTlv8}; _ -> { asn1_NOVALUE, Tlv7}end,%%-------------------------------------------------%% attribute timeStamp(8) External megaco_ber_bin_drv_media_gateway_control_v1:TimeNotation OPTIONAL%%-------------------------------------------------{Term8,Tlv9} = case Tlv8 of[{131079,V8}|TempTlv9] -> {'dec_TimeNotation'(V8, []), TempTlv9}; _ -> { asn1_NOVALUE, Tlv8}end,%%-------------------------------------------------%% attribute nonStandardData(9) External megaco_ber_bin_drv_media_gateway_control_v1:NonStandardData OPTIONAL%%-------------------------------------------------{Term9,Tlv10} = case Tlv9 of[{131080,V9}|TempTlv10] -> {'dec_NonStandardData'(V9, []), TempTlv10}; _ -> { asn1_NOVALUE, Tlv9}end,case Tlv10 of [] -> true; _ -> true end, % ... extra fields skipped {'ServiceChangeParm', Term1, Term2, Term3, Term4, Term5, Term6, Term7, Term8, Term9}.%%================================%% DigitMapValue%%================================'enc_DigitMapValue'(Val) -> 'enc_DigitMapValue'(Val, [<<48>>]).'enc_DigitMapValue'(Val, TagIn) ->{_,Cindex1, Cindex2, Cindex3, Cindex4} = Val,%%-------------------------------------------------%% attribute startTimer(1) with type INTEGER OPTIONAL%%------------------------------------------------- {EncBytes1,EncLen1} = case Cindex1 of asn1_NOVALUE -> {<<>>,0}; _ -> ?RT_BER:encode_integer([], Cindex1, [<<128>>]) end,
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -