Anca,<br><br>Thank you very much for your support, I&#39;ve made the changes in my script and I got the refer scenarios working properly.<br><br>Regards,<br><br clear="all">Antonio Anderson Souza<br>Voice Technology<br><a href="http://www.antonioams.com">http://www.antonioams.com</a><br>


<br><br><div class="gmail_quote">On Wed, Apr 14, 2010 at 6:31 AM, Anca Vamanu <span dir="ltr">&lt;<a href="mailto:anca@opensips.org">anca@opensips.org</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">

Hi Antonio,<br>
<br>
You have to call b2b_init on the initial INVITE that creates the dialog.<br>
And the B2B server will know to correctly treat the REFER when it comes.<br>
That REFER message in fact will never go in the default route but in the<br>
route with the name defined in the module parameter &quot;script_req_route&quot;<br>
<a href="http://www.opensips.org/html/docs/modules/devel/b2b_entities.html#id227305" target="_blank">http://www.opensips.org/html/docs/modules/devel/b2b_entities.html#id227305</a>.<br>
<br>
Regards,<br>
<br>
--<br>
Anca Vamanu<br>
<a href="http://www.voice-system.ro" target="_blank">www.voice-system.ro</a><br>
<div><div></div><div class="h5"><br>
<br>
<br>
<br>
<br>
Antonio Anderson Souza wrote:<br>
&gt; Hi,<br>
&gt;<br>
&gt; I&#39;m creating a B2B scnarios to handle Refer request and execute the<br>
&gt; transfer process, I&#39;m using the Refer scenario [1] as reference, but<br>
&gt; when the UAC sends the Refer to Opensips and the Script call the<br>
&gt; scenario and the following error is printed in the Log:<br>
&gt;<br>
&gt; *Apr 13 14:10:18 localhost opensips[8924]:<br>
&gt; ERROR:b2b_entities:b2b_tm_**cback: No TO TAG found *<br>
&gt;<br>
&gt; Follow bellow my b2b scenario [2], and the Cfg snippet [3].<br>
&gt;<br>
&gt; [1] - <a href="http://www.opensips.org/Resources/B2buaTutorial#toc15" target="_blank">http://www.opensips.org/Resources/B2buaTutorial#toc15</a><br>
&gt;<br>
&gt; [2] - B2B Scenario:<br>
&gt; &lt;?xml version=&quot;1.0&quot;?&gt;<br>
&gt; &lt;scenario id=&quot;b2b-refer&quot; name=&quot;Handle refer at server&quot; param=&quot;0&quot;<br>
&gt; type=&quot;script&quot;&gt;<br>
&gt;   &lt;init&gt;<br>
&gt;     &lt;bridge&gt;<br>
&gt;       &lt;server&gt;<br>
&gt;         &lt;id&gt;server1&lt;/id&gt;<br>
&gt;       &lt;/server&gt;<br>
&gt;       &lt;client&gt;<br>
&gt;         &lt;id&gt;client1&lt;/id&gt;<br>
&gt;         &lt;type&gt;message&lt;/type&gt;<br>
&gt;         &lt;destination&gt;<br>
&gt;           &lt;value type=&quot;header&quot;&gt;Refer-To&lt;/value&gt;<br>
&gt;         &lt;/destination&gt;<br>
&gt;       &lt;/client&gt;<br>
&gt;     &lt;/bridge&gt;<br>
&gt;   &lt;/init&gt;<br>
&gt;<br>
&gt;   &lt;rules&gt;<br>
&gt;      &lt;request&gt;<br>
&gt;        &lt;refer&gt;<br>
&gt;          &lt;rule id=&quot;1&quot;&gt;<br>
&gt;            &lt;action&gt;<br>
&gt;              &lt;send_reply&gt;<br>
&gt;                &lt;code&gt;202&lt;/code&gt;<br>
&gt;                &lt;reason&gt;Accepted&lt;/reason&gt;<br>
&gt;              &lt;/send_reply&gt;<br>
&gt;              &lt;end_dialog_leg/&gt;<br>
&gt;              &lt;bridge&gt;<br>
&gt;                &lt;client&gt;<br>
&gt;                  &lt;peer/&gt;<br>
&gt;                &lt;/client&gt;<br>
&gt;                &lt;client&gt;<br>
&gt;                  &lt;id&gt;client2&lt;/id&gt;<br>
&gt;                  &lt;destination&gt;<br>
&gt;                    &lt;value type=&quot;header&quot;&gt;Refer-To&lt;/value&gt;<br>
&gt;                  &lt;/destination&gt;<br>
&gt;                &lt;/client&gt;<br>
&gt;              &lt;/bridge&gt;<br>
&gt;            &lt;/action&gt;<br>
&gt;          &lt;/rule&gt;<br>
&gt;        &lt;/refer&gt;<br>
&gt;     &lt;/request&gt;<br>
&gt;   &lt;/rules&gt;<br>
&gt; &lt;/scenario&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; [3] - Cfg snippet<br>
&gt;<br>
&gt;         if (has_totag()) {<br>
&gt;                 # sequential request withing a dialog should<br>
&gt;                 # take the path determined by record-routing<br>
&gt;                 if (loose_route()) {<br>
&gt;                         if (is_method(&quot;BYE&quot;)) {<br>
&gt;<br>
&gt;   setflag(1); # do accounting ...<br>
&gt;                                 setflag(3); # ... even if the<br>
&gt; transaction fails<br>
&gt;                         } else if (is_method(&quot;INVITE&quot;)) {<br>
&gt;                                 # even if in most of the cases is<br>
&gt; useless, do RR for<br>
&gt;                                 # re-INVITEs alos, as some buggy<br>
&gt; clients do change route set<br>
&gt;                                 # during the dialog.<br>
&gt;                                 record_route();<br>
&gt;                         } else if (is_method(&quot;REFER&quot;)) {<br>
&gt;                                 xlog(&quot;L_ERR&quot;,<br>
&gt;                                         &quot;Refer received the b2b<br>
&gt; scenario will be triggered [$fu/$tu/$ru/$ci]&quot;);<br>
&gt;                                 # Start B2B Script to handle the<br>
&gt; transference<br>
&gt;                                 *b2b_init_request(&quot;b2b-refer&quot;);*<br>
&gt;                                 xlog(&quot;L_ERR&quot;,<br>
&gt;                                         &quot;Refer processed by the b2b<br>
&gt; scenario [$fu/$tu/$ru/$ci]&quot;);<br>
&gt;                                 exit;<br>
&gt;<br>
&gt;<br>
&gt; Does anybody have some idea to help me?<br>
&gt;<br>
&gt; Best regards,<br>
&gt;<br>
&gt; Antonio Anderson Souza<br>
&gt; Voice Technology<br>
&gt; <a href="http://www.antonioams.com" target="_blank">http://www.antonioams.com</a><br>
</div></div>&gt; ------------------------------------------------------------------------<br>
&gt;<br>
&gt; _______________________________________________<br>
&gt; Users mailing list<br>
&gt; <a href="mailto:Users@lists.opensips.org">Users@lists.opensips.org</a><br>
&gt; <a href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users" target="_blank">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a><br>
&gt;<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>