Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1754357
  • 博文数量: 787
  • 博客积分: 10000
  • 博客等级: 上将
  • 技术积分: 5015
  • 用 户 组: 普通用户
  • 注册时间: 2008-09-22 15:17
文章分类

全部博文(787)

文章存档

2008年(787)

我的朋友

分类:

2008-09-25 16:11:31

Vovida Open Communication Application Library(VOCAL)
这个程序只是发送一个REGISTER消息,是使用VOCAL库的mini示例,hoho
[@more@]#include "VovidaSipStack.hxx"
#include "symbols.hxx"

#include "SipMsg.hxx"
#include "RegisterMsg.hxx"

using namespace Vocal;

///
int
main( int argc, char* argv[] )
{
    int port = 5060;
    string message (
"REGISTER sip:192.168.199.21 SIP/2.0n
Via: SIP/2.0/UDP 59.64.177.210:5060n
To: 199186n
From: 199186n
Call-ID: a772115bc63d86eb7d1f7e5fb2f7f8f9@59.64.177.210n
CSeq: 1 REGISTERn
Max-Forwards: 70n
Expires: 300n
Contact: n
Content-Length: 0"
                   );
    SipTransceiver stack("", port);
    Sptr pSipMsg = SipMsg::decode(message);
    Sptr pRegisterMsg;
    pRegisterMsg.dynamicCast(pSipMsg);
    stack.sendAsync(pRegisterMsg);

    return ( 0 );
}



--------------------next---------------------

阅读(686) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~