Asterisk - The Open Source Telephony Project  18.5.0
Macros | Functions | Variables
res_pjsip_caller_id.c File Reference
#include "asterisk.h"
#include <pjsip.h>
#include <pjsip_ua.h>
#include "asterisk/res_pjsip.h"
#include "asterisk/res_pjsip_session.h"
#include "asterisk/channel.h"
#include "asterisk/module.h"
#include "asterisk/callerid.h"
#include "asterisk/conversions.h"
Include dependency graph for res_pjsip_caller_id.c:

Go to the source code of this file.

Macros

#define MAX_OLI_DIGITS   2
 

Functions

static void __reg_module (void)
 
static void __unreg_module (void)
 
static void add_id_headers (const struct ast_sip_session *session, pjsip_tx_data *tdata, const struct ast_party_id *id)
 
static void add_pai_header (const struct ast_sip_session *session, pjsip_tx_data *tdata, const struct ast_party_id *id)
 
static void add_party_param (pjsip_tx_data *tdata, pjsip_fromto_hdr *hdr, const struct ast_sip_session *session)
 
static void add_privacy_header (pjsip_tx_data *tdata, const struct ast_party_id *id)
 
static void add_privacy_params (pjsip_tx_data *tdata, pjsip_fromto_hdr *hdr, const struct ast_party_id *id)
 
static void add_rpid_header (const struct ast_sip_session *session, pjsip_tx_data *tdata, const struct ast_party_id *id)
 
struct ast_moduleAST_MODULE_SELF_SYM (void)
 
static int caller_id_incoming_request (struct ast_sip_session *session, pjsip_rx_data *rdata)
 
static void caller_id_incoming_response (struct ast_sip_session *session, pjsip_rx_data *rdata)
 
static void caller_id_outgoing_request (struct ast_sip_session *session, pjsip_tx_data *tdata)
 
static void caller_id_outgoing_response (struct ast_sip_session *session, pjsip_tx_data *tdata)
 
static pjsip_fromto_hdr * create_new_id_hdr (const pj_str_t *hdr_name, pjsip_fromto_hdr *base, pjsip_tx_data *tdata, const struct ast_party_id *id)
 
static pjsip_fromto_hdr * get_id_header (pjsip_rx_data *rdata, const pj_str_t *header_name)
 
static int load_module (void)
 
static void queue_connected_line_update (struct ast_sip_session *session, const struct ast_party_id *id)
 
static int set_id_from_from (struct pjsip_rx_data *rdata, struct ast_party_id *id)
 
static void set_id_from_hdr (pjsip_fromto_hdr *hdr, struct ast_party_id *id)
 
static int set_id_from_oli (pjsip_rx_data *rdata, int *ani2)
 
static int set_id_from_pai (pjsip_rx_data *rdata, struct ast_party_id *id)
 
static int set_id_from_rpid (pjsip_rx_data *rdata, struct ast_party_id *id)
 
static int should_queue_connected_line_update (const struct ast_sip_session *session, const struct ast_party_id *id)
 
static int unload_module (void)
 
static void update_incoming_connected_line (struct ast_sip_session *session, pjsip_rx_data *rdata)
 

Variables

static struct ast_module_info __mod_info = { .name = AST_MODULE, .flags = AST_MODFLAG_LOAD_ORDER , .description = "PJSIP Caller ID Support" , .key = "This paragraph is copyright (c) 2006 by Digium, Inc. \In order for your module to load, it must return this \key via a function called \"key\". Any code which \includes this paragraph must be licensed under the GNU \General Public License version 2 or later (at your \option). In addition to Digium's general reservations \of rights, Digium expressly reserves the right to \allow other parties to license this paragraph under \different terms. Any use of Digium, Inc. trademarks or \logos (including \"Asterisk\" or \"Digium\") without \express written permission of Digium, Inc. is prohibited.\n" , .buildopt_sum = "30ef0c93b36035ec78c9cfd712d36d9b" , .support_level = AST_MODULE_SUPPORT_CORE, .load = load_module, .unload = unload_module, .load_pri = AST_MODPRI_APP_DEPEND, .requires = "res_pjsip,res_pjsip_session", }
 
static const struct ast_module_infoast_module_info = &__mod_info
 
static struct ast_sip_session_supplement caller_id_supplement
 

Macro Definition Documentation

◆ MAX_OLI_DIGITS

#define MAX_OLI_DIGITS   2

Referenced by set_id_from_oli().

Function Documentation

◆ __reg_module()

static void __reg_module ( void  )
static

Definition at line 861 of file res_pjsip_caller_id.c.

◆ __unreg_module()

static void __unreg_module ( void  )
static

Definition at line 861 of file res_pjsip_caller_id.c.

◆ add_id_headers()

static void add_id_headers ( const struct ast_sip_session session,
pjsip_tx_data *  tdata,
const struct ast_party_id id 
)
static

Definition at line 756 of file res_pjsip_caller_id.c.

References add_pai_header(), add_rpid_header(), ast_party_id_presentation(), AST_PRES_ALLOWED, AST_PRES_RESTRICTION, ast_sip_session::endpoint, ast_sip_endpoint::id, ast_party_id::number, ast_sip_endpoint_id_configuration::send_pai, ast_sip_endpoint_id_configuration::send_rpid, ast_sip_endpoint_id_configuration::trust_outbound, and ast_party_number::valid.

Referenced by caller_id_outgoing_request(), and caller_id_outgoing_response().

