Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
savoirfairelinux
jami-daemon
Commits
3e2a4f2c
Commit
3e2a4f2c
authored
Feb 18, 2009
by
Alexandre Savard
Browse files
Changed internal call id for peerNumber in filewave save name
parent
6271a039
Changes
6
Show whitespace changes
Inline
Side-by-side
src/call.cpp
View file @
3e2a4f2c
...
...
@@ -42,16 +42,16 @@ Call::Call(const CallID& id, Call::CallType type)
SOUND_FORMAT
soundFormat
=
INT16
;
recAudio
.
setRecordingOption
(
fileType
,
soundFormat
,
44100
,
Manager
::
instance
().
getConfigString
(
AUDIO
,
RECORD_PATH
),
id
);
_debug
(
"CALL::Constructor for this clss is called
\n
"
);
//
_debug("CALL::Constructor for this clss is called \n");
}
Call
::~
Call
()
{
_debug
(
"CALL::~Call(): Destructor for this clss is called
\n
"
);
//
_debug("CALL::~Call(): Destructor for this clss is called \n");
if
(
recAudio
.
isOpenFile
())
{
_debug
(
"CALL::~Call(): A recording file is open, close it
\n
"
);
//
_debug("CALL::~Call(): A recording file is open, close it \n");
recAudio
.
closeFile
();
}
}
...
...
@@ -146,6 +146,11 @@ Call::setRecording()
recAudio
.
setRecording
();
}
void
Call
::
initRecFileName
()
{
recAudio
.
initFileName
(
_peerNumber
);
}
void
Call
::
stopRecording
()
{
...
...
src/call.h
View file @
3e2a4f2c
...
...
@@ -237,6 +237,11 @@ class Call{
*/
bool
isRecording
();
/**
*
*/
void
initRecFileName
();
protected:
/** Protect every attribute that can be changed by two threads */
ost
::
Mutex
_callMutex
;
...
...
src/iaxvoiplink.cpp
View file @
3e2a4f2c
...
...
@@ -410,6 +410,7 @@ IAXVoIPLink::newOutgoingCall(const CallID& id, const std::string& toUrl)
if
(
call
)
{
call
->
setPeerNumber
(
toUrl
);
call
->
initRecFileName
();
if
(
iaxOutgoingInvite
(
call
)
)
{
call
->
setConnectionState
(
Call
::
Progressing
);
...
...
@@ -939,6 +940,9 @@ IAXVoIPLink::iaxHandlePrecallEvent(iax_event* event)
if
(
event
->
ies
.
calling_name
)
call
->
setPeerName
(
std
::
string
(
event
->
ies
.
calling_name
));
// if peerNumber exist append it to the name string
call
->
initRecFileName
();
if
(
Manager
::
instance
().
incomingCall
(
call
,
getAccountID
()))
{
/** @todo Faudra considérer éventuellement le champ CODEC PREFS pour
* l'établissement du codec de transmission */
...
...
src/plug-in/audiorecorder/audiorecord.cpp
View file @
3e2a4f2c
...
...
@@ -56,7 +56,7 @@ void AudioRecord::setSndSamplingRate(int smplRate){
void
AudioRecord
::
setRecordingOption
(
FILE_TYPE
type
,
SOUND_FORMAT
format
,
int
sndSmplRate
,
std
::
string
path
,
std
::
string
id
){
std
::
string
fName
;
//
std::string fName;
fileType_
=
type
;
sndFormat_
=
format
;
...
...
@@ -64,10 +64,10 @@ void AudioRecord::setRecordingOption(FILE_TYPE type, SOUND_FORMAT format, int sn
sndSmplRate_
=
sndSmplRate
;
call_id_
=
id
;
fName
=
fileName_
;
fName
.
append
(
"-"
+
call_id_
);
// fName = fileName_;
// fName.append("-"+call_id_);
/*
if (fileType_ == FILE_RAW){
if ( strstr(fileName_, ".raw") == NULL){
printf("AudioRecord::openFile::concatenate .raw file extension: name : %s \n", fileName_);
...
...
@@ -80,8 +80,34 @@ void AudioRecord::setRecordingOption(FILE_TYPE type, SOUND_FORMAT format, int sn
fName.append(".wav");
}
}
*/
savePath_
=
path
+
"/"
;
// savePath_.append(fName);
}
void
AudioRecord
::
initFileName
(
std
::
string
peerNumber
){
std
::
string
fName
;
fName
=
fileName_
;
fName
.
append
(
"-"
+
peerNumber
);
if
(
fileType_
==
FILE_RAW
){
if
(
strstr
(
fileName_
,
".raw"
)
==
NULL
){
printf
(
"AudioRecord::openFile::concatenate .raw file extension: name : %s
\n
"
,
fileName_
);
fName
.
append
(
".raw"
);
}
}
else
if
(
fileType_
==
FILE_WAV
){
if
(
strstr
(
fileName_
,
".wav"
)
==
NULL
){
printf
(
"AudioRecord::openFile::concatenate .wav file extension: name : %s
\n
"
,
fileName_
);
fName
.
append
(
".wav"
);
}
}
savePath_
.
append
(
fName
);
}
...
...
src/plug-in/audiorecorder/audiorecord.h
View file @
3e2a4f2c
...
...
@@ -45,6 +45,8 @@ public:
void
setRecordingOption
(
FILE_TYPE
type
,
SOUND_FORMAT
format
,
int
sndSmplRate
,
std
::
string
path
,
std
::
string
id
);
void
initFileName
(
std
::
string
peerNumber
);
/**
* Check if no otehr file is opened, then create a new one
* @param fileName A string containing teh file (with/without extension)
...
...
src/sipvoiplink.cpp
View file @
3e2a4f2c
...
...
@@ -420,6 +420,9 @@ SIPVoIPLink::newOutgoingCall(const CallID& id, const std::string& toUrl)
}
//call->setPeerNumber(toUrl);
call
->
setPeerNumber
(
getSipTo
(
toUrl
,
account
->
getHostname
()));
call
->
initRecFileName
();
_debug
(
"Try to make a call to: %s with call ID: %s
\n
"
,
toUrl
.
data
(),
id
.
data
());
// we have to add the codec before using it in SIPOutgoingInvite...
call
->
setCodecMap
(
Manager
::
instance
().
getCodecDescriptorMap
());
...
...
@@ -1838,6 +1841,8 @@ mod_on_rx_request(pjsip_rx_data *rdata)
call
->
setIp
(
link
->
getLocalIPAddress
());
call
->
setPeerNumber
(
peerNumber
);
call
->
initRecFileName
();
/* Call the SIPCallInvite function to generate the local sdp,
* remote sdp and negociator.
* This function is also used to set the parameters of audio RTP, including:
...
...
Write
Preview
Supports
Markdown
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