modem support for Asterisk 1.2

Comment on Asterisk Modem channels
ecze
Joined: Mon 23 of Apr, 2007

modem support for Asterisk 1.2

Posted:Mon 23 of Apr, 2007 (09:43 UTC)
Hi,

I have sucessfully enabled chan_modem for asterisk 1.2
To do that , edit the Makefile under channels/ directory and un comment the lines regarding chan_modem

Finally fix the bug in chan_modem.c in monitor_restart() function.

static int restart_monitor()
{
/* If we're supposed to be stopped — stay stopped */
if (monitor_thread == AST_PTHREADT_STOP)
return 0;
if (ast_mutex_lock(&monlock)) {
ast_log(LOG_WARNING, "Unable to lock monitor\n");
return -1;
}
if (monitor_thread == pthread_self()) {
ast_mutex_unlock(&monlock);
ast_log(LOG_WARNING, "Cannot kill myself\n");
return -1;
}
if (monitor_thread != AST_PTHREADT_NULL) {
pthread_kill(monitor_thread, SIGURG);
//pthread_join(monitor_thread, NULL); <--- this line must be removed or just comment it !!!
} else {
/* Start a new monitor */
if (ast_pthread_create(&monitor_thread, NULL, do_monitor, NULL) < 0) {
ast_mutex_unlock(&monlock);
ast_log(LOG_ERROR, "Unable to start monitor thread.\n");
return -1;
}
}
ast_mutex_unlock(&monlock);
return 0;
}