757 {
758  if (!id->number.valid
759  || (!session->endpoint->id.trust_outbound
761  return;
762  }
763  if (session->endpoint->id.send_pai) {
764  add_pai_header(session, tdata, id);
765  }
766  if (session->endpoint->id.send_rpid) {
767  add_rpid_header(session, tdata, id);
768  }
769 }
struct ast_sip_endpoint * endpoint
int ast_party_id_presentation(const struct ast_party_id *id)
Determine the overall presentation value for the given party.
Definition: channel.c:1821
struct ast_sip_endpoint_id_configuration id
Definition: res_pjsip.h:847
#define AST_PRES_RESTRICTION
Definition: callerid.h:323
#define AST_PRES_ALLOWED
Definition: callerid.h:324
static void add_rpid_header(const struct ast_sip_session *session, pjsip_tx_data *tdata, const struct ast_party_id *id)
unsigned char valid
TRUE if the number information is valid/present.
Definition: channel.h:298
static void add_pai_header(const struct ast_sip_session *session, pjsip_tx_data *tdata, const struct ast_party_id *id)
struct ast_party_number number
Subscriber phone number.
Definition: channel.h:343

◆ add_pai_header()

static void add_pai_header ( const struct ast_sip_session session,
pjsip_tx_data *  tdata,
const struct ast_party_id id 
)
static

Definition at line 563 of file res_pjsip_caller_id.c.

References add_privacy_header(), ast_sip_modify_id_header(), create_new_id_hdr(), NULL, and ast_sip_session::saved_from_hdr.

Referenced by add_id_headers().

564 {
565  static const pj_str_t pj_pai_name = { "P-Asserted-Identity", 19 };
566  pjsip_fromto_hdr *base;
567  pjsip_fromto_hdr *pai_hdr;
568  pjsip_fromto_hdr *old_pai;
569 
570  /* Since inv_session reuses responses, we have to make sure there's not already
571  * a P-Asserted-Identity present. If there is, we just modify the old one.
572  */
573  old_pai = pjsip_msg_find_hdr_by_name(tdata->msg, &pj_pai_name, NULL);
574  if (old_pai) {
575  /* If type is OTHER, then the existing header was most likely
576  * added by the PJSIP_HEADER dial plan function as a simple
577  * name/value pair. We can't pass this to modify_id_header because
578  * there are no virtual functions to get the uri. We could parse
579  * it into a pjsip_fromto_hdr but it isn't worth it since
580  * modify_id_header is just going to overwrite the name and number
581  * anyway. We'll just remove it from the header list instead
582  * and create a new one.
583  */
584  if (old_pai->type == PJSIP_H_OTHER) {
585  pj_list_erase(old_pai);
586  } else {
587  ast_sip_modify_id_header(tdata->pool, old_pai, id);
588  add_privacy_header(tdata, id);
589  return;
590  }
591  }
592 
593  if (tdata->msg->type == PJSIP_REQUEST_MSG) {
594  base = session->saved_from_hdr ? session->saved_from_hdr : PJSIP_MSG_FROM_HDR(tdata->msg);
595  } else {
596  base = PJSIP_MSG_TO_HDR(tdata->msg);
597  }
598 
599  pai_hdr = create_new_id_hdr(&pj_pai_name, base, tdata, id);
600  if (!pai_hdr) {
601  return;
602  }
603  add_privacy_header(tdata, id);
604 
605  pjsip_msg_add_hdr(tdata->msg, (pjsip_hdr *)pai_hdr);
606 }
static pjsip_fromto_hdr * create_new_id_hdr(const pj_str_t *hdr_name, pjsip_fromto_hdr *base, pjsip_tx_data *tdata, const struct ast_party_id *id)
static void add_privacy_header(pjsip_tx_data *tdata, const struct ast_party_id *id)
#define NULL
Definition: resample.c:96
void ast_sip_modify_id_header(pj_pool_t *pool, pjsip_fromto_hdr *id_hdr, const struct ast_party_id *id)
Set name and number information on an identity header.
Definition: res_pjsip.c:5587
pjsip_fromto_hdr * saved_from_hdr

◆ add_party_param()

static void add_party_param ( pjsip_tx_data *  tdata,
pjsip_fromto_hdr *  hdr,
const struct ast_sip_session session 
)
static

Definition at line 616 of file res_pjsip_caller_id.c.

References ast_sip_session::inv_session.

Referenced by add_rpid_header().

617 {
618  static const pj_str_t party_str = { "party", 5 };
619  static const pj_str_t calling_str = { "calling", 7 };
620  static const pj_str_t called_str = { "called", 6 };
621  pjsip_param *party;
622 
623  /* The party value can't change throughout the lifetime, so it is set only once */
624  party = pjsip_param_find(&hdr->other_param, &party_str);
625  if (party) {
626  return;
627  }
628 
629  party = PJ_POOL_ALLOC_T(tdata->pool, pjsip_param);
630  party->name = party_str;
631  party->value = (session->inv_session->role == PJSIP_ROLE_UAC) ? calling_str : called_str;
632  pj_list_insert_before(&hdr->other_param, party);
633 }
struct pjsip_inv_session * inv_session

◆ add_privacy_header()

static void add_privacy_header ( pjsip_tx_data *  tdata,
const struct ast_party_id id 
)
static

Definition at line 538 of file res_pjsip_caller_id.c.

References ast_party_id_presentation(), AST_PRES_ALLOWED, AST_PRES_RESTRICTION, and NULL.

Referenced by add_pai_header().

539 {
540  static const pj_str_t pj_privacy_name = { "Privacy", 7 };
541  static const pj_str_t pj_privacy_value = { "id", 2 };
542  pjsip_hdr *old_privacy;
543 
544  old_privacy = pjsip_msg_find_hdr_by_name(tdata->msg, &pj_privacy_name, NULL);
545 
547  if (old_privacy) {
548  pj_list_erase(old_privacy);
549  }
550  } else if (!old_privacy) {
551  pjsip_generic_string_hdr *privacy_hdr = pjsip_generic_string_hdr_create(
552  tdata->pool, &pj_privacy_name, &pj_privacy_value);
553  pjsip_msg_add_hdr(tdata->msg, (pjsip_hdr *)privacy_hdr);
554  }
555 }
int ast_party_id_presentation(const struct ast_party_id *id)
Determine the overall presentation value for the given party.
Definition: channel.c:1821
#define NULL
Definition: resample.c:96
#define AST_PRES_RESTRICTION
Definition: callerid.h:323
#define AST_PRES_ALLOWED
Definition: callerid.h:324

◆ add_privacy_params()

static void add_privacy_params ( pjsip_tx_data *  tdata,
pjsip_fromto_hdr *  hdr,
const struct ast_party_id id 
)
static

Definition at line 647 of file res_pjsip_caller_id.c.

References ast_party_id_presentation(), AST_PRES_ALLOWED, AST_PRES_NUMBER_TYPE, AST_PRES_RESTRICTION, and AST_PRES_USER_NUMBER_PASSED_SCREEN.

Referenced by add_rpid_header().

