Exemplo n.º 1
0
/*
 * This mid-dialog request callback ensures that any extra/leg settings done
 * at script level before dialog matching is performed will get properly
 * transferred into the dialog context, once the dialog is matched
 */
static void acc_merge_contexts(struct dlg_cell *dlg, int type,
		struct dlg_cb_params *_params)
{
	acc_ctx_t *ctx;

	/* if there is already a acc context in the processing
	 * context, be sure to destroy it for now */
	if ((ctx = ACC_GET_CTX())) {
		push_ctx_to_ctx( ctx, (acc_ctx_t *)(*_params->param));
		acc_unref(ctx); /* unref it now beause it will disapear from local ctx */
	}

	ctx = (acc_ctx_t *)(*_params->param);
	acc_ref(ctx);
	ACC_PUT_CTX(ctx);
}
Exemplo n.º 2
0
static void acc_dlg_ctx_cb(struct dlg_cell *dlg, int type,
		struct dlg_cb_params *_params)
{
	acc_ctx_t *ctx;
	/* set the acc context from dialog into the
	 * current processing context */

	/* if there is already a acc context in the processing
	 * context, be sure to destroy it for now */
	if ( (ctx=ACC_GET_CTX)!=NULL) {
		push_ctx_to_ctx( ctx, (acc_ctx_t *)(*_params->param));
		acc_unref(ctx); /* unref it now beause it will disapear from local ctx */
	}

	ctx = (acc_ctx_t *)(*_params->param);
	acc_ref(ctx);
	ACC_PUT_CTX(ctx);
}