Thursday, November 19, 2009

How to find Static IP Address

1. Get the MAC address from the phone.
2. Put Protocol sniffer (like Wireshark) on hub w/ Phone and PC.
3. On windows PC:

arp -s (unused IP on LAN) (MAC of phone entered like 00-aa-00-62-c6-09)

4. On PC, ping IP:

ping (unused IP selected)

5. Check Protocol sniffer for responses from phone's MAC address.
6. I think that you should see it's real IP in the ARP packets coming from the phone.
7. Set your PC up with an address on the subnet of the phone.
8. Telnet or http into the phone/device.
This is probably assuming that the default password hasn't changed.

Friday, September 18, 2009

Digium PCI Telephony card Stability Issues

How to solve Digium PCI Telephony card Stability Issues

This guide is mainly related to TE122P stability issues which are being experienced by some users of Asterisk®. Naturally, this also applies to Elastix® and other distribtions that use Asterisk®. This guide can also be applied to any other Digium® products that you might be having issues with and is a guide for good practice in any case. This has been confirmed with both Elastix® and some other ISO based distributions.

In the last month, we had two systems that had similar issues, which was dropping of calls at random times during the day. Its one of those problems that is not easy to diagnose, even down to using PRI Debug, it looks like the carrier equipment has failed for a brief period. So naturally you follow up with the carrier, asking them to look at the line to see if they have any issues.

The reason why I mention two machines, was that they were about 14 months apart in motherboard design (although similar), and it would be beneficial to see if the same correction applied to both would correct the issue, giving us some confidence that this was a step in the right direction. It has also been reported by others that this occurs on both AMD® and Intel® Chipset motherboards

To confirm you have a similar issue, the symptoms/issues that you may come across are:

1) Calls being dropped (Due to Red Alarm)
2) Red Alarms occurring on a regular basis, usually at least 10 per day (as evidenced in the Asterisk Logs)
3) Red Alarms occurring for less than a second
4) When using a Asterisk® Based distribution such as Elastix®, initial format and install is quite slow (15 min format on 120Gb, and 26 min install of ISO as opposed to 3 min format and 6-8 min install of ISO)
5) ZTTool showing an ever increasing increase in the Interrupt misses.
6) The faster the machine, the faster the Interrupt misses increase, and also naturally the more often the call drop outs.

Many of us are aware of the interrupt issue where it is always good practice to make sure that the Digium® cards are on their own interrupt (e.g. not sharing with another device), and this includes many of the Digium® Range, as missed interrupts can cause different issues on different cards. As an example the TDM400P with missed interrupts, can result in crackle on the line, or hissing/popping noises. Many of us have become blaise about this interrupt issue as OS software has improved, drivers have improved, APIC has improved and for many it has not presented any issue.

However, with some of the later motherboards, especially with some of the more "generic" boards, they have been making reasonable changes which include less PCI Slots, changing from IDE to SATA, which also includes support of both hard drive types (including mixing), and many other small changes. These changes are making an impact as we found out recently. It is necessary to move back to confirming that the interrupts are not conflicting with the DIGIUM® Cards. At this point it should be noted that these rules should not only apply to Digium® cards but any other cards used for Telephony.

The same emphasis that you place on good network infrastructure, WAN Quality of Service, traffic prioritisation, should equally apply to the telephony card that you install. Those same "realtime traffic" rules that you steadfastly apply to your Local Area Network and Wide Area Network should apply to your Telephony interface.

To resolve this issue, we used a few "tools" that are available on the system. You don't need to install any additional software. The first one is the simple command

#cat /proc/interrupts

CPU0 CPU1
0: 56986323 0 IO-APIC-edge timer
6: 5 0 IO-APIC-edge floppy
8: 3 0 IO-APIC-edge rtc
9: 0 0 IO-APIC-level acpi
193: 990440 0 IO-APIC-level libata, wcte12x[p]
201: 56975304 0 IO-APIC-level eth0
NMI: 0 0
LOC: 55878552 55878496
ERR: 0
MIS: 0

This straight away tells us that the SATA Interface/Driver and the TE122/Driver are sharing the same interrupt on the system.

Another tool is using ZTTEST which runs a test to confirm whether we had some easy to recognise Interrupt issues

root@elastix ~]# zttest -v
Opened pseudo zap interface, measuring accuracy...

8192 zaptel samples in 8191.664 system clock sample intervals (99.996%)
8192 zaptel samples in 8191.016 system clock sample intervals (99.988%)
8192 zaptel samples in 8191.543 system clock sample intervals (99.994%)
8192 zaptel samples in 8191.520 system clock sample intervals (99.994%)
8192 zaptel samples in 8191.512 system clock sample intervals (99.994%)
8192 zaptel samples in 8191.424 system clock sample intervals (99.993%)
8192 zaptel samples in 56191.512 system clock sample intervals (0.146%) <==== The blip
8192 zaptel samples in 8191.480 system clock sample intervals (99.994%)
8192 zaptel samples in 8191.423 system clock sample intervals (99.993%)
8192 zaptel samples in 8191.456 system clock sample intervals (99.993%)
8192 zaptel samples in 8191.472 system clock sample intervals (99.994%)
8192 zaptel samples in 8191.440 system clock sample intervals (99.993%)
8192 zaptel samples in 8191.496 system clock sample intervals (99.994%)
8192 zaptel samples in 8191.464 system clock sample intervals (99.993%)
8192 zaptel samples in 8191.488 system clock sample intervals (99.994%)
8192 zaptel samples in 8191.432 system clock sample intervals (99.993%)
8192 zaptel samples in 8191.528 system clock sample intervals (99.994%)

We run this test over several hours and noted that in general we were on target (on target is generally a figure of 99.97% or better), except for the occasional blip that you will notice in the listing above. Now generally we take the ZTTEST results with a grain of salt, but in this case, this blip was not something we had seen before, and secondly, the amount of times that it appeared over a two hour period, seemed to roughly correalate to the timing that the system dropped the calls. Secondly, it appeared that the IRQ misses that we saw before, seemed to increase each time this blip appeared.

Last but not least we used the

lspci -vb command

What this provided was very detailed information on how the cards/devices were seen at both the bus level and also at the OS level. The output we saw was as follows

[root@elastix asterisk]# lspci -vb

00:1f.2 IDE interface: Intel Corporation 82801GB/GR/GH (ICH7 Family) SATA IDE Co
ntroller (rev 01) (prog-if 8f [Master SecP SecO PriP PriO])
Subsystem: Giga-byte Technology Unknown device b002
Flags: bus master, 66MHz, medium devsel, latency 0, IRQ 5
I/O ports at d400
I/O ports at d800
I/O ports at dc00
I/O ports at e000
I/O ports at e400
Capabilities: [70] Power Management version 2

00:1f.3 SMBus: Intel Corporation 82801G (ICH7 Family) SMBus Controller (rev 01)
Subsystem: Giga-byte Technology Unknown device 5001
Flags: medium devsel, IRQ 5
I/O ports at 0500

02:00.0 Ethernet controller: Digium, Inc. Unknown device 8001 (rev 11)
Subsystem: Digium, Inc. Unknown device 8001
Flags: bus master, medium devsel, latency 64, IRQ 5
I/O ports at a000
Memory at e1000000 (32-bit, non-prefetchable)
Capabilities: [c0] Power Management version 2

02:01.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL-8139/8139C/8139
C+ (rev 10)
Subsystem: Realtek Semiconductor Co., Ltd. RT8139
Flags: bus master, medium devsel, latency 64, IRQ 9
I/O ports at a400
Memory at e1001000 (32-bit, non-prefetchable)
Capabilities: [50] Power Management version 2


(*Note - I have only included a few relevant lines.)

Now the normal routine is to relocate the TE122P into a different slot on the motherboard, which in most cases will change the IRQ that the TE122 will use, usually correcting the issue.

So Our interrupts now look like this

cat /proc/interrupts
CPU0 CPU1
0: 56986323 0 IO-APIC-edge timer
6: 5 0 IO-APIC-edge floppy
8: 3 0 IO-APIC-edge rtc
9: 0 0 IO-APIC-level acpi
193: 990440 0 IO-APIC-level libata, eth0
201: 56975304 0 IO-APIC-level wcte12x[p]
NMI: 0 0
LOC: 55878552 55878496
ERR: 0
MIS: 0

