• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ osip_free函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中osip_free函数的典型用法代码示例。如果您正苦于以下问题:C++ osip_free函数的具体用法?C++ osip_free怎么用?C++ osip_free使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了osip_free函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: sip_login_do_login

static int sip_login_do_login(SipSetupContext * ctx, const char *uri, const char *passwd){
	LinphoneProxyConfig *cfg=sip_setup_context_get_proxy_config(ctx);
	LinphoneCore *lc=linphone_proxy_config_get_core(cfg);
	LinphoneAuthInfo *auth;
	osip_from_t *parsed_uri;
	char *tmp;

	osip_from_init(&parsed_uri);
	osip_from_parse(parsed_uri,uri);
	if (parsed_uri->displayname==NULL || strlen(parsed_uri->displayname)==0){
		guess_display_name(parsed_uri);
	}
	osip_from_to_str(parsed_uri,&tmp);
	linphone_proxy_config_set_identity(cfg,tmp);
	if (passwd ) {
		auth=linphone_auth_info_new(parsed_uri->url->username,NULL,passwd,NULL,NULL);
		linphone_core_add_auth_info(lc,auth);
	}
	linphone_proxy_config_enable_register(cfg,TRUE);
	linphone_proxy_config_done(cfg);
	osip_free(tmp);
	osip_from_free(parsed_uri);
	ms_message("SipLogin: done");
	return 0;
}
开发者ID:hunghtbk,项目名称:LinphoneV1,代码行数:25,代码来源:siplogin.c


示例2: _eXosip_subscribe_free

void
_eXosip_subscribe_free (struct eXosip_t *excontext, eXosip_subscribe_t * js)
{
  /* ... */

  eXosip_dialog_t *jd;

  if (js->s_inc_tr != NULL && js->s_inc_tr->orig_request != NULL && js->s_inc_tr->orig_request->call_id != NULL && js->s_inc_tr->orig_request->call_id->number != NULL)
    _eXosip_delete_nonce (excontext, js->s_inc_tr->orig_request->call_id->number);
  else if (js->s_out_tr != NULL && js->s_out_tr->orig_request != NULL && js->s_out_tr->orig_request->call_id != NULL && js->s_out_tr->orig_request->call_id->number != NULL)
    _eXosip_delete_nonce (excontext, js->s_out_tr->orig_request->call_id->number);

  for (jd = js->s_dialogs; jd != NULL; jd = js->s_dialogs) {
    REMOVE_ELEMENT (js->s_dialogs, jd);
    _eXosip_dialog_free (excontext, jd);
  }

  _eXosip_delete_reserved (js->s_inc_tr);
  _eXosip_delete_reserved (js->s_out_tr);
  if (js->s_inc_tr != NULL)
    osip_list_add (&excontext->j_transactions, js->s_inc_tr, 0);
  if (js->s_out_tr != NULL)
    osip_list_add (&excontext->j_transactions, js->s_out_tr, 0);

  osip_free (js);
}
开发者ID:CrazyBBer,项目名称:sip_stack,代码行数:26,代码来源:jsubscribe.c


示例3: sdp_message_clone

int
sdp_message_clone (sdp_message_t * sdp, sdp_message_t ** dest)
{
  int i;
  char *body;

  i = sdp_message_init (dest);
  if (i != 0)
    return -1;

  i = sdp_message_to_str (sdp, &body);
  if (i != 0)
    goto error_sc1;

  i = sdp_message_parse (*dest, body);
  osip_free (body);
  if (i != 0)
    goto error_sc1;

  return 0;

error_sc1:
  sdp_message_free (*dest);
  return -1;
}
开发者ID:Nymphetaminer,项目名称:dsl-n55u,代码行数:25,代码来源:sdp_message.c


示例4: main

