added function to ignore sigchld (executing shell cmds)

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

@ -113,6 +113,19 @@ extern "C" {
return PyString_FromString(res.c_str());
}
static PyObject* ivr_ignoreSigchld(PyObject*, PyObject* args)
{
int* ignore;
if(!PyArg_ParseTuple(args,"i",&ignore))
return NULL;
AmConfig::IgnoreSIGCHLD = ignore;
DBG("%sgnoring SIGCHLD.\n", ignore?"I":"Not i");
return Py_None;
}
static PyObject* ivr_getSessionParam(PyObject*, PyObject* args)
{
char* headers;
@ -165,6 +178,7 @@ extern "C" {
{"getHeader", (PyCFunction)ivr_getHeader, METH_VARARGS,"Python getHeader wrapper"},
{"getSessionParam", (PyCFunction)ivr_getSessionParam, METH_VARARGS,"Python getSessionParam wrapper"},
{"createThread", (PyCFunction)ivr_createThread, METH_VARARGS, "Create another interpreter thread"},
{"setIgnoreSigchld", (PyCFunction)ivr_ignoreSigchld, METH_VARARGS, "ignore SIGCHLD signal"},
{NULL} /* Sentinel */
};
}

@ -66,6 +66,7 @@ vector <string> AmConfig::CodecOrder;
Dtmf::InbandDetectorType
AmConfig::DefaultDTMFDetector = Dtmf::SEMSInternal;
bool AmConfig::IgnoreSIGCHLD = false;
AmSessionTimerConfig AmConfig::defaultSessionTimerConfig;

@ -111,6 +111,8 @@ struct AmConfig
static Dtmf::InbandDetectorType DefaultDTMFDetector;
static bool IgnoreSIGCHLD;
/** Init function. Resolves SMTP server address. */
static int init();

@ -84,6 +84,9 @@ int deamon_mode=1;
static void sig_usr_un(int signo)
{
if (signo == SIGCHLD && AmConfig::IgnoreSIGCHLD)
return;
WARN("signal %d received\n", signo);
if(!main_pid || (main_pid == getpid())){

Loading…
Cancel
Save