linphone-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Linphone-users] (Linux mint 18.3/flatpak) Linphone-desktop 4.1.1 -


From: Maciej Morycinski
Subject: Re: [Linphone-users] (Linux mint 18.3/flatpak) Linphone-desktop 4.1.1 - Calling a number/sip address from web page or command line
Date: Wed, 28 Oct 2020 10:35:40 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0

Sorry for mangled script. Let me try again.

#!/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
reply via email to

[Prev in Thread] Current Thread [Next in Thread]