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
b2289be3
Commit
b2289be3
authored
12 years ago
by
Alexandre Savard
Browse files
Options
Downloads
Patches
Plain Diff
#9831: Fix sip transport port number
parent
6a06c6fa
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
daemon/src/sip/siptransport.cpp
+10
-2
10 additions, 2 deletions
daemon/src/sip/siptransport.cpp
daemon/src/sip/sipvoiplink.cpp
+0
-36
0 additions, 36 deletions
daemon/src/sip/sipvoiplink.cpp
with
10 additions
and
38 deletions
daemon/src/sip/siptransport.cpp
+
10
−
2
View file @
b2289be3
...
...
@@ -330,7 +330,11 @@ void SipTransport::createSipTransport(SIPAccount *account)
account
->
transport_
=
transport
;
}
if
(
!
account
->
transport_
)
{
DEBUG
(
"SipTransport: Looking into previously created transport map for %s:%d"
,
account
->
getLocalInterface
().
c_str
(),
account
->
getLocalPort
());
// Could not create new transport, this transport may already exists
account
->
transport_
=
transportMap_
[
account
->
getLocalPort
()];
...
...
@@ -341,6 +345,10 @@ void SipTransport::createSipTransport(SIPAccount *account)
account
->
setLocalPort
(
localUDPTransport_
->
local_name
.
port
);
}
}
if
(
account
->
transport_
==
NULL
)
ERROR
(
"SipTransport: Could not create transport on %s:%d"
,
account
->
getLocalInterface
().
c_str
(),
account
->
getLocalPort
());
}
void
SipTransport
::
createDefaultSipUdpTransport
()
...
...
@@ -408,15 +416,15 @@ SipTransport::createUdpTransport(const std::string &interface, unsigned int port
pj_status_t
status
;
pjsip_transport
*
transport
=
NULL
;
if
(
boundAddr
.
addr
.
sa_family
==
pj_AF_INET
())
{
boundAddr
.
ipv4
.
sin_port
=
listeningPort
;
status
=
pjsip_udp_transport_start
(
endpt_
,
&
boundAddr
.
ipv4
,
NULL
,
1
,
&
transport
);
if
(
status
!=
PJ_SUCCESS
)
{
ERROR
(
"Failed to create IPv4 UDP transport"
);
return
NULL
;
}
}
else
if
(
boundAddr
.
addr
.
sa_family
==
pj_AF_INET6
())
{
boundAddr
.
ipv6
.
sin6_port
=
listeningPort
;
status
=
pjsip_udp_transport_start6
(
endpt_
,
&
boundAddr
.
ipv6
,
NULL
,
1
,
&
transport
);
if
(
status
!=
PJ_SUCCESS
)
{
ERROR
(
"Failed to create IPv6 UDP transport"
);
return
NULL
;
}
}
...
...
This diff is collapsed.
Click to expand it.
daemon/src/sip/sipvoiplink.cpp
+
0
−
36
View file @
b2289be3
...
...
@@ -195,42 +195,6 @@ pj_bool_t transaction_response_cb(pjsip_rx_data *rdata)
return
PJ_SUCCESS
;
}
/*
std::string parseDisplayName(const char * buffer)
{
const char* from_header = strstr(buffer, "From: ");
if (!from_header)
return "";
std::string temp(from_header);
size_t begin_displayName = temp.find("\"") + 1;
size_t end_displayName = temp.rfind("\"");
std::string displayName(temp.substr(begin_displayName, end_displayName - begin_displayName));
static const size_t MAX_DISPLAY_NAME_SIZE = 25;
if (displayName.size() > MAX_DISPLAY_NAME_SIZE)
return "";
return displayName;
}
void stripSipUriPrefix(std::string& sipUri)
{
// Remove sip: prefix
static const char SIP_PREFIX[] = "sip:";
size_t found = sipUri.find(SIP_PREFIX);
if (found != std::string::npos)
sipUri.erase(found, found + (sizeof SIP_PREFIX) - 1);
found = sipUri.find("@");
if (found != std::string::npos)
sipUri.erase(found);
}
*/
pj_bool_t
transaction_request_cb
(
pjsip_rx_data
*
rdata
)
{
pjsip_method
*
method
=
&
rdata
->
msg_info
.
msg
->
line
.
req
.
method
;
...
...
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