648 {
649  static const pj_str_t privacy_str = { "privacy", 7 };
650  static const pj_str_t screen_str = { "screen", 6 };
651  static const pj_str_t privacy_full_str = { "full", 4 };
652  static const pj_str_t privacy_off_str = { "off", 3 };
653  static const pj_str_t screen_yes_str = { "yes", 3 };
654  static const pj_str_t screen_no_str = { "no", 2 };
655  pjsip_param *old_privacy;
656  pjsip_param *old_screen;
657  pjsip_param *privacy;
658  pjsip_param *screen;
659  int presentation;
660 
661  old_privacy = pjsip_param_find(&hdr->other_param, &privacy_str);
662  old_screen = pjsip_param_find(&hdr->other_param, &screen_str);
663 
664  if (!old_privacy) {
665  privacy = PJ_POOL_ALLOC_T(tdata->pool, pjsip_param);
666  privacy->name = privacy_str;
667  pj_list_insert_before(&hdr->other_param, privacy);
668  } else {
669  privacy = old_privacy;
670  }
671 
672  if (!old_screen) {
673  screen = PJ_POOL_ALLOC_T(tdata->pool, pjsip_param);
674  screen->name = screen_str;
675  pj_list_insert_before(&hdr->other_param, screen);
676  } else {
677  screen = old_screen;
678  }
679 
680  presentation = ast_party_id_presentation(id);
681  if ((presentation & AST_PRES_RESTRICTION) == AST_PRES_ALLOWED) {
682  privacy->value = privacy_off_str;
683  } else {
684  privacy->value = privacy_full_str;
685  }
687  screen->value = screen_yes_str;
688  } else {
689  screen->value = screen_no_str;
690  }
691 }
int ast_party_id_presentation(const struct ast_party_id *id)
Determine the overall presentation value for the given party.
Definition: channel.c:1821
#define AST_PRES_NUMBER_TYPE
Definition: callerid.h:317
#define AST_PRES_RESTRICTION
Definition: callerid.h:323
#define AST_PRES_USER_NUMBER_PASSED_SCREEN
Definition: callerid.h:319
#define AST_PRES_ALLOWED
Definition: callerid.h:324

◆ add_rpid_header()

static void add_rpid_header ( const struct ast_sip_session session,
pjsip_tx_data *  tdata,
const struct ast_party_id id 
)
static

Definition at line 699 of file res_pjsip_caller_id.c.

References add_party_param(), add_privacy_params(), ast_sip_modify_id_header(), create_new_id_hdr(), NULL, and ast_sip_session::saved_from_hdr.

Referenced by add_id_headers().

700 {
701  static const pj_str_t pj_rpid_name = { "Remote-Party-ID", 15 };
702  pjsip_fromto_hdr *base;
703  pjsip_fromto_hdr *rpid_hdr;
704  pjsip_fromto_hdr *old_rpid;
705 
706  /* Since inv_session reuses responses, we have to make sure there's not already
707  * a P-Asserted-Identity present. If there is, we just modify the old one.
708  */
709  old_rpid = pjsip_msg_find_hdr_by_name(tdata->msg, &pj_rpid_name, NULL);
710  if (old_rpid) {
711  /* If type is OTHER, then the existing header was most likely
712  * added by the PJSIP_HEADER dial plan function as a simple
713  * name/value pair. We can't pass this to modify_id_header because
714  * there are no virtual functions to get the uri. We could parse
715  * it into a pjsip_fromto_hdr but it isn't worth it since
716  * modify_id_header is just going to overwrite the name and number
717  * anyway. We'll just remove it from the header list instead
718  * and create a new one.
719  */
720  if (old_rpid->type == PJSIP_H_OTHER) {
721  pj_list_erase(old_rpid);
722  } else {
723  ast_sip_modify_id_header(tdata->pool, old_rpid, id);
724  add_party_param(tdata, old_rpid, session);
725  add_privacy_params(tdata, old_rpid, id);
726  return;
727  }
728  }
729 
730  if (tdata->msg->type == PJSIP_REQUEST_MSG) {
731  base = session->saved_from_hdr ? session->saved_from_hdr : PJSIP_MSG_FROM_HDR(tdata->msg);
732  } else {
733  base = PJSIP_MSG_TO_HDR(tdata->msg);
734  }
735 
736  rpid_hdr = create_new_id_hdr(&pj_rpid_name, base, tdata, id);
737  if (!rpid_hdr) {
738  return;
739  }
740  add_party_param(tdata, rpid_hdr, session);
741  add_privacy_params(tdata, rpid_hdr, id);
742  pjsip_msg_add_hdr(tdata->msg, (pjsip_hdr *)rpid_hdr);
743 }
static pjsip_fromto_hdr * create_new_id_hdr(const pj_str_t *hdr_name, pjsip_fromto_hdr *base, pjsip_tx_data *tdata, const struct ast_party_id *id)
static void add_privacy_params(pjsip_tx_data *tdata, pjsip_fromto_hdr *hdr, const struct ast_party_id *id)
#define NULL
Definition: resample.c:96
void ast_sip_modify_id_header(pj_pool_t *pool, pjsip_fromto_hdr *id_hdr, const struct ast_party_id *id)
Set name and number information on an identity header.
Definition: res_pjsip.c:5587
pjsip_fromto_hdr * saved_from_hdr
static void add_party_param(pjsip_tx_data *tdata, pjsip_fromto_hdr *hdr, const struct ast_sip_session *session)

◆ AST_MODULE_SELF_SYM()

struct ast_module* AST_MODULE_SELF_SYM ( void  )

Definition at line 861 of file res_pjsip_caller_id.c.

◆ caller_id_incoming_request()

static int caller_id_incoming_request ( struct ast_sip_session session,
pjsip_rx_data *  rdata 
)
static

Definition at line 428 of file res_pjsip_caller_id.c.

References ast_sip_session::ani2, ast_free, ast_party_id_copy(), ast_strdup, ast_sip_session::channel, ast_sip_session::endpoint, ast_sip_session::id, ast_sip_endpoint::id, ast_party_id::number, ast_sip_endpoint_id_configuration::self, set_id_from_from(), set_id_from_oli(), set_id_from_pai(), set_id_from_rpid(), ast_party_id::tag, ast_sip_endpoint_id_configuration::trust_inbound, update_incoming_connected_line(), and ast_party_number::valid.

