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.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@403258 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Joshua Colp
2013-12-01 20:04:02 +00:00
parent e0cfdf5655
commit fb7c0d5ecc

View File

@@ -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;
}