If anyone is watching, you will notice that we switched the position of our Ethernet Card and the TE122P card in the PCI Slots. But we now have the desired results that we were looking for which is the TE122P now sitting on an Interrupt of its own.

Normally this would correct things, but what was interesting was our interrupts continued to climb. It appeared that all that we have been taught about interrupts and TE122P was wrong. Suspicions continued....did we have a faulty card? This was discounted straight away as we had two systems doing the same thing, the only thing that was the same was the carrier, although these were two separate locations, so again this was discounted, and we were left with the machine.

After many, many hours, working through all the BIOS options, disabling devices, trying IDE Drives instead of SATA Drives etc etc...we finally made a change which surprised us. Changing the SATA mode in the BIOS from Auto (which is the default on all these motherboards) to SATA Enhanced resulted in the interrupt misses becoming rock solid after boot up. It was the last thing we wanted to change, as we were using a IDE DVDROM drive (which many of the system builders are still supplying).

If the system is using SATA Hard Drive and a IDE CDROM, the system, in Auto mode selects the PATA/SATA mode to support both devices and it appears that this mode is causing a large amount of the issues. Whether it is a combination of the LIBATA Driver and this PATA/SATA compatibility mode, we cannot be sure which is causing the issue. But taking a huge guess, I suspect that this mode is causing clock cycles to be missed or "stolen" resulting in the interrupt misses.

What further backs up that we had found the device that was causing the issue, was the fact that now, upon installing the ISO Distribution again, the installation was back to lightning fast, with 3 mins for the format, and 5 or so minutes for the install.

Naturally, to confirm that we have found the issue, we put everything back to defaults in the BIOS, we moved the cards back to the slots that we had previously, and run the same tests, reinstalled the ISO, which went back to the very long install time, and then checked the interrupts and found them climbing again. This time, we made just the change to the SATA settings in BIOS, and whilst this defintely slowed the interrupt misses, but they were still climbing, but only at a rate of 2 or so every minute, which was a lot better, but not the rock steady position that we had with both corrections.

So to summarise, it appears that the two issues together were causing the Interrupt misses that we had, which were

1) The LIBATA and the WCTE12x[p} driver cannot be on the same interrupt
2) The SATA Driver must be set to ENHANCED MODE (to reduce the possibility that the system selects PATA/SATA mode) which means that you need to be using a SATA (not IDE) CDROM or DVDROM, otherwise it may be disabled

Further evidence has been reviewed on Google, that similar issues are being found on Linux and other Operating Systems with handling of Dual IDE and SATA. What was interesting is that on one motherboard that we applied these changes, we lost access to the IDE Drive, on the other it appeared to still function with and IDE DVD Drive, while in SATA Enhanced mode. It clearly shows that the board manufactures have not got this mode working correctly, and it appears to affect many other boards as well including SuperMicro, ASUS and many others.

Anyhow, we made the changes above to two machines which were defintely suffering from the issue, and we can confirm that they have been in place now for several weeks withour an interrupts miss or any issues (which is what we wanted).

Hope this helps others with similar issues.

Source;
http://www.elastixconnection.com/index.php?option=com_content&task=view&id=60&Itemid=77

Friday, September 11, 2009

Receive and Send Fax with Asterisk 1.4/1.6

Receiving and sending faxes with asterisk 1.4, NVFaxDetect, iaxmodem and hylafax

UPDATE: Changes to mutex usage in Asterisk 1.4.23 cause NVFax to cease to compile properly, see below for updated files that compile with 1.4.23.1

We have bridged our HylaFax server with our Asterisk server in order to be able to send and receive faxes over VOIP phone lines and to eliminate dedicated PSTN phone lines hooked up directly to modems on our HylaFax server. A lot of documentation floating around on the internet states that VOIP phone lines are not really suited to send/receive faxes. We have found out that it mostly depend on the providers you are using and on your network connectivity quality.



Note: To be able to send/receive faxes over IP, your provider has to support the ulaw codec (alaw in Europe and other areas). gsm, g729 and other compression codecs won't work.
We obtain virtually 100% successful completion for fax transmissions (20 pages per transmission in our tests) with one specific provider while it doesn't work at all with other providers.



Note although that the setup described is this article is also convenient if your faxes come in through PSTN lines (conventional copper wire lines) hooked up to your asterisk server. We used to have dedicated PSTN lines hooked up directly to physical hardware modems on our HylaFax server. We moved those lines to Asterisk and it forwards the call to virtual modems (iaxmodems) running on the HylaFax server residing on the same LAN. Note that there is zero degradation in fax transmission over an iax2 channel on the LAN (Local Area Network).

Iaxmodem documentation states that it should only be used to connect to an Asterisk server over a LAN connection, there is no degradation in fax transmission over an iax2 channel on a LAN. So if you receive fax phone calls over VOIP from the internet, Asterisk will be in charge of dealing with your VOIP provider to insure that the fax is transmitted correctly. If your asterisk server receives fax phone calls over traditional PSTN copper wire lines, you will experience zero fax transmission problems with the setup defined in this article.

Iaxmodem is viewed as an IAX2 extension from Asterisk. It allows you to use any other software at your convenience beside HylaFax to handle the faxes. From linux or hylafax, the virtual iaxmodem is just viewed as a standard hardware fax-modem that could be connected to your system.

What is needed:

At minimum, if you have a dedicated number for your fax machine and you don't need to detect incoming fax tones from a human person you will need:

* Iaxmodem (Click to download)

If you need to detect incoming fax tones in order to be able to share your fax lines with human voice, you will need to recompile asterisk with NVFaxdetect support, simply compile Asterisk after adding the following files into the apps folder in the asterisk sources. The Makefile is just the genuine Makefile with the NVfax apps added into it like this:

APPS+=app_nv_faxdetect.so
APPS+=app_nv_backgrounddetect.so

* Asterisk sources
* apps/app_nv_faxdetect-1.0.6_1.c
* apps/app_nv_backgrounddetect-1.0.6_1.c
* apps/Makefile

UPDATE: For Asterisk 1.4.23.1 and probably for future Asterisk releases, use the following NVFax files instead:

* apps/app_nv_faxdetect-1.0.6_1-foras1.4.23.1.c
* apps/app_nv_backgrounddetect-1.0.6_1-foras1.4.23.1.c

Note: If you downloaded and installed Asterisk from a pre-compiled distribution repository (yum install, trixbox, etc.), you may already have NVFax support built-in to your Asterisk server. Just type the following command to find out, if the modules are there, you already have support for NVFax and you can skip this step.

$ ls /usr/lib/asterisk/modules/app_nv_*

/usr/lib/asterisk/modules/app_nv_backgrounddetect-1.0.6_1.so

/usr/lib/asterisk/modules/app_nv_faxdetect-1.0.6_1.so

Note2: If your fax calls come in exclusively through PSTN lines, you do not need NVFax, just use Zaptel for fax detection. Zaptel fax detection is bundled with every asterisk distribution as far as we can tell. We do not really know because our PSTN lines are hooked to a GXW4104 IP Analog Gateway that forwards PSTN fax calls to our Asterisk server through VOIP. We do not use Zaptel, except ztdummy with high resolution timer kernel support for timing.

You will also need a software to handle faxes coming into or going out from your iaxmodem, we use HylaFax:

* HylaFax (Click to download)


Iaxmodem setup

Download, compile and install iaxmodem. We built iaxmodem statically ( issuing the command "./build static" to build) and we have just copied the generated executable (iaxmodem) to /usr/local/bin

Install the configuration file for your modem in /etc/iaxmodem (mkdir /etc/iaxmodem), we configured 2 faxes to be mapped to 2 extensions defined in asterisk configuration; extension 125 and extension 126:

extension 125 file in /etc/iaxmodem/tty125 :

device /dev/tty125
owner uucp:uucp
mode 660
port 4570
refresh 1800
server 10.10.1.20
peername 125
secret XXXXX
cidname Technologies OC9-ACTS
cidnumber 5555551212
codec ulaw