429 {
430  if (!session->channel) {
431  int ani2;
432  /*
433  * Since we have no channel this must be the initial inbound
434  * INVITE. Set the session ID directly because the channel
435  * has not been created yet.
436  */
437 
438  if (session->endpoint->id.trust_inbound
439  && (!set_id_from_pai(rdata, &session->id)
440  || !set_id_from_rpid(rdata, &session->id))) {
441  ast_free(session->id.tag);
442  session->id.tag = ast_strdup(session->endpoint->id.self.tag);
443  return 0;
444  }
445  ast_party_id_copy(&session->id, &session->endpoint->id.self);
446  if (!session->endpoint->id.self.number.valid) {
447  set_id_from_from(rdata, &session->id);
448  }
449  if (!set_id_from_oli(rdata, &ani2)) {
450  session->ani2 = 0;
451  }
452  } else {
453  /*
454  * ReINVITE or UPDATE. Check for changes to the ID and queue
455  * a connected line update if necessary.
456  */
457  update_incoming_connected_line(session, rdata);
458  }
459  return 0;
460 }
static int set_id_from_oli(pjsip_rx_data *rdata, int *ani2)
struct ast_sip_endpoint * endpoint
static int set_id_from_rpid(pjsip_rx_data *rdata, struct ast_party_id *id)
void ast_party_id_copy(struct ast_party_id *dest, const struct ast_party_id *src)
Copy the source party id information to the destination party id.
Definition: channel.c:1765
#define ast_strdup(str)
A wrapper for strdup()
Definition: astmm.h:243
struct ast_channel * channel
struct ast_sip_endpoint_id_configuration id
Definition: res_pjsip.h:847
static int set_id_from_pai(pjsip_rx_data *rdata, struct ast_party_id *id)
static int set_id_from_from(struct pjsip_rx_data *rdata, struct ast_party_id *id)
static void update_incoming_connected_line(struct ast_sip_session *session, pjsip_rx_data *rdata)
#define ast_free(a)
Definition: astmm.h:182
char * tag
User-set "tag".
Definition: channel.h:355
struct ast_party_id self
Definition: res_pjsip.h:629
struct ast_party_id id
unsigned char valid
TRUE if the number information is valid/present.
Definition: channel.h:298
struct ast_party_number number
Subscriber phone number.
Definition: channel.h:343

◆ caller_id_incoming_response()

static void caller_id_incoming_response ( struct ast_sip_session session,
pjsip_rx_data *  rdata 
)
static

Definition at line 471 of file res_pjsip_caller_id.c.

References ast_sip_session::channel, and update_incoming_connected_line().

472 {
473  if (!session->channel) {
474  return;
475  }
476 
477  update_incoming_connected_line(session, rdata);
478 }
struct ast_channel * channel
static void update_incoming_connected_line(struct ast_sip_session *session, pjsip_rx_data *rdata)

◆ caller_id_outgoing_request()

static void caller_id_outgoing_request ( struct ast_sip_session session,
pjsip_tx_data *  tdata 
)
static

Definition at line 782 of file res_pjsip_caller_id.c.

References add_id_headers(), ast_channel_connected_effective_id(), ast_channel_lock, ast_channel_unlock, ast_party_id_copy(), ast_party_id_free(), ast_party_id_init(), and ast_sip_session::channel.

783 {
784  struct ast_party_id effective_id;
785  struct ast_party_id connected_id;
786 
787  if (!session->channel) {
788  return;
789  }
790 
791  ast_party_id_init(&connected_id);
792  ast_channel_lock(session->channel);
793  effective_id = ast_channel_connected_effective_id(session->channel);
794  ast_party_id_copy(&connected_id, &effective_id);
795  ast_channel_unlock(session->channel);
796 
797  add_id_headers(session, tdata, &connected_id);
798  ast_party_id_free(&connected_id);
799 }
Information needed to identify an endpoint in a call.
Definition: channel.h:339
#define ast_channel_lock(chan)
Definition: channel.h:2945
void ast_party_id_copy(struct ast_party_id *dest, const struct ast_party_id *src)
Copy the source party id information to the destination party id.
Definition: channel.c:1765
static void add_id_headers(const struct ast_sip_session *session, pjsip_tx_data *tdata, const struct ast_party_id *id)
void ast_party_id_free(struct ast_party_id *doomed)
Destroy the party id contents.
Definition: channel.c:1811
struct ast_channel * channel
struct ast_party_id ast_channel_connected_effective_id(struct ast_channel *chan)
#define ast_channel_unlock(chan)
Definition: channel.h:2946
void ast_party_id_init(struct ast_party_id *init)
Initialize the given party id structure.
Definition: channel.c:1757

◆ caller_id_outgoing_response()

static void caller_id_outgoing_response ( struct ast_sip_session session,
pjsip_tx_data *  tdata 
)
static

Definition at line 810 of file res_pjsip_caller_id.c.

References add_id_headers(), ast_channel_connected_effective_id(), ast_channel_lock, ast_channel_unlock, ast_party_id_copy(), ast_party_id_free(), ast_party_id_init(), ast_sip_session::channel, ast_sip_session::endpoint, ast_sip_endpoint::id, ast_sip_session::inv_session, and ast_sip_endpoint_id_configuration::send_connected_line.

811 {
812  struct ast_party_id effective_id;
813  struct ast_party_id connected_id;
814 
815  if (!session->channel
816  || (!session->endpoint->id.send_connected_line
817  && session->inv_session
818  && session->inv_session->state >= PJSIP_INV_STATE_EARLY)) {
819  return;
820  }
821 
822  /* Must do a deep copy unless we hold the channel lock the entire time. */
823  ast_party_id_init(&connected_id);
824  ast_channel_lock(session->channel);
825  effective_id = ast_channel_connected_effective_id(session->channel);
826  ast_party_id_copy(&connected_id, &effective_id);
827  ast_channel_unlock(session->channel);
828 
829  add_id_headers(session, tdata, &connected_id);
830  ast_party_id_free(&connected_id);
831 }
Information needed to identify an endpoint in a call.
Definition: channel.h:339
#define ast_channel_lock(chan)
Definition: channel.h:2945
struct ast_sip_endpoint * endpoint
void ast_party_id_copy(struct ast_party_id *dest, const struct ast_party_id *src)
Copy the source party id information to the destination party id.
Definition: channel.c:1765
static void add_id_headers(const struct ast_sip_session *session, pjsip_tx_data *tdata, const struct ast_party_id *id)
void ast_party_id_free(struct ast_party_id *doomed)
Destroy the party id contents.
Definition: channel.c:1811
struct pjsip_inv_session * inv_session
struct ast_channel * channel
struct ast_sip_endpoint_id_configuration id
Definition: res_pjsip.h:847
struct ast_party_id ast_channel_connected_effective_id(struct ast_channel *chan)
#define ast_channel_unlock(chan)
Definition: channel.h:2946
void ast_party_id_init(struct ast_party_id *init)
Initialize the given party id structure.
Definition: channel.c:1757

◆ create_new_id_hdr()

static pjsip_fromto_hdr* create_new_id_hdr ( const pj_str_t *  hdr_name,
pjsip_fromto_hdr *  base,
pjsip_tx_data *  tdata,
const struct ast_party_id id 
)
static

