Ejemplo n.º 1
0
int
_eXosip_dialog_init_as_uas (eXosip_dialog_t ** _jd, osip_message_t * _invite, osip_message_t * _200Ok)
{
  int i;
  eXosip_dialog_t *jd;

  *_jd = NULL;
  jd = (eXosip_dialog_t *) osip_malloc (sizeof (eXosip_dialog_t));
  if (jd == NULL)
    return OSIP_NOMEM;
  memset (jd, 0, sizeof (eXosip_dialog_t));
  jd->d_id = -1;                /* not yet available to user */
  i = osip_dialog_init_as_uas (&(jd->d_dialog), _invite, _200Ok);
  if (i != 0) {
    osip_free (jd);
    return i;
  }

  jd->d_count = 0;
  jd->d_session_timer_start = 0;
  jd->d_session_timer_length = 0;
  jd->d_session_timer_use_update = -1;
  jd->d_refresher = -1;         /* 0 -> me / 1 -> remote */
  jd->d_timer = osip_getsystemtime (NULL);
  jd->d_200Ok = NULL;
  jd->d_ack = NULL;
  jd->next = NULL;
  jd->parent = NULL;
  jd->d_out_trs = (osip_list_t *) osip_malloc (sizeof (osip_list_t));
  if (jd->d_out_trs == NULL) {
    osip_dialog_free (jd->d_dialog);
    osip_free (jd);
    return OSIP_NOMEM;
  }
  osip_list_init (jd->d_out_trs);
  jd->d_inc_trs = (osip_list_t *) osip_malloc (sizeof (osip_list_t));
  if (jd->d_inc_trs == NULL) {
    osip_dialog_free (jd->d_dialog);
    osip_free (jd->d_out_trs);
    osip_free (jd);
    return OSIP_NOMEM;
  }
  osip_list_init (jd->d_inc_trs);

  jd->d_dialog->local_cseq = 1;

  *_jd = jd;
  return OSIP_SUCCESS;
}
Ejemplo n.º 2
0
int
eXosip_dialog_init_as_uas (eXosip_dialog_t ** _jd, osip_message_t * _invite,
                           osip_message_t * _200Ok)
{
  int i;
  eXosip_dialog_t *jd;

  *_jd = NULL;
  jd = (eXosip_dialog_t *) osip_malloc (sizeof (eXosip_dialog_t));
  memset (jd, 0, sizeof (eXosip_dialog_t));
  jd->d_id = -1;                /* not yet available to user */
  jd->d_STATE = JD_EMPTY;
  i = osip_dialog_init_as_uas (&(jd->d_dialog), _invite, _200Ok);
  if (i != 0)
    {
      osip_free (jd);
      return -1;
    }

  jd->d_timer = time (NULL);
  jd->d_200Ok = NULL;
  jd->d_ack = NULL;
  jd->next = NULL;
  jd->parent = NULL;
  jd->d_out_trs = (osip_list_t *) osip_malloc (sizeof (osip_list_t));
  osip_list_init (jd->d_out_trs);
  jd->d_inc_trs = (osip_list_t *) osip_malloc (sizeof (osip_list_t));
  osip_list_init (jd->d_inc_trs);

#ifdef SUPPORT_MSN
  /* bugguy MSN */
  jd->d_dialog->local_cseq = 1;
#endif

  /* jd->d_bh = sdp_handler_new(); */
  *_jd = jd;
  return 0;
}