Deadagi On 11 And 1.4

Home » Asterisk Users » Deadagi On 11 And 1.4
Asterisk Users 2 Comments

How can extensions.conf be changed to work with both Asterisk 11 and 1.4.X such that 1.4.X calls deadagi and 11 just calls agi as deadagi is no more.



2 thoughts on - Deadagi On 11 And 1.4

  • Put a GLOBAL in extensions.conf with the version and use GOTOIF to run AGI/DEADAGI dependent on it.

    —–Original Message—

  • When do you know what version of Asterisk is executing your dialplan?

    If you know at installation time, pass your dialplan through a preprocessor (even something as simple as sed -e ‘s/@DEADAGI@/deadagi/g’).

    If you truly don’t know until execution time (and I can’t imagine this is true), you could define a channel variable (‘DEADAGI’) to either ‘deadagi’
    or ‘agi’ once and then reference it in your dialplan as:

    exten = *,n, execif(1,${MY-AGI},null-agi,–null)

    At least you aren’t evaluating your version condition throughout your dialplan.

    Curiously (and unfortunately) (at least in 1.2), you can’t just define a variable and then execute it as:

    exten = *,n, ${MY-AGI}(null-agi,–null)

    I’d advise the full preprocessor approach. The additional functionality it provides will result in a easier to maintain system. I do it with all of my Asterisk ‘conf’ files.