[asterisk-dev] Understanding chan_sip case 491 resulting in dropped calls

Rick Breidenstein rbreidenstein at recoverynetworks.com
Thu Jul 15 08:45:30 CDT 2010


Sorry for the duplicate post if it is.  I am unsure if it actually made it to the list the first time.

Problem: Dropped Calls after 45 minutes


Description:

I am looking to gain better understanding of the following part of the chan_sip.c as I am always receiving the message "LOG_WARNING, "just did sched_add waitid(%d) for sip_reinvite_retry for dialog %s in handle_response_invite\n", p->waitid, p->callid" 30 minutes into a call which then results in the call dropping 15 minutes later.

Can anyone help me better understand this portion of the chan_sip module?



Case 491:
"

case 491: /* Pending */
                xmitres = transmit_request(p, SIP_ACK, seqno, XMIT_UNRELIABLE, FALSE);
                if (p->owner && !req->ignore) {
                        if (p->owner->_state != AST_STATE_UP) {
                                ast_queue_control(p->owner, AST_CONTROL_CONGESTION);
                                pvt_set_needdestroy(p, "received 491 response");
                        } else {
                                /* This is a re-invite that failed. */
                                /* Reset the flag after a while
                                 */
                                int wait;
                                /* RFC 3261, if owner of call, wait between 2.1 to 4 seconds,
                                 * if not owner of call, wait 0 to 2 seconds */
                                if (p->outgoing_call) {
                                        wait = 2100 + ast_random() % 2000;
                                } else {
                                        wait = ast_random() % 2000;
                                }
                                p->waitid = ast_sched_add(sched, wait, sip_reinvite_retry, dialog_ref(p, "passing dialog ptr into sched structure based on waitid for sip_reinvite_retry."));
                                ast_log(LOG_WARNING, "just did sched_add waitid(%d) for sip_reinvite_retry for dialog %s in handle_response_invite\n", p->waitid, p->callid);
                                ast_debug(2, "Reinvite race. Waiting %d secs before retry\n", wait);
                        }
                }
                break;

"

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.digium.com/pipermail/asterisk-dev/attachments/20100715/03818461/attachment.htm 


More information about the asterisk-dev mailing list