int main(int argc, char **argv)
{
	FILE *froms_file;


	osip_from_t *from;
	char *a_from;
	char *dest;
	char *res;

	froms_file = fopen(argv[1], "r");
	if (froms_file == NULL) {
		fprintf(stdout, "Failed to open %s file.\nUsage: tfrom froms.txt\n",
				argv[1]);
		exit(0);
	}

	a_from = (char *) osip_malloc(200);
	res = fgets(a_from, 200, froms_file);	/* lines are under 200 */
	while (res != NULL) {

		int errcode;

		/* remove the last '\n' before parsing */
		strncpy(a_from + strlen(a_from) - 1, "\0", 1);

		if (0 != strncmp(a_from, "#", 1)) {
			/* allocate & init from */
			osip_from_init(&from);
			printf("=================================================\n");
			printf("FROM TO PARSE: |%s|\n", a_from);
			errcode = osip_from_parse(from, a_from);
			if (errcode != -1) {
				if (osip_from_to_str(from, &dest) != -1) {
					printf("result:        |%s|\n", dest);
					osip_free(dest);
				}
			} else
				printf("Bad from format: %s\n", a_from);
			osip_from_free(from);
			printf("=================================================\n");
		}
		res = fgets(a_from, 200, froms_file);	/* lines are under 200 */
	}
	osip_free(a_from);
	return 0;
}
开发者ID:AirDev,项目名称:linphone-android,代码行数:47,代码来源:tfrom.c


示例5: main

int main(int argc, char **argv)
{
	FILE *callids_file;


	osip_call_id_t *callid;
	char *a_callid;
	char *dest;
	char *res;

	callids_file = fopen(argv[1], "r");
	if (callids_file == NULL) {
		fprintf(stdout,
				"Failed to open %s file.\nUsage: tcallid callids.txt\n", argv[1]);
		exit(0);
	}

	a_callid = (char *) osip_malloc(200);
	res = fgets(a_callid, 200, callids_file);	/* lines are under 200 */
	while (res != NULL) {

		int errcode;

		/* remove the last '\n' before parsing */
		strncpy(a_callid + strlen(a_callid) - 1, "\0", 1);

		if (0 != strncmp(a_callid, "#", 1)) {
			/* allocate & init callid */
			osip_call_id_init(&callid);
			printf("=================================================\n");
			printf("CALLID TO PARSE: |%s|\n", a_callid);
			errcode = osip_call_id_parse(callid, a_callid);
			if (errcode != -1) {
				if (osip_call_id_to_str(callid, &dest) != -1) {
					printf("result:        |%s|\n", dest);
					osip_free(dest);
				}
			} else
				printf("Bad callid format: %s\n", a_callid);
			osip_call_id_free(callid);
			printf("=================================================\n");
		}
		res = fgets(a_callid, 200, callids_file);	/* lines are under 200 */
	}
	osip_free(a_callid);
	return 0;
}
开发者ID:AirDev,项目名称:linphone-android,代码行数:47,代码来源:tcallid.c


示例6: __osip_nist_init

int
__osip_nist_init (osip_nist_t ** nist, osip_t * osip, osip_message_t * invite)
{
  int i;

  OSIP_TRACE (osip_trace
              (__FILE__, __LINE__, OSIP_INFO2, NULL, "allocating NIST context\n"));

  *nist = (osip_nist_t *) osip_malloc (sizeof (osip_nist_t));
  if (*nist == NULL)
    return OSIP_NOMEM;
  memset (*nist, 0, sizeof (osip_nist_t));
  /* for INVITE retransmissions */
  {
    osip_via_t *via;
    char *proto;

    i = osip_message_get_via (invite, 0, &via); /* get top via */
    if (i < 0)
	{
	  osip_free (*nist);
	  *nist=NULL;
	  return i;
	}
    proto = via_get_protocol (via);
    if (proto == NULL)
	{
	  osip_free (*nist);
	  *nist=NULL;
	  return OSIP_UNDEFINED_ERROR;
	}

    if (osip_strcasecmp (proto, "TCP") != 0
        && osip_strcasecmp (proto, "TLS") != 0
        && osip_strcasecmp (proto, "SCTP") != 0)
      {
        (*nist)->timer_j_length = 64 * DEFAULT_T1;
        (*nist)->timer_j_start.tv_sec = -1;     /* not started */
    } else
      {                         /* reliable protocol is used: */
        (*nist)->timer_j_length = 0;    /* MUST do the transition immediatly */
        (*nist)->timer_j_start.tv_sec = -1;     /* not started */
      }
  }

  return OSIP_SUCCESS;
}
开发者ID:LaughingAngus,项目名称:linphone-vs2008,代码行数:47,代码来源:nist.c


示例7: aiptv_log_message

void aiptv_log_message(osip_message_t *sip_message)
{
char *dest = NULL;
size_t length = 0;
osip_message_to_str (sip_message, &dest, &length);
aiptv_log(dest);
osip_free(dest);
}
开发者ID:WindyCitySDR,项目名称:uctimscharging,代码行数:8,代码来源:auxilliary_methods.c


