Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Open sidebar
savoirfairelinux
jami-daemon
Commits
3d5ff61e
Commit
3d5ff61e
authored
Apr 16, 2012
by
Alexandre Savard
Committed by
Tristan Matthews
Apr 17, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
#9831: Fix sip transport port number
parent
7208f192
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
38 deletions
+10
-38
daemon/src/sip/siptransport.cpp
daemon/src/sip/siptransport.cpp
+10
-2
daemon/src/sip/sipvoiplink.cpp
daemon/src/sip/sipvoiplink.cpp
+0
-36
No files found.
daemon/src/sip/siptransport.cpp
View file @
3d5ff61e
...
...
@@ -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
;
}
}
...
...
daemon/src/sip/sipvoiplink.cpp
View file @
3d5ff61e
...
...
@@ -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
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment