<HTML>
<HEAD>
<TITLE>Re: [OpenSIPS-Users] assigning dialog profiles</TITLE>
</HEAD>
<BODY>
<FONT FACE="Tahoma, Verdana, Helvetica, Arial"><SPAN STYLE='font-size:10pt'>Brett,<BR>
<BR>
I changed the dialog profile operations to occur just before the INVITE is sent to the PSTN carrier. &nbsp;So, in so many words: &nbsp;create_dialog(), set_dlg_profile(), then t_relay().<BR>
<BR>
The first time through, no problem. &nbsp;The second time through (first carrier hit failure route), create_dialog() returns without an error (so the dialog re-created successfully or was already there), but the set_dlg_profile() immediately after the create_dialog() fails with the same error:<BR>
<BR>
</SPAN></FONT><SPAN STYLE='font-size:10pt'><FONT FACE="Lucida Console"> ERROR:dialog:set_dlg_profile: dialog was not yet created - script error <BR>
&nbsp;ERROR:dialog:w_set_dlg_profile: failed to set profile<BR>
</FONT><FONT FACE="Tahoma, Verdana, Helvetica, Arial"><BR>
The exact formulation is: &nbsp;set_dlg_profile(&quot;outbound&quot;, &quot;$avp(s:dlgid_out)&quot;);<BR>
I have verified that $avp(s:dlgid_out) does have a value.<BR>
<BR>
Any thoughts?<BR>
<BR>
<BR>
Thanks,<BR>
Jeff<BR>
<BR>
<BR>
<BR>
On 3/8/09 2:19 PM, &quot;Jeff Pyle&quot; &lt;<a href="jpyle@fidelityvoice.com">jpyle@fidelityvoice.com</a>&gt; wrote:<BR>
<BR>
</FONT></SPAN><BLOCKQUOTE><SPAN STYLE='font-size:10pt'><FONT FACE="Tahoma, Verdana, Helvetica, Arial">Brett,<BR>
<BR>
So, if I understand this correctly... &nbsp;Each time a call hits a failure_route, the dialog is destroyed, and with it any profile assignments. &nbsp;In my case, when I select another PSTN carrier, I simply do a create_dialog() again and another set_dlg_profile()?<BR>
<BR>
<BR>
- Jeff<BR>
<BR>
<BR>
<BR>
On 3/8/09 1:15 PM, &quot;Brett Nemeroff&quot; &lt;<a href="brett@nemeroff.com">brett@nemeroff.com</a>&gt; wrote:<BR>
<BR>
</FONT></SPAN><BLOCKQUOTE><SPAN STYLE='font-size:10pt'><FONT FACE="Tahoma, Verdana, Helvetica, Arial">Jeff,<BR>
The dialogs are destroyed automatically upon failure. You don't need to unset the dialog manually unless there is a reason the dialog doesn't fit the profile anymore..<BR>
<BR>
-Brett<BR>
<BR>
On Sun, Mar 8, 2009 at 2:09 PM, Jeff Pyle &lt;<a href="jpyle@fidelityvoice.com">jpyle@fidelityvoice.com</a>&gt; wrote:<BR>
</FONT></SPAN><BLOCKQUOTE><SPAN STYLE='font-size:10pt'><FONT FACE="Tahoma, Verdana, Helvetica, Arial">Hello,<BR>
<BR>
I'm configuring Opensips' dialog module to keep count of the number of calls<BR>
I have on each outbound PSTN carrier.  Here's my thinking:<BR>
<BR>
In request route:<BR>
- create_dialog() on new INVITE<BR>
- select carrier<BR>
- set_dlg_profile() to assign to proper profile with this carrier's value<BR>
<BR>
In failure route:<BR>
- unset_dlg_profile() to remove from profile, since it failed<BR>
- send to original request route to select next carrier, assign profile, etc<BR>
<BR>
When I run this, the first set_dlg_profile() works properly, but the<BR>
unset_dlg_profile() in the failure route logs:<BR>
<BR>
 ERROR:dialog:unset_dlg_profile: dialog was not yet created - script error<BR>
 ERROR:dialog:w_unset_dlg_profile: failed to unset profile<BR>
<BR>
All subsequent set/unset_dlg_profile give the same error.  Does the dialog<BR>
somehow get destroyed when the failure_route is hit?  Is it necessary to<BR>
create_dialog() each time the failure_route is hit by sending it back around<BR>
to a request route?<BR>
<BR>
<BR>
Thanks,<BR>
Jeff<BR>
<BR>
<BR>
_______________________________________________<BR>
Users mailing list<BR>
<a href="Users@lists.opensips.org">Users@lists.opensips.org</a><BR>
<a href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a><BR>
</FONT></SPAN></BLOCKQUOTE><SPAN STYLE='font-size:10pt'><FONT FACE="Tahoma, Verdana, Helvetica, Arial"><BR>
<BR>
</FONT></SPAN></BLOCKQUOTE></BLOCKQUOTE>
</BODY>
</HTML>