[asterisk-bugs] [Asterisk 0010647]: SIP Reinvite behaviour does not work as expected with certain dial() options

noreply at bugs.digium.com noreply at bugs.digium.com
Sat Sep 8 03:38:39 CDT 2007


A NOTE has been added to this issue. 
====================================================================== 
http://bugs.digium.com/view.php?id=10647 
====================================================================== 
Reported By:                samdell3
Assigned To:                
====================================================================== 
Project:                    Asterisk
Issue ID:                   10647
Category:                   Core/RTP
Reproducibility:            always
Severity:                   minor
Priority:                   normal
Status:                     feedback
Asterisk Version:           1.4.11  
SVN Branch (only for SVN checkouts, not tarball releases): N/A  
SVN Revision (number only!):  
Disclaimer on File?:        N/A 
Request Review:              
====================================================================== 
Date Submitted:             09-05-2007 00:50 CDT
Last Modified:              09-08-2007 03:38 CDT
====================================================================== 
Summary:                    SIP Reinvite behaviour does not work as expected
with certain dial() options
Description: 
With canreinvite=no on any SIP peer, the call is never reinvited (this is
correct behaviour)

With canreinvite=yes, and using with a Dial() option from below,
re-invites are not issued correctly. (actually, reinvites should not be
issued at all...)

Asterisk is not supposed to perform a re-invite when using any of the
following Dial() options: t, T, h, H, w, W or L (with multiple arguments)
This is not the case. 
Asterisk still issues a Re-invite to one of the call legs causing an
asytmetrical RTP traffic flow (causing one-way audio if the SIP peer
filters RTP packets coming from somehwere that was not in it's own SDP)

EG 
SIPPeerA------ASTERISK-----SIPPeerB

SIPPeerA calls SIPPeerB

If either or both SIPPeerA or SIPPeerB have canreinvite=no, the RTP flow
is always via Asterisk - this is correct.

If Both SIPPeers are canreinvite=yes, AND the dial command contains any of
the above dial() options, then the RTP flow forms a triangle due to a
single re-invite STILL being issued by Asterisk. EG A's RTP goes to
Asterisk, Asterisk's RTP goes to B, but B's RTP goes to A. This is because
Asterisk issues a re-invite and tells B to talk to A when it shouldn't. 
If Asterisk does issue a re-invite for one leg, it should issue a
re-invite for both legs! But in this case it should not issues any
re-invites at all.
====================================================================== 

---------------------------------------------------------------------- 
 samdell3 - 09-08-07 03:38  
---------------------------------------------------------------------- 
Hmmmm, I can see where the offending re-invite is being generated in
verbosedebug.txt:

[Sep  6 10:29:53] DEBUG[3077]: chan_sip.c:17253 sip_set_rtp_peer: Sending
reinvite on SIP '7eac-49c-852007223629-NAP1-6650-1 at 202.137.240.83' - It's
audio soon redirected to IP 10.10.1.245

OK, so it's hitting the elseif statement at line 17253 and performing the
stray re-invite at: 'transmit_reinvite_with_sdp(p)'. 
**Is the curly just above 'transmit_reinvite_with_sdp(p)' in the correct
location?** 


        if (changed && !ast_test_flag(&p->flags[0], SIP_GOTREFER)) {
                if (chan->_state != AST_STATE_UP) {     /* We are in early
state */
                        if (!ast_test_flag(&p->flags[0], SIP_NO_HISTORY))
                                append_history(p, "ExtInv", "Initial
invite sent with remote bridge proposal.");
                        if (option_debug)
                                ast_log(LOG_DEBUG, "Early remote bridge
setting SIP '%s' - Sending media to %s\n", p->callid, ast_inet_ntoa(rtp ?
p->redirip.
                } else if (!p->pendinginvite) {         /* We are up, and
have no outstanding invite */
                        if (option_debug > 2) {
                                ast_log(LOG_DEBUG, "Sending reinvite on
SIP '%s' - It's audio soon redirected to IP %s\n", p->callid,
ast_inet_ntoa(rtp ? p->
            ------>     }     <------ IS THIS IN THE RIGHT PLACE ?
                        transmit_reinvite_with_sdp(p);
                } else if (!ast_test_flag(&p->flags[0], SIP_PENDINGBYE))
{
                        if (option_debug > 2) {
                                ast_log(LOG_DEBUG, "Deferring reinvite on
SIP '%s' - It's audio will be redirected to IP %s\n", p->callid,
ast_inet_ntoa(rtp
                        }
                        /* We have a pending Invite. Send re-invite when
we're done with the invite */
                        ast_set_flag(&p->flags[0], SIP_NEEDREINVITE);
                }
        } 

Issue History 
Date Modified   Username       Field                    Change               
====================================================================== 
09-08-07 03:38  samdell3       Note Added: 0070151                          
======================================================================




More information about the asterisk-bugs mailing list