mirror of
https://github.com/asterisk/asterisk.git
synced 2025-11-09 03:18:30 +00:00
Add option to park in the next slot (bug #4028)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@5512 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -14,6 +14,7 @@ context => parkedcalls ; Which context parked calls are in
|
|||||||
;xfersound = beep ; to indicate an attended transfer is complete
|
;xfersound = beep ; to indicate an attended transfer is complete
|
||||||
;xferfailsound = beeperr ; to indicate a failed transfer
|
;xferfailsound = beeperr ; to indicate a failed transfer
|
||||||
;adsipark = yes ; if you want ADSI parking announcements
|
;adsipark = yes ; if you want ADSI parking announcements
|
||||||
|
;findslot => next ; Continue to the 'next' parking space. Defaults to 'first' available
|
||||||
;pickupexten = *8 ; Configure the pickup extension. Default is *8
|
;pickupexten = *8 ; Configure the pickup extension. Default is *8
|
||||||
;featuredigittimeout = 500 ; Max time (ms) between digits for
|
;featuredigittimeout = 500 ; Max time (ms) between digits for
|
||||||
; feature activation. Default is 500
|
; feature activation. Default is 500
|
||||||
|
|||||||
@@ -70,6 +70,10 @@ static int parking_start = 701;
|
|||||||
/* Last available extension for parking */
|
/* Last available extension for parking */
|
||||||
static int parking_stop = 750;
|
static int parking_stop = 750;
|
||||||
|
|
||||||
|
static int parking_offset = 0;
|
||||||
|
|
||||||
|
static int parkfindnext = 0;
|
||||||
|
|
||||||
static int adsipark = 0;
|
static int adsipark = 0;
|
||||||
|
|
||||||
static int transferdigittimeout = DEFAULT_TRANSFER_DIGIT_TIMEOUT;
|
static int transferdigittimeout = DEFAULT_TRANSFER_DIGIT_TIMEOUT;
|
||||||
@@ -240,14 +244,16 @@ int ast_park_call(struct ast_channel *chan, struct ast_channel *peer, int timeou
|
|||||||
/* We put the user in the parking list, then wake up the parking thread to be sure it looks
|
/* We put the user in the parking list, then wake up the parking thread to be sure it looks
|
||||||
after these channels too */
|
after these channels too */
|
||||||
struct parkeduser *pu, *cur;
|
struct parkeduser *pu, *cur;
|
||||||
int x;
|
int i,x,parking_range;
|
||||||
char exten[AST_MAX_EXTENSION];
|
char exten[AST_MAX_EXTENSION];
|
||||||
struct ast_context *con;
|
struct ast_context *con;
|
||||||
pu = malloc(sizeof(struct parkeduser));
|
pu = malloc(sizeof(struct parkeduser));
|
||||||
if (pu) {
|
if (pu) {
|
||||||
memset(pu,0,sizeof(struct parkeduser));
|
memset(pu,0,sizeof(struct parkeduser));
|
||||||
ast_mutex_lock(&parking_lock);
|
ast_mutex_lock(&parking_lock);
|
||||||
for (x=parking_start;x<=parking_stop;x++) {
|
parking_range=parking_stop-parking_start+1;
|
||||||
|
for (i=0;i<parking_range;i++) {
|
||||||
|
x=(i+parking_offset)%parking_range + parking_start;
|
||||||
cur = parkinglot;
|
cur = parkinglot;
|
||||||
while(cur) {
|
while(cur) {
|
||||||
if (cur->parkingnum == x)
|
if (cur->parkingnum == x)
|
||||||
@@ -257,7 +263,9 @@ int ast_park_call(struct ast_channel *chan, struct ast_channel *peer, int timeou
|
|||||||
if (!cur)
|
if (!cur)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (x <= parking_stop) {
|
|
||||||
|
if (i < parking_range) {
|
||||||
|
if (parkfindnext) parking_offset=x-parking_start+1;
|
||||||
chan->appl = "Parked Call";
|
chan->appl = "Parked Call";
|
||||||
chan->data = NULL;
|
chan->data = NULL;
|
||||||
|
|
||||||
@@ -1569,6 +1577,8 @@ static int load_config(void)
|
|||||||
parking_start = start;
|
parking_start = start;
|
||||||
parking_stop = end;
|
parking_stop = end;
|
||||||
}
|
}
|
||||||
|
} else if (!strcasecmp(var->name, "findslot")) {
|
||||||
|
parkfindnext = (!strcasecmp(var->value, "next"));
|
||||||
} else if (!strcasecmp(var->name, "adsipark")) {
|
} else if (!strcasecmp(var->name, "adsipark")) {
|
||||||
adsipark = ast_true(var->value);
|
adsipark = ast_true(var->value);
|
||||||
} else if (!strcasecmp(var->name, "transferdigittimeout")) {
|
} else if (!strcasecmp(var->name, "transferdigittimeout")) {
|
||||||
|
|||||||
Reference in New Issue
Block a user