mirror of
				https://github.com/asterisk/asterisk.git
				synced 2025-10-31 02:37:10 +00:00 
			
		
		
		
	res_pjsip_session: Add overlap_context option.
Adds the overlap_context option, which can be used to explicitly specify a context to use for overlap dialing extension matches, rather than forcibly using the context configured for the endpoint. ASTERISK-30262 #close Change-Id: Ibbcd4a8b11402428a187fb56b8d4e7408774a0db
This commit is contained in:
		
				
					committed by
					
						 George Joseph
						George Joseph
					
				
			
			
				
	
			
			
			
						parent
						
							1da489a434
						
					
				
				
					commit
					d1bec3623e
				
			| @@ -313,6 +313,16 @@ | ||||
| 				<configOption name="allow_overlap" default="yes"> | ||||
| 					<synopsis>Enable RFC3578 overlap dialing support.</synopsis> | ||||
| 				</configOption> | ||||
| 				<configOption name="overlap_context"> | ||||
| 					<synopsis>Dialplan context to use for RFC3578 overlap dialing.</synopsis> | ||||
| 					<description> | ||||
| 						<para>Dialplan context to use for overlap dialing extension matching. | ||||
| 						If not specified, the context configured for the endpoint will be used. | ||||
| 						If specified, the extensions/patterns in the specified context will be used | ||||
| 						for determining if a full number has been received from the endpoint. | ||||
| 						</para> | ||||
| 					</description> | ||||
| 				</configOption> | ||||
| 				<configOption name="aors"> | ||||
| 					<synopsis>AoR(s) to be used with the endpoint</synopsis> | ||||
| 					<description><para> | ||||
|   | ||||
| @@ -2229,6 +2229,7 @@ int ast_res_pjsip_initialize_configuration(void) | ||||
| 	ast_sorcery_object_field_register(sip_sorcery, "endpoint", "asymmetric_rtp_codec", "no", OPT_BOOL_T, 1, FLDSET(struct ast_sip_endpoint, asymmetric_rtp_codec)); | ||||
| 	ast_sorcery_object_field_register(sip_sorcery, "endpoint", "rtcp_mux", "no", OPT_BOOL_T, 1, FLDSET(struct ast_sip_endpoint, media.rtcp_mux)); | ||||
| 	ast_sorcery_object_field_register(sip_sorcery, "endpoint", "allow_overlap", "yes", OPT_BOOL_T, 1, FLDSET(struct ast_sip_endpoint, allow_overlap)); | ||||
| 	ast_sorcery_object_field_register(sip_sorcery, "endpoint", "overlap_context", "", OPT_STRINGFIELD_T, 0, STRFLDSET(struct ast_sip_endpoint, overlap_context)); | ||||
| 	ast_sorcery_object_field_register(sip_sorcery, "endpoint", "refer_blind_progress", "yes", OPT_BOOL_T, 1, FLDSET(struct ast_sip_endpoint, refer_blind_progress)); | ||||
| 	ast_sorcery_object_field_register(sip_sorcery, "endpoint", "notify_early_inuse_ringing", "no", OPT_BOOL_T, 1, FLDSET(struct ast_sip_endpoint, notify_early_inuse_ringing)); | ||||
| 	ast_sorcery_object_field_register(sip_sorcery, "endpoint", "max_audio_streams", "1", OPT_UINT_T, 0, FLDSET(struct ast_sip_endpoint, media.max_audio_streams)); | ||||
| @@ -2427,6 +2428,10 @@ void *ast_sip_endpoint_alloc(const char *name) | ||||
| 		ao2_cleanup(endpoint); | ||||
| 		return NULL; | ||||
| 	} | ||||
| 	if (ast_string_field_init_extended(endpoint, overlap_context)) { | ||||
| 		ao2_cleanup(endpoint); | ||||
| 		return NULL; | ||||
| 	} | ||||
|  | ||||
| 	if (!(endpoint->media.codecs = ast_format_cap_alloc(AST_FORMAT_CAP_FLAG_DEFAULT))) { | ||||
| 		ao2_cleanup(endpoint); | ||||
|   | ||||
| @@ -507,6 +507,9 @@ | ||||
| 				<parameter name="Allowoverlap"> | ||||
| 					<para><xi:include xpointer="xpointer(/docs/configInfo[@name='res_pjsip']/configFile[@name='pjsip.conf']/configObject[@name='endpoint']/configOption[@name='allow_overlap']/synopsis/node())"/></para> | ||||
| 				</parameter> | ||||
| 				<parameter name="OverlapContext"> | ||||
| 					<para><xi:include xpointer="xpointer(/docs/configInfo[@name='res_pjsip']/configFile[@name='pjsip.conf']/configObject[@name='endpoint']/configOption[@name='overlap_context']/synopsis/node())"/></para> | ||||
| 				</parameter> | ||||
| 			</syntax> | ||||
| 		</managerEventInstance> | ||||
| 	</managerEvent> | ||||
|   | ||||
| @@ -3713,8 +3713,10 @@ static enum sip_get_destination_result get_destination(struct ast_sip_session *s | ||||
|  | ||||
| 	fetch_callerid_num(session, rdata, cid_num, sizeof(cid_num)); | ||||
|  | ||||
| 	/* If there's an overlap_context override specified, use that; otherwise, just use the endpoint's context */ | ||||
|  | ||||
| 	if (!strcmp(session->exten, pickupexten) || | ||||
| 		ast_exists_extension(NULL, session->endpoint->context, session->exten, 1, S_OR(cid_num, NULL))) { | ||||
| 		ast_exists_extension(NULL, S_OR(session->endpoint->overlap_context, session->endpoint->context), session->exten, 1, S_OR(cid_num, NULL))) { | ||||
| 		/* | ||||
| 		 * Save off the INVITE Request-URI in case it is | ||||
| 		 * needed: CHANNEL(pjsip,request_uri) | ||||
| @@ -3729,7 +3731,7 @@ static enum sip_get_destination_result get_destination(struct ast_sip_session *s | ||||
| 	 */ | ||||
| 	if (session->endpoint->allow_overlap && ( | ||||
| 		!strncmp(session->exten, pickupexten, strlen(session->exten)) || | ||||
| 		ast_canmatch_extension(NULL, session->endpoint->context, session->exten, 1, S_OR(cid_num, NULL)))) { | ||||
| 		ast_canmatch_extension(NULL, S_OR(session->endpoint->overlap_context, session->endpoint->context), session->exten, 1, S_OR(cid_num, NULL)))) { | ||||
| 		/* Overlap partial match */ | ||||
| 		return SIP_GET_DEST_EXTEN_PARTIAL; | ||||
| 	} | ||||
|   | ||||
		Reference in New Issue
	
	Block a user