<div dir="ltr">Hello,<div><br></div><div>I'm not sure this is the best or even the right way, but i do that by figuring out where the call is coming from.</div><div>In my case, an INVITE from an RFC1918 IP address will always be internal to external and vice versa.</div><div> i.e.:</div><div><font face="monospace"><br></font></div><div><font face="monospace">    # If the Source IP is an RFC1918 address, it's coming from an internal endpoint, so the call is going out <br>    if (is_ip_rfc1918("$si")) { <br>        $dlg_var(rtp_direction) = "direction=internal direction=external"; <br>    } else { <br>        $dlg_var(rtp_direction) = "direction=external direction=internal"; <br>    }<br></font></div><div></div><div><br></div><div>You may even check both origin and destination domain ($du) and configure rtpengine accordingly.</div><div><br></div><div><font face="monospace">onsend_route { <br>    xlog("L_ERR", "[onsend_route] Packet going to $du\n" ); <br>    if (is_ip_rfc1918("$si") && is_ip_rfc1918("$du") ) { <br>        # call is internal to internal </font></div><div><font face="monospace"><br>    } else if (is_ip_rfc1918("$si") && !is_ip_rfc1918("$du")) {<br>        # call is internal to external </font></div><div><font face="monospace"><br>    } else if (!is_ip_rfc1918("$si") && !is_ip_rfc1918("$du")) {<br>        # call is external to external </font></div><div><font face="monospace"><br>    } else if (!is_ip_rfc1918("$si") && is_ip_rfc1918("$du")) {<br>        # call is external to internal <br>    }<br>}</font><br></div><div></div><div><br></div><div>Hope that makes sense and help you a little.<br clear="all"><div><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div>Regards,</div><div><br></div>David Villasmil<div>email: <a href="mailto:david.villasmil.work@gmail.com" target="_blank">david.villasmil.work@gmail.com</a></div><div>phone: +34669448337</div></div></div></div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Nov 21, 2019 at 6:11 AM Patrick Wakano <<a href="mailto:pwakano@gmail.com">pwakano@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>Hello list,</div><div>Hope you are all doing well!</div><div><br></div><div>I am trying to figure out a way to retrieve the local socket the t_relay() has decided to use in a mhomed=1 env. Is there a way to do that? I couldn't find any variable other than the $snd ones that maybe have this info, but I am not using onsend_route anyway.....<br></div><div>I am after this value because this is what I can use to figure out if I need to engage RTPEngine with parameters "external, internal", "external, external", "internal, external" or "internal, internal". In my case, my server is in between two networks, and calls can traverse or can be routed back to the same interface depending on what was decide by the LCR module. Signalling is fine, but engaging the RTPEngine must be done with the correct parameters to get the correct IPs in the SDP, other else I get one way audio in the call.....<br></div><div><br></div><div>Any help is much appreciated!</div><div></div><div>Thank you!<br></div><div>Kind regards,</div><div>Patrick Wakano<br></div><div><br></div><div><br></div></div>
_______________________________________________<br>
Kamailio (SER) - Users Mailing List<br>
<a href="mailto:sr-users@lists.kamailio.org" target="_blank">sr-users@lists.kamailio.org</a><br>
<a href="https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users" rel="noreferrer" target="_blank">https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users</a><br>
</blockquote></div>