summaryrefslogtreecommitdiff
path: root/res/res_pjsip_t38.c
diff options
context:
space:
mode:
authorJoshua Colp <jcolp@digium.com>2013-12-01 20:04:55 +0000
committerJoshua Colp <jcolp@digium.com>2013-12-01 20:04:55 +0000
commit88c840db50b948e0556168dddffd4f417e6b0b34 (patch)
tree62c00a3a4ff713619ad92b31c61154f157465612 /res/res_pjsip_t38.c
parent0620cc0c0049993df6521420d3a6f9b2933aaa55 (diff)
res_pjsip_t38: Add the framehook to the channel only on first INVITE.
The check for determining whether the T.38 framehook should be added to the channel or not has now been changed to guarantee adding only occurs on the first incoming or outgoing INVITE. ........ Merged revisions 403258 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@403259 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'res/res_pjsip_t38.c')
-rw-r--r--res/res_pjsip_t38.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/res/res_pjsip_t38.c b/res/res_pjsip_t38.c
index e44820214..021fe4fe2 100644
--- a/res/res_pjsip_t38.c
+++ b/res/res_pjsip_t38.c
@@ -446,8 +446,10 @@ static void t38_attach_framehook(struct ast_sip_session *session)
.event_cb = t38_framehook,
};
- if (!session->channel || (ast_channel_state(session->channel) == AST_STATE_UP) ||
- !session->endpoint->media.t38.enabled) {
+ /* Only attach the framehook on the first outgoing INVITE or the first incoming INVITE */
+ if ((session->inv_session->state != PJSIP_INV_STATE_NULL &&
+ session->inv_session->state != PJSIP_INV_STATE_INCOMING) ||
+ !session->endpoint->media.t38.enabled) {
return;
}