blob: d1b1d19b63ab696faf61d669f97a1b17c0c8ee9e [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;
41 pout.msg := dec_MgcpMessage(oct2char(pin.msg));
42 } with { extension "prototype(fast)" };
43
44 private function MGCP_to_IPL4_Send(in MGCP_Send pin, out ASP_Send pout) {
45 pout.connId := pin.connId;
46 pout.proto := { udp := {} };
47 pout.msg := char2oct(enc_MgcpMessage(pin.msg));
48 } with { extension "prototype(fast)" };
49
50 type port MGCP_CODEC_PT message {
51 out MGCP_Send;
52 in MGCP_RecvFrom,
53 ASP_Event;
54 } with { extension "user IPL4asp_PT
55 out(MGCP_Send -> ASP_Send:function(MGCP_to_IPL4_Send))
56 in(ASP_RecvFrom -> MGCP_RecvFrom: function(IPL4_to_MGCP_RecvFrom);
57 ASP_Event -> ASP_Event: simple)"
58 }
59}