On 02/03/15 16:45, Alex Balashov wrote:
Daniel,
ā€ˇThanks for that insight. Where exactly is the association between an initial invite and
a dialog profile kept, if no dialog structure has yet been malloc'd? Is it in shared
or package memory? How exactly is such an association destroyed? Is it garbage-collected,
or explicitly deleted if, for example, script processing of an initial invite is aborted
with 'exit'?
There are some lists per processes associated with the message id. When
the dialog is created, then it checks if the message id is the one for
current invite and if yes, it uses the lists, otherwise the lists are
discarded. There are also some callbacks for the end of config execution
for cleanup, but I don't remember by heart if does something with these
lists -- code has to be checked.
Cheers,
Daniel
--
Sent from my BlackBerry. Please excuse errors and brevity.
Original Message
From: Daniel-Constantin Mierla
Sent: Monday, March 2, 2015 2:53 AM
To: Kamailio (SER) - Users Mailing List
Reply To: miconda(a)gmail.com
Subject: Re: [SR-Users] Dialog order of operations
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