pespin has submitted this change. ( 
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/36763?usp=email )

Change subject: asterisk: Use ActionID field in Action Login
......................................................................

asterisk: Use ActionID field in Action Login

It's a good practice to tag Actions with an ActionID to do proper
matching of the response once it comes back. It also helps reading a
dump of the conversation if there were events in between.

Change-Id: Iec320762ff0cca86319f7374b53c642f08a6e6df
---
M asterisk/AMI_Functions.ttcn
1 file changed, 22 insertions(+), 3 deletions(-)

Approvals:
  osmith: Looks good to me, but someone else must approve
  pespin: Looks good to me, approved
  Jenkins Builder: Verified




diff --git a/asterisk/AMI_Functions.ttcn b/asterisk/AMI_Functions.ttcn
index 3044c17..1f3dc5e 100644
--- a/asterisk/AMI_Functions.ttcn
+++ b/asterisk/AMI_Functions.ttcn
@@ -115,16 +115,21 @@
  * Secret: <value>
  */
 template (value) AMI_Msg
-ts_AMI_Action_Login(charstring username, charstring secret) := {
+ts_AMI_Action_Login(charstring username,
+                   charstring secret,
+                   template (value) charstring action_id := "0001") := {
        ts_AMI_Field_Action("Login"),
+       ts_AMI_Field_ActionId(action_id),
        ts_AMI_Field_Username(username),
        ts_AMI_Field_Secret(secret)
 };

 template (present) AMI_Msg
 tr_AMI_Action_Login(template(present) charstring username := ?,
-                   template(present) charstring secret := ?) := superset(
+                   template(present) charstring secret := ?,
+                   template (present) charstring action_id := ?) := superset(
        tr_AMI_Field_Action("Login"),
+       tr_AMI_Field_ActionId(action_id),
        tr_AMI_Field_Username(username),
        tr_AMI_Field_Secret(secret)
 );
@@ -468,7 +473,8 @@
 }

 function f_ami_action_login(AMI_Msg_PT pt, charstring username, charstring 
secret) {
-       f_ami_transceive_match_response_success(pt, 
ts_AMI_Action_Login(username, secret));
+       var charstring reg_action_id := f_gen_action_id();
+       f_ami_transceive_match_response_success(pt, 
ts_AMI_Action_Login(username, secret, reg_action_id));
 }

 function f_ami_action_PJSIPRegister(AMI_Msg_PT pt, charstring register) {

--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/36763?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: Iec320762ff0cca86319f7374b53c642f08a6e6df
Gerrit-Change-Number: 36763
Gerrit-PatchSet: 3
Gerrit-Owner: pespin <[email protected]>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: osmith <[email protected]>
Gerrit-Reviewer: pespin <[email protected]>
Gerrit-MessageType: merged

Reply via email to