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
8a9b264d
Commit
8a9b264d
authored
16 years ago
by
Yun Liu
Browse files
Options
Downloads
Patches
Plain Diff
Modify return value( change PJ_SUCCESS to boolean )
parent
3b814e02
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/useragent.cpp
+9
-9
9 additions, 9 deletions
src/useragent.cpp
src/useragent.h
+1
-1
1 addition, 1 deletion
src/useragent.h
with
10 additions
and
10 deletions
src/useragent.cpp
+
9
−
9
View file @
8a9b264d
...
@@ -358,7 +358,7 @@ void UserAgent::busy_sleep(unsigned msec)
...
@@ -358,7 +358,7 @@ void UserAgent::busy_sleep(unsigned msec)
#endif
#endif
}
}
int
UserAgent
::
addAccount
(
AccountID
id
,
pjsip_regc
**
regc2
,
const
std
::
string
&
server
,
const
std
::
string
&
user
,
const
std
::
string
&
passwd
,
bool
UserAgent
::
addAccount
(
AccountID
id
,
pjsip_regc
**
regc2
,
const
std
::
string
&
server
,
const
std
::
string
&
user
,
const
std
::
string
&
passwd
,
const
int
&
timeout
UNUSED
)
{
const
int
&
timeout
UNUSED
)
{
pj_status_t
status
;
pj_status_t
status
;
AccountID
*
currentId
=
new
AccountID
(
id
);
AccountID
*
currentId
=
new
AccountID
(
id
);
...
@@ -376,7 +376,7 @@ int UserAgent::addAccount(AccountID id, pjsip_regc **regc2, const std::string& s
...
@@ -376,7 +376,7 @@ int UserAgent::addAccount(AccountID id, pjsip_regc **regc2, const std::string& s
status
=
pjsip_regc_create
(
_endpt
,
(
void
*
)
currentId
,
&
regc_cb
,
&
regc
);
status
=
pjsip_regc_create
(
_endpt
,
(
void
*
)
currentId
,
&
regc_cb
,
&
regc
);
if
(
status
!=
PJ_SUCCESS
)
{
if
(
status
!=
PJ_SUCCESS
)
{
_debug
(
"UserAgent: Unable to create regc.
\n
"
);
_debug
(
"UserAgent: Unable to create regc.
\n
"
);
return
status
;
return
false
;
}
}
tmp
=
"sip:"
+
server
;
tmp
=
"sip:"
+
server
;
...
@@ -394,7 +394,7 @@ int UserAgent::addAccount(AccountID id, pjsip_regc **regc2, const std::string& s
...
@@ -394,7 +394,7 @@ int UserAgent::addAccount(AccountID id, pjsip_regc **regc2, const std::string& s
status
=
pjsip_regc_init
(
regc
,
&
svr
,
&
aor
,
&
aor
,
1
,
&
contact
,
600
);
//timeout);
status
=
pjsip_regc_init
(
regc
,
&
svr
,
&
aor
,
&
aor
,
1
,
&
contact
,
600
);
//timeout);
if
(
status
!=
PJ_SUCCESS
)
{
if
(
status
!=
PJ_SUCCESS
)
{
_debug
(
"UserAgent: Unable to initialize regc. %d
\n
"
,
status
);
//, regc->str_srv_url.ptr);
_debug
(
"UserAgent: Unable to initialize regc. %d
\n
"
,
status
);
//, regc->str_srv_url.ptr);
return
status
;
return
false
;
}
}
...
@@ -418,13 +418,13 @@ int UserAgent::addAccount(AccountID id, pjsip_regc **regc2, const std::string& s
...
@@ -418,13 +418,13 @@ int UserAgent::addAccount(AccountID id, pjsip_regc **regc2, const std::string& s
status
=
pjsip_regc_register
(
regc
,
PJ_TRUE
,
&
tdata
);
status
=
pjsip_regc_register
(
regc
,
PJ_TRUE
,
&
tdata
);
if
(
status
!=
PJ_SUCCESS
)
{
if
(
status
!=
PJ_SUCCESS
)
{
_debug
(
"UserAgent: Unable to register regc.
\n
"
);
_debug
(
"UserAgent: Unable to register regc.
\n
"
);
return
status
;
return
false
;
}
}
status
=
pjsip_regc_send
(
regc
,
tdata
);
status
=
pjsip_regc_send
(
regc
,
tdata
);
if
(
status
!=
PJ_SUCCESS
)
{
if
(
status
!=
PJ_SUCCESS
)
{
_debug
(
"UserAgent: Unable to send regc request.
\n
"
);
_debug
(
"UserAgent: Unable to send regc request.
\n
"
);
return
status
;
return
false
;
}
}
account
->
setUserName
(
user
);
account
->
setUserName
(
user
);
...
@@ -436,7 +436,7 @@ int UserAgent::addAccount(AccountID id, pjsip_regc **regc2, const std::string& s
...
@@ -436,7 +436,7 @@ int UserAgent::addAccount(AccountID id, pjsip_regc **regc2, const std::string& s
pj_mutex_unlock
(
_mutex
);
pj_mutex_unlock
(
_mutex
);
return
PJ_SUCCESS
;
return
true
;
}
}
bool
UserAgent
::
removeAccount
(
pjsip_regc
*
regc
)
bool
UserAgent
::
removeAccount
(
pjsip_regc
*
regc
)
...
@@ -893,7 +893,7 @@ bool UserAgent::makeOutgoingCall(const std::string& strTo, SIPCall* call, const
...
@@ -893,7 +893,7 @@ bool UserAgent::makeOutgoingCall(const std::string& strTo, SIPCall* call, const
&
to
,
&
to
,
NULL
,
NULL
,
&
dialog
);
&
dialog
);
PJ_ASSERT_RETURN
(
status
==
PJ_SUCCESS
,
1
);
PJ_ASSERT_RETURN
(
status
==
PJ_SUCCESS
,
false
);
setCallAudioLocal
(
call
);
setCallAudioLocal
(
call
);
call
->
setIp
(
getInstance
()
->
getLocalIP
());
call
->
setIp
(
getInstance
()
->
getLocalIP
());
...
@@ -904,7 +904,7 @@ bool UserAgent::makeOutgoingCall(const std::string& strTo, SIPCall* call, const
...
@@ -904,7 +904,7 @@ bool UserAgent::makeOutgoingCall(const std::string& strTo, SIPCall* call, const
// Create the invite session for this call
// Create the invite session for this call
pjsip_inv_session
*
inv
;
pjsip_inv_session
*
inv
;
status
=
pjsip_inv_create_uac
(
dialog
,
call
->
getLocalSDPSession
(),
0
,
&
inv
);
status
=
pjsip_inv_create_uac
(
dialog
,
call
->
getLocalSDPSession
(),
0
,
&
inv
);
PJ_ASSERT_RETURN
(
status
==
PJ_SUCCESS
,
1
);
PJ_ASSERT_RETURN
(
status
==
PJ_SUCCESS
,
false
);
// Set auth information
// Set auth information
pjsip_auth_clt_set_credentials
(
&
dialog
->
auth_sess
,
1
,
account
->
getCredInfo
());
pjsip_auth_clt_set_credentials
(
&
dialog
->
auth_sess
,
1
,
account
->
getCredInfo
());
...
@@ -913,7 +913,7 @@ bool UserAgent::makeOutgoingCall(const std::string& strTo, SIPCall* call, const
...
@@ -913,7 +913,7 @@ bool UserAgent::makeOutgoingCall(const std::string& strTo, SIPCall* call, const
inv
->
mod_data
[
_mod
.
id
]
=
call
;
inv
->
mod_data
[
_mod
.
id
]
=
call
;
status
=
pjsip_inv_invite
(
inv
,
&
tdata
);
status
=
pjsip_inv_invite
(
inv
,
&
tdata
);
PJ_ASSERT_RETURN
(
status
==
PJ_SUCCESS
,
1
);
PJ_ASSERT_RETURN
(
status
==
PJ_SUCCESS
,
false
);
// Associate current invite session in the call
// Associate current invite session in the call
call
->
setInvSession
(
inv
);
call
->
setInvSession
(
inv
);
...
...
This diff is collapsed.
Click to expand it.
src/useragent.h
+
1
−
1
View file @
8a9b264d
...
@@ -102,7 +102,7 @@ public:
...
@@ -102,7 +102,7 @@ public:
pj_str_t
getStunServer
()
{
return
_stunHost
;
}
pj_str_t
getStunServer
()
{
return
_stunHost
;
}
int
addAccount
(
AccountID
id
,
pjsip_regc
**
regc
,
const
std
::
string
&
server
,
const
std
::
string
&
user
,
const
std
::
string
&
passwd
bool
addAccount
(
AccountID
id
,
pjsip_regc
**
regc
,
const
std
::
string
&
server
,
const
std
::
string
&
user
,
const
std
::
string
&
passwd
,
const
int
&
timeout
);
,
const
int
&
timeout
);
bool
removeAccount
(
pjsip_regc
*
regc
);
bool
removeAccount
(
pjsip_regc
*
regc
);
...
...
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