示例8: groups_ctx_free

void
groups_ctx_free()
{
    if (groups_context==NULL) return;

    osip_free(groups_context);
    groups_context = NULL;
}
开发者ID:gozfree,项目名称:src,代码行数:8,代码来源:groups.c


示例9: 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 OSIP_BADPARAMETER;

	/* 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);
	if (buf == NULL)
		return OSIP_NOMEM;
	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 0
		if (!osip_list_eol(content_type->gen_params, pos)) {	/* needed for cannonical form! (authentication issue of rfc2543) */
			sprintf(tmp, " ");
			tmp++;
		}
#endif
		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 OSIP_SYNTAXERROR;
			}
			tmp_len = strlen(buf) + 4 + strlen(u_param->gname)
				+ strlen(u_param->gvalue) + 1;
			if (len < tmp_len) {
				buf = osip_realloc(buf, tmp_len);
				len = tmp_len;
				tmp = buf + strlen(buf);
			}
			snprintf(tmp, len - (tmp - buf), "; %s=%s", u_param->gname, u_param->gvalue);
			tmp = tmp + strlen(tmp);
			pos++;
		}
	}
	*dest = buf;
	return OSIP_SUCCESS;
}
开发者ID:avis,项目名称:osip,代码行数:59,代码来源:osip_content_type.c


示例10: osip_dialog_match_as_uas

int
osip_dialog_match_as_uas (osip_dialog_t * dlg, osip_message_t * request)
{
    osip_generic_param_t *tag_param_remote;
    int i;
    char *tmp;

    osip_call_id_to_str (request->call_id, &tmp);
    if (0 != strcmp (dlg->call_id, tmp))
    {
        osip_free (tmp);
        return -1;
    }
    osip_free (tmp);

    /* for INCOMING REQUEST:
       To: local_uri;local_tag           <- LOCAL TAG ALWAYS EXIST
       From: remote_uri;remote_tag
     */

    if (dlg->local_tag == NULL)
        /* NOT POSSIBLE BECAUSE I MANAGE REMOTE_TAG AND I ALWAYS ADD IT! */
        return -1;

    i = osip_from_get_tag (request->from, &tag_param_remote);
    if (i != 0 && dlg->remote_tag != NULL)	/* no tag in request but tag in dialog */
        return -1;			/* impossible... */
    if (i != 0 && dlg->remote_tag == NULL)	/* no tag in request AND no tag in dialog */
    {
        if (0 ==
                osip_from_compare ((osip_from_t *) dlg->remote_uri, (osip_from_t *) request->from)
                && 0 == osip_from_compare (dlg->local_uri, request->to))
            return 0;
        return -1;
    }

    /* we don't have to compare
       remote_uri with from
       && local_uri with to.    ----> we have both tag recognized, it's enough..
     */
    if (0 == strcmp (tag_param_remote->gvalue, dlg->remote_tag))
        return 0;

    return -1;
}
开发者ID:smx-smx,项目名称:dsl-n55u,代码行数:45,代码来源:osip_dialog.c


示例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);
}
开发者ID:tws67,项目名称:bayonne-base-windows,代码行数:30,代码来源:osip_uri.c


示例12: strcat_simple_header

static int
strcat_simple_header (char **_string, size_t * malloc_size, char **_message, void *ptr_header, char *header_name, size_t size_of_header, int (*xxx_to_str) (void *, char **), char **next)
{
  char *string;
  char *message;
  char *tmp;
  int i;

  string = *_string;
  message = *_message;

  if (ptr_header != NULL) {
    if (*malloc_size < message - string + 100 + size_of_header)
      /* take some memory avoid to osip_realloc too much often */
    {                           /* should not happen often */
      size_t size = message - string;

      *malloc_size = message - string + size_of_header + 100;
      string = osip_realloc (string, *malloc_size);
      if (string == NULL) {
        *_string = NULL;
        *_message = NULL;
        return OSIP_NOMEM;
      }
      message = string + size;
    }
    message = osip_strn_append (message, header_name, size_of_header);

    i = xxx_to_str (ptr_header, &tmp);
    if (i != 0) {
      *_string = string;
      *_message = message;
      *next = NULL;
      return i;
    }
    if (*malloc_size < message - string + strlen (tmp) + 100) {
      size_t size = message - string;

      *malloc_size = message - string + strlen (tmp) + 100;
      string = osip_realloc (string, *malloc_size);
      if (string == NULL) {
        *_string = NULL;
        *_message = NULL;
        return OSIP_NOMEM;
      }
      message = string + size;
    }

    message = osip_str_append (message, tmp);
    osip_free (tmp);
    message = osip_strn_append (message, CRLF, 2);
  }
  *_string = string;
  *_message = message;
  *next = message;
  return OSIP_SUCCESS;
}
开发者ID:benjaminlevine,项目名称:Huawei-HG633-Open-Source-Software-Package,代码行数:57,代码来源:osip_message_to_str.c


