Asterisk AGI - Originate a call using php agi
Asked Answered
N

1

5

Is anybody knows , how we can Originate an external number call using PHP AGI script ?

Natalia answered 30/12, 2012 at 9:29 Comment(0)
L
7

You have got two possible options. One is use the "Originate" command. See http://www.voip-info.org/wiki/view/Asterisk+manager+Example:+Originate for an example.

The other one, which is what I favor in my solutions, since it does not require AMI, is using spooled call files. See https://wiki.asterisk.org/wiki/display/AST/Asterisk+Call+Files for how to do them. The trick, and I cannot stress it enough, is to create the spool file in /tmp and then "move" the file into the ../spool/asterisk/outgoing directory.

If you assign a unique channel variable key/value to the spooled call, you can then pick it up with your dial plan and route the call appropriately.

Lutherlutheran answered 31/12, 2012 at 16:46 Comment(2)
asterisk -rx "channel originate SIP/<number>@test extension <extension>@<channel>"')Natalia
Even works with local channels: channel originate local/exten1@context extension exten2@contextLasandralasater

© 2022 - 2024 — McMap. All rights reserved.