Definition at line 488 of file res_pjsip_caller_id.c.

References ast_alloca, ast_escape_quoted(), ast_strlen_zero, ast_party_id::name, NULL, ast_party_id::number, ast_party_name::str, ast_party_number::str, ast_party_name::valid, and ast_party_number::valid.

Referenced by add_pai_header(), and add_rpid_header().

489 {
490  pjsip_fromto_hdr *id_hdr;
491  pjsip_name_addr *id_name_addr;
492  pjsip_sip_uri *id_uri;
493 
494  id_hdr = pjsip_from_hdr_create(tdata->pool);
495  id_hdr->type = PJSIP_H_OTHER;
496  id_hdr->sname = id_hdr->name = *hdr_name;
497 
498  id_name_addr = pjsip_uri_clone(tdata->pool, base->uri);
499  id_uri = pjsip_uri_get_uri(id_name_addr->uri);
500 
501  if (id->name.valid && !ast_strlen_zero(id->name.str)) {
502  int name_buf_len = strlen(id->name.str) * 2 + 1;
503  char *name_buf = ast_alloca(name_buf_len);
504 
505  ast_escape_quoted(id->name.str, name_buf, name_buf_len);
506  pj_strdup2(tdata->pool, &id_name_addr->display, name_buf);
507  } else {
508  /*
509  * We need to clear the remnants of the clone or it'll be left set.
510  * pj_strdup2 is safe to call with a NULL src and it resets both slen and ptr.
511  */
512  pj_strdup2(tdata->pool, &id_name_addr->display, NULL);
513  }
514 
515  if (id->number.valid) {
516  pj_strdup2(tdata->pool, &id_uri->user, id->number.str);
517  } else {
518  /* Similar to name, make sure the number is also cleared when invalid */
519  pj_strdup2(tdata->pool, &id_uri->user, NULL);
520  }
521 
522  id_hdr->uri = (pjsip_uri *) id_name_addr;
523  return id_hdr;
524 }
char * str
Subscriber phone number (Malloced)
Definition: channel.h:292
struct ast_party_name name
Subscriber name.
Definition: channel.h:341
char * str
Subscriber name (Malloced)
Definition: channel.h:265
#define NULL
Definition: resample.c:96
#define ast_strlen_zero(foo)
Definition: strings.h:52
#define ast_alloca(size)
call __builtin_alloca to ensure we get gcc builtin semantics
Definition: astmm.h:290
char * ast_escape_quoted(const char *string, char *outbuf, int buflen)
Escape characters found in a quoted string.
Definition: main/utils.c:635
unsigned char valid
TRUE if the name information is valid/present.
Definition: channel.h:280
unsigned char valid
TRUE if the number information is valid/present.
Definition: channel.h:298
struct ast_party_number number
Subscriber phone number.
Definition: channel.h:343

◆ get_id_header()

static pjsip_fromto_hdr* get_id_header ( pjsip_rx_data *  rdata,
const pj_str_t *  header_name 
)
static

Definition at line 98 of file res_pjsip_caller_id.c.

References ast_log, LOG_WARNING, and NULL.

Referenced by set_id_from_oli(), set_id_from_pai(), and set_id_from_rpid().

99 {
100  static const pj_str_t from = { "From", 4 };
101  pj_str_t header_content;
102  pjsip_fromto_hdr *parsed_hdr;
103  pjsip_generic_string_hdr *ident = pjsip_msg_find_hdr_by_name(rdata->msg_info.msg,
104  header_name, NULL);
105  int parsed_len;
106 
107  if (!ident) {
108  return NULL;
109  }
110 
111  ast_log(LOG_WARNING, "Doing checks now\n");
112 
113  if (!(rdata)) {
114  ast_log(LOG_WARNING, "NULL 1\n");
115  }
116  if (!ident) {
117  ast_log(LOG_WARNING, "NULL 3\n");
118  }
119 
120  if (!rdata->tp_info.pool) {
121  ast_log(LOG_WARNING, "NULL 11\n");
122  }
123  if (!&ident->hvalue) {
124  ast_log(LOG_WARNING, "NULL 13\n");
125  }
126 
127  ast_log(LOG_WARNING, "strlens %lu %lu\n", pj_strlen(&header_content), pj_strlen(&ident->hvalue));
128 
129 
130  pj_strdup_with_null(rdata->tp_info.pool, &header_content, &ident->hvalue);
131 
132  parsed_hdr = pjsip_parse_hdr(rdata->tp_info.pool, &from, header_content.ptr,
133  pj_strlen(&header_content), &parsed_len);
134 
135  if (!parsed_hdr) {
136  return NULL;
137  }
138 
139  return parsed_hdr;
140 }
#define LOG_WARNING
Definition: logger.h:274
#define NULL
Definition: resample.c:96
#define ast_log
Definition: astobj2.c:42

◆ load_module()

static int load_module ( void  )
static

Definition at line 842 of file res_pjsip_caller_id.c.

References AST_MODULE_LOAD_SUCCESS, ast_module_shutdown_ref, and ast_sip_session_register_supplement.

Referenced by unload_module().

843 {
844  ast_module_shutdown_ref(AST_MODULE_SELF);
847 }
static struct ast_sip_session_supplement caller_id_supplement
#define ast_module_shutdown_ref(mod)
Prevent unload of the module before shutdown.
Definition: module.h:464
#define ast_sip_session_register_supplement(supplement)

◆ queue_connected_line_update()

static void queue_connected_line_update ( struct ast_sip_session session,
const struct ast_party_id id 
)
static

Definition at line 362 of file res_pjsip_caller_id.c.

References ast_party_caller::ani, ast_party_caller::ani2, ast_channel_caller(), ast_channel_queue_connected_line_update(), ast_channel_set_caller_event(), AST_CONNECTED_LINE_UPDATE_SOURCE_ANSWER, ast_party_caller_init(), ast_party_connected_line_init(), ast_party_id_copy(), ast_sip_session::channel, ast_sip_session::endpoint, ast_sip_session::id, ast_party_caller::id, ast_party_connected_line::id, ast_sip_endpoint::id, id, NULL, ast_sip_endpoint_id_configuration::self, ast_party_connected_line::source, and ast_party_id::tag.

Referenced by update_incoming_connected_line().

