Hello,
it should be ok to set a profile or a dlg variable before creating the
dialog. They are kept in the context of the process and destroyed if the
dialog is no longer created for the current sip message.
Cheers,
Daniel
On 26/02/15 20:49, Alex Balashov wrote:
Hi,
The dialog module documentation remains unclear about the order of
operations with regard to when to call dlg_manage() or set the
transaction flag.
My impression is that dlg_manage() only registered TM callbacks, so it
doesn't matter when you call it, as long as it's before t_relay().
However, the documentation neither confirms nor denies this.
So, this raises the questions:
1) Is this okay?
set_dlg_profile("caller", "$fU");
dlg_manage();
...
t_relay();
Or do I need to do this?
dlg_manage();
set_dlg_profile("caller", "$fU");
...
t_relay();
2) What about setting dialog-persistent variables? Is this okay?
$dlg_var(account_id) = 49555;
dlg_manage();
If so, where does the variable go if I never call dlg_manage() because
the call is aborted beforehand, e.g.
$dlg_var(account_id) = 49555;
sl_send_reply("403", "Forbidden");
exit;
dlg_manage();
...
t_relay();
3) Any other gotchas or caveats in relation to the order of operations?
I suppose my preference would be to set the dialog profiles in various
places throughout call processing and call dlg_manage() at the very
end, right before t_relay(). Is this acceptable?
Thanks,
-- Alex
--
Daniel-Constantin Mierla
http://twitter.com/#!/miconda -
http://www.linkedin.com/in/miconda
Kamailio World Conference, May 27-29, 2015
Berlin, Germany -
http://www.kamailioworld.com