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
2e9b206f
Commit
2e9b206f
authored
13 years ago
by
Alexandre Savard
Browse files
Options
Downloads
Patches
Plain Diff
#3674: Add contact option in configuration
parent
abebe234
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
daemon/src/sip/sipaccount.cpp
+4
-0
4 additions, 0 deletions
daemon/src/sip/sipaccount.cpp
daemon/src/sip/sipaccount.h
+1
-0
1 addition, 0 deletions
daemon/src/sip/sipaccount.h
daemon/src/sip/sipvoiplink.cpp
+1
-8
1 addition, 8 deletions
daemon/src/sip/sipvoiplink.cpp
with
6 additions
and
8 deletions
daemon/src/sip/sipaccount.cpp
+
4
−
0
View file @
2e9b206f
...
...
@@ -119,6 +119,7 @@ void SIPAccount::serialize(Conf::YamlEmitter *emitter)
portstr
<<
localPort_
;
ScalarNode
port
(
portstr
.
str
());
ScalarNode
serviceRoute
(
serviceRoute_
);
ScalarNode
contactUpdateEnabled
(
contactUpdateEnabled_
);
ScalarNode
mailbox
(
mailBox_
);
ScalarNode
publishAddr
(
publishedIpAddress_
);
...
...
@@ -179,6 +180,7 @@ void SIPAccount::serialize(Conf::YamlEmitter *emitter)
accountmap
.
setKeyValue
(
publishPortKey
,
&
publishPort
);
accountmap
.
setKeyValue
(
sameasLocalKey
,
&
sameasLocal
);
accountmap
.
setKeyValue
(
serviceRouteKey
,
&
serviceRoute
);
accountmap
.
setKeyValue
(
updateContactHeaderKey
,
&
contactUpdateEnabled
);
accountmap
.
setKeyValue
(
dtmfTypeKey
,
&
dtmfType
);
accountmap
.
setKeyValue
(
displayNameKey
,
&
displayName
);
accountmap
.
setKeyValue
(
codecsKey
,
&
codecs
);
...
...
@@ -281,6 +283,8 @@ void SIPAccount::unserialize(Conf::MappingNode *map)
dtmfType_
=
dtmfType
;
map
->
getValue
(
serviceRouteKey
,
&
serviceRoute_
);
map
->
getValue
(
updateContactHeaderKey
,
&
contactUpdateEnabled_
);
// stun enabled
map
->
getValue
(
stunEnabledKey
,
&
stunEnabled_
);
map
->
getValue
(
stunServerKey
,
&
stunServer_
);
...
...
This diff is collapsed.
Click to expand it.
daemon/src/sip/sipaccount.h
+
1
−
0
View file @
2e9b206f
...
...
@@ -55,6 +55,7 @@ namespace Conf {
const
char
*
const
sameasLocalKey
=
"sameasLocal"
;
const
char
*
const
dtmfTypeKey
=
"dtmfType"
;
const
char
*
const
serviceRouteKey
=
"serviceRoute"
;
const
char
*
const
updateContactHeaderKey
=
"updateContact"
;
// TODO: write an object to store credential which implement serializable
const
char
*
const
srtpKey
=
"srtp"
;
...
...
This diff is collapsed.
Click to expand it.
daemon/src/sip/sipvoiplink.cpp
+
1
−
8
View file @
2e9b206f
...
...
@@ -1657,29 +1657,25 @@ static void update_contact_header(struct pjsip_regc_cbparam *param, SIPAccount *
ss
<<
uri
->
port
;
std
::
string
recvContactPort
=
ss
.
str
();
DEBUG
(
"SIPVoIPLink: Current contact header %s:%s"
,
recvContactHost
.
c_str
(),
recvContactPort
.
c_str
());
std
::
string
currentAddress
,
currentPort
;
siplink
->
findLocalAddressFromTransport
(
account
->
transport_
,
PJSIP_TRANSPORT_UDP
,
currentAddress
,
currentPort
);
DEBUG
(
"SIPVoIPLink: Current contact header %s:%s
\n
"
,
currentAddress
.
c_str
(),
currentPort
.
c_str
());
// DEBUG("Received contact header %s",
bool
updateContact
=
false
;
std
::
string
currentContactHeader
=
account
->
getContactHeader
();
size_t
foundHost
=
currentContactHeader
.
find
(
recvContactHost
);
if
(
foundHost
==
std
::
string
::
npos
)
{
DEBUG
(
"SIPVoIPLink: Host %s not in current contact header
\n
"
,
recvContactHost
.
c_str
());
updateContact
=
true
;
}
size_t
foundPort
=
currentContactHeader
.
find
(
recvContactPort
);
if
(
foundPort
==
std
::
string
::
npos
)
{
DEBUG
(
"SIPVoIPLink: Port %s not in current contact header
\n
"
,
recvContactPort
.
c_str
());
updateContact
=
true
;
}
if
(
updateContact
)
{
DEBUG
(
"SIPVoIPLink: Update contact header: %s:%s
\n
"
,
recvContactHost
.
c_str
(),
recvContactPort
.
c_str
());
account
->
setContactHeader
(
recvContactHost
,
recvContactPort
);
siplink
->
sendRegister
(
account
);
}
...
...
@@ -1691,8 +1687,6 @@ void registration_cb(struct pjsip_regc_cbparam *param)
{
SIPAccount
*
account
=
static_cast
<
SIPAccount
*>
(
param
->
token
);
ERROR
(
"SipVoipLink: REGISTRATION CALLBACK"
);
if
(
account
==
NULL
)
{
ERROR
(
"SipVoipLink: account does'nt exist in registration callback"
);
return
;
...
...
@@ -1703,7 +1697,6 @@ void registration_cb(struct pjsip_regc_cbparam *param)
return
;
}
DEBUG
(
"SipVoipLink: Contact header from UAS, %d contact(s)"
,
param
->
contact_cnt
);
if
(
account
->
isContactUpdateEnabled
())
{
update_contact_header
(
param
,
account
);
}
...
...
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