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: http://svn.digium.com/svn/asterisk/trunk@317475 f38db490-d61c-443f-a65b-d21fe96a405b
This commit is contained in:
parent
8a4c82c4b7
commit
09c11738f2
|
@ -231,7 +231,6 @@ static int load_module(void)
|
||||||
{
|
{
|
||||||
struct ast_config *cfg;
|
struct ast_config *cfg;
|
||||||
struct ast_flags config_flags = { 0 };
|
struct ast_flags config_flags = { 0 };
|
||||||
int res;
|
|
||||||
const char *tmp;
|
const char *tmp;
|
||||||
|
|
||||||
if ((cfg = ast_config_load(cdr_config, config_flags)) && cfg != CONFIG_STATUS_FILEINVALID) {
|
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;
|
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;
|
return AST_MODULE_LOAD_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -535,7 +535,6 @@ static int process_my_load_module(struct ast_config *cfg)
|
||||||
static int my_load_module(int reload)
|
static int my_load_module(int reload)
|
||||||
{
|
{
|
||||||
struct ast_config *cfg;
|
struct ast_config *cfg;
|
||||||
int res;
|
|
||||||
struct ast_flags config_flags = { reload ? CONFIG_FLAG_FILEUNCHANGED : 0 };
|
struct ast_flags config_flags = { reload ? CONFIG_FLAG_FILEUNCHANGED : 0 };
|
||||||
|
|
||||||
if ((cfg = ast_config_load(config, config_flags)) == NULL || cfg == CONFIG_STATUS_FILEINVALID) {
|
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;
|
return AST_MODULE_LOAD_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
res = process_my_load_module(cfg);
|
process_my_load_module(cfg);
|
||||||
ast_config_destroy(cfg);
|
ast_config_destroy(cfg);
|
||||||
|
|
||||||
event_sub = ast_event_subscribe(AST_EVENT_CEL, pgsql_log, "CEL PGSQL backend", NULL, AST_EVENT_IE_END);
|
event_sub = ast_event_subscribe(AST_EVENT_CEL, pgsql_log, "CEL PGSQL backend", NULL, AST_EVENT_IE_END);
|
||||||
|
|
|
@ -725,7 +725,7 @@ static char *cli_console_autoanswer(struct ast_cli_entry *e, int cmd,
|
||||||
|
|
||||||
unref_pvt(pvt);
|
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)
|
static char *cli_console_flash(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
|
||||||
|
|
|
@ -6161,7 +6161,6 @@ static int iax2_trunk_queue(struct chan_iax2_pvt *pvt, struct iax_frame *fr)
|
||||||
struct iax2_trunk_peer *tpeer;
|
struct iax2_trunk_peer *tpeer;
|
||||||
void *tmp, *ptr;
|
void *tmp, *ptr;
|
||||||
struct timeval now;
|
struct timeval now;
|
||||||
int res;
|
|
||||||
struct ast_iax2_meta_trunk_entry *met;
|
struct ast_iax2_meta_trunk_entry *met;
|
||||||
struct ast_iax2_meta_trunk_mini *mtm;
|
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 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) {
|
if (global_max_trunk_mtu > 0 && tpeer->trunkdatalen + f->datalen + 4 >= global_max_trunk_mtu) {
|
||||||
now = ast_tvnow();
|
now = ast_tvnow();
|
||||||
res = send_trunk(tpeer, &now);
|
send_trunk(tpeer, &now);
|
||||||
trunk_untimed ++;
|
trunk_untimed ++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -9350,7 +9349,6 @@ static void *iax_park_thread(void *stuff)
|
||||||
struct iax_dual *d;
|
struct iax_dual *d;
|
||||||
struct ast_frame *f;
|
struct ast_frame *f;
|
||||||
int ext;
|
int ext;
|
||||||
int res;
|
|
||||||
d = stuff;
|
d = stuff;
|
||||||
chan1 = d->chan1;
|
chan1 = d->chan1;
|
||||||
chan2 = d->chan2;
|
chan2 = d->chan2;
|
||||||
|
@ -9358,7 +9356,7 @@ static void *iax_park_thread(void *stuff)
|
||||||
f = ast_read(chan1);
|
f = ast_read(chan1);
|
||||||
if (f)
|
if (f)
|
||||||
ast_frfree(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_hangup(chan2);
|
||||||
ast_log(LOG_NOTICE, "Parked on extension '%d'\n", ext);
|
ast_log(LOG_NOTICE, "Parked on extension '%d'\n", ext);
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
|
@ -587,7 +587,6 @@ static int jingle_create_candidates(struct jingle *client, struct jingle_pvt *p,
|
||||||
struct ast_sockaddr sin_tmp;
|
struct ast_sockaddr sin_tmp;
|
||||||
struct ast_sockaddr us_tmp;
|
struct ast_sockaddr us_tmp;
|
||||||
struct ast_sockaddr bindaddr_tmp;
|
struct ast_sockaddr bindaddr_tmp;
|
||||||
struct sockaddr_in dest;
|
|
||||||
struct in_addr us;
|
struct in_addr us;
|
||||||
struct in_addr externaddr;
|
struct in_addr externaddr;
|
||||||
iks *iq, *jingle, *content, *transport, *candidate;
|
iks *iq, *jingle, *content, *transport, *candidate;
|
||||||
|
@ -668,9 +667,6 @@ static int jingle_create_candidates(struct jingle *client, struct jingle_pvt *p,
|
||||||
ours2 = NULL;
|
ours2 = NULL;
|
||||||
}
|
}
|
||||||
ours1 = NULL;
|
ours1 = NULL;
|
||||||
dest.sin_addr = __ourip;
|
|
||||||
dest.sin_port = sin.sin_port;
|
|
||||||
|
|
||||||
|
|
||||||
for (tmp = p->ourcandidates; tmp; tmp = tmp->next) {
|
for (tmp = p->ourcandidates; tmp; tmp = tmp->next) {
|
||||||
snprintf(component, sizeof(component), "%u", tmp->component);
|
snprintf(component, sizeof(component), "%u", tmp->component);
|
||||||
|
|
|
@ -4587,7 +4587,6 @@ static struct sip_peer *realtime_peer(const char *newpeername, struct ast_sockad
|
||||||
struct ast_config *peerlist = NULL;
|
struct ast_config *peerlist = NULL;
|
||||||
char ipaddr[INET6_ADDRSTRLEN];
|
char ipaddr[INET6_ADDRSTRLEN];
|
||||||
char portstring[6]; /*up to 5 digits plus null terminator*/
|
char portstring[6]; /*up to 5 digits plus null terminator*/
|
||||||
char *cat = NULL;
|
|
||||||
int realtimeregs = ast_check_realtime("sipregs");
|
int realtimeregs = ast_check_realtime("sipregs");
|
||||||
|
|
||||||
/* First check on peer name */
|
/* 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"*/
|
} else { /*var wasn't found in the list of "hosts", so try "ipaddr"*/
|
||||||
peerlist = NULL;
|
peerlist = NULL;
|
||||||
cat = NULL;
|
|
||||||
peerlist = ast_load_realtime_multientry("sippeers", "ipaddr", ipaddr, SENTINEL);
|
peerlist = ast_load_realtime_multientry("sippeers", "ipaddr", ipaddr, SENTINEL);
|
||||||
if(peerlist) {
|
if(peerlist) {
|
||||||
var = get_insecure_variable_from_config(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 */
|
/* 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_registry *r = (struct sip_registry *)data; /* the ref count should have been bumped when the sched item was added */
|
||||||
struct sip_pvt *p;
|
struct sip_pvt *p;
|
||||||
int res;
|
|
||||||
|
|
||||||
/* if we couldn't get a reference to the registry object, punt */
|
/* if we couldn't get a reference to the registry object, punt */
|
||||||
if (!r) {
|
if (!r) {
|
||||||
|
@ -12777,7 +12774,7 @@ static int sip_reg_timeout(const void *data)
|
||||||
r->regstate = REG_STATE_FAILED;
|
r->regstate = REG_STATE_FAILED;
|
||||||
} else {
|
} else {
|
||||||
r->regstate = REG_STATE_UNREGISTERED;
|
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);
|
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));
|
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;
|
const char *of;
|
||||||
char *c;
|
char *c;
|
||||||
char referto[256];
|
char referto[256];
|
||||||
char *ttag, *ftag;
|
|
||||||
char *theirtag = ast_strdupa(p->theirtag);
|
|
||||||
int use_tls=FALSE;
|
int use_tls=FALSE;
|
||||||
|
|
||||||
if (sipdebug) {
|
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 ? */
|
/* Are we transfering an inbound or outbound call ? */
|
||||||
if (ast_test_flag(&p->flags[0], SIP_OUTGOING)) {
|
if (ast_test_flag(&p->flags[0], SIP_OUTGOING)) {
|
||||||
of = get_header(&p->initreq, "To");
|
of = get_header(&p->initreq, "To");
|
||||||
ttag = theirtag;
|
|
||||||
ftag = p->tag;
|
|
||||||
} else {
|
} else {
|
||||||
of = get_header(&p->initreq, "From");
|
of = get_header(&p->initreq, "From");
|
||||||
ftag = theirtag;
|
|
||||||
ttag = p->tag;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ast_copy_string(from, of, sizeof(from));
|
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;
|
struct ast_channel *owner;
|
||||||
int sipmethod;
|
int sipmethod;
|
||||||
int res = 1;
|
|
||||||
const char *c = get_header(req, "Cseq");
|
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 */
|
/* 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);
|
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) {
|
} else if (sipmethod == SIP_NOTIFY) {
|
||||||
handle_response_notify(p, resp, rest, req, seqno);
|
handle_response_notify(p, resp, rest, req, seqno);
|
||||||
} else if (sipmethod == SIP_REGISTER) {
|
} 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) {
|
} else if (sipmethod == SIP_SUBSCRIBE) {
|
||||||
ast_set_flag(&p->flags[1], SIP_PAGE2_DIALOG_ESTABLISHED);
|
ast_set_flag(&p->flags[1], SIP_PAGE2_DIALOG_ESTABLISHED);
|
||||||
handle_response_subscribe(p, resp, rest, req, seqno);
|
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)
|
else if (sipmethod == SIP_SUBSCRIBE)
|
||||||
handle_response_subscribe(p, resp, rest, req, seqno);
|
handle_response_subscribe(p, resp, rest, req, seqno);
|
||||||
else if (p->registry && sipmethod == SIP_REGISTER)
|
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) {
|
else if (sipmethod == SIP_UPDATE) {
|
||||||
handle_response_update(p, resp, rest, req, seqno);
|
handle_response_update(p, resp, rest, req, seqno);
|
||||||
} else if (sipmethod == SIP_BYE) {
|
} 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)
|
else if (sipmethod == SIP_SUBSCRIBE)
|
||||||
handle_response_subscribe(p, resp, rest, req, seqno);
|
handle_response_subscribe(p, resp, rest, req, seqno);
|
||||||
else if (p->registry && sipmethod == SIP_REGISTER)
|
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 {
|
else {
|
||||||
ast_log(LOG_WARNING, "Forbidden - maybe wrong password on authentication for %s\n", msg);
|
ast_log(LOG_WARNING, "Forbidden - maybe wrong password on authentication for %s\n", msg);
|
||||||
pvt_set_needdestroy(p, "received 403 response");
|
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;
|
break;
|
||||||
case 404: /* Not found */
|
case 404: /* Not found */
|
||||||
if (p->registry && sipmethod == SIP_REGISTER)
|
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)
|
else if (sipmethod == SIP_INVITE)
|
||||||
handle_response_invite(p, resp, rest, req, seqno);
|
handle_response_invite(p, resp, rest, req, seqno);
|
||||||
else if (sipmethod == SIP_SUBSCRIBE)
|
else if (sipmethod == SIP_SUBSCRIBE)
|
||||||
|
@ -20435,13 +20425,13 @@ static void handle_response(struct sip_pvt *p, int resp, const char *rest, struc
|
||||||
break;
|
break;
|
||||||
case 423: /* Interval too brief */
|
case 423: /* Interval too brief */
|
||||||
if (sipmethod == SIP_REGISTER)
|
if (sipmethod == SIP_REGISTER)
|
||||||
res = handle_response_register(p, resp, rest, req, seqno);
|
handle_response_register(p, resp, rest, req, seqno);
|
||||||
break;
|
break;
|
||||||
case 408: /* Request timeout - terminate dialog */
|
case 408: /* Request timeout - terminate dialog */
|
||||||
if (sipmethod == SIP_INVITE)
|
if (sipmethod == SIP_INVITE)
|
||||||
handle_response_invite(p, resp, rest, req, seqno);
|
handle_response_invite(p, resp, rest, req, seqno);
|
||||||
else if (sipmethod == SIP_REGISTER)
|
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) {
|
else if (sipmethod == SIP_BYE) {
|
||||||
pvt_set_needdestroy(p, "received 408 response");
|
pvt_set_needdestroy(p, "received 408 response");
|
||||||
ast_debug(4, "Got timeout on bye. Thanks for the answer. Now, kill this call\n");
|
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 */
|
/* Mostly created to return proper answers on notifications on outbound REFER's */
|
||||||
int res = 0;
|
int res = 0;
|
||||||
const char *event = get_header(req, "Event");
|
const char *event = get_header(req, "Event");
|
||||||
char *eventid = NULL;
|
|
||||||
char *sep;
|
char *sep;
|
||||||
|
|
||||||
if( (sep = strchr(event, ';')) ) { /* XXX bug here - overwriting string ? */
|
if( (sep = strchr(event, ';')) ) { /* XXX bug here - overwriting string ? */
|
||||||
*sep++ = '\0';
|
*sep++ = '\0';
|
||||||
eventid = sep;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (sipdebug)
|
if (sipdebug)
|
||||||
|
|
|
@ -110,7 +110,6 @@ static unsigned int iax_str2flags(const char *buf)
|
||||||
{
|
{
|
||||||
int x;
|
int x;
|
||||||
int len;
|
int len;
|
||||||
int found;
|
|
||||||
unsigned int flags = 0;
|
unsigned int flags = 0;
|
||||||
char *e;
|
char *e;
|
||||||
while(buf && *buf) {
|
while(buf && *buf) {
|
||||||
|
@ -119,7 +118,6 @@ static unsigned int iax_str2flags(const char *buf)
|
||||||
len = e - buf;
|
len = e - buf;
|
||||||
else
|
else
|
||||||
len = 0;
|
len = 0;
|
||||||
found = 0;
|
|
||||||
for (x = 0; x < ARRAY_LEN(iax_flags); x++) {
|
for (x = 0; x < ARRAY_LEN(iax_flags); x++) {
|
||||||
if ((len && !strncasecmp(iax_flags[x].name, buf, len)) ||
|
if ((len && !strncasecmp(iax_flags[x].name, buf, len)) ||
|
||||||
(!len && !strcasecmp(iax_flags[x].name, buf))) {
|
(!len && !strcasecmp(iax_flags[x].name, buf))) {
|
||||||
|
|
|
@ -191,7 +191,6 @@ err:
|
||||||
int sdp_crypto_process(struct sdp_crypto *p, const char *attr, struct ast_rtp_instance *rtp)
|
int sdp_crypto_process(struct sdp_crypto *p, const char *attr, struct ast_rtp_instance *rtp)
|
||||||
{
|
{
|
||||||
char *str = NULL;
|
char *str = NULL;
|
||||||
char *name = NULL;
|
|
||||||
char *tag = NULL;
|
char *tag = NULL;
|
||||||
char *suite = NULL;
|
char *suite = NULL;
|
||||||
char *key_params = 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);
|
str = ast_strdupa(attr);
|
||||||
|
|
||||||
name = strsep(&str, ":");
|
strsep(&str, ":");
|
||||||
tag = strsep(&str, " ");
|
tag = strsep(&str, " ");
|
||||||
suite = strsep(&str, " ");
|
suite = strsep(&str, " ");
|
||||||
key_params = strsep(&str, " ");
|
key_params = strsep(&str, " ");
|
||||||
|
|
|
@ -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, "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, "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) : "<Unspecified>");
|
ast_cli(a->fd, "Host: %s\n", peer->addr.sin_addr.s_addr ? ast_inet_ntoa(peer->addr.sin_addr) : "<Unspecified>");
|
||||||
ast_cli(a->fd, "Port: %d\n", ntohs(peer->addr.sin_port));
|
ast_cli(a->fd, "Port: %d\n", ntohs(peer->addr.sin_port));
|
||||||
ast_cli(a->fd, "Dynamic: %s\n", peer->dynamic ? "yes" : "no");
|
ast_cli(a->fd, "Dynamic: %s\n", peer->dynamic ? "yes" : "no");
|
||||||
|
|
|
@ -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 */
|
/* step through the extensions looking for a match */
|
||||||
for (i = 1; i < lua_objlen(L, context_order_table) + 1; i++) {
|
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;
|
const char *e;
|
||||||
|
|
||||||
lua_pushinteger(L, i);
|
lua_pushinteger(L, i);
|
||||||
lua_gettable(L, context_order_table);
|
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 */
|
/* copy the key at the top of the stack for use later */
|
||||||
lua_pushvalue(L, -1);
|
lua_pushvalue(L, -1);
|
||||||
|
|
|
@ -151,7 +151,7 @@ static struct ast_variable *realtime_odbc(const char *database, const char *tabl
|
||||||
char coltitle[256];
|
char coltitle[256];
|
||||||
char rowdata[2048];
|
char rowdata[2048];
|
||||||
char *op;
|
char *op;
|
||||||
const char *newparam, *newval;
|
const char *newparam;
|
||||||
char *stringp;
|
char *stringp;
|
||||||
char *chunk;
|
char *chunk;
|
||||||
SQLSMALLINT collen;
|
SQLSMALLINT collen;
|
||||||
|
@ -193,7 +193,7 @@ static struct ast_variable *realtime_odbc(const char *database, const char *tabl
|
||||||
ast_string_field_free_memory(&cps);
|
ast_string_field_free_memory(&cps);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
newval = va_arg(aq, const char *);
|
va_arg(aq, const char *);
|
||||||
op = !strchr(newparam, ' ') ? " =" : "";
|
op = !strchr(newparam, ' ') ? " =" : "";
|
||||||
snprintf(sql, sizeof(sql), "SELECT * FROM %s WHERE %s%s ?%s", table, newparam, op,
|
snprintf(sql, sizeof(sql), "SELECT * FROM %s WHERE %s%s ?%s", table, newparam, op,
|
||||||
strcasestr(newparam, "LIKE") && !ast_odbc_backslash_is_escape(obj) ? " ESCAPE '\\'" : "");
|
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, ' ') ? " =" : "";
|
op = !strchr(newparam, ' ') ? " =" : "";
|
||||||
snprintf(sql + strlen(sql), sizeof(sql) - strlen(sql), " AND %s%s ?%s", newparam, op,
|
snprintf(sql + strlen(sql), sizeof(sql) - strlen(sql), " AND %s%s ?%s", newparam, op,
|
||||||
strcasestr(newparam, "LIKE") && !ast_odbc_backslash_is_escape(obj) ? " ESCAPE '\\'" : "");
|
strcasestr(newparam, "LIKE") && !ast_odbc_backslash_is_escape(obj) ? " ESCAPE '\\'" : "");
|
||||||
newval = va_arg(aq, const char *);
|
va_arg(aq, const char *);
|
||||||
}
|
}
|
||||||
va_end(aq);
|
va_end(aq);
|
||||||
|
|
||||||
|
@ -317,7 +317,7 @@ static struct ast_config *realtime_multi_odbc(const char *database, const char *
|
||||||
char rowdata[2048];
|
char rowdata[2048];
|
||||||
const char *initfield=NULL;
|
const char *initfield=NULL;
|
||||||
char *op;
|
char *op;
|
||||||
const char *newparam, *newval;
|
const char *newparam;
|
||||||
char *stringp;
|
char *stringp;
|
||||||
char *chunk;
|
char *chunk;
|
||||||
SQLSMALLINT collen;
|
SQLSMALLINT collen;
|
||||||
|
@ -358,7 +358,7 @@ static struct ast_config *realtime_multi_odbc(const char *database, const char *
|
||||||
initfield = ast_strdupa(newparam);
|
initfield = ast_strdupa(newparam);
|
||||||
if ((op = strchr(initfield, ' ')))
|
if ((op = strchr(initfield, ' ')))
|
||||||
*op = '\0';
|
*op = '\0';
|
||||||
newval = va_arg(aq, const char *);
|
va_arg(aq, const char *);
|
||||||
op = !strchr(newparam, ' ') ? " =" : "";
|
op = !strchr(newparam, ' ') ? " =" : "";
|
||||||
snprintf(sql, sizeof(sql), "SELECT * FROM %s WHERE %s%s ?%s", table, newparam, op,
|
snprintf(sql, sizeof(sql), "SELECT * FROM %s WHERE %s%s ?%s", table, newparam, op,
|
||||||
strcasestr(newparam, "LIKE") && !ast_odbc_backslash_is_escape(obj) ? " ESCAPE '\\'" : "");
|
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, ' ') ? " =" : "";
|
op = !strchr(newparam, ' ') ? " =" : "";
|
||||||
snprintf(sql + strlen(sql), sizeof(sql) - strlen(sql), " AND %s%s ?%s", newparam, op,
|
snprintf(sql + strlen(sql), sizeof(sql) - strlen(sql), " AND %s%s ?%s", newparam, op,
|
||||||
strcasestr(newparam, "LIKE") && !ast_odbc_backslash_is_escape(obj) ? " ESCAPE '\\'" : "");
|
strcasestr(newparam, "LIKE") && !ast_odbc_backslash_is_escape(obj) ? " ESCAPE '\\'" : "");
|
||||||
newval = va_arg(aq, const char *);
|
va_arg(aq, const char *);
|
||||||
}
|
}
|
||||||
if (initfield)
|
if (initfield)
|
||||||
snprintf(sql + strlen(sql), sizeof(sql) - strlen(sql), " ORDER BY %s", 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;
|
SQLHSTMT stmt;
|
||||||
char sql[256];
|
char sql[256];
|
||||||
SQLLEN rowcount=0;
|
SQLLEN rowcount=0;
|
||||||
const char *newparam, *newval;
|
const char *newparam;
|
||||||
int res, count = 1;
|
int res, count = 1;
|
||||||
va_list aq;
|
va_list aq;
|
||||||
struct custom_prepare_struct cps = { .sql = sql, .extra = lookup };
|
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);
|
ast_string_field_free_memory(&cps);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
newval = va_arg(aq, const char *);
|
va_arg(aq, const char *);
|
||||||
|
|
||||||
if (tableptr && !(column = ast_odbc_find_column(tableptr, newparam))) {
|
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);
|
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);
|
snprintf(sql, sizeof(sql), "UPDATE %s SET %s=?", table, newparam);
|
||||||
while((newparam = va_arg(aq, const char *))) {
|
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) {
|
if ((tableptr && (column = ast_odbc_find_column(tableptr, newparam))) || count > 63) {
|
||||||
snprintf(sql + strlen(sql), sizeof(sql) - strlen(sql), ", %s=?", newparam);
|
snprintf(sql + strlen(sql), sizeof(sql) - strlen(sql), ", %s=?", newparam);
|
||||||
} else { /* the column does not exist in the table */
|
} 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 keys[256];
|
||||||
char vals[256];
|
char vals[256];
|
||||||
SQLLEN rowcount=0;
|
SQLLEN rowcount=0;
|
||||||
const char *newparam, *newval;
|
const char *newparam;
|
||||||
int res;
|
int res;
|
||||||
va_list aq;
|
va_list aq;
|
||||||
struct custom_prepare_struct cps = { .sql = sql, .extra = NULL };
|
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);
|
ast_odbc_release_obj(obj);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
newval = va_arg(aq, const char *);
|
va_arg(aq, const char *);
|
||||||
snprintf(keys, sizeof(keys), "%s", newparam);
|
snprintf(keys, sizeof(keys), "%s", newparam);
|
||||||
ast_copy_string(vals, "?", sizeof(vals));
|
ast_copy_string(vals, "?", sizeof(vals));
|
||||||
while ((newparam = va_arg(aq, const char *))) {
|
while ((newparam = va_arg(aq, const char *))) {
|
||||||
snprintf(keys + strlen(keys), sizeof(keys) - strlen(keys), ", %s", newparam);
|
snprintf(keys + strlen(keys), sizeof(keys) - strlen(keys), ", %s", newparam);
|
||||||
snprintf(vals + strlen(vals), sizeof(vals) - strlen(vals), ", ?");
|
snprintf(vals + strlen(vals), sizeof(vals) - strlen(vals), ", ?");
|
||||||
newval = va_arg(aq, const char *);
|
va_arg(aq, const char *);
|
||||||
}
|
}
|
||||||
va_end(aq);
|
va_end(aq);
|
||||||
snprintf(sql, sizeof(sql), "INSERT INTO %s (%s) VALUES (%s)", table, keys, vals);
|
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;
|
SQLHSTMT stmt;
|
||||||
char sql[256];
|
char sql[256];
|
||||||
SQLLEN rowcount=0;
|
SQLLEN rowcount=0;
|
||||||
const char *newparam, *newval;
|
const char *newparam;
|
||||||
int res;
|
int res;
|
||||||
va_list aq;
|
va_list aq;
|
||||||
struct custom_prepare_struct cps = { .sql = sql, .extra = lookup };
|
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);
|
snprintf(sql, sizeof(sql), "DELETE FROM %s WHERE ", table);
|
||||||
while((newparam = va_arg(aq, const char *))) {
|
while((newparam = va_arg(aq, const char *))) {
|
||||||
snprintf(sql + strlen(sql), sizeof(sql) - strlen(sql), "%s=? AND ", newparam);
|
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);
|
va_end(aq);
|
||||||
snprintf(sql + strlen(sql), sizeof(sql) - strlen(sql), "%s=?", keyfield);
|
snprintf(sql + strlen(sql), sizeof(sql) - strlen(sql), "%s=?", keyfield);
|
||||||
|
|
|
@ -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_tables *tbl = find_table(tablename);
|
||||||
struct sqlite_cache_columns *col;
|
struct sqlite_cache_columns *col;
|
||||||
char *elm;
|
char *elm;
|
||||||
int type, size, res = 0;
|
int type, res = 0;
|
||||||
|
|
||||||
if (!tbl) {
|
if (!tbl) {
|
||||||
return -1;
|
return -1;
|
||||||
|
@ -1626,7 +1626,7 @@ static int realtime_require_handler(const char *unused, const char *tablename, v
|
||||||
|
|
||||||
while ((elm = va_arg(ap, char *))) {
|
while ((elm = va_arg(ap, char *))) {
|
||||||
type = va_arg(ap, require_type);
|
type = va_arg(ap, require_type);
|
||||||
size = va_arg(ap, int);
|
va_arg(ap, int);
|
||||||
/* Check if the field matches the criteria */
|
/* Check if the field matches the criteria */
|
||||||
AST_RWLIST_TRAVERSE(&tbl->columns, col, list) {
|
AST_RWLIST_TRAVERSE(&tbl->columns, col, list) {
|
||||||
if (strcmp(col->name, elm) == 0) {
|
if (strcmp(col->name, elm) == 0) {
|
||||||
|
|
|
@ -99,7 +99,8 @@ static int pw_cb(char *buf, int size, int rwflag, void *userdata)
|
||||||
{
|
{
|
||||||
struct ast_key *key = (struct ast_key *)userdata;
|
struct ast_key *key = (struct ast_key *)userdata;
|
||||||
char prompt[256];
|
char prompt[256];
|
||||||
int res, tmp;
|
int tmp;
|
||||||
|
int res;
|
||||||
|
|
||||||
if (key->infd < 0) {
|
if (key->infd < 0) {
|
||||||
/* Note that we were at least called */
|
/* 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);
|
tmp = ast_hide_password(key->infd);
|
||||||
memset(buf, 0, size);
|
memset(buf, 0, size);
|
||||||
res = read(key->infd, buf, 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);
|
ast_restore_tty(key->infd, tmp);
|
||||||
if (buf[strlen(buf) -1] == '\n') {
|
if (buf[strlen(buf) -1] == '\n') {
|
||||||
buf[strlen(buf) - 1] = '\0';
|
buf[strlen(buf) - 1] = '\0';
|
||||||
|
|
|
@ -2873,7 +2873,6 @@ static int aji_register_transport2(void *data, ikspak *pak)
|
||||||
*/
|
*/
|
||||||
static void aji_pruneregister(struct aji_client *client)
|
static void aji_pruneregister(struct aji_client *client)
|
||||||
{
|
{
|
||||||
int res = 0;
|
|
||||||
iks *removeiq = iks_new("iq");
|
iks *removeiq = iks_new("iq");
|
||||||
iks *removequery = iks_new("query");
|
iks *removequery = iks_new("query");
|
||||||
iks *removeitem = iks_new("item");
|
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
|
/* For an aji_buddy, both AUTOPRUNE and AUTOREGISTER will never
|
||||||
* be called at the same time */
|
* be called at the same time */
|
||||||
if (ast_test_flag(&iterator->flags, AJI_AUTOPRUNE)) { /* If autoprune is set on jabber.conf */
|
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"
|
"GoodBye. Your status is no longer needed by Asterisk the Open Source PBX"
|
||||||
" so I am no longer subscribing to your presence.\n"));
|
" 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"
|
"GoodBye. You are no longer in the Asterisk config file so I am removing"
|
||||||
" your access to my presence.\n"));
|
" your access to my presence.\n"));
|
||||||
iks_insert_attrib(removeiq, "from", client->jid->full);
|
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(removequery, "xmlns", "jabber:iq:roster");
|
||||||
iks_insert_attrib(removeitem, "jid", iterator->name);
|
iks_insert_attrib(removeitem, "jid", iterator->name);
|
||||||
iks_insert_attrib(removeitem, "subscription", "remove");
|
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)) {
|
} 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"));
|
"Greetings! I am the Asterisk Open Source PBX and I want to subscribe to your presence\n"));
|
||||||
ast_clear_flag(&iterator->flags, AJI_AUTOREGISTER);
|
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)
|
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 *modify_affiliates = aji_pubsub_iq_create(client, "set");
|
||||||
iks *pubsub, *affiliations, *affiliate;
|
iks *pubsub, *affiliations, *affiliate;
|
||||||
pubsub = iks_insert(modify_affiliates, "pubsub");
|
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");
|
iks_insert_attrib(affiliate, "affiliation", "owner");
|
||||||
ASTOBJ_UNLOCK(iterator);
|
ASTOBJ_UNLOCK(iterator);
|
||||||
});
|
});
|
||||||
res = ast_aji_send(client, modify_affiliates);
|
ast_aji_send(client, modify_affiliates);
|
||||||
iks_delete(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)
|
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 *request = aji_build_node_request(client, collection);
|
||||||
|
|
||||||
iks_filter_add_rule(client->f, aji_receive_node_list, client, IKS_RULE_TYPE,
|
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_PAK_IQ, IKS_RULE_SUBTYPE, IKS_TYPE_RESULT, IKS_RULE_ID, client->mid,
|
||||||
IKS_RULE_DONE);
|
IKS_RULE_DONE);
|
||||||
res = ast_aji_send(client, request);
|
ast_aji_send(client, request);
|
||||||
iks_delete(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)
|
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);
|
iks *request = aji_build_node_request(client, collection_name);
|
||||||
ast_aji_send(client, request);
|
ast_aji_send(client, request);
|
||||||
iks_filter_add_rule(client->f, aji_delete_node_list, client, IKS_RULE_TYPE,
|
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_PAK_IQ, IKS_RULE_SUBTYPE, IKS_TYPE_RESULT, IKS_RULE_ID, client->mid,
|
||||||
IKS_RULE_DONE);
|
IKS_RULE_DONE);
|
||||||
res = ast_aji_send(client, request);
|
ast_aji_send(client, request);
|
||||||
iks_delete(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
|
static iks* aji_create_pubsub_node(struct aji_client *client, const char *node_type, const
|
||||||
char *name, const char *collection_name)
|
char *name, const char *collection_name)
|
||||||
{
|
{
|
||||||
int res = 0;
|
|
||||||
iks *node = aji_pubsub_iq_create(client, "set");
|
iks *node = aji_pubsub_iq_create(client, "set");
|
||||||
iks *pubsub, *create, *configure;
|
iks *pubsub, *create;
|
||||||
pubsub = iks_insert(node, "pubsub");
|
pubsub = iks_insert(node, "pubsub");
|
||||||
iks_insert_attrib(pubsub, "xmlns", "http://jabber.org/protocol/pubsub");
|
iks_insert_attrib(pubsub, "xmlns", "http://jabber.org/protocol/pubsub");
|
||||||
create = iks_insert(pubsub, "create");
|
create = iks_insert(pubsub, "create");
|
||||||
iks_insert_attrib(create, "node", name);
|
iks_insert_attrib(create, "node", name);
|
||||||
configure = aji_build_node_config(pubsub, node_type, collection_name);
|
aji_build_node_config(pubsub, node_type, collection_name);
|
||||||
res = ast_aji_send(client, node);
|
ast_aji_send(client, node);
|
||||||
aji_create_affiliations(client, name);
|
aji_create_affiliations(client, name);
|
||||||
iks_delete(node);
|
iks_delete(node);
|
||||||
return 0;
|
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)
|
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 *presence = iks_make_pres(level, desc);
|
||||||
iks *cnode = iks_new("c");
|
iks *cnode = iks_new("c");
|
||||||
iks *priority = iks_new("priority");
|
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, "ext", "voice-v1");
|
||||||
iks_insert_attrib(cnode, "xmlns", "http://jabber.org/protocol/caps");
|
iks_insert_attrib(cnode, "xmlns", "http://jabber.org/protocol/caps");
|
||||||
iks_insert_node(presence, cnode);
|
iks_insert_node(presence, cnode);
|
||||||
res = ast_aji_send(client, presence);
|
ast_aji_send(client, presence);
|
||||||
} else {
|
} else {
|
||||||
ast_log(LOG_ERROR, "Out of memory.\n");
|
ast_log(LOG_ERROR, "Out of memory.\n");
|
||||||
}
|
}
|
||||||
|
|
Reference in New Issue