So far, this looks like it is going to be a decent little unit for what I want it to do.
Configuration through the web UI wasn’t a problem. I set up an account on the TG100 and configured my asterisk box to register to it. Once registered – both originating and terminating calls worked properly. I didn’t talk to myself long enough to judge call quality or to see if doing anything in the UI or on the device would load it up enough to impact call quality. Also did not try call waiting, multiple channels, or to see if any voicemail indications were passed through.
SMS didn’t work properly for me with the as-shipped firmware – they showed up in the UI looking corrupted. They have worked properly with the newest firmware (220.127.116.11 released 2014-05-15). It looks like you will either have to use the web interface, or code your own interface to the API to work with SMS messages. I did try sending an SMS while a voice conversation was active. It didn’t send the message until the voice call was over.
Having not used them very much, and it’s not likely the prepaid service I am using supports them anyhow – I didn’t try any MMS messages.
Their API for sending/receiving SMS messages uses the Asterisk Manager interface – with a couple tweaks to the manager permissions there is a lot of potential. With a root shell provided, those tweaks can probably be made.
Network services, OS
Plugged into my LAN switch. The default IP (192.168.5.150) and login/password (admin/password) are printed on the label. Instead of rejiggering my network, I just did:
ifconfig eth0:1 192.168.5.1
And for good measure:
nmap -sSV -p1-65535 192.168.5.150
Starting Nmap 5.00 ( http://nmap.org ) at 2014-05-31 21:14 MDT Interesting ports on 192.168.5.150: Not shown: 65532 closed ports PORT STATE SERVICE VERSION 80/tcp open http Boa HTTPd 0.94.14rc21 514/tcp open shell? 5038/tcp open asterisk Asterisk Call Manager 1.1
Connecting to the web interface, it gives a nice popup “Security Advice: Please change the password on the first login.” That’s good of them to do. Tried turning on SSH, it became unresponsive after saving the setting and telling it to apply the change (maybe it was still reeling from nmap). Power cycle – nothing. Hold down the reset button for a while – rebooted and back online.
Try it again – success!
ssh in, turns out this little guy is actually running asterisk 18.104.22.168! I might be able to replace my current asterisk server with this – except that I have some inkling to try out connecting asterisk to my mobile and there is no bluetooth transceiver and no USB port to plug one in.
root@TG100:/etc/asterisk# rasterisk -x "core show version" Setting max files open to 2048 Asterisk 22.214.171.124 built by root @ lzwyeastar on a i686 running Linux on 2014-02-20 07:46:16 UTCroot@TG100:/etc/asterisk# netstat -pnl Active Internet connections (only servers) Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name tcp 0 0 0.0.0.0:514 0.0.0.0:* LISTEN 1100/inetd tcp 0 0 0.0.0.0:5038 0.0.0.0:* LISTEN 1276/asterisk tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 1271/boa tcp 0 0 0.0.0.0:21 0.0.0.0:* LISTEN 1100/inetd tcp 0 0 0.0.0.0:8022 0.0.0.0:* LISTEN 1100/inetd udp 0 0 192.168.5.150:123 0.0.0.0:* 1383/ntpd udp 0 0 127.0.0.1:123 0.0.0.0:* 1383/ntpd udp 0 0 0.0.0.0:123 0.0.0.0:* 1383/ntpd udp 0 0 0.0.0.0:5060 0.0.0.0:* 1276/asterisk udp 0 0 0.0.0.0:4569 0.0.0.0:* 1276/asterisk Active UNIX domain sockets (only servers) Proto RefCnt Flags Type State I-Node PID/Program name Path unix 2 [ ACC ] STREAM LISTENING 2178 1276/asterisk /var/run/asterisk/asterisk.ctl root@TG100:/persistent# uname -a Linux TG100 3.2.0 #129 Fri Oct 25 14:39:37 CST 2013 armv7l GNU/Linux
Got excited and took it apart
I like the nice heavy case. Not sure what to take away from the components – but here they are.
Cracked out the Kill-A-Watt meter. Plugged in, no SIM card, no ethernet – pulling 2W. With ethernet and GSM registered – 2.2-2.5W. The highest I’ve seen while running has been maybe 2.7W, it’s been up for a little while now – Kill-A-Watt shows 40 hours 15 minutes, 0.08 kWH which works out to roughly 2W average continuous draw.
Corrupted SMS and upgrading firmware
The account validation SMS message from speakout showed up looking corrupted. This unit came with firmware 126.96.36.199, and looking at the release notes for the newest firmware 188.8.131.52 shows a couple maybe relevant bug fixes:
3. Fixed the issue that SMS sent out would have messy codes at the end of the original message if the SMS has more than 70 characters, containing Chinese characters and numbers or Chinese characters and English characters. 5. Fixed the issue that the spam messages from China Mobile would be shown as gibberish on NeoGate TG "Inbox" page.
Upgrading the firmware went smoothly. I already had a TFTP server running (which primarily serves configuration to my Polycom IP550), so I used that option to upload the firmware.
“cause the failure performance!” – awesome.
Re-try the validation SMS: Success! No more corrupted messages.
Hello, sorry for ask here but i can´t fid one contact for email.
I read your post about neogate TG100 and want know if you can tell me, how received sms can be used with neogate API.
For instance, if i receive one SMS i can able to save in message in one Database ? Is´t possible acess sms inbox from external via API ?
For now i use one software NOWSMS and when i receive one sms, software send sms content to another adress for exemple: myweb.com/get_sms.php and in this script i can manage data. It´s possible with Neogate API.
obs: sorry for my english.
Their API uses Asterisk’s Manager interface. I’ve never written a script to work with this, but it should be fairly easy since it is only using stdin/stdout.
To try yourself – SSH into the box.
root@TG100:~# cat /etc/asterisk/manager.conf
enabled = yes
webenabled = no
port = 5038
bindaddr = 0.0.0.0
secret = password
read = system,call,log,verbose,command,agent,user,config,originate,cdr
write = system,call,log,verbose,command,agent,user,config,originate
deny = 0.0.0.0/0.0.0.0
permit = 127.0.0.1/255.255.255.255
secret = apipass
read = smscommand
write = smscommand
deny = 0.0.0.0/0.0.0.0
permit = 127.0.0.1/255.255.255.255
permit = 192.168.10.0/255.255.255.0
root@TG100:~# telnet 127.0.0.1 5038
Asterisk Call Manager/1.1
Message: Authentication accepted
Now you wait. It will fire an event when an SMS is received.
Notice that I actually modified the manager.conf file to allow the apiuser to work from my local network (bolded). This means you can run your script/code on a different machine.
Recvtime: 2014-09-17 10:24:56
--END SMS EVENT--
So – have your script parse the text fields, and then do whatever you like with it – including storing in a database.
Here is their documentation: How_to_Use_NeoGate_TG_API.pdf
And the Asterisk Manager: http://www.voip-info.org/wiki/view/Asterisk+manager+API
I haven’t looked since maybe the second edition, but the book Asterisk: The Future of Telephony was very helpful in working with Asterisk.
The default software running on the unit is already storing the messages somehow, you might be able to use that.
root@TG100:/persistent/var/lib/asterisk/db/MyPBX.sqlitethat has saved copies of the received SMS.
Assuming from the filename – it’s sqlite… And it’s probably a safe bet that there is good documentation about MyPBX.
Maybe noteworthy – I haven’t touched the unit in a while, and it froze up after I connected to SSH again to look around for this. It was responding before that.
I’m also using NeoGate TG100, but i’m having difficulties to integrate my asterisk voip server. I haven’t find any documentation that give detail description on how to connect TG100 with asterisk server. Most of the tutorial are using asterisk with GUI such as elastix, 3CX, while i build my asterisk server using command line (non-GUI).
Could you kindly share some example of sip.conf & extensions.conf to integrate TG100 with asterisk server.
No problem. I prefer the command-line approach myself.
I am using my asterisk as a client, registering to the TG100.
On the TG100 – I’ve set up an account as a “Voip Trunk”, the important part is the account (by memory – numeric only) and a password.
Incoming calls are handled in the [from-gsmgateway] context in extensions.conf.
Outgoing calls are handled in the specific context for that user – in this case [outgoing-calls].
I don’t have anything figured out for handling SMS.
thanks, this helps a lot
Here I added some more details for these devices http://txlab.wordpress.com/2014/12/22/connecting-yeastar-tg200-gsm-gateway-with-freeswitch/