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
4b565bec
Commit
4b565bec
authored
15 years ago
by
Alexandre Savard
Browse files
Options
Downloads
Patches
Plain Diff
[#2176] Fix fix audio stream binding in iax
parent
d055eea4
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
sflphone-common/src/iax/iaxvoiplink.cpp
+22
-1
22 additions, 1 deletion
sflphone-common/src/iax/iaxvoiplink.cpp
with
22 additions
and
1 deletion
sflphone-common/src/iax/iaxvoiplink.cpp
+
22
−
1
View file @
4b565bec
...
@@ -271,6 +271,8 @@ IAXVoIPLink::sendAudioFromMic (void)
...
@@ -271,6 +271,8 @@ IAXVoIPLink::sendAudioFromMic (void)
AudioCodec
*
ac
;
AudioCodec
*
ac
;
IAXCall
*
currentCall
;
IAXCall
*
currentCall
;
// We have to update the audio layer type in case we switched
// We have to update the audio layer type in case we switched
// TODO Find out a better way to do it
// TODO Find out a better way to do it
updateAudiolayer
();
updateAudiolayer
();
...
@@ -278,10 +280,14 @@ IAXVoIPLink::sendAudioFromMic (void)
...
@@ -278,10 +280,14 @@ IAXVoIPLink::sendAudioFromMic (void)
currentCall
=
getIAXCall
(
Manager
::
instance
().
getCurrentCallId
());
currentCall
=
getIAXCall
(
Manager
::
instance
().
getCurrentCallId
());
if
(
!
currentCall
)
{
if
(
!
currentCall
)
{
// Let's mind our own business.
// Let's mind our own business.
return
;
return
;
}
}
if
(
currentCall
->
getAudioCodec
()
<
0
)
if
(
currentCall
->
getAudioCodec
()
<
0
)
return
;
return
;
...
@@ -307,9 +313,13 @@ IAXVoIPLink::sendAudioFromMic (void)
...
@@ -307,9 +313,13 @@ IAXVoIPLink::sendAudioFromMic (void)
return
;
return
;
}
}
// Send sound here
// Send sound here
if
(
audiolayer
)
{
if
(
audiolayer
)
{
// we have to get 20ms of data from the mic *20/1000 = /50
// we have to get 20ms of data from the mic *20/1000 = /50
// rate/50 shall be lower than IAX__20S_48KHZ_MAX
// rate/50 shall be lower than IAX__20S_48KHZ_MAX
maxBytesToGet
=
audiolayer
->
getSampleRate
()
*
audiolayer
->
getFrameSize
()
/
1000
*
sizeof
(
SFLDataFormat
);
maxBytesToGet
=
audiolayer
->
getSampleRate
()
*
audiolayer
->
getFrameSize
()
/
1000
*
sizeof
(
SFLDataFormat
);
...
@@ -330,6 +340,8 @@ IAXVoIPLink::sendAudioFromMic (void)
...
@@ -330,6 +340,8 @@ IAXVoIPLink::sendAudioFromMic (void)
// Get bytes from micRingBuffer to data_from_mic
// Get bytes from micRingBuffer to data_from_mic
nbSample_
=
audiolayer
->
getMainBuffer
()
->
getData
(
micData
,
bytesAvail
,
100
,
currentCall
->
getCallId
())
/
sizeof
(
SFLDataFormat
);
nbSample_
=
audiolayer
->
getMainBuffer
()
->
getData
(
micData
,
bytesAvail
,
100
,
currentCall
->
getCallId
())
/
sizeof
(
SFLDataFormat
);
// Store the number of samples for recording
// Store the number of samples for recording
nbSampleForRec_
=
nbSample_
;
nbSampleForRec_
=
nbSample_
;
...
@@ -526,6 +538,7 @@ IAXVoIPLink::peerHungup (const CallID& id)
...
@@ -526,6 +538,7 @@ IAXVoIPLink::peerHungup (const CallID& id)
IAXCall
*
call
=
getIAXCall
(
id
);
IAXCall
*
call
=
getIAXCall
(
id
);
std
::
string
reason
=
"Dumped Call"
;
std
::
string
reason
=
"Dumped Call"
;
CHK_VALID_CALL
;
CHK_VALID_CALL
;
_mutexIAX
.
enterMutex
();
_mutexIAX
.
enterMutex
();
_mutexIAX
.
leaveMutex
();
_mutexIAX
.
leaveMutex
();
...
@@ -769,6 +782,9 @@ IAXVoIPLink::iaxHandleCallEvent (iax_event* event, IAXCall* call)
...
@@ -769,6 +782,9 @@ IAXVoIPLink::iaxHandleCallEvent (iax_event* event, IAXCall* call)
case
IAX_EVENT_ANSWER
:
case
IAX_EVENT_ANSWER
:
if
(
call
->
getConnectionState
()
!=
Call
::
Connected
)
{
if
(
call
->
getConnectionState
()
!=
Call
::
Connected
)
{
Manager
::
instance
().
addStream
(
call
->
getCallId
());
call
->
setConnectionState
(
Call
::
Connected
);
call
->
setConnectionState
(
Call
::
Connected
);
call
->
setState
(
Call
::
Active
);
call
->
setState
(
Call
::
Active
);
audiolayer
->
startStream
();
audiolayer
->
startStream
();
...
@@ -850,6 +866,8 @@ IAXVoIPLink::iaxHandleVoiceEvent (iax_event* event, IAXCall* call)
...
@@ -850,6 +866,8 @@ IAXVoIPLink::iaxHandleVoiceEvent (iax_event* event, IAXCall* call)
int
expandedSize
,
nbSample_
;
int
expandedSize
,
nbSample_
;
AudioCodec
*
ac
;
AudioCodec
*
ac
;
// If we receive datalen == 0, some things of the jitter buffer in libiax2/iax.c
// If we receive datalen == 0, some things of the jitter buffer in libiax2/iax.c
// were triggered
// were triggered
...
@@ -860,6 +878,7 @@ IAXVoIPLink::iaxHandleVoiceEvent (iax_event* event, IAXCall* call)
...
@@ -860,6 +878,7 @@ IAXVoIPLink::iaxHandleVoiceEvent (iax_event* event, IAXCall* call)
}
}
if
(
audiolayer
)
{
if
(
audiolayer
)
{
// On-the-fly codec changing (normally, when we receive a full packet)
// On-the-fly codec changing (normally, when we receive a full packet)
// as per http://tools.ietf.org/id/draft-guy-iax-03.txt
// as per http://tools.ietf.org/id/draft-guy-iax-03.txt
// - subclass holds the voiceformat property.
// - subclass holds the voiceformat property.
...
@@ -1000,6 +1019,8 @@ IAXVoIPLink::iaxHandlePrecallEvent (iax_event* event)
...
@@ -1000,6 +1019,8 @@ IAXVoIPLink::iaxHandlePrecallEvent (iax_event* event)
id
=
Manager
::
instance
().
getNewCallID
();
id
=
Manager
::
instance
().
getNewCallID
();
_debug
(
"-------------------------------------------------------------- callid %s"
,
id
.
c_str
());
call
=
new
IAXCall
(
id
,
Call
::
Incoming
);
call
=
new
IAXCall
(
id
,
Call
::
Incoming
);
if
(
!
call
)
{
if
(
!
call
)
{
...
...
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