Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
A
asterisk
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Voice
asterisk
Commits
61b6d9ef
Commit
61b6d9ef
authored
6 years ago
by
George Joseph
Committed by
Gerrit Code Review
6 years ago
Browse files
Options
Downloads
Plain Diff
Merge "res_pjsip_caller_id: Add "party" parameter to RPID header."
parents
9241b112
fca3d4fe
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
res/res_pjsip_caller_id.c
+29
-0
29 additions, 0 deletions
res/res_pjsip_caller_id.c
with
29 additions
and
0 deletions
res/res_pjsip_caller_id.c
+
29
−
0
View file @
61b6d9ef
...
...
@@ -542,6 +542,33 @@ static void add_pai_header(const struct ast_sip_session *session, pjsip_tx_data
pjsip_msg_add_hdr
(
tdata
->
msg
,
(
pjsip_hdr
*
)
pai_hdr
);
}
/*!
* \internal
* \brief Add party parameter to a Remote-Party-ID header.
*
* \param tdata The message where the Remote-Party-ID header is
* \param hdr The header on which the parameters are being added
* \param session The session involved
*/
static
void
add_party_param
(
pjsip_tx_data
*
tdata
,
pjsip_fromto_hdr
*
hdr
,
const
struct
ast_sip_session
*
session
)
{
static
const
pj_str_t
party_str
=
{
"party"
,
5
};
static
const
pj_str_t
calling_str
=
{
"calling"
,
7
};
static
const
pj_str_t
called_str
=
{
"called"
,
6
};
pjsip_param
*
party
;
/* The party value can't change throughout the lifetime, so it is set only once */
party
=
pjsip_param_find
(
&
hdr
->
other_param
,
&
party_str
);
if
(
party
)
{
return
;
}
party
=
PJ_POOL_ALLOC_T
(
tdata
->
pool
,
pjsip_param
);
party
->
name
=
party_str
;
party
->
value
=
(
session
->
inv_session
->
role
==
PJSIP_ROLE_UAC
)
?
calling_str
:
called_str
;
pj_list_insert_before
(
&
hdr
->
other_param
,
party
);
}
/*!
* \internal
* \brief Add privacy and screen parameters to a Remote-Party-ID header.
...
...
@@ -631,6 +658,7 @@ static void add_rpid_header(const struct ast_sip_session *session, pjsip_tx_data
pj_list_erase
(
old_rpid
);
}
else
{
ast_sip_modify_id_header
(
tdata
->
pool
,
old_rpid
,
id
);
add_party_param
(
tdata
,
old_rpid
,
session
);
add_privacy_params
(
tdata
,
old_rpid
,
id
);
return
;
}
...
...
@@ -646,6 +674,7 @@ static void add_rpid_header(const struct ast_sip_session *session, pjsip_tx_data
if
(
!
rpid_hdr
)
{
return
;
}
add_party_param
(
tdata
,
rpid_hdr
,
session
);
add_privacy_params
(
tdata
,
rpid_hdr
,
id
);
pjsip_msg_add_hdr
(
tdata
->
msg
,
(
pjsip_hdr
*
)
rpid_hdr
);
}
...
...
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