blob: 06072af71a66aaaa3ee56a42757fb1fe676d7fe5 [file] [log] [blame]
Harald Welte2c6dba12017-09-16 00:50:08 +08001module MGCP_CodecPort {
2
3 import from IPL4asp_PortType all;
4 import from IPL4asp_Types all;
5 import from MGCP_Types all;
6
7 type record MGCP_RecvFrom {
8 ConnectionId connId,
9 HostName remName,
10 PortNumber remPort,
11 HostName locName,
12 PortNumber locPort,
13 MgcpMessage msg
Harald Welte3c6ebb92017-09-16 00:56:57 +080014 };
15
16 template MGCP_RecvFrom t_MGCP_RecvFrom(template MgcpMessage msg) := {
17 connId := ?,
18 remName := ?,
19 remPort := ?,
20 locName := ?,
21 locPort := ?,
22 msg := msg
Harald Welte2c6dba12017-09-16 00:50:08 +080023 }
24
25 type record MGCP_Send {
26 ConnectionId connId,
27 MgcpMessage msg
28 }
29
Harald Welte3c6ebb92017-09-16 00:56:57 +080030 template MGCP_Send t_MGCP_Send(template ConnectionId connId, template MgcpMessage msg) := {
31 connId := connId,
32 msg := msg
33 }
34
Harald Welte2c6dba12017-09-16 00:50:08 +080035 private function IPL4_to_MGCP_RecvFrom(in ASP_RecvFrom pin, out MGCP_RecvFrom pout) {
36 pout.connId := pin.connId;
37 pout.remName := pin.remName;
38 pout.remPort := pin.remPort;
39 pout.locName := pin.locName;
40 pout.locPort := pin.locPort;
Harald Welte9ccb4802017-09-17 16:22:34 +080041 /* FIXME: This should actually be the below:
42 pout.msg := dec_MgcpMessage(oct2char(pin.msg)); - see
43 https://www.eclipse.org/forums/index.php/t/1088893/
44 */
45 pout.msg := { response := dec_MgcpResponse(oct2char(pin.msg)) };
Harald Welte2c6dba12017-09-16 00:50:08 +080046 } with { extension "prototype(fast)" };
47
48 private function MGCP_to_IPL4_Send(in MGCP_Send pin, out ASP_Send pout) {
49 pout.connId := pin.connId;
50 pout.proto := { udp := {} };
51 pout.msg := char2oct(enc_MgcpMessage(pin.msg));
52 } with { extension "prototype(fast)" };
53
54 type port MGCP_CODEC_PT message {
55 out MGCP_Send;
56 in MGCP_RecvFrom,
Harald Welte45295c52017-11-18 13:00:57 +010057 ASP_ConnId_ReadyToRelease,
Harald Welte2c6dba12017-09-16 00:50:08 +080058 ASP_Event;
59 } with { extension "user IPL4asp_PT
60 out(MGCP_Send -> ASP_Send:function(MGCP_to_IPL4_Send))
61 in(ASP_RecvFrom -> MGCP_RecvFrom: function(IPL4_to_MGCP_RecvFrom);
Harald Welte45295c52017-11-18 13:00:57 +010062 ASP_ConnId_ReadyToRelease -> ASP_ConnId_ReadyToRelease: simple;
Harald Welte2c6dba12017-09-16 00:50:08 +080063 ASP_Event -> ASP_Event: simple)"
64 }
65}