Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
J
jami-daemon
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
147
Issues
147
List
Boards
Labels
Service Desk
Milestones
Iterations
Requirements
Requirements
List
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Incidents
Analytics
Analytics
Insights
Issue
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
savoirfairelinux
jami-daemon
Commits
e44b0a5f
Commit
e44b0a5f
authored
Jul 19, 2010
by
Alexandre Savard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[#2841] Add ringtone path and ringtone enabled to account
parent
e27080fc
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
61 additions
and
18 deletions
+61
-18
sflphone-common/src/account.cpp
sflphone-common/src/account.cpp
+2
-0
sflphone-common/src/account.h
sflphone-common/src/account.h
+23
-2
sflphone-common/src/managerimpl.cpp
sflphone-common/src/managerimpl.cpp
+24
-5
sflphone-common/src/preferences.cpp
sflphone-common/src/preferences.cpp
+10
-9
sflphone-common/src/preferences.h
sflphone-common/src/preferences.h
+1
-1
sflphone-common/src/user_cfg.h
sflphone-common/src/user_cfg.h
+1
-1
No files found.
sflphone-common/src/account.cpp
View file @
e44b0a5f
...
...
@@ -40,6 +40,8 @@ Account::Account (const AccountID& accountID, std::string type) :
,
_type
(
type
)
,
_codecOrder
()
,
_codecStr
(
""
)
,
_ringtonePath
(
"/usr/share/sflphone/ringtones/konga.ul"
)
,
_ringtoneEnabled
(
true
)
,
_displayName
(
""
)
,
_useragent
(
"SFLphone"
)
{
...
...
sflphone-common/src/account.h
View file @
e44b0a5f
...
...
@@ -259,9 +259,15 @@ class Account : public Serializable{
* Accessor to data structures
* @return CodecOrder& The list that reflects the user's choice
*/
inline
CodecOrder
&
getActiveCodecs
()
{
return
_codecOrder
;
}
inline
CodecOrder
&
getActiveCodecs
(
void
)
{
return
_codecOrder
;
}
void
setActiveCodecs
(
const
std
::
vector
<
std
::
string
>&
list
);
inline
std
::
string
getRingtonePath
(
void
)
{
return
_ringtonePath
;
}
inline
void
setRingtonePath
(
std
::
string
path
)
{
_ringtonePath
=
path
;
}
inline
bool
getRingtoneEnabled
(
void
)
{
return
_ringtoneEnabled
;
}
inline
void
setRingtoneEnabled
(
bool
enabl
)
{
_ringtoneEnabled
=
enabl
;
}
inline
std
::
string
getDisplayName
(
void
)
{
return
_displayName
;
}
inline
void
setDisplayName
(
std
::
string
name
)
{
_displayName
=
name
;
}
...
...
@@ -344,9 +350,24 @@ class Account : public Serializable{
*/
std
::
string
_codecStr
;
// Display Name that can be used in SIP URI.
/**
* Ringtone .au file used for this account
*/
std
::
string
_ringtonePath
;
/**
* Play ringtone when receiving a call
*/
bool
_ringtoneEnabled
;
/**
* Display name when calling
*/
std
::
string
_displayName
;
/**
* Useragent used for registration
*/
std
::
string
_useragent
;
};
...
...
sflphone-common/src/managerimpl.cpp
View file @
e44b0a5f
...
...
@@ -2361,8 +2361,17 @@ void ManagerImpl::ringtoneEnabled (void) {
}
std
::
string
ManagerImpl
::
getRingtoneChoice
(
void
)
{
// we need the absolute path
std
::
string
tone_name
=
audioPreference
.
getRingchoice
();
// retreive specified account id
Account
*
account
=
getAccount
(
IP2IP_PROFILE
);
if
(
!
account
)
{
_warn
(
"Manager: Warning: Not a valid account ID for ringone choice"
);
return
std
::
string
(
""
);
}
// we need the absolute path
std
::
string
tone_name
=
account
->
getRingtonePath
();
std
::
string
tone_path
;
if
(
tone_name
.
find
(
DIR_SEPARATOR_CH
)
==
std
::
string
::
npos
)
{
...
...
@@ -2374,14 +2383,23 @@ std::string ManagerImpl::getRingtoneChoice (void) {
tone_path
=
tone_name
;
}
_debug
(
"%s"
,
tone_path
.
c_str
());
_debug
(
"
Manager: get ringtone path
%s"
,
tone_path
.
c_str
());
return
tone_path
;
}
void
ManagerImpl
::
setRingtoneChoice
(
const
std
::
string
&
tone
)
{
// retreive specified account id
Account
*
account
=
getAccount
(
IP2IP_PROFILE
);
if
(
!
account
)
{
_warn
(
"Manager: Warning: Not a valid account ID for ringtone choice"
);
return
;
}
// we save the absolute path
a
udioPreference
.
setRingchoice
(
tone
);
a
ccount
->
setRingtonePath
(
tone
);
}
std
::
string
ManagerImpl
::
getRecordPath
(
void
)
{
...
...
@@ -2389,7 +2407,7 @@ std::string ManagerImpl::getRecordPath (void) {
}
void
ManagerImpl
::
setRecordPath
(
const
std
::
string
&
recPath
)
{
_debug
(
"Manager
Impl::setRecordPath(%s)!
"
,
recPath
.
c_str
());
_debug
(
"Manager
: Set record path %s
"
,
recPath
.
c_str
());
audioPreference
.
setRecordpath
(
recPath
);
}
...
...
@@ -3952,3 +3970,4 @@ std::vector<std::string> ManagerImpl::getParticipantList (
return
v
;
}
sflphone-common/src/preferences.cpp
View file @
e44b0a5f
...
...
@@ -31,13 +31,14 @@
#include "preferences.h"
#include <sstream>
#include "global.h"
#include "user_cfg.h"
Preferences
::
Preferences
()
:
_accountOrder
(
""
)
,
_audioApi
(
0
)
,
_historyLimit
(
30
)
,
_historyMaxCalls
(
20
)
,
_notifyMails
(
false
)
,
_zoneToneChoice
(
"North America"
)
// DFT_ZONE
,
_zoneToneChoice
(
DFT_ZONE
)
// DFT_ZONE
,
_registrationExpire
(
180
)
,
_ringtoneEnabled
(
true
)
// CONFIG_RINGTONE
,
_portNum
(
5060
)
...
...
@@ -131,10 +132,10 @@ void Preferences::unserialize(Conf::MappingNode *map)
VoipPreference
::
VoipPreference
()
:
_playDtmf
(
true
)
,
_playTones
(
true
)
,
_pulseLength
(
250
)
// DFT_PULSE_LENGTH_STR
,
_pulseLength
(
atoi
(
DFT_PULSE_LENGTH_STR
)
)
// DFT_PULSE_LENGTH_STR
,
_sendDtmfAs
(
0
)
,
_symmetricRtp
(
true
)
,
_zidFile
(
"zidFile"
)
// ZRTP_ZID_FILENAME
,
_zidFile
(
ZRTP_ZIDFILE
)
// ZRTP_ZID_FILENAME
{
}
...
...
@@ -314,10 +315,10 @@ void HookPreference::unserialize(Conf::MappingNode *map)
AudioPreference
::
AudioPreference
()
:
_cardin
(
0
)
// ALSA_DFT_CARD
,
_cardout
(
0
)
// ALSA_DFT_CARD
,
_cardring
(
0
)
// ALSA_DFT_CARD
,
_framesize
(
20
)
// DFT_FRAME_SIZE
AudioPreference
::
AudioPreference
()
:
_cardin
(
atoi
(
ALSA_DFT_CARD
)
)
// ALSA_DFT_CARD
,
_cardout
(
atoi
(
ALSA_DFT_CARD
)
)
// ALSA_DFT_CARD
,
_cardring
(
atoi
(
ALSA_DFT_CARD
)
)
// ALSA_DFT_CARD
,
_framesize
(
atoi
(
DFT_FRAME_SIZE
)
)
// DFT_FRAME_SIZE
,
_plugin
(
"default"
)
// PCM_DEFAULT
,
_smplrate
(
44100
)
// DFT_SAMPLE_RATE
,
_devicePlayback
(
""
)
...
...
@@ -325,8 +326,8 @@ AudioPreference::AudioPreference() : _cardin(0) // ALSA_DFT_CARD
,
_deviceRingtone
(
""
)
,
_recordpath
(
""
)
// DFT_RECORD_PATH
,
_ringchoice
(
"/usr/share/sflphone/ringtones/konga.ul"
)
//DFT_RINGTONE
,
_volumemic
(
100
)
// DFT_VOL_SPKR_STR
,
_volumespkr
(
100
)
// DFT_VOL_MICRO_STR
,
_volumemic
(
atoi
(
DFT_VOL_SPKR_STR
)
)
// DFT_VOL_SPKR_STR
,
_volumespkr
(
atoi
(
DFT_VOL_MICRO_STR
)
)
// DFT_VOL_MICRO_STR
{
}
...
...
sflphone-common/src/preferences.h
View file @
e44b0a5f
...
...
@@ -72,7 +72,7 @@ const Conf::Key sipEnabledKey("sipEnabled"); //: false
const
Conf
::
Key
urlCommandKey
(
"urlCommand"
);
//: x-www-browser
const
Conf
::
Key
urlSipFieldKey
(
"urlSipField"
);
//: X-sflphone-url
// audio preferences
const
Conf
::
Key
alsamapKey
(
"alsa"
);
const
Conf
::
Key
pulsemapKey
(
"pulse"
);
const
Conf
::
Key
cardinKey
(
"cardin"
);
// : 0
...
...
sflphone-common/src/user_cfg.h
View file @
e44b0a5f
...
...
@@ -84,7 +84,7 @@
#define IP2IP_PROFILE "IP2IP"
#define SIGNALISATION "VoIPLink"
/** Section Signalisation */
#define ZRTP_ZIDFILE "
ZRTP.zidFile"
/** The filename used for storing ZIDs */
#define ZRTP_ZIDFILE "
zidFile"
/** The filename used for storing ZIDs */
#define PLAY_DTMF "DTMF.playDtmf"
/** Whether or not should play dtmf */
#define PLAY_TONES "DTMF.playTones"
/** Whether or not should play tones */
#define PULSE_LENGTH "DTMF.pulseLength"
/** Length of the DTMF in millisecond */
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment