Skip to content

Commit

Permalink
remove pjmedia_sdp_attr_get_label function
Browse files Browse the repository at this point in the history
  • Loading branch information
sorooshm78 committed Dec 12, 2024
1 parent 9a46400 commit 098d22a
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 27 deletions.
10 changes: 0 additions & 10 deletions pjsip/include/pjsip-ua/sip_siprec.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,6 @@ PJ_BEGIN_DECL
PJ_DECL(pj_status_t) pjsip_siprec_init_module(pjsip_endpoint *endpt);


/**
* Create a=label attribute.
*
* @param media The SDP media.
*
* @return SDP label attribute.
*/
PJ_DECL(pjmedia_sdp_attr*) pjmedia_sdp_attr_get_label(pjmedia_sdp_media *sdp_media);


/**
* Check if the value of Require header is equal to siprec.
*
Expand Down
13 changes: 1 addition & 12 deletions pjsip/src/pjsip-ua/sip_siprec.c
Original file line number Diff line number Diff line change
Expand Up @@ -56,24 +56,13 @@ PJ_DEF(pj_status_t) pjsip_siprec_init_module(pjsip_endpoint *endpt)
}


/**
* Returns the label attribute in the SDP offer
*/
PJ_DEF(pjmedia_sdp_attr*) pjmedia_sdp_attr_get_label(pjmedia_sdp_media *sdp_media)
{
pjmedia_sdp_attr *attr;
attr = pjmedia_sdp_media_find_attr(sdp_media, &STR_LABEL, NULL);
return attr;
}


/**
* Checks if there is an attribute label for each media in the SDP.
*/
PJ_DEF(pj_status_t) pjsip_siprec_verify_sdp_attr_label(pjmedia_sdp_session *sdp)
{
for (unsigned mi=0; mi<sdp->media_count; ++mi) {
if(!pjmedia_sdp_attr_get_label(sdp->media[mi]))
if(!pjmedia_sdp_media_find_attr(sdp->media[mi], &STR_LABEL, NULL))
return PJ_FALSE;
}
return PJ_TRUE;
Expand Down
10 changes: 5 additions & 5 deletions pjsip/src/pjsua-lib/pjsua_media.c
Original file line number Diff line number Diff line change
Expand Up @@ -3002,11 +3002,11 @@ pj_status_t pjsua_media_channel_create_sdp(pjsua_call_id call_id,
}

/* Check if request supports PJSIP_INV_REQUIRE_SIPREC. If so
* Get label attribute in SDP offer and add label attribute to SDP answer
*/
if (call->inv){
if(call->inv->options & PJSIP_INV_REQUIRE_SIPREC)
m->attr[m->attr_count++] = pjmedia_sdp_attr_get_label(rem_sdp->media[mi]);
* Get label attribute in SDP offer and add label attribute to SDP answer
*/
if (call->inv && (call->inv->options & PJSIP_INV_REQUIRE_SIPREC)) {
const pj_str_t STR_LABEL_ATTR = {"label", 5};
m->attr[m->attr_count++] = pjmedia_sdp_media_find_attr(rem_sdp->media[mi], &STR_LABEL_ATTR, NULL);
}

/* Add ssrc and cname attribute */
Expand Down

0 comments on commit 098d22a

Please sign in to comment.