asterisk: AMI: Wait for Event Registry after IMS REGISTER

Change-Id: I735a4298ec0d13009d8971880fe870810608d7e0
diff --git a/asterisk/AMI_Functions.ttcn b/asterisk/AMI_Functions.ttcn
index be1be70..a82af97 100644
--- a/asterisk/AMI_Functions.ttcn
+++ b/asterisk/AMI_Functions.ttcn
@@ -27,11 +27,14 @@
 
 const charstring AMI_FIELD_ACTION := "Action";
 const charstring AMI_FIELD_ACTION_ID := "ActionID";
+const charstring AMI_FIELD_CHAN_TYPE := "ChannelType";
+const charstring AMI_FIELD_DOMAIN := "Domain";
 const charstring AMI_FIELD_EVENT := "Event";
 const charstring AMI_FIELD_INFO := "Info";
-const charstring AMI_FIELD_USERNAME := "Username";
-const charstring AMI_FIELD_SECRET := "Secret";
 const charstring AMI_FIELD_RESPONSE := "Response";
+const charstring AMI_FIELD_SECRET := "Secret";
+const charstring AMI_FIELD_STATUS := "Status";
+const charstring AMI_FIELD_USERNAME := "Username";
 
 /* Extensions: */
 const charstring AMI_FIELD_ALGORITHM := "Algorithm";
@@ -85,13 +88,19 @@
 template (value) AMI_Field
 ts_AMI_Field_ActionId(template (value) charstring val) := ts_AMI_Field(AMI_FIELD_ACTION_ID, val);
 template (value) AMI_Field
+ts_AMI_Field_ChannelType(template (value) charstring val) := ts_AMI_Field(AMI_FIELD_CHAN_TYPE, val);
+template (value) AMI_Field
+ts_AMI_Field_Domain(template (value) charstring val) := ts_AMI_Field(AMI_FIELD_DOMAIN, val);
+template (value) AMI_Field
 ts_AMI_Field_Event(template (value) charstring val) := ts_AMI_Field(AMI_FIELD_EVENT, val);
 template (value) AMI_Field
 ts_AMI_Field_Info(template (value) charstring val) := ts_AMI_Field(AMI_FIELD_INFO, val);
 template (value) AMI_Field
-ts_AMI_Field_Username(template (value) charstring val) := ts_AMI_Field(AMI_FIELD_USERNAME, val);
-template (value) AMI_Field
 ts_AMI_Field_Secret(template (value) charstring val) := ts_AMI_Field(AMI_FIELD_SECRET, val);
+template (value) AMI_Field
+ts_AMI_Field_Status(template (value) charstring val) := ts_AMI_Field(AMI_FIELD_STATUS, val);
+template (value) AMI_Field
+ts_AMI_Field_Username(template (value) charstring val) := ts_AMI_Field(AMI_FIELD_USERNAME, val);
 /* Extensions: */
 template (value) AMI_Field
 ts_AMI_Field_Algorithm(template (value) charstring val) := ts_AMI_Field(AMI_FIELD_ALGORITHM, val);
@@ -115,15 +124,21 @@
 template (present) AMI_Field
 tr_AMI_Field_ActionId(template (present) charstring val := ?) := tr_AMI_Field(pattern @nocase AMI_FIELD_ACTION_ID, val);
 template (present) AMI_Field
+tr_AMI_Field_ChannelType(template (present) charstring val := ?) := tr_AMI_Field(pattern @nocase AMI_FIELD_CHAN_TYPE, val);
+template (present) AMI_Field
+tr_AMI_Field_Domain(template (present) charstring val := ?) := tr_AMI_Field(pattern @nocase AMI_FIELD_DOMAIN, val);
+template (present) AMI_Field
 tr_AMI_Field_Event(template (present) charstring val := ?) := tr_AMI_Field(pattern @nocase AMI_FIELD_EVENT, val);
 template (present) AMI_Field
 tr_AMI_Field_Info(template (present) charstring val := ?) := tr_AMI_Field(pattern @nocase AMI_FIELD_INFO, val);
 template (present) AMI_Field
-tr_AMI_Field_Username(template (present) charstring val := ?) := tr_AMI_Field(pattern @nocase AMI_FIELD_USERNAME, val);
+tr_AMI_Field_Response(template (present) charstring val := ?) := tr_AMI_Field(pattern @nocase AMI_FIELD_RESPONSE, val);
 template (present) AMI_Field
 tr_AMI_Field_Secret(template (present) charstring val := ?) := tr_AMI_Field(pattern @nocase AMI_FIELD_SECRET, val);
 template (present) AMI_Field
-tr_AMI_Field_Response(template (present) charstring val := ?) := tr_AMI_Field(pattern @nocase AMI_FIELD_RESPONSE, val);
+tr_AMI_Field_Status(template (present) charstring val := ?) := tr_AMI_Field(pattern @nocase AMI_FIELD_STATUS, val);
+template (present) AMI_Field
+tr_AMI_Field_Username(template (present) charstring val := ?) := tr_AMI_Field(pattern @nocase AMI_FIELD_USERNAME, val);
 /* Extensions: */
 template (present) AMI_Field
 tr_AMI_Field_Algorithm(template (present) charstring val := ?) := tr_AMI_Field(pattern @nocase AMI_FIELD_ALGORITHM, val);
@@ -304,6 +319,25 @@
 	tr_AMI_Field_AUTN(autn)
 );
 
+/* Event: Registry
+ * Privilege: system,all
+ * ChannelType: PJSIP
+ * Username: sip:238010000090828@172.18.155.103
+ * Domain: sip:172.18.155.103
+ * Status: Registered
+ */
+template (present) AMI_Msg
+tr_AMI_Event_Registry(template (present) charstring username := ?,
+		      template (present) charstring domain := ?,
+		      template (present) charstring status := ?,
+		      template (present) charstring chan_type := "PJSIP") := superset(
+	tr_AMI_Field_Event("Registry"),
+	tr_AMI_Field_ChannelType(chan_type),
+	tr_AMI_Field_Username(username),
+	tr_AMI_Field_Domain(domain),
+	tr_AMI_Field_Status(status)
+);
+
 /***********************
  * Adapter:
  ***********************/