How to redirect the current Asterisk call to AGI using Perl?

I have a PBX on an asterisk and I was able to successfully run the AGI script from the PBX's web control panel.

Because I'm calling AGI from Perl (not what I know yet) ... The asterisk commands look like this:

    print "SET CALLERID $newcid \"\"\n";

So far, I did not expect to need to search the database, etc. I just want to set the caller ID (which I can do already) - then forward the call to a specific number.

Can someone show me how to redirect the current call using the AGI / perl style to execute the asterisk commands shown above?

FYI: I saw several examples using the format, for example:

    Exten => blah blah....

But I'm not sure how to convert this to AGI / perl format.

+3
1
print "EXEC DIAL \"Zap/1/5551234567\"\n";

, Asterisk::AGI,

$AGI->exec("DIAL", "Zap/1/5551234567");
+4

Source: https://habr.com/ru/post/1730252/


All Articles