~damg/ubuntu/quantal/asterisk/LP1097687

« back to all changes in this revision

Viewing changes to main/features.c

  • Committer: Bazaar Package Importer
  • Author(s): Dave Walker (Daviey)
  • Date: 2009-09-22 16:22:14 UTC
  • mfrom: (1.2.4 upstream)
  • Revision ID: james.westby@ubuntu.com-20090922162214-awce8id0lt9v51jb
Tags: 1:1.6.2.0~rc2-0ubuntu1

* New upstream version, upstream is now DFSG compliant.
  - ilibc has been removed upstream.
  - Music on Hold is now cc-by-sa.
  - binary firmware iaxy.bin has been removed upstream.
* debian/rules: Santitised UPSTREAM variable for compatiability
  with Ubuntu and other variants.
* debian/control: Removed Debian Vcs-Svn entry and replaced 
  with ubuntu-voip Vcs-Bzr, to reflect divergence in packages.
* patches/makefile_appdocs_dtd: Removed, merged upstream.
* patches/disable_moh: Previosly disabled, removed from pool.
* patches/ubuntu-banner: Ported debian-banner to display Ubuntu
  centric bug report information.
* Refresh quilt patches

Show diffs side-by-side

added added

removed removed

Lines of Context:
25
25
 
26
26
#include "asterisk.h"
27
27
 
28
 
ASTERISK_FILE_VERSION(__FILE__, "$Revision: 209234 $")
 
28
ASTERISK_FILE_VERSION(__FILE__, "$Revision: 218300 $")
29
29
 
30
30
#include "asterisk/_private.h"
31
31
 
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.
603
605
                 */
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);
607
609
            free(pu);
2547
2549
                   is before the bridge's start time, so I added in the 
2548
2550
                   tvcmp check to the if below */
2549
2551
 
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);
2908
2910
                        }
2909
2911
                        /* new channel */
2910
 
                        ast_cdr_specialized_reset(new_peer_cdr,0);
 
2912
                        if (new_peer_cdr) {
 
2913
                                ast_cdr_specialized_reset(new_peer_cdr, 0);
 
2914
                        }
2911
2915
                } else {
2912
2916
                        ast_cdr_specialized_reset(peer_cdr,0); /* nothing changed, reset the peer_cdr  */
2913
2917
                }
3269
3273
 
3270
3274
                if (parse) {
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;
3275
3279
                                }
3281
3285
                                args.return_ext = app_args.return_ext;
3282
3286
                        }
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;
3287
3291
                                }
3504
3508
                return NULL;
3505
3509
        
3506
3510
        ast_copy_string(newlot->name, name, sizeof(newlot->name));
 
3511
        AST_LIST_HEAD_INIT(&newlot->parkings);
3507
3512
 
3508
3513
        return newlot;
3509
3514
}
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;
3555
3560
                        } else
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);
3560
3565
                                error = 1;
3561
3566
                        } else {
3591
3596
        }
3592
3597
 
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)
3597
3602
                                error = 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;
3725
3730
                        } else
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;
3774
3779
                        } else
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;
3780
3785
                        }
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;
3785
3790
                        } else
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;
3791
3796
                        } else 
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;
3799
3804
                        }
4404
4409
        }
4405
4410
 
4406
4411
        if (!ast_strlen_zero(timeout)) {
4407
 
                sscanf(timeout, "%d", &to);
 
4412
                sscanf(timeout, "%30d", &to);
4408
4413
        }
4409
4414
 
4410
4415
        res = ast_masq_park_call(ch1, ch2, to, &parkExt);