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