<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Hi Joshua,<br>
<br>
Ok, I see - your opensips is actually in a private network.<br>
What you can do is to use instead of record_route() the
record_route_preset("pub_IP") function (see
<a class="moz-txt-link-freetext" href="http://www.opensips.org/html/docs/modules/1.7.x/rr.html#id250439">http://www.opensips.org/html/docs/modules/1.7.x/rr.html#id250439</a>) -
this will make opensips to advertise in RR the public IP.
Additionally set "alias = pub_IP" in your cfg (see
<a class="moz-txt-link-freetext" href="http://www.opensips.org/Resources/DocsCoreFcn17#toc26">http://www.opensips.org/Resources/DocsCoreFcn17#toc26</a>), so that
opensips will recognize its own pub IP in the Route hdr (in ACK)<br>
<br>
Regards,<br>
Bogdan<br>
<br>
On 03/14/2012 10:54 PM, Joshua Nankin wrote:
<blockquote
cite="mid:CAAYWZ8mBs8FMOvcRaqpR_EY39+6JMPTqwPUGcOLR5yKChscxuw@mail.gmail.com"
type="cite">Do I need to specify the public IPs of my asterisk
boxes in the load balancing table?
<div><br>
</div>
<div>Here's is what my carrier told me:</div>
<div><br>
</div>
<div><span style="">After looking into this issue further, it
appears you are not including the Record-route header for your
public IP address. The reason the call is failing currently is
because you have listed your internal IP address for us to
send the call too, however since we do not have access to your
internal IP address, we are unable to send this to you. You
can see this in the 200 OK that you send to us, where you
start with your internal IP, and go straight to our IP.</span></div>
<div><font color="#500050" face="arial, sans-serif"><br>
</font></div>
<div><font color="#500050" face="arial, sans-serif">You can find a
packet captures for the call here:</font></div>
<div><font color="#500050" face="arial, sans-serif"><br>
</font></div>
<div><font color="#500050" face="arial, sans-serif">Capture from
OpenSIPS: xxxxxxxxxxxxxx<a moz-do-not-send="true"
href="http://joshnankin.com/opensips.pcap"></a></font></div>
<div><span style="color: rgb(80, 0, 80); font-family:
arial,sans-serif;">Capture from Asterisk: xxxxxxxxxxxxxx</span></div>
<div><font color="#500050" face="arial, sans-serif"><br>
</font></div>
<div><font color="#500050" face="arial, sans-serif">Thanks,</font></div>
<div><font color="#500050" face="arial, sans-serif">Josh<br>
</font><br>
<div class="gmail_quote">
On Wed, Mar 14, 2012 at 1:02 PM, Joshua Nankin <span
dir="ltr"><<a moz-do-not-send="true"
href="mailto:jnankin@gmail.com">jnankin@gmail.com</a>></span>
wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt
0.8ex; border-left: 1px solid rgb(204, 204, 204);
padding-left: 1ex;">
Yeah, I'm seeing that now. I just did a capture and
verified, the<br>
200s are coming out of my Asterisk box, and OpenSIPS is
relaying them<br>
properly. I'm not getting the ACK back from my carrier.
I'm going to<br>
check with them and send the capture files I just generated
- they use<br>
IP whitelists, and this may just be a
authentication/security problem.<br>
<br>
Thanks again!<br>
<br>
-Josh<br>
<br>
On Wed, Mar 14, 2012 at 12:59 PM, Bogdan-Andrei Iancu<br>
<div class="HOEnZb">
<div class="h5"><<a moz-do-not-send="true"
href="mailto:bogdan@opensips.org">bogdan@opensips.org</a>>
wrote:<br>
> Hi Joshua,<br>
><br>
> It seams to be a lot of 200 OK retransmissions from
Asterisk because there<br>
> is no ACK from the original caller side.<br>
><br>
> Do you see the caller sending such ACK ? have you
tried to make a network<br>
> capture ?<br>
><br>
> Regards,<br>
> Bogdan<br>
><br>
><br>
><br>
> On 03/14/2012 06:27 PM, Joshua Nankin wrote:<br>
>><br>
>> Hey Bogdan!<br>
>><br>
>> So, it appears that the call gets to the LB and
is forwarded to<br>
>> Asterisk. Here's what happens in both the LB
logs and Asterisk:<br>
>><br>
>> Asterisk - <a moz-do-not-send="true"
href="http://pastebin.com/" target="_blank">http://pastebin.com/</a><br>
>> OpenSIPS - <a moz-do-not-send="true"
href="http://pastebin.com/" target="_blank">http://pastebin.com/</a><br>
>><br>
>><br>
>> I have debug=6 on OpenSIPS, so there's quite a
bit of logging<br>
>> happening for a pretty short call. It seems
that there's a<br>
>> retransmission problem here. Also, I'm trying
to negotiate T.38, so<br>
>> I'm not sure if that has something to do with
this.<br>
>><br>
>> Thanks,<br>
>> Josh<br>
>><br>
>> On Wed, Mar 14, 2012 at 7:25 AM, Bogdan-Andrei
Iancu<br>
>> <<a moz-do-not-send="true"
href="mailto:bogdan@opensips.org">bogdan@opensips.org</a>>
wrote:<br>
>>><br>
>>> Hi Joshua,<br>
>>><br>
>>> Have you checked (at network level) if the
actual call (the inbound one,<br>
>>> from a client) gets to opensips LB ? and if
so, if the call gets<br>
>>> forwarded<br>
>>> to Asterisk ?<br>
>>><br>
>>> Regards,<br>
>>> Bogdan<br>
>>><br>
>>><br>
>>> On 03/13/2012 10:00 PM, Joshua Nankin
wrote:<br>
>>>><br>
>>>> Hello,<br>
>>>><br>
>>>> Trying to use OpenSIPS as both a load
balancer for incoming calls and<br>
>>>> as an outbound proxy to my carrier. I
have been unsuccessful to place<br>
>>>> outgoing or incoming calls, and I think
I just need some help with the<br>
>>>> configuration. Just for testing, I
have one Asterisk box behind<br>
>>>> OpenSIPS and the load balancer table on
OpenSIPS looks like this:<br>
>>>><br>
>>>><br>
>>>><br>
>>>>
+----+----------+-------------------+-----------+------------+-------------+<br>
>>>> | id | group_id | dst_uri |
resources | probe_mode |<br>
>>>> description<br>
>>>> |<br>
>>>><br>
>>>><br>
>>>>
+----+----------+-------------------+-----------+------------+-------------+<br>
>>>> | 1 | 1 | <a class="moz-txt-link-freetext" href="sip:10.36.115.119">sip:10.36.115.119</a> |
fax=300 | 0 | tester<br>
>>>> |<br>
>>>><br>
>>>><br>
>>>>
+----+----------+-------------------+-----------+------------+-------------+<br>
>>>><br>
>>>><br>
>>>> The dst_ur is the internal IP of my
asterisk box. I'm using this for<br>
>>>> fax, so I have set the resources field
to 300 channels of "fax". On<br>
>>>> my asterisk box, I've added
"outboundproxy=23.21.170.154", as the 23.*<br>
>>>> IP is the external IP of the opensips
box. Below is my simple<br>
>>>> opensips.cfg that I've adapted from the
load balancing tutorial. Any<br>
>>>> help would be much appreciated.
Additionally, for debugging purposes,<br>
>>>> I've opened all UDP and TCP ports.
Still not able to connect.<br>
>>>><br>
>>>><br>
>>>> debug=6<br>
>>>> memlog=1<br>
>>>><br>
>>>> fork=yes<br>
>>>> children=2<br>
>>>> log_stderror=yes<br>
>>>> log_facility=LOG_LOCAL0<br>
>>>><br>
>>>> disable_tcp=yes<br>
>>>> disable_dns_blacklist = yes<br>
>>>><br>
>>>> auto_aliases=no<br>
>>>><br>
>>>> check_via=no<br>
>>>> dns=off<br>
>>>> rev_dns=off<br>
>>>> port=5060<br>
>>>><br>
>>>> mpath="/usr/lib/opensips/modules/"<br>
>>>> loadmodule "maxfwd.so"<br>
>>>> loadmodule "sl.so"<br>
>>>> loadmodule "db_mysql.so"<br>
>>>> loadmodule "tm.so"<br>
>>>> loadmodule "uri.so"<br>
>>>> loadmodule "rr.so"<br>
>>>> loadmodule "dialog.so"<br>
>>>> loadmodule "mi_fifo.so"<br>
>>>> loadmodule "signaling.so"<br>
>>>> loadmodule "textops.so"<br>
>>>> loadmodule "load_balancer.so"<br>
>>>><br>
>>>> modparam("mi_fifo", "fifo_name",
"/tmp/opensips_fifo")<br>
>>>> modparam("mi_fifo", "fifo_mode",0666)<br>
>>>><br>
>>>> modparam("dialog", "db_mode", 1)<br>
>>>> modparam("dialog", "db_url",
"mysql://root:opensips@localhost/opensips")<br>
>>>><br>
>>>> modparam("rr","enable_double_rr",1)<br>
>>>> modparam("rr","append_fromtag",1)<br>
>>>><br>
>>>> modparam("load_balancer",<br>
>>>>
"db_url","mysql://root:opensips@localhost/opensips")<br>
>>>><br>
>>>><br>
>>>> route{<br>
>>>> if
(!mf_process_maxfwd_header("3")) {<br>
>>>>
sl_send_reply("483","looping");<br>
>>>> exit;<br>
>>>> }<br>
>>>><br>
>>>><br>
>>>> if (!has_totag()) {<br>
>>>> # initial request<br>
>>>> record_route();<br>
>>>> } else {<br>
>>>> # sequential request
-> obey Route indication<br>
>>>> loose_route();<br>
>>>> t_relay();<br>
>>>> exit;<br>
>>>> }<br>
>>>><br>
>>>> # handle cancel and
re-transmissions<br>
>>>> if ( is_method("CANCEL") ) {<br>
>>>> if ( t_check_trans() )<br>
>>>> t_relay();<br>
>>>> exit;<br>
>>>> }<br>
>>>><br>
>>>><br>
>>>> # from now on we have only the
initial requests<br>
>>>> if (!is_method("INVITE")) {<br>
>>>>
send_reply("405","Method Not Allowed");<br>
>>>> exit;<br>
>>>> }<br>
>>>><br>
>>>> # detect resources and do
balancing<br>
>>>> load_balance("1","fax");<br>
>>>><br>
>>>> # LB function returns negative
if no suitable destination (for<br>
>>>> requested resources) is found,<br>
>>>> # or if all destinations are
full<br>
>>>> if ($retcode<0) {<br>
>>>>
sl_send_reply("500","Service full");<br>
>>>> exit;<br>
>>>> }<br>
>>>><br>
>>>> xlog("Selected destination is:
$du\n");<br>
>>>><br>
>>>> # send it out<br>
>>>> if (!t_relay()) {<br>
>>>> sl_reply_error();<br>
>>>> }<br>
>>>> }<br>
>>>><br>
</div>
</div>
</blockquote>
</div>
</div>
</blockquote>
<br>
<pre class="moz-signature" cols="72">--
Bogdan-Andrei Iancu
OpenSIPS Founder and Developer
<a class="moz-txt-link-freetext" href="http://www.opensips-solutions.com">http://www.opensips-solutions.com</a></pre>
</body>
</html>