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
b7d8dd44
Commit
b7d8dd44
authored
15 years ago
by
Alexandre Savard
Browse files
Options
Downloads
Patches
Plain Diff
[#2522] Add crypto attribute as session attribute, not media
parent
d815147b
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
sflphone-common/src/sip/sdp.cpp
+27
-12
27 additions, 12 deletions
sflphone-common/src/sip/sdp.cpp
sflphone-common/src/sip/sdp.h
+2
-2
2 additions, 2 deletions
sflphone-common/src/sip/sdp.h
with
29 additions
and
14 deletions
sflphone-common/src/sip/sdp.cpp
+
27
−
12
View file @
b7d8dd44
...
@@ -32,6 +32,7 @@ static const pj_str_t STR_RTP_AVP = { (char*) "RTP/AVP", 7 };
...
@@ -32,6 +32,7 @@ static const pj_str_t STR_RTP_AVP = { (char*) "RTP/AVP", 7 };
static
const
pj_str_t
STR_SDP_NAME
=
{
(
char
*
)
"sflphone"
,
8
};
static
const
pj_str_t
STR_SDP_NAME
=
{
(
char
*
)
"sflphone"
,
8
};
static
const
pj_str_t
STR_SENDRECV
=
{
(
char
*
)
"sendrecv"
,
8
};
static
const
pj_str_t
STR_SENDRECV
=
{
(
char
*
)
"sendrecv"
,
8
};
static
const
pj_str_t
STR_RTPMAP
=
{
(
char
*
)
"rtpmap"
,
6
};
static
const
pj_str_t
STR_RTPMAP
=
{
(
char
*
)
"rtpmap"
,
6
};
static
const
pj_str_t
STR_CRYPTO
=
{
(
char
*
)
"crypto"
,
6
};
Sdp
::
Sdp
(
pj_pool_t
*
pool
)
Sdp
::
Sdp
(
pj_pool_t
*
pool
)
...
@@ -131,8 +132,6 @@ void Sdp::set_media_descriptor_line (sdpMedia *media, pjmedia_sdp_media** p_med)
...
@@ -131,8 +132,6 @@ void Sdp::set_media_descriptor_line (sdpMedia *media, pjmedia_sdp_media** p_med)
_debug
(
"No hash specified"
);
_debug
(
"No hash specified"
);
}
}
sdp_add_sdes_attribute
(
med
);
*
p_med
=
med
;
*
p_med
=
med
;
}
}
...
@@ -159,6 +158,8 @@ int Sdp::create_local_offer ()
...
@@ -159,6 +158,8 @@ int Sdp::create_local_offer ()
//sdp_addAttributes( _pool );
//sdp_addAttributes( _pool );
sdp_add_media_description
();
sdp_add_media_description
();
sdp_add_sdes_attribute
();
//toString ();
//toString ();
// Validate the sdp session
// Validate the sdp session
...
@@ -364,7 +365,7 @@ void Sdp::sdp_add_media_description()
...
@@ -364,7 +365,7 @@ void Sdp::sdp_add_media_description()
}
}
void
Sdp
::
sdp_add_sdes_attribute
(
pjmedia_sdp_media
*
media
)
void
Sdp
::
sdp_add_sdes_attribute
()
{
{
char
tempbuf
[
256
];
char
tempbuf
[
256
];
...
@@ -388,7 +389,7 @@ void Sdp::sdp_add_sdes_attribute (pjmedia_sdp_media* media)
...
@@ -388,7 +389,7 @@ void Sdp::sdp_add_sdes_attribute (pjmedia_sdp_media* media)
attribute
->
value
.
ptr
=
(
char
*
)
pj_pool_alloc
(
_pool
,
attribute
->
value
.
slen
+
1
);
attribute
->
value
.
ptr
=
(
char
*
)
pj_pool_alloc
(
_pool
,
attribute
->
value
.
slen
+
1
);
pj_memcpy
(
attribute
->
value
.
ptr
,
tempbuf
,
attribute
->
value
.
slen
+
1
);
pj_memcpy
(
attribute
->
value
.
ptr
,
tempbuf
,
attribute
->
value
.
slen
+
1
);
if
(
pjmedia_sdp_
media_add_attr
(
media
,
attribute
)
!=
PJ_SUCCESS
)
{
if
(
pjmedia_sdp_
attr_add
(
&
(
_local_offer
->
attr_count
),
_local_offer
->
attr
,
attribute
)
!=
PJ_SUCCESS
){
throw
sdpException
();
throw
sdpException
();
}
}
...
@@ -644,7 +645,7 @@ void Sdp::set_media_transport_info_from_remote_sdp (const pjmedia_sdp_session *r
...
@@ -644,7 +645,7 @@ void Sdp::set_media_transport_info_from_remote_sdp (const pjmedia_sdp_session *r
this
->
get_remote_sdp_media_from_offer
(
remote_sdp
,
&
r_media
);
this
->
get_remote_sdp_media_from_offer
(
remote_sdp
,
&
r_media
);
//
this->get_remote_sdp_crypto_from_offer(
)
this
->
get_remote_sdp_crypto_from_offer
(
remote_sdp
,
&
attribute
);
if
(
r_media
==
NULL
)
{
if
(
r_media
==
NULL
)
{
_debug
(
"SDP Failure: no remote sdp media found in the remote offer"
);
_debug
(
"SDP Failure: no remote sdp media found in the remote offer"
);
...
@@ -671,18 +672,32 @@ void Sdp::get_remote_sdp_media_from_offer (const pjmedia_sdp_session* remote_sdp
...
@@ -671,18 +672,32 @@ void Sdp::get_remote_sdp_media_from_offer (const pjmedia_sdp_session* remote_sdp
}
}
}
}
void
Sdp
::
get_remote_sdp_crypto_from_offer
(
const
pjmedia_sdp_session
*
remote_sdp
,
pjmedia_sdp_
media
**
r_crypto
)
void
Sdp
::
get_remote_sdp_crypto_from_offer
(
const
pjmedia_sdp_session
*
remote_sdp
,
pjmedia_sdp_
attr
**
r_crypto
)
{
{
int
count
,
i
;
count
=
remote_sdp
->
media_count
;
int
i
;
int
attr_count
;
// pjmedia_sdp_attr * attribute;
*
r_crypto
=
NULL
;
*
r_crypto
=
NULL
;
for
(
i
=
0
;
i
<
count
;
++
i
)
{
attr_count
=
remote_sdp
->
attr_count
;
if
(
pj_stricmp2
(
&
remote_sdp
->
media
[
i
]
->
desc
.
media
,
"crypto"
)
==
0
)
{
*
r_crypto
=
remote_sdp
->
media
[
i
];
// *r_crypto= pjmedia_sdp_media_find_attr(attribute, &STR_CRYPTO, NULL);
_debug
(
"****************** Parse for Crypto %i ********************"
,
attr_count
);
_debug
(
"****************** Parse for Media %i ********************"
,
attr_count
);
for
(
i
=
0
;
i
<
attr_count
;
++
i
)
{
_debug
(
"%.*s"
,
(
int
)
remote_sdp
->
attr
[
i
]
->
name
.
slen
,
remote_sdp
->
attr
[
i
]
->
name
.
ptr
);
if
(
pj_stricmp2
(
&
remote_sdp
->
attr
[
i
]
->
name
,
"crypto"
)
==
0
)
{
_debug
(
"****************** Found a Crypto ********************"
);
*
r_crypto
=
remote_sdp
->
attr
[
i
];
return
;
return
;
}
}
}
}
_debug
(
"****************** Did not Found any Crypto ********************"
);
}
}
This diff is collapsed.
Click to expand it.
sflphone-common/src/sip/sdp.h
+
2
−
2
View file @
b7d8dd44
...
@@ -336,7 +336,7 @@ class Sdp {
...
@@ -336,7 +336,7 @@ class Sdp {
void
get_remote_sdp_media_from_offer
(
const
pjmedia_sdp_session
*
r_sdp
,
pjmedia_sdp_media
**
r_media
);
void
get_remote_sdp_media_from_offer
(
const
pjmedia_sdp_session
*
r_sdp
,
pjmedia_sdp_media
**
r_media
);
void
get_remote_sdp_crypto_from_offer
(
const
pjmedia_sdp_session
*
remote_sdp
,
pjmedia_sdp_
media
**
r_crypto
);
void
get_remote_sdp_crypto_from_offer
(
const
pjmedia_sdp_session
*
remote_sdp
,
pjmedia_sdp_
attr
**
r_crypto
);
/*
/*
...
@@ -344,7 +344,7 @@ class Sdp {
...
@@ -344,7 +344,7 @@ class Sdp {
*
*
* @param media The media to add the srtp attribute to
* @param media The media to add the srtp attribute to
*/
*/
void
sdp_add_sdes_attribute
(
pjmedia_sdp_media
*
media
);
void
sdp_add_sdes_attribute
();
/*
/*
* Adds a zrtp-hash attribute to
* Adds a zrtp-hash attribute to
...
...
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