Hi all,
I have the following scenario:
UACA SEMS UACB
| | |
|---------------------->| |
| INVITE UACB | |
| |-------------------------->|
|<----------------------| INVITE UACB |
| 100 Trying | |
| |<--------------------------|
| | 100 Trying |
| |<--------------------------|
| | 183 w/SDP |
|<----------------------| |
| 183 w/SDP | |
|---------------------->| |
| PRACK |-------------------------->|
| | PRACK |
| |<--------------------------|
| | 200 OK w/o SDP |
| |<--------------------------|
| | 200 OK w/o SDP |
| | |
So, UACA calls UACB, which replies 183 with SDP; UACA sends a PRACK for
the 183 and then UACB answers with a 200 OK without SDP. This 200 OK is
never replayed by SEMS to UACA. Instead, I can find this in the logs:
[#7f862df39700] [getSdpBody, AmOfferAnswer.cpp:491] DEBUG: No SDP Answer
[#7f862df39700] [reply, AmBasicSipDialog.cpp:600] DEBUG: onTxReply faile
and the 200 OK si never relayed to the callee.
So, according to the logs and to the code in AmOfferAnswer.cpp, the 200 OK
is being discarded since it doesn't coontain an SDP. From my understanding
this should not be correct, because the Offer/Answer can be considered
complete since the PRACK was sent by the UAC.
I tried to play a bit with the 100rel parameter, but with no luck, so at
the end I ended up with the attached patch, which is working for my
(particular) case. I have a really superficial knowledge of SEMS's code, so
I don't know if this could have drawbacks or introduce other problems.
Best regards,
Federico Cabiddu
diff --git a/core/AmOfferAnswer.cpp b/core/AmOfferAnswer.cpp
index 390ec09..816c47c 100644
--- a/core/AmOfferAnswer.cpp
+++ b/core/AmOfferAnswer.cpp
@@ -51,6 +51,7 @@ static const char* getOAStateStr(AmOfferAnswer::OAState st) {
AmOfferAnswer::AmOfferAnswer(AmSipDialog* dlg)
: state(OA_None),
cseq(0),
+ prack(0),
sdp_remote(),
sdp_local(),
dlg(dlg)
@@ -121,6 +122,11 @@ int AmOfferAnswer::onRequestIn(const AmSipRequest& req)
const char* err_txt = NULL;
int err_code = 0;
+ if((req.method == SIP_METH_PRACK) && (state == OA_Completed)) {
+ DBG("PRACK for a completed OA received: setting flag\n");
+ prack = true;
+ }
+
if((req.method == SIP_METH_INVITE ||
req.method == SIP_METH_UPDATE ||
req.method == SIP_METH_ACK ||
@@ -152,7 +158,7 @@ int AmOfferAnswer::onRequestIn(const AmSipRequest& req)
(req.cseq == cseq)){
// 200 ACK received:
// -> reset OA state
- DBG("200 ACK received: resetting OA state");
+ DBG("200 ACK received: resetting OA state\n");
clearTransitionalState();
}
@@ -385,10 +391,12 @@ int AmOfferAnswer::onReplyOut(AmSipReply& reply)
saveState();
if (generate_sdp) {
-
+
string sdp_buf;
if(getSdpBody(sdp_buf)) {
- if (reply.code == 183 && reply.cseq_method == SIP_METH_INVITE) {
+ if ((reply.code == 183 && reply.cseq_method == SIP_METH_INVITE) ||
+ (state == OA_Completed && prack)){
+ DBG("Ignoring missing SDP [%d/%d/%d]\n", reply.code, state, prack);
// just ignore if no SDP is generated (required for B2B)
}
else return -1;
diff --git a/core/AmOfferAnswer.h b/core/AmOfferAnswer.h
index 64f942b..91f49b3 100644
--- a/core/AmOfferAnswer.h
+++ b/core/AmOfferAnswer.h
@@ -48,6 +48,7 @@ private:
OAState state;
OAState saved_state;
unsigned int cseq;
+ bool prack;
AmSdp sdp_remote;
AmSdp sdp_local;
_______________________________________________
Semsdev mailing list
[email protected]
http://lists.iptel.org/mailman/listinfo/semsdev