593
593
/* Lock parking list */
594
594
AST_LIST_LOCK(&parkinglot->parkings);
595
595
/* Check for channel variable PARKINGEXTEN */
596
ast_channel_lock(chan);
596
597
parkingexten = pbx_builtin_getvar_helper(chan, "PARKINGEXTEN");
598
ast_channel_unlock(chan);
597
599
if (!ast_strlen_zero(parkingexten)) {
598
600
/*!\note The API forces us to specify a numeric parking slot, even
599
601
* though the architecture would tend to support non-numeric extensions
601
603
* limitation here. If extout was not numeric, we could permit
602
604
* arbitrary non-numeric extensions.
604
if (sscanf(parkingexten, "%d", &parking_space) != 1 || parking_space < 0) {
606
if (sscanf(parkingexten, "%30d", &parking_space) != 1 || parking_space < 0) {
605
607
AST_LIST_UNLOCK(&parkinglot->parkings);
606
608
parkinglot_unref(parkinglot);
2547
2549
is before the bridge's start time, so I added in the
2548
2550
tvcmp check to the if below */
2550
if (peer_cdr && !ast_tvzero(peer_cdr->answer) && ast_tvcmp(peer->cdr->answer, bridge_cdr->start) >= 0) {
2552
if (peer_cdr && !ast_tvzero(peer_cdr->answer) && ast_tvcmp(peer_cdr->answer, bridge_cdr->start) >= 0) {
2551
2553
bridge_cdr->answer = peer_cdr->answer;
2552
2554
bridge_cdr->disposition = peer_cdr->disposition;
2553
2555
if (chan_cdr) {
2907
2909
ast_channel_unlock(chan_ptr);
2909
2911
/* new channel */
2910
ast_cdr_specialized_reset(new_peer_cdr,0);
2913
ast_cdr_specialized_reset(new_peer_cdr, 0);
2912
2916
ast_cdr_specialized_reset(peer_cdr,0); /* nothing changed, reset the peer_cdr */
3271
3275
if (!ast_strlen_zero(app_args.timeout)) {
3272
if (sscanf(app_args.timeout, "%d", &args.timeout) != 1) {
3276
if (sscanf(app_args.timeout, "%30d", &args.timeout) != 1) {
3273
3277
ast_log(LOG_WARNING, "Invalid timeout '%s' provided\n", app_args.timeout);
3274
3278
args.timeout = 0;
3281
3285
args.return_ext = app_args.return_ext;
3283
3287
if (!ast_strlen_zero(app_args.return_pri)) {
3284
if (sscanf(app_args.return_pri, "%d", &args.return_pri) != 1) {
3288
if (sscanf(app_args.return_pri, "%30d", &args.return_pri) != 1) {
3285
3289
ast_log(LOG_WARNING, "Invalid priority '%s' specified\n", app_args.return_pri);
3286
3290
args.return_pri = 0;
3549
3554
if (!strcasecmp(confvar->name, "context")) {
3550
3555
ast_copy_string(parkinglot->parking_con, confvar->value, sizeof(parkinglot->parking_con));
3551
3556
} else if (!strcasecmp(confvar->name, "parkingtime")) {
3552
if ((sscanf(confvar->value, "%d", &parkinglot->parkingtime) != 1) || (parkinglot->parkingtime < 1)) {
3557
if ((sscanf(confvar->value, "%30d", &parkinglot->parkingtime) != 1) || (parkinglot->parkingtime < 1)) {
3553
3558
ast_log(LOG_WARNING, "%s is not a valid parkingtime\n", confvar->value);
3554
3559
parkinglot->parkingtime = DEFAULT_PARK_TIME;
3556
3561
parkinglot->parkingtime = parkinglot->parkingtime * 1000;
3557
3562
} else if (!strcasecmp(confvar->name, "parkpos")) {
3558
if (sscanf(confvar->value, "%d-%d", &start, &end) != 2) {
3563
if (sscanf(confvar->value, "%30d-%30d", &start, &end) != 2) {
3559
3564
ast_log(LOG_WARNING, "Format for parking positions is a-b, where a and b are numbers at line %d of parking.conf\n", confvar->lineno);
3593
3598
/* Add a parking extension into the context */
3594
if (!oldparkinglot) {
3599
if (!error && !oldparkinglot) {
3595
3600
if (!ast_strlen_zero(ast_parking_ext())) {
3596
3601
if (ast_add_extension2(con, 1, ast_parking_ext(), 1, NULL, NULL, parkcall, strdup(""), ast_free_ptr, registrar) == -1)
3719
3724
} else if (!strcasecmp(var->name, "context")) {
3720
3725
ast_copy_string(default_parkinglot->parking_con, var->value, sizeof(default_parkinglot->parking_con));
3721
3726
} else if (!strcasecmp(var->name, "parkingtime")) {
3722
if ((sscanf(var->value, "%d", &default_parkinglot->parkingtime) != 1) || (default_parkinglot->parkingtime < 1)) {
3727
if ((sscanf(var->value, "%30d", &default_parkinglot->parkingtime) != 1) || (default_parkinglot->parkingtime < 1)) {
3723
3728
ast_log(LOG_WARNING, "%s is not a valid parkingtime\n", var->value);
3724
3729
default_parkinglot->parkingtime = DEFAULT_PARK_TIME;
3726
3731
default_parkinglot->parkingtime = default_parkinglot->parkingtime * 1000;
3727
3732
} else if (!strcasecmp(var->name, "parkpos")) {
3728
if (sscanf(var->value, "%d-%d", &start, &end) != 2) {
3733
if (sscanf(var->value, "%30d-%30d", &start, &end) != 2) {
3729
3734
ast_log(LOG_WARNING, "Format for parking positions is a-b, where a and b are numbers at line %d of features.conf\n", var->lineno);
3730
3735
} else if (default_parkinglot) {
3731
3736
default_parkinglot->parking_start = start;
3768
3773
} else if (!strcasecmp(var->name, "adsipark")) {
3769
3774
adsipark = ast_true(var->value);
3770
3775
} else if (!strcasecmp(var->name, "transferdigittimeout")) {
3771
if ((sscanf(var->value, "%d", &transferdigittimeout) != 1) || (transferdigittimeout < 1)) {
3776
if ((sscanf(var->value, "%30d", &transferdigittimeout) != 1) || (transferdigittimeout < 1)) {
3772
3777
ast_log(LOG_WARNING, "%s is not a valid transferdigittimeout\n", var->value);
3773
3778
transferdigittimeout = DEFAULT_TRANSFER_DIGIT_TIMEOUT;
3775
3780
transferdigittimeout = transferdigittimeout * 1000;
3776
3781
} else if (!strcasecmp(var->name, "featuredigittimeout")) {
3777
if ((sscanf(var->value, "%d", &featuredigittimeout) != 1) || (featuredigittimeout < 1)) {
3782
if ((sscanf(var->value, "%30d", &featuredigittimeout) != 1) || (featuredigittimeout < 1)) {
3778
3783
ast_log(LOG_WARNING, "%s is not a valid featuredigittimeout\n", var->value);
3779
3784
featuredigittimeout = DEFAULT_FEATURE_DIGIT_TIMEOUT;
3781
3786
} else if (!strcasecmp(var->name, "atxfernoanswertimeout")) {
3782
if ((sscanf(var->value, "%d", &atxfernoanswertimeout) != 1) || (atxfernoanswertimeout < 1)) {
3787
if ((sscanf(var->value, "%30d", &atxfernoanswertimeout) != 1) || (atxfernoanswertimeout < 1)) {
3783
3788
ast_log(LOG_WARNING, "%s is not a valid atxfernoanswertimeout\n", var->value);
3784
3789
atxfernoanswertimeout = DEFAULT_NOANSWER_TIMEOUT_ATTENDED_TRANSFER;
3786
3791
atxfernoanswertimeout = atxfernoanswertimeout * 1000;
3787
3792
} else if (!strcasecmp(var->name, "atxferloopdelay")) {
3788
if ((sscanf(var->value, "%u", &atxferloopdelay) != 1)) {
3793
if ((sscanf(var->value, "%30u", &atxferloopdelay) != 1)) {
3789
3794
ast_log(LOG_WARNING, "%s is not a valid atxferloopdelay\n", var->value);
3790
3795
atxferloopdelay = DEFAULT_ATXFER_LOOP_DELAY;
3793
3798
} else if (!strcasecmp(var->name, "atxferdropcall")) {
3794
3799
atxferdropcall = ast_true(var->value);
3795
3800
} else if (!strcasecmp(var->name, "atxfercallbackretries")) {
3796
if ((sscanf(var->value, "%u", &atxferloopdelay) != 1)) {
3801
if ((sscanf(var->value, "%30u", &atxferloopdelay) != 1)) {
3797
3802
ast_log(LOG_WARNING, "%s is not a valid atxfercallbackretries\n", var->value);
3798
3803
atxfercallbackretries = DEFAULT_ATXFER_CALLBACK_RETRIES;
4406
4411
if (!ast_strlen_zero(timeout)) {
4407
sscanf(timeout, "%d", &to);
4412
sscanf(timeout, "%30d", &to);
4410
4415
res = ast_masq_park_call(ch1, ch2, to, &parkExt);