[sr-dev] [kamailio] registrar: Custom socket string for location table (related to pr #470) (#471)

Ian Yu-Hsun Lin notifications at github.com
Fri Jan 8 04:52:19 CET 2016


# Environment

Kamailio-433 installed behind nat (Amazon EC2 or Google Compute Engine) using config

```cfg
listen=PRIVATE_IP:PORT advertise PUBLIC_IP:PORT
```

# What I wanted to do

In table `location`, the column `socket` will be stored in the form of  "PROTO:**PRIVATE_IP**:PORT" while for some reasons I would like it to be stored as "PROTO:**PUBLIC_IP**:PORT"

Through the `registrar` document there is the [xavp_cfg](http://wwwkamailioorg/docs/modules/43x/modules/registrarhtml#registrarpxavp_cfg) parameter that can be used in conjunction with the attribute "socket" to specify the socket string From my understanding this might be the solution to my requirement

# Problem

The column `location``socket` wasn't changed when setting the custom socket string via `xavp_cfg`

After looking into the source code, firstly, a potential bug (correct me if I'm wrong) that it would reset the `sock_flag` to -1 (no flags) even if `reg_xavp_cfg` and `sock_flag` is set A pull request #470 has been opened for this

Secondly, if we pass the above problem, in `savec` it did grab the socket string from xavp_cfg and in function `grep_sock_info()` the socket string was checked with all the address we listen on, including the advertised public address via `socket_info->useinfo` But the returned socket structure still contains the private address info

# Conclusion so far

So, I wasn't sure if using the parameter `xavp_cfg` for setting socket string and stores it in location table make sense or not If yes, can you please giving me some hints about the potential way to extend this?

Cheers,
Ian

---
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/471
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sip-router.org/pipermail/sr-dev/attachments/20160107/e921112f/attachment-0001.html>


More information about the sr-dev mailing list