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
7ee3d70f
Commit
7ee3d70f
authored
Feb 20, 2009
by
Alexandre Savard
Browse files
Fixed second call audio codec name broadcasting to client
parent
9b32b811
Changes
7
Hide whitespace changes
Inline
Side-by-side
po/es.po
View file @
7ee3d70f
...
...
@@ -114,6 +114,7 @@ msgid "%d voice mail"
msgstr "%d mensaje de voz"
#: ../sflphone-gtk/src/actions.c:80
#, c-format
msgid "%s account- %s"
msgstr "%s cuenta: %s"
...
...
@@ -304,6 +305,7 @@ msgid "Ringtones"
msgstr "_Permitir los ringtones"
#: ../sflphone-gtk/src/calltree.c:209
#, fuzzy, c-format
msgid "\"Voicemail\" <%s>"
msgstr "_Numero de Caja de Voz"
...
...
@@ -625,6 +627,7 @@ msgid "_Show main window"
msgstr "Mostrar ventana principal"
#: ../sflphone-gtk/src/statusicon.c:124
#, c-format
msgid "SFLphone - %i accounts registered"
msgstr "SFLphone - %i cuenta registrada"
...
...
src/audio/audiortp.cpp
View file @
7ee3d70f
...
...
@@ -182,15 +182,17 @@ AudioRtpRTX::initBuffers()
void
AudioRtpRTX
::
initAudioRtpSession
(
void
)
{
_debug
(
"AudioRtpRTX::initAudioRtpSession: call %s
\n
"
,
_ca
->
getCallId
().
c_str
());
try
{
if
(
_ca
==
0
)
{
return
;
}
_audiocodec
=
Manager
::
instance
().
getCodecDescriptorMap
().
getCodec
(
_ca
->
getAudioCodec
()
);
_codecSampleRate
=
_audiocodec
->
getClockRate
();
_codecSampleRate
=
_audiocodec
->
getClockRate
();
_debug
(
"Init audio RTP session
\n
"
);
ost
::
InetHostAddress
remote_ip
(
_ca
->
getRemoteIp
().
c_str
());
if
(
!
remote_ip
)
{
_debug
(
"! ARTP Thread Error: Target IP address [%s] is not correct!
\n
"
,
_ca
->
getRemoteIp
().
data
());
return
;
}
...
...
@@ -249,6 +251,7 @@ AudioRtpRTX::initAudioRtpSession (void)
_debugException
(
"! ARTP Failure: initialisation failed"
);
throw
;
}
_debug
(
"AudioRtpRTX::initAudioRtpSession: Init audio RTP sessionend of method
\n
"
);
}
void
...
...
@@ -442,7 +445,7 @@ AudioRtpRTX::run () {
audiolayer
->
startStream
();
_start
.
post
();
_debug
(
"- ARTP Action: Start
\n
"
);
_debug
(
"- ARTP Action: Start
call %s
\n
"
,
_ca
->
getCallId
().
c_str
()
);
while
(
!
testCancel
())
{
// printf("AudioRtpRTX::run() _session->getFirstTimestamp() %i \n",_session->getFirstTimestamp());
...
...
@@ -452,12 +455,14 @@ AudioRtpRTX::run () {
////////////////////////////
// Send session
////////////////////////////
sendSessionFromMic
(
timestamp
);
sendSessionFromMic
(
timestamp
);
timestamp
+=
step
;
////////////////////////////
// Recv session
////////////////////////////
receiveSessionForSpkr
(
countTime
);
// Let's wait for the next transmit cycle
if
(
_session
->
isWaiting
())
...
...
@@ -465,13 +470,14 @@ AudioRtpRTX::run () {
else
_ca
->
recAudio
.
recData
(
micData
,
_nSamplesMic
);
Thread
::
sleep
(
TimerPort
::
getTimer
());
Thread
::
sleep
(
TimerPort
::
getTimer
());
TimerPort
::
incTimer
(
_layerFrameSize
);
// 'frameSize' ms
}
// _debug("stop stream for audiortp loop\n");
audiolayer
->
stopStream
();
_debug
(
"- ARTP Action: Stop
\n
"
);
_debug
(
"- ARTP Action: Stop
call %s
\n
"
,
_ca
->
getCallId
().
c_str
()
);
//} catch(std::exception &e) {
//_start.post();
//_debug("! ARTP: Stop %s\n", e.what());
...
...
src/call.cpp
View file @
7ee3d70f
...
...
@@ -122,7 +122,6 @@ Call::getRemoteIp()
AudioCodecType
Call
::
getAudioCodec
()
{
ost
::
MutexLock
m
(
_callMutex
);
return
_audioCodec
;
}
...
...
src/iaxvoiplink.cpp
View file @
7ee3d70f
...
...
@@ -43,6 +43,7 @@
IAXVoIPLink
::
IAXVoIPLink
(
const
AccountID
&
accountID
)
:
VoIPLink
(
accountID
)
{
// _debug("IAXVoIPLink::IAXVoIPLink : creating eventhread \n ");
_evThread
=
new
EventThread
(
this
);
_regSession
=
NULL
;
_nextRefreshStamp
=
0
;
...
...
@@ -88,6 +89,7 @@ IAXVoIPLink::init()
if
(
initDone
())
return
false
;
bool
returnValue
=
false
;
// _localAddress = "127.0.0.1";
// port 0 is default
...
...
src/main.cpp
View file @
7ee3d70f
...
...
@@ -110,6 +110,7 @@ main (int argc, char **argv) {
}
bool
initOK
=
false
;
try
{
_debug
(
"Initialize manager in main
\n
"
);
Manager
::
instance
().
initConfigFile
();
Manager
::
instance
().
init
();
initOK
=
true
;
...
...
src/managerimpl.cpp
View file @
7ee3d70f
...
...
@@ -221,6 +221,7 @@ ManagerImpl::outgoingCall(const std::string& accountid, const CallID& id, const
bool
ManagerImpl
::
answerCall
(
const
CallID
&
id
)
{
stopTone
(
false
);
_debug
(
"Try to answer call: %s
\n
"
,
id
.
data
());
AccountID
accountid
=
getAccountFromCall
(
id
);
...
...
@@ -240,14 +241,15 @@ ManagerImpl::answerCall(const CallID& id)
return
false
;
}
std
::
string
codecName
=
getCurrentCodecName
(
id
);
_debug
(
"ManagerImpl::hangupCall(): broadcast codec name %s
\n
"
,
codecName
.
c_str
());
if
(
_dbus
)
_dbus
->
getCallManager
()
->
currentSelectedCodec
(
id
,
codecName
.
c_str
());
// if it was waiting, it's waiting no more
if
(
_dbus
)
_dbus
->
getCallManager
()
->
callStateChanged
(
id
,
"CURRENT"
);
removeWaitingCall
(
id
);
switchCall
(
id
);
std
::
string
codecName
=
getCurrentCodecName
(
id
);
_debug
(
"ManagerImpl::hangupCall(): broadcast codec name %s
\n
"
,
codecName
.
c_str
());
if
(
_dbus
)
_dbus
->
getCallManager
()
->
currentSelectedCodec
(
id
,
codecName
.
c_str
());
return
true
;
}
...
...
@@ -367,6 +369,10 @@ ManagerImpl::offHoldCall(const CallID& id)
}
switchCall
(
id
);
std
::
string
codecName
=
getCurrentCodecName
(
id
);
_debug
(
"ManagerImpl::hangupCall(): broadcast codec name %s
\n
"
,
codecName
.
c_str
());
if
(
_dbus
)
_dbus
->
getCallManager
()
->
currentSelectedCodec
(
id
,
codecName
.
c_str
());
return
returnValue
;
}
...
...
@@ -748,7 +754,7 @@ bool ManagerImpl::playATone(Tone::TONEID toneId)
return
false
;
audiolayer
=
getAudioDriver
();
if
(
_telephoneTone
!=
0
)
{
_toneMutex
.
enterMutex
();
_telephoneTone
->
setCurrentTone
(
toneId
);
...
...
src/sipvoiplink.cpp
View file @
7ee3d70f
...
...
@@ -446,7 +446,7 @@ SIPVoIPLink::answer(const CallID& id)
pj_status_t
status
;
pjsip_tx_data
*
tdata
;
_debug
(
"
-
SIP
Action
: start answering
\n
"
);
_debug
(
"SIP
VoIPLink::answer
: start answering
\n
"
);
call
=
getSIPCall
(
id
);
...
...
@@ -458,22 +458,23 @@ SIPVoIPLink::answer(const CallID& id)
// User answered the incoming call, tell peer this news
if
(
call
->
startNegociation
(
_pool
))
{
// Create and send a 200(OK) response
_debug
(
"UserAgent: Negociation success!
\n
"
);
_debug
(
"
SIPVoIPLink::answer:
UserAgent: Negociation success!
: call %s
\n
"
,
call
->
getCallId
().
c_str
()
);
status
=
pjsip_inv_answer
(
call
->
getInvSession
(),
PJSIP_SC_OK
,
NULL
,
NULL
,
&
tdata
);
PJ_ASSERT_RETURN
(
status
==
PJ_SUCCESS
,
1
);
status
=
pjsip_inv_send_msg
(
call
->
getInvSession
(),
tdata
);
PJ_ASSERT_RETURN
(
status
==
PJ_SUCCESS
,
1
);
_debug
(
"
*
SIP
Info
: Starting AudioRTP when answering
\n
"
);
_debug
(
"SIP
VoIPLink::answer
: Starting AudioRTP when answering
: call %s
\n
"
,
call
->
getCallId
().
c_str
()
);
if
(
_audiortp
->
createNewSession
(
call
)
>=
0
)
{
call
->
setAudioStart
(
true
);
call
->
setConnectionState
(
Call
::
Connected
);
call
->
setState
(
Call
::
Active
);
return
true
;
}
else
{
_debug
(
"
!
SIP
Failure
: Unable to start sound when answering %s/%d
\n
"
,
__FILE__
,
__LINE__
);
_debug
(
"SIP
VoIPLink::answer
: Unable to start sound when answering %s/%d
\n
"
,
__FILE__
,
__LINE__
);
}
}
_debug
(
"SIPVoIPLink::answer: fail terminate call %s
\n
"
,
call
->
getCallId
().
c_str
());
terminateOneCall
(
call
->
getCallId
());
removeCall
(
call
->
getCallId
());
return
false
;
...
...
@@ -804,10 +805,16 @@ std::string
SIPVoIPLink
::
getCurrentCodecName
()
{
// _debug("SIPVoIPLink::getCurrentCodecName : \n");
_debug
(
"SIPVoIPLink::getCurrentCodecName Ok 1 :
\n
"
);
printf
(
"AAAAAAAAAAAAAHHHHHHH!!!!!!:: %s
\n
"
,
Manager
::
instance
().
getCurrentCallId
().
c_str
());
SIPCall
*
call
=
getSIPCall
(
Manager
::
instance
().
getCurrentCallId
());
_debug
(
"SIPVoIPLink::getCurrentCodecName Ok 2 :
\n
"
);
printf
(
"OOOOOOOUUUUUUPPPPPPPPPPSSSSSSSSSSS!!!!!!:: %s
\n
"
,
call
->
getCallId
().
c_str
());
AudioCodec
*
ac
=
call
->
getCodecMap
().
getCodec
(
call
->
getAudioCodec
());
return
ac
->
getCodecName
();
...
...
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