亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? osip_dialog.c

?? SIP協議棧實現
?? C
字號:
/*  The oSIP library implements the Session Initiation Protocol (SIP -rfc3261-)  Copyright (C) 2001,2002,2003  Aymeric MOIZARD jack@atosc.org    This library is free software; you can redistribute it and/or  modify it under the terms of the GNU Lesser General Public  License as published by the Free Software Foundation; either  version 2.1 of the License, or (at your option) any later version.    This library is distributed in the hope that it will be useful,  but WITHOUT ANY WARRANTY; without even the implied warranty of  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU  Lesser General Public License for more details.    You should have received a copy of the GNU Lesser General Public  License along with this library; if not, write to the Free Software  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA*/#include <osip2/internal.h>#include <osip2/osip.h>#include "fsm.h"#include <osip2/osip_dialog.h>voidosip_dialog_set_state (osip_dialog_t * dialog, state_t state){  dialog->state = state;}intosip_dialog_update_route_set_as_uas (osip_dialog_t * dialog, osip_message_t * invite){  osip_contact_t *contact;  int i;  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 -1;    }  return 0;}intosip_dialog_update_osip_cseq_as_uas (osip_dialog_t * dialog, osip_message_t * invite){  dialog->remote_cseq = osip_atoi (invite->cseq->number);  return 0;}intosip_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 (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, -1);	  pos++;	}    }  if (MSG_IS_STATUS_2XX (response))    dialog->state = DIALOG_CONFIRMED;  return 0;}intosip_dialog_update_tag_as_uac (osip_dialog_t * dialog, osip_message_t * response){  osip_generic_param_t *tag;  int i;  i = osip_to_get_tag (response->to, &tag);  if (i != 0)    {      OSIP_TRACE (osip_trace		  (__FILE__, __LINE__, OSIP_WARNING, NULL,		   "Remote UA is not compliant: missing a tag in response!\n"));      dialog->remote_tag = NULL;    }  else    dialog->remote_tag = osip_strdup (tag->gvalue);  return 0;}intosip_dialog_match_as_uac (osip_dialog_t * dlg, osip_message_t * answer){  osip_generic_param_t *tag_param_local;  osip_generic_param_t *tag_param_remote;  char *tmp;  int i;  osip_call_id_to_str (answer->call_id, &tmp);  if (0 != strcmp (dlg->call_id, tmp))    {      osip_free (tmp);      return -1;    }  osip_free (tmp);  /* for INCOMING RESPONSE:     To: remote_uri;remote_tag     From: local_uri;local_tag           <- LOCAL TAG ALWAYS EXIST   */  i = osip_from_get_tag (answer->from, &tag_param_local);  if (i != 0)    return -1;  if (dlg->local_tag == NULL)    /* NOT POSSIBLE BECAUSE I MANAGE REMOTE_TAG AND I ALWAYS ADD IT! */    return -1;  if (0 != strcmp (tag_param_local->gvalue, dlg->local_tag))    return -1;  i = osip_to_get_tag (answer->to, &tag_param_remote);  if (i != 0 && dlg->remote_tag != NULL)	/* no tag in response but tag in dialog */    return -1;			/* impossible... */  if (i != 0 && dlg->remote_tag == NULL)	/* no tag in response AND no tag in dialog */    {      if (0 ==	  osip_from_compare ((osip_from_t *) dlg->local_uri, (osip_from_t *) answer->from)	  && 0 == osip_from_compare (dlg->remote_uri, answer->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;}intosip_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;}intosip_dialog_init_as_uac (osip_dialog_t ** dialog, osip_message_t * response){  int i;  int pos;  osip_generic_param_t *tag;  *dialog = NULL;  i = osip_to_get_tag (response->to, &tag);  if (i != 0)    {      OSIP_TRACE (osip_trace		  (__FILE__, __LINE__, OSIP_WARNING, NULL,		   "Remote UA is not compliant: missing a tag in response!\n"));      return -1;    }  (*dialog) = (osip_dialog_t *) osip_malloc (sizeof (osip_dialog_t));  if (*dialog == NULL)    return -1;  (*dialog)->type = CALLER;  if (MSG_IS_STATUS_2XX (response))    (*dialog)->state = DIALOG_CONFIRMED;  else				/* 1XX */    (*dialog)->state = DIALOG_EARLY;  i = osip_call_id_to_str (response->call_id, &((*dialog)->call_id));  if (i != 0)    goto diau_error_0;  i = osip_from_get_tag (response->from, &tag);  if (i != 0)    goto diau_error_1;  (*dialog)->local_tag = osip_strdup (tag->gvalue);  i = osip_to_get_tag (response->to, &tag);  if (i != 0)    {      OSIP_TRACE (osip_trace		  (__FILE__, __LINE__, OSIP_WARNING, NULL,		   "Remote UA is not compliant: missing a tag in response!\n"));      (*dialog)->remote_tag = NULL;    }  else    (*dialog)->remote_tag = osip_strdup (tag->gvalue);  (*dialog)->route_set = (osip_list_t *) osip_malloc (sizeof (osip_list_t));  osip_list_init ((*dialog)->route_set);  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)	goto diau_error_2;      osip_list_add ((*dialog)->route_set, rr2, -1);      pos++;    }  (*dialog)->local_cseq = osip_atoi (response->cseq->number);  (*dialog)->remote_cseq = -1;  i = osip_to_clone (response->to, &((*dialog)->remote_uri));  if (i != 0)    goto diau_error_3;  i = osip_from_clone (response->from, &((*dialog)->local_uri));  if (i != 0)    goto diau_error_4;  {    osip_contact_t *contact;    if (!osip_list_eol (response->contacts, 0))      {	contact = osip_list_get (response->contacts, 0);	i = osip_contact_clone (contact, &((*dialog)->remote_contact_uri));	if (i != 0)	  goto diau_error_5;      }    else      {	(*dialog)->remote_contact_uri = NULL;	OSIP_TRACE (osip_trace		    (__FILE__, __LINE__, OSIP_WARNING, NULL,		     "Remote UA is not compliant: missing a contact in response!\n"));      }  }  (*dialog)->secure = -1;	/* non secure */  return 0;diau_error_5:  osip_from_free ((*dialog)->local_uri);diau_error_4:  osip_from_free ((*dialog)->remote_uri);diau_error_3:diau_error_2:  osip_list_special_free ((*dialog)->route_set,		     (void *(*)(void *)) &osip_record_route_free);  osip_free ((*dialog)->remote_tag);  osip_free ((*dialog)->local_tag);diau_error_1:  osip_free ((*dialog)->call_id);diau_error_0:  OSIP_TRACE (osip_trace	      (__FILE__, __LINE__, OSIP_ERROR, NULL,	       "Could not establish dialog!\n"));  osip_free (*dialog);  *dialog = NULL;  return -1;}#if 1 /* SIPIT13 */intosip_dialog_init_as_uac_with_remote_request (osip_dialog_t ** dialog, osip_message_t *next_request, int local_cseq){  int i;  osip_generic_param_t *tag;  *dialog = NULL;  i = osip_to_get_tag (next_request->from, &tag);  if (i != 0)    {      OSIP_TRACE (osip_trace		  (__FILE__, __LINE__, OSIP_WARNING, NULL,		   "Remote UA is not compliant: missing a tag in next request!\n"));      return -1;    }  (*dialog) = (osip_dialog_t *) osip_malloc (sizeof (osip_dialog_t));  if (*dialog == NULL)    return -1;  (*dialog)->type = CALLER;#if 0  (*dialog)->state = DIALOG_CONFIRMED;#endif  (*dialog)->state = DIALOG_EARLY;  i = osip_call_id_to_str (next_request->call_id, &((*dialog)->call_id));  if (i != 0)    goto diau_error_0;  i = osip_from_get_tag (next_request->to, &tag);  if (i != 0)    goto diau_error_1;  (*dialog)->local_tag = osip_strdup (tag->gvalue);  i = osip_to_get_tag (next_request->from, &tag);  if (i != 0)    {      OSIP_TRACE (osip_trace		  (__FILE__, __LINE__, OSIP_WARNING, NULL,		   "Remote UA is not compliant: missing a tag in next request!\n"));      (*dialog)->remote_tag = NULL;    }  else    (*dialog)->remote_tag = osip_strdup (tag->gvalue);  (*dialog)->route_set = (osip_list_t *) osip_malloc (sizeof (osip_list_t));  osip_list_init ((*dialog)->route_set);  (*dialog)->local_cseq = local_cseq; /* -1 osip_atoi (xxx->cseq->number); */  (*dialog)->remote_cseq = osip_atoi (next_request->cseq->number);  i = osip_to_clone (next_request->from, &((*dialog)->remote_uri));  if (i != 0)    goto diau_error_3;  i = osip_from_clone (next_request->to, &((*dialog)->local_uri));  if (i != 0)    goto diau_error_4;  (*dialog)->secure = -1;	/* non secure */  return 0;diau_error_4:  osip_from_free ((*dialog)->remote_uri);diau_error_3:  osip_free ((*dialog)->remote_tag);  osip_free ((*dialog)->local_tag);diau_error_1:  osip_free ((*dialog)->call_id);diau_error_0:  OSIP_TRACE (osip_trace	      (__FILE__, __LINE__, OSIP_ERROR, NULL,	       "Could not establish dialog!\n"));  osip_free (*dialog);  *dialog = NULL;  return -1;}#endifintosip_dialog_init_as_uas (osip_dialog_t ** dialog, osip_message_t * invite, osip_message_t * response){  int i;  int pos;  osip_generic_param_t *tag;  (*dialog) = (osip_dialog_t *) osip_malloc (sizeof (osip_dialog_t));  if (*dialog == NULL)    return -1;  (*dialog)->type = CALLEE;  if (MSG_IS_STATUS_2XX (response))    (*dialog)->state = DIALOG_CONFIRMED;  else				/* 1XX */    (*dialog)->state = DIALOG_EARLY;  i = osip_call_id_to_str (response->call_id, &((*dialog)->call_id));  if (i != 0)    goto diau_error_0;  i = osip_to_get_tag (response->to, &tag);  if (i != 0)    goto diau_error_1;  (*dialog)->local_tag = osip_strdup (tag->gvalue);  i = osip_from_get_tag (response->from, &tag);  if (i != 0)    {      OSIP_TRACE (osip_trace		  (__FILE__, __LINE__, OSIP_WARNING, NULL,		   "Remote UA is not compliant: missing a tag in response!\n"));      (*dialog)->remote_tag = NULL;    }  else    (*dialog)->remote_tag = osip_strdup (tag->gvalue);  (*dialog)->route_set = (osip_list_t *) osip_malloc (sizeof (osip_list_t));  osip_list_init ((*dialog)->route_set);  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)	goto diau_error_2;      osip_list_add ((*dialog)->route_set, rr2, -1);      pos++;    }  /* local_cseq is set to response->cseq->number for better     handling of bad UA */  (*dialog)->local_cseq = osip_atoi (response->cseq->number);  (*dialog)->remote_cseq = osip_atoi (response->cseq->number);  i = osip_from_clone (response->from, &((*dialog)->remote_uri));  if (i != 0)    goto diau_error_3;  i = osip_to_clone (response->to, &((*dialog)->local_uri));  if (i != 0)    goto diau_error_4;  {    osip_contact_t *contact;    if (!osip_list_eol (invite->contacts, 0))      {	contact = osip_list_get (invite->contacts, 0);	i = osip_contact_clone (contact, &((*dialog)->remote_contact_uri));	if (i != 0)	  goto diau_error_5;      }    else      {	(*dialog)->remote_contact_uri = NULL;	OSIP_TRACE (osip_trace		    (__FILE__, __LINE__, OSIP_WARNING, NULL,		     "Remote UA is not compliant: missing a contact in response!\n"));      }  }  (*dialog)->secure = -1;	/* non secure */  return 0;diau_error_5:  osip_from_free ((*dialog)->local_uri);diau_error_4:  osip_from_free ((*dialog)->remote_uri);diau_error_3:diau_error_2:  osip_list_special_free ((*dialog)->route_set,		     (void *(*)(void *)) &osip_record_route_free);  osip_free ((*dialog)->remote_tag);  osip_free ((*dialog)->local_tag);diau_error_1:  osip_free ((*dialog)->call_id);diau_error_0:  OSIP_TRACE (osip_trace	      (__FILE__, __LINE__, OSIP_ERROR, NULL,	       "Could not establish dialog!\n"));  osip_free (*dialog);  *dialog = NULL;  return -1;}voidosip_dialog_free (osip_dialog_t * dialog){  if (dialog == NULL)    return;  osip_contact_free (dialog->remote_contact_uri);  osip_from_free (dialog->local_uri);  osip_to_free (dialog->remote_uri);  osip_list_special_free (dialog->route_set,		     (void *(*)(void *)) &osip_record_route_free);  osip_free (dialog->remote_tag);  osip_free (dialog->local_tag);  osip_free (dialog->call_id);  osip_free (dialog);}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产精品中文字幕一区二区三区| 狠狠色丁香婷婷综合| 亚洲一区二区欧美激情| 精品国产一区二区三区久久久蜜月 | 欧美日韩亚洲综合一区| 老司机精品视频线观看86| 国产一区二区三区免费| 99精品国产视频| 欧美自拍偷拍一区| 成人成人成人在线视频| 色88888久久久久久影院野外| 欧美体内she精高潮| 亚洲精品日韩一| 日本不卡一区二区| 成人深夜视频在线观看| 欧美三级资源在线| 国产三区在线成人av| 国产欧美一区二区精品仙草咪| 国产精品久久免费看| 午夜av一区二区| 国产黄色精品网站| 欧美性生交片4| 91在线精品一区二区三区| 91精品国产麻豆| 日韩一区和二区| 亚洲日本乱码在线观看| 日韩av网站免费在线| 99久久精品国产精品久久| 在线电影国产精品| 日韩精品在线一区二区| 一区二区在线观看免费视频播放| 另类人妖一区二区av| 91香蕉视频污| 久久久久久久网| 亚洲午夜在线视频| 豆国产96在线|亚洲| 日韩亚洲欧美中文三级| 欧美电影一区二区| 亚洲蜜臀av乱码久久精品| 国产乱对白刺激视频不卡| 欧美女孩性生活视频| 亚洲欧洲无码一区二区三区| 狠狠色丁香久久婷婷综合丁香| 欧美视频在线一区二区三区 | 欧美另类高清zo欧美| 欧美精彩视频一区二区三区| 激情综合色综合久久综合| 欧美久久久影院| 日韩av在线发布| 欧美色图免费看| 在线观看不卡一区| 日韩毛片在线免费观看| 风间由美一区二区三区在线观看| 99精品视频一区二区| www国产精品av| 国产日韩v精品一区二区| 精品在线播放免费| 精品少妇一区二区三区日产乱码| 午夜精品爽啪视频| 欧美亚洲禁片免费| 欧美激情在线一区二区| 国产一区二区三区精品视频| 欧美刺激脚交jootjob| 日本不卡中文字幕| 日韩亚洲国产中文字幕欧美| 亚洲国产视频在线| 欧美精品乱码久久久久久| 夜夜夜精品看看| 欧美精品第1页| 日韩精品一级中文字幕精品视频免费观看 | 国产精品视频九色porn| 懂色av一区二区三区蜜臀| 欧美视频中文一区二区三区在线观看 | 国产在线不卡一卡二卡三卡四卡| 欧美专区亚洲专区| 天天做天天摸天天爽国产一区| 久久不见久久见免费视频7| 精品福利一二区| 亚洲色图欧洲色图| 色婷婷综合五月| 天天色 色综合| 精品久久久久久久久久久久久久久久久 | 国产视频一区在线观看| 日韩一区二区精品| 538在线一区二区精品国产| 精品少妇一区二区三区在线播放| 久久网站最新地址| 亚洲国产一区在线观看| 国产精品自拍av| 欧美性大战久久久| 欧美大片免费久久精品三p| 亚洲人快播电影网| 久久激情综合网| 欧美在线不卡一区| 精品电影一区二区| 亚洲成a人在线观看| 成人午夜激情视频| 91精品国产91热久久久做人人| 欧美国产丝袜视频| 久久国产精品99久久久久久老狼| 色综合久久天天综合网| 26uuuu精品一区二区| 一区二区三区毛片| 成人免费观看视频| 日韩写真欧美这视频| 亚洲精品日韩综合观看成人91| 精品一区二区三区香蕉蜜桃| 欧美午夜寂寞影院| 亚洲欧美另类久久久精品2019| 精品在线播放午夜| 欧美男人的天堂一二区| 亚洲免费在线视频一区 二区| 国产成人在线视频免费播放| 欧美一级久久久| 天天色天天操综合| 一本久道久久综合中文字幕| 中文字幕乱码日本亚洲一区二区 | 最新不卡av在线| 国产一区999| 日韩欧美国产系列| 日韩精品一二三| 欧美色网一区二区| 一区二区三区蜜桃| 91国偷自产一区二区开放时间 | 国产一区欧美日韩| 欧美一级二级在线观看| 亚洲高清免费视频| 欧美在线影院一区二区| 亚洲在线成人精品| 91久久精品一区二区| 亚洲视频你懂的| 91啪亚洲精品| 一区二区三区四区不卡在线| 一本大道久久a久久精二百| 亚洲天堂网中文字| 色悠悠久久综合| 亚洲自拍偷拍图区| 精品视频一区二区不卡| 亚洲成人777| 欧美日韩成人在线一区| 亚洲成人一二三| 91精品国产色综合久久| 蜜臀久久99精品久久久画质超高清 | 国产欧美日韩麻豆91| 成人福利在线看| 亚洲三级在线免费| 色8久久精品久久久久久蜜| 玉米视频成人免费看| 欧美中文字幕久久| 青青草国产成人99久久| 3d成人h动漫网站入口| 蜜桃一区二区三区四区| 26uuu久久天堂性欧美| 国产一区二区毛片| 一区二区中文字幕在线| 色婷婷精品久久二区二区蜜臀av | 麻豆成人av在线| 久久精品夜色噜噜亚洲a∨| 国产xxx精品视频大全| 欧美国产一区二区在线观看 | 欧美在线观看18| 蜜桃av一区二区在线观看 | 国产午夜精品一区二区三区四区 | 亚洲精品在线网站| 丁香婷婷综合色啪| 亚洲欧美区自拍先锋| 在线91免费看| 国产美女精品在线| 亚洲欧美一区二区三区久本道91| 在线观看日产精品| 久久国产婷婷国产香蕉| 中文字幕成人在线观看| 欧美三级日韩在线| 精品一二三四区| 自拍av一区二区三区| 欧美精品在线视频| 国产福利不卡视频| 亚洲黄色小说网站| 欧美精品一区二区精品网| 成人99免费视频| 偷拍日韩校园综合在线| 欧美精品一区二区三区高清aⅴ| www.综合网.com| 免费看精品久久片| 亚洲女子a中天字幕| 日韩欧美一级精品久久| 99精品视频在线观看| 伦理电影国产精品| 亚洲一区在线免费观看| 国产日韩精品一区| 欧美日韩在线播| fc2成人免费人成在线观看播放 | 中文字幕第一区第二区| 5566中文字幕一区二区电影| 91女厕偷拍女厕偷拍高清| 久草中文综合在线| 欧美a级理论片| 亚洲欧美日韩一区二区三区在线观看| 精品蜜桃在线看| 欧美日韩不卡一区|