aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoroej <oej@f38db490-d61c-443f-a65b-d21fe96a405b>2007-03-13 10:03:03 +0000
committeroej <oej@f38db490-d61c-443f-a65b-d21fe96a405b>2007-03-13 10:03:03 +0000
commite0939e6ecc106bf57039e07e42fdbaac7610292d (patch)
treeb436f2493fe6e4878e63aa940dfcee1d47247b37
parentd216eb8f05546f9f7505009ee7261dd6e04c37d4 (diff)
Don't hangup the call on OK or errors on MESSAGE and INFO
inside of a dialog (like video update requests). git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@58845 f38db490-d61c-443f-a65b-d21fe96a405b
-rw-r--r--channels/chan_sip.c23
1 files changed, 13 insertions, 10 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index 12e353147..d5e4870c9 100644
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -12213,9 +12213,10 @@ static void handle_response(struct sip_pvt *p, int resp, char *rest, struct sip_
break;
case 200: /* 200 OK */
p->authtries = 0; /* Reset authentication counter */
- if (sipmethod == SIP_MESSAGE) {
- /* We successfully transmitted a message */
- ast_set_flag(&p->flags[0], SIP_NEEDDESTROY);
+ if (sipmethod == SIP_MESSAGE || sipmethod == SIP_INFO) {
+ /* We successfully transmitted a message
+ or a video update request in INFO */
+ /* Nothing happens here - the message is inside a dialog */
} else if (sipmethod == SIP_INVITE) {
handle_response_invite(p, resp, rest, req, seqno);
} else if (sipmethod == SIP_NOTIFY) {
@@ -12344,7 +12345,8 @@ static void handle_response(struct sip_pvt *p, int resp, char *rest, struct sip_
if ((option_verbose > 2) && (resp != 487))
ast_verbose(VERBOSE_PREFIX_3 "Got SIP response %d \"%s\" back from %s\n", resp, rest, ast_inet_ntoa(p->sa.sin_addr));
- stop_media_flows(p); /* Immediately stop RTP, VRTP and UDPTL as applicable */
+ if (sipmethod == SIP_INVITE)
+ stop_media_flows(p); /* Immediately stop RTP, VRTP and UDPTL as applicable */
/* XXX Locking issues?? XXX */
switch(resp) {
@@ -12388,14 +12390,15 @@ static void handle_response(struct sip_pvt *p, int resp, char *rest, struct sip_
break;
default:
/* Send hangup */
- if (owner)
+ if (owner && sipmethod != SIP_MESSAGE && sipmethod != SIP_INFO)
ast_queue_hangup(p->owner);
break;
}
/* ACK on invite */
if (sipmethod == SIP_INVITE)
transmit_request(p, SIP_ACK, seqno, XMIT_UNRELIABLE, FALSE);
- sip_alreadygone(p);
+ if (sipmethod != SIP_MESSAGE && sipmethod != SIP_INFO)
+ sip_alreadygone(p);
if (!p->owner)
ast_set_flag(&p->flags[0], SIP_NEEDDESTROY);
} else if ((resp >= 100) && (resp < 200)) {
@@ -12451,10 +12454,10 @@ static void handle_response(struct sip_pvt *p, int resp, char *rest, struct sip_
}
} else if (sipmethod == SIP_BYE)
ast_set_flag(&p->flags[0], SIP_NEEDDESTROY);
- else if (sipmethod == SIP_MESSAGE)
- /* We successfully transmitted a message */
- /* XXX Why destroy this pvt after message transfer? Bad */
- ast_set_flag(&p->flags[0], SIP_NEEDDESTROY);
+ else if (sipmethod == SIP_MESSAGE || sipmethod == SIP_INFO)
+ /* We successfully transmitted a message or
+ a video update request in INFO */
+ ;
else if (sipmethod == SIP_BYE)
/* Ok, we're ready to go */
ast_set_flag(&p->flags[0], SIP_NEEDDESTROY);