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
c0ae25bb
Commit
c0ae25bb
authored
15 years ago
by
Alexandre Savard
Browse files
Options
Downloads
Patches
Plain Diff
[#2522] Add basic SRTP attribute in sdp
parent
25332552
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
sflphone-common/src/sip/sdp.cpp
+33
-0
33 additions, 0 deletions
sflphone-common/src/sip/sdp.cpp
sflphone-common/src/sip/sdp.h
+8
-0
8 additions, 0 deletions
sflphone-common/src/sip/sdp.h
with
41 additions
and
0 deletions
sflphone-common/src/sip/sdp.cpp
+
33
−
0
View file @
c0ae25bb
...
...
@@ -130,6 +130,8 @@ void Sdp::set_media_descriptor_line (sdpMedia *media, pjmedia_sdp_media** p_med)
_debug
(
"No hash specified"
);
}
// sdp_add_srtp_attribute (med);
*
p_med
=
med
;
}
...
...
@@ -360,6 +362,37 @@ void Sdp::sdp_add_media_description()
}
}
void
Sdp
::
sdp_add_srtp_attribute
(
pjmedia_sdp_media
*
media
)
{
char
tempbuf
[
256
];
std
::
string
crypto_suite
=
"AES_CM_128_HMAC_SHA1_32"
;
std
::
string
application
=
"srtp"
;
std
::
string
key
=
"inline:16/14/NzB4d1BINUAvLEw6UzF3WSJ+PSdFcGdUJShpX1Zj/2^20/1:32"
;
pjmedia_sdp_attr
*
attribute
=
(
pjmedia_sdp_attr
*
)
pj_pool_zalloc
(
_pool
,
sizeof
(
pjmedia_sdp_attr
));
attribute
->
name
=
pj_strdup3
(
_pool
,
"crypto"
);
int
len
=
pj_ansi_snprintf
(
tempbuf
,
sizeof
(
tempbuf
),
"%.*s %.*s %.*s"
,
(
int
)
crypto_suite
.
size
(),
crypto_suite
.
c_str
(),
(
int
)
application
.
size
(),
application
.
c_str
(),
(
int
)
key
.
size
(),
key
.
c_str
());
attribute
->
value
.
slen
=
len
;
attribute
->
value
.
ptr
=
(
char
*
)
pj_pool_alloc
(
_pool
,
attribute
->
value
.
slen
+
1
);
pj_memcpy
(
attribute
->
value
.
ptr
,
tempbuf
,
attribute
->
value
.
slen
+
1
);
if
(
pjmedia_sdp_media_add_attr
(
media
,
attribute
)
!=
PJ_SUCCESS
)
{
throw
sdpException
();
}
}
void
Sdp
::
sdp_add_zrtp_attribute
(
pjmedia_sdp_media
*
media
,
std
::
string
hash
)
{
pjmedia_sdp_attr
*
attribute
;
...
...
This diff is collapsed.
Click to expand it.
sflphone-common/src/sip/sdp.h
+
8
−
0
View file @
c0ae25bb
...
...
@@ -336,6 +336,14 @@ class Sdp {
void
get_remote_sdp_media_from_offer
(
const
pjmedia_sdp_session
*
r_sdp
,
pjmedia_sdp_media
**
r_media
);
/*
* Adds a srtp attribute to the given media section.
*
* @param media The media to add the srtp attribute to
*/
void
sdp_add_srtp_attribute
(
pjmedia_sdp_media
*
media
);
/*
* Adds a zrtp-hash attribute to
* the given media section. The hello hash is
...
...
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