extension 126 file in /etc/iaxmodem/tty126 :

device /dev/tty126
owner uucp:uucp
mode 660
port 4571
refresh 1800
server 10.10.1.20
peername 126
secret XXXXX
cidname Technologies OC9-ACTS
cidnumber 5555551212
codec ulaw

We arranged so that iaxmodem starts automatically by adding the following to our rc.local file :

/usr/local/bin/iaxmodem

Note: Do not put any other file in /etc/iaxmodem if you use the above command. We left a text file that didn't look at all like an iaxmodem config file but still, iaxmodem read that file and locked up the default iax2 port (4569) on the machine! ;-)

With no option given, iaxmodem just automatically reads all files in /etc/iaxmodem and configures all virtual modems accordingly. We defined extension 125 and 126 with the same passwords in asterisk.On startup iaxmodem registers extension 125 and 126 with the asterisk server. We can see this by running the following command:

asterisk -r -x "iax2 show peers"

126 192.168.11.138 (D) 255.255.255.255 4571 OK (2 ms)
125 192.168.11.138 (D) 255.255.255.255 4570 OK (2 ms)

At this point asterisk is ready to forward calls to the 2 iaxmodems. We have a dedicated fax number, we just mapped that number to extension 125 in FreePBX incoming routes and asterisk forwards all calls to that number to the iaxmodem virtual fax.

Setting up fax tone detection

This step is only required if you want to share your fax lines with human voice. Basically, NVFaxdetect will listen for fax tones when a call comes into asterisk. If it hears fax tones, it will forward the call to extension 126 otherwise, the call is just normally forwarded to our IVR (automated digital receptionist).

To enable Asterisk to use NVFax to detect incoming faxes, we simply need to recompile it after adding the files listed above in the "What is needed" section.

We can now enable fax detection in FreePBX incoming route, specifying to forward the call to extension 126 if fax tones are detected. 5 seconds is the recommanded time to listen for fax tones before passing the call to the IVR or to a human. A human caller will simply hears an additional ring tone during that 5 seconds.

HylaFax configuration

Note that you can use any software to pickup and send faxes from/to the iaxmodems, we just use Hylafax. Here is our HylaFax config file so that it can talk with the iaxmodem on extension 125:

file in /var/spool/hylafax/etc/config.tty125 :

CountryCode: 1
AreaCode: 418
FAXNumber: +1.555.555.1212
LongDistancePrefix: 1
InternationalPrefix: 011
DialStringRules: etc/dialrules
ServerTracing: 1
SessionTracing: 11
RecvFileMode: 0660
LogFileMode: 0600
DeviceMode: 0600
RingsBeforeAnswer: 1
SpeakerVolume: off
GettyArgs: "-h %l dx_%s"
LocalIdentifier: "OC9 Technologies"
TagLineFont: etc/lutRS18.pcf
TagLineFormat: "From %%l|%c|Page %%P of %%T"
MaxRecvPages: 175

#
#
# Modem-related stuff: should reflect modem command interface
# and hardware connection/cabling (e.g. flow control).
#
ModemType: Class1 # use this to supply a hint

#
# Enabling this will use the hfaxd-protocol to set Caller*ID
#
#ModemSetOriginCmd: AT+VSID="%s","%d"

#
# If "glare" during initialization becomes a problem then take
# the modem off-hook during initialization, and then place it
# back on-hook when done.
#
#ModemResetCmds: "ATH1\nAT+VCID=1" # enables CallID display
#ModemReadyCmds: ATH0

Class1AdaptRecvCmd: AT+FAR=1
Class1TMConnectDelay: 400 # counteract quick CONNECT response

#
# If you have trouble with V.17 receiving or sending,
# you may want to enable one of these, respectively.
#
Class1RMQueryCmd: "!24,48,72,96" # enable this to disable V.17 receiving
Class1TMQueryCmd: "!24,48,72,96" # enable this to disable V.17 sending

#
# You'll likely want Caller*ID display (also displays DID) enabled.
#
ModemResetCmds: AT+VCID=1 # enables CallID display

#
# The pty does not support changing parity.
#
PagerTTYParity: none

#
# If you are "missing" Caller*ID data on some calls (but not all)
# and if you do not have adequate glare protection you may want to
# not answer based on RINGs, but rather enable the CallIDAnswerLength
# for NDID, disable AT+VCID=1 and do this:
#
#RingsBeforeAnswer: 0
#ModemRingResponse: AT+VRID=1

# Uncomment DATE and TIME if you really want them, but you probably don't.
#CallIDPattern: "DATE="
#CallIDPattern: "TIME="
CallIDPattern: "NMBR="
CallIDPattern: "NAME="
CallIDPattern: "ANID="
#CallIDPattern: "USER=" # username provided by call
#CallIDPattern: "PASS=" # password provided by call
#CallIDPattern: "CDID=" # DID context in call
CallIDPattern: "NDID="
#CallIDAnswerLength: 4

We now need to fork the usual Hylafax faxgetty to listen for incoming fax :

in rc.local :

/usr/local/sbin/faxgetty tty125 &

/usr/local/sbin/faxgetty tty126 &

as well as the usal daemons, see HylaFax documentation if you are interested in using it.

in rc.local :

/usr/local/sbin/hfaxd
/usr/local/sbin/faxq

Add-on

View this free package: AvantFax. It allows you to let your users access fax functionality from a web browser. Some have used this package along with what is described in this article to set up pools of over 2000 iaxmodems and they have got so to speak in the fax sending/receiving outsourcing business.




Commentaires / Comments (23)
forward call to 125 extension
1 vendredi, 07 décembre 2007 05:14
spooky
How can I perform fax detection and forward to extension 125 in asterisk 1,4 ? (No FreePBX)
Re: forward call to 125 extension
2 jeudi, 13 décembre 2007 23:37
ls
Hi,

Note that 125 is just a random extension number we picked up for our examples, it can be any extension number.

You can do the same in Asterisk 1.4 without FreePBX by manually editing your extension.conf file. Just follow the instructions in the article and edit your extension.conf manually instead of editing the extension settings in FreePBX.

Here are the lines required to detect a FAX or send to an IVR in the incoming section of extention.conf :
...
...
exten => s,n,Set(FAX_RX=125)
exten => s,n,Answer
exten => s,n,Playtones(ring)
exten => s,n,NVFaxDetect(5)
exten => s,n,Goto(ivr-2,s,1)
...

Just replace the lines in your configuration file that sends to the IVR with the above lines in order to first detect fax tones and reload Asterisk so it re-read its config files.
tiff isues
3 jeudi, 31 janvier 2008 10:21
spooky
I have managed to install hylafax.When a fax comes my asterisk forward the call to iaxmodem.Iaxmodem to hylafax . But when I try to see the fax,which is in tiff format,through webmin then I receive an error , That the file format is not supported or Image something is not installed on my machine . What may be the problem ?
Re: tiff issue
4 vendredi, 01 février 2008 00:34
oc9
Hi,

If you got so far, it means you have successfully configured asterisk, iaxmodem and hylafax. Congratulations! ;-)

As you may already understand, the tiff issue is not related to the fax setup.

To be able to view faxes from webmin you should.

1) Make sure the tiff mime type is defined in your apache configuration, in your apache folder, in conf/mime.types, you should have a line with :

image/tiff tiff tif

2) You will need a program that supports displaying multi-page tiff images.

Do a search for "linux fax viewer" to find a program that displays multi-page tiff files correctly.

On my linux desktop, I use :

kfax (KDE fax viewer)

To have mozilla open the tiff file automatically when you click on it, you will need to define you fax viewer program (i.e. kfax) to handle tiff files in mozilla or in your system settings.

