Hey Timo
Thanks for your email.
I apologise i never copied the config properly. I missed a } to close the if statement.
You can see that the route(WITHINDLG); is called for all requests from this config.
# MANAGE ALL DIALOGS
#===================================================
if (is_method("INVITE"))
{
if(is_method("INVITE") && !has_totag())
{
$dlg_ctx(timeout_route) = 12;
$dlg_ctx(timeout_bye) = 1;
}
dlg_manage();
}
if(is_method("BYE|CANCEL"))
{
dlg_manage();
}
# per request initial checks
route(REQINIT);
# NAT detection
route(NAT);
# handle requests within SIP dialogs
route(WITHINDLG);
### only initial requests (no To tag)
# CANCEL processing
if (is_method("CANCEL"))
{
if (t_check_trans())
t_relay();
exit;
}
t_check_trans();
# authentication
route(AUTH);
# record routing for dialog forming requests (in case they are routed)
# - remove preloaded route headers
remove_hf("Route");
if (is_method("INVITE|SUBSCRIBE"))
record_route();
Thanks again for your help.
Phillip
Hey Phillip,
On *all* in-dialog requests, i.e., all requests which contain a To tag.
On 20.09.2011 13:48, Phillman25 Kyriacou wrote:
> Thanks for your email.
>
> Yes dlg_manage(); has to now be called on INVITE and BYE/CANCEL messages.
> Where would i have to call loose_route()? Only on INVITE?
This may include Re-INVITEs too (but not initial INVITEs).
Let's take a look at it:
> My configuration did not change between 3.1.2 and 3.1.5.
>
> Call flow example:
> ==============
>
> Cisco PGW ===> Kamailio 3.1.5 ===> VOIP PROVIDER or ASTERISK PABX
>
>
> The below is my configuration.
> #!KAMAILIO
> #
[...]
[...]
> if(is_method("BYE|CANCEL"))
>
> {
>
> dlg_manage();
>
>
>
> # per request initial checks
> route(REQINIT);
>
> # NAT detection
> route(NAT);
>
> # handle requests within SIP dialogs
> route(WITHINDLG);
[...]
> # Handle requests within SIP dialogs
> route[WITHINDLG] {
> if (has_totag()) {
> # sequential request withing a dialog should
> # take the path determined by record-routing
> if (loose_route()) {
So route[WITHINDLG] contains the logic to track in-dialog requests.
However, you seem to call that route only from BYE and CANCEL requests,
missing out ACKs, which is likely the reason why things go wrong. So
make sure you run all in-dialog requests through that route, and you
should be fine (hopefully).
Cheers,
--Timo