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

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

?? osip.c

?? 最新osip源代碼
?? C
?? 第 1 頁 / 共 4 頁
字號:
/*  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 "xixt.h"#ifdef OSIP_MTstatic struct osip_mutex *ict_fastmutex;static struct osip_mutex *ist_fastmutex;static struct osip_mutex *nict_fastmutex;static struct osip_mutex *nist_fastmutex;#endif#include <osip2/osip_dialog.h>#ifdef OSIP_MTstatic struct osip_mutex *ixt_fastmutex;#endifstatic int __osip_global_init (void);static void __osip_global_free (void);static int increase_ref_count (void);static void decrease_ref_count (void);static int__osip_global_init (){  /* load the fsm configuration */  __ict_load_fsm ();  __ist_load_fsm ();  __nict_load_fsm ();  __nist_load_fsm ();  /* load the parser configuration */  parser_init ();#ifdef OSIP_MT  ict_fastmutex = osip_mutex_init ();  ist_fastmutex = osip_mutex_init ();  nict_fastmutex = osip_mutex_init ();  nist_fastmutex = osip_mutex_init ();  ixt_fastmutex = osip_mutex_init ();#endif  return 0;}static void__osip_global_free (){  __ict_unload_fsm ();  __ist_unload_fsm ();  __nict_unload_fsm ();  __nist_unload_fsm ();#ifdef OSIP_MT  osip_mutex_destroy (ict_fastmutex);  osip_mutex_destroy (ist_fastmutex);  osip_mutex_destroy (nict_fastmutex);  osip_mutex_destroy (nist_fastmutex);  osip_mutex_destroy (ixt_fastmutex);#endif}voidosip_response_get_destination (osip_message_t * response, char **address,                               int *portnum){  osip_via_t *via;  char *host = NULL;  int port = 0;  via = (osip_via_t *) osip_list_get (response->vias, 0);  if (via)    {      osip_generic_param_t *maddr;      osip_generic_param_t *received;      osip_generic_param_t *rport;      osip_via_param_get_byname (via, "maddr", &maddr);      osip_via_param_get_byname (via, "received", &received);      osip_via_param_get_byname (via, "rport", &rport);      /* 1: user should not use the provided information         (host and port) if they are using a reliable         transport. Instead, they should use the already         open socket attached to this transaction. */      /* 2: check maddr and multicast usage */      if (maddr != NULL)        host = maddr->gvalue;      /* we should check if this is a multicast address and use         set the "ttl" in this case. (this must be done in the         UDP message (not at the SIP layer) */      else if (received != NULL)        host = received->gvalue;      else        host = via->host;      if (rport == NULL || rport->gvalue == NULL)        {          if (via->port != NULL)            port = osip_atoi (via->port);          else            port = 5060;      } else        port = osip_atoi (rport->gvalue);    }  *portnum = port;  if (host != NULL)    *address = osip_strdup (host);  else    *address = NULL;}intosip_ixt_lock (osip_t * osip){#ifdef OSIP_MT  return osip_mutex_lock (ixt_fastmutex);#else  return 0;#endif}intosip_ixt_unlock (osip_t * osip){#ifdef OSIP_MT  return osip_mutex_unlock (ixt_fastmutex);#else  return 0;#endif}/* these are for transactions that would need retransmission not handled by state machines */voidosip_add_ixt (osip_t * osip, ixt_t * ixt){  /* ajout dans la liste de osip_t->ixt */  osip_ixt_lock (osip);  osip_list_add (osip->ixt_retransmissions, (void *) ixt, 0);  osip_ixt_unlock (osip);}voidosip_remove_ixt (osip_t * osip, ixt_t * ixt){  int i;  int found = 0;  ixt_t *tmp;  /* ajout dans la liste de osip_t->ixt */  osip_ixt_lock (osip);  for (i = 0; !osip_list_eol (osip->ixt_retransmissions, i); i++)    {      tmp = (ixt_t *) osip_list_get (osip->ixt_retransmissions, i);      if (tmp == ixt)        {          osip_list_remove (osip->ixt_retransmissions, i);          found = 1;          break;        }    }  osip_ixt_unlock (osip);}intixt_init (ixt_t ** ixt){  ixt_t *pixt;  *ixt = pixt = (ixt_t *) osip_malloc (sizeof (ixt_t));  if (pixt == NULL)    return -1;  pixt->dialog = NULL;  pixt->msg2xx = NULL;  pixt->ack = NULL;  pixt->start = time (NULL);  pixt->interval = 500;  pixt->counter = 7;  pixt->dest = NULL;  pixt->port = 5060;  pixt->sock = -1;  return 0;}voidixt_free (ixt_t * ixt){  osip_message_free (ixt->ack);  osip_message_free (ixt->msg2xx);  osip_free (ixt->dest);  osip_free (ixt);}/* usefull for UAs */voidosip_start_200ok_retransmissions (osip_t * osip, osip_dialog_t * dialog,                                  osip_message_t * msg200ok, int sock){  ixt_t *ixt;  ixt_init (&ixt);  ixt->dialog = dialog;  osip_message_clone (msg200ok, &ixt->msg2xx);  ixt->sock = sock;  osip_response_get_destination (msg200ok, &ixt->dest, &ixt->port);  osip_add_ixt (osip, ixt);}voidosip_start_ack_retransmissions (osip_t * osip, osip_dialog_t * dialog,                                osip_message_t * ack, char *dest, int port,                                int sock){  int i;  ixt_t *ixt;  i = ixt_init (&ixt);  if (i != 0)    return;  ixt->dialog = dialog;  osip_message_clone (ack, &ixt->ack);  ixt->dest = osip_strdup (dest);  ixt->port = port;  ixt->sock = sock;  osip_add_ixt (osip, ixt);}/* we stop the 200ok when receiving the corresponding ack */struct osip_dialog *osip_stop_200ok_retransmissions (osip_t * osip, osip_message_t * ack){  osip_dialog_t *dialog = NULL;  int i;  ixt_t *ixt;  osip_ixt_lock (osip);  for (i = 0; !osip_list_eol (osip->ixt_retransmissions, i); i++)    {      ixt = (ixt_t *) osip_list_get (osip->ixt_retransmissions, i);      if (osip_dialog_match_as_uas (ixt->dialog, ack) == 0)        {          osip_list_remove (osip->ixt_retransmissions, i);          ixt_free (ixt);          dialog = ixt->dialog;          break;        }    }  osip_ixt_unlock (osip);  return dialog;}/* when a dialog is destroyed by the application,   it is safer to remove all ixt that are related to it */voidosip_stop_retransmissions_from_dialog (osip_t * osip, osip_dialog_t * dialog){  int i;  ixt_t *ixt;  osip_ixt_lock (osip);  for (i = 0; !osip_list_eol (osip->ixt_retransmissions, i); i++)    {      ixt = (ixt_t *) osip_list_get (osip->ixt_retransmissions, i);      if (ixt->dialog == dialog)        {          osip_list_remove (osip->ixt_retransmissions, i);          ixt_free (ixt);          i--;        }    }  osip_ixt_unlock (osip);}voidixt_retransmit (osip_t * osip, ixt_t * ixt, time_t current){  if ((current - ixt->start) * 1000 > ixt->interval)    {      ixt->interval = ixt->interval * 2;      ixt->start = current;      if (ixt->ack != NULL)        osip->cb_send_message (NULL, ixt->ack, ixt->dest, ixt->port, ixt->sock);      else if (ixt->msg2xx != NULL)        osip->cb_send_message (NULL, ixt->msg2xx, ixt->dest, ixt->port, ixt->sock);      ixt->counter--;    }}voidosip_retransmissions_execute (osip_t * osip){  int i;  time_t current;  ixt_t *ixt;  current = time (NULL);  osip_ixt_lock (osip);  for (i = 0; !osip_list_eol (osip->ixt_retransmissions, i); i++)    {      ixt = (ixt_t *) osip_list_get (osip->ixt_retransmissions, i);      ixt_retransmit (osip, ixt, current);      if (ixt->counter == 0)        {          /* remove it */          osip_list_remove (osip->ixt_retransmissions, i);          ixt_free (ixt);          i--;        }    }  osip_ixt_unlock (osip);}intosip_ict_lock (osip_t * osip){#ifdef OSIP_MT  return osip_mutex_lock (ict_fastmutex);#else  return 0;#endif}intosip_ict_unlock (osip_t * osip){#ifdef OSIP_MT  return osip_mutex_unlock (ict_fastmutex);#else  return 0;#endif}intosip_ist_lock (osip_t * osip){#ifdef OSIP_MT  return osip_mutex_lock (ist_fastmutex);#else  return 0;#endif}intosip_ist_unlock (osip_t * osip){#ifdef OSIP_MT  return osip_mutex_unlock (ist_fastmutex);#else  return 0;#endif}intosip_nict_lock (osip_t * osip){#ifdef OSIP_MT  return osip_mutex_lock (nict_fastmutex);#else  return 0;#endif}intosip_nict_unlock (osip_t * osip){#ifdef OSIP_MT  return osip_mutex_unlock (nict_fastmutex);#else  return 0;#endif}intosip_nist_lock (osip_t * osip){#ifdef OSIP_MT  return osip_mutex_lock (nist_fastmutex);#else  return 0;#endif}intosip_nist_unlock (osip_t * osip){#ifdef OSIP_MT  return osip_mutex_unlock (nist_fastmutex);#else  return 0;#endif}#if defined(HAVE_DICT_DICT_H)#define HSIZE           200unsigned s_hash (const unsigned char *p);unsigneds_hash (const unsigned char *p){  unsigned hash = 0;  while (*p)    {      hash *= 31;      hash ^= *p++;    }  return hash;}#endifint__osip_add_ict (osip_t * osip, osip_transaction_t * ict){#ifdef OSIP_MT  osip_mutex_lock (ict_fastmutex);#endif#if defined(HAVE_DICT_DICT_H)  {    osip_generic_param_t *b_request = NULL;    int rv = -99;    osip_via_param_get_byname (ict->topvia, "branch", &b_request);    if (b_request != NULL && b_request->gvalue != NULL)      rv = dict_insert (osip->osip_ict_hastable,                        b_request->gvalue, (void *) ict, FALSE);#if 0    else      rv = dict_insert (osip->osip_ict_hastable,                        b_request->gvalue, (void *) ict, FALSE);#endif    if (rv == 0)      {        OSIP_TRACE (osip_trace                    (__FILE__, __LINE__, OSIP_INFO1, NULL,                     "New key inserted in ict hastable `%s'\n",                     b_request->gvalue));    } else if (rv != -99)      {        OSIP_TRACE (osip_trace                    (__FILE__, __LINE__, OSIP_WARNING, NULL,                     "already inserted `%s'\n", b_request->gvalue));      }  }#endif  osip_list_add (osip->osip_ict_transactions, ict, -1);#ifdef OSIP_MT  osip_mutex_unlock (ict_fastmutex);#endif  return 0;}int__osip_add_ist (osip_t * osip, osip_transaction_t * ist){#ifdef OSIP_MT  osip_mutex_lock (ist_fastmutex);#endif#if defined(HAVE_DICT_DICT_H)  {    osip_generic_param_t *b_request = NULL;    int rv = -99;    osip_via_param_get_byname (ist->topvia, "branch", &b_request);    if (b_request != NULL && b_request->gvalue != NULL)      rv = dict_insert (osip->osip_ist_hastable,                        b_request->gvalue, (void *) ist, FALSE);    else#if 0      rv = dict_insert (osip->osip_ist_hastable,                        b_request->gvalue, (void *) ist, FALSE);#endif    if (rv == 0)      {        OSIP_TRACE (osip_trace                    (__FILE__, __LINE__, OSIP_INFO1, NULL,                     "New key inserted in ist hastable `%s'\n",                     b_request->gvalue));    } else if (rv != -99)      {        OSIP_TRACE (osip_trace                    (__FILE__, __LINE__, OSIP_WARNING, NULL,                     "already inserted `%s'\n", b_request->gvalue));      }  }#endif  osip_list_add (osip->osip_ist_transactions, ist, -1);#ifdef OSIP_MT  osip_mutex_unlock (ist_fastmutex);#endif  return 0;}int__osip_add_nict (osip_t * osip, osip_transaction_t * nict){#ifdef OSIP_MT  osip_mutex_lock (nict_fastmutex);#endif#if defined(HAVE_DICT_DICT_H)  {    osip_generic_param_t *b_request = NULL;    int rv = -99;    osip_via_param_get_byname (nict->topvia, "branch", &b_request);

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
经典三级一区二区| 国产精品国产三级国产普通话蜜臀| 亚洲女人的天堂| 在线欧美日韩国产| 琪琪久久久久日韩精品| 久久色在线观看| 91国在线观看| 国产伦精品一区二区三区在线观看| 中文在线资源观看网站视频免费不卡| 一本色道久久综合精品竹菊| 久久精品久久精品| 亚洲黄色在线视频| 久久久久久久久久看片| 欧美亚洲动漫精品| 成人免费视频caoporn| 蜜桃视频在线观看一区| 亚洲在线一区二区三区| 国产欧美精品区一区二区三区 | 洋洋成人永久网站入口| 精品乱人伦小说| 欧美日韩一区二区欧美激情| 国产91在线观看| 久久精品国产免费看久久精品| 免费成人在线观看视频| 国产suv一区二区三区88区| 97aⅴ精品视频一二三区| 韩国女主播一区二区三区| 午夜精品福利一区二区三区av| 成人欧美一区二区三区在线播放| 精品国产污污免费网站入口| 538在线一区二区精品国产| 在线视频国内自拍亚洲视频| 91精品国产色综合久久久蜜香臀| 欧洲国内综合视频| 日韩精品影音先锋| 日韩三级伦理片妻子的秘密按摩| 欧美精品xxxxbbbb| 在线不卡免费av| 欧美激情一区二区三区| 亚洲大片在线观看| 偷拍日韩校园综合在线| 国产成人av影院| 不卡高清视频专区| 国产精品一区二区久久精品爱涩| 国产一区视频网站| 欧美色手机在线观看| 久久久99久久精品欧美| 91麻豆精品国产91久久久久久久久| 久久日一线二线三线suv| 亚洲成人精品一区| 国产精华液一区二区三区| 欧美日韩大陆一区二区| 欧美日韩成人高清| 国产精品美女久久久久久久久 | 亚洲成av人在线观看| 国产剧情在线观看一区二区| 在线成人av网站| 亚洲一区二区精品视频| 成人的网站免费观看| 精品国产sm最大网站免费看| 天堂在线亚洲视频| 久久se这里有精品| 欧美日韩精品免费观看视频| 亚洲日本一区二区| 热久久免费视频| 欧美偷拍一区二区| 亚洲日本va在线观看| 成人aa视频在线观看| 中文字幕av一区二区三区免费看| 美国av一区二区| 69堂国产成人免费视频| 五月婷婷欧美视频| 538prom精品视频线放| 午夜精品在线看| 欧美剧在线免费观看网站| 一区二区欧美在线观看| 一本久久a久久免费精品不卡| 中文字幕在线视频一区| 91天堂素人约啪| 91精品国产福利在线观看 | 国产一区二区伦理| 久久综合色天天久久综合图片| 日本在线不卡视频一二三区| 波多野洁衣一区| 日韩一区二区中文字幕| 麻豆国产精品视频| 久久久噜噜噜久噜久久综合| 国产精品一区免费在线观看| 欧美激情在线免费观看| 91在线你懂得| 午夜精品一区在线观看| 日韩女优毛片在线| 国产乱子伦一区二区三区国色天香| 精品国产一区二区三区四区四| 国产乱子伦视频一区二区三区 | 欧美一级高清片在线观看| 免费一级欧美片在线观看| 久久日韩精品一区二区五区| 成人av资源在线| 亚洲综合男人的天堂| 日韩无一区二区| 国产福利一区二区三区视频在线| 综合激情成人伊人| 91精品国产免费久久综合| 国产成人av电影在线播放| 亚洲狼人国产精品| 欧美一区二区私人影院日本| 国产不卡高清在线观看视频| 亚洲午夜成aⅴ人片| 91激情五月电影| 精品一区二区在线视频| 中文字幕日韩一区| 欧美日韩成人综合| www.成人网.com| 麻豆精品在线播放| 亚洲视频每日更新| 精品理论电影在线观看| 色综合天天狠狠| 国产一区二区三区免费在线观看| 亚洲激情成人在线| 国产亚洲短视频| 欧美剧在线免费观看网站| 成人av网站在线观看免费| 美国精品在线观看| 亚洲一区免费视频| 国产精品短视频| 日韩欧美中文一区| 欧美日韩视频一区二区| 成人性生交大片免费看视频在线| 欧美aaa在线| 亚洲国产精品影院| 亚洲女子a中天字幕| 久久久另类综合| 日韩午夜电影av| 91精品国产综合久久久久久漫画| 99久久精品99国产精品 | 亚洲在线观看免费| 中文字幕在线观看不卡视频| 国产色综合久久| 精品日韩99亚洲| 欧美高清视频在线高清观看mv色露露十八| av亚洲精华国产精华精| 国产精品911| 国产精品中文字幕一区二区三区| 日韩电影在线观看一区| 午夜久久久影院| 一级精品视频在线观看宜春院| 国产精品成人午夜| 国产精品福利一区二区三区| 中文字幕乱码亚洲精品一区| 国产欧美精品日韩区二区麻豆天美| 日韩美女主播在线视频一区二区三区| 欧美久久久久免费| 欧美日韩电影在线播放| 7777精品伊人久久久大香线蕉最新版| 91成人网在线| 欧美日韩高清一区二区三区| 欧美视频在线播放| 在线观看免费视频综合| 欧美三区免费完整视频在线观看| 91精品国产综合久久精品性色| 色综合欧美在线视频区| 色女孩综合影院| 欧美亚洲国产一卡| 欧美日本一道本在线视频| 91精品欧美一区二区三区综合在| 91精品国产综合久久精品| 91精品国产一区二区人妖| 精品国产亚洲在线| 国产精品天干天干在线综合| 亚洲人一二三区| 三级成人在线视频| 精品中文字幕一区二区小辣椒 | 成人黄色在线视频| 91色乱码一区二区三区| 欧美午夜在线观看| 日韩你懂的在线播放| 国产欧美一区二区三区在线老狼| 欧美激情中文不卡| 亚洲专区一二三| 日本亚洲电影天堂| 国产麻豆精品在线观看| 国产很黄免费观看久久| 韩国v欧美v亚洲v日本v| 国产精品77777竹菊影视小说| 97久久超碰精品国产| 欧美日韩黄色一区二区| 国产三级欧美三级日产三级99 | 日本不卡视频在线| 国产一区在线观看麻豆| 成人国产精品视频| 91黄色免费网站| 久久久久久影视| 亚洲一级在线观看| 国产成人免费视频| 欧美日韩精品免费| 自拍偷在线精品自拍偷无码专区 | 不卡欧美aaaaa| 欧美电影免费观看高清完整版在线 | 国产麻豆视频一区|