好文档就是一把金锄头!
欢迎来到金锄头文库![会员中心]
电子文档交易市场
安卓APP | ios版本
电子文档交易市场
安卓APP | ios版本

exosip开发手册.pdf

49页
  • 卖家[上传人]:suns****4568
  • 文档编号:90195910
  • 上传时间:2019-06-09
  • 文档格式:PDF
  • 文档大小:422.36KB
  • / 49 举报 版权申诉 马上下载
  • 文本预览
  • 下载提示
  • 常见问题
    • exexoSoSipip 开发者手册开发者手册 exoSip 开发者手册 ——本手册指导开发者利用exoSip 栈开发用户代理 原文标题:exoSIP User Manual 原文作者: 联系方法: 版权保护:GNU Free Documentation License 项目网站: 制作作者:周芒芝 联系方法:xing_1314@ 1 The eXtented eXosip stack.4 1.1How- To initialize libeXosip24 1.2How- To initiate, modify or terminate calls.5 1.2.1Initiate a call6 1.2.2Answer a call.7 1.2.3Sending other request8 1.3How- To send or update registrations. .9 1.3.1Initiate a registration .9 1.3.2Update a registration.9 1.3.3Closing the registration.10 2General purposeAPI.11 2.1eXosip2 configurationAPI11 2.1.1 Functions11 2.1.2Function Documentation.11 2.2eXosip2 networkAPI14 2.2.2Functions.14 2.2.3Function Documentation.14 2.3 eXosip2 eventAPI 16 2.3.1 Data Structures.16 2.3.2 Enumerations .16 2.3.3 Functions17 2.3.4 Enumeration Type Documentation.17 2.3.5 Function Documentation19 3SIP messages and call controlAPI21 3.1eXosip2 INVITE and Call Management.21 3.1.1Functions.21 3.1.2Function Documentation.22 3.2eXosip2 request outside of dialog.29 3.2.1Functions.29 3.2.2Function Documentation.29 3.3eXosip2 OPTIONS and UAcapabilities Management .31 3.3.1Functions.31 3.3.2Function Documentation.31 3.4eXosip2 Publication Management 33 3.4.1Functions.33 3.4.2Function Documentation.33 3.5eXosip2 REFER and blind tranfer Management outside of calls35 3.5.1Functions.35 3.5.2Function Documentation.35 3.6eXosip2 REGISTER and Registration Management 37 3.6.1Functions.37 3.6.2Function Documentation.37 3.7eXosip2 SUBSCRIBE and outgoing subscriptions.39 3.7.1Enumerations.39 3.7.2Functions.39 3.7.3Enumeration Type Documentation40 3.7.4Function Documentation.41 3.8eXosip2 SUBSCRIBE and incoming subscriptions43 3.8.1Functions.43 3.8.2Function Documentation.43 3.9eXosip2 authenticationAPI.46 3.9.1Functions.46 3.9.2Function Documentation.46 3.10Xosip2 SDP helperAPI.48 3.10.1Functions.48 3.10.2Function Documentation.48 1 The eXtented eXosip stack 1.1 How- To initialize libeXosip2. When using eXosip, your first task is to initialize both eXosip context and libosip library (parser and state machines). This must be done prior to any use of libeXosip2. include int i; TRACE_INITIALIZE (6, stdout); i=eXosip_init(); if (i!=0) return -1; i = eXosip_listen_addr (IPPROTO_UDP, NULL, port, AF_INET, 0); if (i!=0) { eXosip_quit()eXosip_quit(); fprintf (stderr, “could not initialize transport layer\n“); return -1; } . then you have to send messages and wait for eXosip events. In the previous code, you've learned how to: Initialize the osip trace (compile this code with - DENABLE_TRACE) Initialize eXosip (and osip) stack Open a socket for signalling (only UDP with initial eXosip2 version) Now you have to handle eXosip events. Here is some code to get eXosip_event from the eXosip2 stack. eXosip_event_t *je; for (;;) { je = eXosip_event_wait (0, 50); eXosip_lock()eXosip_lock(); eXosip_automatic_action (); eXosip_unlock()eXosip_unlock(); if (je == NULL) break; if (je-type == EXOSIP_CALL_NEW) { } else if (je-type == EXOSIP_CALL_ACK) { } else if (je-type == EXOSIP_CALL_ANSWERED) { } else . eXosip_event_free(je); } You will receive one event for each SIP message sent. Each event contains the original request of the affected transaction and the last response that triggers the event when available. You can access all headers from those messages and store them in your own context for other actions or graphic displays. For example, when you receive a REFER request for a call transfer, you'll typically retreive the “refer- To“ header: osip_header_t *referto_head = NULL; i = osip_message_header_get_byname (evt-sip, “refer-to“, 0, if (referto_head == NULL || referto_head-hvalue == NULL) The eXosip_event also contains identifiers for calls, registrations, incoming subscriptions or outgoing subscriptions when applicable. Those identifiers are used in API to control calls, registrations, incoming or outgoing subscriptions. These API will build default messages with usual SIP headers (From, To, Call- ID, CSeq, Route, Record- Route, Max- Forward.) and send thoses messages for you. 1.2 How- To initiate, modify or terminate calls. eXosip2 offers a flexible API to help you controling calls. 1.2.1 Initiate a call To start an outgoing call, you typically need a few headers which will be used by eXosip2 to build a default SIP INVITE request. The code below is used to start a call: osip_message_t *invite; int i; i = eXosip_call_build_initial_invite ( if (i != 0) { return -1; } osip_message_set_supported (invite, “100rel“); { char tmp[4096]; char localip[128]; eXosip_guess_localip (AF_INET, localip, 128); snprintf (tmp, 4096, “v=0\r\n“ “o=josua 0 0 IN IP4 %s\r\n“ “s=conversation\r\n“ “c=IN IP4 %s\r\n“ “t=0 0\r\n“ “m=audio %s RTP/AVP 0 8 101\r\n“ “a=rtpmap:0 PCMU/8000\r\n“ “a=rtpmap:8 PCMA/8000\r\n“ “a=rtpmap:101 telephone-event/8000\r\n“ “a=fmtp:101 0-11\r\n“, localip, localip, port); osip_message_set_body (invite, tmp, strlen (tmp)); osip_message_set_content_type (invite, “a。

      点击阅读更多内容
      相关文档
      Unit2 Health and Fitness语法课件-(高教版2023·基础模块2).pptx 九年级数学提升精品讲义 用配方法求解一元二次方程(原卷版).docx 九年级数学提升精品讲义 一元二次方程的根与系数的关系(解析版).docx 2025学年九年级化学优学讲练(人教版) 化学实验与科学探究(解析版).docx 九年级数学提升精品讲义 一元一次不等式与一元一次不等式组(原卷版).docx 九年级数学提升精品讲义 因式分解(解析版).docx 九年级数学提升精品讲义 相似三角形的性质(原卷版).docx 2025年 初中七年级数学 相交线与平行线 知识突破速记与巧练(原卷版).docx 九年级数学提升精品讲义 中点模型之斜边中线、中点四边形(解析版).docx 2025学年九年级化学优学讲练(人教版) 分子和原子(解析版).docx 九年级数学提升精品讲义 正方形的性质(原卷版).docx 九年级数学提升精品讲义 用因式分解法求解一元二次方程(解析版).docx 2025年 初中七年级数学 实数 知识突破速记与巧练(原卷版).docx 九年级数学提升精品讲义 应用一元二次方程(原卷版) (2).docx 2025年 初中七年级数学 相交线与平行线 压轴专练速记与巧练(解析版).docx 九年级数学提升精品讲义 用公式法求解一元二次方程(解析版).docx 2025学年九年级化学优学讲练(人教版) 化学方程式的书写(原卷版).docx 九年级数学提升精品讲义 应用一元二次方程(解析版) (2).docx 2025年 初中七年级数学 数据的收集、整理与描述 综合测试速记与巧练(解析版).docx 九年级数学提升精品讲义 中点模型之斜边中线、中点四边形(原卷版).docx
      关于金锄头网 - 版权申诉 - 免责声明 - 诚邀英才 - 联系我们
      手机版 | 川公网安备 51140202000112号 | 经营许可证(蜀ICP备13022795号)
      ©2008-2016 by Sichuan Goldhoe Inc. All Rights Reserved.