The attached patch fixes an apparent bug in the serviceline example.

Thanks!
From de7161b002b4e85c7eac5b8e73d978686dac3266 Mon Sep 17 00:00:00 2001
From: Will Newton <[email protected]>
Date: Thu, 22 Jan 2015 12:04:51 +0000
Subject: [PATCH] apps/examples/serviceline: Enable early return from onInvite

The intent appears to be to return the appropriate object rather
than just create it.
---
 apps/examples/serviceline/ServiceLine.cpp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/apps/examples/serviceline/ServiceLine.cpp b/apps/examples/serviceline/ServiceLine.cpp
index 3898cd3..7ca3bb9 100644
--- a/apps/examples/serviceline/ServiceLine.cpp
+++ b/apps/examples/serviceline/ServiceLine.cpp
@@ -104,12 +104,12 @@ AmSession* ServiceLineFactory::onInvite(const AmSipRequest& req, const string& a
     
   DBG("trying '%s'\n",announce_file.c_str());
   if(file_exists(announce_file))
-    new ServiceLineCallerDialog(announce_file);
+    return new ServiceLineCallerDialog(announce_file);
     
   announce_file = announce_path + req.user + ".wav";
   DBG("trying '%s'\n",announce_file.c_str());
   if(file_exists(announce_file))
-    new ServiceLineCallerDialog(announce_file);
+    return new ServiceLineCallerDialog(announce_file);
     
   announce_file = AnnouncePath + AnnounceFile;
   return new ServiceLineCallerDialog(announce_file);
-- 
2.1.0

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

Reply via email to