Routing calls from Zap Trunks to SIP trunks in Asterisk

March 9th, 2010 Ahmed El Gamil No comments

So i had this situation where i have 2 Asterisk boxes, the 1st one of them had a PRI card and the 2nd one is just attached to the network through an ethernet card

Goal: redirect all of the incoming calls on the PRI to the 2nd Asterisk box through a SIP Trunk (The 2nd box holds the IVR and all of those stuff, all of the IP phones are connecting to this one), There was no decent documentation about this out there so i am documenting this and may be someone will find it useful.

Here is what you should do (I am assuming you are using an Asterisk installation that uses FreePBX):

  • Create the Zap Trunk as you normally do from the FreePBX interface: Trunks -> Add Zap Trunk
  • Create a SIP trunk that points to the 2nd Asterisk box, we will use this Trunk later in the configuration: Trunks -> Add SIP Trunk, scroll down to outgoing settings and add the following
    • Trunk name: to-2ndAsterisk
    • Peer details:

type=peer

host=<IP Address of 2nd Asterisk Box>

  • Connect to the 1st Asterisk box using SSH and edit the file /etc/asterisk/dahdi-channels.conf, you will find some configuration like
group=0,11
context=from-pstn
switchtype = euroisdn
signalling = pri_cpe
channel => 1-15,17-31
context = default
group = 63
  • So as you can see all of the incoming calls are directed to the from-pstn context, we will now edit this line to direct the calls to the from-pstn-custom context and do the rest of the magic in this context so the file should be as follows
group=0,11
context=from-pstn-custom
switchtype = euroisdn
signalling = pri_cpe
channel => 1-15,17-31
context = default
group = 63
  • Now edit the file /etc/asterisk/extensions_custom.conf and add the following at the end of the file

[from-pstn-custom]
exten => _.,1,Dial(SIP/to-2ndAsterisk/${EXTEN:2},20,rt)

So what this does is that it matches all of the calls (_.) then redirect them through the SIP trunk to the 2nd Asterisk box

  • And the last step is to allow calls coming from the 1st Box to the 2nd Box, you should do IP-based authentication on the 2nd box by editing /etc/asterisk/sip_custom.conf and add the following

[1stAsterisk]
type=peer
canreinvite=no
host=<IP Address of 1st Asterisk Box>
context=from-pstn
nat=no
dtmfmode=rfc2833
disallow=all
allow=ulaw
insecure=port
qualify=yes

Of course you can now create any inbound routes on the 2nd Asterisk Box to match your needs.

I hope this works for you, and if you need any assistance please don’t hesitate to ask me in the comments

Thanks for listening :)

Installing Adobe Air under Fedora 12

March 5th, 2010 Ahmed El Gamil 1 comment

After having some problems trying to install Adobe Air under my Fedora 12 installation, here is the what you should do to get it up and running:

  • Install the following packages usign YUM

yum install gtk2-devel rpm-devel xterm

  • Solve the certificates issue using the command

for c in /etc/opt/Adobe/certificates/crypt/*.0; do aucm -n $(basename $c) -t true; done

  • Now you can navigate to where you download the binary and then do the following

chmod +x AdobeAIRInstaller.bin

./AdobeAIRInstaller.bin

BTW, this was under a 32-bit installation.

Hope this solves the problem.

Categories: Tutorials, UNIX/Linux Tags: , , ,

Stars were glowing at JDC 2010

February 28th, 2010 Ahmed El Gamil No comments

Since this blog was starting to be full of ghosts, i said that i must break the silence by some quick post.

Last Saturday I attended the JDC 2010 (Java Developer Conference) which is organized by EGJUG , I attended the last JDC which was at 2008 and it was pretty good and after looking at the agenda of 2010, i just couldn’t resist :)

Most of the sessions were quite interesting, i got to know some of the new technologies and made some good contacts with great people in the industry here in Egypt.

I also bought an excellent book “Secrets of the Rock Star Programmers” by Ed Burns who was a speaker at the conference (and he was also a speaker at 2008), and he signed it for me ;) , Thanks Ed.

After the conference we had a quick visit to Google :)

Actually that was at the Google Booth :) , Some of the Google guys were there like AbdelKarim Mardini showing the new Nexus one and some other cool stuff.

A lot of interesting people was there like Sang Shin, Fred Sauer, also from Egypt Mohammed El-Refaey whom i really enjoyed talking to.

So in the end, it was a pretty good day and meeting a lot of my friends added a tasty flavour to the mixture, JAK Shabab.

Time to move on and finish that piles of work to do !