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
8e45d1d7
Commit
8e45d1d7
authored
12 years ago
by
Alexandre Savard
Browse files
Options
Downloads
Patches
Plain Diff
#9833: handlingEvents_ must be initialized to true when starting iax thread
parent
54519120
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
daemon/src/iax/iaxvoiplink.cpp
+15
-8
15 additions, 8 deletions
daemon/src/iax/iaxvoiplink.cpp
daemon/src/iax/iaxvoiplink.h
+9
-7
9 additions, 7 deletions
daemon/src/iax/iaxvoiplink.h
daemon/src/sip/sipvoiplink.h
+1
-3
1 addition, 3 deletions
daemon/src/sip/sipvoiplink.h
with
25 additions
and
18 deletions
daemon/src/iax/iaxvoiplink.cpp
+
15
−
8
View file @
8e45d1d7
...
...
@@ -43,8 +43,7 @@
#include
<dlfcn.h>
IAXVoIPLink
::
IAXVoIPLink
(
const
std
::
string
&
accountID
)
:
evThread_
(
new
EventThread
(
this
))
,
regSession_
(
NULL
)
regSession_
(
NULL
)
,
nextRefreshStamp_
(
0
)
,
mutexIAX_
()
,
decData_
()
...
...
@@ -53,6 +52,7 @@ IAXVoIPLink::IAXVoIPLink(const std::string& accountID) :
,
converter_
(
44100
)
,
initDone_
(
false
)
,
accountID_
(
accountID
)
,
evThread_
(
this
)
{
srand
(
time
(
NULL
));
// to get random number for RANDOM_PORT
}
...
...
@@ -61,8 +61,6 @@ IAXVoIPLink::IAXVoIPLink(const std::string& accountID) :
IAXVoIPLink
::~
IAXVoIPLink
()
{
handlingEvents_
=
false
;
delete
evThread_
;
regSession_
=
NULL
;
// shall not delete it // XXX: but why?
terminate
();
}
...
...
@@ -75,8 +73,8 @@ IAXVoIPLink::init()
for
(
int
port
=
IAX_DEFAULT_PORTNO
,
nbTry
=
0
;
nbTry
<
3
;
port
=
rand
()
%
64000
+
1024
,
nbTry
++
)
{
if
(
iax_init
(
port
)
>=
0
)
{
handlingEvents_
=
fals
e
;
evThread_
->
start
();
handlingEvents_
=
tru
e
;
evThread_
.
start
();
initDone_
=
true
;
break
;
}
...
...
@@ -113,6 +111,7 @@ IAXVoIPLink::getEvent()
iax_event
*
event
;
while
((
event
=
iax_get_event
(
0
))
!=
NULL
)
{
// If we received an 'ACK', libiax2 tells apps to ignore them.
if
(
event
->
etype
==
IAX_EVENT_NULL
)
{
iax_event_free
(
event
);
...
...
@@ -121,10 +120,12 @@ IAXVoIPLink::getEvent()
IAXCall
*
call
=
iaxFindCallBySession
(
event
->
session
);
if
(
call
)
if
(
call
)
{
iaxHandleCallEvent
(
event
,
call
);
else
if
(
event
->
session
&&
event
->
session
==
regSession_
)
}
else
if
(
event
->
session
&&
event
->
session
==
regSession_
)
{
iaxHandleRegReply
(
event
);
// This is a registration session, deal with it
}
else
// We've got an event before it's associated with any call
iaxHandlePrecallEvent
(
event
);
...
...
@@ -208,6 +209,8 @@ IAXVoIPLink::getIAXCall(const std::string& id)
void
IAXVoIPLink
::
sendRegister
(
Account
*
a
)
{
DEBUG
(
"========================================= Send register"
);
IAXAccount
*
account
=
dynamic_cast
<
IAXAccount
*>
(
a
);
if
(
account
->
getHostname
().
empty
())
...
...
@@ -584,6 +587,8 @@ void IAXVoIPLink::iaxHandleVoiceEvent(iax_event* event, IAXCall* call)
*/
void
IAXVoIPLink
::
iaxHandleRegReply
(
iax_event
*
event
)
{
DEBUG
(
"================== IAX REG REPLY"
);
IAXAccount
*
account
=
dynamic_cast
<
IAXAccount
*>
(
Manager
::
instance
().
getAccount
(
accountID_
));
if
(
event
->
etype
!=
IAX_EVENT_REGREJ
&&
event
->
etype
!=
IAX_EVENT_REGACK
)
...
...
@@ -605,6 +610,8 @@ void IAXVoIPLink::iaxHandlePrecallEvent(iax_event* event)
std
::
string
id
;
int
format
;
DEBUG
(
"================ HANDLE IAX PRECALL EVENT"
);
switch
(
event
->
etype
)
{
case
IAX_EVENT_CONNECT
:
id
=
Manager
::
instance
().
getNewCallID
();
...
...
This diff is collapsed.
Click to expand it.
daemon/src/iax/iaxvoiplink.h
+
9
−
7
View file @
8e45d1d7
...
...
@@ -33,20 +33,20 @@
#define IAXVOIPLINK_H
#include
"voiplink.h"
#include
<iax-client.h>
#include
"audio/codecs/audiocodec.h"
// for DEC_BUFFER_SIZE
#include
"sfl_types.h"
#include
"noncopyable.h"
#include
"audio/samplerateconverter.h"
#include
"eventthread.h"
#include
<iax-client.h>
class
EventThread
;
class
IAXCall
;
class
IAXAccount
;
class
AudioCodec
;
class
AudioLayer
;
class
IAXAccount
;
/**
* @file iaxvoiplink.h
* @brief VoIPLink contains a thread that listen to external events
...
...
@@ -234,9 +234,6 @@ class IAXVoIPLink : public VoIPLink {
*/
void
iaxOutgoingInvite
(
IAXCall
*
call
);
/** Threading object */
EventThread
*
evThread_
;
/** registration session : 0 if not register */
iax_session
*
regSession_
;
...
...
@@ -264,6 +261,11 @@ class IAXVoIPLink : public VoIPLink {
bool
initDone_
;
const
std
::
string
accountID_
;
/**
* Threading object
*/
EventThread
evThread_
;
};
#endif
This diff is collapsed.
Click to expand it.
daemon/src/sip/sipvoiplink.h
+
1
−
3
View file @
8e45d1d7
...
...
@@ -38,15 +38,13 @@
#include
<map>
//////////////////////////////
/* PJSIP imports */
#include
<pjsip.h>
#include
<pjlib.h>
#include
<pjsip_ua.h>
#include
<pjlib-util.h>
#include
<pjnath.h>
#include
<pjnath/stun_config.h>
///////////////////////////////
#include
"sipaccount.h"
#include
"voiplink.h"
#include
"siptransport.h"
...
...
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