예제 #1
0
/*!
 * \brief Helper method that outputs a dialog via the RPC interface
 * \see rpc_print_dlg
 * \param rpc RPC node that should be filled
 * \param c RPC void pointer
 * \param dlg printed dialog
 * \param with_context if 1 then the dialog context will be also printed
 * \return 0 on success, -1 on failure
 */
static inline void internal_rpc_print_dlg(rpc_t *rpc, void *c, struct dlg_cell *dlg, void *dh)
{
	void* dlg_outs_h;
	struct dlg_cell_out* dlg_out;

	rpc->struct_add(dh, "dd", "Entry", dlg->h_entry, "Id", dlg->h_id);
	rpc->struct_add(dh, "SSSSSSSsd{",
			"RURI", &dlg->req_uri,
			"From", &dlg->from_uri,
			"Call-ID", &dlg->callid,
			"Caller Contact", &dlg->caller_contact,
			"Caller Route Set", &dlg->caller_route_set,
			"Dialog-ID", &dlg->did,
			"From Tag", &dlg->from_tag,
			"State", state_to_char(dlg->state),
			"Ref", dlg->ref,
			"dlg_outs", &dlg_outs_h
			);

	lock_get(dlg->dlg_out_entries_lock);

	dlg_out = dlg->dlg_entry_out.first;
	while (dlg_out) {
		rpc->struct_add(dlg_outs_h, "dd", "Entry", dlg_out->h_entry, "Id", dlg_out->h_id);
		dlg_out = dlg_out->next;
	}

	lock_release(dlg->dlg_out_entries_lock);

	/*now traverse dlg_outs*/

}
예제 #2
0
파일: debuging.c 프로젝트: xevix/fsqlf
void debug_stchange(int newstate_int)
{
    char* currentstate = 0;
    char* newstate;

    // currentstate = state_to_char(YY_START); // FIXME: take YY_START param.
    newstate = state_to_char(newstate_int);

    if (debug_level & DEBUGSTATES) {
        printf("\n\t*   %s->%s   *\n", currentstate,newstate);
    }
}