363 {
365  struct ast_party_caller caller;
366 
367  /* Fill connected line information */
369  connected.id = *id;
370  connected.id.tag = session->endpoint->id.self.tag;
372 
373  /* Save to channel driver copy */
374  ast_party_id_copy(&session->id, &connected.id);
375 
376  /* Update our channel CALLERID() */
377  ast_party_caller_init(&caller);
378  caller.id = connected.id;
379  caller.ani = connected.id;
380  caller.ani2 = ast_channel_caller(session->channel)->ani2;
381  ast_channel_set_caller_event(session->channel, &caller, NULL);
382 
383  /* Tell peer about the new connected line information. */
385 }
struct ast_party_caller * ast_channel_caller(struct ast_channel *chan)
void ast_party_connected_line_init(struct ast_party_connected_line *init)
Initialize the given connected line structure.
Definition: channel.c:2022
struct ast_sip_endpoint * endpoint
void ast_channel_set_caller_event(struct ast_channel *chan, const struct ast_party_caller *caller, const struct ast_set_party_caller *update)
Set the caller id information in the Asterisk channel and generate an AMI event if the caller id name...
Definition: channel.c:7472
void ast_party_id_copy(struct ast_party_id *dest, const struct ast_party_id *src)
Copy the source party id information to the destination party id.
Definition: channel.c:1765
#define NULL
Definition: resample.c:96
void ast_channel_queue_connected_line_update(struct ast_channel *chan, const struct ast_party_connected_line *connected, const struct ast_set_party_connected_line *update)
Queue a connected line update frame on a channel.
Definition: channel.c:9202
Caller Party information.
Definition: channel.h:419
struct ast_channel * channel
struct ast_sip_endpoint_id_configuration id
Definition: res_pjsip.h:847
int ani2
Automatic Number Identification 2 (Info Digits)
Definition: channel.h:434
Connected Line/Party information.
Definition: channel.h:457
char * tag
User-set "tag".
Definition: channel.h:355
struct ast_party_id self
Definition: res_pjsip.h:629
enum queue_result id
Definition: app_queue.c:1507
void ast_party_caller_init(struct ast_party_caller *init)
Initialize the given caller structure.
Definition: channel.c:1978
char connected
Definition: eagi_proxy.c:82
struct ast_party_id id

◆ set_id_from_from()

static int set_id_from_from ( struct pjsip_rx_data *  rdata,
struct ast_party_id id 
)
static

Definition at line 284 of file res_pjsip_caller_id.c.

References ast_party_id::number, set_id_from_hdr(), and ast_party_number::valid.

Referenced by caller_id_incoming_request().

285 {
286  pjsip_fromto_hdr *from = pjsip_msg_find_hdr(rdata->msg_info.msg,
287  PJSIP_H_FROM, rdata->msg_info.msg->hdr.next);
288 
289  if (!from) {
290  /* This had better not happen */
291  return -1;
292  }
293 
294  set_id_from_hdr(from, id);
295 
296  if (!id->number.valid) {
297  return -1;
298  }
299 
300  return 0;
301 }
static void set_id_from_hdr(pjsip_fromto_hdr *hdr, struct ast_party_id *id)
unsigned char valid
TRUE if the number information is valid/present.
Definition: channel.h:298
struct ast_party_number number
Subscriber phone number.
Definition: channel.h:343

◆ set_id_from_hdr()

static void set_id_from_hdr ( pjsip_fromto_hdr *  hdr,
struct ast_party_id id 
)
static

Definition at line 44 of file res_pjsip_caller_id.c.

References AST_CHANNEL_NAME, ast_copy_pj_str(), ast_free, ast_strdup, ast_strlen_zero, cid_name, cid_num, ast_party_id::name, ast_party_id::number, ast_party_name::str, and ast_party_number::str.

Referenced by set_id_from_from(), set_id_from_pai(), and set_id_from_rpid().

45 {
48  pjsip_sip_uri *uri;
49  pjsip_name_addr *id_name_addr = (pjsip_name_addr *) hdr->uri;
50  char *semi;
51 
52  uri = pjsip_uri_get_uri(id_name_addr);
53  ast_copy_pj_str(cid_name, &id_name_addr->display, sizeof(cid_name));
54  ast_copy_pj_str(cid_num, &uri->user, sizeof(cid_num));
55 
56  /* Always truncate caller-id number at a semicolon. */
57  semi = strchr(cid_num, ';');
58  if (semi) {
59  /*
60  * We need to be able to handle URI's looking like
61  * "sip:1235557890;[email protected];user=phone"
62  *
63  * Where the uri->user field will result in:
64  * "1235557890;phone-context=national"
65  *
66  * People don't care about anything after the semicolon
67  * showing up on their displays even though the RFC
68  * allows the semicolon.
69  */
70  *semi = '\0';
71  }
72 
73  ast_free(id->name.str);
74  id->name.str = ast_strdup(cid_name);
75  if (!ast_strlen_zero(cid_name)) {
76  id->name.valid = 1;
77  }
78  ast_free(id->number.str);
79  id->number.str = ast_strdup(cid_num);
80  if (!ast_strlen_zero(cid_num)) {
81  id->number.valid = 1;
82  }
83 }
char * str
Subscriber phone number (Malloced)
Definition: channel.h:292
struct ast_party_name name
Subscriber name.
Definition: channel.h:341
char * str
Subscriber name (Malloced)
Definition: channel.h:265
#define ast_strdup(str)
A wrapper for strdup()
Definition: astmm.h:243
void ast_copy_pj_str(char *dest, const pj_str_t *src, size_t size)
Copy a pj_str_t into a standard character buffer.
Definition: res_pjsip.c:5240
static char cid_num[AST_MAX_EXTENSION]
Definition: chan_mgcp.c:164
#define ast_strlen_zero(foo)
Definition: strings.h:52
#define ast_free(a)
Definition: astmm.h:182
#define AST_CHANNEL_NAME
Definition: channel.h:172
static char cid_name[AST_MAX_EXTENSION]
Definition: chan_mgcp.c:165
struct ast_party_number number
Subscriber phone number.
Definition: channel.h:343

◆ set_id_from_oli()

static int set_id_from_oli ( pjsip_rx_data *  rdata,
int *  ani2 
)
static

Definition at line 153 of file res_pjsip_caller_id.c.

References ast_copy_pj_str(), ast_str_to_int(), get_id_header(), and MAX_OLI_DIGITS.

Referenced by caller_id_incoming_request().

