[svn-commits] branch oej/02-labarea r20842 - in
/team/oej/02-labarea: ./ channels/
svn-commits at lists.digium.com
svn-commits at lists.digium.com
Sun Apr 16 23:57:59 MST 2006
Author: oej
Date: Mon Apr 17 01:57:53 2006
New Revision: 20842
URL: http://svn.digium.com/view/asterisk?rev=20842&view=rev
Log:
Try to separate requests with different branches
Modified:
team/oej/02-labarea/Makefile
team/oej/02-labarea/channels/chan_sip.c
Modified: team/oej/02-labarea/Makefile
URL: http://svn.digium.com/view/asterisk/team/oej/02-labarea/Makefile?rev=20842&r1=20841&r2=20842&view=diff
==============================================================================
--- team/oej/02-labarea/Makefile (original)
+++ team/oej/02-labarea/Makefile Mon Apr 17 01:57:53 2006
@@ -57,7 +57,7 @@
#K6OPT = -DK6OPT
# Tell gcc to optimize the code
-OPTIMIZE+=-O6
+OPTIMIZE+=#-O6
else
# Stack backtraces, while useful for debugging, are incompatible with optimizations
ifeq (${OSARCH},Linux)
Modified: team/oej/02-labarea/channels/chan_sip.c
URL: http://svn.digium.com/view/asterisk/team/oej/02-labarea/channels/chan_sip.c?rev=20842&r1=20841&r2=20842&view=diff
==============================================================================
--- team/oej/02-labarea/channels/chan_sip.c (original)
+++ team/oej/02-labarea/channels/chan_sip.c Mon Apr 17 01:57:53 2006
@@ -514,6 +514,11 @@
int method; /*!< Method of this request */
int lines; /*!< SDP Content */
unsigned int flags; /*!< SIP_PKT Flags for this packet */
+ const char *callid; /*!< Call-id of this packet */
+ const char *via; /*!< First via header of this packet */
+ const char *from; /*!< From header */
+ const char *to; /*!< To header */
+ const char *cseq; /*!< Cseq header */
char *header[SIP_MAX_HEADERS];
char *line[SIP_MAX_LINES];
char data[SIP_MAX_PACKET];
@@ -3395,12 +3400,13 @@
char *tag = ""; /* note, tag is never NULL */
char totag[128];
char fromtag[128];
- const char *callid = get_header(req, "Call-ID");
- const char *from = get_header(req, "From");
- const char *to = get_header(req, "To");
- const char *cseq = get_header(req, "Cseq");
-
- if (!callid || !to || !from || !cseq) /* Call-ID, to, from and Cseq are required by RFC 3261. (Max-forwards and via too - ignored now) */
+ req->callid = get_header(req, "Call-ID");
+ req->from = get_header(req, "From");
+ req->to = get_header(req, "To");
+ req->cseq = get_header(req, "Cseq");
+ req->via = get_header(req, "Via");
+
+ if (!req->callid || !req->to || !req->from || !req->cseq) /* Call-ID, to, from and Cseq are required by RFC 3261. (Max-forwards and via too - ignored now) */
return NULL; /* Invalid packet */
if (pedanticsipchecking) {
@@ -3417,17 +3423,18 @@
tag = (req->method == SIP_RESPONSE) ? totag : fromtag;
if (option_debug > 4 )
- ast_log(LOG_DEBUG, "= Looking for Call ID: %s (Checking %s) --From tag %s --To-tag %s \n", callid, req->method==SIP_RESPONSE ? "To" : "From", fromtag, totag);
+ ast_log(LOG_DEBUG, "= Looking for Call ID: %s (Checking %s) --From tag %s --To-tag %s \n", req->callid, req->method==SIP_RESPONSE ? "To" : "From", fromtag, totag);
}
ast_mutex_lock(&iflock);
for (p = iflist; p; p = p->next) {
/* In pedantic, we do not want packets with bad syntax to be connected to a PVT */
int found = FALSE;
+
if (req->method == SIP_REGISTER)
- found = (!strcmp(p->callid, callid));
+ found = (!strcmp(p->callid, req->callid));
else
- found = (!strcmp(p->callid, callid) &&
+ found = (!strcmp(p->callid, req->callid) &&
(!pedanticsipchecking || !tag || ast_strlen_zero(p->theirtag) || !strcmp(p->theirtag, tag))) ;
if (option_debug > 4)
@@ -3450,15 +3457,15 @@
if (found) {
/* Found the call */
- ast_mutex_lock(&p->lock);
- ast_mutex_unlock(&iflock);
- return p;
- }
- }
- ast_mutex_unlock(&iflock);
- /* Allocate new call */
- if ((p = sip_alloc(callid, sin, 1, intended_method)))
- ast_mutex_lock(&p->lock);
+ ast_mutex_lock(&p->lock); /* Lock this PVT while we are working on it */
+ ast_mutex_unlock(&iflock); /* Unlock the interface list */
+ return p; /* Return with this PVT */
+ }
+ }
+ ast_mutex_unlock(&iflock); /* Unlock the interface list */
+
+ if ((p = sip_alloc(req->callid, sin, 1, intended_method))) /* Allocate new call */
+ ast_mutex_lock(&p->lock); /* Lock this new PVT while we are in action */
return p;
}
@@ -4264,8 +4271,8 @@
ot = newto;
}
add_header(resp, "To", ot);
- copy_header(resp, req, "Call-ID");
- copy_header(resp, req, "CSeq");
+ add_header(resp, "Call-ID", req->callid);
+ add_header(resp, "Cseq", req->cseq);
add_header(resp, "User-Agent", global_useragent);
add_header(resp, "Allow", ALLOWED_METHODS);
if (msg[0] == '2' && (p->method == SIP_SUBSCRIBE || p->method == SIP_REGISTER)) {
@@ -11506,7 +11513,7 @@
memset(&resp, 0, sizeof(resp));
/* Get Method and Cseq */
- cseq = get_header(req, "Cseq");
+ cseq = req->cseq;
cmd = req->header[0];
/* Must have Cseq */
@@ -11573,6 +11580,12 @@
p->method = req->method; /* Find out which SIP method they are using */
if (option_debug > 3)
ast_log(LOG_DEBUG, "**** Received %s (%d) - Command in SIP %s\n", sip_methods[p->method].text, sip_methods[p->method].id, cmd);
+
+ /* Check for loop in INVITE */
+ if (p->icseq && (p->icseq > seqno) && req->method == SIP_INVITE) {
+ //SKREP
+ ast_log(LOG_DEBUG, "**** Our initial VIA %s - This req VIA %s\n", p->initreq.via, req->via);
+ }
if (p->icseq && (p->icseq > seqno)) {
if (option_debug)
More information about the svn-commits
mailing list