[asterisk-dev] To-tag checks in chan_sip 1.8

Olle E. Johansson oej at edvina.net
Mon Nov 18 08:39:22 CST 2013


Someone (I can't track the change down in svn here) changed the to-tag handling in chan_sip to this:

/* Get their tag if we haven't already */
        if (ast_strlen_zero(p->theirtag) || (resp >= 200)) {
                char tag[128];

                gettag(req, "To", tag, sizeof(tag));
                ast_string_field_set(p, theirtag, tag);
        } else {
                /* Store theirtag to track for changes when 200 responses to invites are received without SDP */
                ast_string_field_set(p, theirprovtag, p->theirtag);

This change broke a lot of installations with forking proxys and PRACK. Before an established dialog, many to-tags can come in from various phones and servers ringing, but you lock when the dialog is established.

This code makes our responses use the first tag and not use the tag from the request we're responding to, which breaks communication. 

In order for me to fix this, I would need help in finding the commit and the reason for this change. Maybe we could change like this:

if (!ast_test_flag(&p->flags[1], SIP_PAGE2_DIALOG_ESTABLISHED)) {

Thanks for your help!


More information about the asterisk-dev mailing list