mirror of
				https://github.com/asterisk/asterisk.git
				synced 2025-10-31 10:47:18 +00:00 
			
		
		
		
	res_pjsip_dialog_info_body_generator: Set LOCAL target URI as local URI
The change "Add LOCAL/REMOTE tags in dialog-info+xml" set both "local" Identity Element URI and Target Element URI to the same value - the channel Caller Number. For Identity Element it's ok to set as Caller ID. But Local Target URI should be set as local URI. In this case the Local Target URI can be used for Directed Call Pickup by Polycom ip-phones (parameter useLocalTargetUriforLegacyPickup). Also XML sanitized Display names. ASTERISK-24601 Change-Id: If130a2f2f3b2339b14dca0ec0ebeea3a87b34343
This commit is contained in:
		
				
					committed by
					
						 Joshua Colp
						Joshua Colp
					
				
			
			
				
	
			
			
			
						parent
						
							d1f32e75d7
						
					
				
				
					commit
					1576004e07
				
			| @@ -234,7 +234,10 @@ static int dialog_info_generate_body_content(void *body, void *data) | |||||||
|  |  | ||||||
| 			pj_strdup2(state_data->pool, &remote_identity_node->content, remote_target); | 			pj_strdup2(state_data->pool, &remote_identity_node->content, remote_target); | ||||||
| 			if (!ast_strlen_zero(remote_cid_name)) { | 			if (!ast_strlen_zero(remote_cid_name)) { | ||||||
| 				ast_sip_presence_xml_create_attr(state_data->pool, remote_identity_node, "display", remote_cid_name); | 				char display_sanitized[PJSIP_MAX_URL_SIZE]; | ||||||
|  |  | ||||||
|  | 				ast_sip_sanitize_xml(remote_cid_name, display_sanitized, sizeof(display_sanitized)); | ||||||
|  | 				ast_sip_presence_xml_create_attr(state_data->pool, remote_identity_node, "display", display_sanitized); | ||||||
| 			} | 			} | ||||||
| 			ast_sip_presence_xml_create_attr(state_data->pool, remote_target_node, "uri", remote_target); | 			ast_sip_presence_xml_create_attr(state_data->pool, remote_target_node, "uri", remote_target); | ||||||
| 		} | 		} | ||||||
| @@ -247,9 +250,13 @@ static int dialog_info_generate_body_content(void *body, void *data) | |||||||
| 			/* If a channel is not available we fall back to the sanitized local URI instead */ | 			/* If a channel is not available we fall back to the sanitized local URI instead */ | ||||||
| 			pj_strdup2(state_data->pool, &local_identity_node->content, S_OR(local_target, sanitized)); | 			pj_strdup2(state_data->pool, &local_identity_node->content, S_OR(local_target, sanitized)); | ||||||
| 			if (!ast_strlen_zero(local_cid_name)) { | 			if (!ast_strlen_zero(local_cid_name)) { | ||||||
| 				ast_sip_presence_xml_create_attr(state_data->pool, local_identity_node, "display", local_cid_name); | 				char display_sanitized[PJSIP_MAX_URL_SIZE]; | ||||||
|  |  | ||||||
|  | 				ast_sip_sanitize_xml(local_cid_name, display_sanitized, sizeof(display_sanitized)); | ||||||
|  | 				ast_sip_presence_xml_create_attr(state_data->pool, local_identity_node, "display", display_sanitized); | ||||||
| 			} | 			} | ||||||
| 			ast_sip_presence_xml_create_attr(state_data->pool, local_target_node, "uri", S_OR(local_target, sanitized)); |  | ||||||
|  | 			ast_sip_presence_xml_create_attr(state_data->pool, local_target_node, "uri", sanitized); | ||||||
| 		} | 		} | ||||||
| 	} | 	} | ||||||
|  |  | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user