Alternatively, you can download the file to your local drive and use the tiff2ps or tiff2pdf utilities (to transform it either to a .ps or .pdf file.

Same principle applies on windows, on windows, my XP install came with a utility named "Windows image and faxes preview" and that's what I use to read/print faxes (e.g. tiff files).
Asterisk & Fax over SIP Channels
5 jeudi, 14 février 2008 15:49
Amit
Hi
i read your post on Asterisk list. last 3 months i am trying to set Asterisk Fax to email
on SIP, but i have no success when i try with Spandsp..
so do you have any idea how we can make this if we are using SIP-VOIP with
Asterisk.Otherwise help me to do this with any other software taht u check it.only need is that that work
with SIP-VOIP Asterisk.(SIP Channel).
plz provide me link or config deatils if you have so i can try this with my Asterisk
Asterisk version 1.4.9
on dell server with RHEL OS
using SIP Channel type.

i am waiting for ur reply


Regards
Amit
RE: Asterisk & Fax over SIP Channels
6 jeudi, 14 février 2008 15:51
Alain Côté
1) We try that too but we couldn't get it to work well. That's why we recommend using iaxmodem. Iaxmodem comes with its own spandsp libraries.



2) So asterisk knows nothing about spandsp, asterisk just forwards the call to iaxmodem which takes care of decoding the fax. We leave asterisk alone and handle the faxes with iaxmodem. Don't use spandsp within asterisk.

3) Since you tell asterisk to forward the call to iaxmodem in inbound routes, (or in extensions if you wish) it does not matter if the call comes in through a SIP trunk or an IAX trunk. We have calls coming in through SIP and IAX trunks and faxes are forwarded to the iaxmodem.

4) Hylafax is a very stable and powerful fax handling software, it does fax to email since at least 15 years ;-)

SIP trunk --> asterisk --> iaxmodem --> hylafax --> email So the instructions in the article will work with a SIP trunk too ;-)

Cheers,
creating fax dialplan in asterisk
7 jeudi, 06 mars 2008 12:25
Iqbal
Thanks for your tutorial. But i don't know how to create dial plan for my fax machine.So my asterisk know to send fax to the fax machine

Here my configuration

Hylafax+iaxmodem+trixbox2.4.xCisco router ios 13(FXO)Switching Center(PSTN Central)My fax machine(fax number 6211)
Could you give me example help to create dialplan in extension.conf for fax number in this case 6211 base on the configuration above.Thanks sorry for my English...
Re: creating fax dialplan in asterisk
8 dimanche, 16 mars 2008 23:36
oc9
Here are the lines required to detect a FAX or send to an IVR in the incoming section of extention.conf :
...
...
exten => s,n,Set(FAX_RX=125)
exten => s,n,Answer
exten => s,n,Playtones(ring)
exten => s,n,NVFaxDetect(5)
exten => s,n,Goto(ivr-2,s,1)
...

Just replace the lines in your configuration file that sends to the IVR with the above lines in order to first detect fax tones and reload Asterisk so it re-read its config files.

If you share voice and fax, you need to use NVFaxDetect which catch the fax call at the IVR level and automagically forwards it to the fax extension. If you have a dedicated number for your fax, just forward all calls to the fax extension like you would normally do for a phone extension with a dedicated number.

If you use FreePBX just configure the fax handling in your Inbound Routes :
Fax Extension: 6211
Fax Email: (leave blank)
Fax Detection Type: NVFax
Pause After Answer: 5
Faxing
9 vendredi, 11 avril 2008 11:22
Keith
Great read on your article, but there is a lot of misinformation on the subject.

1. Faxing over VoIP is not dependant on the carrier. Network jitter is what causes a fax to fail when sending/receiving faxes over SIP. The only reason you may get better results with one provider is because your connection to them, at this moment, may be good. However, this will eventually change at some point and your faxing will decrease to 50%-70% success rate.

2. IAX modem is slow (14.4k), but really only achieves 9.6k. This is something that will never change. Traditional lines are 33.6k. Hence, your 20 page document will take 5 times as long to send/receive.

3. Why are you trying to have Asterisk send the email? HylaFAX should be in charge of all fax functions including sending the pdf to email.

Guys, you will never be able to "beat" the system for faxing. If you want reliable faxing, stick with the PSTN.
Re: Faxing
10 dimanche, 13 avril 2008 03:06
Alain Côté
Great read on your article, but there is a lot of misinformation on the subject.



---> Thanks !

1. Faxing over VoIP is not dependant on the carrier. Network jitter is what causes a fax to fail when sending/receiving faxes over SIP. The only reason you may get better results with one provider is because your connection to them, at this moment, may be good. However, this will eventually change at some point and your faxing will decrease to 50%-70% success rate.

----> I agree, but this is the same as your "good" carrier becoming a bad "carrier" or your "good" internet connectivity becoming "bad". It is therefore dependent on your carrier and your internet connectivity, which is pretty much what we have said in the article ;-)

2. IAX modem is slow (14.4k), but really only achieves 9.6k. This is something that will never change. Traditional lines are 33.6k. Hence, your 20 page document will take 5 times as long to send/receive.

----> Very good point ! This should definitely have been noted in the article !

3. Why are you trying to have Asterisk send the email? HylaFAX should be in charge of all fax functions including sending the pdf to email.

-----> I don't know where this is from, we recommend delegating everything to Hylafax just as you do.

Guys, you will never be able to "beat" the system for faxing. If you want reliable faxing, stick with the PSTN.

------> Agreed, if you run a mission critical fax operation that needs maximum reliability. But this is changing slowly as networks get better. Who would have thought that VOIP could be possible in the early ages of Internet (say in 1980, when I got my first access to it)?. Also, do not forget that Internet2 (Also called The Grid) is coming ;-)

-------> Also, note that the article states that the suggested setup is also valid if you use PSTN lines ONLY with Asterisk as your PBX, it lets you share your fax lines with voice, all handled by Asterisk, with only PSTN lines and VOIP used internally only.


asterisk pstn faxing
11 dimanche, 11 mai 2008 05:10
dave
hi there i have a tdm24xxp(fxo) port is it possible to route faxes to hylafax from asterisk + do you need to route your incoming calls to the iaxmodem, or can you route the calls strait from fxo to hylafax using asterisk?

any help welcome
Re: asterisk pstn faxing
12 lundi, 19 mai 2008 20:03
oc9
Yes shou;ld be able to do that as long as you use ulaw between your asterisk and the tdm24xxp(fxo) and that it supports fax passtrough. You will also need to use a hardware modem on the hylafax server. This type of config is very similar to having hylafax hooked to a hardware modem that is turn hooked to a PSTN line. So asterisk routing prior to the fax call hitting the hardware modem on the hylafax server will be transparent.

Also, you wouldn't be limited by the relatively slow speed of iaxmodem, as a another user has rightly noted 2 messages ago.
Sending fax
13 mercredi, 16 juillet 2008 23:42
Juvs
Hi, nice tutorial, but I didn't see an example to send an fax using hylafax and asterisk, we have some PSTN lines connected to asterisk and we want to sent faxes using this lines.
Need to setup this only for outgoing faxes...
14 jeudi, 31 juillet 2008 13:02
Capt Nemo
Hi there,

great article, I wana setup this for only outgoing faxes, i-e, I only need to send faxes. Is it possible. Do I still need any extra hardware for this?

thanks for your help in advance!!!

cheers!
Nemo.
Re: Sending fax
15 lundi, 04 août 2008 20:29
oc9
Just follow standard hylafax procedure to send a fax. Remember that hylafax sees your IAXmodem as any other modem. The fact that you use iax modem/asterisk is completely transparent to hylafax. Hylafax doesn't know anything about asterisk and iaxmodem, hylafax doesn't even know they exist!

That's the reason why we like this approach despite the limitations of iaxmodem, everything is nicely layered in indepandant layers.

To send a fax, we just use the following command triggered from our custom web interface, just have a look at AvantFax (link in the article) if you want to install a turn key solution :

command to send fax with hylafax:

/usr/local/bin/sendfax -x "Destination company" -r "Subject of the fax" -c "Comment for recipient" -D -h localhost:9008 -d "Recipient Name"@1555555121 2 file.pdf
Re: Need to setup this only for outgoing faxes...
16 lundi, 04 août 2008 20:36
oc9
The setup described in this article works equally well to send faxes, please have a look at above reply (Re: Sending fax) which pretty much answer your question.

Additionally, remember that this setup works with totally independent layers so any solution that works with hylafax to send faxes will work with this setup.

