Api c++ forward call to phone device

hi, i have an application which when a user clicks a tel number, a softphone opens and call the number.
now I have setup up freepbx and bought few grandstream phone devices.
I would like when a user clicks the number instead of softone , to be redirected to freebpx and then to certain phone device. I saw that an api for asterix exists but there is no much information.
thank you.

You’re looking for FreePBX to do ‘originate call’ for you.

Also, you need to have FreePBX treat 2 (or more) separate devices as users of same extension.

I have this configured as follows (on FreePBX 12.0.65 with asterisk 11.14.2):

  • I use chan_sip for extensions (on pjsip I recall i was told, the below step would not be necessary)

  • use the ‘Devices and Extensions’ mode : first, configure ‘sip accounts’ unique for each and every device (e.g. I have sip/21, /1021, /5021, /9021 for the desk phone, soft phone, mobile phone app and WebRTC respectively); then define your extension numbers, (in above example, 21 is the number that can be dialled, which will ring on all 3 of above devices)

  • (to get the WebRTC going, you need to define appropriate UCP user for the above extension, with WEBRTC enabled;)

  • when logging on to UCP on the UCP users’ credentials, the WebRTC phone has got the ‘originate call’ option, where, if you selected more than 1 extension to be available for that UCP user, you will be given a choice, which extension to ring upon originating the call; in my above example, I have an Office21 user, that is configured to use extension 21, 26 and 30, and these are presented as a drop-down in the ‘originate call’ dialog window. If operator has his devices (deskphone, softphone, mobile app and webrtc) active, he has a choice which device they want to pick the call up on (migrating the call between devices though, involves always the parking lot)

  • there are ‘desktop’ applications you can use to originate call : one of them is siptapi, which is a plugin for Windows TAPI subsystem, that can be used by the windows’ dialer; I have not yet found a ‘standalone’ Linux ‘desktop’ application that can do ‘call originate’, which is why on Linux workstations I use WebRTC (and the operators unanimously voted for WebRTC having compared it with the TAPI/Dialer way)

Hope this helps.