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

📄 megaco_per_media_gateway_control_prev3b.erl

📁 OTP是开放电信平台的简称
💻 ERL
📖 第 1 页 / 共 5 页
字号:
,Extensions,case ?RT_PER:cindex(11,Val1,serviceChangeInfo) ofasn1_NOVALUE -> [];Tmpval8 ->%% attribute number 10 with type Externaltypereference905megaco_per_media_gateway_control_prev3bAuditDescriptor?RT_PER:encode_open_type(dummy,?RT_PER:complete('enc_AuditDescriptor'(Tmpval8)))end,case ?RT_PER:cindex(12,Val1,serviceChangeIncompleteFlag) ofasn1_NOVALUE -> [];Tmpval9 ->%% attribute number 11 with type NULL?RT_PER:encode_open_type(dummy,?RT_PER:complete(?RT_PER:encode_null(Tmpval9)))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),%%  attribute number 10 with type AuditDescriptor{Term10,Bytes13} = case Extensions of_ when size(Extensions) >= 1,element(1,Extensions) == 1 ->begin{TmpVal10,Trem10}=?RT_PER:decode_open_type(Bytes12,[]),{TmpValx10,_}='dec_AuditDescriptor'(TmpVal10,telltype), {TmpValx10,Trem10}end;_  ->{asn1_NOVALUE,Bytes12}end,%% attribute number 11 with type NULL{Term11,Bytes14} = case Extensions of_ when size(Extensions) >= 2,element(2,Extensions) == 1 ->begin{TmpVal11,Trem11}=?RT_PER:decode_open_type(Bytes13,[]),{TmpValx11,_}=?RT_PER:decode_null(TmpVal11), {TmpValx11,Trem11}end;_  ->{asn1_NOVALUE,Bytes13}end,Bytes15= ?RT_PER:skipextensions(Bytes14,3,Extensions),{{'ServiceChangeParm',Term1,Term2,Term3,Term4,Term5,Term6,Term7,Term8,Term9,Term10,Term11},Bytes15}.'enc_DigitMapValue'(Val) ->{Val1,Opt} = ?RT_PER:fixoptionals([2,3,4],3,Val),Extensions = ?RT_PER:fixextensions({ext,5,1}, Val1),[?RT_PER:setext(Extensions =/= []), 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)),Extensions,case ?RT_PER:cindex(6,Val1,durationTimer) ofasn1_NOVALUE -> [];Tmpval4 ->%% attribute number 5 with type INTEGER?RT_PER:encode_open_type(dummy,?RT_PER:complete(?RT_PER:encode_integer([{'ValueRange',{0,99}}],Tmpval4)))end].'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),%% attribute number 5 with type INTEGER{Term5,Bytes8} = case Extensions of_ when size(Extensions) >= 1,element(1,Extensions) == 1 ->begin{TmpVal5,Trem5}=?RT_PER:decode_open_type(Bytes7,[]),{TmpValx5,_}=?RT_PER:decode_integer(TmpVal5,[{'ValueRange',{0,99}}]), {TmpValx5,Trem5}end;_  ->{asn1_NOVALUE,Bytes7}end,Bytes9= ?RT_PER:skipextensions(Bytes8,2,Extensions),{{'DigitMapValue',Term1,Term2,Term3,Term4,Term5},Bytes9}.'enc_DigitMapName'({'DigitMapName',Val}) ->'enc_DigitMapName'(Val);'enc_DigitMapName'(Val) ->?RT_PER:encode_octet_string([{'SizeConstraint',2}],Val).'dec_DigitMapName'(Bytes,_) ->?RT_PER:decode_octet_string(Bytes,[{'SizeConstraint',2}]).'enc_DigitMapDescriptor'(Val) ->{Val1,Opt} = ?RT_PER:fixoptionals([2,3],2,Val),[Opt,case ?RT_PER:cindex(2,Val1,digitMapName) ofasn1_NOVALUE -> [];Tmpval1 ->%% attribute number 1 with type OCTET STRING?RT_PER:encode_octet_string([{'SizeConstraint',2}],Tmpval1)end,case ?RT_PER:cindex(3,Val1,digitMapValue) ofasn1_NOVALUE -> [];Tmpval2 ->%% attribute number 2 with type Externaltypereference862megaco_per_media_gateway_control_prev3bDigitMapValue'enc_DigitMapValue'(Tmpval2)end].'dec_DigitMapDescriptor'(Bytes,_) ->{Opt,Bytes1} = ?RT_PER:getoptionals2(Bytes,2), %% attribute number 1 with type OCTET STRING{Term1,Bytes2} = case Opt band (1 bsl 1) of_Opt1 when _Opt1 > 0 ->?RT_PER:decode_octet_string(Bytes1,[{'SizeConstraint',2}]);0 ->{asn1_NOVALUE,Bytes1}end,%%  attribute number 2 with type DigitMapValue{Term2,Bytes3} = case Opt band (1 bsl 0) of_Opt2 when _Opt2 > 0 ->'dec_DigitMapValue'(Bytes2,telltype);0 ->{asn1_NOVALUE,Bytes2}end,{{'DigitMapDescriptor',Term1,Term2},Bytes3}.'enc_ModemType'({'ModemType',Val}) ->'enc_ModemType'(Val);'enc_ModemType'(Val) ->case (case Val of {_,_}->element(2,Val);_->Val end) of'v18' -> [{bit,0},?RT_PER:encode_integer([{'ValueRange',{0,8}}], 0)];'v22' -> [{bit,0},?RT_PER:encode_integer([{'ValueRange',{0,8}}], 1)];'v22bis' -> [{bit,0},?RT_PER:encode_integer([{'ValueRange',{0,8}}], 2)];'v32' -> [{bit,0},?RT_PER:encode_integer([{'ValueRange',{0,8}}], 3)];'v32bis' -> [{bit,0},?RT_PER:encode_integer([{'ValueRange',{0,8}}], 4)];'v34' -> [{bit,0},?RT_PER:encode_integer([{'ValueRange',{0,8}}], 5)];'v90' -> [{bit,0},?RT_PER:encode_integer([{'ValueRange',{0,8}}], 6)];'v91' -> [{bit,0},?RT_PER:encode_integer([{'ValueRange',{0,8}}], 7)];'synchISDN' -> [{bit,0},?RT_PER:encode_integer([{'ValueRange',{0,8}}], 8)];{asn1_enum,EnumV} when integer(EnumV), EnumV > 8 -> [{bit,1},?RT_PER:encode_small_number(EnumV)];EnumVal -> exit({error,{asn1, {enumerated_not_in_range, EnumVal}}})end.'dec_ModemType'(Bytes,_) ->?RT_PER:decode_enumerated(Bytes,[{'ValueRange',{0,8}}],{{v18,v22,v22bis,v32,v32bis,v34,v90,v91,synchISDN},{}}).'enc_ModemDescriptor'(Val) ->{Val1,Opt} = ?RT_PER:fixoptionals([4],1,Val),[Opt,%% attribute number 1 with type SEQUENCE OF'enc_ModemDescriptor_mtl'(?RT_PER:cindex(2,Val1,mtl)),%% attribute number 2 with type SEQUENCE OF'enc_ModemDescriptor_mpl'(?RT_PER:cindex(3,Val1,mpl)),case ?RT_PER:cindex(4,Val1,nonStandardData) ofasn1_NOVALUE -> [];Tmpval1 ->%% attribute number 3 with type Externaltypereference842megaco_per_media_gateway_control_prev3bNonStandardData'enc_NonStandardData'(Tmpval1)end].'enc_ModemDescriptor_mtl'({'ModemDescriptor_mtl',Val}) ->'enc_ModemDescriptor_mtl'(Val);'enc_ModemDescriptor_mtl'(Val) ->[   ?RT_PER:encode_length(undefined,length(Val)),   'enc_ModemDescriptor_mtl_components'(Val, [])].'enc_ModemDescriptor_mtl_components'([], Acc) -> lists:reverse(Acc);'enc_ModemDescriptor_mtl_components'([H|T], Acc) ->'enc_ModemDescriptor_mtl_components'(T, [case (case H of {_,_}->element(2,H);_->H end) of'v18' -> [{bit,0},?RT_PER:encode_integer([{'ValueRange',{0,8}}], 0)];'v22' -> [{bit,0},?RT_PER:encode_integer([{'ValueRange',{0,8}}], 1)];'v22bis' -> [{bit,0},?RT_PER:encode_integer([{'ValueRange',{0,8}}], 2)];'v32' -> [{bit,0},?RT_PER:encode_integer([{'ValueRange',{0,8}}], 3)];'v32bis' -> [{bit,0},?RT_PER:encode_integer([{'ValueRange',{0,8}}], 4)];'v34' -> [{bit,0},?RT_PER:encode_integer([{'ValueRange',{0,8}}], 5)];'v90' -> [{bit,0},?RT_PER:encode_integer([{'ValueRange',{0,8}}], 6)];'v91' -> [{bit,0},?RT_PER:encode_integer([{'ValueRange',{0,8}}], 7)];'synchISDN' -> [{bit,0},?RT_PER:encode_integer([{'ValueRange',{0,8}}], 8)];{asn1_enum,EnumV} when integer(EnumV), EnumV > 8 -> [{bit,1},?RT_PER:encode_small_number(EnumV)];EnumVal -> exit({error,{asn1, {enumerated_not_in_range, EnumVal}}})end | Acc]).'dec_ModemDescriptor_mtl'(Bytes,_) ->{Num,Bytes1} = ?RT_PER:decode_length(Bytes,undefined),'dec_ModemDescriptor_mtl_components'(Num, Bytes1, telltype, []).'dec_ModemDescriptor_mtl_components'(0, Bytes, _, Acc) ->   {lists:reverse(Acc), Bytes};'dec_ModemDescriptor_mtl_components'(Num, Bytes, _, Acc) ->   {Term,Remain} = ?RT_PER:decode_enumerated(Bytes,[{'ValueRange',{0,8}}],{{v18,v22,v22bis,v32,v32bis,v34,v90,v91,synchISDN},{}}),   'dec_ModemDescriptor_mtl_components'(Num-1, Remain, telltype, [Term|Acc]).'enc_ModemDescriptor_mpl'({'ModemDescriptor_mpl',Val}) ->'enc_ModemDescriptor_mpl'(Val);'enc_ModemDescriptor_mpl'(Val) ->[   ?RT_PER:encode_length(undefined,length(Val)),   'enc_ModemDescriptor_mpl_components'(Val, [])].'enc_ModemDescriptor_mpl_components'([], Acc) -> lists:reverse(Acc);'enc_ModemDescriptor_mpl_components'([H|T], Acc) ->'enc_ModemDescriptor_mpl_components'(T, ['enc_PropertyParm'(H) | Acc]).'dec_ModemDescriptor_mpl'(Bytes,_) ->{Num,Bytes1} = ?RT_PER:decode_length(Bytes,undefined),'dec_ModemDescriptor_mpl_components'(Num, Bytes1, telltype, []).'dec_ModemDescriptor_mpl_components'(0, Bytes, _, Acc) ->   {lists:reverse(Acc), Bytes};'dec_ModemDescriptor_mpl_components'(Num, Bytes, _, Acc) ->   {Term,Remain} = 'dec_PropertyParm'(Bytes,telltype),   'dec_ModemDescriptor_mpl_components'(Num-1, Remain, telltype, [Term|Acc]).'dec_ModemDescriptor'(Bytes,_) ->{Opt,Bytes1} = ?RT_PER:getoptionals2(Bytes,1), %% attribute number 1 with type SEQUENCE OF{Term1,Bytes2} = 'dec_ModemDescriptor_mtl'(Bytes1, telltype),%% attribute number 2 with type SEQUENCE OF{Term2,Bytes3} = 'dec_ModemDescriptor_mpl'(Bytes2, telltype),%%  attribute number 3 with type NonStandardData{Term3,Bytes4} = case Opt band (1 bsl 0) of_Opt1 when _Opt1 > 0 ->'dec_NonStandardData'(Bytes3,telltype);0 ->{asn1_NOVALUE,Bytes3}

⌨️ 快捷键说明

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