154 {
155  #define MAX_OLI_DIGITS 2
156  char oli[MAX_OLI_DIGITS + 1];
157  static const pj_str_t from = { "From", 4 };
158  static const pj_str_t oli_str1 = { "oli", 3 };
159  static const pj_str_t oli_str2 = { "isup-oli", 8 };
160  static const pj_str_t oli_str3 = { "ss7-oli", 7 };
161  const pjsip_param *oli1, *oli2, *oli3;
162  pjsip_fromto_hdr *from_hdr = get_id_header(rdata, &from);
163  if (!from_hdr) {
164  return 0;
165  }
166  if ((oli1 = pjsip_param_find(&from_hdr->other_param, &oli_str1))) {
167  ast_copy_pj_str(oli, &oli1->value, MAX_OLI_DIGITS);
168  return ast_str_to_int(oli, ani2);
169  } else if ((oli2 = pjsip_param_find(&from_hdr->other_param, &oli_str2))) {
170  ast_copy_pj_str(oli, &oli2->value, MAX_OLI_DIGITS);
171  return ast_str_to_int(oli, ani2);
172  } else if ((oli3 = pjsip_param_find(&from_hdr->other_param, &oli_str3))) {
173  ast_copy_pj_str(oli, &oli3->value, MAX_OLI_DIGITS);
174  return ast_str_to_int(oli, ani2);
175  }
176  return 0;
177 }
static pjsip_fromto_hdr * get_id_header(pjsip_rx_data *rdata, const pj_str_t *header_name)
void ast_copy_pj_str(char *dest, const pj_str_t *src, size_t size)
Copy a pj_str_t into a standard character buffer.
Definition: res_pjsip.c:5240
int ast_str_to_int(const char *str, int *res)
Convert the given string to a signed integer.
Definition: conversions.c:44
int ani2
Automatic Number Identification 2 (Info Digits)
Definition: channel.h:434
#define MAX_OLI_DIGITS

◆ set_id_from_pai()

static int set_id_from_pai ( pjsip_rx_data *  rdata,
struct ast_party_id id 
)
static

Definition at line 191 of file res_pjsip_caller_id.c.

References AST_PRES_ALLOWED_USER_NUMBER_NOT_SCREENED, AST_PRES_PROHIB_USER_NUMBER_NOT_SCREENED, get_id_header(), NULL, ast_party_id::number, set_id_from_hdr(), and ast_party_number::valid.

Referenced by caller_id_incoming_request(), and update_incoming_connected_line().

192 {
193  static const pj_str_t pai_str = { "P-Asserted-Identity", 19 };
194  static const pj_str_t privacy_str = { "Privacy", 7 };
195  pjsip_fromto_hdr *pai_hdr = get_id_header(rdata, &pai_str);
196  pjsip_generic_string_hdr *privacy;
197 
198  if (!pai_hdr) {
199  return -1;
200  }
201 
202  set_id_from_hdr(pai_hdr, id);
203 
204  if (!id->number.valid) {
205  return -1;
206  }
207 
208  privacy = pjsip_msg_find_hdr_by_name(rdata->msg_info.msg, &privacy_str, NULL);
209  if (!privacy || !pj_stricmp2(&privacy->hvalue, "none")) {
210  id->number.presentation = AST_PRES_ALLOWED_USER_NUMBER_NOT_SCREENED;
211  id->name.presentation = AST_PRES_ALLOWED_USER_NUMBER_NOT_SCREENED;
212  } else {
213  id->number.presentation = AST_PRES_PROHIB_USER_NUMBER_NOT_SCREENED;
214  id->name.presentation = AST_PRES_PROHIB_USER_NUMBER_NOT_SCREENED;
215  }
216 
217  return 0;
218 }
static pjsip_fromto_hdr * get_id_header(pjsip_rx_data *rdata, const pj_str_t *header_name)
static void set_id_from_hdr(pjsip_fromto_hdr *hdr, struct ast_party_id *id)
#define AST_PRES_PROHIB_USER_NUMBER_NOT_SCREENED
Definition: callerid.h:341
#define NULL
Definition: resample.c:96
#define AST_PRES_ALLOWED_USER_NUMBER_NOT_SCREENED
Definition: callerid.h:329
unsigned char valid
TRUE if the number information is valid/present.
Definition: channel.h:298
struct ast_party_number number
Subscriber phone number.
Definition: channel.h:343

◆ set_id_from_rpid()

static int set_id_from_rpid ( pjsip_rx_data *  rdata,
struct ast_party_id id 
)
static

Definition at line 232 of file res_pjsip_caller_id.c.

References AST_PRES_ALLOWED, AST_PRES_RESTRICTED, AST_PRES_USER_NUMBER_PASSED_SCREEN, AST_PRES_USER_NUMBER_UNSCREENED, get_id_header(), ast_party_id::number, set_id_from_hdr(), and ast_party_number::valid.

Referenced by caller_id_incoming_request(), and update_incoming_connected_line().

233 {
234  static const pj_str_t rpid_str = { "Remote-Party-ID", 15 };
235  static const pj_str_t privacy_str = { "privacy", 7 };
236  static const pj_str_t screen_str = { "screen", 6 };
237  pjsip_fromto_hdr *rpid_hdr = get_id_header(rdata, &rpid_str);
238  pjsip_param *screen;
239  pjsip_param *privacy;
240 
241  if (!rpid_hdr) {
242  return -1;
243  }
244 
245  set_id_from_hdr(rpid_hdr, id);
246 
247  if (!id->number.valid) {
248  return -1;
249  }
250 
251  privacy = pjsip_param_find(&rpid_hdr->other_param, &privacy_str);
252  screen = pjsip_param_find(&rpid_hdr->other_param, &screen_str);
253  if (privacy && !pj_stricmp2(&privacy->value, "full")) {
254  id->number.presentation = AST_PRES_RESTRICTED;
255  id->name.presentation = AST_PRES_RESTRICTED;
256  } else {
257  id->number.presentation = AST_PRES_ALLOWED;
258  id->name.presentation = AST_PRES_ALLOWED;
259  }
260  if (screen && !pj_stricmp2(&screen->value, "yes")) {
261  id->number.presentation |= AST_PRES_USER_NUMBER_PASSED_SCREEN;
262  id->name.presentation |= AST_PRES_USER_NUMBER_PASSED_SCREEN;
263  } else {
264  id->number.presentation |= AST_PRES_USER_NUMBER_UNSCREENED;
265  id->name.presentation |= AST_PRES_USER_NUMBER_UNSCREENED;
266  }
267 
268  return 0;
269 }
static pjsip_fromto_hdr * get_id_header(pjsip_rx_data *rdata, const pj_str_t *header_name)
static void set_id_from_hdr(pjsip_fromto_hdr *hdr, struct ast_party_id *id)
#define AST_PRES_RESTRICTED
Definition: callerid.h:325
#define AST_PRES_USER_NUMBER_UNSCREENED
Definition: callerid.h:318
#define AST_PRES_USER_NUMBER_PASSED_SCREEN
Definition: callerid.h:319
#define AST_PRES_ALLOWED
Definition: callerid.h:324
unsigned char valid
TRUE if the number information is valid/present.
Definition: channel.h:298
struct ast_party_number number
Subscriber phone number.
Definition: channel.h:343

