On 28/04/14 19:49, Alex Balashov wrote:
Hi,
Am I not allowed to call dlg_manage() and add a dialog to a profile
inside a request_route that is called out of a failure_route?
The sequence of events is like this:
1. INVITE ---------------->
2. <---------- 302 redirect
3. ACK ------------------->
4. INVITE (new branch) --->
It's in #4 that I add the dialog to a profile and call dlg_manage().
There's a slight ambiguity because I am calling in a request_route,
but the request_route is really called from a failure_route that
catches the 302. It contains common logic that is used in both #1 and
#4. So, the message being processed is 302, but the execution context
is request_route.
The docs say that dlg_manage() can be used in a request_route, and
that set_dlg_profile() can be called from request/branch/reply/failure
routes. But, I suppose it's logical that dlg_manage() ought to operate
on the initial dialog-opening request. However, since the 302 is part
of the same transaction as the initial INVITE, I would think that's
okay. Is it?
Anyway, I get these messages a lot:
Apr 28 17:41:04 p01 /usr/local/sbin/kamailio[8581]: CRITICAL: dialog
[dlg_profile.c:444]: set_dlg_profile(): BUG - dialog not found in a
non REQUEST route (1)
Apr 28 17:41:04 p02 /usr/local/sbin/kamailio[8581]: ERROR: dialog
[dialog.c:800]: w_set_dlg_profile(): failed to set profile
At no point am I actually calling set_dlg_profile() outside of a
request_route, but the request_route might be called from a
failure_route.
So, the question is, am I doing something wrong? What's the best way
to accommodate this scenario? I don't know if I want to track the
dialog or add it to a profile until after I get the 302.
I guess dialog has to be
created in main request_route (or sub-route
block executed from there) as it relies on some tm callbacks that could
be related to transaction creation and first time forwarding.
Cheers,
Daniel
--
Daniel-Constantin Mierla -
http://www.asipto.com
http://twitter.com/#!/miconda -
http://www.linkedin.com/in/miconda