peter59
November 23, 2015, 2:01pm
1
Hello everyone,
I am actually looking for an Asterisk API in order to allows a client program to connect to an Asterisk instance and issue commands or read events.
I have found Asterisk Java and I want to know, what are its features?
For example, can it send actions to Asterisk like agent login/logoff, presence state?
And can it read events like agent presence state, registered peers?
Best regards,
Thank you in advance.
Asterisk-java doesn’t seem to have support beyond 1.6 from what I can see.
What you’re probably looking for is and AMI or REST API. Google them, and you should find plenty of info.
Here’s a manual way to use AMI. Press Enter twice to run the Action once all of the info has been entered.
manager.conf
[general]
enabled = yes
webenabled = no
port = 5038
bindaddr = 0.0.0.0
[asterisk]
secret=asterisk
write=all
mark@mark ~ $ telnet localhost 5038
Trying 127.0.0.1…
Connected to localhost.
Escape character is ‘^]’.
Asterisk Call Manager/2.8.0
Action: Login
Username: asterisk
Secret: asterisk
Response: Success
Message: Authentication accepted
Action: Command
Command: core show hints
Response: Follows
Privilege: Command
-= Registered Asterisk Dial Plan Hints =-
_10XXX@hints : Custom:${EXTEN}@hint State:Unavailable Presence: Watchers 0
_ZXXXX@hints : SIP/${EXTEN} State:Unavailable Presence: Watchers 0
12966@hints : SIP/12966 State:Idle Presence:not_set Watchers 1
3 hints registered
–END COMMAND–
Action: Logoff
Response: Goodbye
Message: Thanks for all the fish.
Connection closed by foreign host.
peter59
November 24, 2015, 3:32pm
3
Thank you for your answer
If I understand what are you telling me, I can install and use the AMI directly on the server?