[asterisk-commits] irroot: branch irroot/distrotech-customers-1.8 r333494 - in /team/irroot/dist...
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Sat Aug 27 05:39:22 CDT 2011
Author: irroot
Date: Sat Aug 27 05:39:18 2011
New Revision: 333494
URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=333494
Log:
Backport app_queue.c from ver 10
some trivial cleanups backport from ver 10
Modified:
team/irroot/distrotech-customers-1.8/apps/app_queue.c
team/irroot/distrotech-customers-1.8/channels/chan_sip.c
team/irroot/distrotech-customers-1.8/channels/sip/sdp_crypto.c
Modified: team/irroot/distrotech-customers-1.8/apps/app_queue.c
URL: http://svnview.digium.com/svn/asterisk/team/irroot/distrotech-customers-1.8/apps/app_queue.c?view=diff&rev=333494&r1=333493&r2=333494
==============================================================================
--- team/irroot/distrotech-customers-1.8/apps/app_queue.c (original)
+++ team/irroot/distrotech-customers-1.8/apps/app_queue.c Sat Aug 27 05:39:18 2011
@@ -1462,13 +1462,14 @@
"Queue: %s\r\n"
"Location: %s\r\n"
"MemberName: %s\r\n"
+ "StateInterface: %s\r\n"
"Membership: %s\r\n"
"Penalty: %d\r\n"
"CallsTaken: %d\r\n"
"LastCall: %d\r\n"
"Status: %d\r\n"
"Paused: %d\r\n",
- q->name, m->interface, m->membername, m->dynamic ? "dynamic" : m->realtime ? "realtime" : "static",
+ q->name, m->interface, m->membername, m->state_interface, m->dynamic ? "dynamic" : m->realtime ? "realtime" : "static",
m->penalty, m->calls, (int)m->lastcall, m->status, m->paused
);
@@ -1578,7 +1579,7 @@
return state;
}
-static int extension_state_cb(char *context, char *exten, enum ast_extension_states state, void *data)
+static int extension_state_cb(const char *context, const char *exten, enum ast_extension_states state, void *data)
{
struct ao2_iterator miter, qiter;
struct member *m;
@@ -2363,7 +2364,7 @@
mem_iter = ao2_iterator_init(q->members, 0);
while ((m = ao2_iterator_next(&mem_iter))) {
if (m->dead) {
- if (m->membername == NULL || !log_membername_as_agent) {
+ if (ast_strlen_zero(m->membername) || !log_membername_as_agent) {
ast_queue_log(q->name, "REALTIME", m->interface, "REMOVEMEMBER", "%s", "");
} else {
ast_queue_log(q->name, "REALTIME", m->membername, "REMOVEMEMBER", "%s", "");
@@ -2488,7 +2489,7 @@
mem_iter = ao2_iterator_init(q->members, 0);
while ((m = ao2_iterator_next(&mem_iter))) {
if (m->dead) {
- if (m->membername == NULL || !log_membername_as_agent) {
+ if (ast_strlen_zero(m->membername) || !log_membername_as_agent) {
ast_queue_log(q->name, "REALTIME", m->interface, "REMOVEMEMBER", "%s", "");
} else {
ast_queue_log(q->name, "REALTIME", m->membername, "REMOVEMEMBER", "%s", "");
@@ -5364,13 +5365,14 @@
"Queue: %s\r\n"
"Location: %s\r\n"
"MemberName: %s\r\n"
+ "StateInterface: %s\r\n"
"Membership: %s\r\n"
"Penalty: %d\r\n"
"CallsTaken: %d\r\n"
"LastCall: %d\r\n"
"Status: %d\r\n"
"Paused: %d\r\n",
- q->name, new_member->interface, new_member->membername,
+ q->name, new_member->interface, new_member->membername, state_interface,
"dynamic",
new_member->penalty, new_member->calls, (int) new_member->lastcall,
new_member->status, new_member->paused);
@@ -5759,7 +5761,7 @@
switch (remove_from_queue(args.queuename, args.interface)) {
case RES_OKAY:
- if (mem->membername == NULL || !log_membername_as_agent) {
+ if (!mem || ast_strlen_zero(mem->membername) || !log_membername_as_agent) {
ast_queue_log(args.queuename, chan->uniqueid, args.interface, "REMOVEMEMBER", "%s", "");
} else {
ast_queue_log(args.queuename, chan->uniqueid, mem->membername, "REMOVEMEMBER", "%s", "");
@@ -7212,7 +7214,11 @@
while ((mem = ao2_iterator_next(&mem_iter))) {
ast_str_set(&out, 0, " %s", mem->membername);
if (strcasecmp(mem->membername, mem->interface)) {
- ast_str_append(&out, 0, " (%s)", mem->interface);
+ ast_str_append(&out, 0, " (%s", mem->interface);
+ if (mem->state_interface) {
+ ast_str_append(&out, 0, " from %s", mem->state_interface);
+ }
+ ast_str_append(&out, 0, ")");
}
if (mem->penalty)
ast_str_append(&out, 0, " with penalty %d", mem->penalty);
@@ -7480,6 +7486,7 @@
"Queue: %s\r\n"
"Name: %s\r\n"
"Location: %s\r\n"
+ "StateInterface: %s\r\n"
"Membership: %s\r\n"
"Penalty: %d\r\n"
"CallsTaken: %d\r\n"
@@ -7488,7 +7495,7 @@
"Paused: %d\r\n"
"%s"
"\r\n",
- q->name, mem->membername, mem->interface, mem->dynamic ? "dynamic" : "static",
+ q->name, mem->membername, mem->interface, mem->state_interface, mem->dynamic ? "dynamic" : "static",
mem->penalty, mem->calls, (int)mem->lastcall, mem->status, mem->paused, idText);
}
ao2_ref(mem, -1);
@@ -7604,7 +7611,7 @@
switch (remove_from_queue(queuename, interface)) {
case RES_OKAY:
- if (mem->membername == NULL || !log_membername_as_agent) {
+ if (!mem || ast_strlen_zero(mem->membername) || !log_membername_as_agent) {
ast_queue_log(queuename, "MANAGER", interface, "REMOVEMEMBER", "%s", "");
} else {
ast_queue_log(queuename, "MANAGER", mem->membername, "REMOVEMEMBER", "%s", "");
@@ -7830,7 +7837,7 @@
switch (add_to_queue(queuename, interface, membername, penalty, 0, queue_persistent_members, state_interface)) {
case RES_OKAY:
- if (membername == NULL || !log_membername_as_agent) {
+ if (ast_strlen_zero(membername) || !log_membername_as_agent) {
ast_queue_log(queuename, "CLI", interface, "ADDMEMBER", "%s", "");
} else {
ast_queue_log(queuename, "CLI", membername, "ADDMEMBER", "%s", "");
@@ -7930,7 +7937,7 @@
switch (remove_from_queue(queuename, interface)) {
case RES_OKAY:
- if (mem->membername == NULL || !log_membername_as_agent) {
+ if (!mem || ast_strlen_zero(mem->membername) || !log_membername_as_agent) {
ast_queue_log(queuename, "CLI", interface, "REMOVEMEMBER", "%s", "");
} else {
ast_queue_log(queuename, "CLI", mem->membername, "REMOVEMEMBER", "%s", "");
@@ -8663,18 +8670,14 @@
*/
static struct member *find_member_by_queuename_and_interface(const char *queuename, const char *interface)
{
- struct member tmpmem, *mem = NULL;
+ struct member *mem = NULL;
struct call_queue *q;
- ast_copy_string(tmpmem.interface, interface, sizeof(tmpmem.interface));
- if ((q = load_realtime_queue(queuename)))
- {
+ if ((q = load_realtime_queue(queuename))) {
ao2_lock(q);
- if ((mem = ao2_find(q->members, &tmpmem, OBJ_POINTER))) {
- ao2_ref(mem, -1);
- queue_t_unref(q, "Expiring temporary reference.");
- }
+ mem = ao2_find(q->members, interface, OBJ_KEY);
ao2_unlock(q);
+ queue_t_unref(q, "Expiring temporary reference.");
}
return mem;
}
Modified: team/irroot/distrotech-customers-1.8/channels/chan_sip.c
URL: http://svnview.digium.com/svn/asterisk/team/irroot/distrotech-customers-1.8/channels/chan_sip.c?view=diff&rev=333494&r1=333493&r2=333494
==============================================================================
--- team/irroot/distrotech-customers-1.8/channels/chan_sip.c (original)
+++ team/irroot/distrotech-customers-1.8/channels/chan_sip.c Sat Aug 27 05:39:18 2011
@@ -28875,7 +28875,7 @@
return FALSE;
}
- if (sdp_crypto_process((*srtp)->crypto, a, rtp, (*srtp)) < 0) {
+ if (sdp_crypto_process((*srtp)->crypto, a, rtp, *srtp) < 0) {
return FALSE;
}
Modified: team/irroot/distrotech-customers-1.8/channels/sip/sdp_crypto.c
URL: http://svnview.digium.com/svn/asterisk/team/irroot/distrotech-customers-1.8/channels/sip/sdp_crypto.c?view=diff&rev=333494&r1=333493&r2=333494
==============================================================================
--- team/irroot/distrotech-customers-1.8/channels/sip/sdp_crypto.c (original)
+++ team/irroot/distrotech-customers-1.8/channels/sip/sdp_crypto.c Sat Aug 27 05:39:18 2011
@@ -286,7 +286,7 @@
return 0;
}
-int sdp_crypto_offer(struct sdp_crypto *p,int taglen)
+int sdp_crypto_offer(struct sdp_crypto *p, int taglen)
{
char crypto_buf[128];
More information about the asterisk-commits
mailing list