Asterisk: Initial AMI support

Introduce config and functions around TELNETasp_PT to implement an AMI
interface client to interact with Asterisk.

So far only the "Action: Login" case is implemented.

Change-Id: I2c570e4d04e7ab8c44962cf484e4bbc946209aee
diff --git a/asterisk/Asterisk_Tests.ttcn b/asterisk/Asterisk_Tests.ttcn
index 151041d..c883bac 100644
--- a/asterisk/Asterisk_Tests.ttcn
+++ b/asterisk/Asterisk_Tests.ttcn
@@ -16,6 +16,8 @@
 import from Osmocom_Types all;
 import from Native_Functions all;
 import from Misc_Helpers all;
+import from TELNETasp_PortType all;
+import from AMI_Functions all;
 
 import from SDP_Types all;
 import from SDP_Templates all;
@@ -29,6 +31,10 @@
 	integer mp_local_sip_port := 5060;
 	charstring mp_remote_sip_host := "127.0.0.1";
 	integer mp_remote_sip_port := 5060;
+
+	/* Asterisk AMI: */
+	charstring mp_ami_user := "test_user";
+	charstring mp_ami_secret := "1234";
 }
 
 type port Coord_PT message
@@ -44,6 +50,7 @@
 
 type component test_CT {
 	var SIP_Emulation_CT vc_SIP;
+	port TELNETasp_PT AMI;
 	port Coord_PT COORD;
 }
 
@@ -159,7 +166,14 @@
 	mt := t_CallParsMT
 }
 
+/* Initialize connection towards Asterisk AMI */
+private function f_init_ami() runs on test_CT {
+	map(self:AMI, system:AMI);
+	f_ami_action_login(AMI, mp_ami_user, mp_ami_secret);
+}
+
 function f_init() runs on test_CT {
+	f_init_ami();
 	f_init_sip(vc_SIP, "Asterisk_Test");
 	log("end of f_init");
 }