Hylafax exists since more than 15 years so many very mature solutions to send faxes with hylafax are available. Again, that's why we choose that solution, to completely abstract asterisk and VOIP out of the picture.
Which provider you have tested is suited best?
17 samedi, 07 mars 2009 17:49
ingo
We also have tested two dozen providers. So far gafachi stands out. What is your best choice?
I can't receive fax
18 lundi, 09 mars 2009 06:49
faty
Hi:
How can I see the communication between hylafax and iaxmodem and the console of them?I only can see the console of asterisk.It shows: 'IAX2/iaxmodem-2 is ringing' when I dial the fax number.
and nothing else.I can't receive fax.
I installed asterisk 1.4.18 and iaxmodem-1.2.0 and
hylafax-5.2.9-1.fc9.i386.rpm and these are my main configurations:
extensions.conf:
[from-pstn]
exten => 9711315,1,Answer
exten => 9711315,2,Dial(IAX2/iaxmodem)
iax.conf:
[iaxmodem]
type=friend
secret=password
port=4570
host=dynamic
context=from-pstn
disallow=all
allow=alaw

/etc/iaxmodem/ttyIAX0
device /dev/ttyIAX0
owner uucp:uucp
mode 660
port 4570
refresh 50
server 127.0.0.1
peername iaxmodem
secret password
codec alaw
and this is my modem type in /var/spool/hylafax/etc/config.tty
ModemType: Class1
/etc/inittab:
id:5:initdefault:
IA00:23:respawn:/usr/bin/iaxmodem
ttyIAX0
IA00:23:respawn:/usr/bin/iaxmodem
ttyIAX0
mo00:23:respawn:/usr/sbin/faxgetty ttyIAX0

I started hylafax and run iaxmodem.
I see below lines when I run faxstat:
HylaFAX scheduler on localhost.localdomain: Running
Modem ttyIAX0 (9711315): Waiting for modem to come ready

I'd appreciate any help,idea.
~
Re: Which provider you have tested is suited best?
19 lundi, 09 mars 2009 22:45
oc9
Hello,

Well there is no big secret, we use a local provider a few hops away from us that is directly hooked to the Telco via T1 links. The provider is 15ms away from us.

International providers where the call is routed to (or received from) out of the country networks have less chances to succeed in a steady way. There is more spots on the network where weakness may cause the call to fail and you often do not know how the call is routed once it gets to the provider.

To get maximum reliability, we use a local provider and we know how our call is routed once it gets to that provider. Straight to the Telco with T1 links ;-)

We do not use any of our other 4 providers for faxes for the reasons stated above. We use g729 on those trunks anyway which is not best suited for faxes.
Re: I can't receive fax
20 lundi, 09 mars 2009 22:52
oc9
Hi,

It looks like you do have faxgetty running, to test that hylafax communicates with the modem, use the following command:

$ ps axw | grep faxgetty
14871 pts/9 S 0:00 /sbin/faxgetty -q /var/spool/hylafax-2 tty882991110992
14872 pts/9 S 0:00 /sbin/faxgetty ttyIAX
14873 pts/9 S 0:00 /sbin/faxgetty acts1

faxgetty does the communication between hylafax and iaxmodem
Re:I can't receive fax
21 mardi, 10 mars 2009 07:45
faty
Hi:
thank you for reply.
after running : ps axw | grep faxgetty
I saw :
7687 pts/9 S+ 0:00 grep faxgetty
Is it problem?
Re: I can't receive fax
22 mardi, 10 mars 2009 07:47
faty
Hi:
thank you for reply.
after running : ps axw | grep faxgetty
I saw :
7687 pts/9 S+ 0:00 grep faxgetty
Is it problem?
Re: I can't receive fax
23 mardi, 10 mars 2009 17:42
oc9
Yes it is a problem, ps returned you the pid of the grep command you were currently running (pid=7687) ( pid= process ID ) this is the pid of the grep process created by the command you just typed.

But ps show that you DO NOT have faxgetty running hence hylafax can't receive faxes. To see that you have a faxgetty process running, you must have a faxgetty process showing up when you issue the command ps axw | grep faxgetty.

The process name will start with the name faxgetty as the examples show in previous posts. The name of the process will be faxgetty, not grep:

$ ps axw | grep faxgetty
14872 pts/9 S 0:00 /sbin/faxgetty ttyIAX

You may also use pidof faxgetty which will only return pids of faxgetty processes :

/sbin/pidof faxgetty
14872

See how we start faxgetty in our article, we just put the following command in /etc/rc.d/rc.local, you may also test it from the command line and it should just work :

/usr/local/sbin/faxgetty tty125 &

You can also use the following command to list all processes on your computer:

$top -b -n 1

source:
http://blogtech.oc9.com/index.php?option=com_content&view=article&catid=4:asterisk&id=77:20071121ast&Itemid=6

Thursday, August 20, 2009

Build an In-Car PC

peripherals.

On the flip side, here are a few limitations on the technology which you should consider before implementing a mini-ITX solution:

* Not Upgradeable: To reduce the cost of manufacture, CPUs are permanently installed on the mainboard. The ZIF (Zero Insertion Force) socket on most modern motherboards makes up a significant part of the manufacture cost. In VIA's EPIA (Embedded Platform Innovative Architecture) architecture, the company integrated the mainboard and CPU and removed the socket to streamline production and reduce costs.
* Limited Expandability: Typical cases have limited real estate—that's the cost of going "small." Power supplies can be as small as 60 watts, limiting the addition of peripherals. Also, these boards have minimal PCI slots available.
* Higher Cost: The cost for an integrated mini-ITX mainboard is likely to be higher than a comparable ATX motherboard/CPU bundle.

While there are certainly some cons to going with mini-ITX, I believe the technology is sound. That's why I recommend it as the virtual heart of this build.

Car PC Benefits

The public's attitude about what belongs in a car, coupled with technological advances that have made components like displays more compact and robust, have transformed cars and SUVs into rolling infotainment centers. Not long ago, a video display in a car would turn heads; today, it's commonplace. Global positioning systems (GPS) that were once deployed exclusively by the military now listen for bleeps from space from consumer dashboards. DVD players, surround sound, and video displays have all become popular selling features for auto makers. Add to that the high-end options: satellite radio, Bluetooth connectivity, rear-view cameras, vehicle diagnostics and sensor monitoring, Wi-Fi, smart alarm systems, and more. As a result, consumers seek new possibilities for their mobile computing needs.

Car dealers and makers of satellite radio, GPS and media players are targeting a growing consumer market with individual infotainment products. But a well-built car PC can run all of these and more. It can also help consumers with route planning, Web browsing, personal scheduling, gaming, and general computing.

System builders should consider consumers to be just part of whom you should pitch for offering a road PC. There are also hardcore mobile computing applications you could offer, such as digital video recording for police vehicles with broadband connectivity. Also, consider inventory and transportation tracking systems for trucking and delivery companies that provide businesses the advantage of being able to pinpoint where their products and materials anytime anywhere.

Let's take a look at some approaches to getting a PC on the road and choosing the right components. Then I'll show you how to put it all together.

Why Not Go With a Notebook?

In-car PC components are similar to those for notebook and desktop systems—power supplies, CPU, hard disk, etc.—but they need to meet much more rugged specifications. The operating environment in a car is vastly different from an office desktop. Notebooks, while closer in size and ruggedness, are still best for home or office use.

Can you simply mount a notebook or desktop and use it in a car? Sure, and many installers have done just that. But there are serious drawbacks. Desperate installers have mounted flimsy desktop cases in the trunk; used inefficient power inverters to supply power; and even have built elaborate trays for input devices. But size, cable runs and cooling requirements make the desktop approach cumbersome to install and unappealing to operate.

Where standard desktop boxes are awkward for the road, notebooks are a better fit. But their power supplies are not specifically built to handle the special demands of the starts and stops of an average vehicle. As a result, an unmodified notebook cannot be counted on for reliable in-car service.

In addition, both traditional desktops and notebooks are plagued with overheating problems and unexpected reboot issues. Inopportune reboots can occur as power fluctuates in a system designed more to provide power for a car's lights, wiper motors and fans than the smooth, constant voltage required for typical computing.
Car PC's Require Special Components

