[asterisk-commits] rizzo: branch rizzo/astobj2 r48530 -
/team/rizzo/astobj2/channels/chan_sip.c
asterisk-commits at lists.digium.com
asterisk-commits at lists.digium.com
Sat Dec 16 14:43:36 MST 2006
Author: rizzo
Date: Sat Dec 16 15:43:36 2006
New Revision: 48530
URL: http://svn.digium.com/view/asterisk?view=rev&rev=48530
Log:
rename some variables to clarify a bit their usage.
Modified:
team/rizzo/astobj2/channels/chan_sip.c
Modified: team/rizzo/astobj2/channels/chan_sip.c
URL: http://svn.digium.com/view/asterisk/team/rizzo/astobj2/channels/chan_sip.c?view=diff&rev=48530&r1=48529&r2=48530
==============================================================================
--- team/rizzo/astobj2/channels/chan_sip.c (original)
+++ team/rizzo/astobj2/channels/chan_sip.c Sat Dec 16 15:43:36 2006
@@ -6967,9 +6967,10 @@
struct ast_str *invite = ast_str_alloca(256);
char from[256];
char to[256];
- char tmp[BUFSIZ/2];
- char tmp2[BUFSIZ/2];
- const char *l = NULL, *n = NULL;
+ char tmp_n[BUFSIZ/2]; /* build a local copy of 'n' if needed */
+ char tmp_l[BUFSIZ/2]; /* build a local copy of 'l' if needed */
+ const char *l = NULL; /* XXX what is this, exactly ? */
+ const char *n = NULL; /* XXX what is this, exactly ? */
const char *urioptions = "";
if (ast_test_flag(&p->flags[0], SIP_USEREQPHONE)) {
@@ -7021,10 +7022,10 @@
ast_string_field_set(p, fromname, n);
if (pedanticsipchecking) {
- ast_uri_encode(n, tmp, sizeof(tmp), 0);
- n = tmp;
- ast_uri_encode(l, tmp2, sizeof(tmp2), 0);
- l = tmp2;
+ ast_uri_encode(n, tmp_n, sizeof(tmp_n), 0);
+ n = tmp_n;
+ ast_uri_encode(l, tmp_l, sizeof(tmp_l), 0);
+ l = tmp_l;
}
if (ourport != STANDARD_SIP_PORT && ast_strlen_zero(p->fromdomain))
@@ -7042,8 +7043,8 @@
if (!ast_strlen_zero(p->username)) {
n = p->username;
if (pedanticsipchecking) {
- ast_uri_encode(n, tmp, sizeof(tmp), 0);
- n = tmp;
+ ast_uri_encode(n, tmp_n, sizeof(tmp_n), 0);
+ n = tmp_n;
}
ast_str_append(&invite, 0, "%s@", n);
}
@@ -7069,7 +7070,8 @@
snprintf(to, sizeof(to), "<%s>", p->uri);
init_req(req, sipmethod, p->uri);
- snprintf(tmp, sizeof(tmp), "%d %s", ++p->ocseq, sip_methods[sipmethod].text);
+ /* now tmp_n is available so reuse it to build the CSeq */
+ snprintf(tmp_n, sizeof(tmp_n), "%d %s", ++p->ocseq, sip_methods[sipmethod].text);
add_header(req, "Via", p->via);
add_header(req, "Max-Forwards", DEFAULT_MAX_FORWARDS);
@@ -7086,7 +7088,7 @@
build_contact(p);
add_header(req, "Contact", p->our_contact);
add_header(req, "Call-ID", p->callid);
- add_header(req, "CSeq", tmp);
+ add_header(req, "CSeq", tmp_n);
add_header(req, "User-Agent", global_useragent);
if (!ast_strlen_zero(p->rpid))
add_header(req, "Remote-Party-ID", p->rpid);
More information about the asterisk-commits
mailing list