From 1bb358edd4755deb812304d5868dee8611484907 Mon Sep 17 00:00:00 2001 From: Stefan Sayer Date: Sun, 21 Mar 2010 22:23:46 +0000 Subject: [PATCH] fixed compilation of urlcatcher example, checking return code of system call git-svn-id: http://svn.berlios.de/svnroot/repos/sems/trunk@1677 8eb893ce-cfd4-0310-b710-fb5ebe64c474 --- apps/examples/urlcatcher/Makefile | 2 +- apps/examples/urlcatcher/UrlCatcher.cpp | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/apps/examples/urlcatcher/Makefile b/apps/examples/urlcatcher/Makefile index cabf8aa7..3035ed29 100644 --- a/apps/examples/urlcatcher/Makefile +++ b/apps/examples/urlcatcher/Makefile @@ -3,5 +3,5 @@ plug_in_name = urlcatcher module_ldflags = module_cflags = -COREPATH ?=../../core +COREPATH ?=../../../core include $(COREPATH)/plug-in/Makefile.app_module diff --git a/apps/examples/urlcatcher/UrlCatcher.cpp b/apps/examples/urlcatcher/UrlCatcher.cpp index ebb06f76..147dedc7 100644 --- a/apps/examples/urlcatcher/UrlCatcher.cpp +++ b/apps/examples/urlcatcher/UrlCatcher.cpp @@ -75,7 +75,13 @@ AmSession* UrlCatcherFactory::onInvite(const AmSipRequest& req) if (sdp.uri.empty()) throw AmSession::Exception(404, "Not Found Here (No Call URI found)"); - system((UrlCatcherFactory::ExecCmd + " \""+sdp.uri+"\"").c_str()); + int res = system((UrlCatcherFactory::ExecCmd + " \""+sdp.uri+"\"").c_str()); + if (res == -1) { + ERROR("executing system command '%s'\n", + (UrlCatcherFactory::ExecCmd + " \""+sdp.uri+"\"").c_str()); + } else { + DBG("command returned code %d\n", res); + } throw AmSession::Exception(404, "Not Found Here (but I got your URL)"); }