Author: sayer
Date: 2008-11-11 10:29:34 +0100 (Tue, 11 Nov 2008)
New Revision: 1126
Modified:
trunk/apps/precoded_announce/PrecodedAnnounce.cpp
Log:
fixed setting of payload if not known
Modified: trunk/apps/precoded_announce/PrecodedAnnounce.cpp
===================================================================
--- trunk/apps/precoded_announce/PrecodedAnnounce.cpp 2008-11-05 17:57:22 UTC
(rev 1125)
+++ trunk/apps/precoded_announce/PrecodedAnnounce.cpp 2008-11-11 09:29:34 UTC
(rev 1126)
@@ -75,10 +75,21 @@
void PrecodedDialog::onSessionStart(const AmSipRequest& req)
{
- AmPrecodedFileInstance* file =
file_def->getFileInstance(rtp_str.getCurrentPayload(),
+ int current_payload=rtp_str.getCurrentPayload();
+ if ((current_payload == -1) && !m_payloads.empty()) {
+ current_payload = m_payloads[0]->payload_type;
+ }
+ AmPrecodedFileInstance* file = file_def->getFileInstance(current_payload,
m_payloads);
- if (!file || file->open())
- throw string("PrecodedDialog::onSessionStart: Cannot open file\n");
+ if (!file) {
+ ERROR("no payload\n");
+ }
+ if (!file || file->open()) {
+ ERROR("PrecodedDialog::onSessionStart: Cannot open file\n");
+ dlg.bye();
+ setStopped();
+ return;
+ }
rtp_str.setFormat(file->getRtpFormat());
_______________________________________________
Semsdev mailing list
[email protected]
http://lists.iptel.org/mailman/listinfo/semsdev