| 1380 | } |
| 1381 | |
| 1382 | void SipMTInviteServerTransactionLayer::MTCSendOK(CodecSet wCodec, const L3LogicalChannel *chan) |
| 1383 | { |
| 1384 | if (getSipState()==SSFail) { devassert(0); } |
| 1385 | SipMessage *invite = getInvite(); |
| 1386 | gReports.incr("OpenBTS.SIP.INVITE-OK.Out"); |
| 1387 | mRTPPort = allocateRTPPorts(); |
| 1388 | mCodec = wCodec; |
| 1389 | LOG(INFO) <<sbText(); |
| 1390 | SipMessageReply ok(invite,200,string("OK"),this); |
| 1391 | ok.smAddBody(string("application/sdp"),makeSDPAnswer()); // TODO: This should be a reply to the originating SDP offer. |
| 1392 | writePrivateHeaders(&ok,chan); |
| 1393 | mtWriteLowSide(&ok); |
| 1394 | setSipState(Connecting); |
| 1395 | // In RFC-3261 the Transaction Layer no longer handles timers after the OK is sent. |
| 1396 | // The Transport Layer alone is not capabable of sending the 200 OK reliably because then the |
| 1397 | // INVITE server transaction ends, and the INVITE client transaction no longer resends INVITEs after |
| 1398 | // receiving a provisional response. Rather, the way that would end up being handled is by starting a new |
| 1399 | // INVITE transaction, which is totally not what we want to do. So we will push out the 2xx OK |
| 1400 | // until we get the ACK. Doesnt matter for reliable transports. |
| 1401 | if (dgIsInvite()) { setTimerG(); } |
| 1402 | setTimerH(); |
| 1403 | } |
| 1404 | |
| 1405 | string SipMTInviteServerTransactionLayer::mttlText() const |
| 1406 | { |
no test coverage detected