Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
savoirfairelinux
jami-daemon
Commits
8f6e9ac3
Commit
8f6e9ac3
authored
Apr 24, 2012
by
Alexandre Savard
Browse files
#9910: fix sending call with new transport
parent
904f7882
Changes
3
Show whitespace changes
Inline
Side-by-side
daemon/src/sip/sipaccount.cpp
View file @
8f6e9ac3
...
...
@@ -793,7 +793,7 @@ void SIPAccount::setContactHeader(std::string address, std::string port)
std
::
string
SIPAccount
::
getContactHeader
()
const
{
if
(
transport_
==
NULL
)
ERROR
(
"Transport not created yet"
);
ERROR
(
"
SipAccount:
Transport not created yet"
);
// The transport type must be specified, in our case START_OTHER refers to stun transport
pjsip_transport_type_e
transportType
=
transportType_
;
...
...
daemon/src/sip/siptransport.cpp
View file @
8f6e9ac3
...
...
@@ -457,7 +457,7 @@ SipTransport::createUdpTransport(const std::string &interface, unsigned int port
{
// init socket to bind this transport to
pj_uint16_t
listeningPort
=
(
pj_uint16_t
)
port
;
pjsip_transport
*
transport
;
pjsip_transport
*
transport
=
NULL
;
DEBUG
(
"SipTransport: Update UDP transport on %s:%d with public addr %s:%d"
,
interface
.
c_str
(),
port
,
publicAddr
.
c_str
(),
publicPort
);
...
...
daemon/src/sip/sipvoiplink.cpp
View file @
8f6e9ac3
...
...
@@ -524,6 +524,9 @@ void SIPVoIPLink::sendRegister(Account *a)
account
->
setReceivedParameter
(
""
);
// Explicitely set the bound address port to 0 so that pjsip determine a random port by itself
account
->
transport_
=
sipTransport
.
createUdpTransport
(
account
->
getLocalInterface
(),
0
,
received
,
account
->
getLocalPort
());
if
(
account
->
transport_
==
NULL
)
{
ERROR
(
"UserAgent: Could not create new udp transport with public address: %s:%d"
,
received
.
c_str
(),
account
->
getLocalPort
());
}
}
if
(
pjsip_regc_init
(
regc
,
&
pjSrv
,
&
pjFrom
,
&
pjFrom
,
1
,
&
pjContact
,
account
->
getRegistrationExpire
())
!=
PJ_SUCCESS
)
...
...
@@ -1617,7 +1620,6 @@ void registration_cb(pjsip_regc_cbparam *param)
if
(
param
->
status
!=
PJ_SUCCESS
)
{
account
->
setRegistrationState
(
ErrorAuth
);
account
->
setRegister
(
false
);
SIPVoIPLink
::
instance
()
->
sipTransport
.
shutdownSipTransport
(
*
account
);
return
;
}
...
...
@@ -1633,28 +1635,32 @@ void registration_cb(pjsip_regc_cbparam *param)
case
PJSIP_SC_SERVICE_UNAVAILABLE
:
case
PJSIP_SC_REQUEST_TIMEOUT
:
account
->
setRegistrationState
(
ErrorHost
);
account
->
setRegister
(
false
);
SIPVoIPLink
::
instance
()
->
sipTransport
.
shutdownSipTransport
(
*
account
);
break
;
case
PJSIP_SC_UNAUTHORIZED
:
case
PJSIP_SC_FORBIDDEN
:
case
PJSIP_SC_NOT_FOUND
:
account
->
setRegistrationState
(
ErrorAuth
);
account
->
setRegister
(
false
);
SIPVoIPLink
::
instance
()
->
sipTransport
.
shutdownSipTransport
(
*
account
);
break
;
case
PJSIP_SC_INTERVAL_TOO_BRIEF
:
// Expiration Interval Too Brief
account
->
doubleRegistrationExpire
();
account
->
registerVoIPLink
();
account
->
setRegister
(
false
);
SIPVoIPLink
::
instance
()
->
sipTransport
.
shutdownSipTransport
(
*
account
);
break
;
default:
account
->
setRegistrationState
(
Error
);
break
;
}
account
->
setRegister
(
false
);
SIPVoIPLink
::
instance
()
->
sipTransport
.
shutdownSipTransport
(
*
account
);
break
;
}
}
else
{
if
(
account
->
isRegistered
())
...
...
Write
Preview
Supports
Markdown
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