[asterisk-users] Creating an IAX/SIP-to-ISDN PRI gateway

Steve Edwards asterisk.org at sedwards.com
Thu Aug 13 22:14:52 CDT 2009


On Wed, 12 Aug 2009, Shashi Dookhee wrote:

> I'd like to setup a really lean Asterisk installation that essentially 
> has a full ISDN PRI (AT&T, T1, 23 B-chans, 1 D-chan, BZ8S, 5ESS, 
> National dialplan) on a Digium TE207P adapter that all it does is 
> convert the ISDN channels to SIP/IAX channels.  Then I would add this 
> Asterisk 'gateway' as a provider on one (or many) Asterisk systems on 
> the back.

I did something almost exactly like this for a client about 5 years ago, 
but we used 1 te410p in each pizza box with the 4 PRI's in an NFAS group.

> With such a config I don't need anything like Voicemails, mailboxes, 
> etc...  All I want it to do is accept calls and 'passthru' the caller 
> ID, and when it receives a call, send it to the appropriate Asterisk 
> server based on Called ID (and, of course, passthru that 'Called ID' 
> too).

I "screen" each incoming call so I can discard [unwanted|abusive] callers 
on the "telco servers" before I hand off to the "application servers."

On Wed, 12 Aug 2009, Dave Fullerton wrote:

> extensions.conf (you'll find plenty of examples online)
> iax.conf (start with sample config and tweak to your liking)
> sip.conf (again, start with sample and tweak)
> logger.conf (sample will work)
> modules.conf (start with sample)
> indications.conf (use the sample)

I'd take a slightly different tack. I wouldn't start with the samples. I'd 
start with empty files and copy the bare minimum from the sample files 
until it works and then I would:

) Add access control features to [iax|sip].conf

) Only log to a central log host via syslog so you can [analyze|ignore] 
everything at once. My /etc/syslog.conf only has a single line: "*.* 
@loghost" Also, you reduce disk I/O and space consumption.

I do use the sample indications.conf because I've never taken the time to 
figure out what I really need.

"Building up" the conf files helps you understand exactly what you are 
doing and why. Also, as any good mechanic will tell you, parts left out 
don't get broke.

This is most of my extensions.conf:

[globals]
         HOSTNAME                        = ${ENV(HOSTNAME)}
         SERVER                          = iax2/${HOSTNAME}:${HOSTNAME}@192.168.0.x

; all calls start here
[block-ani]
         exten = _x.,1,                  verbose(1,[${CONTEXT}:${EXTEN}])
         exten = _x.,n,                  answer()
         exten = _x.,n,                  set(DNIS=${EXTEN})

; update the channel status in the database
         exten = _x.,n,                  agi(update-channel-status,--offhook,--debug,--verbose)

; see if this ANI should be blocked
         exten = _x.,n,                  agi(block-ani)
         exten = _x.,n,                  goto(${STATUS},1)

; hand off to the application server
         exten = SUCCESS,1               dial(${SERVER}/${DNIS})
         exten = SUCCESS,n,              hangup()

; hangup
         exten = FAILURE,1,              playback(redirect)
         exten = FAILURE,n,              hangup()

The AGIs are written in C so the performance "hit" is a very small 
fraction of that of AGIs written in Perl or PHP.

-- 
Thanks in advance,
-------------------------------------------------------------------------
Steve Edwards       sedwards at sedwards.com      Voice: +1-760-468-3867 PST
Newline                                              Fax: +1-760-731-3000



More information about the asterisk-users mailing list