osmux: Send the CI as part of the dummy to help to identify a client

We need to discover the remote port as we are likely behind a NAT.
Right now the NAT code will just send to port 1984 on the BSC but
this might not arrive at the BSC. Include the CI (in the future we
need to include the endpoint address or send the dummy to the net
port). This is just an interim solution.
This commit is contained in:
Holger Hans Peter Freyther 2014-07-09 00:32:00 +02:00
parent 3b8ab41ab0
commit caf3dd07a4
1 changed files with 7 additions and 2 deletions

View File

@ -393,11 +393,16 @@ int osmux_enable_endpoint(struct mgcp_endpoint *endp, int role)
*/
int osmux_send_dummy(struct mgcp_endpoint *endp)
{
static char buf[] = { MGCP_DUMMY_LOAD };
uint32_t ci_be;
char buf[1 + sizeof(uint32_t)];
ci_be = htonl(endp->ci);
buf[0] = MGCP_DUMMY_LOAD;
memcpy(&buf[1], &ci_be, sizeof(ci_be));
LOGP(DMGCP, LOGL_DEBUG, "sending OSMUX dummy load to %s\n",
inet_ntoa(endp->net_end.addr));
return mgcp_udp_send(osmux_fd.fd, &endp->net_end.addr,
htons(OSMUX_PORT), buf, 1);
htons(OSMUX_PORT), buf, sizeof(buf));
}