Hello!
I have a recent request for controlling a telephony center (PBX) via a new application I'm writing in B4J.
Does anyone have any experience with telephony APIs in B4J?
Are you going to be interfacing to an existing PBX like Asterisk or Freeswitch?
If so you need to look at the AMI (Asterisk) or ESL (Freeswitch) interfaces, both of which use sockets and are very well documented. These give you as much control as you want to have, from just reading events to generating calls and defining dial plans.
That's a shame - so much easier with Asterisk/Freeswitch
What kind of control do you need to build? Do you need to control it in the form of making calls/transferring/switchboard/etc., or just react to events or stats for display or analysis? I see it has some form of TCP port, but without knowing what you're trying to do I'm not sure if it helps.
That's a shame - so much easier with Asterisk/Freeswitch
What kind of control do you need to build? Do you need to control it in the form of making calls/transferring/switchboard/etc., or just react to events or stats for display or analysis? I see it has some form of TCP port, but without knowing what you're trying to do I'm not sure if it helps.
1. My user will answer the call with a keyboard key (e.g. F3).
2. My user needs to park (hold with an ID) the line.
3. A second user will unpark the line in order to finish the conversation.
4. The second user hangs up the line, or I receive the event that the line hanged up from customer.
Finally, I need:
1. Caller ID
2. Trunk ID
3. Answer Function
4. Park Function
5. Unpark Function
6. Hang Up Function
I've read quickly the link you sent me but I can't figure out which B4J component can help me to get the job done!
I've not done a GUI app yet in B4j, only server apps.
But a quick looks shows you need to include jNetwork in your project, then investigate sockets. As a starting point for more reading :
B4X:
dim mySocket as Socket
dim HostIP as string="192.168.0.1"
dim HostPort as int =5001
dim ConnectTimeout as int = 30000
mySocket.Initialize
mySocket.Connect(HostIP, HostPort, ConnectTimeout)
...
etc etc
...
EDIT - See here for a nonUI example on how to use sockets. Easily adapted, I'm sure.
Re-reading what you wrote, I'm guessing that you meant that you want to use the PC as a phone device. If that is correct then the above probably won't help. Sorry, I think I misunderstood.
Though, assuming what I've just written is correct, it sounds like you want to replace the phones with PC based phones. If that is correct, you are to all intents and purposes replacing the point of having the PBX anyway. Is it viable to move to something like Asterisk?
Yes, I want to use the computer as a phone device!
Unfortunately, the decision of which PBX will be used is not mine...
I'm just called to make my app work with the specific PBX. :-(
You would register the softphone as a voip phone on the PBX, then use your app to control the softphone. If that's an option then it might save you a few headaches as the softphone handles all the functionality for you, you just instruct it.
EDIT -
theres a Java library for it as well which could probably be included in B4J :