Setup an IPv6 enabled Asterisk server

November 26th, 2010 No comments

According to tunnelbroker.net, at the time of this writing, we’ve got 95 days left until we’re out of IPv4 addresses. Fortunately for us, Asterisk 1.8 has native support for SIP over IPv6. Even if your ISP isn’t handing out IPv6 addresses, doesn’t mean you can’t take advantage of Asterisk’s native IPv6 support. By utilizing a free tunnel broker, you can run an IPv6 enabled Asterisk server on your existing IPv4 Internet connection and provide IPv6 connectivity to the rest of your network.

Since your Internet connection only supports v4 addresses, you’ll need to setup a tunnel on your server to an IPv6 “tunnel broker”.  This tunnel allows you to assign your Asterisk server, and all the machines on your network with public IPv6 addressees. All of your IPv6 traffic flows through this tunnel over you existing v4 Internet connection. You can sign up for a free tunnel at  http://tunnelbroker.net.


Configure your Asterisk Server for IPv6

1. Enable IPv6 – Make sure these lines are in /etc/sysconfig/network

nano /etc/sysconfig/network

NETWORKING_IPV6=yes
IPV6FORWARDING=yes
IPV6_DEFAULTDEV=sit1

2. Assign eth0 an IPv6 address – This file contains your IPv4 address information as well. Copy the below lines in addition to what’s already in there. Take the “Routed /64″ from your tunnellbroker.net account page and add a 1 to the end. Example, if my routed /64 was 2001:xxx:x:xxx::/64, I would assign 2001:xxx:x:xxx::1/64 for IPV6ADDR=

nano /etc/sysconfig/network-scripts/ifcfg-eth0

IPV6INIT=yes
IPV6ADDR=2001:xxx:x:xxx::1/64

3. Setup the IPv6 tunnel interface - This should be new file so there shouldn’t be anything in there.

nano /etc/sysconfig/network-scripts/ifcfg-sit1

DEVICE=sit1
BOOTPROTO=none
ONBOOT=yes
IPV6INIT=yes
IPV6TUNNELIPV4=Server IPv4 address as specified on your tunnelbroker.net account page
IPV6ADDR=Client IPv6 address as specified on your tunnelbroker.net account page

/etc/init.d/network restart

4. Enable IPv6 forwarding - add or change the following line in /etc/sysctl.conf

nano /etc/sysctl.conf

net.ipv6.conf.all.forwarding=1

sysctl -p

5. Enable IPv6 auto-configuration on your LAN with radvd – Substitute the “prefix” with the “Routed /64″ from your tunnelbroker.net account page. Since we are specifying a subnet here, do not add the 1 like we did for the ip address.

yum install radvd
nano /etc/radvd.conf

interface eth0
{
AdvSendAdvert on;
MinRtrAdvInterval 30;
MaxRtrAdvInterval 100;
prefix 2001:xxx:x:xxx::/64
{
AdvOnLink on;
AdvAutonomous on;
AdvRouterAddr off;
};

};

/etc/init.d/radvd start

7. optionally add an IPv6 DNS server

nano /etc/resolv.conf

nameserver 2001:470:20::2

Configuring IPv6 support in Asterisk:

Enabling IPv6 support in Asterisk is incredibly simple. In your sip.conf enable SIP on all addresses by placing bindaddr=:: in the [general] section

sip.conf

[general]
bindaddr=::

Asterisk will now route SIP traffic over IPv6 for any peers/users that have either a valid AAAA record for their hostname, or if you specify a peer/user with an IPv6 address.

Categories: Asterisk, sip Tags:

Have fun changing your voice with Asterisk “PITCH_SHIFT”

October 18th, 2010 No comments

One of Asterisk 1.8′s many new features is a function called PITCH_SHIFT. PITCH_SHIFT allows you to change the pitch of the audio on a given channel.

Here’s a quick dial-plan example that you can use to lower the pitch of  the callers voice on calls placed to  SIP extension 500. You can also substitute tx for rx and the voice of the called party will be changed. You can change the voice of both the caller and the called party by substituting rx or tx with  both.

The pitch of the voice can be raised or lowered by changing the number after the = sign. A value greater than 1 raises the pitch, while numbers less than 1 lower the pitch. Any number between .1 and 4 can be used.


exten => 500,1,Set(PITCH_SHIFT(rx)=.7)
exten => 500,2,Dial(SIP/500)
exten => 500,3,Hangup()

You can find additional documentation by running “core show function PITCH_SHIFT” at the Asterisk CLI.

Installing PBX In a Flash from a USB CD-ROM – Network Install

September 25th, 2009 No comments

