[ previous ] [ next ] [ threads ]
 To :  yate@v...
 From :  Luca Olivetti <luca@v...>
 Subject :  Re: [yate] issue about yate behind nat
 Date :  Tue, 12 Sep 2017 20:36:44 +0200
El 12/09/17 a les 19:40, Luca Olivetti ha escrit:

> but now my line in call.answered
> 
> .*=;osip_Contact=sip:${caller}@c...:56060;maxcall=30000;timeout=300000 
> 

OK, I think that now I have the configuration that covers all bases 
(calls from outside to inside, from inside to outside and from inside to 
inside, I don't need to manage from outside to outside) and either party 
can terminate the call

To recap:

------[ javascript to get my public ip ]-----------------------------

javascript to get the public ip address

function myExec(msg)
{
var pippo=DNS.queryA("olivetti.dhis.org",false);
Engine.debug(pippo[0]);
var ipmsg=new Message("ventoso.nat_address");
ipmsg.message="ventoso.nat_address";
ipmsg.ip=pippo[0];
ipmsg.dispatch();
Engine.debug("********************************************************");
return false;
}

Message.install(myExec, "call.route", 40);

----------[ in regexroute.conf ]---------------------------------


[extra]
call.execute=50
call.answered=50
call.route=50
ventoso.nat_address=50

[call.route]
.*=;osip_Contact=sip:${caller}@c...:56060;maxcall=30000;timeout=300000;nat_address=$(nat_address)

[call.execute]
${callto}.*192\.168\.10\.=;nat_address=192.168.10.30
${callto}.*192\.168\.10\.^=;nat_address=$(nat_address)
.*=;osip_Contact=sip:${caller}@c...:56060;maxcall=30000;timeout=300000


[call.answered]
${sip_contact}sip:\([^@]*\)@=;osip_Contact=;maxcall=30000;timeout=300000

[ventoso.nat_address]
${ip}.=;$nat_address=${ip}