A reliable in-car PC needs to use small yet rugged components whose size and shape allow proper placement, whether on a crowded dashboard, in or under a dashboard, or under the car's seats. The PC needs to be out of the way of the car's critical instruments.

A car PC must also be designed to be a real workhorse. It will need to handle heat and cold, exposure to sunlight, rapid changes in temperature and humidity, along with shocks and vibrations from the road. The system must also survive as an add-on to a power system that is frequently switched off, often for long periods, and that is prone to deep cycle discharging.

Automotive electrical systems—unlike the clean, steady household current from a wall receptacle—operate off a DC (direct current) storage system that is constantly changing. First, it discharges to deliver power to 'turn-over' a cold car engine. Then it charges the battery back to capacity as the car is driven. Car PCs must operate from power fully conditioned to remove the risk of low voltage during cranking and carefully regulated to prevent damage to PC components during charging.

In summary, an in-car PC must work consistently and meet the challenges of in-vehicle operability. It must be able to take a beating, have short boot times, offer power-saving features, and run its applications easily and safely accessible. The system must be mountable where it is easily visible but doesn't block the driver's line of vision or the path of airbags. The system also must be fastened securely so it won't come lose in a minor accident.

To meet all these challenging requirements, you'll need to choose the right components. In the next section, we'll look at your best choices for parts and how to source them.

Getting the Right Parts for a Car PC

Finding the right parts for your car PC is all about heat, power, vibration/shock, and operability. Let's take these in order:

Heat: Large power requirements and heat dissipation don't mix well with the confined space of a car. As a result, traditional desktops are difficult to keep cool in a car. Notebooks require less cooling, but mini-ITX boxes are even better. They're also easier to tuck into tight spaces. At just 17 cm. x 17 cm., a mini-ITX can fit into or below a dashboard, or even in a glove compartment. Special enclosures, like the VoomPC case, allow for optimal cooling and shock resistance while keeping a compact footprint; I'll discuss this at greater length later in the Recipe.

Power: This is the most challenging obstacle to computing on the road. Specifically, how do you supply clean power as needed? And how do you not drain a car system's battery when the car is unattended for long periods? Inefficient power inverters can covert the 12-volt DC typically used in car electronics into the 120-volt AC (alternating current) source required for a standard PC power supply. But there are a number of drawbacks. Most notably, inverters don't "know" when the car ignition is being turned off, so PCs won't shut down properly and will constantly be restarting on short trips. While notebooks use less power and can operate without an inverter (since they operate from battery power already), they can drain car batteries if left on or in 'hibernation mode' over long periods.

An excellent solution is a new breed of power supply that can make decisions about how to supply power and even signal a PC to 'hibernate' or 'shut-down' when warranted. It's called a DC-to-DC converter, and it can covert a car's 12-volt source into the 3.3-volt, 5-volt, and 1-volt outputs that computers can use. I especially like the M2-ATX. It allows for a user-selectable timer that lets the PC to remain on for a certain amount of time after the car is shut off before issuing a command to the computer to go to 'sleep.' Then, after a prolonged period of sleep, the power supply protects the car's battery by issuing a full shutdown command to the PC.

Vibration and shock: Components in a car PC are subject to all the same jarring, bumping and G-forces as passengers are. If all users drove luxury cars on traffic-free, freshly paved highways, then vibration and shock would be a non-issue. But in the real world, potholes, debris, curbs, and sudden stops and starts can all cause serious trouble for an in-car PC. As a result, hardware mounting, cable stress and wear, and choice of hard disk need to address the situation.

The PC's hard disk is the only constantly moving part, making it the one most sensitive to road shock and vibration. Fortunately, most of today's 2.5-inch notebook drives are designed to take a reasonable amount of abuse from motion, and most are suitable for all but the most rugged applications. I recommend the Seagate Momentus 7200.1, which has been rigorously tested for use in many mobile and notebook applications. For situations where you know your car PC will be heavily stressed, Seagate's EE-25 series drives are hardened specifically for automotive applications; they should hold up better in challenging applications.

Operability: Car PC users need to get to their applications fast and with a minimum of interaction. So keyboards and mice, while handy for occasional work in the car, are of limited use in a car. Instead, car PCs should rely on touch screens and software interfaces with "skins" that let users access their apps quickly and safely.

In car lingo, a touch screen works like a "head unit," providing access to music selection or a GPS. A major goal of a car PC is to replace the vehicle's head unit with a touch screen that will act as GPS, CD player, radio and the like.

Skins used with voice-recognition software can also provide safe and a mostly hands-free method of working with applications. Applications like RoadRunner and SKINbedder work with NaviVoice voice recognition to provide quick access to applications with a minimum of driver involvement. In the screenshot below, you can see how NaviVoice helps to integrate voice activated GPS with media playing and other applications, making GPS functions available quickly and safely with a one-word command:


With applications like Mobile Media Center, users can develop their own "skins" to access media and other car applications by touch. Here's an example:












Ingredients

Here are the components you'll need to create a car PC:

CarPC Parts List


Power Supply:

M2-AXT(160-watt)

- ATX, 6-24V wide input range

- Intelligent shutdown controller

- ON/OFF motherboard control

- Survives vehicle engine cranks

- Battery deep discharge prevention

- High efficiency, 160-watts output

- "Anti-thump" amplifier remote control

- 15A automotive fuse (mini-blade)

- VIA, P4 and AMD (NYSE:AMD) CPU support

$90.
Enclosure: VoomPC

- Rugged enclosure, easy to handle and mount

- 5.5mm aluminum extrusion

- Compatible with any mini-ITX board

- 210mm (W) x 254mm (L) x 56mm (H)

- Up to three fans for moist/heat removal
$80
Mainboard VIA SP130000

- VIA C3 EBGA processor

- 1 DDR266/333/400 DIMM socket

- UniChromePro AGP graphics/MPEG-2 decoder/MPEG-4 Accelerator

- 1 PCI

- 2 X UltraDMA 133/100 connector

- VIA VT6103 10/100 Base-T Ethernet PHY

- VIA VT1617A 6-channel AC' 97 codec

- VIA VT1623 TV encoder

- VIA VT6307S IEEE 1394 Firewire
$200.
Touchscreen Monitor (Two options)
Motorized VMI70 7-inch TFT-LCD monitor with touch panel

7-inch fully motorized in-dash TFT-LCD monitor touch screen VGA and TV

- 16:9 TFT-LCD car PC monitor

- Resolution: 800 x 480

- VGA support: 640 x 480 to 1280 x 768

- Video Input: AV1/AV2

- Audio output: Single audio output

- Standard PAL/NTSC TV signal reception

- Double-channel video input

- Includes remote control

- Chromatic system: PAL/NTSC (auto switch)

- Input: Double-channel AV/TV input, 1 VGA input

- One year warranty
$400
Non-Motorized VM7000 7-inch TFT LCD touchscreen for car PC

- Mount type: Dashboard or Headrest

- PAL/NTSC

- Resolution 720 x 400 to 1280 x 1024

- 16:9 aspect ratio

- Video input: XGA/VGA input (15 pin D-SUB), USB or RS232 interface

- Two RCA video inputs, one audio input

- Built-in speaker

- Display brightness (with touchscreen): 280cd/ m²

- Power consumption: < 9W

- Includes: Remote control, USB cable, VGA cable, AV cable, dashboard mounting bracket, headrest mounting bracket and screws, stylus, CD with touch screen drivers, operation manual

- One-year warranty
$215.
Hard Disk (Two options)
7200 RPM Seagate Momentus 7200 ST910021A

-Reliable 100 GB ATA

-Fast-booting with average seek-time of 10.5 msec.

-Low-power consumption for maximum battery life

-Whisper-quiet load/unload acoustics

-Operating shock of 250Gs (to withstand rugged environments)
$220.
5400 RPM Mobile Seagate EE25 5400RPM

-60GB designed for automotive entertainment and GPS systems

- Hardened for mobile computing and other extreme environments

- Tested for 24x7 operation at elevated temperatures

