Friday, July 29, 2011

Add Google +1 button to PhpBB

The Google +1 button is analogous to the Facebook Like.  With a few steps, we could add this feature to our PhpBB-based forum.
In the first place, edit two files : overall_header.html and viewtopic_body.html in the template folder as below.
1.    find </head>
2.    in front of it, insert <script type="text/javascript" src=""></script>
1.    find <div class="postbody">
2.    inline add to the appropriate position to show the +1 button
<g:plusone size="medium"></g:plusone>
It is advisable to refresh to template if the +1 button does not appear.
1.    Open PhpBB Administration Control Panel
2.    Click the 'STYLES' tab
3.    Click 'Templates' and 'Refresh'

Thursday, July 21, 2011

Asterisk dialer with Outlook 2010

It would be convenient if we just merely point and click a contact in our Outlook address book and our Asterisk PBX would make the call.  This article outlines the steps taken to enable an Asterisk dialer in Outlook 2010.
These steps are tested under below environment.
Microsoft Outlook 2010
Windows 7 (32-bit)
Elastix 2.0.0-36
The office extensions are managed by Elastix/Asterisk.  They are configured as sip peers and physically vary from IP Phones, analogue phones via ATA and Xlite softphones. 
In essence, we need a windows TAPI driver that can talk with Asterisk via Asterisk Manager Interface(AMI).  When we click to dial an Outlook contact, the TAPI driver sends an Originate command to our Asterisk PBX which performs the dialing.  It dials to our phone extension first and then to the contact, bridging both parties in a conversation.

TAPI Driver

An open source TAPI drvier is selected.  It is available from  The version we tested is v.1.6.4



1.    In the first place, we need to enable AMI and define an AMI account in the Asterisk box.

AMI is configured in /etc/asterisk/manager.conf.

;The general section below enables Asterisk to listen for AMI connection in port 5038.






;It defines an AMI account – astdialer – to be used by the TAPI driver

;It is advisable to only permit connections from internal ip, as accomplished by the 'deny and permit'



read = system,call,log,verbose,command,agent,user,originate

write = system,call,log,verbose,command,agent,user,originate

deny =

permit =


To make the changes effective, we can reload manager module by:

asterisk –rx 'manager reload'


2.    Next, we install the TAPI driver in our PC.

The installation process will present a screen to capture a) our phone extension and b) AMI connection parameters.

Line DN    :    It refers to our phone extension;  it becomes the 1st leg SIP/<Line DN> in the Originate command

Line Prefix    :    What input here would be stripped when sending to Asterisk as the dial string.

Context    :    It refers to the dialplan context in Asterisk for incoming and outgoing calls

Host IP    :    It refers to the ip/dns of our Asterisk PBX

Port    :    refer to the AMI above

User    :    refer to the AMI above; in our example, we should input 'astdialer'

Password    :refer to the AMI above


3.    We also need to add a key in Windows 7 registry for TAPI support (ref to )


The registry subkey required is:

KEY_LOCAL_MACHINE\Software\Microsoft\Office\Outlook\Call Integration

with a DWORD value:



With the above done, we should see a 'call' icon on right clicking an Outlook contact.



Asterisk will firstly ring our extension and, upon connected, dial the other number.  The callee would have seen incoming call from us (or what configured as the proper caller id to present) as if we manually dialed the number.




Wednesday, July 13, 2011

Why we receive spam not attending to us?

Recently, a client asks why she receive emails not attending to her. 
The internet email system is responsible for delivery.  It functions like our post office.  As long as we write a correct postal address, our post office can deliver a letter to the address.  The letter contents (who wrote the letter and who should receive the letter) is not under strict control.
Similarly, the internet email delivery mechanism (which is a number of computers running smtp services) only deals with routing and delivery of email messages.  The 'from: to:', etc. are part of the contents and therefore not under control by the smtp delivery.  Spammers can alter or fake these fields so as to broadcast purposely and hide their real identity. It explains why we receive so many spams, some with forged sender and some are not even attending to us.
It is our system administrator (who is in charge of our company email server) to take care of spam filtering.  Common measures are checking the sending ip against DNSBL (eg spamcot, spamhaus) and deploying some kind of anti-spam appliance.  The administrator also needs to ensure his email server is NOT acting as open relay which could otherwise make the server itself a spam source.  It is also advisable to disable smtp connection from internal LAN PC to outside because the smtp connection is usually initiated by the company email server only.  If there is some other PC making the connection, then it is likely from an infected one.