I found a way to install PIAF via a USB cdrom drive/network. The only way I could get it to work was to put the contents of the cd on the http server

1. Copy the contents of PIAF to a HTTP server
2.
Type ksnet at the boot prompt
3.
When it complains about not finding kickstart script put in “http://:x.x.x.x/ksnet.cfg”
4. When it complains about not finding the FTP. Hit back and select HTTP
5. Follow the prompts to install PIAF

Please post comments on your experiences.  I hope this helps.

UPDATE:

You can also use an NFS share. The syntax is “nfs:x.x.x.x:/mnt/install/ksnet.cfg”

Categories: Uncategorized Tags:

A Free SIP Out Bound Proxy Service

May 4th, 2009 1 comment

There is nothing worse than your provider blocking outbound SIP traffic (UDP 5060). There is a great service out now that will allow you to bypass your providers hatred for SIP.

Last I checked ClearWire blocks SIP. I am assuming this should work for ClearWire users. If it works please leave a comment and let me know.

A complete list of proxies is available at http://freesps.googlepages.com/

Last I checked the following proxies and ports were avaialable:

free.sipout.com:53
free.sipout.com:69
free.sipout.com:80
free.sipout.com:123
free.sipout.com:135
free.sipout.com:161
free.sipout.com:443
free.sipout.com:1433
free.sipout.com:1812
free.sipout.com:3389
free.sipout.com:5900
free.sipout.com:15345
free.sipout.com:27888
free.sipout.com:44899

Categories: sip Tags:

Listen to Podcasts on Asterisk – Takes 30 seconds!

May 3rd, 2009 No comments

What is podlinez.net?

Podlinez is a free service that lets you listen to podcasts on your phone by calling a regular land line phone number.

For example, if you call 1 (415) 376-7253 from any phone, you will hear the CNN podcast.

Get a complete list of podcast numbers from their website:
http://www.podlinez.net

We are all about SIP and VoIP here so PSTN numbers aren’t that impressive. I’ll show you
how to connect to podlinez via SIP bypassing the PSTN. With SIP, you can listen to podcasts
on your Asterisk system without the need to place a PSTN call. No phone line needed!

The Concept:

Since podlinez supports SIP we are going to configure Asterisk to take any number begining with *763(POD) and direct it to the podlinez SIP proxy server. You can of course change *763 to whatever you wish.

Step One:

Non FreePBX users: add the following to your /etc/asterisk/extensions.conf

exten => _*763.,1,Dial(SIP/${EXTEN:4}@podlinez.net)

Free PBX users: add the following to your /etc/asterisk/extensions_custom.conf

[from-internal-custom]
exten => _*763.,1,Dial(SIP/${EXTEN:4}@podlinez.net)

Step Two:

Reload asterisk: asterisk -rx reload

Enjoy a podcast:

1. Browse to http://www.podlinez.net to find the number of your favorite podcast

2. Dial: *763 and a the number of the podcast you wish to listen enjoy  excluding the country code 1.

3. Enjoy SIP podcasting goodness.

Please leve a comment and let me know how how this works for you.

TelTel SIP Settings

May 2nd, 2009 No comments

TelTel is a SIP provider that includes a proprietary SIP client that only works under Windows. The client itself has allot of features such as desktop sharing, presence, and chat capabilities.  The problem is, you can’t use the service on anything but a Windows box. TelTel does not include instructions on their website to configure third party clients.

After some searching I found the settings:

Username: user_AT_email.com | subsitute the @ symbol with _AT_
Authorization username:
user@email.com  | you are using the @ sign and not _AT_
Password:
yourpassword
Domain:
teltel.com
Proxy: obproxy.teltel.com:9090

I have tested these settings with XLite and they work great!

PBX-IN-A-FLASH Redundancy

February 9th, 2009 No comments

There are several ways to go about creating a redundant PIAF setup.  I am fortunate enough to have access to a MySQL cluster so I am taking advantage of it. You can also use MySQL replication between two PIAF boxes. That is a topic for another post.

This post is geared towards those already familiar with Linux. When I have more time I may create step by step instructions for those that aren’t so familiar with Linux.

Solution:

1. Export the local DB called ‘asterisk’ to a file on PIAF server a

2. Import the file containing the SQL for the ‘asterisk’ DB to the MySQL cluster.

3. Modify necesarry variables in  /etc/amportal.conf on server a to point to the MySQL cluster.

4. Restart amportal to ensure MySQL access is working as expected.

5. Enable SSH key based authentication between server a and server b and drop the keys in /root/cron

6. Copy the following two scripts to /root/cron on server b

update_host.sh
# cat rsync_script
#!/usr/bin/sh