- In use for mission-critical military field applications
$145.
Memory Kingston KVR400X64C3A/512 (512-MB, 400-MHz DDR DIMM). This is reliable, affordable memory. $54.

The following photo is a shot of the main components: VoomPC case, Seagate hard drive, and M2-ATX power supply board for our Car PC. It also shows a Star monitor I used to check the mainboard before permanent installation of a touch screen:


Vertical mounting of the hard drives, rather than horizontal mounting, can minimize trouble from hard impacts and minimize "head crash" situations. If you know a drive will be getting serious abuse, choose a location for the enclosures that provide sufficient air flow and keep the disks perpendicular to the road.


Assembling the Car PC

Before assembly, and before making final decisions on parts, make sure you have a solid plan and a proper place to work. Finding the right place to work on your car PC will make for a cleaner installation and speed your project along. Look for a protected location with good lighting. You'll also want to use a droplight to help you with interior fitting and for working under the hood. Don't forget Internet access for downloading applications, updates, etc. While garages with a high-speed hook-up might be hard to come by, you'll only need network access for a short period. So be prepared to string a long cable, or use a USB wireless-network adaptor.

No special tools are needed to build and install a Car PC. You can go with the favorite tools of professional installers, such as good wire strippers with spring action and wire-gauge sensing; a heavy-duty crimping tool; a thread-locker compound such as LocTite, which can prevent screws from coming loose from repeated vibration; and a collection of faston and other wire-splicing parts. Wire connectors are available in various assortments or in bubble packs from auto-supply stores, and they are highly recommended for a safe and professional-looking installation.

Here are the 14 steps for the Car PC assembly:


CarPC Assembly Steps


1

Install memory and configure VIA mainboard ___
2 Install the motherboard on the base plate of enclosure using four screws.

See illustration of parts layout above.

