~davewalker/ubuntu/maverick/asterisk/lp_705014

« back to all changes in this revision

Viewing changes to res/ael/pval.c

  • Committer: Bazaar Package Importer
  • Author(s): Jean-Michel Dault
  • Date: 2010-02-16 14:08:54 UTC
  • mfrom: (1.2.5 upstream) (8.3.4 sid)
  • Revision ID: james.westby@ubuntu.com-20100216140854-rb2godspb9lduazl
Tags: 1:1.6.2.2-1ubuntu1
* Merge from Debian: security update
  * Changes:
  - debian/control: Change Maintainer
  - debian/control: Removed Uploaders field.
  - debian/control: Removed Debian Vcs-Svn entry and replaced with
      ubuntu-voip Vcs-Bzr, to reflect divergence in packages.
  - debian/asterisk.init : chown /dev/dahdi
  - debian/backports/hardy : add file
  - debian/backports/asterisk.init.hardy : add file

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: 211580 $")
 
28
ASTERISK_FILE_VERSION(__FILE__, "$Revision: 222289 $")
29
29
 
30
30
#include <sys/types.h>
31
31
#include <stdlib.h>
3361
3361
                if (contains_switch(statement)) { /* only run contains_switch if you haven't checked before */
3362
3362
                        if (mother_exten) {
3363
3363
                                if (!mother_exten->has_switch) {
3364
 
                                        switch_set = new_prio();
3365
 
                                        switch_set->type = AEL_APPCALL;
3366
 
                                        if (!ast_compat_app_set) {
3367
 
                                                switch_set->app = strdup("MSet");
3368
 
                                        } else {
3369
 
                                                switch_set->app = strdup("Set");
 
3364
                                        for (first = 1; first >= 0; first--) {
 
3365
                                                switch_set = new_prio();
 
3366
                                                switch_set->type = AEL_APPCALL;
 
3367
                                                if (!ast_compat_app_set) {
 
3368
                                                        switch_set->app = strdup("MSet");
 
3369
                                                } else {
 
3370
                                                        switch_set->app = strdup("Set");
 
3371
                                                }
 
3372
                                                /* Are we likely inside a gosub subroutine? */
 
3373
                                                if (!strcmp(mother_exten->name, "s") && first) {
 
3374
                                                        /* If we're not actually within a gosub, this will fail, but the
 
3375
                                                         * second time through, it will get set.  If we are within gosub,
 
3376
                                                         * the second time through is redundant, but acceptable. */
 
3377
                                                        switch_set->appargs = strdup("LOCAL(~~EXTEN~~)=${EXTEN}");
 
3378
                                                } else {
 
3379
                                                        switch_set->appargs = strdup("~~EXTEN~~=${EXTEN}");
 
3380
                                                        first = 0;
 
3381
                                                }
 
3382
                                                linkprio(exten, switch_set, mother_exten);
 
3383
                                                mother_exten->has_switch = 1;
 
3384
                                                mother_exten->checked_switch = 1;
 
3385
                                                if (exten) {
 
3386
                                                        exten->has_switch = 1;
 
3387
                                                        exten->checked_switch = 1;
 
3388
                                                }
3370
3389
                                        }
3371
 
                                        switch_set->appargs = strdup("~~EXTEN~~=${EXTEN}");
3372
 
                                        linkprio(exten, switch_set, mother_exten);
3373
 
                                        mother_exten->has_switch = 1;
3374
 
                                        mother_exten->checked_switch = 1;
3375
 
                                        if (exten) {
 
3390
                                }
 
3391
                        } else if (exten) {
 
3392
                                if (!exten->has_switch) {
 
3393
                                        for (first = 1; first >= 0; first--) {
 
3394
                                                switch_set = new_prio();
 
3395
                                                switch_set->type = AEL_APPCALL;
 
3396
                                                if (!ast_compat_app_set) {
 
3397
                                                        switch_set->app = strdup("MSet");
 
3398
                                                } else {
 
3399
                                                        switch_set->app = strdup("Set");
 
3400
                                                }
 
3401
                                                /* Are we likely inside a gosub subroutine? */
 
3402
                                                if (!strcmp(exten->name, "s")) {
 
3403
                                                        /* If we're not actually within a gosub, this will fail, but the
 
3404
                                                         * second time through, it will get set.  If we are within gosub,
 
3405
                                                         * the second time through is redundant, but acceptable. */
 
3406
                                                        switch_set->appargs = strdup("LOCAL(~~EXTEN~~)=${EXTEN}");
 
3407
                                                } else {
 
3408
                                                        switch_set->appargs = strdup("~~EXTEN~~=${EXTEN}");
 
3409
                                                        first = 0;
 
3410
                                                }
 
3411
                                                linkprio(exten, switch_set, mother_exten);
3376
3412
                                                exten->has_switch = 1;
3377
3413
                                                exten->checked_switch = 1;
3378
 
                                        }
3379
 
                                }
3380
 
                        } else if (exten) {
3381
 
                                if (!exten->has_switch) {
3382
 
                                        switch_set = new_prio();
3383
 
                                        switch_set->type = AEL_APPCALL;
3384
 
                                        if (!ast_compat_app_set) {
3385
 
                                                switch_set->app = strdup("MSet");
3386
 
                                        } else {
3387
 
                                                switch_set->app = strdup("Set");
3388
 
                                        }
3389
 
                                        switch_set->appargs = strdup("~~EXTEN~~=${EXTEN}");
3390
 
                                        linkprio(exten, switch_set, mother_exten);
3391
 
                                        exten->has_switch = 1;
3392
 
                                        exten->checked_switch = 1;
3393
 
                                        if (mother_exten) {
3394
 
                                                mother_exten->has_switch = 1;
3395
 
                                                mother_exten->checked_switch = 1;
 
3414
                                                if (mother_exten) {
 
3415
                                                        mother_exten->has_switch = 1;
 
3416
                                                        mother_exten->checked_switch = 1;
 
3417
                                                }
3396
3418
                                        }
3397
3419
                                }
3398
3420
                        }