MacOS 3CX App - help needed launching external application with parameters

Status
Not open for further replies.

stubs

Bronze Partner
Advanced Certified
Joined
Mar 21, 2019
Messages
8
Reaction score
1
I'm trying to get VLC player to display the RTSP stream of a Fanvil i30 as soon as an inbound call is received to the 3CX app that's running on a MacOS device.
If I select the VLC application in the "Path to executable", and put the RTSP address in the "Parameters to send", the video stream is displayed correctly.
However, this video stream is opened with every call to the extension.

I wanted to use a script to exclude all inbound calls apart from the i30's extension, so instead of calling VLC application, I would call my own scripted app and pass the %CallerNumber% parameter to it for processing.

I find that if I use -n --args %CallerNumber% in the "Parameters to send" from 3CX, I can't pick up the caller number from within my script.
It seems that rather than sending it to args, it's just trying to open the application with that as the filename.


Has anyone got any info on this function?
 
Have you tried adding quotation marks for the %CallerNumber% variable, because that could contain spaces, and they would be considered different arguments for the receiving application.
 
  • Like
Reactions: stubs
Have you tried adding quotation marks for the %CallerNumber% variable, because that could contain spaces, and they would be considered different arguments for the receiving application.

Thanks, I think it's actually a limitation of the Apple Script I'm trying to create. 3CX won't launch the script if saved as a script file, but when save as an application (.app), the arguments won't pass correctly. Might have to see if I can use something else.

Anyone else had any joy with anything similar?
 
I've sorted it.... basically had to Automator instead of Script Editor;

Created a Shell script in automator (Utilities-->Run Shell Script)
Set Shell to "/bin/bash"
Set Pass input to "as arguments"


This is the script I used (extension number and rtsp stream removed);

Bash:
#!/bin/sh

if [ -z "$1" -o "$1" = **ext** ]
then
open /Applications/VLC.app --args "rtsp://192.168.1.1/**rest_of_rtsp_stream"
fi

Saved it as an application to the applications folder, and copied the 3CX icon to it for a unified look.

Settings in 3CX:
Path to Excecutable: /Applications/3CXIntercomView.app
Parameters to send: -n --args %CallerNumber%


It serves as a quick view for the Fanvil i30's camera feed if opened from the applications list without any inbound calls.

Then the 3CX application can launch, but only when incoming call is from that extension.
 
  • Like
Reactions: edossantos
Status
Not open for further replies.

Latest Posts

Forum statistics

Threads
112,324
Messages
591,897
Members
165,475
Latest member
lastshadow