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: 199186
n
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---------------------
阅读(731) | 评论(0) | 转发(0) |