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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
savoirfairelinux
jami-daemon
Commits
fd7593e4
Commit
fd7593e4
authored
Oct 3, 2008
by
Yun Liu
Browse files
Options
Downloads
Patches
Plain Diff
Check the availability of port 5060
parent
4e09c9de
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
src/useragent.cpp
+17
-10
17 additions, 10 deletions
src/useragent.cpp
with
17 additions
and
10 deletions
src/useragent.cpp
+
17
−
10
View file @
fd7593e4
...
@@ -113,8 +113,6 @@ pj_status_t UserAgent::sipInit() {
...
@@ -113,8 +113,6 @@ pj_status_t UserAgent::sipInit() {
_debug
(
"UserAgent: Unable to check NAT setting
\n
"
);
_debug
(
"UserAgent: Unable to check NAT setting
\n
"
);
return
false
;
// hoho we can't use the random sip port too...
return
false
;
// hoho we can't use the random sip port too...
}
}
}
else
{
//FIXME! check port number availability
}
}
_localPort
=
port
;
_localPort
=
port
;
...
@@ -123,18 +121,27 @@ pj_status_t UserAgent::sipInit() {
...
@@ -123,18 +121,27 @@ pj_status_t UserAgent::sipInit() {
stunServerResolve
();
stunServerResolve
();
_localExternAddress
=
Manager
::
instance
().
getFirewallAddress
();
_localExternAddress
=
Manager
::
instance
().
getFirewallAddress
();
_localExternPort
=
Manager
::
instance
().
getFirewallPort
();
_localExternPort
=
Manager
::
instance
().
getFirewallPort
();
errPjsip
=
createUDPServer
();
if
(
errPjsip
!=
0
)
{
_debug
(
"UserAgent: Could not initialize SIP listener on port %d
\n
"
,
port
);
return
errPjsip
;
}
}
else
{
}
else
{
_localExternAddress
=
_localIPAddress
;
_localExternAddress
=
_localIPAddress
;
_localExternPort
=
_localPort
;
_localExternPort
=
_localPort
;
}
errPjsip
=
createUDPServer
();
errPjsip
=
createUDPServer
();
if
(
errPjsip
!=
0
)
{
if
(
errPjsip
!=
0
)
{
_debug
(
"UserAgent: Could not initialize SIP listener on port %d
\n
"
,
port
);
_debug
(
"UserAgent: Could not initialize SIP listener on port %d
\n
"
,
_localExternPort
);
port
=
RANDOM_SIP_PORT
;
_localExternPort
=
_localPort
=
RANDOM_SIP_PORT
;
_debug
(
"UserAgent: SIP failed to listen on port %d
\n
"
,
port
);
_debug
(
"UserAgent: Try to initialize SIP listener on port %d
\n
"
,
_localExternPort
);
errPjsip
=
createUDPServer
();
if
(
errPjsip
!=
0
)
{
_debug
(
"UserAgent: Fail to initialize SIP listener on port %d
\n
"
,
_localExternPort
);
return
errPjsip
;
return
errPjsip
;
}
}
}
}
_debug
(
"UserAgent: SIP Init -- listening on port %d
\n
"
,
_localExternPort
);
_debug
(
"UserAgent: SIP Init -- listening on port %d
\n
"
,
_localExternPort
);
// Initialize transaction layer
// Initialize transaction layer
...
...
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