4

I'm developing a contact center with Laravel framework, I'm using Asterisk 13 to manage call system.

Each operator is assigned an extension to use a SIP software (Zoiper) in order to answer customer calls.

What I want is a convenient API to interact with asterisk server, for example when the operator receive a customer call, the caller id being inserted in a text field.

I've been experimenting with PHPARI But it lacks proper documentation.

José Ricardo Pla
  • 1,043
  • 10
  • 16
Amin
  • 579
  • 7
  • 23

2 Answers2

1

ARI is very new inteface.

If you want more documentation, try with AMI event model.

arheops
  • 15,544
  • 1
  • 21
  • 27
1

I have worked with PAMI and it satisfied my needs.
The documentation is not great too and some events are not processed with this library thus you may have to make some changes but the overall structure is good.

If nothing meets your expectation you may want to create your own parser, after all AMI will return a well formed string and use can parse that string for your needs.

amine.ahd
  • 431
  • 3
  • 11
  • As you suggested, I started to use PAMI, it logs in to and logs out from AMI successfully, but I can not listen any event. – Amin Jun 09 '15 at 04:11
  • Have you registered for any events? and did you start the main loop? Also make sure that Asterisk is sending events, I remembers that you hade to specify them somewhere in the config file for AMI – amine.ahd Jun 16 '15 at 18:17
  • http://www.voip-info.org/wiki/view/Asterisk+manager+API you have to put permissions in the AMI config file (read for getting events and write for sending actions) – amine.ahd Jun 16 '15 at 18:19
  • Thanks for reply, yes I have registered for some events but the main loop seems to break the deal as it prevents the php page from loading. – Amin Jun 17 '15 at 04:15
  • 1
    I think in the documentation you have another option instead of a forever loop: using [register_tick_function] (http://us.php.net/register_tick_function) like this : register_tick_function(array($pamiClient, 'process')); – amine.ahd Jun 17 '15 at 08:49
  • Using that facility didn't help neither, I just need a working piece of code. – Amin Jun 17 '15 at 09:01