By:

_ ___ _
/ |/ _ \ _ __ (_)_ __
| | | | | '_ \| \ \/ /
| | |_| | | | | |> <
|_|\___/|_| |_|_/_/\_\

INTRO:
===============================================================================================================
Welcome. Today I will be presenting international phreaking with the Asterisk Open Source PBX system, and free services. We will compile Asterisk from source, configure it to connect to Free World Dialup and Voip User, and then design a custom dial plan using the Asterisk Extension Language to make and receive calls (including provisioning US and UK phone numbers), route forwarding, establish encrypted connections, set up a conference calling server and a voice mail server on the laptop, and explore Caller ID spoofing, Backspoofing, and call forwarding manipulation in the US, and UK. Then we will briefly explore exploiting the weaknesses in the SIP protocol, and initiate passive digital wiretaps of a conversation using Wireshark. First a bit of a glossary on the terminology.

GLOSSARY:
===============================================================================================================
Asterisk will be represented by * here-on in.

VoIP=Voice Over IP. (sorry)

PSTN=Plain Standard Telephone Network. This is the 'normal' telephone network that in the UK is run by the Dalek... I mean British Telecom.

ADA=Analog Digital Adapter. This allows you to use standard telephones with VoIP servers.

SIP=Session Initiation Protocol. This is the ipso-facto industry standard for VoIP. It is used by most major VoIP providers including Vonage, and initiated voice conversations over port 5060 then carries on packet communication over RTP. It is a rock soild Open source standard, and as it becomes adopted more the NAT transversal issues typically associated with it are being overcome using STUN servers.

IAX=Inter-Asterisk Exchange protocol. This is an open source protocol developed by Digium (the developer of *) for use with *. It offers many advantages over the SIP protocol, including seamless NAT transversal, and fixed bandwidth trunking. It also includes a little documented feature of 128bit AES encryption using MD5 authentication.

Skype=A bullshit proprietary VoIP service that uses a P2P connection system to route computer to computer calls, and offers incoming and outgoing PSTN termination for a fee. The protocol is closed source, and so there is little development of applications using Skype's network outside of Skype itself. Skype is the anti-thesis of *, and for the life of me I have no idea why it has become so popular aside from its ease of configuration and use. It is known for buggy software, dropped calls, and general suckyness. I will be happy to debate this after the presentation.

FWD=Free World Dialup. This is a free service that offers many of the same features of Skype, and many that Skype does not offer. The major difference is that FWD uses the Open Source SIP protocol, and allows the connecting client to choose its codec. It is fully compatible with * as well as any SIP softphone or ADA. FWD also offers free IAX termination. It offers free calls to toll-free numbers in 5 different countries including the US, and UK, and peering with over 50 different VoIP providers. There is also a little known quirk using * that allows you to set outgoing Caller ID fields for free. For this tutorial we will be acquiring two separate FWD #'s.

CID Spoofing=Changing the outgoing Caller ID presentation flags to mask the origin of a call.

Backspoofing=Using CID spoofing to pull CNAM (Customer Name) information.

-And Now For The Show!

But first a word about TrixBox. TrixBox is a CentOS based distro that comes with asterisk, and many other toys for asterisk included. It is solid, reliable and easy, so why not use it right? Well, it is a viable option, however, you will be limited in the ways that it can be configured. I always opt for flexibility over ease of use. Also using the vanilla * allows me the ability to continue to learn how * works, and the flexibility to make it work how I want it to. If you are new to linux, and * then trixbox may be a great place for you to start. If you are interested in rolling up your sleeves, and getting a bit dirty, then please read on.

INSTALLATION:
===============================================================================================================
Firstly we will be installing * from source. There are Binary Packages available for many Distributions, but in order to use a recent version of the PBX it is much better to compile it from source.. I have already taken the liberty of installing all of the dependencies for *, so we will be compiling libpri, zaptel drivers (necessary even though we do not have digium hardware, we will need the zaptel-dummy driver for its timer to use conference calling).

OK, lets get started. Just do a standard:

./configure
make
make install

for zaptel, then libpri, then asterisk. On my laptop I have compiled the newest version of asterisk-1.2, but on the HVR PBX I am running the newest version of asterisk-1.4. I recommend 1.4, but am running 1.2 on my laptop because I have compiled some custom modules for * that demand 1.2. Both work, but 1.4 has the newest cool stuff.
Anyway, if you are going to use 1.4 also make sure to : make samples. This will give you the sample configurations that are pretty well documented, though full documentation can be found on www.voip-info.org.

