summaryrefslogtreecommitdiff
path: root/res/res_pjsip_t38.c
diff options
context:
space:
mode:
authorRichard Mudgett <rmudgett@digium.com>2014-05-28 16:56:07 +0000
committerRichard Mudgett <rmudgett@digium.com>2014-05-28 16:56:07 +0000
commit69125a7ae2516902c682ba9a91c5dfa1d189ad29 (patch)
tree457360104b1bc9c779113eb038bd0c8f623a585f /res/res_pjsip_t38.c
parenta5aea0cca026fe894b9f50b6995f6ab5dcf080b1 (diff)
res_pjsip_session: Fix leaked video RTP ports.
Simply enabling PJSIP to negotiage a video codec (e.g., h264) would leak video RTP ports if the codec were not negotiated by an incoming call. * Made add_sdp_streams() associate the handler with the media stream if the handler handled the media stream. Otherwise, when the ast_sip_session_media object was destroyed it didn't know how to clean up the RTP resources. * Fixed sdp_requires_deferral() associating the handler with the media stream when deciding if the SDP processing needs to be deferred for T.38. Like the leaked video RTP ports, the T.38 handler needs to clean up allocated resources from deciding if SDP processing needs to be deffered. * Cleaned up some dead code in handle_incoming_sdp() and sdp_requires_deferral(). ASTERISK-23721 #close Reported by: cervajs Review: https://reviewboard.asterisk.org/r/3571/ ........ Merged revisions 414749 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@414750 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'res/res_pjsip_t38.c')
-rw-r--r--res/res_pjsip_t38.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/res/res_pjsip_t38.c b/res/res_pjsip_t38.c
index 5a6935250..1f83da3bc 100644
--- a/res/res_pjsip_t38.c
+++ b/res/res_pjsip_t38.c
@@ -569,21 +569,22 @@ static void t38_interpret_sdp(struct t38_state *state, struct ast_sip_session *s
}
/*! \brief Function which defers an incoming media stream */
-static int defer_incoming_sdp_stream(struct ast_sip_session *session, struct ast_sip_session_media *session_media,
- const struct pjmedia_sdp_session *sdp, const struct pjmedia_sdp_media *stream)
+static enum ast_sip_session_sdp_stream_defer defer_incoming_sdp_stream(
+ struct ast_sip_session *session, struct ast_sip_session_media *session_media,
+ const struct pjmedia_sdp_session *sdp, const struct pjmedia_sdp_media *stream)
{
struct t38_state *state;
if (!session->endpoint->media.t38.enabled) {
- return 0;
+ return AST_SIP_SESSION_SDP_DEFER_NOT_HANDLED;
}
if (t38_initialize_session(session, session_media)) {
- return 0;
+ return AST_SIP_SESSION_SDP_DEFER_ERROR;
}
if (!(state = t38_state_get_or_alloc(session))) {
- return 0;
+ return AST_SIP_SESSION_SDP_DEFER_ERROR;
}
t38_interpret_sdp(state, session, session_media, stream);
@@ -591,10 +592,10 @@ static int defer_incoming_sdp_stream(struct ast_sip_session *session, struct ast
/* If they are initiating the re-invite we need to defer responding until later */
if (session->t38state == T38_DISABLED) {
t38_change_state(session, session_media, state, T38_PEER_REINVITE);
- return 1;
+ return AST_SIP_SESSION_SDP_DEFER_NEEDED;
}
- return 0;
+ return AST_SIP_SESSION_SDP_DEFER_NOT_NEEDED;
}
/*! \brief Function which negotiates an incoming media stream */