fixed reply sending after the announcement.

git-svn-id: http://svn.berlios.de/svnroot/repos/sems/trunk@36 8eb893ce-cfd4-0310-b710-fb5ebe64c474
sayer/1.4-spce2.6
Raphael Coeffic 21 years ago
parent 1f5be2afcb
commit 73b06d8bb4

@ -81,7 +81,6 @@ void EarlyAnnounceDialog::onInvite(const AmSipRequest& req)
if(dlg.reply(req,183,"Session Progress",
"application/sdp",sdp_reply) != 0){
//throw AmSession::Exception(500,"error while sending response");
setStopped();
}
else {
@ -89,9 +88,6 @@ void EarlyAnnounceDialog::onInvite(const AmSipRequest& req)
localreq = req;
}
// reply_code = 183; // early dialog
// reply_reason = "Session Progress";
}
@ -150,35 +146,25 @@ void EarlyAnnounceDialog::process(AmEvent* event)
{
AmAudioEvent* audio_event = dynamic_cast<AmAudioEvent*>(event);
if(audio_event)
if(audio_event &&
(audio_event->event_id == AmAudioEvent::cleared))
{
switch(audio_event->event_id)
{
case AmAudioEvent::cleared:
DBG("AmAudioEvent::cleared\n");
//dlg.bye();
setStopped();
return;
break;
case AmAudioEvent::noAudio:
DBG("AmAudioEvent::noAudio\n");
unsigned int code_i;
string code = getHeader(localreq.hdrs,"P-Final-Reply-Code");
string reason = getHeader(localreq.hdrs,"P-Final-Reply-Reason");
if (code.length() && reason.length() && !str2i(code, code_i) ) {
DBG("Replying with code %d %s\n", code_i, reason.c_str());
dlg.reply(localreq, code_i, reason);
} else {
DBG("Replying with std code 404 Not found\n");
dlg.reply(localreq, 404, "Not Found");
}
setStopped();
return;
break;
}
DBG("AmAudioEvent::cleared\n");
unsigned int code_i;
string code = getHeader(localreq.hdrs,"P-Final-Reply-Code");
string reason = getHeader(localreq.hdrs,"P-Final-Reply-Reason");
if (code.length() && reason.length() && !str2i(code, code_i) ) {
DBG("Replying with code %d %s\n", code_i, reason.c_str());
dlg.reply(localreq, code_i, reason);
} else {
DBG("Replying with std code 404 Not found\n");
dlg.reply(localreq, 404, "Not Found");
}
setStopped();
return;
}
AmSession::process(event);

Loading…
Cancel
Save