Please note that you can use a pre-compiled binary for your distribution, but chances are it will be a rather old version of *, and as development of the PBX happens quickly I find that it is best to use the most current versions.

After you have compiled * go ahead and run the command:

sudo su
asterisk -vvvvvc

* is run as root, so always make sure you have root access when running the server, the CLI, or editing the configs. This will start * and the CLI (command line interface) with a verbosity of 5. If all apears to be going well and you are dropped to the CLI> command prompt, then type:

stop now

This will stop * and bring you back to your prompt. Now lets cd to /etc/asterisk and issue an ls. These are the guts of *, the config files. You are now ready to make * your own.

CONFIGURATION:
===============================================================================================================
There are 5 configuration files we will be using: sip.conf. iax.conf extensions.conf voicemail.conf, and meetme.conf. We will be writing extensions.conf from scratch. all the others we will be modifying to suit our needs. We will be starting with sip.conf. It is the configuration file that defines all of the SIP interactions. This includes both the Voip provider's servers, and the clients that will connect to * for service. We will be configuring one client, and connections to the FWD servers, and the Voip User servers. As we go I will explain the configuration options. I will also be providing the specs on the codecs available, and the pros and cons of each.

SIP.CONF
_______________________________________________________________________________________________________________
OK, lets open up sip.conf in your favorite editor (i like nano), and take a look see. Its not as confusing as it may seem, lets just take it easy to start. The first thing we are going to need is to have a client to connect to the * server. Lets go all the way to the bottom of the conf and make up a sip client. We'll add these lines:

(The comments after the ; tags are just that, comments, and unnecessary for the conf to work, they are just my explanations)