◆ should_queue_connected_line_update()

static int should_queue_connected_line_update ( const struct ast_sip_session session,
const struct ast_party_id id 
)
static

Definition at line 316 of file res_pjsip_caller_id.c.

References ast_strlen_zero, ast_sip_session::id, ast_party_id::name, ast_party_id::number, ast_party_name::str, ast_party_number::str, ast_party_name::valid, and ast_party_number::valid.

Referenced by update_incoming_connected_line().

317 {
318  /* Invalid number means no update */
319  if (!id->number.valid) {
320  return 0;
321  }
322 
323  /* If the session has never communicated an update or if the
324  * new ID has a different number than the session, then we
325  * should queue an update
326  */
327  if (ast_strlen_zero(session->id.number.str) ||
328  strcmp(session->id.number.str, id->number.str)) {
329  return 1;
330  }
331 
332  /* By making it to this point, it means the number is not enough
333  * to determine if an update should be sent. Now we look at
334  * the name
335  */
336 
337  /* If the number couldn't warrant an update and the name is
338  * invalid, then no update
339  */
340  if (!id->name.valid) {
341  return 0;
342  }
343 
344  /* If the name has changed or we don't have a name set for the
345  * session, then we should send an update
346  */
347  if (ast_strlen_zero(session->id.name.str) ||
348  strcmp(session->id.name.str, id->name.str)) {
349  return 1;
350  }
351 
352  /* Neither the name nor the number have changed. No update */
353  return 0;
354 }
char * str
Subscriber phone number (Malloced)
Definition: channel.h:292
struct ast_party_name name
Subscriber name.
Definition: channel.h:341
char * str
Subscriber name (Malloced)
Definition: channel.h:265
#define ast_strlen_zero(foo)
Definition: strings.h:52
unsigned char valid
TRUE if the name information is valid/present.
Definition: channel.h:280
struct ast_party_id id
unsigned char valid
TRUE if the number information is valid/present.
Definition: channel.h:298
struct ast_party_number number
Subscriber phone number.
Definition: channel.h:343

◆ unload_module()

static int unload_module ( void  )
static

Definition at line 849 of file res_pjsip_caller_id.c.

References AST_MODFLAG_LOAD_ORDER, AST_MODPRI_APP_DEPEND, AST_MODULE_INFO(), AST_MODULE_SUPPORT_CORE, ast_sip_session_unregister_supplement(), ASTERISK_GPL_KEY, and load_module().

850 {
852  return 0;
853 }
void ast_sip_session_unregister_supplement(struct ast_sip_session_supplement *supplement)
Unregister a an supplement to SIP session processing.
Definition: pjsip_session.c:63
static struct ast_sip_session_supplement caller_id_supplement

◆ update_incoming_connected_line()

static void update_incoming_connected_line ( struct ast_sip_session session,
pjsip_rx_data *  rdata 
)
static

Definition at line 398 of file res_pjsip_caller_id.c.

References ast_party_id_free(), ast_party_id_init(), ast_sip_session::endpoint, ast_sip_endpoint::id, queue_connected_line_update(), set_id_from_pai(), set_id_from_rpid(), should_queue_connected_line_update(), ast_sip_endpoint_id_configuration::trust_connected_line, and ast_sip_endpoint_id_configuration::trust_inbound.

Referenced by caller_id_incoming_request(), and caller_id_incoming_response().

399 {
400  struct ast_party_id id;
401 
402  if (!session->endpoint->id.trust_connected_line
403  || !session->endpoint->id.trust_inbound) {
404  return;
405  }
406 
407  ast_party_id_init(&id);
408  if (!set_id_from_pai(rdata, &id) || !set_id_from_rpid(rdata, &id)) {
409  if (should_queue_connected_line_update(session, &id)) {
410  queue_connected_line_update(session, &id);
411  }
412  }
413  ast_party_id_free(&id);
414 }
Information needed to identify an endpoint in a call.
Definition: channel.h:339
struct ast_sip_endpoint * endpoint
static int set_id_from_rpid(pjsip_rx_data *rdata, struct ast_party_id *id)
void ast_party_id_free(struct ast_party_id *doomed)
Destroy the party id contents.
Definition: channel.c:1811
static void queue_connected_line_update(struct ast_sip_session *session, const struct ast_party_id *id)
static int should_queue_connected_line_update(const struct ast_sip_session *session, const struct ast_party_id *id)
struct ast_sip_endpoint_id_configuration id
Definition: res_pjsip.h:847
static int set_id_from_pai(pjsip_rx_data *rdata, struct ast_party_id *id)
void ast_party_id_init(struct ast_party_id *init)
Initialize the given party id structure.
Definition: channel.c:1757
enum queue_result id
Definition: app_queue.c:1507

Variable Documentation

◆ __mod_info

struct ast_module_info __mod_info = { .name = AST_MODULE, .flags = AST_MODFLAG_LOAD_ORDER , .description = "PJSIP Caller ID Support" , .key = "This paragraph is copyright (c) 2006 by Digium, Inc. \In order for your module to load, it must return this \key via a function called \"key\". Any code which \includes this paragraph must be licensed under the GNU \General Public License version 2 or later (at your \option). In addition to Digium's general reservations \of rights, Digium expressly reserves the right to \allow other parties to license this paragraph under \different terms. Any use of Digium, Inc. trademarks or \logos (including \"Asterisk\" or \"Digium\") without \express written permission of Digium, Inc. is prohibited.\n" , .buildopt_sum = "30ef0c93b36035ec78c9cfd712d36d9b" , .support_level = AST_MODULE_SUPPORT_CORE, .load = load_module, .unload = unload_module, .load_pri = AST_MODPRI_APP_DEPEND, .requires = "res_pjsip,res_pjsip_session", }
static

Definition at line 861 of file res_pjsip_caller_id.c.

◆ ast_module_info

const struct ast_module_info* ast_module_info = &__mod_info
static

Definition at line 861 of file res_pjsip_caller_id.c.

◆ caller_id_supplement

struct ast_sip_session_supplement caller_id_supplement
static

Definition at line 833 of file res_pjsip_caller_id.c.