summaryrefslogtreecommitdiff
path: root/channels
diff options
context:
space:
mode:
authorRussell Bryant <russell@russellbryant.com>2011-05-05 22:44:52 +0000
committerRussell Bryant <russell@russellbryant.com>2011-05-05 22:44:52 +0000
commitf0f5e237bf96ed5531b164935bbe8dca1c7b70ed (patch)
tree2b7d632f7f42d434363d7dee71d987562eb56ed9 /channels
parentc28e2d380c185b8cda44b468504bb8a6892714a6 (diff)
Merged revisions 317474 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8 ........ r317474 | russell | 2011-05-05 17:36:33 -0500 (Thu, 05 May 2011) | 2 lines Fix more "set but unused" warnings. ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@317475 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'channels')
-rw-r--r--channels/chan_console.c2
-rw-r--r--channels/chan_iax2.c6
-rw-r--r--channels/chan_jingle.c4
-rw-r--r--channels/chan_sip.c26
-rw-r--r--channels/iax2-provision.c2
-rw-r--r--channels/sip/sdp_crypto.c3
6 files changed, 11 insertions, 32 deletions
diff --git a/channels/chan_console.c b/channels/chan_console.c
index eb961b682..c08e3e5ab 100644
--- a/channels/chan_console.c
+++ b/channels/chan_console.c
@@ -725,7 +725,7 @@ static char *cli_console_autoanswer(struct ast_cli_entry *e, int cmd,
unref_pvt(pvt);
- return CLI_SUCCESS;
+ return res;
}
static char *cli_console_flash(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
diff --git a/channels/chan_iax2.c b/channels/chan_iax2.c
index 0db1f2299..45410f64f 100644
--- a/channels/chan_iax2.c
+++ b/channels/chan_iax2.c
@@ -6161,7 +6161,6 @@ static int iax2_trunk_queue(struct chan_iax2_pvt *pvt, struct iax_frame *fr)
struct iax2_trunk_peer *tpeer;
void *tmp, *ptr;
struct timeval now;
- int res;
struct ast_iax2_meta_trunk_entry *met;
struct ast_iax2_meta_trunk_mini *mtm;
@@ -6217,7 +6216,7 @@ static int iax2_trunk_queue(struct chan_iax2_pvt *pvt, struct iax_frame *fr)
/* if we have enough for a full MTU, ship it now without waiting */
if (global_max_trunk_mtu > 0 && tpeer->trunkdatalen + f->datalen + 4 >= global_max_trunk_mtu) {
now = ast_tvnow();
- res = send_trunk(tpeer, &now);
+ send_trunk(tpeer, &now);
trunk_untimed ++;
}
@@ -9350,7 +9349,6 @@ static void *iax_park_thread(void *stuff)
struct iax_dual *d;
struct ast_frame *f;
int ext;
- int res;
d = stuff;
chan1 = d->chan1;
chan2 = d->chan2;
@@ -9358,7 +9356,7 @@ static void *iax_park_thread(void *stuff)
f = ast_read(chan1);
if (f)
ast_frfree(f);
- res = ast_park_call(chan1, chan2, 0, d->parkexten, &ext);
+ ast_park_call(chan1, chan2, 0, d->parkexten, &ext);
ast_hangup(chan2);
ast_log(LOG_NOTICE, "Parked on extension '%d'\n", ext);
return NULL;
diff --git a/channels/chan_jingle.c b/channels/chan_jingle.c
index 311f4c91c..d0a027c3d 100644
--- a/channels/chan_jingle.c
+++ b/channels/chan_jingle.c
@@ -587,7 +587,6 @@ static int jingle_create_candidates(struct jingle *client, struct jingle_pvt *p,
struct ast_sockaddr sin_tmp;
struct ast_sockaddr us_tmp;
struct ast_sockaddr bindaddr_tmp;
- struct sockaddr_in dest;
struct in_addr us;
struct in_addr externaddr;
iks *iq, *jingle, *content, *transport, *candidate;
@@ -668,9 +667,6 @@ static int jingle_create_candidates(struct jingle *client, struct jingle_pvt *p,
ours2 = NULL;
}
ours1 = NULL;
- dest.sin_addr = __ourip;
- dest.sin_port = sin.sin_port;
-
for (tmp = p->ourcandidates; tmp; tmp = tmp->next) {
snprintf(component, sizeof(component), "%u", tmp->component);
diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index 2ab88b37b..84a5d7d12 100644
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -4587,7 +4587,6 @@ static struct sip_peer *realtime_peer(const char *newpeername, struct ast_sockad
struct ast_config *peerlist = NULL;
char ipaddr[INET6_ADDRSTRLEN];
char portstring[6]; /*up to 5 digits plus null terminator*/
- char *cat = NULL;
int realtimeregs = ast_check_realtime("sipregs");
/* First check on peer name */
@@ -4659,7 +4658,6 @@ static struct sip_peer *realtime_peer(const char *newpeername, struct ast_sockad
}
} else { /*var wasn't found in the list of "hosts", so try "ipaddr"*/
peerlist = NULL;
- cat = NULL;
peerlist = ast_load_realtime_multientry("sippeers", "ipaddr", ipaddr, SENTINEL);
if(peerlist) {
var = get_insecure_variable_from_config(peerlist);
@@ -12734,7 +12732,6 @@ static int sip_reg_timeout(const void *data)
/* if we are here, our registration timed out, so we'll just do it over */
struct sip_registry *r = (struct sip_registry *)data; /* the ref count should have been bumped when the sched item was added */
struct sip_pvt *p;
- int res;
/* if we couldn't get a reference to the registry object, punt */
if (!r) {
@@ -12777,7 +12774,7 @@ static int sip_reg_timeout(const void *data)
r->regstate = REG_STATE_FAILED;
} else {
r->regstate = REG_STATE_UNREGISTERED;
- res = transmit_register(r, SIP_REGISTER, NULL, NULL);
+ transmit_register(r, SIP_REGISTER, NULL, NULL);
ast_log(LOG_NOTICE, " -- Registration for '%s@%s' timed out, trying again (Attempt #%d)\n", r->username, r->hostname, r->regattempts);
}
manager_event(EVENT_FLAG_SYSTEM, "Registry", "ChannelType: SIP\r\nUsername: %s\r\nDomain: %s\r\nStatus: %s\r\n", r->username, r->hostname, regstate2str(r->regstate));
@@ -13058,8 +13055,6 @@ static int transmit_refer(struct sip_pvt *p, const char *dest)
const char *of;
char *c;
char referto[256];
- char *ttag, *ftag;
- char *theirtag = ast_strdupa(p->theirtag);
int use_tls=FALSE;
if (sipdebug) {
@@ -13069,12 +13064,8 @@ static int transmit_refer(struct sip_pvt *p, const char *dest)
/* Are we transfering an inbound or outbound call ? */
if (ast_test_flag(&p->flags[0], SIP_OUTGOING)) {
of = get_header(&p->initreq, "To");
- ttag = theirtag;
- ftag = p->tag;
} else {
of = get_header(&p->initreq, "From");
- ftag = theirtag;
- ttag = p->tag;
}
ast_copy_string(from, of, sizeof(from));
@@ -20251,7 +20242,6 @@ static void handle_response(struct sip_pvt *p, int resp, const char *rest, struc
{
struct ast_channel *owner;
int sipmethod;
- int res = 1;
const char *c = get_header(req, "Cseq");
/* GCC 4.2 complains if I try to cast c as a char * when passing it to ast_skip_nonblanks, so make a copy of it */
char *c_copy = ast_strdupa(c);
@@ -20374,7 +20364,7 @@ static void handle_response(struct sip_pvt *p, int resp, const char *rest, struc
} else if (sipmethod == SIP_NOTIFY) {
handle_response_notify(p, resp, rest, req, seqno);
} else if (sipmethod == SIP_REGISTER) {
- res = handle_response_register(p, resp, rest, req, seqno);
+ handle_response_register(p, resp, rest, req, seqno);
} else if (sipmethod == SIP_SUBSCRIBE) {
ast_set_flag(&p->flags[1], SIP_PAGE2_DIALOG_ESTABLISHED);
handle_response_subscribe(p, resp, rest, req, seqno);
@@ -20392,7 +20382,7 @@ static void handle_response(struct sip_pvt *p, int resp, const char *rest, struc
else if (sipmethod == SIP_SUBSCRIBE)
handle_response_subscribe(p, resp, rest, req, seqno);
else if (p->registry && sipmethod == SIP_REGISTER)
- res = handle_response_register(p, resp, rest, req, seqno);
+ handle_response_register(p, resp, rest, req, seqno);
else if (sipmethod == SIP_UPDATE) {
handle_response_update(p, resp, rest, req, seqno);
} else if (sipmethod == SIP_BYE) {
@@ -20417,7 +20407,7 @@ static void handle_response(struct sip_pvt *p, int resp, const char *rest, struc
else if (sipmethod == SIP_SUBSCRIBE)
handle_response_subscribe(p, resp, rest, req, seqno);
else if (p->registry && sipmethod == SIP_REGISTER)
- res = handle_response_register(p, resp, rest, req, seqno);
+ handle_response_register(p, resp, rest, req, seqno);
else {
ast_log(LOG_WARNING, "Forbidden - maybe wrong password on authentication for %s\n", msg);
pvt_set_needdestroy(p, "received 403 response");
@@ -20425,7 +20415,7 @@ static void handle_response(struct sip_pvt *p, int resp, const char *rest, struc
break;
case 404: /* Not found */
if (p->registry && sipmethod == SIP_REGISTER)
- res = handle_response_register(p, resp, rest, req, seqno);
+ handle_response_register(p, resp, rest, req, seqno);
else if (sipmethod == SIP_INVITE)
handle_response_invite(p, resp, rest, req, seqno);
else if (sipmethod == SIP_SUBSCRIBE)
@@ -20435,13 +20425,13 @@ static void handle_response(struct sip_pvt *p, int resp, const char *rest, struc
break;
case 423: /* Interval too brief */
if (sipmethod == SIP_REGISTER)
- res = handle_response_register(p, resp, rest, req, seqno);
+ handle_response_register(p, resp, rest, req, seqno);
break;
case 408: /* Request timeout - terminate dialog */
if (sipmethod == SIP_INVITE)
handle_response_invite(p, resp, rest, req, seqno);
else if (sipmethod == SIP_REGISTER)
- res = handle_response_register(p, resp, rest, req, seqno);
+ handle_response_register(p, resp, rest, req, seqno);
else if (sipmethod == SIP_BYE) {
pvt_set_needdestroy(p, "received 408 response");
ast_debug(4, "Got timeout on bye. Thanks for the answer. Now, kill this call\n");
@@ -21047,12 +21037,10 @@ static int handle_request_notify(struct sip_pvt *p, struct sip_request *req, str
/* Mostly created to return proper answers on notifications on outbound REFER's */
int res = 0;
const char *event = get_header(req, "Event");
- char *eventid = NULL;
char *sep;
if( (sep = strchr(event, ';')) ) { /* XXX bug here - overwriting string ? */
*sep++ = '\0';
- eventid = sep;
}
if (sipdebug)
diff --git a/channels/iax2-provision.c b/channels/iax2-provision.c
index a95098236..26c7a0b5d 100644
--- a/channels/iax2-provision.c
+++ b/channels/iax2-provision.c
@@ -110,7 +110,6 @@ static unsigned int iax_str2flags(const char *buf)
{
int x;
int len;
- int found;
unsigned int flags = 0;
char *e;
while(buf && *buf) {
@@ -119,7 +118,6 @@ static unsigned int iax_str2flags(const char *buf)
len = e - buf;
else
len = 0;
- found = 0;
for (x = 0; x < ARRAY_LEN(iax_flags); x++) {
if ((len && !strncasecmp(iax_flags[x].name, buf, len)) ||
(!len && !strcasecmp(iax_flags[x].name, buf))) {
diff --git a/channels/sip/sdp_crypto.c b/channels/sip/sdp_crypto.c
index 94bf85619..9abf79ebc 100644
--- a/channels/sip/sdp_crypto.c
+++ b/channels/sip/sdp_crypto.c
@@ -191,7 +191,6 @@ err:
int sdp_crypto_process(struct sdp_crypto *p, const char *attr, struct ast_rtp_instance *rtp)
{
char *str = NULL;
- char *name = NULL;
char *tag = NULL;
char *suite = NULL;
char *key_params = NULL;
@@ -211,7 +210,7 @@ int sdp_crypto_process(struct sdp_crypto *p, const char *attr, struct ast_rtp_in
str = ast_strdupa(attr);
- name = strsep(&str, ":");
+ strsep(&str, ":");
tag = strsep(&str, " ");
suite = strsep(&str, " ");
key_params = strsep(&str, " ");