Hackers

Having an own VoIP solution with FreePBX wasn't that much exciting for me, rather connecting it to a cellular network is much more interesting! Looking over and over the web you mostly find expensive solutions or solutions where much knowhow is needed to configure it properly. Also there are some cheaper (~100eur) products where there is too less description to be sure of it, sure its cheap in comparison but would you go ahead and buy another one if that one doesn't fit your needs? And then its a question about who you could talk to, to share experience and solve problems if there is no large number of users. In the end i gave up that idea and put it back in the dusty shelf of collected ideas. But that didn't last long this way...

While looking for a cause of some asterisk error, i found people writing about using 3G USB dongles (modems for mobile internet access) to connect their asterisk with their local cellular providers. Intersting story, there are gsm modules for asterisk and freeswitch available. Only thing is, actualy only huawei dongles are supported but there are cheap models widely available.

From what i have read here and here, model E1550 is widely used and supported, it works fine as also model E180.

 

You might want to update the firmware.

 

usb-modeswitch is needed! -> aptitude install usb-modeswitch

http://www.draisberghof.de/usb_modeswitch/

 

After plugging it in again, it should show up in lsusb like this:

Bus 001 Device 012: ID 12d1:1001 Huawei Technologies Co., Ltd. E169/E620/E800 HSDPA Modem

or like this:

Bus 002 Device 023: ID 12d1:140c Huawei Technologies Co., Ltd. 

 

Then you should see three ttyUSB devices:

root@voip:~# ls -al /dev/ttyUSB*
crw-rw---T 1 root dialout 188, 0 Sep 24 23:52 /dev/ttyUSB0
crw-rw---T 1 root dialout 188, 1 Sep 24 22:51 /dev/ttyUSB1
crw-rw---T 1 root dialout 188, 2 Sep 24 23:56 /dev/ttyUSB2

Where the last one '/dev/ttyUSB2' is the serial device to talk to the modem via screen or minicom or putty or hyperterminal or ..

 

AT-Commands:

ATI                         - get relevant information from modem
ATZ - reset modem configuration
AT^CARDLOCK=”<code>” - send unlock code
AT^CVOICE=? - Check status
AT^CVOICE=0 - Enable Voice
AT^CVOICE=1 - Disable Voice


AT^SYSCFG=mode, order, band, roaming, domain - System Config
Mode:
2 Automatic search
13 2G ONLY
14 3G ONLY
16 No change
Order:
0 Automatic search
1 2G first, then 3G
2 3G first, then 2G
3 No change
Band:
80 GSM DCS systems
100 Extended GSM 900
200 Primary GSM 900
200000 GSM PCS
400000 WCDMA IMT 2000
3FFFFFFF Any band
40000000 No change of band
Roaming:
0 Not supported
1 Roaming is supported
2 No change
Domain:
0 CS_ONLY
1 PS_ONLY
2 CS_PS
3 ANY
4 No change
Examples:
AT^SYSCFG=13,0,3FFFFFFF,0,3 - modem 2G only, automatic search any band, no roaming
AT^SYSCFG=2,0,3FFFFFFF,2,4 - Any
AT^SYSCFG=13,1,3FFFFFFF,2,4 - 2G only
AT^SYSCFG=14,2,3FFFFFFF,2,4 - 3G only
AT^SYSCFG=2,1,3FFFFFFF,2,4 - 2G preferred
AT^SYSCFG=2,2,3FFFFFFF,2,4 - 3G preferred

AT^U2DIAG=0 - modem mode only
AT^U2DIAG=1 - modem mode + CD-ROM
AT^U2DIAG=255 - modem mode + CD-ROM + Card Reader
AT^U2DIAG=256 - modem mode + Card Reader
AT+CCWA=0,0,1 - disable call-waiting
AT+CFUN=1,1 - reboot modem
AT+CGSN - get IMEI
AT+CIMI - get IMSI
AT+CLAC - feature list (check if ^CVOICE is listed)
AT+CLCK=“SC”,0,”<pin>” - disable PIN verification
save own number to sim:
AT+CPBS="ON"
AT+CPBW=1,\"+4369911786693\",145

 

Asterisk users need chan_dongle which is available on google code.

Freeswitch users need mod_gsmopen.

 

Asterisk 1.8.13.1~dfsg-3 with chan_dongle 1.1.r14

$ wget https://asterisk-chan-dongle.googlecode.com/files/chan_dongle-1.1.r14.tgz
$ tar xfz chan_dongle-1.1.r14.tgz
$ cd chan_dongle-1.1.r14
$ ./configure; make
$ sudo make install
$ sudo asterisk -r
asterisk*CLI> module load chan_dongle
asterisk*CLI> dongle show devices
ID         Group State RSSI Mode Submode Provider Name  Model      Firmware          IMEI             IMSI             Number
CHiLpublic 0     Free  12   0    0       one            E1550      11.608.13.00.47   35*************  23205**********  +4369911786693
asterisk*CLI> quit

 [article work in progress]

Asterisk SVN-branch-11-r396377 with asterisk-chan-dongle

$ sudo aptitude install git automake
$ git clone https://github.com/jstasiak/asterisk-chan-dongle.git
$ cd asterisk-chan-dongle/
$ aclocal # (ignore warnings)
$ autoconf # (ignore warnings)
$ automake -a
$ ./configure
$ make

 

Some time ago i switched from orange to hutchison but kept the old orange sim as prepaid card so people could reach me without the need of telling them my new number. Now most of you will think thats good but carrying two mobiles (both sim cards) with you isn't practical either. Some people instantly think about dual-sim adapters to use both cards in one mobile (parallel simultaneous function is not possible) or about "real dual-sim capable" mobiles which face the same problem as the cheaper gsm-voip gateways, described above. And i love my HTC DesireZ so acually i don't want to get a new mobile. So i needed a solution independent of the used mobile i thought and came up with the idea, there are cellular providers in some countries (like Hutchison3G in Austria actually) who offer limited toll-free telephony in their own network. Why not combine that with our new gsm2voip gateway to get our calls forwarded, for free?

[edit how to]

If you use a SIP client on your mobile, you could even forward it there before forwarding it via cellular. Additionaly i wrote a quick bash script to get the caller name from your google contacts.

 

problems:

https://www.vr.org/kb/5132/Force-exim-to-send-email-from-a-particular-IP.html

http://forums.asterisk.org/viewtopic.php?f=1&t=80482

http://www.modemunlock.com/huawei-e1550-unlock-3g-usb-modem.html

http://wiki.e1550.mobi/

http://code.google.com/p/asterisk-chan-dongle/

https://github.com/jstasiak/asterisk-chan-dongle

http://codestudioblog.wordpress.com/tag/e1750/