3815
3826
pretty_otp6490_msg(EBD).
3829
%% --------------------------------------------------------------
3832
pretty_otp7671_msg01(suite) ->
3834
pretty_otp7671_msg01(Config) when is_list(Config) ->
3835
%% put(severity, trc),
3837
d("pretty_otp7671_msg01 -> entry", []),
3838
%% ?ACQUIRE_NODES(1, Config),
3839
ok = pretty_otp7671( pretty_otp7671_msg01(), [] ),
3844
pretty_otp7671_msg02(suite) ->
3846
pretty_otp7671_msg02(Config) when is_list(Config) ->
3847
%% put(severity, trc),
3849
d("pretty_otp7671_msg02 -> entry", []),
3850
%% ?ACQUIRE_NODES(1, Config),
3851
ok = pretty_otp7671( pretty_otp7671_msg02(), [] ),
3856
pretty_otp7671_msg03(suite) ->
3858
pretty_otp7671_msg03(Config) when is_list(Config) ->
3859
%% put(severity, trc),
3861
d("pretty_otp7671_msg03 -> entry", []),
3862
%% ?ACQUIRE_NODES(1, Config),
3863
ok = pretty_otp7671( pretty_otp7671_msg03(), [] ),
3868
pretty_otp7671_msg04(suite) ->
3870
pretty_otp7671_msg04(Config) when is_list(Config) ->
3871
%% put(severity, trc),
3873
d("pretty_otp7671_msg04 -> entry", []),
3874
%% ?ACQUIRE_NODES(1, Config),
3875
ok = pretty_otp7671( pretty_otp7671_msg04(), [] , error, ignore),
3880
pretty_otp7671_msg05(suite) ->
3882
pretty_otp7671_msg05(Config) when is_list(Config) ->
3883
%% put(severity, trc),
3885
d("pretty_otp7671_msg05 -> entry", []),
3886
Check = fun(M1, M2) -> cmp_otp7671_msg05(M1, M2) end,
3887
ok = pretty_otp7671( pretty_otp7671_msg05(), [] , ok, ok, Check),
3892
pretty_otp7671(Msg, Conf) ->
3893
pretty_otp7671(Msg, Conf, ok).
3895
pretty_otp7671(Msg, Conf, ExpectedEncode) ->
3896
pretty_otp7671(Msg, Conf, ExpectedEncode, ok).
3898
pretty_otp7671(Msg, Conf, ExpectedEncode, ExpectedDecode) ->
3899
otp7671(Msg, megaco_pretty_text_encoder, Conf,
3900
ExpectedEncode, ExpectedDecode).
3902
pretty_otp7671(Msg, Conf, ExpectedEncode, ExpectedDecode, Check) ->
3903
otp7671(Msg, megaco_pretty_text_encoder, Conf,
3904
ExpectedEncode, ExpectedDecode, Check).
3906
otp7671(Msg, Codec, Conf, ExpectedEncode, ExpectedDecode) ->
3907
Check = fun(M1, M2) ->
3908
exit({unexpected_decode_result, M1, M2})
3910
otp7671(Msg, Codec, Conf, ExpectedEncode, ExpectedDecode, Check).
3912
otp7671(Msg, Codec, Conf, ExpectedEncode, ExpectedDecode, Check) ->
3913
case (catch encode_message(Codec, Conf, Msg)) of
3914
{error, _Reason} when ExpectedEncode =:= error ->
3916
{error, Reason} when ExpectedEncode =:= ok ->
3917
exit({unexpected_encode_failure, Reason});
3918
{ok, Bin} when ExpectedEncode =:= error ->
3919
exit({unexpected_encode_success, Msg, binary_to_list(Bin)});
3920
{ok, Bin} when ExpectedEncode =:= ok ->
3921
case decode_message(Codec, false, Conf, Bin) of
3922
{ok, Msg} when ExpectedDecode =:= ok ->
3924
{ok, Msg2} when ExpectedDecode =:= ok ->
3926
{ok, Msg} when ExpectedDecode =:= error ->
3927
exit({unexpected_decode_success, Msg});
3928
{ok, Msg2} when ExpectedDecode =:= error ->
3929
exit({unexpected_decode_success, Msg, Msg2});
3930
{error, _Reason} when ExpectedDecode =:= error ->
3932
{error, Reason} when ExpectedDecode == ok ->
3933
exit({unexpected_decode_failure, Msg, Reason})
3938
pretty_otp7671_msg(DigitMapDesc) ->
3939
AmmReq = cre_AmmReq([#megaco_term_id{id = ?A4444}],
3940
[{digitMapDescriptor, DigitMapDesc}]),
3941
CmdReq = cre_CmdReq({modReq, AmmReq}),
3942
msg_request(?MGC_MID, 10001, ?megaco_null_context_id, [CmdReq]).
3944
pretty_otp7671_msg01() ->
3945
Name = "dialplan01",
3946
DigitMapDesc = cre_DigitMapDesc(Name),
3947
pretty_otp7671_msg(DigitMapDesc).
3949
pretty_otp7671_msg02() ->
3950
Name = "dialplan02",
3951
Body = "(0s| 00s|[1-7]xlxx|8lxxxxxxx|#xxxxxxx|*xx|9l1xxxxxxxxxx|9l011x.s)",
3952
Value = cre_DigitMapValue(Body),
3953
DigitMapDesc = cre_DigitMapDesc(Name, Value),
3954
pretty_otp7671_msg(DigitMapDesc).
3956
pretty_otp7671_msg03() ->
3957
Body = "(0s| 00s|[1-7]xlxx|8lxxxxxxx|#xxxxxxx|*xx|9l1xxxxxxxxxx|9l011x.s)",
3958
Value = cre_DigitMapValue(Body),
3959
DigitMapDesc = cre_DigitMapDesc(Value),
3960
pretty_otp7671_msg(DigitMapDesc).
3962
pretty_otp7671_msg04() ->
3963
DigitMapDesc = cre_DigitMapDesc(),
3964
pretty_otp7671_msg(DigitMapDesc).
3966
pretty_otp7671_msg05() ->
3967
{'MegacoMessage',asn1_NOVALUE,
3968
{'Message',?VERSION,
3969
{domainName,{'DomainName',"tgc",asn1_NOVALUE}},
3971
[{transactionRequest,
3972
{'TransactionRequest',12582952,
3973
[{'ActionRequest',0,asn1_NOVALUE,asn1_NOVALUE,
3977
[{megaco_term_id,false,["root"]}],
3978
[{digitMapDescriptor,
3979
{'DigitMapDescriptor',"dialplan1",
3980
{'DigitMapValue',asn1_NOVALUE,asn1_NOVALUE,asn1_NOVALUE,[],
3982
asn1_NOVALUE,asn1_NOVALUE}]}]}}]}}}.
3984
cmp_otp7671_msg05(#'MegacoMessage'{authHeader = asn1_NOVALUE,
3986
#'MegacoMessage'{authHeader = asn1_NOVALUE,
3988
#'Message'{messageBody = Body1} = M1,
3989
#'Message'{messageBody = Body2} = M2,
3990
{transactions, Trans1} = Body1,
3991
{transactions, Trans2} = Body2,
3992
[{transactionRequest, TR1}] = Trans1,
3993
[{transactionRequest, TR2}] = Trans2,
3994
#'TransactionRequest'{actions = Acts1} = TR1,
3995
#'TransactionRequest'{actions = Acts2} = TR2,
3996
[#'ActionRequest'{commandRequests = CR1}] = Acts1,
3997
[#'ActionRequest'{commandRequests = CR2}] = Acts2,
3998
[#'CommandRequest'{command = Cmd1}] = CR1,
3999
[#'CommandRequest'{command = Cmd2}] = CR2,
4000
{modReq, #'AmmRequest'{descriptors = Descs1}} = Cmd1,
4001
{modReq, #'AmmRequest'{descriptors = Descs2}} = Cmd2,
4002
[{digitMapDescriptor,
4003
#'DigitMapDescriptor'{digitMapName = Name,
4004
digitMapValue = Value1}}] = Descs1,
4005
[{digitMapDescriptor,
4006
#'DigitMapDescriptor'{digitMapName = Name,
4007
digitMapValue = Value2}}] = Descs2,
4008
#'DigitMapValue'{startTimer = asn1_NOVALUE,
4009
shortTimer = asn1_NOVALUE,
4010
longTimer = asn1_NOVALUE,
4012
durationTimer = asn1_NOVALUE} = Value1,
4013
asn1_NOVALUE = Value2,
3818
4017
%% ==============================================================
3820
4019
%% F l e x P r e t t y T e s t c a s e s