Sorry disregard the previous patch, (I included the wrong file :-( )
Here is the correct patch.
Torrey
On 16 November 2011 10:07, Torrey Searle <[email protected]> wrote:
> Hello all,
>
> Attached is a simple patch I have made to allow SEMs to transparently
> pass SIP-T messages without complaining when configured as a
> transparent SBC. It isn't fully correct as it makes the assumption
> that if you have a multi-part body that there is probably an SDP as
> one of it's parts.
>
> However I have a question. When using SEMS as a transparent SBC,
> would it be ok to add a flag inside AmSipDialog instructing it to
> bypass all SDP offer/answer check validations (or at least make sure
> it doesn't try to generate SDP)?
>
> Regards,
> Torrey
>
diff --git a/core/AmSipDialog.cpp b/core/AmSipDialog.cpp
index 411a5fc..c6b74eb 100644
--- a/core/AmSipDialog.cpp
+++ b/core/AmSipDialog.cpp
@@ -236,7 +236,8 @@ void AmSipDialog::onRxRequest(const AmSipRequest& req)
req.method == SIP_METH_ACK ||
req.method == SIP_METH_PRACK) &&
!req.body.empty() &&
- (req.content_type == SIP_APPLICATION_SDP)) {
+ (req.content_type == SIP_APPLICATION_SDP ||
+ req.content_type.substr(0, 15) == "multipart/mixed")) {
err_code = onRxSdp(req.cseq,req.body,&err_txt);
}
@@ -523,7 +524,8 @@ int AmSipDialog::onTxRequest(AmSipRequest& req)
&& (req.content_type == SIP_APPLICATION_SDP);
bool has_sdp = !req.body.empty()
- && (req.content_type == SIP_APPLICATION_SDP);
+ && (req.content_type == SIP_APPLICATION_SDP
+ || req.content_type.substr(0, 15) == "multipart/mixed");
if (!generate_sdp && !has_sdp &&
((req.method == SIP_METH_PRACK) ||
@@ -560,7 +562,8 @@ int AmSipDialog::onTxReply(AmSipReply& reply)
&& (reply.content_type == SIP_APPLICATION_SDP);
bool has_sdp = !reply.body.empty()
- && (reply.content_type == SIP_APPLICATION_SDP);
+ && (reply.content_type == SIP_APPLICATION_SDP ||
+ reply.content_type.substr(0, 15) == "multipart/mixed");
if (!has_sdp && !generate_sdp) {
// let's see whether we should force SDP or not.
@@ -775,7 +778,8 @@ void AmSipDialog::onRxReply(const AmSipReply& reply)
reply.cseq_method == SIP_METH_UPDATE ||
reply.cseq_method == SIP_METH_PRACK) &&
!reply.body.empty() &&
- (reply.content_type == SIP_APPLICATION_SDP)) {
+ (reply.content_type == SIP_APPLICATION_SDP ||
+ reply.content_type.substr(0, 15) == "multipart/mixed")) {
if(((oa_trans.state == OA_Completed) ||
(oa_trans.state == OA_OfferRecved)) &&
_______________________________________________
Semsdev mailing list
[email protected]
http://lists.iptel.org/mailman/listinfo/semsdev