Hello!

I'm trying to implement a PUBLISH request in the voicemail app for using MWI
feature.
So, I'm writing some code in the AnswerMachine.cpp in the void
AnswerMachineDialog::onBye, but I'm a bit confused about AmSipRequest
fields.

unsigned int serKeyLen = 0;
AmSipRequest publish_request;

publish_request.method = "PUBLISH";
publish_request.hdrs = "Max-Forwards: 32";
publish_request.to = "[email protected]"; // subscriber
publish_request.from = "[email protected]";
publish_request.from_uri = "[email protected]";
publish_request.next_hop = "sip:192.168.0.1:5060"; // opensips
publish_request.callid = "123456780";
DBG("*** Sending request...\n");
AmServer::sendRequest(publish_request, NULL, serKeyLen);
DBG("*** Finished\n");


And I've got in log
onBye (AnswerMachine.cpp:916): *** Sending request...
DEBUG: [b71a9b90] parse_headers (parse_header.cpp:403): Incomplete header
(st=0;saved_st=0)
DEBUG: [b71a9b90] parse_headers (parse_header.cpp:405): header =
"[email protected]"
ERROR: [b71a9b90] send (SipCtrlInterface.cpp:236): Malformed To or From
header
DEBUG: [b71a9b90] ~sip_msg (sip_parser.cpp:92): ~sip_msg()
DEBUG: [b71a9b90] onBye (AnswerMachine.cpp:918): *** Finished


Could you please explain how will exactly AmSipRequest should be filled? And
what are parameters serKey and serKeyLen in the AmServer::sendRequest?



Also, a note about core/sipctrl/sip_parser.cpp:int parse_sip_msg()
There are a lot of assignment like err_msg = (char *)"blablabla" where
err_msg is a function parameter char *&.
But that will assignment to err_msg a local pointer and outside of
parse_sip_msg() this pointer will be invalid.
Right decisions are:
1) use string (safe, a bit slowly)
2) use strcpy_s (unsafe, fast)


[email protected]
www.oyster-telecom.ru

 

 



_______________________________________________
Sems mailing list
[email protected]
http://lists.iptel.org/mailman/listinfo/sems

Reply via email to