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

📄 megaco_ber_bin_media_gateway_control_v1.erl

📁 OTP是开放电信平台的简称
💻 ERL
📖 第 1 页 / 共 5 页
字号:
    {131073, V1} ->         {h221NonStandard, 'dec_H221NonStandard'(V1, [])};%% 'experimental'    {131074, V1} ->         {experimental, ?RT_BER:decode_restricted_string(V1,8,22,[])};      Else ->          {asn1_ExtAlt, ?RT_BER:encode(Else)}   end.%%================================%%  NonStandardData%%================================'enc_NonStandardData'(Val) ->    'enc_NonStandardData'(Val, [<<48>>]).'enc_NonStandardData'(Val, TagIn) ->{_,Cindex1, Cindex2} = Val,%%-------------------------------------------------%% attribute nonStandardIdentifier(1)   External megaco_ber_bin_media_gateway_control_v1:NonStandardIdentifier%%-------------------------------------------------   {EncBytes1,EncLen1} = 'enc_NonStandardIdentifier'(Cindex1, [<<160>>]),%%-------------------------------------------------%% attribute data(2) with type OCTET STRING%%-------------------------------------------------   {EncBytes2,EncLen2} = ?RT_BER:encode_octet_string([], Cindex2, [<<129>>]),   BytesSoFar = [EncBytes1, EncBytes2],LenSoFar = EncLen1 + EncLen2,?RT_BER:encode_tags(TagIn, BytesSoFar, LenSoFar).'dec_NonStandardData'(Tlv) ->   'dec_NonStandardData'(Tlv, [16]).'dec_NonStandardData'(Tlv, TagIn) ->   %%-------------------------------------------------   %% decode tag and length    %%-------------------------------------------------Tlv1 = ?RT_BER:match_tags(Tlv,TagIn), %%-------------------------------------------------%% attribute nonStandardIdentifier(1)   External megaco_ber_bin_media_gateway_control_v1:NonStandardIdentifier%%-------------------------------------------------[V1|Tlv2] = Tlv1, Term1 = 'dec_NonStandardIdentifier'(V1, [131072]),%%-------------------------------------------------%% attribute data(2) with type OCTET STRING%%-------------------------------------------------[V2|Tlv3] = Tlv2, Term2 = ?RT_BER:decode_octet_string(V2,[],[131073]),case Tlv3 of[] -> true;_ -> exit({error,{asn1, {unexpected,Tlv3}}}) % extra fields not allowedend,   {'NonStandardData', Term1, Term2}.%%================================%%  StatisticsParameter%%================================'enc_StatisticsParameter'(Val) ->    'enc_StatisticsParameter'(Val, [<<48>>]).'enc_StatisticsParameter'(Val, TagIn) ->{_,Cindex1, Cindex2} = Val,%%-------------------------------------------------%% attribute statName(1) with type OCTET STRING%%-------------------------------------------------   {EncBytes1,EncLen1} = ?RT_BER:encode_octet_string([], Cindex1, [<<128>>]),%%-------------------------------------------------%% attribute statValue(2)   External megaco_ber_bin_media_gateway_control_v1:Value OPTIONAL%%-------------------------------------------------   {EncBytes2,EncLen2} =  case Cindex2 of         asn1_NOVALUE -> {<<>>,0};         _ ->            'enc_Value'(Cindex2, [<<161>>])       end,   BytesSoFar = [EncBytes1, EncBytes2],LenSoFar = EncLen1 + EncLen2,?RT_BER:encode_tags(TagIn, BytesSoFar, LenSoFar).'dec_StatisticsParameter'(Tlv) ->   'dec_StatisticsParameter'(Tlv, [16]).'dec_StatisticsParameter'(Tlv, TagIn) ->   %%-------------------------------------------------   %% decode tag and length    %%-------------------------------------------------Tlv1 = ?RT_BER:match_tags(Tlv,TagIn), %%-------------------------------------------------%% attribute statName(1) with type OCTET STRING%%-------------------------------------------------[V1|Tlv2] = Tlv1, Term1 = ?RT_BER:decode_octet_string(V1,4,[131072]),%%-------------------------------------------------%% attribute statValue(2)   External megaco_ber_bin_media_gateway_control_v1:Value OPTIONAL%%-------------------------------------------------{Term2,Tlv3} = case Tlv2 of[{131073,V2}|TempTlv3] ->    {'dec_Value'(V2, []), TempTlv3};    _ ->        { asn1_NOVALUE, Tlv2}end,case Tlv3 of[] -> true;_ -> exit({error,{asn1, {unexpected,Tlv3}}}) % extra fields not allowedend,   {'StatisticsParameter', Term1, Term2}.%%================================%%  StatisticsDescriptor%%================================'enc_StatisticsDescriptor'(Val) ->    'enc_StatisticsDescriptor'(Val, [<<48>>]).'enc_StatisticsDescriptor'({'StatisticsDescriptor',Val}, TagIn) ->   'enc_StatisticsDescriptor'(Val, TagIn);'enc_StatisticsDescriptor'(Val, TagIn) ->   {EncBytes,EncLen} = 'enc_StatisticsDescriptor_components'(Val,[],0),   ?RT_BER:encode_tags(TagIn, EncBytes, EncLen).'enc_StatisticsDescriptor_components'([], AccBytes, AccLen) ->    {lists:reverse(AccBytes),AccLen};'enc_StatisticsDescriptor_components'([H|T],AccBytes, AccLen) ->   {EncBytes,EncLen} = 'enc_StatisticsParameter'(H, [<<48>>]),   'enc_StatisticsDescriptor_components'(T,[EncBytes|AccBytes], AccLen + EncLen).'dec_StatisticsDescriptor'(Tlv) ->   'dec_StatisticsDescriptor'(Tlv, [16]).'dec_StatisticsDescriptor'(Tlv, TagIn) ->   %%-------------------------------------------------   %% decode tag and length    %%-------------------------------------------------Tlv1 = ?RT_BER:match_tags(Tlv,TagIn), ['dec_StatisticsParameter'(V1, [16]) || V1 <- Tlv1].%%================================%%  PackagesItem%%================================'enc_PackagesItem'(Val) ->    'enc_PackagesItem'(Val, [<<48>>]).'enc_PackagesItem'(Val, TagIn) ->{_,Cindex1, Cindex2} = Val,%%-------------------------------------------------%% attribute packageName(1) with type OCTET STRING%%-------------------------------------------------   {EncBytes1,EncLen1} = ?RT_BER:encode_octet_string([], Cindex1, [<<128>>]),%%-------------------------------------------------%% attribute packageVersion(2) with type INTEGER%%-------------------------------------------------   {EncBytes2,EncLen2} = ?RT_BER:encode_integer([], Cindex2, [<<129>>]),   BytesSoFar = [EncBytes1, EncBytes2],LenSoFar = EncLen1 + EncLen2,?RT_BER:encode_tags(TagIn, BytesSoFar, LenSoFar).'dec_PackagesItem'(Tlv) ->   'dec_PackagesItem'(Tlv, [16]).'dec_PackagesItem'(Tlv, TagIn) ->   %%-------------------------------------------------   %% decode tag and length    %%-------------------------------------------------Tlv1 = ?RT_BER:match_tags(Tlv,TagIn), %%-------------------------------------------------%% attribute packageName(1) with type OCTET STRING%%-------------------------------------------------[V1|Tlv2] = Tlv1, Term1 = ?RT_BER:decode_octet_string(V1,2,[131072]),%%-------------------------------------------------%% attribute packageVersion(2) with type INTEGER%%-------------------------------------------------[V2|Tlv3] = Tlv2, Term2 = ?RT_BER:decode_integer(V2,{0,99},[131073]),case Tlv3 of [] -> true; _ -> true end, % ... extra fields skipped   {'PackagesItem', Term1, Term2}.%%================================%%  PackagesDescriptor%%================================'enc_PackagesDescriptor'(Val) ->    'enc_PackagesDescriptor'(Val, [<<48>>]).'enc_PackagesDescriptor'({'PackagesDescriptor',Val}, TagIn) ->   'enc_PackagesDescriptor'(Val, TagIn);'enc_PackagesDescriptor'(Val, TagIn) ->   {EncBytes,EncLen} = 'enc_PackagesDescriptor_components'(Val,[],0),   ?RT_BER:encode_tags(TagIn, EncBytes, EncLen).'enc_PackagesDescriptor_components'([], AccBytes, AccLen) ->    {lists:reverse(AccBytes),AccLen};'enc_PackagesDescriptor_components'([H|T],AccBytes, AccLen) ->   {EncBytes,EncLen} = 'enc_PackagesItem'(H, [<<48>>]),   'enc_PackagesDescriptor_components'(T,[EncBytes|AccBytes], AccLen + EncLen).'dec_PackagesDescriptor'(Tlv) ->   'dec_PackagesDescriptor'(Tlv, [16]).'dec_PackagesDescriptor'(Tlv, TagIn) ->   %%-------------------------------------------------   %% decode tag and length    %%-------------------------------------------------Tlv1 = ?RT_BER:match_tags(Tlv,TagIn), ['dec_PackagesItem'(V1, [16]) || V1 <- Tlv1].%%================================%%  ServiceChangeProfile%%================================'enc_ServiceChangeProfile'(Val) ->    'enc_ServiceChangeProfile'(Val, [<<48>>]).'enc_ServiceChangeProfile'(Val, TagIn) ->{_,Cindex1} = Val,%%-------------------------------------------------%% attribute profileName(1) with type IA5String%%-------------------------------------------------   {EncBytes1,EncLen1} = ?RT_BER:encode_restricted_string([], Cindex1, 22, [<<128>>]),   BytesSoFar = [EncBytes1],LenSoFar = EncLen1,?RT_BER:encode_tags(TagIn, BytesSoFar, LenSoFar).'dec_ServiceChangeProfile'(Tlv) ->   'dec_ServiceChangeProfile'(Tlv, [16]).'dec_ServiceChangeProfile'(Tlv, TagIn) ->   %%-------------------------------------------------   %% decode tag and length    %%-------------------------------------------------Tlv1 = ?RT_BER:match_tags(Tlv,TagIn), %%-------------------------------------------------%% attribute profileName(1) with type IA5String%%-------------------------------------------------[V1|Tlv2] = Tlv1, Term1 = ?RT_BER:decode_restricted_string(V1,{1,67},22,[131072]),case Tlv2 of[] -> true;_ -> exit({error,{asn1, {unexpected,Tlv2}}}) % extra fields not allowedend,   {'ServiceChangeProfile', Term1}.%%================================%%  ServiceChangeMethod%%================================'enc_ServiceChangeMethod'(Val) ->    'enc_ServiceChangeMethod'(Val, [<<10>>]).'enc_ServiceChangeMethod'({'ServiceChangeMethod',Val}, TagIn) ->   'enc_ServiceChangeMethod'(Val, TagIn);'enc_ServiceChangeMethod'(Val, TagIn) ->case (case Val of {asn1_enum,_}->Val;{_,_}->element(2,Val);_->Val end) offailover -> ?RT_BER:encode_enumerated(0,TagIn);forced -> ?RT_BER:encode_enumerated(1,TagIn);graceful -> ?RT_BER:encode_enumerated(2,TagIn);restart -> ?RT_BER:encode_enumerated(3,TagIn);disconnected -> ?RT_BER:encode_enumerated(4,TagIn);handOff -> ?RT_BER:encode_enumerated(5,TagIn);{asn1_enum,Enumval1} -> ?RT_BER:encode_enumerated(Enumval1,TagIn);Enumval2 -> exit({error,{asn1, {enumerated_not_in_range,Enumval2}}})end.'dec_ServiceChangeMethod'(Tlv) ->   'dec_ServiceChangeMethod'(Tlv, [10]).'dec_ServiceChangeMethod'(Tlv, TagIn) ->?RT_BER:decode_enumerated(Tlv,[],{[{failover,0},{forced,1},{graceful,2},{restart,3},{disconnected,4},{handOff,5}],[]},TagIn).%%================================%%  ServiceChangeResParm%%================================'enc_ServiceChangeResParm'(Val) ->    'enc_ServiceChangeResParm'(Val, [<<48>>]).'enc_ServiceChangeResParm'(Val, TagIn) ->{_,Cindex1, Cindex2, Cindex3, Cindex4, Cindex5} = Val,%%-------------------------------------------------%% attribute serviceChangeMgcId(1)   External megaco_ber_bin_media_gateway_control_v1:MId OPTIONAL%%-------------------------------------------------   {EncBytes1,EncLen1} =  case Cindex1 of         asn1_NOVALUE -> {<<>>,0};         _ ->            'enc_MId'(Cindex1, [<<160>>])       end,%%-------------------------------------------------%% attribute serviceChangeAddress(2)   External megaco_ber_bin_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_media_gateway_control_v1:ServiceChangeProfile OPTIONAL%%-------------------------------------------------   {EncBytes4,EncLen4} =  case Cindex4 of         asn1_NOVALUE -> {<<>>,0};         _ ->            'enc_ServiceChangeProfile'(Cindex4, [<<163>>])       end,%%-------------------------------------------------

⌨️ 快捷键说明

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