[asterisk-commits] ctooley: branch ctooley/excel-sip-changes r133803 - in /team/ctooley/excel-si...
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Fri Jul 25 14:32:03 CDT 2008
Author: ctooley
Date: Fri Jul 25 14:32:02 2008
New Revision: 133803
URL: http://svn.digium.com/view/asterisk?view=rev&rev=133803
Log:
Content Length Header wasn't being retrieved and tested properly
Modified:
team/ctooley/excel-sip-changes/channels/chan_sip.c
team/ctooley/excel-sip-changes/include/asterisk/channel.h
Modified: team/ctooley/excel-sip-changes/channels/chan_sip.c
URL: http://svn.digium.com/view/asterisk/team/ctooley/excel-sip-changes/channels/chan_sip.c?view=diff&rev=133803&r1=133802&r2=133803
==============================================================================
--- team/ctooley/excel-sip-changes/channels/chan_sip.c (original)
+++ team/ctooley/excel-sip-changes/channels/chan_sip.c Fri Jul 25 14:32:02 2008
@@ -7798,12 +7798,14 @@
struct sip_request resp;
int seqno = 0;
+ char clheader[SIPBUFSIZE];
+
if (reliable && (sscanf(get_header(req, "CSeq"), "%d ", &seqno) != 1)) {
ast_log(LOG_WARNING, "Unable to determine sequence number from '%s'\n", get_header(req, "CSeq"));
return -1;
}
respprep(&resp, p, msg, req);
- clheader = get_header(req, "Content-Length");
+ ast_copy_string(clheader, get_header(req, "Content-Length"), sizeof(stripped));
if(!clheader[0]) {
add_header_contentLength(&resp, 0);
}
@@ -22334,44 +22336,12 @@
*/
static int sip_redirect_multiplechoices(struct sip_pvt *p, const char *dest, const char *content)
{
- char *cdest;
- char *extension, *host, *port;
- char tmp[80];
-
- cdest = ast_strdupa(dest);
-
- extension = strsep(&cdest, "@");
- host = strsep(&cdest, ":");
- port = strsep(&cdest, ":");
- if (ast_strlen_zero(extension)) {
- ast_log(LOG_ERROR, "Missing mandatory argument: extension\n");
+ /* we'll issue the redirect message here */
+ if (!p->uri) {
+ ast_log(LOG_ERROR, "Cannot retrieve the Request URI from the original SIP request!\n");
return 0;
- }
-
- /* we'll issue the redirect message here */
- if (!host) {
- char *localtmp;
- ast_copy_string(tmp, get_header(&p->initreq, "To"), sizeof(tmp));
- if (ast_strlen_zero(tmp)) {
- ast_log(LOG_ERROR, "Cannot retrieve the 'To' header from the original SIP request!\n");
- return 0;
- }
- if ((localtmp = strcasestr(tmp, "sip:")) && (localtmp = strchr(localtmp, '@'))) {
- char lhost[80], lport[80];
- memset(lhost, 0, sizeof(lhost));
- memset(lport, 0, sizeof(lport));
- localtmp++;
- /* This is okey because lhost and lport are as big as tmp */
- sscanf(localtmp, "%[^<>:; ]:%[^<>:; ]", lhost, lport);
- if (ast_strlen_zero(lhost)) {
- ast_log(LOG_ERROR, "Can't find the host address\n");
- return 0;
- }
- host = ast_strdupa(lhost);
- if (!ast_strlen_zero(lport)) {
- port = ast_strdupa(lport);
- }
- }
+ } else {
+ ast_log(LOG_DEBUG, "The Request URI looks like: [%s]\n", p->uri);
}
transmit_response_with_routedata(p, "300 Multiple choices", &p->initreq, content);
Modified: team/ctooley/excel-sip-changes/include/asterisk/channel.h
URL: http://svn.digium.com/view/asterisk/team/ctooley/excel-sip-changes/include/asterisk/channel.h?view=diff&rev=133803&r1=133802&r2=133803
==============================================================================
--- team/ctooley/excel-sip-changes/include/asterisk/channel.h (original)
+++ team/ctooley/excel-sip-changes/include/asterisk/channel.h Fri Jul 25 14:32:02 2008
@@ -332,6 +332,9 @@
/*! \brief Blind transfer other side (see app_transfer.c and ast_transfer() */
int (* const transfer)(struct ast_channel *chan, const char *newdest);
+
+ /*! \brief Respond to a route request (see app_routerequest.c) */
+ int (* const routeresponse)(struct ast_channel *chan, const char *newdest, const char *routelist);
/*! \brief Write a frame, in standard format */
int (* const write_video)(struct ast_channel *chan, struct ast_frame *frame);
More information about the asterisk-commits
mailing list