Search

Wednesday, October 29, 2014

User nc to send smtp message in centos

nc is a handy tool in unix to test network connection and we can use it
to write script to send smtp message as well. It is useful when we
implement some kind of server monitoring scripts and want to send out
alarm messages.

In the example below, we use 'nc' to connect smtp-server at port 25 to
send out contents in email-msg.txt

#nc smtp-server 25 < email-msg.txt

The email-msg.txt contains the below commands to form the smtp dialogue.

#cat email-msg.txt
HELO my-server
MAIL FROM:<sender@domain1.com>
RCPT TO:<receiver@domain2.com>
DATA
Subject:This is a sample subject
This is a sample mnessage body
.
QUIT

Note the last line of the message body is a line starting with '.'.

Another point to note is that if we create the email-msg.txt in unix
environment, we probably need to ensure each line ends by CRLF rather
than just a line feed.

To do so, we can simply use the unix2dos command:

#unix2dos email-msg.txt

Saturday, October 11, 2014

How to create a disk image of Elastix Mini UCS

To create DD Image file from  SD Card of MiniUCS:

Requirements
1.pc running linux
2.cf card reader

Steps to create dd image
1.connect the cf card reader to the linux pc
2.take out the CF card from elastix mini
3.insert the CF card inside the reader
4.in the linux pc, determine the device assigned to the cf reader using 'df -h'  (the device name is machine-dependent, eg /dev/sdc ,etc.)
5.create a disk image using dd command as below:
dd if=/dev/sdc  of= bs=32M

** pls check whether the sdcard is /dev/sdc


Restore DD Image from SD Card

1. dd if= of=/dev/sdc
2. Insert the new SD card into MiniUCS and boot it
3. Use computer to connect COM port of MiniUCS ( 115200 8N1, flow control=none )
4. login root/palosanto
5. Modity the file  /etc/sysconfig/network-scripts/ifcfg-eth0 to use dhcp
DEVICE=eth0
BOOTPROTO=dhcp
BROADCAST=
DHCPCLASS=
HWADDR=a0:98:05:01:be:9b
IPADDR=
NETMASK=
NETWORK=
ONBOOT=yes
TYPE=Ethernet
NOZEROCONF=yes


3. Finally, you need to restart the networking service, enter:
service network restart

4.  Determine the ip address by 'ifconfig'

5.  Login elastix by https:// with username/password = admin/palosanto.  Go to network and configure via the GUI. 

Sunday, July 13, 2014

How to set callerid in Elastix Call Forward

Elastix allows an extension to setup call forward via feature code such as *72.  These codes are defined in PBX|Features.    When we dial from PSTN to an extension which has CF setup to external party, the call is forwarded using the foreign caller as CID.  As this call is not originated from an extension, it will be handled by a catch-all route which usually presents the company's primary number to the forward destination.  In most cases, we consider it intuitive.
In some cases, however, we prefer to handle the forwarded call differently such that it presents another CID.  It is useful if our Elastix PBX is sharing by different business entities (eg in a business center) because there is no such a common primary number.  The forwarded call should be handled by an extension-based outbound route.


The default Elastix behaviour must be modified not to use the foreign caller as CID when forwarding call.  Rather, the CID should be the extension being forwarded to select the appropriate outbound route.

The Elastix UI does not provide this option.  By changing the dialplan code in extensions_override_elastix.conf, we could manipulate the CID used in CF.

Sunday, April 06, 2014

Redundancy Asterisk Configuration

Here describes a working solution to implement a redundant asterisk PBX system.

When we design a redundant PBX solution, it is intuitive to think of building two Asterisk nodes with some kind of synchronization mechanisms ranging from simple scripts to more complicated HA cluster.

The more challenging task is to failover the PSTN connection when the primary node is down.

The TwinStar solution from Xorcom is directly addressing this problem.

This solution is comprised of two Asterisk servers with identical configuration in active-standby mode and one Astribank channel banks for PSTN connection .

The Astribank provides FXO or T1 connection with telco provider. It communicates via USB with the two Asterisk servers and continuously monitors the function of the primary node. Upon detecting node failure, it instantly passes control to the backup server. This architecture ensures communication in the organization is re-established in short time.

Further information can be found in here