Archive

Posts Tagged ‘sip’

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.

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: , , , ,