pespin has uploaded this change for review. ( 
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(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks 
refs/changes/63/36763/1

diff --git a/asterisk/AMI_Functions.ttcn b/asterisk/AMI_Functions.ttcn
index a6c7aec..4935638 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)
 );
@@ -466,7 +471,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: 1
Gerrit-Owner: pespin <[email protected]>
Gerrit-MessageType: newchange

Reply via email to