<div>I am missing a alot of that. Now I see why I am getting the duplicate INVITES since I am not exiting after the B2B_INIT</div>
<div> </div>
<div>So I need to do something like this</div>
<div> </div>
<div>if(is_method("INVITE") && !(src_ip == "OPENSIPS_IP") && !has_totag() ) {</div>
<div>{</div>
<div> location();</div>
<div> b2b_init_request("refer");<br> exit;</div>
<div>}</div>
<div> </div>
<div> </div>
<div>I will test that out.</div>
<div><br><br> </div>
<div class="gmail_quote">On Thu, Oct 28, 2010 at 3:39 AM, Anca Vamanu <span dir="ltr"><<a href="mailto:anca@opensips.org">anca@opensips.org</a>></span> wrote:<br>
<blockquote style="BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex; PADDING-LEFT: 1ex" class="gmail_quote">Hi,<br><br>Do you exit the script after calling b2b_init_request? When calling this<br>function you should have the following conditions:<br>
- it Invite - is_method("INVITE")<br>- it initial - !has_totag()<br>- does not come from the same machine ( in case you have the proxy on<br>the same machine and the request generated by the B2BUA will get looped<br>
back into the script) !(src_ip=="MY_IP" && src_port=="MY_PORT").<br>Then if you have this you can call the b2b_init_request either at the<br>start of the script, as you did, or somewhere lower after<br>
lookup("location"). You can call it after if you don't want to do any<br>other change on the request generated - and it will be sent directly to<br>the IP discovered in location.<br><br>Regards,<br><br>--<br>
Anca Vamanu<br><a href="http://www.voice-system.ro/" target="_blank">www.voice-system.ro</a><br><br><br><br><br>On 10/26/2010 09:12 PM, osiris123d wrote:<br>> I have seen there are a couple of posts about this so I apologize if this<br>
> seems redundant.<br>><br>> I am starting to mess with the B2BUA and am having some issues. I am trying<br>> to solve the transfer issue when a local OpenSIPS subcriber is on the phone<br>> with a PSTN user and wants to transfer the PSTN user to another OpenSIPS<br>
> user. I have created the refer.xml file and set up the module parameters,<br>> so all that is fine. The issue I am seeing are the invites getting sent out<br>> from OpenSIPS.<br>><br>> If I place my<br>
> b2b_init_request("refer");<br>> at the very beginning of my route logic before consume_credentials(),<br>> location() and all that other junk I see that two Invites are sent<br>><br>> Say the user is <a href="mailto:444@irock.com">444@irock.com</a><br>
> The B2B CALL-ID generated message gets sent to the actual IP address of<br>> <a href="http://irock.com/" target="_blank">irock.com</a>, which it shouldn't.<br>> Then a correct invite gets sent to 444@7X.45.X.44 which is the correct info<br>
> that is pulled from the location table, but this invite does not have the<br>> B2B CALL-ID info in it. So it seems I have placed the b2b_init_request in<br>> the wrong spot on my script.<br>><br>><br>> Then when I place the b2b_init_request after I execute the location() in my<br>
> route logic I see the following<br>> two invites<br>><br>> The first invite is the B2B invite with the B2B CALL-ID. It gets sent<br>> correctly to 444@7X.45.X.44 instead of to the actually IP of <a href="http://irock.com/" target="_blank">irock.com</a>. The<br>
> only problem here is that within the actual TO: field of the sip message it<br>> is 444@7X.45.X.44 instead of <a href="mailto:444@irock.com">444@irock.com</a>. So the phone rejects this<br>> invite with a "SIP/2.0 404 Not Found" since the phone only knows itself as<br>
> <a href="mailto:444@irock.com">444@irock.com</a>.<br>><br>> The second invite is as usual the normal invite without the B2B CALL-ID.<br>><br>> So I guess the issue I am having is that dual invites are being sent and the<br>
> B2B is either sending it to the wrong IP address or it is placing the wrong<br>> domain in the invite for the user.<br>><br><br>_______________________________________________<br>Users mailing list<br><a href="mailto:Users@lists.opensips.org">Users@lists.opensips.org</a><br>
<a href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users" target="_blank">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a><br></blockquote></div><br><br clear="all"><br>-- <br>--<br>*--*--*--*--*--*<br>
Duane<br>*--*--*--*--*--*<br>--<br>