summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOlle Johansson <oej@edvina.net>2006-04-06 21:01:06 +0000
committerOlle Johansson <oej@edvina.net>2006-04-06 21:01:06 +0000
commit62128ba7b78bc8a5c3e302e10638f5ef849328dc (patch)
tree5930f2d873f64f79f8b07aa0dc4251443ac28951
parent3b89edc066382988fa28993523ea14e8fbd4a43a (diff)
- Don't change channel direction on re-invites
- Don't re-initialize initreq on re-invites git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@18033 65c4cc65-6c06-0410-ace0-fbb531ad65f3
-rw-r--r--channels/chan_sip.c19
1 files changed, 11 insertions, 8 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index 58dcb4f6d..7ef5e04f7 100644
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -10718,7 +10718,7 @@ static int handle_request_options(struct sip_pvt *p, struct sip_request *req, in
static int handle_request_invite(struct sip_pvt *p, struct sip_request *req, int debug, int ignore, int seqno, struct sockaddr_in *sin, int *recount, char *e)
{
int res = 1;
- struct ast_channel *c=NULL;
+ struct ast_channel *c=NULL; /* New channel */
int gotdest;
char *supported;
char *required;
@@ -10730,6 +10730,8 @@ static int handle_request_invite(struct sip_pvt *p, struct sip_request *req, int
if (supported)
parse_sip_options(p, supported);
}
+
+ /* Find out what they require */
required = get_header(req, "Required");
if (!ast_strlen_zero(required)) {
required_profile = parse_sip_options(NULL, required);
@@ -10766,17 +10768,18 @@ static int handle_request_invite(struct sip_pvt *p, struct sip_request *req, int
}
if (!ignore) {
- /* Use this as the basis */
- if (debug)
- ast_verbose("Using INVITE request as basis request - %s\n", p->callid);
sip_cancel_destroy(p);
- /* This call is no longer outgoing if it ever was */
- ast_clear_flag(&p->flags[0], SIP_OUTGOING);
+
/* This also counts as a pending invite */
p->pendinginvite = seqno;
- copy_request(&p->initreq, req);
check_via(p, req);
- if (p->owner) {
+
+ if (!p->owner) { /* Not a re-invite */
+ /* Use this as the basis */
+ copy_request(&p->initreq, req);
+ if (debug)
+ ast_verbose("Using INVITE request as basis request - %s\n", p->callid);
+ } else { /* Re-invite on existing call */
/* Handle SDP here if we already have an owner */
if (!strcasecmp(get_header(req, "Content-Type"), "application/sdp")) {
if (process_sdp(p, req)) {