|
From: | Maciej Morycinski |
Subject: | [Linphone-users] (Linux mint 18.3/flatpak) Linphone-desktop 4.1.1 - Calling a number/sip address from web page or command line |
Date: | Tue, 27 Oct 2020 12:40:45 -0700 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 |
Mine is installed as Appimage on Linux Mint Ulyana, Desktop 4.2.3 - Qt5.12.5 and it works fantastically, including Firefox and Thunderbird/CardBook, which are set up to call a script as a shim between them and Linphone.
I use the following bash script, as I cannot figure out a way to make linphone work directly with sip: or tel: links.
The linphone --cli-help command is not very helpful, in that it does not show a working example of linphone <sip-address>?method=<method>([&<argument>=<base64-value>]*)
I tried linphone my-address@my-server.voip.ms?method=call and it does not work from terminal, while linphone "call my-address@my-server.voip.ms" works with no issues.
I have linphone installed in /usr/local/bin along with this script (its filename is linphone-tel.sh)
The script converts sip:, tel: and callto: uri links to a linphone "call sip-address ......" command. Fill free to copy and modify to your needs... or convert to .bat for windows. :-)
Cheers!
--------------------------------------------------------------------------------------------------------------------------------------------------------
#!/bin/bash # This script will use linphone to call any sip, tel or callto uri, # as long as web browser and/or address book is set up to use it. # Linphone by itself will not work, as it expect a call parameter # as detailed below: # linphone must run, then # linphone "call sip-address=sip:4443@vancouver1.voip.ms" # will call Voip.ms echo test # linphone "call sip-address=604-555-1212" # will call a (nonexistent) number in Vancouver area code # ================================================================ # Check that there is only one parameter if [ "$#" -ne 1 ]; then echo " " $# " parameters, must be one only" else # Input parameter must start with one of: sip:, tel:, or callto: p=$(expr $1 : "^\(sip:\|tel:\|callto:\)") if [ $p ]; then # Protocol with telephone number or sip address pt=$1 # Calculate the length of the protocol part lp=$(expr length $p) # Calculate the length of the telephone number including protocol lpt=$(expr length $pt) # Calculate length of sip address less protocol part lsa=$(expr $lpt - $lp) if [ $lsa -gt "0" ]; then # Calculate the position of first character of address less protocol fc=$(expr $lp + 1) sa=$(expr substr $pt $fc $lsa) echo "Calling" "$sa" notify-send "Calling" "$sa" --icon=dialog-information linphone "call sip-address=$sa" else echo "Phone number/sip address not provided" fi else echo "Usage: linphone-tel.sh protocol:destination" echo " where protocol is one of: sip, tel, or callto" echo " and destination is either a phone number, or a sip address" fi fi
Hi all.With earlier (3.6.1) version, I was able to pass the phone number/sip address as first parameter to linphone to initiate a call, so I have registered a custom protocol handler for 'sip:' links which executed the command 'linphone -c $1'.With version 4.1.1 I am unable to find a way to initiate a call on new/already running instance of Linphone.Tried looking for a way to send linohonecsh command or use the linphone-daemon instead but with no avail...Can anyone point me in the right direction? What I need, is to initiate a call from shell or by clicking a link on a web page.Thanks in advance!
Maciej Morycinski #204-5100 Capitol Dr Burnaby, BC, Canada, V5B 4S7
+1-778-820-0182 morciej@gmail.com
[Prev in Thread] | Current Thread | [Next in Thread] |