Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
jami-daemon
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
savoirfairelinux
jami-daemon
Commits
763a7277
Commit
763a7277
authored
15 years ago
by
Emmanuel Milou
Browse files
Options
Downloads
Patches
Plain Diff
[#2404] Update call-to script - Maxime Chambreuil
parent
1f8e5fdb
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tools/sflphone-callto
+19
-17
19 additions, 17 deletions
tools/sflphone-callto
with
19 additions
and
17 deletions
tools/sflphone-callto
+
19
−
17
View file @
763a7277
#!/bin/sh
#
# This script can be used as a callto: (or other) protocol handler in
# Mozilla
/
Firefox
/whatever
browser.
# Mozilla
Firefox
-based
browser.
# In Firefox use Preferences > Applications and set the callto handler
# to this script.
# Configuration:
# All you have to do is set this to your account alias name
# (see ~/.sflphone/sflphonedrc file)
ACCOUNT_ALIAS
=
"manu"
################################################################################
# The sflphone daemon config file
RESFILE
=
~/.sflphone/sflphonedrc
RESFILE
=
~/.
config/
sflphone/sflphonedrc
# Parse sflphonedrc and get account id string
from defined alias
# Parse sflphonedrc and get
default
account id string
if
[
-f
"
$RESFILE
"
]
;
then
ACCOUNTID
=
`
grep
-B2
"Account.alias=
$ACCOUNT_ALIAS
"
"
$RESFILE
"
|
\
grep
"Account:[0-9]"
|
\
head
-n
1 |
\
sed
-e
's/[^a-zA-Z0-9:]//g'
`
# Use first ID
ACCOUNTID
=
`
grep
Accounts.order
$RESFILE
|
sed
-e
's/Accounts.order=//'
-e
's/\/.*//'
`
# Accounts.order is not set
if
[
-z
$ACCOUNTID
]
;
then
# Use first account declared in sflphone config
ACCOUNTID
=
"
`
grep
-m
1 Account:
$RESFILE
|
sed
-e
's/\[//'
-e
's/\]//'
`
"
fi
else
echo
Fatal: Cant find sflphonedrc config file.
exit
1
fi
# Check 1st argument (phone number)
if
[
"
$1
"
=
""
]
;
then
if
[
-z
$1
]
;
then
echo
"Error: argument 1 (phone number) not provided."
exit
1
fi
# Cleanup destination
removing callto: prefix
TO
=
"
`
echo
$1
|
sed
-e
's/
callto:
//'
`
"
# Cleanup destination
, keeping numbers only
TO
=
"
`
echo
$1
|
sed
-e
's/
[^0123456789]
//
g
'
`
"
# Generate call id.
CALLID
=
${
RANDOM
}
$$
...
...
@@ -47,4 +47,6 @@ dbus-send \
string:
"
$CALLID
"
\
string:
"
$TO
"
exit
0
# EOF
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment