diff --git a/core/AmSdp.cpp b/core/AmSdp.cpp index 86fb8780..90168cd2 100644 --- a/core/AmSdp.cpp +++ b/core/AmSdp.cpp @@ -207,19 +207,18 @@ void AmSdp::print(string& body) const for(std::vector::const_iterator media_it = media.begin(); media_it != media.end(); media_it++) { - + out_buf += "m=" + media_t_2_str(media_it->type) + " " + int2str(media_it->port) + " " + transport_p_2_str(media_it->transport); + string options; + if (media_it->transport == TP_RTPAVP || media_it->transport == TP_RTPSAVP) { - string options; + for(std::vector::const_iterator pl_it = media_it->payloads.begin(); pl_it != media_it->payloads.end(); pl_it++) { out_buf += " " + int2str(pl_it->payload_type); - if (!media_it->conn.address.empty()) - options += "c=IN IP4 "+media_it->conn.address+"\r\n"; - if (pl_it->encoding_name.empty()) // don't add rtpmap if no encoding name given continue; @@ -241,12 +240,16 @@ void AmSdp::print(string& body) const } - out_buf += "\r\n" + options; } else { // for other transports (UDP/UDPTL) just print out fmt - out_buf += " " + media_it->fmt + "\r\n"; + out_buf += " " + media_it->fmt; + // ... and continue with c=, attributes, ... } + if (!media_it->conn.address.empty()) + out_buf += "\r\nc=IN IP4 "+media_it->conn.address; + + out_buf += "\r\n" + options; // add attributes (media level) for (std::vector::const_iterator a_it= diff --git a/core/AmSession.cpp b/core/AmSession.cpp index e24ac47c..340f88a9 100644 --- a/core/AmSession.cpp +++ b/core/AmSession.cpp @@ -914,11 +914,11 @@ void AmSession::onSipReply(const AmSipReply& reply, DBG("negotiate_onreply = %s\n", negotiate_onreply?"true":"false"); if (negotiate_onreply) { if(old_dlg_status < AmSipDialog::Connected){ - DBG("old is < conn\n"); + switch(dlg.getStatus()){ case AmSipDialog::Connected: - DBG("case conn\n"); + try { RTPStream()->setMonitorRTPTimeout(true); @@ -947,7 +947,7 @@ void AmSession::onSipReply(const AmSipReply& reply, break; case AmSipDialog::Pending: - DBG("case pending\n"); + switch(reply.code){ // todo: 180 with body (remote rbt) case 180: {