From e9178c2a897317e16c37747d0879edc2c84bc94a Mon Sep 17 00:00:00 2001 From: Thomas Ries Date: Thu, 21 Apr 2005 22:41:02 +0000 Subject: [PATCH] - fix: ACK may contain SDP body, process it --- ChangeLog | 1 + src/proxy.c | 21 +++++++++++++-------- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/ChangeLog b/ChangeLog index b1e66db..fab46ed 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,6 @@ 0.5.11 ====== + 21-Apr-2005: - fix: ACK may contain SDP body, process it 19-Apr-2005: - feature: DSCP value for RTP packets defineable (by Nick Vermeer, Internet Express) 15-Apr-2005: - feature: auto-save registration table during operation diff --git a/src/proxy.c b/src/proxy.c index 8049847..7d6db38 100644 --- a/src/proxy.c +++ b/src/proxy.c @@ -270,15 +270,12 @@ int proxy_request (sip_ticket_t *ticket) { /* check for incoming request */ } else if (MSG_IS_INVITE(request)) { - /* First, rewrite the body */ - if (configuration.rtp_proxy_enable == 1) { - sts = proxy_rewrite_invitation_body(request, DIR_INCOMING); - } + /* Rewrite the body */ + sts = proxy_rewrite_invitation_body(request, DIR_INCOMING); - /* - * Note: Incoming requests have no need to rewrite Contact - * header - as we are not masquerading something there - */ + } else if (MSG_IS_ACK(request)) { + /* Rewrite the body */ + sts = proxy_rewrite_invitation_body(request, DIR_INCOMING); } break; @@ -324,6 +321,8 @@ int proxy_request (sip_ticket_t *ticket) { /* if an INVITE, rewrite body */ if (MSG_IS_INVITE(request)) { sts = proxy_rewrite_invitation_body(request, DIR_OUTGOING); + } else if (MSG_IS_ACK(request)) { + sts = proxy_rewrite_invitation_body(request, DIR_OUTGOING); } /* if this is CANCEL/BYE request, stop RTP proxying */ @@ -956,6 +955,7 @@ int proxy_rewrite_invitation_body(osip_message_t *mymsg, int direction){ */ sts = osip_message_get_body(mymsg, 0, &body); if (sts != 0) { +#if 0 if ((MSG_IS_RESPONSE_FOR(mymsg,"INVITE")) && (MSG_IS_STATUS_1XX(mymsg))) { /* 1xx responses *MAY* contain SDP data */ @@ -967,6 +967,11 @@ int proxy_rewrite_invitation_body(osip_message_t *mymsg, int direction){ ERROR("rewrite_invitation_body: no body found in message"); return STS_FAILURE; } +#else + DEBUGC(DBCLASS_PROXY, "rewrite_invitation_body: " + "no body found in message"); + return STS_SUCCESS; +#endif } sts = sip_body_to_str(body, &bodybuff, &bodybuflen);