一、PTZ格式
抓包数据
在网上找的一些资料
二、部分代码实现
//控制向上,控制部分比较容易实现,但还是有些细节要注意,例如ID
char body[2048];
int bodyLen = snprintf(body, 2048,
"<?xml version=\"1.0\" encoding=\"GB2312\"?>\r\n"
"<Control>\r\n"
" <CmdType>DeviceControl</CmdType>\n"
" <SN>%d</SN>\r\n"
" <DeviceID>%s</DeviceID>\r\n"
" <PTZCmd>A50F0108007F003C</PTZCmd>\r\n"
" <Info>\r\n"
" <Controlprioritf>5</Controlprioritf>\r\n"
" </Info>\r\n"
"</Control>\r\n", sn++, m_UserID.c_str());
char dest_call[256], source_call[256];
snprintf(dest_call, 256, "sip:%s@%s:%d", m_UserID.c_str(), m_LocalIP.c_str(), m_LocalPort);
snprintf(source_call, 256, "sip:%s@%s:%d", m_SipID.c_str(), m_SipIP.c_str(), m_SipPort);
send_Cotrol(dest_call, source_call, body, bodyLen);