本文整理汇总了C++中osip_list_eol函数的典型用法代码示例。如果您正苦于以下问题:C++ osip_list_eol函数的具体用法?C++ osip_list_eol怎么用?C++ osip_list_eol使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了osip_list_eol函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: osip_content_type_to_str
/* returns null on error. */
int
osip_content_type_to_str (const osip_content_type_t * content_type,
char **dest)
{
char *buf;
char *tmp;
size_t len;
*dest = NULL;
if ((content_type == NULL) || (content_type->type == NULL)
|| (content_type->subtype == NULL))
return -1;
/* try to guess a long enough length */
len = strlen (content_type->type) + strlen (content_type->subtype) + 4 /* for '/', ' ', ';' and '\0' */
+ 10 * osip_list_size (content_type->gen_params);
buf = (char *) osip_malloc (len);
tmp = buf;
sprintf (tmp, "%s/%s", content_type->type, content_type->subtype);
tmp = tmp + strlen (tmp);
{
int pos = 0;
osip_generic_param_t *u_param;
if (!osip_list_eol (content_type->gen_params, pos))
{ /* needed for cannonical form! (authentication issue of rfc2543) */
sprintf (tmp, " ");
tmp++;
}
while (!osip_list_eol (content_type->gen_params, pos))
{
size_t tmp_len;
u_param =
(osip_generic_param_t *) osip_list_get (content_type->gen_params,
pos);
if (u_param->gvalue == NULL)
{
osip_free (buf);
return -1;
}
tmp_len = strlen (buf) + 4 + strlen (u_param->gname)
+ strlen (u_param->gvalue);
if (len < tmp_len)
{
buf = osip_realloc (buf, tmp_len);
len = tmp_len;
tmp = buf + strlen (buf);
}
sprintf (tmp, ";%s=%s", u_param->gname, u_param->gvalue);
tmp = tmp + strlen (tmp);
pos++;
}
}
*dest = buf;
return 0;
}
示例2: _eXosip_dialog_free
void
_eXosip_dialog_free (struct eXosip_t *excontext, eXosip_dialog_t * jd)
{
while (!osip_list_eol (jd->d_inc_trs, 0)) {
osip_transaction_t *tr;
tr = (osip_transaction_t *) osip_list_get (jd->d_inc_trs, 0);
osip_list_remove (jd->d_inc_trs, 0);
_eXosip_delete_reserved (tr);
osip_list_add (&excontext->j_transactions, tr, 0);
}
while (!osip_list_eol (jd->d_out_trs, 0)) {
osip_transaction_t *tr;
tr = (osip_transaction_t *) osip_list_get (jd->d_out_trs, 0);
osip_list_remove (jd->d_out_trs, 0);
_eXosip_delete_reserved (tr);
osip_list_add (&excontext->j_transactions, tr, 0);
}
osip_message_free (jd->d_200Ok);
osip_message_free (jd->d_ack);
osip_dialog_free (jd->d_dialog);
osip_free (jd->d_out_trs);
osip_free (jd->d_inc_trs);
osip_free (jd);
_eXosip_update (excontext);
}
示例3: eXosip_dialog_free
void
eXosip_dialog_free (eXosip_dialog_t * jd)
{
while (!osip_list_eol (jd->d_inc_trs, 0))
{
osip_transaction_t *tr;
tr = (osip_transaction_t *) osip_list_get (jd->d_inc_trs, 0);
osip_list_remove (jd->d_inc_trs, 0);
__eXosip_delete_jinfo (tr);
osip_list_add (eXosip.j_transactions, tr, 0);
}
while (!osip_list_eol (jd->d_out_trs, 0))
{
osip_transaction_t *tr;
tr = (osip_transaction_t *) osip_list_get (jd->d_out_trs, 0);
osip_list_remove (jd->d_out_trs, 0);
__eXosip_delete_jinfo (tr);
osip_list_add (eXosip.j_transactions, tr, 0);
}
osip_message_free (jd->d_200Ok);
osip_message_free (jd->d_ack);
osip_dialog_free (jd->d_dialog);
osip_free (jd->d_out_trs);
osip_free (jd->d_inc_trs);
osip_free (jd);
eXosip_update ();
}
示例4: osip_dialog_update_route_set_as_uac
int
osip_dialog_update_route_set_as_uac (osip_dialog_t * dialog,
osip_message_t * response)
{
/* only the remote target URI is updated here... */
osip_contact_t *contact;
int i;
if (dialog == NULL)
return -1;
if (response == NULL)
return -1;
if (osip_list_eol (&response->contacts, 0))
{ /* no contact header in response? */
OSIP_TRACE (osip_trace
(__FILE__, __LINE__, OSIP_WARNING, NULL,
"missing a contact in response!\n"));
} else
{
/* I personally think it's a bad idea to keep the old
value in case the new one is broken... */
if (dialog->remote_contact_uri != NULL)
{
osip_contact_free (dialog->remote_contact_uri);
}
dialog->remote_contact_uri = NULL;
contact = osip_list_get (&response->contacts, 0);
i = osip_contact_clone (contact, &(dialog->remote_contact_uri));
if (i != 0)
return -1;
}
if (dialog->state == DIALOG_EARLY && osip_list_size (&dialog->route_set) == 0)
{ /* update the route set */
int pos = 0;
while (!osip_list_eol (&response->record_routes, pos))
{
osip_record_route_t *rr;
osip_record_route_t *rr2;
rr =
(osip_record_route_t *) osip_list_get (&response->record_routes, pos);
i = osip_record_route_clone (rr, &rr2);
if (i != 0)
return -1;
osip_list_add (&dialog->route_set, rr2, 0);
pos++;
}
}
if (MSG_IS_STATUS_2XX (response))
dialog->state = DIALOG_CONFIRMED;
return 0;
}
示例5: _eXosip_insubscription_transaction_find
int
_eXosip_insubscription_transaction_find (int tid, eXosip_notify_t ** jn,
eXosip_dialog_t ** jd,
osip_transaction_t ** tr)
{
for (*jn = eXosip.j_notifies; *jn != NULL; *jn = (*jn)->next)
{
if ((*jn)->n_inc_tr != NULL && (*jn)->n_inc_tr->transactionid == tid)
{
*tr = (*jn)->n_inc_tr;
*jd = (*jn)->n_dialogs;
return 0;
}
if ((*jn)->n_out_tr != NULL && (*jn)->n_out_tr->transactionid == tid)
{
*tr = (*jn)->n_out_tr;
*jd = (*jn)->n_dialogs;
return 0;
}
for (*jd = (*jn)->n_dialogs; *jd != NULL; *jd = (*jd)->next)
{
osip_transaction_t *transaction;
int pos = 0;
while (!osip_list_eol ((*jd)->d_inc_trs, pos))
{
transaction =
(osip_transaction_t *) osip_list_get ((*jd)->d_inc_trs, pos);
if (transaction != NULL && transaction->transactionid == tid)
{
*tr = transaction;
return 0;
}
pos++;
}
pos = 0;
while (!osip_list_eol ((*jd)->d_out_trs, pos))
{
transaction =
(osip_transaction_t *) osip_list_get ((*jd)->d_out_trs, pos);
if (transaction != NULL && transaction->transactionid == tid)
{
*tr = transaction;
return 0;
}
pos++;
}
}
}
*jd = NULL;
*jn = NULL;
return -1;
}
示例6: eXosip_remove_transaction_from_call
int
eXosip_remove_transaction_from_call (osip_transaction_t * tr, eXosip_call_t * jc)
{
osip_transaction_t *inc_tr;
osip_transaction_t *out_tr;
eXosip_dialog_t *jd;
int pos = 0;
if (jc->c_inc_tr == tr)
{
jc->c_inc_tr = NULL; /* can be NULL */
return 0;
}
for (jd = jc->c_dialogs; jd != NULL; jd = jd->next)
{
pos = 0;
while (!osip_list_eol (jd->d_inc_trs, pos))
{
inc_tr = osip_list_get (jd->d_inc_trs, pos);
if (inc_tr == tr)
{
osip_list_remove (jd->d_inc_trs, pos);
return 0;
}
pos++;
}
}
if (jc->c_out_tr == tr)
{
jc->c_out_tr = NULL; /* can be NULL */
return 0;
}
for (jd = jc->c_dialogs; jd != NULL; jd = jd->next)
{
pos = 0;
while (!osip_list_eol (jd->d_out_trs, pos))
{
out_tr = osip_list_get (jd->d_out_trs, pos);
if (out_tr == tr)
{
osip_list_remove (jd->d_out_trs, pos);
return 0;
}
pos++;
}
}
OSIP_TRACE (osip_trace (__FILE__, __LINE__, OSIP_INFO1, NULL,
"eXosip: No information.\n"));
return -1;
}
示例7: _sdp_analyse_attribute
int
_sdp_analyse_attribute (sdp_message_t * sdp, sdp_media_t * med)
{
int pos;
int pos_media;
/* test media attributes */
pos = 0;
while (!osip_list_eol (med->a_attributes, pos))
{
sdp_attribute_t *at;
at = (sdp_attribute_t *) osip_list_get (med->a_attributes, pos);
if (at->a_att_field != NULL && 0 == strcmp (at->a_att_field, "sendonly"))
{
return _SENDONLY;
} else if (at->a_att_field != NULL &&
0 == strcmp (at->a_att_field, "recvonly"))
{
return _RECVONLY;
} else if (at->a_att_field != NULL &&
0 == strcmp (at->a_att_field, "sendrecv"))
{
return _SENDRECV;
}
pos++;
}
/* test global attributes */
pos_media = -1;
pos = 0;
while (!osip_list_eol (sdp->a_attributes, pos))
{
sdp_attribute_t *at;
at = (sdp_attribute_t *) osip_list_get (sdp->a_attributes, pos);
if (at->a_att_field != NULL && 0 == strcmp (at->a_att_field, "sendonly"))
{
return _SENDONLY;
} else if (at->a_att_field != NULL &&
0 == strcmp (at->a_att_field, "recvonly"))
{
return _RECVONLY;
} else if (at->a_att_field != NULL &&
0 == strcmp (at->a_att_field, "sendrecv"))
{
return _SENDRECV;
}
pos++;
}
return _SENDRECV;
}
示例8: osip_dialog_update_route_set_as_uas
int
osip_dialog_update_route_set_as_uas (osip_dialog_t * dialog, osip_message_t * invite)
{
osip_contact_t *contact;
int i;
if (dialog == NULL)
return OSIP_BADPARAMETER;
if (invite == NULL)
return OSIP_BADPARAMETER;
if (osip_list_eol (&invite->contacts, 0)) {
OSIP_TRACE (osip_trace (__FILE__, __LINE__, OSIP_WARNING, NULL, "missing a contact in invite!\n"));
}
else {
if (dialog->remote_contact_uri != NULL) {
osip_contact_free (dialog->remote_contact_uri);
}
dialog->remote_contact_uri = NULL;
contact = osip_list_get (&invite->contacts, 0);
i = osip_contact_clone (contact, &(dialog->remote_contact_uri));
if (i != 0)
return i;
}
return OSIP_SUCCESS;
}
示例9: _eXosip_find_last_out_invite
osip_transaction_t *
_eXosip_find_last_out_invite (eXosip_call_t * jc, eXosip_dialog_t * jd)
{
osip_transaction_t *out_tr;
int pos;
out_tr = NULL;
pos = 0;
if (jd == NULL && jc == NULL)
return NULL;
if (jd != NULL) {
while (!osip_list_eol (jd->d_out_trs, pos)) {
out_tr = osip_list_get (jd->d_out_trs, pos);
if (0 == strcmp (out_tr->cseq->method, "INVITE"))
break;
else
out_tr = NULL;
pos++;
}
}
if (out_tr == NULL)
return jc->c_out_tr; /* can be NULL */
return out_tr;
}
示例10: osip_uri_param_get_byname
int
osip_uri_param_get_byname (osip_list_t * params, char *pname,
osip_uri_param_t ** url_param)
{
int pos = 0;
size_t pname_len;
osip_uri_param_t *u_param;
*url_param = NULL;
if (pname == NULL)
return -1;
pname_len = strlen (pname);
if (pname_len <= 0)
return -1;
while (!osip_list_eol (params, pos))
{
size_t len;
u_param = (osip_uri_param_t *) osip_list_get (params, pos);
len = strlen (u_param->gname);
if (pname_len == len
&& osip_strncasecmp (u_param->gname, pname, strlen (pname)) == 0)
{
*url_param = u_param;
return 0;
}
pos++;
}
return -1;
}
示例11: osip_uri_free
void
osip_uri_free (osip_uri_t * url)
{
int pos = 0;
if (url == NULL)
return;
osip_free (url->scheme);
osip_free (url->username);
osip_free (url->password);
osip_free (url->host);
osip_free (url->port);
osip_uri_param_freelist (&url->url_params);
{
osip_uri_header_t *u_header;
while (!osip_list_eol (&url->url_headers, pos))
{
u_header = (osip_uri_header_t *) osip_list_get (&url->url_headers, pos);
osip_list_remove (&url->url_headers, pos);
osip_uri_header_free (u_header);
}
}
osip_free (url->string);
osip_free (url);
}
示例12: eXtl_update_local_target
static int
eXtl_update_local_target(osip_message_t *req)
{
int pos = 0;
if (dtls_firewall_ip!='\0')
{
while (!osip_list_eol (&req->contacts, pos))
{
osip_contact_t *co;
co = (osip_contact_t *) osip_list_get (&req->contacts, pos);
pos++;
if (co != NULL && co->url != NULL && co->url->host != NULL
&& 0 == osip_strcasecmp (co->url->host, dtls_firewall_ip))
{
if (co->url->port == NULL &&
0 != osip_strcasecmp (dtls_firewall_port, "5061"))
{
co->url->port = osip_strdup (dtls_firewall_port);
}
else if (co->url->port != NULL &&
0 != osip_strcasecmp (dtls_firewall_port,
co->url->port))
{
osip_free (co->url->port);
co->url->port = osip_strdup (dtls_firewall_port);
}
}
}
}
return 0;
}
示例13: sdp_append_time_descr
static int
sdp_append_time_descr (char *string, int size, char *tmp,
sdp_time_descr_t * time_descr, char **next_tmp)
{
int pos;
if (time_descr->t_start_time == NULL)
return -1;
if (time_descr->t_stop_time == NULL)
return -1;
tmp = __osip_sdp_append_string (string, size, tmp, "t=");
tmp =
__osip_sdp_append_string (string, size, tmp, time_descr->t_start_time);
tmp = __osip_sdp_append_string (string, size, tmp, " ");
tmp = __osip_sdp_append_string (string, size, tmp, time_descr->t_stop_time);
tmp = __osip_sdp_append_string (string, size, tmp, CRLF);
pos = 0;
while (!osip_list_eol (time_descr->r_repeats, pos))
{
char *str = (char *) osip_list_get (time_descr->r_repeats, pos);
tmp = __osip_sdp_append_string (string, size, tmp, "r=");
tmp = __osip_sdp_append_string (string, size, tmp, str);
tmp = __osip_sdp_append_string (string, size, tmp, CRLF);
pos++;
}
*next_tmp = tmp;
return 0;
}
示例14: _eXosip_find_last_inc_transaction
osip_transaction_t *
_eXosip_find_last_inc_transaction (eXosip_call_t * jc, eXosip_dialog_t * jd, const char *method)
{
osip_transaction_t *inc_tr;
int pos;
inc_tr = NULL;
pos = 0;
if (method == NULL || method[0] == '\0')
return NULL;
if (jd != NULL) {
while (!osip_list_eol (jd->d_inc_trs, pos)) {
inc_tr = osip_list_get (jd->d_inc_trs, pos);
if (0 == osip_strcasecmp (inc_tr->cseq->method, method))
break;
else
inc_tr = NULL;
pos++;
}
}
else
inc_tr = NULL;
return inc_tr;
}
示例15: eXosip_find_last_inc_subscribe
osip_transaction_t *
eXosip_find_last_inc_subscribe (eXosip_notify_t * jn, eXosip_dialog_t * jd)
{
osip_transaction_t *inc_tr;
int pos;
inc_tr = NULL;
pos = 0;
if (jd != NULL)
{
while (!osip_list_eol (jd->d_inc_trs, pos))
{
inc_tr = osip_list_get (jd->d_inc_trs, pos);
if (0 == strcmp (inc_tr->cseq->method, "SUBSCRIBE"))
break;
else
inc_tr = NULL;
pos++;
}
} else
inc_tr = NULL;
if (inc_tr == NULL)
return jn->n_inc_tr; /* can be NULL */
return inc_tr;
}