aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormmichelson <mmichelson@f38db490-d61c-443f-a65b-d21fe96a405b>2008-11-18 22:47:57 +0000
committermmichelson <mmichelson@f38db490-d61c-443f-a65b-d21fe96a405b>2008-11-18 22:47:57 +0000
commita234ce6b3b592cb8424e396f74a201a8c99088fd (patch)
tree37499f521c7c2c96b50f44f332574406fed15bd4
parent9bfe2bb2dbbcfa758cadd212c1d614adaa24f06f (diff)
Add some missing invite state changes necessary in the sip_write
function. Not setting the invite state correctly on the call was resulting in the Record application leaving empty files. I also have updated the doxygen comment next to the declaration of the INV_EARLY_MEDIA constant to reflect that we also use this state when we *send* a 18X response to an INVITE. (closes issue #13878) Reported by: nahuelgreco Patches: sip-early-media-recording-1.4.22.patch uploaded by nahuelgreco (license 162) Tested by: putnopvut git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@157503 f38db490-d61c-443f-a65b-d21fe96a405b
-rw-r--r--channels/chan_sip.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index d2fc230a7..b2c58ed09 100644
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -258,7 +258,7 @@ enum invitestates {
INV_NONE = 0, /*!< No state at all, maybe not an INVITE dialog */
INV_CALLING = 1, /*!< Invite sent, no answer */
INV_PROCEEDING = 2, /*!< We got/sent 1xx message */
- INV_EARLY_MEDIA = 3, /*!< We got 18x message with to-tag back */
+ INV_EARLY_MEDIA = 3, /*!< We got/sent 18x message with to-tag back */
INV_COMPLETED = 4, /*!< Got final response with error. Wait for ACK, then CONFIRMED */
INV_CONFIRMED = 5, /*!< Confirmed response - we've got an ack (Incoming calls only) */
INV_TERMINATED = 6, /*!< Transaction done - either successful (AST_STATE_UP) or failed, but done
@@ -3757,8 +3757,9 @@ static int sip_write(struct ast_channel *ast, struct ast_frame *frame)
!ast_test_flag(&p->flags[0], SIP_PROGRESS_SENT) &&
!ast_test_flag(&p->flags[0], SIP_OUTGOING)) {
ast_rtp_new_source(p->rtp);
+ p->invitestate = INV_EARLY_MEDIA;
transmit_response_with_sdp(p, "183 Session Progress", &p->initreq, XMIT_UNRELIABLE);
- ast_set_flag(&p->flags[0], SIP_PROGRESS_SENT);
+ ast_set_flag(&p->flags[0], SIP_PROGRESS_SENT);
}
p->lastrtptx = time(NULL);
res = ast_rtp_write(p->rtp, frame);
@@ -3774,6 +3775,7 @@ static int sip_write(struct ast_channel *ast, struct ast_frame *frame)
if ((ast->_state != AST_STATE_UP) &&
!ast_test_flag(&p->flags[0], SIP_PROGRESS_SENT) &&
!ast_test_flag(&p->flags[0], SIP_OUTGOING)) {
+ p->invitestate = INV_EARLY_MEDIA;
transmit_response_with_sdp(p, "183 Session Progress", &p->initreq, XMIT_UNRELIABLE);
ast_set_flag(&p->flags[0], SIP_PROGRESS_SENT);
}