[100] ;this will be the sip client designation we will use when dialing this phone in extensions.conf
type=peer
host=dynamic ;this indicates that the client can connect from any IP address
username=100
secret=MAKEaPASSWORD
qualify=yes ;this is not necessary, but with this tag when you issue the "sip show peers" command in the CLI it ;will give you the latency, and I like that.
port=5060 ;this is the standard port for SIP
nat=yes ;or no, depending on wether the client is behind a NAT firewall
dtmfmode=rfc2833 ;this is the dtmf signalling protocol to use. I also use inband on lines that i want to dial ;using a tone dialer
disallow=all ;this refers to codecs. This allows me to choose which codecs I want to connect using
allow=ulaw ;G.711u (see chart below)
allow=alaw ;G.711a (" " " )
allow=gsm
context=local ;this is the context that will handle calls made to this client. So a client outside of the local ;context will not be able to dial this client's extension directly.
canreinvite=yes
callerid="10nix" <100> ;Anything in the "" tags is the Caller ID name, and in the <> is the #. You can set these ;either to the internal extension (as was done here), to one of your incomming #, or any other # for that matter.

OK, now we have the client configuration for our first sip client, but wait! We need a client! Here we have many options, ranging from free softphones, to ATA's (they allow you to use normal phones with VoIP, to costly, but really cool, IP phones. The choice is yours, but for now lets go with a free soft phone. We will be using thew Xten Xlite softphone offered by Counterpath. It is a sip softphone, and is freely available to download from: .
In addition ti this there are Windows, Mac OS, and Linux versions of the phone available.

These instructions are for the linux version, other versions may vary:
After downloading the softphone lets go ahead and get it configured. Open up the menu button, and goto System Settings > SIP Proxy. Click on the first entery, and set it up like this:
Enabled: Yes
Display Name: (What you set as Caller ID in the sip.conf, same format, but with no "" on the Caller ID name.
Username: 100
Authorization User: 100
Password: (The password you cose in sip.conf)
Domain/Realm: IP of the * server, if on the same machine, use the local loopback 127.0.0.1
SIP Proxy: same as above
Out Bound Proxy: same as above
Send Internal IP: Default
Register: Default

The rest just leave the same. Now hit back twice and X out of the menu.
Now go to the command line on the * box, and type:

asterisk

This starts the * server as a deamon, and backgrounds it. To connect to the CLI issue the command:

asterisk -r

Now at the CLI>, issue the command

set verbose 8 (or: core set verbose 8 : for asterisk-1.4)
Now restart the xlite softphone. You should see the REGISTER happen in the CLI. Thats really cool, but without a dial plan, its kind of useless, but before we go on, we are going to configure sip.conf for making and receiving calls using FWD. I configure my systems for both SIP and IAX connectivity to FWD for redundancy.

The sip.conf for FWD looks a bit like this:

In the [general] section of sip.conf look for the portion that has the registers in it, and insert the FWD registration line:

register => ${FWD #}:${FWDpassword}@fwd.pulver.com

[fwd-gw]
context=fromiax ;we will be configuring FWD with IAX as well, and this is the context we will be dropping ;incomming FWD calls to
port=5060
type=peer
secret=${YOUR_FWD_PASSWORD}
username=${YOUR_FWD_#}
auth=md5,plaintext
host=fwd.pulver.com
disallow=all
allow=ulaw ;again this is a matter of preference and bandwidth. See chart below.
dtmfmode=rfc2833
canreinvite=no
insecure=very
qualify=yes
nat=yes

IAX.CONF
_______________________________________________________________________________________________________________
We will then move on to the iax.conf. This is the same sort of configuration as sip.rconf for IAX. We will be setting up an encrypted client, and a connection with the FWD IAX server. Again, the configuration options will be explained as they are set.

Before we set up an iax registration for FWD, log into the FWD web interface for your account, and make sure that you have iax enabled. At this point it is very simple to configure * for IAX FWD. Open up the iax.conf file with your favorite editor. Before we get into registrations, and configurations for clients and providers, we are going to tweak some general options. First off, we need to adjust our codecs for bandwidth. There are two ways to do this. The first is with the bandwidth= low,medium,high field in iax.conf. I prefer to comment that out entirely, and set the default codecs by hand. This is achieved in the general section of the iax.;conf in the same manner that we chose the codecs when configuring a sip peer in the sip.conf, i.e. with the allow= and disallow= options. Next we will scroll down to the IAX registration section, and have * register through IAX with FWD. We just add the line:

register => ${ FWD_#}:${FWD_PASSWORD}@iax2.fwdnet.net

Now scroll down some more, and make sure that the following portion is uncommented, and the context is changed to reflect where we are going to handle incoming calls from FWD:

[iaxfwd]
type=user
context=fromiax
auth=rsa
inkeys=freeworlddialup

That was easy enough, now lets set up a couple of encrypted lines so that they can talk to each other securely. Scroll down to the end of iax.conf, and add the lines:

[1007]
type=friend
host=dynamic
username=encrypt1
auth=md5
secret=VERY_SECURE_PASSWORD
trunk=no
notransfer=no
encryption=aes128
disallow=all
allow=ulaw
context=encrypt

[2007]
type=friend
host=dynamic
username=encrypt2
auth=md5
secret=VERY_SECURE_PASSWORD_2
trunk=no
notransfer=no
encryption=aes128
disallow=all
allow=ulaw
context=encrypt

A couple of quick things to note:
-You must use md5 authentication (auth=md5) otherwise the peers will not be encrypted, even though it will indicate that they are with the iax2 show peers command in the CLI.
-Please note the context=encrypt option. This will tell us where to configure the dialplan for these lines.

EXTENSIONS.CONF
______________________________________________________________________________________________________________
extensions.conf is where the dialplan itself is set. We will be setting up the call functions mentioned in the introduction, and exploring some of the functions in the dialplan. Later on we will be looking at the extensions.conf of a production environment (albeit a sloppy one) to see some of the more advanced functions. It is important to not that * has the ability to call AGI's from the dialplan including php and perl scripts. Additionally * can make system calls directly from the dialplan. The ringback function we will be looking at is an excellent example of this.

So we've come this far with little or no problems, but we still cant dial anything, or use anything we've configured. We need a dialplan, and fast. As we've gone on and configured up a bunch of peers and friends and such we have indicated that we are using a bunch of different contexts (local,fromiax,encrypt...). To begin with we are going to put the example extensions.conf file that is included with the distro somewhere safe so we can refer to it if we want, and maybe borrow from it a bit when we need.

Make sure that we are still in the /etc/asterisk folder, and:

mv extensions.conf extensions.conf.example

then:

nano extensions.conf

I much prefer to set up extensions.conf from scratch to eliminate everything that im not going to be using, and to be able to find whatever portions of it that I need quickly. Also there is usually a section in extensions.conf for macro functions. I find these to be very useful for production environments with many users, but unnecessary for a small setup like I use for phreaking. For our purposes we will not be delving into macro functions, but feel free to explore this further as you get more familiar with *.

So lets get started on our extensions.conf. We will start at the best place, the beginning.

This is the portion where we will be setting up options that will apply to all other contexts:

[general]
static=no
writeprotect=no
clearglobalvars=no

Easy enough, now lets start with our contexts. These are defined by [ ], and are the guts of the dialplan.
we will begin by setting up incomming calls from FWD because as of now it is the only service provider that we are using. We will be using the fictitious 123456 and 654321 #s for FWD, when configuring your own, replace 123456 with your own FWD #s.

A breif note on syntax: All extensions are defined by the exten => tag, followed by a comma, the priority, a comma, and the dialplan application to execute.

[fromiax] ;Remember this from iax.conf and sip.conf context= ?
exten => 123456,1,Answer ;Always answer an extension first unless you have a reason not to answer the call.
exten => 123456,2,AGI(cid.agi)
exten => 123456,3,System(echo NUMBER: ${CALLERID(NUM)} >> /var/lib/asterisk/custom-log/ast.log)
exten => 123456,4,System(echo NAME: ${CALLERID(NAME)} >> /var/lib/asterisk/custom-log/ast.log)
exten => 123456,5,Dial(SIP/100,20,rt)
exten => 123456,6,VoiceMail,u100
exten => 123456,7,VoiceMail,b100
exten => 123456,8,Hangup

OK, this is going to take a bit of explaining. Ok, first off it answers the call. Priority 2 tries to replace the Caller ID name by doing a reverse lookup on the #, and failing that, trying to pull the location of the NPA-NXX (In the US). Priority 3 stores the Caller ID number as the variable ${CALLERIDNUM}, and priority 4 sets the Caller ID name as the variable ${CALLERIDNAME}. Now remember when I mentioned that * could pass system commands directly from the dialplan, well that is what we are going to do next. Priority 5 writes the CID number in the text file /var/lib/asterisk/custom-log/ast.log, and priority 6 does the same for the CID name. Now would actually be a great time to create that file:

mkdir /var/lib/asterisk/custom-log/
touch /var/lib/asterisk/custom-log/ast.log

Priority 7 then adds a nice little line to separate the entries. The PBX automatically does this in the cdr with other information that can be parsed in many different ways, but I like to create this separate file to set up a realtime Called ID display in a bash shell using the cat command. To set that up, just open up a new shell, and issue the command:

cat /var/lib/asterisk/custom-log/ast.log

BAMB! instant Caller ID display!

Priority 8 then dials the SIP extension 100, tries it for 20 seconds passing a ring tone, and then allows the extension to transfer the call when answered. If in 20 seconds the call is not answered Priority 9 forwards the call to voicemailbox 100 with the unavailable message, and in the event that the line is already in use, priority 10 sends it to voicemail with the busy message. Finally priority 11 makes sure that after all that goes down that the incoming portion is hung up once it is routed properly.

[local] ;This is where we will set up dialplan options for the sip client that we set up before.
;[default] for asterisk-1.4
;This will set up toll free calling in 5 different countries:
;for the UK and US you dial the # like you would in that country
;for the others, it is the country code followed by the #
;
;United States Toll-Free
exten => _1800NXXXXXX,1,Dial(SIP/fwd-gw/*${EXTEN:1},60,t)
exten => _1888NXXXXXX,1,Dial(SIP/fwd-gw/*${EXTEN:1},60,t)
exten => _1877NXXXXXX,1,Dial(SIP/fwd-gw/*${EXTEN:1},60,t)
exten => _1866NXXXXXX,1,Dial(SIP/fwd-gw/*${EXTEN:1},60,t)

;United Kingdom Toll-Free
exten => _0800.,1,Dial(SIP/fwd-gw/*44${EXTEN:2},60,t)
exten => _0500.,1,Dial(SIP/fwd-gw/*44${EXTEN:2},60,t)
exten => _0808.,1,Dial(SIP/fwd-gw/*44${EXTEN:2},60,t)

;Netherlands Toll-Free
exten => _31800.,1,Dial(SIP/fwd-gw/*${EXTEN:1},60,t)

;Norway Toll-Free
exten => _47800.,1,Dial(SIP/fwd-gw/*${EXTEN:1},60,t)

;Germany Toll-Free
exten => _49800.,1,Dial(SIP/fwd-gw/*${EXTEN:1},60,t)
exten => _49130X.,1,Dial(SIP/fwd-gw/*${EXTEN:1},60,t)

;and now to dial other FWD #'s, dial *393 (*FWD) then the #:
exten => _*393.,1,Dial(SIP/fwd-gw/${EXTEN:4},60,rt)

;It is important to note that the Caller ID presented in the sip.conf will get passed to the # that you are dialing

;Now lets set up some fun extensions
exten => *1,1,VoiceMailMain ;access the voicemail server

exten => *2,1,Meetme ;access the Conference Bridge

;play your music on hold
exten => *3,1,Answer
exten => *3,2,SetMusicOnHold,default
exten => *3,3,Musiconhold
exten => *3,4,Hangup

;dictations, stores sound files in /var/lib/asterisk/dictations (make sure that folder exists)
exten => *4,1,Dictate(/var/lib/asterisk/dictations)
;dial 1 to toggle record and playback modes
;dial 0 for help
;dial * pause/unpause
;dial # to enter a new filename
;
;PLAYBACK MODE OPTIONS
;dial 2 to toggle fast playback (speed 1x, 2x, 3x, 4x)
;dial 7 to seek backwards a few frames
;dial 8 to seek forwards a few frames
;
;RECORDING OPTIONS
;dial 8 to erase the whole file and start again


VOICEMAIL.CONF
___________________________________________________________________________________________________________
voicemail.conf is a simple configuration for the voicemail server. It serves as a good example of a highly efficient configuration for a fully functional program.

We're going to add a mailbox for our softphone:

Scroll to the mailbox portion of the conf ([default]), and add the line:

100 => 1337,10nix,10nix@hackervoice.co.uk

thats mailbox 100 => Password,Name,Email-Address (must have SMTP on server to email messages)

MEETME.CONF
____________________________________________________________________________________________________________
meetme.conf runs along the same lines as voicemail.conf, but for the conference calling application.
We'll setup an example conference like this:

conf => 1337,1337,31337

that's conf => conference number,pin,admin-pin


USAGE
____________________________________________________________________________________________________________

Ok, so now we've got our own PBX running on a laptop, thats really cool, but lets see what we can do with it. For our purposes, we will be mostly controlling the PBX through the extensions.conf. Take note as we go along to the syntax. Just like anything else, its all about the details, but once and understanding of the frameworks is achieved, it becomes trivial to control call flow, and processing.

-Called ID Processing, and Spoofing:
As was mentioned before * allows you to set outgoing CID, just like any other PRI. This allows for CID spoofing. This single handedly got me into * in the first place. Lets look at some of the different ways to accommodate CID spoofing in the Dial Plan. For a while now there have been AGI scripts floating around that prompt you for the inputs, and set the fields accordingly. These work just fine, but for this phreak they are too cumbersome, and in-efficient. When designing call functions for * I often times have to hack together burdensome, and lengthy bits to achieve functionality. This is either to bypass using for pay services that would be easier, or because I am simply limited in my knowledge, am not aware of a 'better' way. CID spoofing is not one of these times. I use a very simple method the uses two lines in the dial plan:

;US national dialing with CID spoofing
exten => _*33NXXNXXXXXXNXXNXXXXXX,1,Set(CALLERID(all)=${EXTEN:13})
exten => _*33NXXNXXXXXXNXXNXXXXXX,2,Dial(SIP/telasip-gw/${EXTEN:3:10},60,rt)

OK, that was three lines, but the comment line is hardly necessary. As for an explanation, _*33 tells the server to process anything that starts with *33 and has 20 digits following it using this extension. So say *3380044444442024561414 is dialed. priority one takes out the first 13 digits and sets all CallerID fields as 202-456-1414 (the switchboard to the White House). Priority 2 then places the call through the SIP provider telasip, eliminating thew first 3 digits (*33) and the last 10. So it would call 800-444-4444 (MCI ANNAC). MCI would then say "our system indicates you are calling from area code 202 456-1414... Please note that it is a common miconception that CID can only be spoofed through IAX. TelaSIP is just one provider that allows it using the sendrpid=yes option in sip.conf. In contrast to this for UK CID spoofing I use an IAX provider. It looks like this:

;UK national dialing with CID spoofing
exten => _*44.,1,Set(CALLERID(all)=0${EXTEN:13})
exten => _*44.,2,Dial( IAX2/${accountname}@voiptalk/${EXTEN:1},rt)

This does the same thing as the above example. the . after _*44 is a wildcard, and tries to process any number of digits after the *44. There is a better way to do this, I just have not figured it out yet.

Suppose you want to spoof your Caller ID, and then record the phone call as well; that is not a problem:
exten => _*444X.,1,SetVar(CALLFILENAME=${EXTEN:1}-${TIMESTAMP})
exten => _*444X.,2,MixMonitor(${CALLFILENAME},wav)
exten => _*444X.,3,Set(CALLERID(all)=0${EXTEN:13})
exten => _*444X.,4,Dial(IAX2/84471531@voiptalk/${EXTEN:2},rt)
exten => _*444X.,5,StopMonitor()
exten => _*444X.,6,Hangup

This will set the Caller ID, make the call, and record it in /var/lib/asterisk/sounds as ${NUMBER CALLED}-${TIME_CALLED}

Now to round out our CID roundup let me introduce to you Backspoofing: according to an article in this Summer's 2600 magazine by Natas, backspoofing is "calling yourself with spoofed Caller ID for the purpose getting the CNAM (Caller ID Name) associated with a particular number. Now it is my understanding that BT does not maintain a CNAM database, and so Caller ID name is a feature that is unavailable in the UK. I have some primative workarounds. One is to call a perl script through an agi to look up the number on google. This does not usually work, and since the UK does not have any free reverse lookup directories for now it seems that backspoofing in the UK proves ellusive. None the less, here is an example of how it would look in an extensions.conf:

;Backspoofing
exten => _*22.,1,Set(CALLERID(all)=${EXTEN:3})
exten => _*22.,2,Dial(SIP/telasip-gw/${inbound #},20,r)
exten => _*22.,3,Hangup

Well that wraps that up, but before we move on from Caller ID, there are a couple of things that I would like to mention. FWD allows passing outbound CID. This means that even without FWDout credits, you can spoof CID to 5 different countries using the standard (and free) FWD service.

Moving on. We have set up a couple of Services on * (A conference Bridge and Voicemail). Lets check them out.

These services, though necessary, and really cool, are alas, standard fare. Lets play a bit. The extensions.conf file allows us the flexibility to impliment dialplan functions on a whym...

For instance, one day someone asked me: "say, could you make a DTMF Readback on the PBX"?, I thought about it, and about 3 minutes later, it was up and running. Let me show you how:

exten => 403,1,Answer
exten => 403,n,Wait(1)
exten => 403,n,Playback(please-enter-your&number)
exten => 403,n,Read(dtmfinput,then-press-pound,,,,)
exten => 403,n,SayDigits(${dtmfinput})
exten => 403,n,Playback(thanks-for-using)
exten => 403,n,Wait(1)
exten => 403,n,Hangup

Then i made sure that the line that accesses this extension has dtmfmode=inband in the sip.conf. This allows * to register dtmf signalling using the sound rather than rfc2833. Pretty cool right?

Lets look at some other cool things we can do:

Automated Name and Number Announcement Circuit:
exten => 404,1,Answer
exten => 404,2,SayDigits(${CALLERID(NUM)})
exten => 404,3,SayAlpha(${CALLERID(NAME)})
exten => 404,4,Hangup

Record Custom Prompts in a Native Codec
exten => 1111,1,Answer
exten => 1111,2,Wait(2)
exten => 1111,3,Record(Custom-Prompt%d:ulaw)
exten => 1111,4,Wait(2)
exten => 1111,5,Playback(${RECORDED_FILE})
exten => 1111,6,Wait(2)
exten => 1111,7,Hangup
;The sound file will be saved in /var/lib/asterisk/sounds with the name Custom-Prompt0, Custom-Prompt1, etc.

Test Text To Speech Software
;Festival Test
exten => 2222,1,Answer
exten => 2222,2,Festival('London Twenty Six Hundred Scares Me With How Leet They Are, All My Base Belong To Them')
exten => 2222,3,Hangup

Talking Time!!! (Hah! Take that BT, we can do that too!!)
exten => 3333,1,Answer
exten => 3333,2,SayUnixTime(GMT,ABdYRS)
exten => 3333,3,Hangup

Think Thats Phun? Now lets get into some of the really phun stuff...
Check this out, you can pass system calls in the dialplan, allowing us to do virtually anything directly from the dial plan! Here is a sample bit that allows for a caller to dial a number, and never get connected to it. Why in the hell would anyone want to do that you ask? Well, While the phone is ringing away, the PBX goes ahead and grabs the Caller ID of the incomming call. It then waits 5 seconds (presumably long enough for the savvy caller to hangup) and calls them back, and hell, while we're at it, why not change the Caller ID of the call to something interesting, lets say... the FBI. This example is for the US, but in a moment I'll show you a version working in the UK.

exten => 841425,1,Ringing
exten => 841425,2,Congestion
exten => 841425,3,Hangup
exten => h,1,System(echo channel: SIP/telasip-gw/${CALLERID(NUM)} > /tmp/${CALLERID(NUM)}.call)
exten => h,2,System(echo callerid: 3104776565 >> /tmp/${CALLERID(NUM)}.call)
exten => h,3,System(echo extension: s >> /tmp/${CALLERID(NUM)}.call)
exten => h,4,System(sleep 5)
exten => h,5,System(cp /tmp/${CALLERID(NUM)}.call /var/spool/asterisk/outgoing)
exten => h,6,Hangup

Now that's 1337!!

Now lets take a look at the Audio Codecs commonly available for use in VoIP:

Audio codecs

Name standardized by description bit rate (kb/s) sampling rate (kHz) frame size (ms) remarks
(ADPCM) DVI Intel, IMA ADPCM 32 8 sample
G.711 ITU-T Pulse code modulation (PCM) 64 8 sample mu-law (US, Japan) and A-law (Europe) companding
G.721 ITU-T Adaptive differential pulse code modulation (ADPCM) 32 8 sample Now described in G.726; obsolete.
G.722 ITU-T 7 kHz audio-coding within 64 kbit/s 64 16 sample Subband-codec that divides 16 kHz band into two subbands, each coded using ADPCM
G.722.1 ITU-T Coding at 24 and 32 kbit/s for hands-free operation in systems with low frame loss 24/32 16 20 See also
G.723 ITU-T Extensions of Recommendation G.721 adaptive differential pulse code modulation to 24 and 40 kbit/s for digital circuit multiplication equipment application 24/40 8 sample Superceded by G.726; obsolete. This is a completely different codec than G.723.1.
G.723.1 ITU-T Dual rate speech coder for multimedia communications transmitting at 5.3 and 6.3 kbit/s 5.6/6.3 8 30 Part of H.324 video conferencing. DSP Group. It encodes speech or other audio signals in frames using linear predictive analysis-by-synthesis coding. The excitation signal for the high rate coder is Multipulse Maximum Likelihood Quantization (MP-MLQ) and for the low rate coder is Algebraic-Code-Excited Linear-Prediction (ACELP).
G.726 ITU-T 40, 32, 24, 16 kbit/s adaptive differential pulse code modulation (ADPCM) 16/24/32/40 8 sample ADPCM; replaces G.721 and G.723.
G.727 ITU-T 5-, 4-, 3- and 2-bit/sample embedded adaptive differential pulse code modulation (ADPCM) var. ? sample ADPCM. Related to G.726.
G.728 ITU-T Coding of speech at 16 kbit/s using low-delay code excited linear prediction 16 8   CELP. Annex J offers variable-bit rate operation for DCME.
G.729 ITU-T Coding of speech at 8 kbit/s using conjugate-structure algebraic-code-excited linear-prediction (CS-ACELP) 8 8 10 Low delay (15 ms)
GSM 06.10 ETSI Regular­Pulse Excitation Long­Term Predictor (RPE-LTP) 13 8 22.5 Used for GSM cellular telephony.
LPC10e (FIPS 1015) US Govt. Linear-predictive codec 2.4 8 22.5 10 coefficients.

 

-Qeustions, Comments? Can it do ____X____???

Thank you for your time, and I hope that this has been informative and phun.@

-References:

www.cs.columbia.edu/~hgs/audio/codecs.html::Codec Comparison (seen above)

www.voip-info.org :: All that is VoIP.
www.asterisk.org :: Asterisk project page.
www.hackervoice.co.uk :: Reppin my peeps yo.

 

Shouts to Belial, Naxxtor, Skoby, Strom Carlson, Mo0, Voltagex, Felix, and all the HVR IRC crew!