Hello,
We are using Kamailio 4.2 and RTPEngine 3.3 hosted on a VM
behind NAT in Google Cloud Engine.
Asterisk 11 + Kamailio + RTPEngine are on the same machine
and Kamailio is used as WebRTC Gateway.
INVITES, that are rewritten by Kamailio look like the
following:
Via: SIP/2.0/UDP
0.0.0.0:5064;branch=z9hG4bK86f5.88fb7f8810c91758b5f3962420d3a4ef.0
Via: SIP/2.0/UDP
10.240.1.95:5060;received=127.0.0.1;branch=z9hG4bK05952ee6;rport=5060
Max-Forwards: 69
CSeq: 102 INVITE
User-Agent: Asterisk PBX 11.13.1
Date: Mon, 03 Nov 2014 09:01:39 GMT
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER,
SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
Content-Type: application/sdp
Content-Length: 676
P-hint: outbound
As you can see, Kamailio uses 0.0.0.0 for Record-Route as
well as for VIA Header.
It uses the address configured in kamilio.cfg (listen=udp:
0.0.0.0:5064)
I know, that we could use the advertise parameter to tell
kamailio the external IP. The problem is, that IPs in GCE are
dynamically assigned to the VMs. Thus static configuration of
external IP is not sufficient for our setup.
Is there a way, to let Kamailio gather it's external IP
dynamically. (E.g. using a STUN server or something like
that?)
Another possibility would be to tell Kamailio it's external
IP via a start parameter. Is that possible?