Timeout on RTPproxy only cancels one leg

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Timeout on RTPproxy only cancels one leg

Gustavo
Hi,

I'm testing the RTPproxy notification with OPENSIPS and I've stumbled on an issue: when RTPproxy notifies that session expired on early dialog the notification module cancels the transaction forward, but doesn't send a final response to CALLER. I would expect (and need) that a "504 Server Time-out" should be replied to CALLER.

I've looked into where OPENSIPS receives this message and its on function "dlg_end_dlg" on file dialog/dlg_req_within.c and function header says:
/* sends BYE in both directions
 * returns 0 if both BYEs were successful
 */

However the part of the function that handles early dialog is clearly not trying to send a reply back to CALLER:

    if (dlg->state == DLG_STATE_UNCONFIRMED || dlg->state == DLG_STATE_EARLY) {
        /* locate initial transaction */
        LM_DBG("trying to find transaction with hash_index = %u and label = %u\n",
                dlg->initial_t_hash_index,dlg->initial_t_label);
        if (d_tmb.t_lookup_ident(&t,dlg->initial_t_hash_index,dlg->initial_t_label) < 0) {
            LM_ERR("Initial transaction does not exist any more\n");
            return -1;
        }

        if (d_tmb.t_cancel_trans(t,NULL) < 0) {
            LM_ERR("Failed to send cancels\n");
            d_tmb.unref_cell(t);
            return -1;
        }

        /* lookup_ident refs the transaction */
        d_tmb.unref_cell(t);
        return 0;
    }


I was trying to do my on fix on this adding a t_reply there, however I need sip_msg to be able to use t_reply and I'm having a hard time to find out if dialog module has the INVITE message stored anywhere so I can use it here. Is this possible?

How would be the proper way to send a reply from that point in the code?

Thanks for the attention,
Gustavo.
Reply | Threaded
Open this post in threaded view
|

Re: Timeout on RTPproxy only cancels one leg

Gustavo
Well, I've find out where the message is!
The t variable has it, I just added the line:

d_tmb.t_reply(t->uas.request, 504, &reason);

and it did the trick. I'll probably add verifications and log messages here, but that solves the problem.

Thanks anyway.
Reply | Threaded
Open this post in threaded view
|

Re: Timeout on RTPproxy only cancels one leg

Gustavo
Hello, again,

I would like to add a custom header in this reply I'm sending in this point of code, however I'm not generating the reply, t_reply function does it all.
My question is: How can I add a header to this reply? Is there something like "local_route" for replies? Or should I use some other function to have more control over my reply?

I'll keep investigating how can I solve this, but a hint would be deeply appreciated.

Thanks,
Gustavo.


On Fri, Dec 21, 2012 at 11:31 AM, Gustavo [via OpenSIPS (Open SIP Server)] <[hidden email]> wrote:
Well, I've find out where the message is!
The t variable has it, I just added the line:

d_tmb.t_reply(t->uas.request, 504, &reason);

and it did the trick. I'll probably add verifications and log messages here, but that solves the problem.

Thanks anyway.


If you reply to this email, your message will be added to the discussion below:
http://opensips-open-sip-server.1449251.n2.nabble.com/Timeout-on-RTPproxy-only-cancels-one-leg-tp7583713p7583714.html
To unsubscribe from Timeout on RTPproxy only cancels one leg, click here.
NAML



--
"Some say that the soul wants to speak and
does so all the time, but humans are blind to
its messages, for they come not in words but
in actions in the world around them."
Reply | Threaded
Open this post in threaded view
|

Re: Timeout on RTPproxy only cancels one leg

Gustavo
diving into the t_reply function I've seem that it eventually, in another function within t_reply, it does this:

add_lump_rpl(p_msg, dset, dset_len, LUMP_RPL_HDR);

this p_msg comes from parameter, so it is a request. It seems that this lump adds something to the reply, I'll try some experiments with this function.

I'm on the right path here? Where can I find a documentation on these lump?
For now I'm going to try and find their definitions, but I don't even know in which module (or is it core?) they are.

If anyway could shed some light here, I'm really in the dark.

Thanks again,
Gustavo.
Reply | Threaded
Open this post in threaded view
|

Re: Timeout on RTPproxy only cancels one leg

Gustavo
Ya, the lump does the trick and is very simple to use.
Hope my monolog might help out someone someday.

Thanks anyway.


On Fri, Feb 1, 2013 at 12:06 PM, Gustavo [via OpenSIPS (Open SIP Server)] <[hidden email]> wrote:
diving into the t_reply function I've seem that it eventually, in another function within t_reply, it does this:

add_lump_rpl(p_msg, dset, dset_len, LUMP_RPL_HDR);

this p_msg comes from parameter, so it is a request. It seems that this lump adds something to the reply, I'll try some experiments with this function.

I'm on the right path here? Where can I find a documentation on these lump?
For now I'm going to try and find their definitions, but I don't even know in which module (or is it core?) they are.

If anyway could shed some light here, I'm really in the dark.

Thanks again,
Gustavo.



If you reply to this email, your message will be added to the discussion below:
http://opensips-open-sip-server.1449251.n2.nabble.com/Timeout-on-RTPproxy-only-cancels-one-leg-tp7583713p7584341.html
To unsubscribe from Timeout on RTPproxy only cancels one leg, click here.
NAML



--
"Some say that the soul wants to speak and
does so all the time, but humans are blind to
its messages, for they come not in words but
in actions in the world around them."