Thursday, July 07, 2011

Make VOIP call from Android phones

The following applies to Android 2.2 on Motorola Milestone 2.
We can dial out and receive VOIP calls from our smartphone (eg Nokia, Android, etc.).  The primary benefit is saving IDD and roaming charges when we travel abroad. 

The prerequisite is that we have subscribed an VOIP account from a Internet Telephony Service Provider (ITSP) and ideally have public internet access for free (eg, wifi in coffee shops).  To make an IDD call (eg to our home town) at low cost, we dial over the internet to the ITSP that eventually routes our call to the destination, bypassing part of the telephone network and thus saving call charges.
The ITSP is usually a telecom sevice provider that operates a VOIP gateway to serve calls from the internet side and routes to the telephone switch network.  They usually charge account maintenance fee monthly and termination fee per call basis.  Local termination is usually free while overseas termination are almost charged the same as if calls were originated locally.
The term VOIP (voice over IP) describes the mechanism and protocol we send voice over the internet.  It centers around SIP (session initiation protocol) which is now the industry protocol standard of transmitting voice over packet switched network.  Our smartphone has to become a sip compliant device in order to make VOIP calls.  It is surprisingly easy as installing an SIP client apps would suffice.
There are a number of SIP client apps on Android.  I installed Sipdroid ( ) on my MS2 because it is free and simple to use.  I take a VOIP account from ZONETEL ( (one of the HK based ITSP) as illustration.
In the first place, I configure the VOIP account in Sipdroid.  The VOIP account just consists of three information: 1) the ITSP server address, 2) account username, 3) account password
To make a call, we type the destination number and enter to proceed.
This VOIP account is bundled with a HK local telephone number for receiving call.  It means we can be reached via this number even when we are abroad and the Sipdroid apps is running.  In other words, it helps to save roaming charge.

Fight spam with MailScanner

One of our clients is using MailScanner ( ) as anti-spam filter on a fedora system.  The ms provides many options to fine tune how to handle spam emails.
In the first place, we have to enable the spam check feature in /etc/mail/MailScanner.conf and tells ms which spam filter to use.
# Spam Detection and Spam Lists (DNS blocklists)
# ----------------------------------------------
Spam Checks = yes
Spam List = spamhaus-ZEN
The information we provided to the directive 'Spam List' is a reference to the spam filter definitions in spam.lists.conf.
The default installation of spam.lists.conf already includes some common spam filter definitions and we can add further as necessary.
Next, we need to define how to handle spam emails in /etc/MailScanner/MailScanner.conf:
Spam Actions = store forward
The above instructs ms to store a copy of the incoming spam in quarantine and also forward to  Alternatively, we can simple discard them as below:
Spam Actions = delete
To make the changes effective, we have to restart ms.  Mailscanner will also restart itself regularly (see the 'Restart Every =' in mailscanner.conf).

Wednesday, July 06, 2011

Difference between 800 and 400 toll-free numbers in China

800 toll-free numbers

800 toll-free numbers are commonly called "800 免费电话", the official name is "被叫集中付费业务" (called party collect paid service), which means the cost of the call is borne not by the caller but by the party receiving the call.
800 toll-free numbers in China are ten-digit numbers beginning with "800". Three is no prefix before "800". (In US, "1" must be used before "800" when dialing from a landline).
800 toll-free numbers are not accessible to some mobile network subscribers.

400 toll-free numbers
400 service is called "主被叫分摊付费业务" (calling party and called party split-paid service), which means the calling party pays for the local access fee and the called party pays the toll (long distance) fee.
400 toll-free numbers in China are ten-digit numbers beginning with "400".
400 toll-free numbers can be accessed by all fixed-line and mobile phones.
Callers have to bear local access charges from their service providers.