support for extra headers in dialout calls

git-svn-id: http://svn.berlios.de/svnroot/repos/sems/trunk@513 8eb893ce-cfd4-0310-b710-fb5ebe64c474
sayer/1.4-spce2.6
Stefan Sayer 19 years ago
parent b5c6354ae8
commit f91fe91c18

@ -162,6 +162,7 @@ string DIDial::dialout_auth(const string& application,
AmSession* s = AmUAC::dialout(user.c_str(), application, to,
"<" + from + ">", from, "<" + to + ">",
string(""), // callid
string(""), // xtra hdrs
a);
if (s)
return s->getLocalTag();
@ -191,6 +192,7 @@ string DIDial::dialout_pin(const string& application,
"sip:"+it->second.user+"@"+it->second.realm,
"<sip:" + to_user+"@"+it->second.realm + ">",
string(""), // callid
string(""), // xtra hdrs
a);
if (s)
return s->getLocalTag();

@ -751,19 +751,19 @@ void AmSession::sendUpdate()
dlg.update("");
}
void AmSession::sendReinvite(bool updateSDP)
void AmSession::sendReinvite(bool updateSDP, const string& headers)
{
if (updateSDP) {
rtp_str.setLocalIP(AmConfig::LocalIP);
string sdp_body;
sdp.genResponse(AmConfig::LocalIP,rtp_str.getLocalPort(),sdp_body);
dlg.reinvite("", "application/sdp", sdp_body);
dlg.reinvite(headers, "application/sdp", sdp_body);
} else {
dlg.reinvite("", "", "");
dlg.reinvite(headers, "", "");
}
}
int AmSession::sendInvite()
int AmSession::sendInvite(const string& headers)
{
// set local IP first, so that IP is set when
// getLocalPort/setLocalPort may bind
@ -771,7 +771,7 @@ int AmSession::sendInvite()
// generate SDP
string sdp_body;
sdp.genRequest(AmConfig::LocalIP,rtp_str.getLocalPort(),sdp_body);
return dlg.invite("", "application/sdp", sdp_body);
return dlg.invite(headers, "application/sdp", sdp_body);
}
void AmSession::setOnHold(bool hold)

@ -309,9 +309,9 @@ public:
/** send an UPDATE in the session */
void sendUpdate();
/** send a Re-INVITE (if connected) */
void sendReinvite(bool updateSDP = true);
void sendReinvite(bool updateSDP = true, const string& headers = "");
/** send an INVITE */
int sendInvite();
int sendInvite(const string& headers = "");
/** set the session on/off hold */
void setOnHold(bool hold);

@ -186,7 +186,7 @@ AmSession* AmSessionContainer::startSessionUAC(AmSipRequest& req, AmArg* session
session->setCallgroup(req.from_tag);
session->setNegotiateOnReply(true);
if (int err = session->sendInvite()) {
if (int err = session->sendInvite(req.hdrs)) {
ERROR("INVITE could not be sent: error code = %d.\n",
err);
delete session;

@ -38,6 +38,7 @@ AmSession* AmUAC::dialout(const string& user,
const string& from_uri,
const string& to,
const string& local_tag,
const string& hdrs,
AmArg* session_params) {
AmSipRequest req;
@ -56,6 +57,7 @@ AmSession* AmUAC::dialout(const string& user,
req.to = to;
req.to_tag = "";
req.callid = AmSession::getNewId() + "@" + AmConfig::LocalIP;
req.hdrs = hdrs;
// set outbound proxy as next hop
if (!AmConfig::OutboundProxy.empty())

@ -45,6 +45,7 @@ class AmUAC {
const string& from_uri,
const string& to,
const string& local_tag = "",
const string& hdrs = "",
AmArg* session_params = NULL);
};

@ -1,5 +1,7 @@
Changelog for SEMS
- support for extra headers in dialout sessions
- support for setting the URI of a session in SDP
- early media receiving example

Loading…
Cancel
Save