El Monday 23 July 2007 17:50:58 Klaus Darilion escribió:
if you only want to prevent calls from sip1 to sip2 just compare the from domain with the domain in the ruri
if ( $rd != $fd) { sl_send_reply("403","forbidden"); exit; }
Hi again, let me just improving a little that solution because comparing $rd and $fd I had problems with presence.
I think it's better (and it's working perfect for me) to compare $fd and $td.
Note that the parameter: modparam("presence","server_address","sip:openser.domain.org") is the <Contact> header the clients will contact for future subscription, so in that cases the $rd will be "openser.domain.org" even if the From: is "user1@sip1.domain.org" who is subscribing to the presence of a To: "user2@sip1.domain.org". In that case $fd = sip1.domain.org and $rd = openser.domain.org, so it will fail. Because of it, IMHO is better to compare $fd with $td.
Just it, regads. :)