mhomed=1

Kam will auto select the socket


On Mon, Apr 1, 2019 at 1:59 PM David Villasmil <
[email protected]> wrote:

> anyone? :)
>
> David Villasmil
> email: [email protected]
> phone: +34669448337
>
>
> On Mon, Apr 1, 2019 at 4:37 PM David Villasmil <
> [email protected]> wrote:
>
>> Hello guys,
>> I have public and private IPs, and i need to force the sending socket
>> replying to internal out externals endpoint, so i'm using this:
>>
>> function to check the destination (i tried using $sndto(ip) but it always
>> returns NULL):
>>
>> route[CHECK_DEST_NET] {
>> if ( $du=~"sip:172\..*" ) {
>> setflag(FLAG_TO_PRIVATE);
>> xlog("L_ERR", "[CHECK_SOURCE] Packet going to PRIVATE -> [$du]\n" );
>> } else {
>> setflag(FLAG_TO_PUBLIC);
>> xlog("L_ERR", "[CHECK_SOURCE] Packet going to PUBLIC -> [$du]\n" );
>> }
>>
>> return;
>> }
>>
>> on my relay:
>>
>> route(CHECK_DEST_NET);
>>
>> if (isflagset(FLAG_TO_PRIVATE)) {
>> xlog("L_ERR", "[RELAY] forcing socket to PRIVATE NET\n" );
>> force_send_socket(LISTEN_INSIDE_IF:LISTEN_INSIDE_PORT);
>> } else {
>> xlog("L_ERR", "[RELAY] forcing socket to PUBLIC NET\n" );
>> force_send_socket(LISTEN_OUTSIDE_IF:LISTEN_OUTSIDE_PORT);
>> }
>>
>>
>> This works nicely, except for ACKs and potentially other packets sent
>> statelessly?
>>
>> Anyone knows how to fix this?
>>
>> Regards,
>>
>> David Villasmil
>> email: [email protected]
>> phone: +34669448337
>>
> _______________________________________________
> Kamailio (SER) - Users Mailing List
> [email protected]
> https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
>
_______________________________________________
Kamailio (SER) - Users Mailing List
[email protected]
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users

Reply via email to