From f0f5e237bf96ed5531b164935bbe8dca1c7b70ed Mon Sep 17 00:00:00 2001 From: Russell Bryant Date: Thu, 5 May 2011 22:44:52 +0000 Subject: [PATCH] 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 --- cdr/cdr_radius.c | 3 +-- cel/cel_pgsql.c | 3 +-- channels/chan_console.c | 2 +- channels/chan_iax2.c | 6 ++---- channels/chan_jingle.c | 4 ---- channels/chan_sip.c | 26 +++++++------------------- channels/iax2-provision.c | 2 -- channels/sip/sdp_crypto.c | 3 +-- pbx/pbx_dundi.c | 1 + pbx/pbx_lua.c | 4 ++-- res/res_config_odbc.c | 28 ++++++++++++++-------------- res/res_config_sqlite.c | 4 ++-- res/res_crypto.c | 6 +++++- res/res_jabber.c | 28 +++++++++++----------------- 14 files changed, 48 insertions(+), 72 deletions(-) diff --git a/cdr/cdr_radius.c b/cdr/cdr_radius.c index c0e2c6d2f5..3a6190942f 100644 --- a/cdr/cdr_radius.c +++ b/cdr/cdr_radius.c @@ -231,7 +231,6 @@ static int load_module(void) { struct ast_config *cfg; struct ast_flags config_flags = { 0 }; - int res; const char *tmp; if ((cfg = ast_config_load(cdr_config, config_flags)) && cfg != CONFIG_STATUS_FILEINVALID) { @@ -259,7 +258,7 @@ static int load_module(void) return AST_MODULE_LOAD_DECLINE; } - res = ast_cdr_register(name, desc, radius_log); + ast_cdr_register(name, desc, radius_log); return AST_MODULE_LOAD_SUCCESS; } diff --git a/cel/cel_pgsql.c b/cel/cel_pgsql.c index ca064ec226..c1861c8553 100644 --- a/cel/cel_pgsql.c +++ b/cel/cel_pgsql.c @@ -535,7 +535,6 @@ static int process_my_load_module(struct ast_config *cfg) static int my_load_module(int reload) { struct ast_config *cfg; - int res; struct ast_flags config_flags = { reload ? CONFIG_FLAG_FILEUNCHANGED : 0 }; if ((cfg = ast_config_load(config, config_flags)) == NULL || cfg == CONFIG_STATUS_FILEINVALID) { @@ -545,7 +544,7 @@ static int my_load_module(int reload) return AST_MODULE_LOAD_SUCCESS; } - res = process_my_load_module(cfg); + process_my_load_module(cfg); ast_config_destroy(cfg); event_sub = ast_event_subscribe(AST_EVENT_CEL, pgsql_log, "CEL PGSQL backend", NULL, AST_EVENT_IE_END); diff --git a/channels/chan_console.c b/channels/chan_console.c index eb961b6825..c08e3e5ab0 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 0db1f22995..45410f64f9 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 311f4c91c9..d0a027c3de 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 2ab88b37ba..84a5d7d126 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 a95098236c..26c7a0b5d5 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 94bf856194..9abf79ebc5 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, " "); diff --git a/pbx/pbx_dundi.c b/pbx/pbx_dundi.c index e95118cce8..4c52d9d7c0 100644 --- a/pbx/pbx_dundi.c +++ b/pbx/pbx_dundi.c @@ -2603,6 +2603,7 @@ static char *dundi_show_peer(struct ast_cli_entry *e, int cmd, struct ast_cli_ar } ast_cli(a->fd, "Peer: %s\n", ast_eid_to_str(eid_str, sizeof(eid_str), &peer->eid)); ast_cli(a->fd, "Model: %s\n", model2str(peer->model)); + ast_cli(a->fd, "Order: %s\n", order); ast_cli(a->fd, "Host: %s\n", peer->addr.sin_addr.s_addr ? ast_inet_ntoa(peer->addr.sin_addr) : ""); ast_cli(a->fd, "Port: %d\n", ntohs(peer->addr.sin_port)); ast_cli(a->fd, "Dynamic: %s\n", peer->dynamic ? "yes" : "no"); diff --git a/pbx/pbx_lua.c b/pbx/pbx_lua.c index c874c7383d..24766bfc29 100644 --- a/pbx/pbx_lua.c +++ b/pbx/pbx_lua.c @@ -1425,12 +1425,12 @@ static int lua_find_extension(lua_State *L, const char *context, const char *ext /* step through the extensions looking for a match */ for (i = 1; i < lua_objlen(L, context_order_table) + 1; i++) { - int e_index, e_index_copy, match = 0; + int e_index_copy, match = 0; const char *e; lua_pushinteger(L, i); lua_gettable(L, context_order_table); - e_index = lua_gettop(L); + lua_gettop(L); /* copy the key at the top of the stack for use later */ lua_pushvalue(L, -1); diff --git a/res/res_config_odbc.c b/res/res_config_odbc.c index b31241235e..8154ecc2b9 100644 --- a/res/res_config_odbc.c +++ b/res/res_config_odbc.c @@ -151,7 +151,7 @@ static struct ast_variable *realtime_odbc(const char *database, const char *tabl char coltitle[256]; char rowdata[2048]; char *op; - const char *newparam, *newval; + const char *newparam; char *stringp; char *chunk; SQLSMALLINT collen; @@ -193,7 +193,7 @@ static struct ast_variable *realtime_odbc(const char *database, const char *tabl ast_string_field_free_memory(&cps); return NULL; } - newval = va_arg(aq, const char *); + va_arg(aq, const char *); op = !strchr(newparam, ' ') ? " =" : ""; snprintf(sql, sizeof(sql), "SELECT * FROM %s WHERE %s%s ?%s", table, newparam, op, strcasestr(newparam, "LIKE") && !ast_odbc_backslash_is_escape(obj) ? " ESCAPE '\\'" : ""); @@ -201,7 +201,7 @@ static struct ast_variable *realtime_odbc(const char *database, const char *tabl op = !strchr(newparam, ' ') ? " =" : ""; snprintf(sql + strlen(sql), sizeof(sql) - strlen(sql), " AND %s%s ?%s", newparam, op, strcasestr(newparam, "LIKE") && !ast_odbc_backslash_is_escape(obj) ? " ESCAPE '\\'" : ""); - newval = va_arg(aq, const char *); + va_arg(aq, const char *); } va_end(aq); @@ -317,7 +317,7 @@ static struct ast_config *realtime_multi_odbc(const char *database, const char * char rowdata[2048]; const char *initfield=NULL; char *op; - const char *newparam, *newval; + const char *newparam; char *stringp; char *chunk; SQLSMALLINT collen; @@ -358,7 +358,7 @@ static struct ast_config *realtime_multi_odbc(const char *database, const char * initfield = ast_strdupa(newparam); if ((op = strchr(initfield, ' '))) *op = '\0'; - newval = va_arg(aq, const char *); + va_arg(aq, const char *); op = !strchr(newparam, ' ') ? " =" : ""; snprintf(sql, sizeof(sql), "SELECT * FROM %s WHERE %s%s ?%s", table, newparam, op, strcasestr(newparam, "LIKE") && !ast_odbc_backslash_is_escape(obj) ? " ESCAPE '\\'" : ""); @@ -366,7 +366,7 @@ static struct ast_config *realtime_multi_odbc(const char *database, const char * op = !strchr(newparam, ' ') ? " =" : ""; snprintf(sql + strlen(sql), sizeof(sql) - strlen(sql), " AND %s%s ?%s", newparam, op, strcasestr(newparam, "LIKE") && !ast_odbc_backslash_is_escape(obj) ? " ESCAPE '\\'" : ""); - newval = va_arg(aq, const char *); + va_arg(aq, const char *); } if (initfield) snprintf(sql + strlen(sql), sizeof(sql) - strlen(sql), " ORDER BY %s", initfield); @@ -476,7 +476,7 @@ static int update_odbc(const char *database, const char *table, const char *keyf SQLHSTMT stmt; char sql[256]; SQLLEN rowcount=0; - const char *newparam, *newval; + const char *newparam; int res, count = 1; va_list aq; struct custom_prepare_struct cps = { .sql = sql, .extra = lookup }; @@ -509,7 +509,7 @@ static int update_odbc(const char *database, const char *table, const char *keyf ast_string_field_free_memory(&cps); return -1; } - newval = va_arg(aq, const char *); + va_arg(aq, const char *); if (tableptr && !(column = ast_odbc_find_column(tableptr, newparam))) { ast_log(LOG_WARNING, "Key field '%s' does not exist in table '%s@%s'. Update will fail\n", newparam, table, database); @@ -517,7 +517,7 @@ static int update_odbc(const char *database, const char *table, const char *keyf snprintf(sql, sizeof(sql), "UPDATE %s SET %s=?", table, newparam); while((newparam = va_arg(aq, const char *))) { - newval = va_arg(aq, const char *); + va_arg(aq, const char *); if ((tableptr && (column = ast_odbc_find_column(tableptr, newparam))) || count > 63) { snprintf(sql + strlen(sql), sizeof(sql) - strlen(sql), ", %s=?", newparam); } else { /* the column does not exist in the table */ @@ -716,7 +716,7 @@ static int store_odbc(const char *database, const char *table, va_list ap) char keys[256]; char vals[256]; SQLLEN rowcount=0; - const char *newparam, *newval; + const char *newparam; int res; va_list aq; struct custom_prepare_struct cps = { .sql = sql, .extra = NULL }; @@ -737,13 +737,13 @@ static int store_odbc(const char *database, const char *table, va_list ap) ast_odbc_release_obj(obj); return -1; } - newval = va_arg(aq, const char *); + va_arg(aq, const char *); snprintf(keys, sizeof(keys), "%s", newparam); ast_copy_string(vals, "?", sizeof(vals)); while ((newparam = va_arg(aq, const char *))) { snprintf(keys + strlen(keys), sizeof(keys) - strlen(keys), ", %s", newparam); snprintf(vals + strlen(vals), sizeof(vals) - strlen(vals), ", ?"); - newval = va_arg(aq, const char *); + va_arg(aq, const char *); } va_end(aq); snprintf(sql, sizeof(sql), "INSERT INTO %s (%s) VALUES (%s)", table, keys, vals); @@ -791,7 +791,7 @@ static int destroy_odbc(const char *database, const char *table, const char *key SQLHSTMT stmt; char sql[256]; SQLLEN rowcount=0; - const char *newparam, *newval; + const char *newparam; int res; va_list aq; struct custom_prepare_struct cps = { .sql = sql, .extra = lookup }; @@ -810,7 +810,7 @@ static int destroy_odbc(const char *database, const char *table, const char *key snprintf(sql, sizeof(sql), "DELETE FROM %s WHERE ", table); while((newparam = va_arg(aq, const char *))) { snprintf(sql + strlen(sql), sizeof(sql) - strlen(sql), "%s=? AND ", newparam); - newval = va_arg(aq, const char *); + va_arg(aq, const char *); } va_end(aq); snprintf(sql + strlen(sql), sizeof(sql) - strlen(sql), "%s=?", keyfield); diff --git a/res/res_config_sqlite.c b/res/res_config_sqlite.c index 744a07bac7..75d353cd55 100644 --- a/res/res_config_sqlite.c +++ b/res/res_config_sqlite.c @@ -1618,7 +1618,7 @@ static int realtime_require_handler(const char *unused, const char *tablename, v struct sqlite_cache_tables *tbl = find_table(tablename); struct sqlite_cache_columns *col; char *elm; - int type, size, res = 0; + int type, res = 0; if (!tbl) { return -1; @@ -1626,7 +1626,7 @@ static int realtime_require_handler(const char *unused, const char *tablename, v while ((elm = va_arg(ap, char *))) { type = va_arg(ap, require_type); - size = va_arg(ap, int); + va_arg(ap, int); /* Check if the field matches the criteria */ AST_RWLIST_TRAVERSE(&tbl->columns, col, list) { if (strcmp(col->name, elm) == 0) { diff --git a/res/res_crypto.c b/res/res_crypto.c index 4886b4f1a5..e25b8a4d6d 100644 --- a/res/res_crypto.c +++ b/res/res_crypto.c @@ -99,7 +99,8 @@ static int pw_cb(char *buf, int size, int rwflag, void *userdata) { struct ast_key *key = (struct ast_key *)userdata; char prompt[256]; - int res, tmp; + int tmp; + int res; if (key->infd < 0) { /* Note that we were at least called */ @@ -118,6 +119,9 @@ static int pw_cb(char *buf, int size, int rwflag, void *userdata) tmp = ast_hide_password(key->infd); memset(buf, 0, size); res = read(key->infd, buf, size); + if (res == -1) { + ast_log(LOG_WARNING, "read() failed: %s\n", strerror(errno)); + } ast_restore_tty(key->infd, tmp); if (buf[strlen(buf) -1] == '\n') { buf[strlen(buf) - 1] = '\0'; diff --git a/res/res_jabber.c b/res/res_jabber.c index 951eb3edfa..47fbcadce9 100644 --- a/res/res_jabber.c +++ b/res/res_jabber.c @@ -2873,7 +2873,6 @@ static int aji_register_transport2(void *data, ikspak *pak) */ static void aji_pruneregister(struct aji_client *client) { - int res = 0; iks *removeiq = iks_new("iq"); iks *removequery = iks_new("query"); iks *removeitem = iks_new("item"); @@ -2890,10 +2889,10 @@ static void aji_pruneregister(struct aji_client *client) /* For an aji_buddy, both AUTOPRUNE and AUTOREGISTER will never * be called at the same time */ if (ast_test_flag(&iterator->flags, AJI_AUTOPRUNE)) { /* If autoprune is set on jabber.conf */ - res = ast_aji_send(client, iks_make_s10n(IKS_TYPE_UNSUBSCRIBE, iterator->name, + ast_aji_send(client, iks_make_s10n(IKS_TYPE_UNSUBSCRIBE, iterator->name, "GoodBye. Your status is no longer needed by Asterisk the Open Source PBX" " so I am no longer subscribing to your presence.\n")); - res = ast_aji_send(client, iks_make_s10n(IKS_TYPE_UNSUBSCRIBED, iterator->name, + ast_aji_send(client, iks_make_s10n(IKS_TYPE_UNSUBSCRIBED, iterator->name, "GoodBye. You are no longer in the Asterisk config file so I am removing" " your access to my presence.\n")); iks_insert_attrib(removeiq, "from", client->jid->full); @@ -2901,9 +2900,9 @@ static void aji_pruneregister(struct aji_client *client) iks_insert_attrib(removequery, "xmlns", "jabber:iq:roster"); iks_insert_attrib(removeitem, "jid", iterator->name); iks_insert_attrib(removeitem, "subscription", "remove"); - res = ast_aji_send(client, removeiq); + ast_aji_send(client, removeiq); } else if (ast_test_flag(&iterator->flags, AJI_AUTOREGISTER)) { - res = ast_aji_send(client, iks_make_s10n(IKS_TYPE_SUBSCRIBE, iterator->name, + ast_aji_send(client, iks_make_s10n(IKS_TYPE_SUBSCRIBE, iterator->name, "Greetings! I am the Asterisk Open Source PBX and I want to subscribe to your presence\n")); ast_clear_flag(&iterator->flags, AJI_AUTOREGISTER); } @@ -3287,7 +3286,6 @@ static int aji_handle_pubsub_event(void *data, ikspak *pak) */ static void aji_create_affiliations(struct aji_client *client, const char *node) { - int res = 0; iks *modify_affiliates = aji_pubsub_iq_create(client, "set"); iks *pubsub, *affiliations, *affiliate; pubsub = iks_insert(modify_affiliates, "pubsub"); @@ -3301,7 +3299,7 @@ static void aji_create_affiliations(struct aji_client *client, const char *node) iks_insert_attrib(affiliate, "affiliation", "owner"); ASTOBJ_UNLOCK(iterator); }); - res = ast_aji_send(client, modify_affiliates); + ast_aji_send(client, modify_affiliates); iks_delete(modify_affiliates); } @@ -3503,13 +3501,12 @@ static int aji_handle_pubsub_error(void *data, ikspak *pak) */ static void aji_request_pubsub_nodes(struct aji_client *client, const char *collection) { - int res = 0; iks *request = aji_build_node_request(client, collection); iks_filter_add_rule(client->f, aji_receive_node_list, client, IKS_RULE_TYPE, IKS_PAK_IQ, IKS_RULE_SUBTYPE, IKS_TYPE_RESULT, IKS_RULE_ID, client->mid, IKS_RULE_DONE); - res = ast_aji_send(client, request); + ast_aji_send(client, request); iks_delete(request); } @@ -3646,13 +3643,12 @@ static char *aji_cli_purge_pubsub_nodes(struct ast_cli_entry *e, int cmd, struct static void aji_pubsub_purge_nodes(struct aji_client *client, const char* collection_name) { - int res = 0; iks *request = aji_build_node_request(client, collection_name); ast_aji_send(client, request); iks_filter_add_rule(client->f, aji_delete_node_list, client, IKS_RULE_TYPE, IKS_PAK_IQ, IKS_RULE_SUBTYPE, IKS_TYPE_RESULT, IKS_RULE_ID, client->mid, IKS_RULE_DONE); - res = ast_aji_send(client, request); + ast_aji_send(client, request); iks_delete(request); } @@ -3772,15 +3768,14 @@ const char *leaf_name) static iks* aji_create_pubsub_node(struct aji_client *client, const char *node_type, const char *name, const char *collection_name) { - int res = 0; iks *node = aji_pubsub_iq_create(client, "set"); - iks *pubsub, *create, *configure; + iks *pubsub, *create; pubsub = iks_insert(node, "pubsub"); iks_insert_attrib(pubsub, "xmlns", "http://jabber.org/protocol/pubsub"); create = iks_insert(pubsub, "create"); iks_insert_attrib(create, "node", name); - configure = aji_build_node_config(pubsub, node_type, collection_name); - res = ast_aji_send(client, node); + aji_build_node_config(pubsub, node_type, collection_name); + ast_aji_send(client, node); aji_create_affiliations(client, name); iks_delete(node); return 0; @@ -3924,7 +3919,6 @@ static char *aji_cli_create_leafnode(struct ast_cli_entry *e, int cmd, struct as */ static void aji_set_presence(struct aji_client *client, char *to, char *from, int level, char *desc) { - int res = 0; iks *presence = iks_make_pres(level, desc); iks *cnode = iks_new("c"); iks *priority = iks_new("priority"); @@ -3945,7 +3939,7 @@ static void aji_set_presence(struct aji_client *client, char *to, char *from, in iks_insert_attrib(cnode, "ext", "voice-v1"); iks_insert_attrib(cnode, "xmlns", "http://jabber.org/protocol/caps"); iks_insert_node(presence, cnode); - res = ast_aji_send(client, presence); + ast_aji_send(client, presence); } else { ast_log(LOG_ERROR, "Out of memory.\n"); }