1 / 49
文档名称:

exoSip开发手册.doc

格式:doc   大小:447KB   页数:49页
下载后只包含 1 个 DOC 格式的文档,没有任何的图纸或源代码,查看文件列表

如果您已付费下载过本站文档,您可以点这里二次下载

分享

预览

exoSip开发手册.doc

上传人:小辰GG 2022/4/11 文件大小:447 KB

下载得到文件列表

exoSip开发手册.doc

文档介绍

文档介绍:exoSip开发者手册
exoSip开发者手册
—本手册指导开发者利用exoSip栈开发用户代理
原文标题:exoSIP User Manual
原文作者:
联系方法:
版权保护:GNU Free Documentation Ldone prior to any use of libeXosip2. include <eXosip2/eXosip・h>
int i;
TRACE_INITIALIZE (6, stdout): i=eXosip_init();
if (i!=0)
return 一1;
i = eXosip_li sten_addr (IPPR0T0_UDP, NULL, port, AF_INET, 0); if (i!=0)
{
eXosip_quit ();
fprintf (stderr, "could not initialize transport layer\n^); return T;
}
… 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_automatic_action ();
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)
eXosip_event_free(je);
} " ~
You will receive one eve nt for each SIP message sent. Each eve nt 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 actio ns or graphic displays.
For example, when you receive a REFER request for a call transfer, you'll typically retreive the Mrefer-ToM header:
osip_header_t *referto_head = NULL;
i = osip_message_header_get_byname (evt->sip, "refer-to", 0,
&referto_head);
if (referto_head == NULL referto_head->hvalue == NULL)
The eXosip_event also contains ide ntifiers for calls, registrations, in comi ng subscriptions or outgoing subscriptions when applicable. Those identifiers are used in API to control calls, reg ist rati ons, in coming or outgoi ng subscriptions ・ These API will build defau