Just ate a bowl of authentic Chaozhou beef tendon pills and a braised egg, is to give their own birthday gift.
This week's work revolves around only one theme, "MGCP's ALG function implementation."
1. Application Scenario:
A terminal device running MGCP Voice protocol, through a router to reach the public network, registered to the MGCP server;
2. Question:
Through the router's MGCP signaling packet, RTP/RTCP stream needs to be snat, because the Snat IP and port can not be determined, so that "out of the MGCP signaling contained in the SDP information (IP and Port)" and "the actual RTP/RTCP stream IP and port" does not match, This makes it possible for the two sides to hear each other during a telephone call.
3. Resolution:
A. Add a pat on the router that corresponds to its original snat, which is a two-way Nat. The IP of the SDP that configures the terminal device at the same time is the WAN port IP of the router. This method is simple and effective, but requires the user to modify the configuration.
B. Add the MGCP alg function on the router, which automatically modifies the IP and port inside the SDP information in the MGCP signaling. This method requires the kernel module code to be changed, but it is not necessary for the user to modify the configuration.
4. The idea of Solution B:
Reference SIP's ALG function code: NF_CONNTRACK_SIP.C, NF_NAT_SIP.C, add nf_conntrack_mgcp.c, nf_nat_mgcp.c, compile Nf_conntrack_mgcp.ko, NF _nat_mgcp.ko, and then insmod go in before the router runs the app. Since MGCP's ALG is a lot simpler, it is almost easy to modify a small portion of the code just by cutting most of the code on the SIP.
The realization of MGCP's ALG function