mgw: Add RTP_CodecPort throguh which we can send/receive RTP+RTCP
diff --git a/mgw/RTP_CodecPort.ttcn b/mgw/RTP_CodecPort.ttcn
new file mode 100644
index 0000000..f9293f4
--- /dev/null
+++ b/mgw/RTP_CodecPort.ttcn
@@ -0,0 +1,61 @@
+module RTP_CodecPort {
+
+	import from IPL4asp_PortType all;
+	import from IPL4asp_Types all;
+	import from RTP_Types all;
+
+	type record RTP_RecvFrom {
+		ConnectionId		connId,
+		HostName		remName,
+		PortNumber		remPort,
+		HostName		locName,
+		PortNumber		locPort,
+		RTP_messages_union	msg
+	};
+
+	template RTP_RecvFrom t_RTP_RecvFrom(template RTP_messages_union msg) := {
+		connId := ?,
+		remName := ?,
+		remPort := ?,
+		locName := ?,
+		locPort := ?,
+		msg := msg
+	}
+
+	type record RTP_Send {
+		ConnectionId		connId,
+		RTP_messages_union	msg
+	}
+
+	template RTP_Send t_RTP_Send(template ConnectionId connId, template RTP_messages_union msg) := {
+		connId := connId,
+		msg := msg
+	}
+
+	private function IPL4_to_RTP_RecvFrom(in ASP_RecvFrom pin, out RTP_RecvFrom pout) {
+		pout.connId := pin.connId;
+		pout.remName := pin.remName;
+		pout.remPort := pin.remPort;
+		pout.locName := pin.locName;
+		pout.locPort := pin.locPort;
+		pout.msg := f_RTP_dec(pin.msg)
+	} with { extension "prototype(fast)" };
+
+	private function RTP_to_IPL4_Send(in RTP_Send pin, out ASP_Send pout) {
+		pout.connId := pin.connId;
+		pout.proto := { udp := {} };
+		pout.msg := f_RTP_enc(pin.msg);
+	} with { extension "prototype(fast)" };
+
+	type port RTP_CODEC_PT message {
+		out	RTP_Send;
+		in	RTP_RecvFrom,
+			ASP_ConnId_ReadyToRelease,
+			ASP_Event;
+	} with { extension "user IPL4asp_PT
+		out(RTP_Send -> ASP_Send:function(RTP_to_IPL4_Send))
+		in(ASP_RecvFrom -> RTP_RecvFrom: function(IPL4_to_RTP_RecvFrom);
+		   ASP_ConnId_ReadyToRelease -> ASP_ConnId_ReadyToRelease: simple;
+		   ASP_Event -> ASP_Event: simple)"
+	}
+}
diff --git a/mgw/RTP_CodecPort_CtrlFunct.ttcn b/mgw/RTP_CodecPort_CtrlFunct.ttcn
new file mode 100644
index 0000000..9f6cad2
--- /dev/null
+++ b/mgw/RTP_CodecPort_CtrlFunct.ttcn
@@ -0,0 +1,44 @@
+module RTP_CodecPort_CtrlFunct {
+
+  import from RTP_CodecPort all;
+  import from IPL4asp_Types all;
+
+  external function f_IPL4_listen(
+    inout RTP_CODEC_PT portRef,
+    in HostName locName,
+    in PortNumber locPort,
+    in ProtoTuple proto,
+    in OptionList options := {}
+  ) return Result;
+
+  external function f_IPL4_connect(
+    inout RTP_CODEC_PT portRef,
+    in HostName remName,
+    in PortNumber remPort,
+    in HostName locName,
+    in PortNumber locPort,
+    in ConnectionId connId,
+    in ProtoTuple proto,
+    in OptionList options := {}
+  ) return Result;
+
+  external function f_IPL4_close(
+    inout RTP_CODEC_PT portRef,
+    in ConnectionId id,
+    in ProtoTuple proto := { unspecified := {} }
+  ) return Result;
+
+  external function f_IPL4_setUserData(
+    inout RTP_CODEC_PT portRef,
+    in ConnectionId id,
+    in UserData userData
+  ) return Result;
+
+  external function f_IPL4_getUserData(
+    inout RTP_CODEC_PT portRef,
+    in ConnectionId id,
+    out UserData userData
+  ) return Result;
+
+}
+
diff --git a/mgw/RTP_CodecPort_CtrlFunctDef.cc b/mgw/RTP_CodecPort_CtrlFunctDef.cc
new file mode 100644
index 0000000..ce8e176
--- /dev/null
+++ b/mgw/RTP_CodecPort_CtrlFunctDef.cc
@@ -0,0 +1,56 @@
+#include "IPL4asp_PortType.hh"
+#include "RTP_CodecPort.hh"
+#include "IPL4asp_PT.hh"
+
+namespace RTP__CodecPort__CtrlFunct {
+
+  IPL4asp__Types::Result f__IPL4__listen(
+    RTP__CodecPort::RTP__CODEC__PT& portRef,
+    const IPL4asp__Types::HostName& locName,
+    const IPL4asp__Types::PortNumber& locPort,
+    const IPL4asp__Types::ProtoTuple& proto,
+    const IPL4asp__Types::OptionList& options)
+  {
+    return f__IPL4__PROVIDER__listen(portRef, locName, locPort, proto, options);
+  }
+  
+  IPL4asp__Types::Result f__IPL4__connect(
+    RTP__CodecPort::RTP__CODEC__PT& portRef,
+    const IPL4asp__Types::HostName& remName,
+    const IPL4asp__Types::PortNumber& remPort,
+    const IPL4asp__Types::HostName& locName,
+    const IPL4asp__Types::PortNumber& locPort,
+    const IPL4asp__Types::ConnectionId& connId,
+    const IPL4asp__Types::ProtoTuple& proto,
+    const IPL4asp__Types::OptionList& options)
+  {
+    return f__IPL4__PROVIDER__connect(portRef, remName, remPort,
+                                      locName, locPort, connId, proto, options);
+  }
+
+  IPL4asp__Types::Result f__IPL4__close(
+    RTP__CodecPort::RTP__CODEC__PT& portRef, 
+    const IPL4asp__Types::ConnectionId& connId, 
+    const IPL4asp__Types::ProtoTuple& proto)
+  {
+      return f__IPL4__PROVIDER__close(portRef, connId, proto);
+  }
+
+  IPL4asp__Types::Result f__IPL4__setUserData(
+    RTP__CodecPort::RTP__CODEC__PT& portRef,
+    const IPL4asp__Types::ConnectionId& connId,
+    const IPL4asp__Types::UserData& userData)
+  {
+    return f__IPL4__PROVIDER__setUserData(portRef, connId, userData);
+  }
+  
+  IPL4asp__Types::Result f__IPL4__getUserData(
+    RTP__CodecPort::RTP__CODEC__PT& portRef,
+    const IPL4asp__Types::ConnectionId& connId,
+    IPL4asp__Types::UserData& userData)
+  {
+    return f__IPL4__PROVIDER__getUserData(portRef, connId, userData);
+  }
+  
+}
+
diff --git a/mgw/gen_links.sh b/mgw/gen_links.sh
index 4b4e2b9..37c42a0 100755
--- a/mgw/gen_links.sh
+++ b/mgw/gen_links.sh
@@ -31,3 +31,11 @@
 FILES="SDP_EncDec.cc SDP_Types.ttcn SDP_parse_.tab.c SDP_parse_.tab.h SDP_parse_parser.h SDP_parser.l
 SDP_parser.y lex.SDP_parse_.c"
 gen_links $DIR $FILES
