示例#1
0
/* returns the SalOp of a call that should be replaced by h, if any */
SalOp *sal_call_get_replaces(SalOp *op){
	if (op && op->replaces){
		/*rfc3891
		 3.  User Agent Server Behavior: Receiving a Replaces Header
			
		 The Replaces header contains information used to match an existing
		 SIP dialog (call-id, to-tag, and from-tag).  Upon receiving an INVITE
		 with a Replaces header, the User Agent (UA) attempts to match this
		 information with a confirmed or early dialog.  The User Agent Server
		 (UAS) matches the to-tag and from-tag parameters as if they were tags
		 present in an incoming request.  In other words, the to-tag parameter
		 is compared to the local tag, and the from-tag parameter is compared
		 to the remote tag.
		 */
		belle_sip_dialog_t* dialog=belle_sip_provider_find_dialog(op->base.root->prov
								,belle_sip_header_replaces_get_call_id(op->replaces)
								,belle_sip_header_replaces_get_to_tag(op->replaces)
								,belle_sip_header_replaces_get_from_tag(op->replaces));

		if (!dialog) {
			/*for backward compatibility with liblinphone <= 3.10.2-243 */
			dialog=belle_sip_provider_find_dialog(op->base.root->prov
												  ,belle_sip_header_replaces_get_call_id(op->replaces)
												  ,belle_sip_header_replaces_get_from_tag(op->replaces)
												  ,belle_sip_header_replaces_get_to_tag(op->replaces));
		}
		if (dialog) {
			return (SalOp*)belle_sip_dialog_get_application_data(dialog);
		}
	}
	return NULL;
}
示例#2
0
/* returns the SalOp of a call that should be replaced by h, if any */
SalOp *sal_call_get_replaces(SalOp *op){
	if (op && op->replaces){
		belle_sip_dialog_t* dialog=belle_sip_provider_find_dialog(op->base.root->prov
								,belle_sip_header_replaces_get_call_id(op->replaces)
								,belle_sip_header_replaces_get_from_tag(op->replaces)
								,belle_sip_header_replaces_get_to_tag(op->replaces));

		if (dialog) {
			return (SalOp*)belle_sip_dialog_get_application_data(dialog);
		}
	}
	return NULL;
}