int tsip_transac_init(tsip_transac_t *self, tsip_transac_type_t type, int32_t cseq_value, const char* cseq_method, const char* callid, struct tsip_transac_dst_s* dst, tsk_fsm_state_id curr, tsk_fsm_state_id term) { if(self && !self->initialized){ self->type = type; self->cseq_value = cseq_value; tsk_strupdate(&self->cseq_method, cseq_method); tsk_strupdate(&self->callid, callid); self->dst = tsk_object_ref(dst); /* FSM */ self->fsm = tsk_fsm_create(curr, term); self->initialized = tsk_true; return 0; } return -1; }
int tsip_transac_init(tsip_transac_t *self, tsip_transac_type_t type, tsk_bool_t reliable, int32_t cseq_value, const char* cseq_method, const char* callid, tsip_dialog_t* dialog, tsk_fsm_state_id curr, tsk_fsm_state_id term) { if(self && !self->initialized){ self->type = type; self->reliable = reliable; self->cseq_value = cseq_value; self->cseq_method = tsk_strdup(cseq_method); self->callid = tsk_strdup(callid); self->dialog = tsk_object_ref(dialog); /* FSM */ self->fsm = tsk_fsm_create(curr, term); self->initialized = tsk_true; return 0; } return -1; }