• V20: 3CX Re-engineered. Get V20 for increased security, better call management, a new admin console and Windows softphone. Learn More.

Communicate between CFDs

Status
Not open for further replies.

JoshuaAceInternet

Joined
Jan 5, 2018
Messages
7
Reaction score
0
I'm starting to try to make a solution which monitors currently placed calls, and will notify someone in charge if one of a specific set of numbers is dialed.
This person in charge will be notified by being called by the system and will use Amazon Polly to explain the situation to the person. "Extension 101, John Smith, has just dialed an emergency number".

I've been playing around with CFD figuring out how it's best to do this.

I currently think the best option to do this is two seperate CFDs.
- The first one as a Dialer as a sort of "background thread" that continually runs and checks if someone is placing a call to one of the designated numbers. When someone makes the call, it'll store the call details and use Make Call to connect the person in charge with the second CFD.
- The second CFD is the one that makes the actual notification call using a basic call flow of Person answers->Load message to say from first CFD->Use a Prompt to say message.

I'm aiming to try and do this without a database, and just have the two CFDs communicate to each other through code, the 3CX classes, or even a static class which both CFDs could see. Is this possible/how would I achieve this? Or am I doing it all wrong and there is a better way?

Thanks for any help! Happy to hear multiple solutions or clarify myself if I haven't been clear.
 
Hello @JoshuaAcelInternet,

If you have the Dialer and the Callflow in the same CFD app project, then all the app will be inside the same DLL. So, you can use a C# script with some static field, that can be read and written by both sides. That will work.

You can also use 3CX global properties or DN properties, using the standard components we provide:
https://www.3cx.com/docs/manual/cfd-components/#h.1qvnvylpx4nt

You can write a property from the dialer with the information you need, and then read it from the callflow later.

Kind regards.
 
If the goal is to monitor when people dial emergency numbers and send notifications, we have an add-on for this exact purpose. It supports multiple sites, notifications by group membership, notifications by phone, email, SMS, and desktop pop-up, logging, and much more. I encourage you to take a look at our add-on.
 
  • Like
Reactions: craigreilly
Ernesto, thanks for getting back to me. Those properties look like they're the way to go, I'll make a start with those and see how it goes. Thanks heaps for the help!

Cheers Matthew, we've seen your software spammed around the forum but we'd found it a bit too expensive. We're going to try our hand at writing something ourself first. Thanks anyway, we'll keep you in mind for the future.
 
@Ernesto

Would the following be the most reliable way to get if a particular call is occurring?

Will ActiveConnection's ExternalParty ever contain a name or some other strange formatting except exactly the phone number dialed? "John Smith - 102" or something?

Regards,
Joshua

ernesto.PNG
 
ExternalParty should have only the number, so if should work as you need.
 
That's great. Thank you.

I've used your suggestion of the Dialer and the Callflow in the same CFD app project, it's a much simpler setup than what I was doing, so thank you for mentioning of it.

I'm currently coming up against 2 issues at the moment that I'm unsure how to resolve.

Firstly, I've made a User Defined Component called NotifyByCall and I'm using that from the Dialer to place the calls out. The MakeCall component in NotifyByCall asks for "origin" and "destination" for the call. I'm giving it the destination of the extension I'd like it to call, and I'm setting the "origin" to session.dnis ("the extension number of the queue where this CFD app is deployed" - https://www.3cx.com/docs/manual/cfd-conditions-variables/#h.gerfdz7c0fxh), however when running the code it's throwing an exception. Is this expected behavior/how do I get the queue extension number for placing a call so I don't need to hardcode it in the CFD?
Also, I noticed in the OutboundDialerDemo the MakeCall component has destination and origin reversed. Am I doing it wrong?
dialer issue.PNG

Secondly, similar issue. on the Callflow side of the CFD which is invoked by that MakeCall, I'm trying to get the destination number I'm supposed to be calling so I can lookup what message to say to them. I'm using session.did for this, however it comes back blank. How do I get the number my Callflow is supposed to be calling?
callflow.PNG

Thank you in advance for any help, it's much appreciated! If I haven't been clear and you'd like me to send through my CFD file, let me know.

Regards,
 
Hello @JoshuaAceInternet,

Firstly, I've made a User Defined Component called NotifyByCall and I'm using that from the Dialer to place the calls out. The MakeCall component in NotifyByCall asks for "origin" and "destination" for the call. I'm giving it the destination of the extension I'd like it to call, and I'm setting the "origin" to session.dnis ("the extension number of the queue where this CFD app is deployed" - https://www.3cx.com/docs/manual/cfd-conditions-variables/#h.gerfdz7c0fxh), however when running the code it's throwing an exception. Is this expected behavior/how do I get the queue extension number for placing a call so I don't need to hardcode it in the CFD?
Also, I noticed in the OutboundDialerDemo the MakeCall component has destination and origin reversed. Am I doing it wrong?
The dialer doesn't have access to variables related to a call. The variable session.dnis is not available because there is no active call in this case... That variable will be available for the callflow, but not for the dialer. In this case I think you will need to hardcode the value of the extension, or take it from a 3CX parameter that you can set from the console for example, but not from a session variable.

Also, it is recommended that you reverse the order of origin and destination in the MakeCall component. This is because if you call the queue first, the CFD callflow will start playing the audio as soon as it receives the call, and the other party might not be connected yet, so the first part of the audio might be lost... The person that receives the call might hear a truncated message...

Secondly, similar issue. on the Callflow side of the CFD which is invoked by that MakeCall, I'm trying to get the destination number I'm supposed to be calling so I can lookup what message to say to them. I'm using session.did for this, however it comes back blank. How do I get the number my Callflow is supposed to be calling?
You can solve this by reversing the order in the MakeCall component as well. In this case, the call will be made to the destination you need to notify first, and once connected, it will be connected to the CFD callflow. In this case, the CFD callflow will see this as an inbound call, and the variable session.ani will contain the number you need.

Kind regards.
 
Edossantos,

Thank you again for getting back to me so quickly. I really appreciate your quick and clear support.

I think you will need to hardcode the value of the extension, or take it from a 3CX parameter

Ahh, alright then. I'll update the documentation I'm writing alongside the CFD project so that it's known.

it is recommended that you reverse the order of origin and destination in the MakeCall component
I've done this as recommended, however now the caller ID shown to the user when they get a call is shown as "MakeCall". It had previously been "ImportantCallNotifier", the name of the queue. Is it possible/how would I change that caller ID shown when the MakeCall values are reversed? Otherwise, is there a way to use the values the un-reversed way, and simply detect/wait for when the destination has answered?

Regards,
 
MakeCall is the caller name you will see if you reverse the order. That's how the MakeCall feature works and can't be changed...

If you reverse the order back, you will not be able to see the other party extension in a simple way. The session.ani variable is filled when the call starts, and is not refreshed later, so you will not get it from there. What you can do is, using a C# script, detect the ActiveConnection for the current call and check the properties from that object.

Kind regards.
 
Status
Not open for further replies.
Get 3CX - Absolutely Free!

Link up your team and customers Phone System Live Chat Video Conferencing

Hosted or Self-managed. Up to 10 users free forever. No credit card. Try risk free.

3CX
A 3CX Account with that email already exists. You will be redirected to the Customer Portal to sign in or reset your password if you've forgotten it.