Asterisk IP-PBX: API to set up and tear down a call between two extensions

776 views Asked by At

I have a working system that controls a Cisco CUCM IP-PBX to set up and tear down a call between two parties A and B; it makes use of Java's JTAPI to:

  1. make A call B
  2. make B answer (pick up)
  3. (wait for a few seconds)
  4. make either A or B drop the call

Now I want to do the same with an Asterisk PBX (version 13.17.0). From what I have gathered, Asterisks JTAPI implementation doesn't work for recent Asterisks; the latest version that I can find, dates from 2006 and it seems to try and send AMI commands to which Asterisk replies something along the lines of "no such command" - I'm guessing the AMI syntax has changed over the years.

What I'm using now is a library called asterisk-java and more specifically, its AMI support. I'm sending an OriginateAction and the net effect is that:

  1. Asterisk calls A
  2. I have to pick up A's phone manually
  3. A calls B
  4. I have to pick up B's phone manually
  5. finally a call is established between A and B

So instead of a fully automated process like in the Cisco case, I have to do manual work and I can't seem to find an API to just set up a call between A and B and having it drop after a couple of seconds.

Questions: is the AMI the correct API for my use case or is there a better alternative? And what API calls do I have to make to establish and drop a call?

Thanks, Jan

1

There are 1 answers

0
Rowdy On

Does this answered question help with establishing a call without picking up:

Originate a call with Asterisk - without the originating extension ringing

To have a channel drop a call, using AMI, you can use 'BridgeKick' to boot a channel, or 'BridgeDestroy' to cause each channel to 'BridgeLeave': https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+ManagerAction_BridgeKick