示例#1
0
void linphone_core_notify_info_message(LinphoneCore* lc,SalOp *op, const SalBody *body){
	LinphoneCall *call=(LinphoneCall*)sal_op_get_user_pointer(op);
	if (call){
		LinphoneInfoMessage *info=ms_new0(LinphoneInfoMessage,1);
		info->headers=sal_custom_header_clone(sal_op_get_recv_custom_header(op));
		if (body) info->content=linphone_content_from_sal_body(body);
		linphone_core_notify_info_received(lc,call,info);
		linphone_info_message_destroy(info);
	}
}
示例#2
0
static void notify(SalOp *op, SalSubscribeStatus st, const char *eventname, const SalBody *body){
	LinphoneEvent *lev=(LinphoneEvent*)sal_op_get_user_pointer(op);
	LinphoneCore *lc=(LinphoneCore *)sal_get_user_pointer(sal_op_get_sal(op));
	LinphoneContent content;
	
	if (lev==NULL) {
		/*out of subscribe notify */
		lev=linphone_event_new_with_op(lc,op,LinphoneSubscriptionOutgoing,eventname);
	}
	if (lc->vtable.notify_received){
		const LinphoneContent *ct=linphone_content_from_sal_body(&content,body);
		if (ct) lc->vtable.notify_received(lc,lev,eventname,ct);
	}
	if (st!=SalSubscribeNone){
		linphone_event_set_state(lev,linphone_subscription_state_from_sal(st));
	}
}