<div dir="ltr">Thank you for your answer. I tried that and it shows DLG_status 1, which means the dialog is created but I definitely didn't create a dialog before that line. Also, the dialog is created further down with create_dialog("pPB") command because I see OPTIONS being sent to both caller and callee (pP working).<div>Why would DLG_status print 1? I will try to print it at different lines of script to see where it changes... I have a t_newtran and some $acc_extra lines befores (other than some standard processing)</div></div><br><div class="gmail_quote gmail_quote_container"><div dir="ltr" class="gmail_attr">On Tue, Dec 17, 2024 at 4:39 PM Bogdan-Andrei Iancu <<a href="mailto:bogdan@opensips.org">bogdan@opensips.org</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">Hi,<br>
<br>
Yes, the dlg_val assignment fails if there is no current dialog. Maybe <br>
the dialog is created (internally) by some other script function you are <br>
using. Try prinitng the $DLG_status before the assignment, just to see <br>
if there is a dialog or not<br>
<br>
Regards,<br>
<br>
Bogdan-Andrei Iancu<br>
<br>
OpenSIPS Founder and Developer<br>
<a href="https://www.opensips-solutions.com" rel="noreferrer" target="_blank">https://www.opensips-solutions.com</a><br>
<a href="https://www.siphub.com" rel="noreferrer" target="_blank">https://www.siphub.com</a><br>
<br>
On 17.12.2024 14:08, M S wrote:<br>
> Hi list,<br>
> I have a script like this:<br>
><br>
> ..... some processing<br>
> if (is_method("INVITE") && !has_totag()) {<br>
> $dlg_val(x)="y";<br>
> }<br>
> .... some processing<br>
> if (is_method("INVITE") && !has_totag()) {<br>
> create_dialog("pPB")<br>
> }<br>
><br>
> My first question is, why does this work?! documents say $dlg_val <br>
> cannot be used before dialog is created, and create_dialog is called <br>
> after dlg_val here.<br>
> I have verified that indeed dialog is created using create_dialog, and <br>
> indeed $dlg_val(x) stores the value (it is available later in the dialog).<br>
><br>
> Second question, once or two times a day (after thousands of calls) I <br>
> see a do_assign setting PV failed error message on the $dlg_val(x)="y" <br>
> line. Since this shouldn't have worked to begin with, I don't know how <br>
> to debug this. Any suggestions?<br>
><br>
> Thank you!<br>
><br>
> _______________________________________________<br>
> Users mailing list<br>
> <a href="mailto:Users@lists.opensips.org" target="_blank">Users@lists.opensips.org</a><br>
> <a href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users" rel="noreferrer" target="_blank">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a><br>
<br>
</blockquote></div>