]> git.ipfire.org Git - thirdparty/asterisk.git/commit
Add PJSIP_HEADER function for manipulation of SIP headers in the PJSIP stack
authorMatthew Jordan <mjordan@digium.com>
Tue, 8 Oct 2013 22:58:04 +0000 (22:58 +0000)
committerMatthew Jordan <mjordan@digium.com>
Tue, 8 Oct 2013 22:58:04 +0000 (22:58 +0000)
commitf440c14a37b51a3e49feb1bbfd5794c30dc0c177
tree6d5767bd92168af56894d4e3045b2a908dc128e2
parentb919e0a72cbce3453a6627c13fa24f2e42f12776
Add PJSIP_HEADER function for manipulation of SIP headers in the PJSIP stack

This patch adds support to the PJSIP stack in Asterisk for SIP header
manipulation. Note that this is analagous to SIPAddHeader/SIPRemoveHeader.

For PJSIP_HEADER, an incoming supplemental session callback is registered that
takes the pjsip_hdrs from the incoming session and stores them in a linked
list in the session datastore.  Calls to PJSIP_HEADER traverse over the list
and return the nth matching header where 'n' is the 'number' argument to the
function.

When adding a header, the first call creates a datastore and linked list and
adds the datastore to the session.  The header is then created as a pjsip_hdr
and added to the list.  An outgoing supplemental session callback then
traverses the list and adds the headers to the outgoing pjsip_msg.

When removing a header, the list created with PJSIP_HEADER(add,...) is
traversed and all matching entries are removed.

(closes issue ASTERISK-22498)
Reported by: George Joseph
patch:
  res_pjsip_header_funcs_v1.patch uploaded by george.joseph (License 6322)

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@400771 65c4cc65-6c06-0410-ace0-fbb531ad65f3
res/res_pjsip_header_funcs.c [new file with mode: 0644]