tags:

views:

333

answers:

1

I have an asterisk-based PBX, and I have been able to successfully run an AGI script from the web control panel of the PBX.

Because I am calling AGI from Perl (neither of which I know, yet)...
asterisk commands look like this:

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

So far, I don't expect to need to do any database lookups, etc. I simply want to set the caller ID (which I can do already) - then forward the call to a particular number.

Can anyone show me how to forward the current call using the AGI/perl style of executing asterisk commands shown above?

FYI: I've seen some examples using a format like:

    Exten => blah blah....

But, I am not sure how to convert that to the AGI/perl format.

+4  A: 
print "EXEC DIAL \"Zap/1/5551234567\"\n";

or, if you are using Asterisk::AGI,

$AGI->exec("DIAL", "Zap/1/5551234567");
Quassnoi
I don't understand the part: "SIP/myusername@myaddres" in your answer. Can I put a telephone number there instead: 912035551212 - what would I put there for "technology" in place of SIP?
arrocharGeek
Oh, I think I have it - we have a T1/PRI - so I think the technology will be Zap.
arrocharGeek
Still working on this...Zap and ZAP are not recognized. When I query agi_type to obtain the channel type, I get: DAHDI - I tried that and go this error: [Jan 27 15:58:34] WARNING[24831]: app_dial.c:1518 dial_exec_full: Unable to create channel of type 'DAHDI' (cause 0 - Unknown) == Everyone is busy/congested at this time (1:0/0/1)
arrocharGeek
Zaptel has been renamed DAHDI, so with recent asterisk you will have DAHDI channels and not Zap channels. Ordinarily you would define a group of channels that could be used for out-dialing and then place a call e.g. Dial(DAHDI/g1/${EXTEN}) to use group 1.
hobbs