Asterisk Modem channels
Created by: JustRumours,Last modification on Tue 01 of Nov, 2005 [20:52 UTC]
Modem channels
The "Modem" channel is factually only of use for ISDN cards operated with the i4l (isdn4linux) driver. Note that there is an alternative method to use ISDN hardware within Asterisk that employs the CAPI channel (chan_capi) - in future also mISDN in Kernel 2.6 will provide CAPI support to cards that until recently only enjoyed HiSax (i4l) support. However these channel drivers are not part of the standard Asterisk code distribution.Most analog modems provide half-duplex only, and Asterisk doesn't provide a simple path to integrate those into the system. Do also check the FAQ on this.
Here is the calling syntax: Dial(Modem/Modem/MSN:Destination))
Note: Asterisk 1.2 doesn't support (isdn4linux). Instead use either CAPI (with chan_capi), or zaphfc, or mISDN (with Kernel 2.6) or the like.
Modem can be either the device name (i.e. ttyI0), or the group of modems (i.e. g1)
MSN is the outgoing MSN you want tu use
Destination is the number you are calling
Example:
; dial out using device "ttyI0" or "ttyI1"exten => 200,1,Dial(Modem/ttyI0/1234567:${EXTEN})
exten => 201,1,Dial(Modem/ttyI1/123457:${EXTEN})
; dial out using device group "g1"
exten => 202,1,Dial(Modem/g1/1234567:${EXTEN})
In the stable 1.0.9 version, the syntax appears to be Dial(Modem/Modem:Destination). The outgoing MSN is picked up from the ${CALLERIDNUM}.
See also
- Asterisk ISDN4Linux
- CAPI
- mISDN
- c't magazine on i4l, hisax and mISDN (German language, excellent article)
- Go back to Asterisk channels
- Asterisk: The start page | Tips & Tricks | Introduction | Applications | CLI

Comments
333modem support for Asterisk 1.2
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;
}