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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? jrequest.c

?? exosip
?? C
?? 第 1 頁(yè) / 共 2 頁(yè)
字號(hào):
/*  eXosip - This is the eXtended osip library.  Copyright (C) 2002,2003,2004,2005,2006,2007  Aymeric MOIZARD  - jack@atosc.org    eXosip is free software; you can redistribute it and/or modify  it under the terms of the GNU General Public License as published by  the Free Software Foundation; either version 2 of the License, or  (at your option) any later version.    eXosip 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 General Public License for more details.    You should have received a copy of the GNU General Public License  along with this program; if not, write to the Free Software  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA*/#ifdef ENABLE_MPATROL#include <mpatrol.h>#endif#include "eXosip2.h"#ifndef WIN32#include <sys/types.h>#include <sys/socket.h>#include <netinet/in.h>#include <arpa/inet.h>#ifdef __APPLE_CC__#include <unistd.h>#endif#else#include <windows.h>#include <Iphlpapi.h>#endifextern eXosip_t eXosip;extern int ipv6_enable;/* Private functions */static int dialog_fill_route_set (osip_dialog_t * dialog,                                  osip_message_t * request);/* should use cryptographically random identifier is RECOMMENDED.... *//* by now this should lead to identical call-id when application are   started at the same time...   */char *osip_call_id_new_random (){  char *tmp = (char *) osip_malloc (33);  unsigned int number = osip_build_random_number ();  sprintf (tmp, "%u", number);  return tmp;}inteXosip_generate_random (char *buf, int buf_size){  unsigned int number = osip_build_random_number ();  snprintf (buf, buf_size, "%u", number);  return 0;}char *osip_from_tag_new_random (void){  return osip_call_id_new_random ();}char *osip_to_tag_new_random (void){  return osip_call_id_new_random ();}unsigned intvia_branch_new_random (void){  return osip_build_random_number ();}int_eXosip_dialog_add_contact(osip_message_t *request, osip_message_t *answer){  osip_via_t *via;  osip_from_t *a_from;  char *contact=NULL;  char locip[65];  char firewall_ip[65];  char firewall_port[10];  int len;  if (eXosip.eXtl==NULL)    return -1;  if (request==NULL)    return -1;  if (eXosip.eXtl->tl_get_masquerade_contact!=NULL)    {      eXosip.eXtl->tl_get_masquerade_contact(firewall_ip, sizeof(firewall_ip),					     firewall_port, sizeof(firewall_port));    }  /* search for topmost Via which indicate the transport protocol */  via = (osip_via_t *) osip_list_get (&request->vias, 0);  if (via == NULL || via->protocol == NULL)    {      OSIP_TRACE (osip_trace                  (__FILE__, __LINE__, OSIP_ERROR, NULL,                   "eXosip: missing via header\n"));      return -1;    }  if (answer==NULL)    a_from = request->from;  else    a_from = answer->to;  if (a_from == NULL || a_from->url == NULL)    return -1;  /*guess the local ip since req uri is known */  memset(locip, '\0', sizeof(locip));  if (a_from->url->username != NULL)    len = 2 + 4 + strlen (a_from->url->username) + 1 + 100 + 6 + 10 + strlen(eXosip.transport);  else    len = 2 + 4 + 100 + 6 + 10 + strlen(eXosip.transport);  contact = (char *) osip_malloc (len+1);  if (firewall_ip[0] != '\0')    {      char *c_address = request->req_uri->host;      struct addrinfo *addrinfo;      struct __eXosip_sockaddr addr;      int i;      i = eXosip_get_addrinfo (&addrinfo, request->req_uri->host, 5060, IPPROTO_TCP);      if (i == 0)        {	  memcpy (&addr, addrinfo->ai_addr, addrinfo->ai_addrlen);	  eXosip_freeaddrinfo (addrinfo);	  c_address = inet_ntoa (((struct sockaddr_in *) &addr)->sin_addr);	  OSIP_TRACE (osip_trace (__FILE__, __LINE__, OSIP_INFO1, NULL,				  "eXosip: here is the resolved destination host=%s\n",				  c_address));        }      if (eXosip_is_public_address (c_address))        {	  memcpy(locip, firewall_ip, sizeof(locip));	}    }  if (locip[0] == '\0')    {      eXosip_guess_ip_for_via (eXosip.eXtl->proto_family, locip, 49);      if (locip[0]=='\0')	{	  OSIP_TRACE (osip_trace		      (__FILE__, __LINE__, OSIP_ERROR, NULL,		       "eXosip: no default interface defined\n"));	  return -1;	}    }  if (eXosip.eXtl->proto_family == AF_INET6)    {      if (a_from->url->username != NULL)	snprintf (contact, len, "<sip:%s@[%s]:%s>", a_from->url->username,		  locip, firewall_port);      else	snprintf (contact, len-strlen(eXosip.transport)-10, "<sip:[%s]:%s>", locip, firewall_port);    }  else    {      if (a_from->url->username != NULL)	snprintf (contact, len, "<sip:%s@%s:%s>", a_from->url->username,		  locip, firewall_port);      else	snprintf (contact, len-strlen(eXosip.transport)-10, "<sip:%s:%s>", locip, firewall_port);    }  if (osip_strcasecmp(eXosip.transport, "UDP")!=0)    {      contact[strlen(contact)-1]='\0';      strcat(contact, ";transport=");      strcat(contact, eXosip.transport);      strcat(contact, ">");    }  osip_message_set_contact (request, contact);  osip_free (contact);  return 0;}int_eXosip_request_add_via(osip_message_t *request, const char *transport, const char *locip){  char tmp[200];  const char *ip=NULL;  char firewall_ip[65];  char firewall_port[10];  if (request==NULL)    return -1;  if (request->call_id==NULL)    return -1;  if (locip==NULL && request->call_id->host==NULL)    return -1;  if (locip!=NULL)    ip = locip;  else if (request->call_id->host!=NULL)    ip = request->call_id->host;  firewall_ip[0] = '\0';  firewall_port[0] = '\0';  if (eXosip.eXtl!=NULL && eXosip.eXtl->tl_get_masquerade_contact!=NULL)    {      eXosip.eXtl->tl_get_masquerade_contact(firewall_ip, sizeof(firewall_ip),					     firewall_port, sizeof(firewall_port));    }#ifdef MASQUERADE_VIA  /* this helps to work with a server that don't handle the     "received" parameter correctly. Some still exists. */  if (firewall_ip[0] != '\0')    {      ip = firewall_ip;    }#endif  if (firewall_port[0] == '\0')    {      snprintf(firewall_port, sizeof(firewall_port), "5060");    }  if (eXosip.eXtl->proto_family == AF_INET6)    snprintf (tmp, 200, "SIP/2.0/%s [%s]:%s;branch=z9hG4bK%u",	      eXosip.transport,	      ip, firewall_port, via_branch_new_random ());  else    {      if (eXosip.use_rport!=0)	snprintf (tmp, 200, "SIP/2.0/%s %s:%s;rport;branch=z9hG4bK%u",		  eXosip.transport,		  ip, firewall_port, via_branch_new_random ());      else	snprintf (tmp, 200, "SIP/2.0/%s %s:%s;branch=z9hG4bK%u",		  eXosip.transport,		  ip, firewall_port, via_branch_new_random ());	      }    osip_message_set_via (request, tmp);    return 0;}/* prepare a minimal request (outside of a dialog) with required headers *//*    method is the type of request. ("INVITE", "REGISTER"...)   to is the remote target URI   transport is either "TCP" or "UDP" (by now, only UDP is implemented!)*/intgenerating_request_out_of_dialog (osip_message_t ** dest, const char *method,                                  const char *to, const char *transport,                                  const char *from, const char *proxy){  /* Section 8.1:     A valid request contains at a minimum "To, From, Call-iD, Cseq,     Max-Forwards and Via   */  int i;  osip_message_t *request;  char locip[65];  int doing_register;  char *register_callid_number = NULL;  *dest = NULL;  if (eXosip.eXtl==NULL)    return -1;  /*guess the local ip since req uri is known */  memset(locip, '\0', sizeof(locip));  eXosip_guess_ip_for_via (eXosip.eXtl->proto_family, locip, 49);  if (locip[0]=='\0')    {      OSIP_TRACE (osip_trace                  (__FILE__, __LINE__, OSIP_ERROR, NULL,                   "eXosip: no default interface defined\n"));      return -1;    }  i = osip_message_init (&request);  if (i != 0)    return -1;  /* prepare the request-line */  osip_message_set_method (request, osip_strdup (method));  osip_message_set_version (request, osip_strdup ("SIP/2.0"));  osip_message_set_status_code (request, 0);  osip_message_set_reason_phrase (request, NULL);  doing_register = 0 == strcmp ("REGISTER", method);  if (doing_register)    {      osip_uri_init (&(request->req_uri));      i = osip_uri_parse (request->req_uri, proxy);      if (i != 0)        {          goto brood_error_1;        }      osip_message_set_to (request, from);  } else    {      /* in any cases except REGISTER: */      i = osip_message_set_to (request, to);      if (i != 0)        {          OSIP_TRACE (osip_trace                      (__FILE__, __LINE__, OSIP_ERROR, NULL,                       "ERROR: callee address does not seems to be a sipurl: %s\n",                       to));          goto brood_error_1;        }	  /* REMOVE ALL URL PARAMETERS from to->url headers and add them as headers */	  if (request->to!=NULL &&		  request->to->url!=NULL)	  {		  osip_uri_t *url = request->to->url;		  while (osip_list_size(&url->url_headers)>0)		  {			  osip_uri_header_t *u_header;			  u_header = (osip_uri_param_t *) osip_list_get (&url->url_headers, 0);			  if (u_header==NULL)				break;			  if (osip_strcasecmp(u_header->gname, "from")==0)			  {			  }			  else if (osip_strcasecmp(u_header->gname, "to")==0)			  {			  }			  else if (osip_strcasecmp(u_header->gname, "call-id")==0)			  {			  }			  else if (osip_strcasecmp(u_header->gname, "cseq")==0)			  {			  }			  else if (osip_strcasecmp(u_header->gname, "via")==0)			  {			  }			  else if (osip_strcasecmp(u_header->gname, "contact")==0)			  {			  }			  else				  osip_message_set_header(request, u_header->gname, u_header->gvalue);			  osip_list_remove (&url->url_headers, 0);			  osip_uri_param_free (u_header);		  }	  }      if (proxy != NULL && proxy[0] != 0)        {                       /* equal to a pre-existing route set */          /* if the pre-existing route set contains a "lr" (compliance             with bis-08) then the req_uri should contains the remote target             URI */          osip_uri_param_t *lr_param;          osip_route_t *o_proxy;          osip_route_init (&o_proxy);          i = osip_route_parse (o_proxy, proxy);          if (i != 0)            {              osip_route_free (o_proxy);              goto brood_error_1;            }          osip_uri_uparam_get_byname (o_proxy->url, "lr", &lr_param);          if (lr_param != NULL) /* to is the remote target URI in this case! */            {              osip_uri_clone (request->to->url, &(request->req_uri));              /* "[request] MUST includes a Route header field containing                 the route set values in order." */              osip_list_add (&request->routes, o_proxy, 0);          } else            /* if the first URI of route set does not contain "lr", the req_uri               is set to the first uri of route set */            {              request->req_uri = o_proxy->url;              o_proxy->url = NULL;              osip_route_free (o_proxy);              /* add the route set */              /* "The UAC MUST add a route header field containing                 the remainder of the route set values in order.                 The UAC MUST then place the remote target URI into                 the route header field as the last value               */              osip_message_set_route (request, to);            }      } else                    /* No route set (outbound proxy) is used */        {          /* The UAC must put the remote target URI (to field) in the req_uri */          i = osip_uri_clone (request->to->url, &(request->req_uri));          if (i != 0)            goto brood_error_1;        }    }  if (locip[0]=='\0')    goto brood_error_1;  /* set To and From */  osip_message_set_from (request, from);  if (request->from==NULL)    goto brood_error_1;  /* add a tag */  osip_from_set_tag (request->from, osip_from_tag_new_random ());  /* set the cseq and call_id header */  {    osip_call_id_t *callid;    osip_cseq_t *cseq;    char *num;    char *cidrand;    /* call-id is always the same for REGISTRATIONS */    i = osip_call_id_init (&callid);    if (i != 0)      goto brood_error_1;    cidrand = osip_call_id_new_random ();    osip_call_id_set_number (callid, cidrand);    if (doing_register)      register_callid_number = cidrand;#if 0    osip_call_id_set_host (callid, osip_strdup (locip));#endif    request->call_id = callid;    i = osip_cseq_init (&cseq);    if (i != 0)      goto brood_error_1;    num = osip_strdup (doing_register ? "1" : "20");    osip_cseq_set_number (cseq, num);    osip_cseq_set_method (cseq, osip_strdup (method));    request->cseq = cseq;  }  i = _eXosip_request_add_via(request, transport, locip);  if (i != 0)    goto brood_error_1;  /* always add the Max-Forward header */  osip_message_set_max_forwards (request, "70"); /* a UA should start a request with 70 */  if (0 == strcmp ("REGISTER", method))    {  } else if (0 == strcmp ("INFO", method))    {  } else if (0 == strcmp ("OPTIONS", method))    {      osip_message_set_accept (request, "application/sdp");    }  osip_message_set_user_agent (request, eXosip.user_agent);  /*  else if ... */  *dest = request;  return 0;brood_error_1:  osip_message_free (request);  *dest = NULL;  return -1;}intgenerating_register (eXosip_reg_t * jreg, osip_message_t ** reg, char *transport, char *from,                     char *proxy, char *contact, int expires){  osip_from_t *a_from;  int i;  char locip[65];  char firewall_ip[65];  char firewall_port[10];  if (eXosip.eXtl==NULL)    return -1;  if (eXosip.eXtl->tl_get_masquerade_contact!=NULL)    {      eXosip.eXtl->tl_get_masquerade_contact(firewall_ip, sizeof(firewall_ip),					     firewall_port, sizeof(firewall_port));    }

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
99麻豆久久久国产精品免费| 欧美亚洲丝袜传媒另类| 亚洲小少妇裸体bbw| 精品国产青草久久久久福利| 91蜜桃视频在线| 国产精一区二区三区| 天堂蜜桃一区二区三区| 国产精品久久久久久亚洲伦| 日韩欧美国产精品| 欧美日韩一区二区三区在线看| 不卡一二三区首页| 国产一区二区在线观看免费 | 国产精品国产三级国产aⅴ中文| 欧美精品久久99久久在免费线| 99精品久久只有精品| 国产在线精品一区二区 | 91丨九色丨蝌蚪富婆spa| 精品一区二区三区欧美| 喷水一区二区三区| 亚洲国产一区二区a毛片| 亚洲色图欧美在线| 中文字幕五月欧美| 中文字幕在线一区免费| 久久一留热品黄| 亚洲精品在线免费观看视频| 51久久夜色精品国产麻豆| 欧美三级电影在线看| 在线观看日韩一区| 在线视频观看一区| 欧美性大战久久久| 欧美综合天天夜夜久久| 91免费国产在线观看| 99精品欧美一区二区三区小说| 粉嫩嫩av羞羞动漫久久久 | 91同城在线观看| www.av精品| 91麻豆产精品久久久久久| aaa亚洲精品一二三区| a级高清视频欧美日韩| 成人高清视频在线| 99久久精品免费| 97精品电影院| 91官网在线观看| 欧美图片一区二区三区| 欧美日韩夫妻久久| 欧美精品 国产精品| 日韩欧美不卡一区| 久久久精品日韩欧美| 国产精品久久三区| 亚洲婷婷综合久久一本伊一区| 国产精品色一区二区三区| 国产精品国产三级国产aⅴ中文| 亚洲欧美日韩小说| 亚洲国产综合视频在线观看| 免费人成在线不卡| 国产精品一线二线三线| 成人av在线资源| 欧美性大战久久| 精品国产乱码久久久久久久久 | 免费视频最近日韩| 国产在线播放一区三区四| 成人av小说网| 色婷婷精品大在线视频| 欧美日韩一级视频| 欧美不卡一区二区| 国产精品美女久久久久久久网站| 亚洲黄色片在线观看| 三级不卡在线观看| 国产成人av电影免费在线观看| 91在线视频18| 日韩一区二区影院| 国产精品伦理在线| 五月激情六月综合| 国产精品资源在线看| 91成人免费电影| 亚洲精品一区二区三区影院| 自拍av一区二区三区| 天天av天天翘天天综合网 | 亚洲美女视频在线| 五月天亚洲婷婷| 成人在线综合网| 欧美日韩精品免费| 国产精品色一区二区三区| 天天影视网天天综合色在线播放| 国产成人夜色高潮福利影视| 欧美日韩中文精品| 中文一区二区在线观看| 日韩在线观看一区二区| 99久久伊人精品| 欧美电视剧免费全集观看| 亚洲欧美激情视频在线观看一区二区三区| 日韩高清一区在线| 色综合久久中文字幕综合网| 精品国产在天天线2019| 亚洲一区二区三区美女| 国产91精品精华液一区二区三区 | 欧美日韩综合在线免费观看| 久久久久久久久99精品| 亚洲国产另类精品专区| eeuss鲁一区二区三区| 亚洲精品在线电影| 日韩av中文字幕一区二区| 91麻豆自制传媒国产之光| 国产日韩av一区| 久久国产精品免费| 欧美性xxxxx极品少妇| 亚洲国产精品精华液ab| 韩国av一区二区三区| 欧美日本一区二区三区四区| 亚洲精选视频在线| 粉嫩蜜臀av国产精品网站| 亚洲精品一区二区三区四区高清| 午夜视频在线观看一区| 欧美在线小视频| 亚洲精品一二三| 成人黄页毛片网站| 国产欧美精品一区二区色综合 | 中文字幕在线观看不卡视频| 国产在线观看一区二区| 欧美xxxxxxxx| 日产国产高清一区二区三区| 欧美日韩精品一区二区在线播放| 亚洲乱码日产精品bd| 成人午夜电影小说| 欧美国产乱子伦| 成人av电影在线网| 中文字幕一区二区在线播放| 国产不卡视频在线观看| 久久久久久久久久久久电影| 国产真实乱对白精彩久久| 精品奇米国产一区二区三区| 久久精品国产亚洲a| 日韩欧美国产一区在线观看| 另类中文字幕网| 日韩欧美的一区二区| 紧缚奴在线一区二区三区| 日韩免费观看高清完整版| 久草热8精品视频在线观看| 日韩欧美的一区| 国产福利91精品一区二区三区| 国产午夜精品一区二区三区视频| 国产精品一区二区三区99| 中文字幕av资源一区| av电影一区二区| 亚洲一区二区三区三| 91精品国产aⅴ一区二区| 日韩av午夜在线观看| 精品久久久久久久久久久久久久久 | 国产精品乱人伦中文| 不卡的av在线播放| 一区二区三区中文在线| 欧美日韩久久久一区| 毛片基地黄久久久久久天堂| 久久综合九色综合97婷婷| 国产精品 欧美精品| 综合久久综合久久| 欧美亚洲高清一区二区三区不卡| 亚洲国产日韩在线一区模特| 欧美一区二区视频观看视频| 国产在线视频一区二区三区| 国产欧美日韩亚州综合 | 成人免费的视频| 亚洲黄色片在线观看| 日韩一区二区三区视频在线观看| 国产精品一二一区| 亚洲视频小说图片| 欧美一区二区在线不卡| 国产白丝网站精品污在线入口| 亚洲欧美日韩电影| 欧美一区二区日韩一区二区| 成人午夜伦理影院| 亚洲国产精品欧美一二99| 精品日韩欧美一区二区| 91在线精品一区二区| 美女精品一区二区| 亚洲天堂av一区| 日韩美女在线视频| 色综合视频一区二区三区高清| 免费成人结看片| 综合精品久久久| 欧美精品一区二区三区四区 | 日本亚洲一区二区| 国产精品每日更新| 欧美一区二区视频网站| www.日韩在线| 精品一区二区三区免费| 亚洲午夜久久久| 国产亚洲成aⅴ人片在线观看| 欧美日韩一区二区欧美激情| 丁香婷婷综合色啪| 免费成人在线网站| 一区二区三区成人| 国产欧美日韩视频在线观看| 91精品一区二区三区在线观看| 91在线观看美女| 国产曰批免费观看久久久| 天天综合日日夜夜精品| 亚洲女与黑人做爰| 日本一区二区三区四区在线视频| 91.com视频|