Answering a call using asterix (AMI / AGI or whatever)

I am using an asterisk to communicate with the PBX and want to answer an incoming call. BUT, I need:

  • Suppose we are 101 and call 102. We can see / monitor the incoming call without any problem.

  • On the receiver (102) side, the user sees an incoming call notification. I want the response to be triggered by the gui client, once the user has done some kind of button action on the gui (software), the response event should propagate to asterix / pbx, and THEN the system should be in response and conversation state. When I define some AGI script at 102 for incoming calls and define a response, the caller (101) is put into a conversation state, but we don't see any action on the phone receiver 102 (called party). Is there a way to include both parties in the conversation state when the receiving party is performing some action, script, etc. (Wait for receiver to perform any answer / pickup action)and then go to talk state? And the action must be initiated by some script (java based agi / ami script)

  • To summarize, I want to use hardware devices for the phone and the software runs in sync. The requirement can be met using TAPI / JTAPI / GJTAPI, but I want to see if this can be implemented using asterix, replacing TAPI. Currently, we can start a call from our Java client, send an action to the phone's hardware, and monitor the calls with gjtapi. And we can also see the incoming call on our java client, the user can respond with some gui button action, gjtapi sends a response to the string, and then the phone device goes into a conversation state.I want to control my phone using software, but I don't need a softphone. I want to control my phone and run makecall, respond to actions with software.

  • Is TAPI the only solution for this requirement and trying asterisk is the wrong way?

Example line extensions.conf

exten => 102,1, Agi (agi: //192.168.0.X/answer.agi)

fastagi.properties:

answer.agi = org.asteriskjava.examples.fastagi.ExampleCallIn

ExampleCallIn:

public class ExampleCallIn extends BaseAgiScript {
  public void service(AgiRequest request, AgiChannel channel) throws AgiException {
   answer();

      

I start a call from 101, by phone or software (dial), the service method is started and the answer is called, on phone 101 I can see that it enters the talk state due to the call being answered, but on 102 (phone device) nothing does not happen, it still rings (incoming call from 101).

+3


source to share


1 answer


To answer a call that does not go to other feet through AGI, you just need to do something like

  print "ANSWER\n"

      

in any language of your choice.

However, if you've already requested a call to another leg B, things get much more complicated. You need to work with the firmware of the destination phone, or you can

1) set up the answering machine of the destination phone or mark your call as an intercom call

https://www.voip-info.org/wiki/view/Asterisk+Paging+and+Intercom



at this moment when the call comes to the target device it will automatically answer and bridge

2) setting the privacy of the macro https://www.voip-info.org/wiki-Asterisk+cmd+Dial#Dialmacros

3) in a macro call an external script / database to validate the call.

This way, the technical support of the call will be RESPONSIBLE, but the A side will think that it is still calling until you confirm it, end the macro with the correct result.

However, this requires a higher level of programming and understanding of the asterisk.

+1


source







All Articles