On 11/13/2014 12:34 PM, Dave WOOLLEY wrote:

I don’t believe that the code that adds Required: timers to a 200 OK response will work, even in Asterisk 13, current branch version.

In my back port, it produces an error saying headers cannot be added after lines have been added. The same conditions for this seem to apply in version 13:

In add_header:

if (req->lines) {

ast_log(LOG_WARNING, "Can't add more headers when lines have been added\n");

return -1;

}

In transmit_response_with_sdp:

if (p->rtp) {

...

if (p->t38.state == T38_ENABLED) {

add_sdp(&resp, p, oldsdp, TRUE, TRUE);

} else {

add_sdp(&resp, p, oldsdp, TRUE, FALSE);

}

} else

ast_log(LOG_ERROR, "Can't add SDP to response, since we have no RTP session allocated. Call-ID %s\n", p->callid);

if (reliable && !p->pendinginvite)

p->pendinginvite = seqno; /* Buggy clients sends ACK on RINGING too */

add_required_respheader(&resp);

Note that SDP is added, and therefore “req->lines” becomes non-zero, as the response now has a body, before add_required_respheader is called.

In add_required_respheader:

         if (ast_str_strlen(str) > 0) {
                add_header(req, "Require", ast_str_buffer(str));
         }

For information, the test setup for this was two Asterisk instances in tandem. The first one uses session-timers=originate. The second one uses sendrpid=true, session-timers=accept and session-refresher=uas. The dialplan (after a delay) sets the connected line, to force a re-invite against the call setup direction (then goes into a long wait). As the first Asterisk is UAS for the re-invite, but is in session timer originate mode, it is forced to use Require. The test was trying to confirm that session timer role reversals worked.


BTS Holdings PLC - Registered office: BTS House, Manor Road, Wallington, SM6 0DD - Registered in England: 1517630



Agreed that this looks like a bug. Probably should be doing the add_required_respheader() call before adding the SDP.
-- 
_____________________________________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

asterisk-dev mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-dev

Reply via email to