示例13: PPL_DECLARE

PPL_DECLARE (int) ppl_pipe_close (ppl_pipe_t * apipe)
{
  if (apipe == NULL)
    return -1;
  ppl_socket_close (apipe->pipes[0]);
  ppl_socket_close (apipe->pipes[1]);
  osip_free (apipe);
  return 0;
}
开发者ID:gozfree,项目名称:src,代码行数:9,代码来源:pplpipe.c


示例14: jpipe_close

int jpipe_close (jpipe_t * apipe)
{
  if (apipe == NULL)
    return -1;
  close (apipe->pipes[0]);
  close (apipe->pipes[1]);
  osip_free (apipe);
  return 0;
}
开发者ID:BackupTheBerlios,项目名称:sfsipua-svn,代码行数:9,代码来源:jpipe.c


示例15: jpipe_close

int jpipe_close(jpipe_t * apipe)
{
	if (apipe == NULL)
		return OSIP_BADPARAMETER;
	close(apipe->pipes[0]);
	close(apipe->pipes[1]);
	osip_free(apipe);
	return OSIP_SUCCESS;
}
开发者ID:AirDev,项目名称:linphone-android,代码行数:9,代码来源:jpipe.c


示例16: osip_negotiation_ctx_free

void
osip_negotiation_ctx_free (osip_negotiation_ctx_t * con)
{
  if (con == NULL)
    return;
  sdp_message_free (con->remote);
  sdp_message_free (con->local);
  osip_free (con);
}
开发者ID:samm-git,项目名称:e3372h-vendor-src,代码行数:9,代码来源:osip_negotiation.c


示例17: ls_localdb_ctx_free

void
ls_localdb_ctx_free ()
{
  if (ls_localdb_context == NULL)
    return;

  osip_free (ls_localdb_context);
  ls_localdb_context = NULL;
}
开发者ID:gozfree,项目名称:src,代码行数:9,代码来源:ls_localdb.c


示例18: osip_mutex_destroy

void
osip_mutex_destroy (struct osip_mutex *_mut)
{
  osip_mutex_t *mut = (osip_mutex_t *) _mut;
  if (mut == NULL)
    return;
  CloseHandle (mut->h);
  osip_free (mut);
}
开发者ID:samm-git,项目名称:e3372h-vendor-src,代码行数:9,代码来源:port_sema.c


示例19: tlp_plugin_free

void
tlp_plugin_free (tlp_plugin_t * plug)
{
  if (plug == NULL)
    return;
  psp_plugin_free (plug->psp_plugin);
  /*  THIS IS NOT A DYMAMIC ELEMENT!!  + THIS IS ATTACHED TO SEVERAL
     PSP_PLUGIN... so the next line will never be called
     osip_free(plug->psp_plugin); */
  /*  Already closed by the plugin itself.
    if (plug->in_socket != -1)
    ppl_socket_close (plug->in_socket);
  */
  plug->in_socket = -1;
  osip_free (plug->rcv_func);
  osip_free (plug->snd_func);
  osip_free (plug);
}
开发者ID:gozfree,项目名称:src,代码行数:18,代码来源:tlp_plugin.c


示例20: __osip_ist_free

int
__osip_ist_free (osip_ist_t * ist)
{
  if (ist == NULL)
    return OSIP_SUCCESS;
  OSIP_TRACE (osip_trace (__FILE__, __LINE__, OSIP_INFO2, NULL, "free ist resource\n"));
  osip_free (ist);
  return OSIP_SUCCESS;
}
开发者ID:Christof0113,项目名称:rtsp-tools,代码行数:9,代码来源:ist.c



注:本文中的osip_free函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ osip_list_add函数代码示例发布时间:2022-05-30
下一篇:
C++ osi_free函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap