Why?


Search This Blog

Sunday, March 29, 2015

Setting up NTP in Centos 6.6

Setting up NTP in Centos 6.6

 First we need to make sure we have the correct date, time, and timezone. You can verify with:

# cat /etc/localtime

Set your time zone with (for Phoenix AZ USA)

#cp /usr/share/zoneinfo/America/Phoenix /etc/localtime


Now check date

# date
Sun Mar 29 01:10:44 MST 2015

You can verify this at the hardware level with:

# hwclock -r
Sun 29 Mar 2015 01:13:51 AM MST  -0.156631 seconds


If  these are incorrect then we can set the OS first and then update the hardware with the date command. The syntax is: date "day month year hh:mm:ss" So if we wanted to change this to March 2 2015 at 1:00pm we would use:

# date -s "2 MAR 2015 13:00:00"

When we have the date correct in the OS we can update the hardware with:

# hwclock -w

Now that we have the correct date and time lets install and setup ntp. First lets install ntp if not already installed.

# yum -y install ntp

Next edit the the ntp.conf file so we are using the correct time servers.

# vi /etc/ntp.conf

I usually use the public servers from the pool.ntp.org project of:
server 0.centos.pool.ntp.org iburst
server 1.centos.pool.ntp.org iburst
server 2.centos.pool.ntp.org iburst
server 3.centos.pool.ntp.org iburst


After you have those in lets start the service and make sure it is on in startup.

# service ntpd start
Starting ntpd:                                             [  OK  ]
# chkconfig ntpd on

Now lets verify the setup by looking at our peers.

# ntpq -p
     remote           refid      st t when poll reach   delay   offset  jitter
==============================================================================
*deekayen.net    209.51.161.238   2 u   43   64    3   75.257  -22.456   3.017
 origin.towfowi. 204.9.54.119     2 u   43   64    3   31.405  -14.629   2.683
 NTP2.playallian 129.6.15.30      2 u   43   64    3   50.576  -14.090   3.465
 sola-dal-09.ser 10.0.77.54       4 u   42   64    3   59.879   -1.507   2.629

 

Saturday, March 28, 2015

Yum htop install from EPEL Extra Packages for Enterprise Linux

Yum htop install from EPEL 

(Extra Packages for Enterprise Linux)


Add the the repository that is for your OS. Do this in your home directory. if root then it should be /root

## RHEL/CentOS 6 32-Bit ## 
# wget http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm 
# rpm -ivh epel-release-6-8.noarch.rpm 

## RHEL/CentOS 6 64-Bit ## 
# wget http://download.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm 
# rpm -ivh epel-release-6-8.noarch.rpm


Now install htop

# yum -y install htop

Setting up Voice Mail in Asterisk 11.15.0



Setting up Voice Mail in Asterisk 11.15.0

If your going to use email notifications then make sure sendmail is installed

# yum -y install sendmail

Edit your /etc/asterisk/voicemail.conf file. After the [general] and [zonemessages] sections, any other bracketed section is a voice mail context. Within each context, you can define one or more mailbox. To define a mailbox, we set a mailbox number, a PIN, the mailbox owner's name, the primary email address, a secondary email address, and a list of mailbox options (separated by the pipe character), as shown below:

[context]
mailbox=>pin,full name,email address,short email address,mailbox options

By way of explanation, the short email address is an email address that will receive shorter email notifications suitable for mobile devices such as cell phones and pagers. It will never receive attachments, even if attach=yes. If you don’t want to use the email, or short, email address just put nothing in it. Be sure to use the comma though for a place holder.
An example of this I use in my lab is:

[internal]
6026356915 => 9999, Glen whittenberg,glen.whittenberg@cableone.biz,,attach=yes|maxmsg=100

My context is internal and extension is 6026356915 as defined in my sip.conf and extensions.conf files. 9999 will be my password. Glen Whittenberg is my full name. glen.whittenberg@cableone.biz is my email address. I am not using a short email addr so I just put in the comma. My options, separated by pipe symbol, are voicemail attachments will be sent to email, attach=yes, and maximum messages will be 100, maxmsg=100.

Now let’s edit the /etc/asterisk/extensions.conf file. We will add 9999 to get to voicemal system and also add to our extensions, and DID’s, to enable voicemail for them.

To make 9999 your access number to the voicemail system add the flowing under the [internal] context:

;used 9999 to access voicemail
exten => 9999,1,Answer(500)
exten => 9999,n,VoiceMailMain(@internal)

Now for my extension of 6026356915 I added the following, still in my [internal] context:

