James Lamanna
2010-Apr-26 14:21 UTC
[asterisk-users] [PATCH] Make Queue announcements more consistent (1.4.26.2)
Hi,
After playing around with queues a bunch on 1.4.26.2, I noticed a few things,
which the patch below addresses. It addresses:
- Callers in position 0 will hear periodic/position announcements at a
very different rate than all other callers.
-- Announcements while in position 0 could be delayed up to
"timeout+retry" seconds.
-- This patch reduces that possible delay to only "timeout"
seconds
- The say_position and periodic_announcement times are in elapsed time
that _includes_ the
time of the announcement.
-- This patch changes those times to be the time _between_ playing
of those announcements
Thanks.
-- James
--- asterisk-1.4.26.2/apps/app_queue.c 2009-08-10 13:14:34.000000000 -0700
+++ asterisk-1.4.26.2.new/apps/app_queue.c 2010-04-25 22:25:08.000000000 -0700
@@ -345,6 +345,7 @@
time_t last_periodic_announce_time; /*!< The last time we played a
periodic announcement */
int last_periodic_announce_sound; /*!< The last periodic
announcement we made */
time_t last_pos; /*!< Last time we told the user
their position */
+ time_t last_ring_time; /*!< Last time we tried to ring
the agents */
int opos; /*!< Where we started in the queue */
int handled; /*!< Whether our call was handled */
int pending; /*!< Non-zero if we are
attempting to call a member */
@@ -1653,6 +1654,7 @@
res = 0;
/* Set our last_pos indicators */
+ time(&now);
qe->last_pos = now;
qe->last_pos_said = qe->pos;
@@ -2131,6 +2133,8 @@
if (!res)
ast_moh_start(qe->chan, qe->moh, NULL);
+ /* Refresh now so that frequency is time _between_ recordings */
+ time(&now);
/* update last_periodic_announce_time */
qe->last_periodic_announce_time = now;
@@ -3292,7 +3296,8 @@
static int wait_a_bit(struct queue_ent *qe)
{
/* Don't need to hold the lock while we setup the outgoing calls */
- int retrywait = qe->parent->retry * 1000;
+ //int retrywait = qe->parent->retry * 1000;
+ int retrywait = RECHECK * 1000;
int res = ast_waitfordigit(qe->chan, retrywait);
if (res > 0 && !valid_exit(qe, res))
@@ -4003,6 +4008,7 @@
qe.max_penalty = max_penalty;
qe.last_pos_said = 0;
qe.last_pos = 0;
+ qe.last_ring_time = 0;
qe.last_periodic_announce_time = time(NULL);
qe.last_periodic_announce_sound = 0;
qe.valid_digits = 0;
@@ -4074,9 +4080,12 @@
break;
}
/* Try calling all queue members for 'timeout' seconds */
- res = try_calling(&qe, args.options, args.announceoverride,
args.url, &tries, &noption, args.agi);
- if (res)
- goto stop;
+ if ((time(NULL) - qe.last_ring_time) > qe.parent->retry) {
+ res = try_calling(&qe, args.options, args.announceoverride,
args.url, &tries, &noption, args.agi);
+ qe.last_ring_time = time(NULL);
+ if (res)
+ goto stop;
+ }
stat = get_member_status(qe.parent, qe.max_penalty);
@@ -4125,7 +4134,7 @@
/* If using dynamic realtime members, we should regenerate the
member list for this queue */
update_realtime_members(qe.parent);
- /* OK, we didn't get anybody; wait for 'retry' seconds; may get
a
digit to exit with */
+ /* OK, we didn't get anybody; poll our retry */
res = wait_a_bit(&qe);
if (res)
goto stop;
Matt Riddell
2010-Apr-26 23:13 UTC
[asterisk-users] [PATCH] Make Queue announcements more consistent (1.4.26.2)
On 27/04/10 2:21 AM, James Lamanna wrote:> Hi, > After playing around with queues a bunch on 1.4.26.2, I noticed a few things, > which the patch below addresses. It addresses: > - Callers in position 0 will hear periodic/position announcements at a > very different rate than all other callers. > -- Announcements while in position 0 could be delayed up to > "timeout+retry" seconds. > -- This patch reduces that possible delay to only "timeout" seconds > - The say_position and periodic_announcement times are in elapsed time > that _includes_ the > time of the announcement. > -- This patch changes those times to be the time _between_ playing > of those announcementsPlease post this to issues.asterisk.org. Unfortunately developers are unable to look at or add patches without knowing the license. When you create an account on issues.asterisk.org you can file a disclaimer for the code and then the patch can be added to the base Asterisk install (assuming it meets coding guidelines etc). -- Cheers, Matt Riddell Managing Director _______________________________________________ http://www.venturevoip.com/news.php (Daily Asterisk News) http://www.venturevoip.com/exchange.php (Full ITSP Solution) http://www.venturevoip.com/st.php (SmoothTorque Predictive Dialer)
Aditya Kumar
2010-Apr-26 23:32 UTC
[asterisk-users] Supporting addressing formats and unsolicited Notify
Hi All,
I am using Asterisk as my pbx talking to a main proxy server.
The main Proxy server is sending unsolicited Notify Messages to the clients
after a call is established.
Is there a setting that I can tell Astersik to forward any NTY received from
Proxy to be forwarded to the End users?
2) Also Can I have the translation from User at domain to User at domain. (
right Now I am having dail plan as numbers)
Now I want to support soft clients also whose User names are not numbers only
but also Alpha numeric character,
I am looking something like:
bob at asterisk.com to be mapped to bob at external.com what is the config
changes :-)
TIA.
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
http://lists.digium.com/pipermail/asterisk-users/attachments/20100426/3fa2aa3c/attachment.htm