4159
%% --------------------------------------------------------------
4162
pretty_otp7671_msg01(suite) ->
4164
pretty_otp7671_msg01(Config) when is_list(Config) ->
4165
%% put(severity, trc),
4167
d("pretty_otp7671_msg01 -> entry", []),
4168
%% ?ACQUIRE_NODES(1, Config),
4169
ok = pretty_otp7671( pretty_otp7671_msg01(), [] ),
4174
pretty_otp7671_msg02(suite) ->
4176
pretty_otp7671_msg02(Config) when is_list(Config) ->
4177
%% put(severity, trc),
4179
d("pretty_otp7671_msg02 -> entry", []),
4180
%% ?ACQUIRE_NODES(1, Config),
4181
ok = pretty_otp7671( pretty_otp7671_msg02(), [] ),
4186
pretty_otp7671_msg03(suite) ->
4188
pretty_otp7671_msg03(Config) when is_list(Config) ->
4189
%% put(severity, trc),
4191
d("pretty_otp7671_msg03 -> entry", []),
4192
%% ?ACQUIRE_NODES(1, Config),
4193
ok = pretty_otp7671( pretty_otp7671_msg03(), [] ),
4198
pretty_otp7671_msg04(suite) ->
4200
pretty_otp7671_msg04(Config) when is_list(Config) ->
4201
%% put(severity, trc),
4203
d("pretty_otp7671_msg04 -> entry", []),
4204
%% ?ACQUIRE_NODES(1, Config),
4205
ok = pretty_otp7671( pretty_otp7671_msg04(), [] , error, ignore),
4210
pretty_otp7671_msg05(suite) ->
4212
pretty_otp7671_msg05(Config) when is_list(Config) ->
4213
%% put(severity, trc),
4215
d("pretty_otp7671_msg05 -> entry", []),
4216
Check = fun(M1, M2) -> cmp_otp7671_msg05(M1, M2) end,
4217
ok = pretty_otp7671( pretty_otp7671_msg05(), [] , ok, ok, Check),
4223
pretty_otp7671(Msg, Conf) ->
4224
pretty_otp7671(Msg, Conf, ok).
4226
pretty_otp7671(Msg, Conf, ExpectedEncode) ->
4227
pretty_otp7671(Msg, Conf, ExpectedEncode, ok).
4229
pretty_otp7671(Msg, Conf, ExpectedEncode, ExpectedDecode) ->
4230
otp7671(Msg, megaco_pretty_text_encoder, Conf,
4231
ExpectedEncode, ExpectedDecode).
4233
pretty_otp7671(Msg, Conf, ExpectedEncode, ExpectedDecode, Check) ->
4234
otp7671(Msg, megaco_pretty_text_encoder, Conf,
4235
ExpectedEncode, ExpectedDecode, Check).
4237
otp7671(Msg, Codec, Conf, ExpectedEncode, ExpectedDecode) ->
4238
Check = fun(M1, M2) ->
4239
exit({unexpected_decode_result, M1, M2})
4241
otp7671(Msg, Codec, Conf, ExpectedEncode, ExpectedDecode, Check).
4243
otp7671(Msg, Codec, Conf, ExpectedEncode, ExpectedDecode, Check) ->
4244
case (catch encode_message(Codec, Conf, Msg)) of
4245
{error, _Reason} when ExpectedEncode =:= error ->
4247
{error, Reason} when ExpectedEncode =:= ok ->
4248
exit({unexpected_encode_failure, Reason});
4249
{ok, Bin} when ExpectedEncode =:= error ->
4250
exit({unexpected_encode_success, Msg, binary_to_list(Bin)});
4251
{ok, Bin} when ExpectedEncode =:= ok ->
4252
case decode_message(Codec, false, Conf, Bin) of
4253
{ok, Msg} when ExpectedDecode =:= ok ->
4255
{ok, Msg2} when ExpectedDecode =:= ok ->
4257
{ok, Msg} when ExpectedDecode =:= error ->
4258
exit({unexpected_decode_success, Msg});
4259
{ok, Msg2} when ExpectedDecode =:= error ->
4260
exit({unexpected_decode_success, Msg, Msg2});
4261
{error, _Reason} when ExpectedDecode =:= error ->
4263
{error, Reason} when ExpectedDecode == ok ->
4264
exit({unexpected_decode_failure, Msg, Reason})
4269
pretty_otp7671_msg(DigitMapDesc) ->
4270
AmmReq = cre_AmmReq([#megaco_term_id{id = ?A4444}],
4271
[{digitMapDescriptor, DigitMapDesc}]),
4272
CmdReq = cre_CmdReq({modReq, AmmReq}),
4273
msg_request(?MGC_MID, 10001, ?megaco_null_context_id, [CmdReq]).
4275
pretty_otp7671_msg01() ->
4276
Name = "dialplan01",
4277
DigitMapDesc = cre_DigitMapDesc(Name),
4278
pretty_otp7671_msg(DigitMapDesc).
4280
pretty_otp7671_msg02() ->
4281
Name = "dialplan02",
4282
Body = "(0s| 00s|[1-7]xlxx|8lxxxxxxx|#xxxxxxx|*xx|9l1xxxxxxxxxx|9l011x.s)",
4283
Value = cre_DigitMapValue(Body),
4284
DigitMapDesc = cre_DigitMapDesc(Name, Value),
4285
pretty_otp7671_msg(DigitMapDesc).
4287
pretty_otp7671_msg03() ->
4288
Body = "(0s| 00s|[1-7]xlxx|8lxxxxxxx|#xxxxxxx|*xx|9l1xxxxxxxxxx|9l011x.s)",
4289
Value = cre_DigitMapValue(Body),
4290
DigitMapDesc = cre_DigitMapDesc(Value),
4291
pretty_otp7671_msg(DigitMapDesc).
4293
pretty_otp7671_msg04() ->
4294
DigitMapDesc = cre_DigitMapDesc(),
4295
pretty_otp7671_msg(DigitMapDesc).
4297
pretty_otp7671_msg05() ->
4298
{'MegacoMessage',asn1_NOVALUE,
4299
{'Message',?VERSION,
4300
{domainName,{'DomainName',"tgc",asn1_NOVALUE}},
4302
[{transactionRequest,
4303
{'TransactionRequest',12582952,
4304
[{'ActionRequest',0,asn1_NOVALUE,asn1_NOVALUE,
4308
[{megaco_term_id,false,["root"]}],
4309
[{digitMapDescriptor,
4310
{'DigitMapDescriptor',"dialplan1",
4311
{'DigitMapValue',asn1_NOVALUE,asn1_NOVALUE,asn1_NOVALUE,[],
4313
asn1_NOVALUE,asn1_NOVALUE}]}]}}]}}}.
4315
cmp_otp7671_msg05(#'MegacoMessage'{authHeader = asn1_NOVALUE,
4317
#'MegacoMessage'{authHeader = asn1_NOVALUE,
4319
#'Message'{messageBody = Body1} = M1,
4320
#'Message'{messageBody = Body2} = M2,
4321
{transactions, Trans1} = Body1,
4322
{transactions, Trans2} = Body2,
4323
[{transactionRequest, TR1}] = Trans1,
4324
[{transactionRequest, TR2}] = Trans2,
4325
#'TransactionRequest'{actions = Acts1} = TR1,
4326
#'TransactionRequest'{actions = Acts2} = TR2,
4327
[#'ActionRequest'{commandRequests = CR1}] = Acts1,
4328
[#'ActionRequest'{commandRequests = CR2}] = Acts2,
4329
[#'CommandRequest'{command = Cmd1}] = CR1,
4330
[#'CommandRequest'{command = Cmd2}] = CR2,
4331
{modReq, #'AmmRequest'{descriptors = Descs1}} = Cmd1,
4332
{modReq, #'AmmRequest'{descriptors = Descs2}} = Cmd2,
4333
[{digitMapDescriptor,
4334
#'DigitMapDescriptor'{digitMapName = Name,
4335
digitMapValue = Value1}}] = Descs1,
4336
[{digitMapDescriptor,
4337
#'DigitMapDescriptor'{digitMapName = Name,
4338
digitMapValue = Value2}}] = Descs2,
4339
#'DigitMapValue'{startTimer = asn1_NOVALUE,
4340
shortTimer = asn1_NOVALUE,
4341
longTimer = asn1_NOVALUE,
4343
durationTimer = asn1_NOVALUE} = Value1,
4344
asn1_NOVALUE = Value2,
4148
4348
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4150
4350
expect_codec(Expect, Codec, Msg, Conf) ->