aboutsummaryrefslogtreecommitdiffstats
path: root/channels/chan_sip.c
diff options
context:
space:
mode:
authoroej <oej@f38db490-d61c-443f-a65b-d21fe96a405b>2006-11-12 15:30:48 +0000
committeroej <oej@f38db490-d61c-443f-a65b-d21fe96a405b>2006-11-12 15:30:48 +0000
commitd738b50d7fb3bda387bbb433f30fa4ed43dd88ff (patch)
treec6ef5eda7a14a51d5243dbfa5867f6e7f0b5e359 /channels/chan_sip.c
parent63fd05e1d5b692c20cd615fa06f1485d42ff34e2 (diff)
- Don't hangup because of failed re-invite. Go back to previous state.
- Keep RTP running during T.38 session We might improve the code to issue ast_rtp_stop if T.38 re-invite not fails later on in the code, but I don't see many reasons to. git-svn-id: http://svn.digium.com/svn/asterisk/trunk@47510 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels/chan_sip.c')
-rw-r--r--channels/chan_sip.c45
1 files changed, 26 insertions, 19 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index a206f7349..e7c552c3e 100644
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -4862,22 +4862,6 @@ static int process_sdp(struct sip_pvt *p, struct sip_request *req)
memcpy(&sin.sin_addr, hp->h_addr, sizeof(sin.sin_addr));
if (vhp)
memcpy(&vsin.sin_addr, vhp->h_addr, sizeof(vsin.sin_addr));
-
- if (p->rtp) {
- if (portno > 0) {
- sin.sin_port = htons(portno);
- ast_rtp_set_peer(p->rtp, &sin);
- if (debug)
- ast_verbose("Peer audio RTP is at port %s:%d\n", ast_inet_ntoa(sin.sin_addr), ntohs(sin.sin_port));
- } else {
- ast_rtp_stop(p->rtp);
- if (debug)
- ast_verbose("Peer doesn't provide audio\n");
- }
- }
- /* Setup video port number */
- if (vportno != -1)
- vsin.sin_port = htons(vportno);
/* Setup UDPTL port number */
if (p->udptl) {
@@ -4893,6 +4877,28 @@ static int process_sdp(struct sip_pvt *p, struct sip_request *req)
}
}
+
+ if (p->rtp) {
+ if (portno > 0) {
+ sin.sin_port = htons(portno);
+ ast_rtp_set_peer(p->rtp, &sin);
+ if (debug)
+ ast_verbose("Peer audio RTP is at port %s:%d\n", ast_inet_ntoa(sin.sin_addr), ntohs(sin.sin_port));
+ } else {
+ if (udptlportno > 0) {
+ if (debug)
+ ast_verbose("Got T.38 Re-invite without audio. Keeping RTP active during T.38 session. Callid %s\n", p->callid);
+ } else {
+ ast_rtp_stop(p->rtp);
+ if (debug)
+ ast_verbose("Peer doesn't provide audio. Callid %s\n", p->callid);
+ }
+ }
+ }
+ /* Setup video port number */
+ if (vportno != -1)
+ vsin.sin_port = htons(vportno);
+
/* Next, scan through each "a=rtpmap:" line, noting each
* specified RTP payload type (with corresponding MIME subtype):
*/
@@ -13479,7 +13485,7 @@ static int handle_request_invite(struct sip_pvt *p, struct sip_request *req, int
transmit_response(p, "488 Not acceptable here", req);
else
transmit_response_reliable(p, "488 Not acceptable here", req);
- sip_scheddestroy(p, DEFAULT_TRANS_TIMEOUT);
+
}
} else {
/* The other side is already setup for T.38 most likely so we need to acknowledge this too */
@@ -13497,7 +13503,9 @@ static int handle_request_invite(struct sip_pvt *p, struct sip_request *req, int
p->t38.state = T38_DISABLED;
if (option_debug > 1)
ast_log(LOG_DEBUG,"T38 state changed to %d on channel %s\n", p->t38.state, p->owner ? p->owner->name : "<none>");
- sip_scheddestroy(p, DEFAULT_TRANS_TIMEOUT);
+
+ if (!p->lastinvite) /* Only destroy if this is *not* a re-invite */
+ sip_scheddestroy(p, DEFAULT_TRANS_TIMEOUT);
}
} else {
/* we are not bridged in a call */
@@ -13524,7 +13532,6 @@ static int handle_request_invite(struct sip_pvt *p, struct sip_request *req, int
transmit_response(p, "488 Not Acceptable Here (unsupported)", req);
else
transmit_response_reliable(p, "488 Not Acceptable Here (unsupported)", req);
- sip_scheddestroy(p, DEFAULT_TRANS_TIMEOUT);
sendok = FALSE;
}
/* No bridged peer with T38 enabled*/