#include "asterisk.h"
#include <pjsip.h>
#include "asterisk/res_pjsip.h"
#include "asterisk/module.h"
Go to the source code of this file.
|
static struct ast_module_info | __mod_info = { .name = AST_MODULE, .flags = AST_MODFLAG_LOAD_ORDER , .description = "UAC SIPS Contact 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", } |
|
static const struct ast_module_info * | ast_module_info = &__mod_info |
|
static pjsip_module | sips_contact_module |
|
◆ __reg_module()
static void __reg_module |
( |
void |
| ) |
|
|
static |
◆ __unreg_module()
static void __unreg_module |
( |
void |
| ) |
|
|
static |
◆ AST_MODULE_SELF_SYM()
◆ load_module()
static int load_module |
( |
void |
| ) |
|
|
static |
Definition at line 91 of file res_pjsip_sips_contact.c.
References AST_MODFLAG_LOAD_ORDER, AST_MODPRI_APP_DEPEND, AST_MODULE_INFO(), AST_MODULE_LOAD_DECLINE, AST_MODULE_LOAD_SUCCESS, AST_MODULE_SUPPORT_CORE, ast_sip_register_service(), ASTERISK_GPL_KEY, sips_contact_module, and unload_module().
int ast_sip_register_service(pjsip_module *module)
Register a SIP service in Asterisk.
Module has failed to load, may be in an inconsistent state.
◆ sips_contact_on_tx_request()
static pj_status_t sips_contact_on_tx_request |
( |
pjsip_tx_data * |
tdata | ) |
|
|
static |
Upgrade Contact URIs on outgoing SIP requests to SIPS if required.
The rules being used here are according to RFC 3261 section 8.1.1.8. In brief, if the request URI is SIPS or the topmost Route header is SIPS, then the Contact header we send must also be SIPS.
Definition at line 39 of file res_pjsip_sips_contact.c.
References ast_debug, and NULL.
42 pjsip_route_hdr *route;
43 pjsip_sip_uri *contact_uri;
45 contact = pjsip_msg_find_hdr(tdata->msg, PJSIP_H_CONTACT,
NULL);
50 contact_uri = pjsip_uri_get_uri(contact->uri);
51 if (PJSIP_URI_SCHEME_IS_SIPS(contact_uri)) {
56 if (PJSIP_URI_SCHEME_IS_SIPS(tdata->msg->line.req.uri)) {
57 ast_debug(1,
"Upgrading contact URI on outgoing SIP request to SIPS due to SIPS Request URI\n");
58 pjsip_sip_uri_set_secure(contact_uri, PJ_TRUE);
62 route = pjsip_msg_find_hdr(tdata->msg, PJSIP_H_ROUTE,
NULL);
67 if (!PJSIP_URI_SCHEME_IS_SIPS(&route->name_addr)) {
72 ast_debug(1,
"Upgrading contact URI on outgoing SIP request to SIPS due to SIPS Route header\n");
73 pjsip_sip_uri_set_secure(contact_uri, PJ_TRUE);
#define ast_debug(level,...)
Log a DEBUG message.
◆ unload_module()
static int unload_module |
( |
void |
| ) |
|
|
static |
◆ __mod_info
struct ast_module_info __mod_info = { .name = AST_MODULE, .flags = AST_MODFLAG_LOAD_ORDER , .description = "UAC SIPS Contact 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", } |
|
static |
◆ ast_module_info
◆ sips_contact_module
pjsip_module sips_contact_module |
|
static |