Asterisk ARI or AMI

Hi everyone!

I am writing a client application to work with an asterisk. Operator shall record the personal information and phone number. Can you please tell how to get phone number when someone calls. I have been programming in Delphi (freepascal) and there are no bindings for ARI and, so I use get and post through http for JSON response.

for example:
S:= Get(‘http://some_login:some_password@some_ip:8088/ari/channels/some_ch’);

Please, show me a simple example (ARI), how to get the phone number and redirect the call to another operator.

Thanks in advance!
Regards, Sergey

Start by learning Asterisk+Standard+Channel+Variables , If you want to get the caller number use ${CALLERID(num)} variable, I also suggest you use AMI or AGI for this type of development

Anyway you can check this links for more information

Thanks for the help, I appreciate it!
Now I train in asterisk Swagger and try to redirect channel to another number and get an answer:
“message”: “Channel not in Stasis application”

On the Internet, information about this quite fragmented. Help please understand.

Thanks in advance!

ARI does not allow you to arbitrarily do things to channels unless they are under its control. This is the opposite of AMI which allows you to redirect anything. What exactly are you trying to accomplish? AMI may be the better option.

I’m not sure what information you’re referring to, but the documentation on the wiki should be correct:

You can read about the differences between ARI and AMI here:

And this section here describes @jcolp’s point about handing channels over to ARI via the Stasis dialplan application:

Now I try to connect to the asterisk via telnet and get an answer:
Connected to
Escape character is ‘^]’.
Asterisk Call Manager/2.8.0

How to enter now my login and password?

Thanks in advance!

CLI> manager show command login