Help with call processing script

Status
Not open for further replies.

giox069c

Customer
Joined
Mar 31, 2022
Messages
26
Reaction score
3
I have just migrated from v18 to v20.
In v18 the user was able to dial an extension to open a door.
In 3CX v18 I was able to write a script IVR for that extension which just executes one simple linux command to open the door:
Code:
wget -O - https://user:[email protected]/ctrl?switch=1&action=trigger

Now, with v20, scripting has become hell.

1726151409320.png

What should I write there to make a simple http request as with wget ? Googling around I can only find few complex examples and very poor documentation.

As I can understand, I need to be able to write C# code. Ok, I can, but it's overkill for just doing a simple http GET.

I can find some examples, but no documentation. For example I can see in the examples that there are some interesting functions like MyCall.Trace() or MyCall.Debug(). But I cannot find a document which describes in depth these functions, including where that output is supposed to go (in a log file? where??)

Thank you for any help.
 
You can still upload a CFD app, which can do a GET request easily... no need to code C# if you don't know how.
 
Do you mean I should install CFD, develop a CFD app and then upload ? I never did it, but all the CFD installation process, design, compilation, upload seems to be far more complex than writing or pasting some C# code inside that textarea...
 
Depends on what you need to do. Does the script just need to trigger the GET request and then hang up?
 
If possible the script should also play the audio file which cah be uploaded on the call processing script configuration. That file which will say to the user something similar to "Command has been sent to the door".
But the http get request will be enough to open the door.
 
Then build it in CFD. You will just need 2 blocks, then build and import in 3CX.

Much easier and more chance of working. Using C# directly, you need to really know what you're doing, not just have some basic knowledge.
 
Much easier and more chance of working. Using C# directly, you need to really know what you're doing, not just have some basic knowledge.

Ok, as asked on the 1st post: where is the documentation for all the C# 3CX integration? Documentation for C# objects like MyCall ? Searching with Google only brings me to this article, but there is no documentation of MyCall object, just some "suggestions" on its use.
 
Check the call control API docs.
 
This is what you need if you will use C#:
https://www.3cx.com/blog/releases/v20-call-control-api/

But if you're not a programmer, doing this with the CFD is way much easier. You should be able to do it in 15 minutes, no coding required. Just add a Prompt Playback component, then an HTTP Request component, and you're ready to go.
 
  • Like
Reactions: Evolute IT
Ok, as asked on the 1st post: where is the documentation for all the C# 3CX integration? Documentation for C# objects like MyCall ? Searching with Google only brings me to this article, but there is no documentation of MyCall object, just some "suggestions" on its use.

It's really simple to do. @edossantos_sipcaller estimates it will take 15 minutes, considering you've never done it before.
In Ernesto's case, in the same 15 minutes,

he will have:
- Created your script,
- Done the laundry,
- Cleaned every room in the house,
- And prepared the next meal.

xD


However, if you still prefer to pay someone to do it for you, contact me privately, and we can handle it for you.
But to be honest, you don't need a C# specialist for this.
 
I think I'm a programmer, despite it's not my main job :)
I was able to write that script in C#, and it works. It does a GET or POST request, and then play an audio file.
Maybe in the future I will publish the final .cs script which does this HTTP request + audio play in a GitHub Gist or Gitlab Snippet.

The hardest part was to find and understand 3CX Call Control API documentation. API and examples are hidden in a .zip file, not indexed by google.
In no place someone explains where MyCall.Trace() MyCall.Debug() MyCall.Info() output goes. I wasted more than a hour only to find that these functions output is /var/lib/3cxpbx/Instance1/Data/Logs/3CXCallFlow.log, but only after you enable a higher log level on the web dashboard.
There are still some other features of the 3CX Call Control API that are still obscure to me and I cannot find info. But the job is done.

Thank you to all people which sent me to the Call Control API download site.

v20 is still a hell. Scripting is complex and poorly documented, unsupported VOIP gateway are causing me a waste of dozen of hours, and other problems.
 
Status
Not open for further replies.

Forum statistics

Threads
111,954
Messages
589,921
Members
164,851
Latest member
DrunkeMeister