Which is more appropriate for pbx events, TIdTCPServer or TIdTCPClient?
I am trying out some IP PBX systems, Asterisk, Freeswitch, and Yate,to register for events in the PBX, and I want to know which of these components is the better one.
The component is supposed to register with the PBX for events, receive them, send some responses and issues some commands. Which of the two would be the more appropriate?
The difference between a TCP server and client is who initiates the connection. The client connects to the server. So I'm guessing you should use the TIdTCPClient.
Asterisk has a well-defined network TCP/IP event-driven protocol which supports SSL communications. This module is called the Asterisk AMI, and is widely used to do exactly what you want.
You can read the documentation on the AMI here: http://www.voip-info.org/wiki/view/Asterisk+manager+API
Also, if you want to check out some products which use the AMI events as their core product, check out:
- Flash Operator Panel http://www.fop2.com/
- HUD http://www.fonality.com/products/hud
- Asterisk Assistant http://blogs.digium.com/2008/12/22/asterisk-desktop-assistant-windows-click-to-call-and-more/
Another option would be to use Synapse which is a blocking TCPIP library which is very easy to use and supports free pascal, as well as Delphi.