Line 69: |
Line 69: |
| | | |
| ====Configuration==== | | ====Configuration==== |
− | Check and edit /etc/iaxmodem/ttyIAX0 as necessary:
| + | *Use template fragment to generate the required Iaxmodem configuration file ''ttyIAX0'' in /etc/iaxmodem |
− | device /dev/ttyIAX | + | mkdir -p /etc/e-smith/templates-custom/etc/iaxmodem/ttyIAX0 |
− | owner uucp:uucp
| + | cd /etc/e-smith/templates-custom/etc/iaxmodem/ttyIAX0 |
− | mode 660
| + | *Now create and edit a new file called ''modem'' with the following content: |
− | port 4570
| + | { |
− | refresh 60
| + | use esmith::DB::db; |
− | server 127.0.0.1
| + | |
− | peername 2000
| + | $OUT = ""; |
− | secret asterisk
| + | my $db = esmith::DB::db->open_ro('/home/e-smith/db/selintra'); |
− | cidname YourCompany
| + | |
− | cidnumber 0123456789
| + | unless ($db) |
− | codec slinear
| + | { |
| + | warn "Couldn't open Selintra DB in Iaxmodem ttyIAX0 template fragment. Using Defaults\n"; |
| + | } |
| + | |
| + | my $extension = $db->get_prop('global','FAX') || "2000"; |
| + | my $pass = $db->get_prop($extension,'passwd') || "asterisk"; |
| + | my $cidname = $db->get_prop($extension,'desc') || "Noname"; |
| + | my $cidnumber = $db->get_prop($extension,'callerid') || "0123456789"; |
| + | |
| + | $OUT .= "device /dev/ttyIAX\n"; |
| + | $OUT .= "owner uucp:uucp\n"; |
| + | $OUT .= "mode 660\n"; |
| + | $OUT .= "port 4570\n"; |
| + | $OUT .= "refresh 60\n"; |
| + | $OUT .= "server 127.0.0.1\n"; |
| + | $OUT .= "peername $extension\n"; |
| + | $OUT .= "secret $pass\n"; |
| + | $OUT .= "cidname $cidname\n"; |
| + | $OUT .= "cidnumber $cidnumber\n"; |
| + | $OUT .= "codec slinear\n"; |
| + | } |
| + | *Save and close the file. |
| + | *Now expand the template |
| + | /sbin/e-smith/expand-template /etc/iaxmodem/ttyIAX0 |
| + | *This will create the necessary ttyIAX0 file, using the settings from Sail/Asterisk. It assumes you have set the Fax extension in ''globals'' and have created a valid ''extension'' of type ''IAXModem''. |
| + | {{Note box|If the required settings are not available in Sail/asterisk then it defaults to an extension of '2000', a secret/password of 'asterisk', a CID Name of ''NoName'' and Caller ID of ''0123456789''}} |
| + | |
| ====Check and Run==== | | ====Check and Run==== |
| Check the modem registers with Sail and Asterisk | | Check the modem registers with Sail and Asterisk |