< Previous by Date Date Index Next by Date >
  Thread Index Next in Thread >

[reSIProcate] how to include "authorization" field in the first "INVITE" sip message


Hi, all,

I have a question: I want to include "Authorization" in the first "INVITE" sip message, my code is as follows:
---------
std::string sDialOutUser = DIALOUT_FROM_NUMBER;

NameAddr dialoutAor;
dialoutAor.uri().host() = g_uConferenceConfigure.m_
sExternalIp;
dialoutAor.uri().port() = g_uConferenceConfigure.m_iSIPPort;
dialoutAor.uri().user() = sDialOutUser.c_str();
Data dialoutpasswd("111");

oDialogUsageManager->getMasterProfile()->setDefaultFrom(dialoutAor);
oDialogUsageManager->getMasterProfile()->setDigestCredential(dialoutAor.uri().host(), dialoutAor.uri().user(), dialoutpasswd);
oDialogUsageManager->getMasterProfile()->setImsAuthUser(sDialOutUser.c_str(), oInviteMsgAddr.uri().getAorNoPort());

SharedPtr<SipMessage> inviteMessageUac = oDialogUsageManager->makeInviteSession(oInviteMsgAddr, &oLocalSdp);
--------

the generated sip message's "Authorization" has empty "nonce" and "response", I guess at least "response" should not be empty to include the digest credential information, right? Would you please kindly tell me what's the correct way to do it?

Thanks a lot!

-Allen