Index: include/asterisk/res_pjsip.h
===================================================================
--- include/asterisk/res_pjsip.h (revisión: 433369)
+++ include/asterisk/res_pjsip.h (copia de trabajo)
@@ -554,6 +554,8 @@
AST_DECLARE_STRING_FIELDS(
/*! Context to send incoming calls to */
AST_STRING_FIELD(context);
+ /*! Context to send subscribes */
+ AST_STRING_FIELD(subscribe_context);
/*! Name of an explicit transport to use */
AST_STRING_FIELD(transport);
/*! Outbound proxy to use */
Index: res/res_pjsip/pjsip_configuration.c
===================================================================
--- res/res_pjsip/pjsip_configuration.c (revisión: 433369)
+++ res/res_pjsip/pjsip_configuration.c (copia de trabajo)
@@ -1676,6 +1676,7 @@
ast_sorcery_object_field_register(sip_sorcery, "endpoint", "type", "", OPT_NOOP_T, 0, 0);
ast_sorcery_object_field_register(sip_sorcery, "endpoint", "context", "default", OPT_STRINGFIELD_T, 0, STRFLDSET(struct ast_sip_endpoint, context));
+ ast_sorcery_object_field_register(sip_sorcery, "endpoint", "subscribe_context", "default", OPT_STRINGFIELD_T, 0, STRFLDSET(struct ast_sip_endpoint, subscribe_context));
ast_sorcery_object_field_register_alias(sip_sorcery, "endpoint", "disallow", "", OPT_CODEC_T, 0, FLDSET(struct ast_sip_endpoint, media.codecs));
ast_sorcery_object_field_register(sip_sorcery, "endpoint", "allow", "", OPT_CODEC_T, 1, FLDSET(struct ast_sip_endpoint, media.codecs));
ast_sorcery_object_field_register_custom(sip_sorcery, "endpoint", "dtmf_mode", "rfc4733", dtmf_handler, dtmf_to_str, NULL, 0, 0);
Index: res/res_pjsip_exten_state.c
===================================================================
--- res/res_pjsip_exten_state.c (revisión: 433369)
+++ res/res_pjsip_exten_state.c (copia de trabajo)
@@ -352,7 +352,7 @@
static int new_subscribe(struct ast_sip_endpoint *endpoint,
const char *resource)
{
- if (!ast_exists_extension(NULL, endpoint->context, resource, PRIORITY_HINT, NULL)) {
+ if (!ast_exists_extension(NULL, endpoint->subscribe_context, resource, PRIORITY_HINT, NULL)) {
ast_log(LOG_NOTICE, "Extension state subscription failed: Extension %s does not exist in context '%s' or has no associated hint\n",
resource, endpoint->context);
return 404;
@@ -372,7 +372,7 @@
return -1;
}
- ast_copy_string(exten_state_sub->context, endpoint->context, sizeof(exten_state_sub->context));
+ ast_copy_string(exten_state_sub->context, endpoint->subscribe_context, sizeof(exten_state_sub->context));
ast_copy_string(exten_state_sub->exten, resource, sizeof(exten_state_sub->exten));
if ((exten_state_sub->id = ast_extension_state_add_destroy_extended(
Index: res/res_pjsip.c
===================================================================
--- res/res_pjsip.c (revisión: 433442)
+++ res/res_pjsip.c (copia de trabajo)
@@ -619,6 +619,9 @@
Determines if endpoint is allowed to initiate subscriptions with Asterisk.
+
+ Determines the subscribe context for subscriptions.
+
The minimum allowed expiry time for subscriptions initiated by the endpoint.
@@ -1611,6 +1614,9 @@
+
+
+