+
+DIR=$BASEDIR/titan.ProtocolModules.RTP/src
+FILES="RTP_EncDec.cc RTP_Types.ttcn"
+gen_links $DIR $FILES
+
+DIR=../library
+FILES="General_Types.ttcn"
+gen_links $DIR $FILES
diff --git a/mgw/regen_makefile.sh b/mgw/regen_makefile.sh
index ffdbd11..752ff1b 100755
--- a/mgw/regen_makefile.sh
+++ b/mgw/regen_makefile.sh
@@ -1,6 +1,6 @@
 #!/bin/sh
 
-FILES="*.ttcn SDP_EncDec.cc *.c MGCP_CodecPort_CtrlFunctDef.cc IPL4asp_PT.cc IPL4asp_discovery.cc TCCConversion.cc TCCInterface.cc"
+FILES="*.ttcn SDP_EncDec.cc *.c MGCP_CodecPort_CtrlFunctDef.cc IPL4asp_PT.cc IPL4asp_discovery.cc TCCConversion.cc TCCInterface.cc RTP_EncDec.cc RTP_CodecPort_CtrlFunctDef.cc"
 
 ttcn3_makefilegen -f MGCP_Test.ttcn $FILES
 sed -i -e 's/# TTCN3_DIR = /TTCN3_DIR = \/usr/' Makefile