[asterisk-users] Running AGI script if condition met?

Philipp Kempgen philipp.kempgen at amooma.de
Wed Dec 5 22:11:24 CST 2007


Vincent wrote:

> exten => 777,n,ExecIf($[${LEN(${CALLERIDNUM})} =
> 10],AGI(/root/dummy.php),${CALLERIDNUM})

The line break is not a good idea.

> It doesn't look like ExecIf() is the right way to have Asterisk run an
> AGI script conditionnally. What would be the right way to do this?

Wrong syntax.
ExecIf(<expr>|<app>|<data>)
So:
ExecIf($[${LEN(${CALLERIDNUM})} = 10],AGI,/root/dummy.php)

Not sure about more than one argument. Maybe
ExecIf($[${LEN(${CALLERIDNUM})} = 10],AGI,/root/dummy.php,${CALLERIDNUM})
or
ExecIf($[${LEN(${CALLERIDNUM})} = 10],AGI,/root/dummy.php|${CALLERIDNUM})

Asterisk's syntax is strange sometimes ...

Regards,
  Philipp Kempgen

-- 
amooma GmbH - Bachstr. 126 - 56566 Neuwied - http://www.amooma.de
    Let's use IT to solve problems and not to create new ones.
          Asterisk? -> http://www.das-asterisk-buch.de

Geschäftsführer: Stefan Wintermeyer
Handelsregister: Neuwied B 14998



More information about the asterisk-users mailing list