Re: [SR-Users] remote ip address of sender and receiver
Let me know how do you test it? You should write it in Request-route block On 30 Jun 2017 13:04, "vuleetu"wrote: > I tried, but no luck. Could you tell which route block i should place > these code to? > > On Thu, Jun 29, 2017 at 10:57 PM, Mojtaba wrote: > >> Hi. >> I wrote this code, I check do the both peers are in the same network >> or not. It works correctly. >> # Check if both peers are in the same network(nat). >> if (is_method("INVITE")){ >> lookup("location","m"); >> $var(x) = $(ru{s.select,1,@}); >> $var(y) = $(var(x){s.select,0,:}); >> if ($var(y) == $si) >> $var(nat) = "yes"; >> else >> $var(nat) = "no"; >> >> } >> With Regagrds. >> Mojtaba Esfandiari.S >> >> On Thu, Jun 29, 2017 at 6:57 PM, vuleetu wrote: >> > Hi, all >> > >> >Is there any way to get remote ip address of both sender($si) and >> > receiver(?)? I am configuring kamailio with multiple rtpproxy sets. >> > Basically, rtpproxy set will be choosed based on the country those ip >> > addresses of caller and callee belong to. Lets say if caller and callee >> are >> > both in US, set 1 will selected. If they are not in the same country, >> set 2 >> > will be selected. I dont know if there is any way to do that. >> > >> > >> > Best regards >> > >> > Fisher >> > >> > ___ >> > Kamailio (SER) - Users Mailing List >> > sr-users@lists.kamailio.org >> > https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users >> > >> >> >> >> -- >> --Mojtaba Esfandiari.S >> >> ___ >> Kamailio (SER) - Users Mailing List >> sr-users@lists.kamailio.org >> https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users >> > > > ___ > Kamailio (SER) - Users Mailing List > sr-users@lists.kamailio.org > https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users > > ___ Kamailio (SER) - Users Mailing List sr-users@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
Re: [SR-Users] remote ip address of sender and receiver
yes, i just want remote user's ip address. It is the received filed of location table. After try the suggestion you gave, i still can't get remote ip address of remote receiver. On Thu, Jun 29, 2017 at 10:46 PM, Sebastian Dammwrote: > Hi, > > where do you get the IP address of the receiver from? You can get the > local interface address of Kamailio where the request was received > with $Ri, but I guess you want the IP address of the target host. If > you are dealing with locally registered users only, you can use the > request URI after calling lookup("location"). This should contain the > target's IP address somewhere. > > Best Regards, > Sebastian > > On Thu, Jun 29, 2017 at 4:27 PM, vuleetu wrote: > > Hi, all > > > >Is there any way to get remote ip address of both sender($si) and > > receiver(?)? I am configuring kamailio with multiple rtpproxy sets. > > Basically, rtpproxy set will be choosed based on the country those ip > > addresses of caller and callee belong to. Lets say if caller and callee > are > > both in US, set 1 will selected. If they are not in the same country, > set 2 > > will be selected. I dont know if there is any way to do that. > > > > > > Best regards > > > > Fisher > > > > ___ > > Kamailio (SER) - Users Mailing List > > sr-users@lists.kamailio.org > > https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users > > > > ___ > Kamailio (SER) - Users Mailing List > sr-users@lists.kamailio.org > https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users > ___ Kamailio (SER) - Users Mailing List sr-users@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
Re: [SR-Users] remote ip address of sender and receiver
I tried, but no luck. Could you tell which route block i should place these code to? On Thu, Jun 29, 2017 at 10:57 PM, Mojtabawrote: > Hi. > I wrote this code, I check do the both peers are in the same network > or not. It works correctly. > # Check if both peers are in the same network(nat). > if (is_method("INVITE")){ > lookup("location","m"); > $var(x) = $(ru{s.select,1,@}); > $var(y) = $(var(x){s.select,0,:}); > if ($var(y) == $si) > $var(nat) = "yes"; > else > $var(nat) = "no"; > > } > With Regagrds. > Mojtaba Esfandiari.S > > On Thu, Jun 29, 2017 at 6:57 PM, vuleetu wrote: > > Hi, all > > > >Is there any way to get remote ip address of both sender($si) and > > receiver(?)? I am configuring kamailio with multiple rtpproxy sets. > > Basically, rtpproxy set will be choosed based on the country those ip > > addresses of caller and callee belong to. Lets say if caller and callee > are > > both in US, set 1 will selected. If they are not in the same country, > set 2 > > will be selected. I dont know if there is any way to do that. > > > > > > Best regards > > > > Fisher > > > > ___ > > Kamailio (SER) - Users Mailing List > > sr-users@lists.kamailio.org > > https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users > > > > > > -- > --Mojtaba Esfandiari.S > > ___ > Kamailio (SER) - Users Mailing List > sr-users@lists.kamailio.org > https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users > ___ Kamailio (SER) - Users Mailing List sr-users@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
[SR-Users] remote ip address of sender and receiver
Hi, all Is there any way to get remote ip address of both sender($si) and receiver(?)? I am configuring kamailio with multiple rtpproxy sets. Basically, rtpproxy set will be choosed based on the country those ip addresses of caller and callee belong to. Lets say if caller and callee are both in US, set 1 will selected. If they are not in the same country, set 2 will be selected. I dont know if there is any way to do that. Best regards Fisher ___ Kamailio (SER) - Users Mailing List sr-users@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
Re: [SR-Users] remote ip address of sender and receiver
Hi. I wrote this code, I check do the both peers are in the same network or not. It works correctly. # Check if both peers are in the same network(nat). if (is_method("INVITE")){ lookup("location","m"); $var(x) = $(ru{s.select,1,@}); $var(y) = $(var(x){s.select,0,:}); if ($var(y) == $si) $var(nat) = "yes"; else $var(nat) = "no"; } With Regagrds. Mojtaba Esfandiari.S On Thu, Jun 29, 2017 at 6:57 PM, vuleetuwrote: > Hi, all > >Is there any way to get remote ip address of both sender($si) and > receiver(?)? I am configuring kamailio with multiple rtpproxy sets. > Basically, rtpproxy set will be choosed based on the country those ip > addresses of caller and callee belong to. Lets say if caller and callee are > both in US, set 1 will selected. If they are not in the same country, set 2 > will be selected. I dont know if there is any way to do that. > > > Best regards > > Fisher > > ___ > Kamailio (SER) - Users Mailing List > sr-users@lists.kamailio.org > https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users > -- --Mojtaba Esfandiari.S ___ Kamailio (SER) - Users Mailing List sr-users@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
Re: [SR-Users] remote ip address of sender and receiver
Hi, where do you get the IP address of the receiver from? You can get the local interface address of Kamailio where the request was received with $Ri, but I guess you want the IP address of the target host. If you are dealing with locally registered users only, you can use the request URI after calling lookup("location"). This should contain the target's IP address somewhere. Best Regards, Sebastian On Thu, Jun 29, 2017 at 4:27 PM, vuleetuwrote: > Hi, all > >Is there any way to get remote ip address of both sender($si) and > receiver(?)? I am configuring kamailio with multiple rtpproxy sets. > Basically, rtpproxy set will be choosed based on the country those ip > addresses of caller and callee belong to. Lets say if caller and callee are > both in US, set 1 will selected. If they are not in the same country, set 2 > will be selected. I dont know if there is any way to do that. > > > Best regards > > Fisher > > ___ > Kamailio (SER) - Users Mailing List > sr-users@lists.kamailio.org > https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users > ___ Kamailio (SER) - Users Mailing List sr-users@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
[SR-Users] remote ip address of sender and receiver
Hi, all Is there any way to get remote ip address of both sender($si) and receiver(?)? I am configuring kamailio with multiple rtpproxy sets. Basically, rtpproxy set will be choosed based on the country those ip addresses of caller and callee belong to. Lets say if caller and callee are both in US, set 1 will selected. If they are not in the same country, set 2 will be selected. I dont know if there is any way to do that. Best regards Fisher ___ Kamailio (SER) - Users Mailing List sr-users@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users