CFD Issues - session.ani

Sallamos

Forum User
Joined
Mar 22, 2025
Messages
15
Reaction score
1
Hello all, this is my first post here (yay).

I am setting up a CFD for our business and would love to mainly do two things - transfer a call and send an http request to twilio to send a message to the caller for after hours solution. Neither of those things were currently accomplished and i am losing my will to turn on my PC with the increasing DAYS I have been battling with this.

When it comes to transfer, the call just drops as soon as the request comes. I am assuming it is coming from the main reason, which is my session.ani is being fetched wrong.

How did I find that my session.ani is fetched wrong? Because I used a simple message.json invocation for my http request that goes through twilio. In the content body I have hardcoded both "To" and "From" and my message went through without issues. However If i did something like "To=$(session.ani)&From=+18888888888&Body=Hello+from+3CX" I got a log on twilio showing a completely different number. I am too many hours deep on trying to troubleshoot as to why the callerID became a completely different number. Any help would be greatly appreciated. Let me know if you need more details.

Edit: I have checked the SIP trunking and do not see any way that this would be thwarted. We are on the enterprise plan if it matters.
 
This will not work:
To=$(session.ani)&From=+18888888888&Body=Hello+from+3CX

You need to use CFD expressions to concatenate values. For example:
CONCATENATE("To=",session.ani,"&From=+18888888888&Body=Hello+from+3CX")
 
How can I input a string into the expression?
Just as an extra piece of info - this worked with a static number, it didn't when I switched to the variable in place of "To=" for session.ani
 
Thank you, that worked.
Would you be able to help me with my other issue, which is transferring calls not working? I assumed it was because my phone number was not passed properly - but since i managed to get the http request for SMS working properly - I tried even the "make a call" widget, using the variable that contains my number, to another one of our 3cx numbers but the call just never happens and the flow ends.
 
this is how it looks in my script
TransferComponent transferComponent18 = new TransferComponent("transferComponent18", callflow, myCall, logHeader);
transferComponent18.DestinationHandler = () => { return Convert.ToString(+18088888888); };
 
You're transferring the call to an external number. You need to check that you have outbound rules in place for this. Check the Activity Log from the dashboard to see why this is failing.
 
It is an internal number that I don't have extension for.
 
It is an internal number that I don't have extension for.
It's not an extension. When you dial it, 3CX needs to use your SIP Trunk to reach that number. You need an outbound rule.
 
Gotcha, thank you for that. I have ended up just generating extensions for all the connections and resting my case! And since I am already changing topics of this. I have found one last issue that I need your help with.
IT is regarding this comment https://www.3cx.com/community/threads/cfd-user-input-extension.128621/post-612326
I am at a point, where I would love to eliminate having to route through double menu (Currently, are business hours menu has static options and when user presses option 9, they get routed to an IVR where they can press extension to get connected.) I would love to have the static options, as well as the extension dialing in my flow. Is it more trouble than its worth ? Meaning I would need options 1-9 as per user input, and then all our extensions that are being updated whenever one is created or deleted. With an error fallback if user enters a wrong one.
 
Yes, you can do it with a single User Input component, and then analyze the response from the user from a C# script.
 
  • Like
Reactions: Alejandro_3CX
how would i implement the c# script? would it be another component that would lead into a condition table before transfer?
 
how would i implement the c# script? would it be another component that would lead into a condition table before transfer?
Yes, correct, you need to use the following component:
https://www.3cx.com/docs/manual/cfd-components/#h.tatp7bos28vo

Then this component will return a value, which could be for example the extension to which you should transfer. You can then decide what to do with this, use a conditional, or transfer the call directly to what's returned by this C# code.
 
  • Like
Reactions: Evolute IT
Great, thanks ! I will experiment
 
That worked ! thank you so much ! I am now wondering if i can parse the buffer into a menu component, or do i just have to create a bunch of conditionals that branch out to different options using user input ?
 
The Menu component will automatically add branches for each enabled option. But works with 1 digit options only. If you need to have dynamic options, or let the user enter more than 1 digit, then you must go with a User Input component, and then use a Conditional component to create all the branches you need.
 
Yeah that is what I thought. Thanks so much for all the help !
 

Members Online Now

Forum statistics

Threads
111,832
Messages
589,278
Members
164,662
Latest member
DejanMDS