exten => 100,n,VoiceMail(6026356915@internal,u)

My entire entry so far for this extensions is:

;used to pass extension dialed, 100, to registered phone of 6026356915
exten => 100,1,Dial(SIP/6026356915,20)
exten => 100,n,VoiceMail(6026356915@internal,u)
exten => 100,n,Playback(vm-goodbye)
exten => 100,n,Hangup

You can see I am using 100 to associate to 6026356915. This allows me to dial 100 from inside the system instead the entire 6026356915 number to call this phone/extension.

Now we need to edit our context concerning outside calls into the system. So when an outside caller calls my DID of 6026356915 they can also leave a voice message.

Again edit the /etc/asterisk/extensions.conf file under the correct context for inbound calls. In my case this context is called [from-test]. This was defined in my /etc/asterisk/dahdi-channels.conf file. Add the following for the DID 6026356915.

exten => 6026356915,n,VoiceMail(6026356915@internal,u)

My entire entry under the [from-test] context for DID 6026356915 is:

exten => 6026356915,1,Dial(SIP/6026356915,20)
exten => 6026356915,n,VoiceMail(6026356915@internal,u)
exten => 6026356915,n,Playback(vm-goodbye)
exten => 6026356915,n,Hangup

Now reload voicemail and extensions in asterisk with:
# asterisk –x ‘core reload’

Enjoy!







Friday, March 27, 2015

Asterisk SIP Trunk to Vitelity

Asterisk SIP Trunk to Vitelity


To get your Asterisk server up with Centos 6.6 see my post at:

CENTOS 6.6 and Asterisk 11.15.0 Install

After you have your server up you will need to get an account at Vitelity:

Vitelity 

Its is a pretty simple process from there. Login into Vitelity site, under support, click Asterisk Support. They will give you two links personalized for your account.

Asterisk via Registration: sip.conf - extensions.conf 
 
All you do is enter the information in the sip.conf and extensions.conf as they state. Simple copy/paste action.

They give you the bare bones to register the inbound and outbound peers. They also give you an exten=> for your phone numbers. I was using three digit extensions and simply changed there defaults. The default they gave me was:

[inbound]
exten => 4803861111,1,Answer

I changed this to:

exten => 4803861111,1,Dial(SIP/100)
exten => 4803861111,n,Hangup

This allows me to register my phone as extension 100 and receive inbound calls from 4803861111 on extension 100.





Tuesday, March 3, 2015

Edgewater Edgemarc Edgemarc 4550 General Setup


cli default login / password = root / @#$%^&*!()
I used the craft cable and issued passwd command for this change

NOTE: 192.168.1.1 is default LAN address

webui default login / password = root / default

set up DHCP server for options and address pool

WAN interface is: your_ip_address/255.255.255.0
LAN interface is: 192.168.1.1/255.255.255.0

Security/firewall allow SSH, HTTP, HTTPS on WAN interface

Set up users/MOTD if wanted

I enabled firewall logging

Setup phone on LAN side of edgemarc. Point to your BRS system.
you should be able to make calls now..

Use port forwarding on your Edgemarc to get to management of phones if wanted. Like: set WAN port 8081 to forward to phone1 IP port 80. Use 8082 for phone2, etc. I am also testing a IP PBX behind this Edgemarc and use a port forward of 2222 on the WAN and forward to port 22 of IP of PBX so i can get SSH access to it. I am already using ports 80 and 22 for Edgemark access, hence why the use of additional ports and the forwarding. I will make another post on the asterisk SIP trunking to brs while asterisk is behind the Edgemark when i am finished testing.

Capture an EdgeMarc protocol trace
1. SSH into the EdgeMarc CLI
2. Type: tcpdump -ni iface -s 0 [port port_number]
    - Ex: tcpdump -ni eth0 -s 0 port 5060
    Decode SIP traffic from the LAN interface (VLANs not in use)
    - Ex: tcpdump -ni eth0.500
    Decode all traffic from VLAN ID 500
    - Ex: tcpdump -ni hdlc0 -s 0 port 5060
    Decode SIP traffic from an HDLC WAN interface



Xlite to BRS

In xlite go to sip acct settings
Display name = Your TN for the user
Username = Your TN for the user
Password = Password you set-up for auth settings in brs AS for this user
Auth user name = Name you set-up for auth settings in brs AS for this user
domain = your_domain.net
Check Register with Domain to send/receive calls
check proxy and use xxx.xxx.xxx.xxx. This will use the SBC/proxy if you have one and need to use it.