___
3 Install the 2.5-inch hard drive using the four silicone rubber shock absorbent pads over the hard drive mounting holes. Fasten the hard drive using four undercut M3 screws attached from the bottom. (See illustration of parts layout, above). Shock pads for mounting the hard drive are included with the VoomPC enclosure ___
4 Attach a 44-40 pin IDE cable to the hard drive and motherboard. ___
5 Attach the M2 ATX power supply over the hard drive, using the remaining standoffs. See illustration of parts layout above. ___
6 Connect the ATX cable harness (provided with power supply) to the motherboard. Use small tie-wraps to manage the ATX cable harness. This is important, not only to prevent rattle and cable wear, but to improve air-flow critical for proper cooling. Note: If you are using a different VIA mainboard, you may be able to eliminate the ATX cable harness entirely, by a custom ATX power extender bus made for use with some EPIA MII mainboards (available from http://www.mini-box.com ) ___
7 Connect the Red / Black / White (terminated in faston quick-splice connectors) to the power supply. Red is un-switched battery, white is switched battery (ignition) and Black is GND. When looking for a power connection in, remember that the switched battery (ignition) is usually present on your cigarette lighter or most of your 12-volt power wires. Un-switched battery (harder to find) is present on your alarm system or other 'always-on' electronics. Use a volt-meter to detect switched versus un-switched wires. If hard to find, connect directly to the battery. ___
8 Connect the LED wire to the LED output if you're the M2-ATX for LED pins. ___
9 Connect the ON/OFF wire harness (provided in the PSU package) to the M2-ATX ON/OFF controller and to the ON/OFF mainboard switch. ___
10 (Optional) Attach your audio amp See details in VoomPC enclosure manual to connect the Amp Enable wire harness to your amp. Please pay special attention to the polarity of the wires. Note: Your amplifier remote control unit actually needs only one wire (RMT), GND is optional. ___
11 Hook up display, keyboard, etc, and perform a quick test of your system by turning ignition ON ___
12 Attach temporary CD-ROM drive to load operating system and application software. ___
13 Secure the enclosure in the vehicle using the four front/back mounting screws. If you don't want to drill holes into your car chassis, large velcro pads work well when attached to the bottom plate of the enclosure. Use the "hook" side of the velcro pad on the PC to attach to your car's carpet. This works very well in most interiors. ___
14 Locate and mount touch screen. For many applications, this can represent a bulk of the work and require patience. Work slowly and carefully knowing that a slip of the Exacto knife or spilling adhesive will mean a trip to scrap yard or a costly trip to the dealer's parts department to fix. ___

Here's a photograph showing how the components are placed for assembly onto the bottom plate of a VoomPC case. Note the overlapping strata of parts to retain our small footprint:


A Word about Car PC and Safety

Using a PC on the road requires a tremendous amount of responsibility. The purpose of having a car PC—in addition to being really cool, of course—is to add to the enjoyment and safety of the driving experience. Unfortunately, having something as wonderful and complex as a computer within sight and reach of a driver can present a serious distraction.

In other words, don't make your in-car PC a driving hazard for yourself or your clients. Instead, follow these important steps as part of your installation:

* Consult your local laws. In the U.S., for example, many states restrict the use of an in-car video monitor that's in the view of the driver.
* Take extra care to provide a safe installation. Design application access to be as easy and hands-free as possible.
* Consider having a serious talk with your clients about the safe use of the car PC. Since everyone will have questions and want to talk about their car PC, suggest an explanation before the trip gets underway. Or suggest offering to pull over to give a complete tour of the hardware and applications curbside, rather than while in motion.

Once the Car PC is built and installed, you'll be ready to load the applications your client desires. But be prepared for questions, lots of them. Car PCs get loads of attention from both potential clients and passers-by. Don't forget to mention to your potential clients that having a Car PC consolidates all their miscellaneous hardware and wires into one box with a large, easy-to-use touch screen. It also lets them run their favorite PC applications in their car. PC gamers will love it for the novelty. Salespeople will love the GPS and the integrated phone and PC applications. And all your on-the-road clients will enjoy the superior media ability of motoring in style with their car PC.

SIDEBAR: Additional Resources for Building Car PCs

Online Vendors: You'll want to source your parts from people who are familiar with the mini-ITX and know the car PC business. I found these three online vendors to be among the best:

* Mini-Box
* MP3Car
* Digital Worldwide

Discussion Forums: Check out the many car-PC sites forums for tips and tricks. Here are three I like:

* Car PC Specialist
* MP3Car.Com
* CarTFT

Books: I recommend two helpful books devoted to car PCs. These two books can be especially helpful if you don't have a lot of experience with 12-volt DC systems, are unfamiliar with "faston" connectors for splicing wire quickly, or are uncomfortable cutting into ignition wiring:

* Geek My Ride by Auri Rahimzadeh (Wiley, 2005)
* Car PC Hacks by Damien Stolarz (O'Reilly, 2005)

Additional ideas: Have a look at some pre-built car PCs. Streetdeck is one that has attracted a lot of attention.

General information on mini-ITX systems: Check out the EPIACenter.

ANDY MCDONOUGH is a professional musician, composer, voice actor, engineer, and educator happily freelancing in New Jersey.

Sunday, August 9, 2009

Vyatta Wireless 3G USB card setup

Wireless 3G USB card setup

The 3G USB wireless modem implementation has been verified against a Sierra Wireless USB Connect 881 modem on the ATT network and a UT Starcom (Pantech) 3G modem on the Verizon network, Tmobile.

config tree:
Code:

interfaces {
wirelessmodem {
backup;
device ;
mtu <1-1500>;
network ;
no-dns;
}
}


Wirelessmodem devices are numbered ppp0-ppp999. The device will not show up in show interfaces until it is configured. The 3g drivers don't create a network interface until pppd is running.

backup: If this node is set, a default route to the upstream provider will be installed in the routing table as a backup default route (metric 10). In this use case, the modem will only be used if the primary route fails.

device: specify the system device for the modem. The default is ttyUSB0. 3g modems for the most part use either ttyUSBx or ttyACMx. Example configs are provided below for reference.

mtu: set the maximum transmission unit for this link

network: this parameter is used to define the chat script for a given network. This chat script is the sequence of AT commands sent to the modem. Chat scripts are provided for att and verizon. Those scripts may work on other networks. The verizon one may work for sprint for example. If a user has a network that doesn't work with one of the pre-existing chat scripts, they can add a custom one by putting the script in a file in /opt/vyatta/share/ppp/network/. The cli will automatically recognize it as a valid configuration option.

no-dns: do not add the provider's DNS hosts to the local name resolution path.

New operational mode commands:
show interfaces wirelessmodem (ppp0): show the layer 3 stats for wirelessmodem interface ppp0
show interfaces wirelessmodem (ppp0) stats: show the ppp stats for wirelessmodem interface ppp0
show interfaces wirelessmodem (ppp0) debug: show the debug startup log wirelessmodem interface ppp0
clear interfaces wirelessmodem (ppp0) session: reset the ppp session

Configuration samples:
ATT Sierra Wireless:

set interfaces wirelessmodem ppp0
commit

Verizon UT Starcom:

set interfaces wirelessmodem ppp0 network verizon
set interfaces wirelessmodem ppp0 device ttyACM0
commit

The usb id for the card I have is 1199:6880, which doesn't work out of the box.

Code:

sat1-wf:~# show system usb
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 003 Device 005: ID 10d5:55a4 Uni Class Technology Co., Ltd
Bus 003 Device 004: ID 413c:3010 Dell Computer Corp. Optical Wheel Mouse
Bus 003 Device 003: ID 413c:2105 Dell Computer Corp. Model L100 Keyboard
Bus 003 Device 002: ID 058f:9254 Alcor Micro Corp. Hub
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 001 Device 003: ID 1199:6880 Sierra Wireless, Inc.
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub


Notice that the Sierra Wireless chip is found, but a quick check of the logs shows this
Code:

May 18 14:53:29 sat1-wf pppd[4145]: In file /etc/ppp/peers/wlm0: unrecognized option '/dev/ttyUSB0'


looking in /dev, sure enough there is no ttyUSB0. The problem is that the usb_serial module doesn't recognize the usb id of this card, but that's an easy fix.

First unload the sierra module, then the usb_serial module. Then load the usb_serial module and tell it to recognize the sierra card. Reload the sierra module and you're done. For those of you who are not clear on exactly how to do that:

Code:

modprobe -r usb_serial
modprobe -r sierra
modprobe usb_serial vendor=0x1199 product=0x6880
modprobe sierra


Now to make it persistent across reboots, edit /etc/modules and add:
usb_serial vendor=0x1199 product=0x6880

Now there is just one more problem. After all of that, a quick check of the /dev directory shows 4 ttyUSBX devices. Vyatta uses ttyUSB0 by default, but the one we want is ttyUSB4. So change your config to something like this:

Code:

wlm0 {
device ttyUSB4
network att
}

or

All you have to do is create the file /etc/modprobe.d/options and put this line in it:

options usbserial vendor=0x1199 product=0x6880

That will make it survive reboots.

create the file /etc/modprobe.d/options and put this line in it:

options usbserial vendor=0x1199 product=0x6880

This will enumerate 7 usb devices ttyUSB0 - 6

use device ttyUSB3

Also for those that use tmobile usa

copy /opt/vyatta/share/ppp/network/att to /opt/vyatta/share/ppp/network/tmobile

edit /opt/vyatta/share/ppp/network/tmobile

modify line 4 from
OK 'AT+CGDCONT=1,"IP","ISP.CINGULAR"'
to
OK 'AT+CGDCONT=1,"IP","WAP.VOICESTREAM.COM"'

If your interface is wlm0 then

set interfaces wirelessmodem wlm0 network tmobile

Monday, July 20, 2009

Rollback yum updates

Anyone who has been around here a while knows yum updates can be a nightmare. It seems other distros are not immune to this either. On the Elastix beta list the following info came through and it may not be a bad idea to add this as a default behaviour in the various distros

--------------------------------------------email from Elastix Beta list ------------------------------------------------
Something to look at if packages break
#

To configure yum to save rollback information, add the line
tsflags=repackage to /etc/yum.conf.

#

To configure command-line rpm to do the same thing, add the line
%_repackage_all_erasures 1 to /etc/rpm/macros.

#

Install, erase, and update packages to your heart's content, using pup,
pirut, yumex, yum, rpm, and the yum automatic update service.

#

If/when you want to rollback to a previous state, perform an rpm update with
the --rollback option followed by a date/time specifier. Some examples: rpm
-Uhv --rollback '9:00 am', rpm -Uhv --rollback '4 hours ago', rpm -Uhv
--rollback 'december 25'.

source:
http://www.trixbox.org/forums/trixbox-forums/open-discussion/rollback-yum-updates

Sunday, July 19, 2009

Building a module in Trixbox

Building a module in Trixbox

cd /var/www/html/maint/modules/support/
cp -R /var/www/html/maint/modules/support /var/www/html/maint/modules/test

-Modify the module.xml file and the page.support.php file ( rename this according to your file option in module.xml).



Today I am going to break down the anatomy of a Trixbox CE module. Note that I am talking about a module in Trixbox CE's dashboard, and not a module in FreePBX, though there are many similarities.

I have created a skeleton module, keeping things as simple as possible. Lets look at the files, starting with module.xml. This file is required by the dashboard menu code as it is scanned every time the dashboard is shown. It tells it where to place the entry in the menus, and what happens when that menu is selected. Lets look at the tags:
module.xml


System

The primary menu to be placed under, or if hidden tab (see below) is 0, the name of the primary menu.


Skeleton Admin

The menu item name


Administer Skeleton

Tooltip text for menu item


Skeleton Admin

Is used in the module's HTML in the footer


skeleton

The folder the module resides in (/maint/modules/skeleton)


2.6.1

Is used in the module's HTML in the footer


1

A 1 makes this module an item in a menu, a 0 makes it a new menu


?skeleton

The actual link url. In this example, its just an argument to the dashboard's index.php, which causes it to load the template below. It could be a full URL to anything, but then you wouldnt get the dashboard headers and menu.




The required smarty template, described below.


config.php

Config variables mostly for smarty.


skeleton
0

A 1 here causes a new window to be opened, a 0 does not.


11

Where to place the menu/item. The number is relative to the numbers in other modules, so this one would be placed after another module at 10 but before one placed at 20.
module.tpl

This is a smarty template file. Here's whats in module.tpl:








This places your module's HTML inside of an iframe. If you like using smarty templates you can just put your html here and not use an iframe. Personally, I despise smarty. But that's what the dashboard is currently using. Because of this, you have the code below. the {literal} tag tells smarty not to mess with anything inside of it. This bit of javascript code is called from within the iframe by the module, so it can tell the iframe how tall it needs to be.

The advantage of doing it this way, is that you can embed whatever you want. You can even wrap an entire separate web application inside a module using the iframes (this is how FreePBX is put into the Trixbox dashboard). Notice the url in the iframe tag.


{literal}

{/literal}
config.php

Finally, you need this config file. This at minimum needs the following:


$smarty->assign("inner","skeleton");
?>

This just tells the smarty engine in the dashboard to insert our template into the dashboard's template.

Now, this is really all you need to know to start making a module. But there's some more interesting stuff there to take advantage of. Most of the newer modules have been written using two frameworks. One is a backend PHP Framework called Kohana (http://kohanaphp.com/), and the other is a frontend Javascript framework called Appcelerator (http://www.appcelerator.com/). You can use either or both or neither of them, your choice. Kohana I highly recomend because it takes care of many security issues for you, makes database access easy, and has lots of nice libraries built into it. Its also very efficient and flexible. Appcelerator is an interesting beast and can be hard to wrap your head around because it uses a message based mechanism and its own kind of syntax to add functionality to HTML tags. It can be very powerful and it has many handy complex GUI widgets included. Unfortunately the newest versions are incompatible with whats being used in Trixbox, so I can't anymore really recommend it. Instead I think I would go with just jQuery and the jQuery UI and maybe some of the controls from the ext framework.

Kohana uses an MVC style design, so you will see a controllers folder, and in there a skeleton.php file. I recommend reading the Kohana documentation, its really quite excellent. Reading this file should give you the general idea of how it works, though.

Source:
http://sporkbox.org/node/3
http://www.trixbox.org/forums/trixbox-forums/trixbox-projects/trixbox-development-where-start