echo "Starting /var/lib/asterisk"
/usr/bin/rsync -a -e "ssh -i /root/cron/asterisk2-rsync-key" \
root@servera:/var/lib/asterisk/ /var/lib/asterisk/
echo "Finished /var/lib/asterisk"
echo ""

echo "Starting /usr/local/apache/passwd/wwwpasswd"
/usr/bin/rsync -a -e "ssh -i /root/cron/asterisk2-rsync-key" \
root@servera:/usr/local/apache/passwd/wwwpasswd /usr/local/apache/passwd/wwwpasswd
echo "Finished /usr/local/apache/passwd/wwwpasswd"
echo ""

echo "Starting /etc/asterisk/"
/usr/bin/rsync -a -e "ssh -i /root/cron/asterisk2-rsync-key" \
root@servera:/etc/asterisk/ /etc/asterisk/
echo "Finished /etc/asterisk/"
echo ""

echo "Starting /var/www"
/usr/bin/rsync -a -e "ssh -i /root/cron/asterisk2-rsync-key" \
root@servera:/var/www/ /var/www/
echo "Finished /var/www"
echo ""

echo "Starting /usr/lib/asterisk"
/usr/bin/rsync -a -e "ssh -i /root/cron/asterisk2-rsync-key" \
root@servera:/usr/lib/asterisk/ /usr/lib/asterisk/
echo "Finished /usr/lib/asterisk"
echo ""

echo "Starting /etc/amportal.conf"
/usr/bin/rsync -a -e "ssh -i /root/cron/asterisk2-rsync-key" \
root@servera:/etc/amportal.conf /etc/amportal.conf
echo "Finished /etc/amportal.conf"
echo ""

echo "Reloading Asterisk configs from MySQL"
/var/lib/asterisk/bin/module_admin reload
echo "Reload Successful"
echo ""

echo "Starting removal of SIP registrations"
rm /etc/asterisk/sip_registrations.conf
echo "sip_registrations.conf removed"
echo ""

echo "Reloading Asterisk"
/usr/sbin/asterisk -rx reload
echo "Reload Successful"
echo ""
promote_primary.sh
# cat rsync_script
#!/usr/bin/sh

echo "Starting /var/lib/asterisk"
/usr/bin/rsync -a -e "ssh -i /root/cron/asterisk2-rsync-key" \
root@servera:/var/lib/asterisk/ /var/lib/asterisk/
echo "Finished /var/lib/asterisk"
echo ""

echo "Starting /usr/local/apache/passwd/wwwpasswd"
/usr/bin/rsync -a -e "ssh -i /root/cron/asterisk2-rsync-key" \
root@servera:/usr/local/apache/passwd/wwwpasswd /usr/local/apache/passwd/wwwpasswd
echo "Finished /usr/local/apache/passwd/wwwpasswd"
echo ""

echo "Starting /etc/asterisk/"
/usr/bin/rsync -a -e "ssh -i /root/cron/asterisk2-rsync-key" \
root@servera:/etc/asterisk/ /etc/asterisk/
echo "Finished /etc/asterisk/"
echo ""

echo "Starting /var/www"
/usr/bin/rsync -a -e "ssh -i /root/cron/asterisk2-rsync-key" \
root@servera:/var/www/ /var/www/
echo "Finished /var/www"
echo ""

echo "Starting /usr/lib/asterisk"
/usr/bin/rsync -a -e "ssh -i /root/cron/asterisk2-rsync-key" \
root@servera:/usr/lib/asterisk/ /usr/lib/asterisk/
echo "Finished /usr/lib/asterisk"
echo ""

echo "Starting /etc/amportal.conf"
/usr/bin/rsync -a -e "ssh -i /root/cron/asterisk2-rsync-key" \
root@servera:/etc/amportal.conf /etc/amportal.conf
echo "Finished /etc/amportal.conf"
echo ""

echo "Reloading Asterisk configs from MySQL"
/var/lib/asterisk/bin/module_admin reload
echo "Reload Successful"
echo ""

7. Run update_host.sh on serverb This copies the configs from server a to server b minus the sip registrations

8. If you want to promote server b to primary (registering to SIP providers for inbound calls) run promote_primary.sh

A free open source SIP Proxy!

February 6th, 2009 No comments

I have always found SER to be a painful process to install and configure.  As a result I started using Brekeke. Breke works well enough alright, but it costs $$.  Another solution is to use openSIPS.

http://www.opensips.org/

Categories: sip Tags: , , , ,

Puget Sound Asterisk Users Group

January 28th, 2009 No comments

If you are interested in starting an Asterisk users group in the Puget Sound area please contact me.

Thanks,

+1 (253) 753-1512