Return TRUE to remove the dialog.
| 1480 | |
| 1481 | // Return TRUE to remove the dialog. |
| 1482 | bool SipMTInviteServerTransactionLayer::mtPeriodicService() |
| 1483 | { |
| 1484 | if (mTimerG.expired()) { // Resend timer. |
| 1485 | if (getSipState() == SSFail || getSipState() == Active) { |
| 1486 | sipWrite(mLastResponse); |
| 1487 | mTimerG.setDouble(T2); // Will send again later. |
| 1488 | } else { |
| 1489 | // This could happen if a CANCEL started before the ACK was received. |
| 1490 | // Not sure what to do - I think we will let the CANCEL take precedence, so stop sending this response. |
| 1491 | mTimerG.stop(); |
| 1492 | } |
| 1493 | } else if (mTimerJ.expired() || mTimerH.expired()) { // Dialog killer timers. |
| 1494 | stopTimers(); // probably redundant. |
| 1495 | // Time to destroy the Dialog. |
| 1496 | if (dgIsInvite()) { |
| 1497 | // Whoops. No ACK received. Notify L3 and remove the dialog |
| 1498 | dialogPushState(SSFail,0); |
| 1499 | } else { |
| 1500 | // No need to notify, just remove the dialog. |
| 1501 | } |
| 1502 | return true; // Stop the dialog now. It will be deleted by the periodic service loop after the associated L3 transaction ends. |
| 1503 | } else if (sipIsFinished()) { |
| 1504 | // If one of the kill timers is active, wait for it to expire, otherwise kill now. |
| 1505 | return (mTimerJ.isActive() || mTimerH.isActive()) ? false : true; |
| 1506 | } |
| 1507 | return false; |
| 1508 | } |
| 1509 | |
| 1510 | }; |
| 1511 | // vim: ts=4 sw=4 |