Telco PRI to Asterisk to PRI to Definity Switch

Hello All,

I need to preserve our Definity switch to that I do not need to replace all 100 phones here in our office at once. I would like to add and Asterisk box inbetween my telco and definity switch so that I can replace the phone on a more gradual scale over. Some phones really never need migrating for extra VOIP functionality. I need to gradually introduce Technology to my people or they freak out plus I need to spread out the cost over time. I have a dual t1 TE220 PCI Express card with hardware echo cancellation install and the Asterisk 1.8.9.2 server installed. I really wnat all calls to seemlessly pass through the Asterisk box at first. I then want to be able to add a few stations on Asterisk to provide them with VOIP awesomeness and have those stations taken oof the definity forever. Then as time passes keep adding more to the Asterisk box and less to the definty. I tried searching for exact example of this and was shocked more people don’t seem to do this. The old phones are all propriatary Lucent 8410D digital phones and the is no way to hook these directly to Elastic so this is the only way. Any advice would be most appreciated in helping me configure this. Thanks,

Tim

What do you mean by 2.3.0 beta 2? There are no open source Asterisk versions beginning with 2 and you should never be continuing to use a beta version after the final version is released.

What you are proposing to do is possible. Have one span go to the PSTN and the second go to the Definity. Then if an incomming call is not for a extension local to the Asterisk server, then send the call out the Definity Tie Trunk. I can;t be more specific because I don’t know Definity, I don’t know Elastix and I don’t know your system.

However, there is an option to re-use the phones and get rid of the Definity. There is company by the name of Citel that offers a box that will convert between several proprietary digital sets and SIP. I have not used the Definity emulation, but do use the Meridian mode and it works fairly well. Not perfect and not identical to the old way of doing things but it works and I did not have to buy 300 SIP enpoints and upgrade the cabling in our buildings. citel.com/Products/Portico.asp

I can do the Definity side. I am looking for how to configure in asterisk the correct way to Have one span go to the PSTN and the second go to the Definity. Then if an incomming call is not for a extension local to the Asterisk server, then send the call out the Definity Tie Trunk. Thanks,

Tim

I don’t suppose you have a ‘spare’ T-1 port on the Definity to test with?

Again, since I am not familiar with Elastix, I will have to be somewhat generic.

The basic steps are as follows…

Setup DAHDI on the Operating system level. If the card was physically in the machine when Elastix was installed, that may already be done. From the Bash command line, the command dahdi_hardware will tell you if the card is found. dahdi_scan will tell you how it is currently configured. The configuration file for setting the framing and d-channel allocation is /etc/dahdi/system.conf. Here is an example from one of mine.

[code]#

Span 1: TE2/0/1 “T2XXP (PCI) Card 0 Span 1” B8ZS/ESF RED

span=1,1,0,esf,b8zs

termtype: unknown

bchan=1-23
dchan=24
echocanceller=hwec,1-23

Span 2: TE2/0/2 “T2XXP (PCI) Card 0 Span 2” B8ZS/ESF RED

span=2,2,0,esf,b8zs

termtype: unknown

bchan=25-47
dchan=48
echocanceller=hwec,25-47
[/code]

It would be easiest to set your spans the same as is currently used on the PSTN <-> Definity now.

Once this is setup, the next thing is to define the channels for each span. That is done with the /etc/asterisk/chan_dahdi.conf file. This may also #include the dahdi-channels.conf file. This will define features of the channels and allow you to group them.

chan_dahdi.conf

[trunkgroups]
trunkgroup => 1,24,72
trunkgroup => 2,48,96
spanmap => 1,1,0
spanmap => 3,1,1
spanmap => 2,2,0
spanmap => 4,2,1

[channels]
relaxdtmf=yes
usecallerid=yes
hidecallerid=no
callwaiting=no
usecallingpres=yes
callwaitingcallerid=no
threewaycalling=no
transfer=yes
cancallforward=yes
callreturn=no
echocancel=yes
echocancelwhenbridged=yes
rxgain=1.0
txgain=0.0
immediate=no
faxdetect=no

#include dahdi-channels.conf

dahdi-channels.conf

; Span 1: TE2/0/1 "T2XXP (PCI) Card 0 Span 1" B8ZS/ESF RED 
; General Trunking
group=1
context=from-pstn
switchtype = national
signalling = pri_cpe
channel => 1-23

; Span 2: TE2/0/2 "T2XXP (PCI) Card 0 Span 2" B8ZS/ESF 
; IVR Trunking 
group=2
context=from-pstn
switchtype = national
signalling = pri_cpe
channel => 25-47

NOTE how the group= is BEFORE the definition for the group. Here you set the context where the incomming call will be placed in Asterisk. You also define the switch time and network connection (CPE or NET) side of the connection. For the PSTN connection, you will be pri_cpe, for the Definity connection, you could act as the net side. If the Definity connection does not work, you could set the Definity for NET and set Asterisk for CPE.

The incomming context is unknow as you have to determine what context Eleastix needs the calls to go to. Be carfull here as the wrong choice could have significant reprecusions.

Once that is configured, it is all dial plan. Assuming that Elastix allows you to define trunks, you would define the two spans as different trunks. I assume there is a way to setup outbound routes so that specific digit patterns can be directed to specific trunks. Digit patterns that match extensions on the Definity would go to that trunk. Digit patterns that match PSTN numbers that you want to allow, would go to that trunk.

With the proper configuration of the contexts and outbound routes, the calls shoule flow between the systems and the PSTN.

Good luck and have fun.

Thanks dalenoll, I appreciate the detail help. You are the man! I do not have a spare T1, but I can work on it during the weekends. We are a M-F shop only. I am going to try and set this up with just plain Asterisk on CentOS. I tried Elastic just to see, but I think I am better off with the stock system. Everything looks good. Two questions I have on the dial plan.

  1. Wouldn’t I need the 2 DAHDI groups to fall into different contexts for this to work?

  2. What is the best way to make it so at first all calls in just pass strait through to the definity and all calls out of the definity pass strait through to the PSTN? I then also want to grab DID’s one at a time as I then convert them to sip over time. Would it be as simple as starting with something like this:

[from-pstn]
exten=> _NXXXXXX,1,Dial(DAHDI/g1/${EXTEN})
exten=> _NXXNXXXXXX,1,Dial(DAHDI/g1/${EXTEN})

[from-definity]
exten=> _NXXXXXX,1,Dial(DAHDI/g2/${EXTEN})
exten=> _NXXNXXXXXX,1,Dial(DAHDI/g2/${EXTEN})

Do you think there will be much lag after adding the asterisk system? I figure because it is digital to digital there should be very little to no lag. I hope at least.

I am hoping to get this close to work berfore the weekend, so that I can just plop this Asterisk box in place an no one will be the wiser come Monday. Thanks,

Tim

Tim,

  1. Yes, you definately want 2 contexts. Like what you show in #2.

  2. It is my understanding, though I have not seen it personnally, that PRI can be configured to send only the DID portion of the number and not the whole 10 digits. So I like to err on the side of caution and include the possibility in my dial plan. If your DIDs are 4 digits, add an extension _XXXX.

Because Asterisk will match the best possible match for a pattern, when it comes time to add local Asterisk sets, you can create a context for the new sets and ‘include’ it in your from PSTN. Keep in mind the length of the DID comming in.

If your extensions are less than 10 digits and you are receiving 10 digits for the DID, you will want to strip the unused portion off and then Goto() the context where the Asterisk extension is defined.

For example:

[from-pstn]
exten => _5555551234,s,NoOp(Match on DID of 1234)
same => n,Set(DID=${CALLERID:-4})
same => n,Goto(asterisk-phones,${DID},1)

(NOTE: There are better ways to do that, but I am using this as an example)

Dale

I came in early this morning in hopes of leaving the Asterisk server into place, but it’s not quite right yet. I am getting close. You were right Dale, the PSTN is only passing the 4 digits of the DID through. I was able to see that on the console. The connection lights were all green everywhere, so that is good. I was able to call from a sip phone to the definity and the sip phone to the PSTN. I still cannot call in from the outside through Asterisk the though to the Definity or out tthe Definity through Asterisk to the PSTN. I had to stop 10 mintues before 8 am and hook everything back up to normal for daily operations. This is the error I am getting:

-- Accepting call from '' to '5151212' on channel 0/8, span 2
-- Executing [5151212@from-definity:1] Dial("DAHDI/i2/-9", "DAHDI/g2/5151212") in new stack

[Feb 16 07:47:35] DEBUG[1892]: sig_pri.c:985 sig_pri_request: sig_pri_request 25
[Feb 16 07:47:35] DEBUG[1892]: sig_pri.c:6498 sig_pri_call: CALLER NAME: NUM:
– Requested transfer capability: 0x10 - 3K1AUDIO
– Called DAHDI/g2/5151212
– DAHDI/i2/5i51212-a is proceeding passing it to DAHDI/i2/-9
– DAHDI/i2/5151212-a is ringing
– Span 2: Channel 0/8 got hangup request, cause 16
[Feb 16 07:47:38] WARNING[1892]: app_dial.c:1379 wait_for_answer: Unable to write frametype: 2
– Hungup ‘DAHDI/i2/5151212-a’
== Spawn extension (from-definity, 5151212, 1) exited non-zero on ‘DAHDI/i2/-9’
– Hungup ‘DAHDI/i2/-9’

Since both cards are communicating with there prospective ends, it appears it must be a configuration error. I have searched google and have not found much for Unable to write frametype: 2, so I am not sure whats going on. I did hook the crossover cable between both ports of the Digium card and could route calls between them offline, but it just does not want to pass them online. Any ideas? Thanks,

Tim

I would think that the inability to write the voice frame (frame type 2) is a consequence of the channel having hung up (previous message). Cause 16 is normal clearing. I’m not sure how to associate the hardware address of the channel that hungup with the Asterisk channels, so I’m not sure if it was the caller or callee that abandoned.

I’m not sure why Malcolm hasn’t directed you to Digium commercial support, assuming a genuine Digium card.

Tim,

If I read the output correctly, it looks like the call is coming into Asterisk from the Definity (DAHDI/i2) and going back out the same span(DAHDI/g2), which would be the Definity. If that is the case, it may explain the hangup.

Assuming that Span 1 is the PSTN and Span 2 is the Definity. Further assuming that the channels from Span 1 are assigned to Group 1 and the Channels from Span 2 are assigned to Group 2, you would Dial(DAHDI/g1/npanxxxxxx) to get to the PSTN and Dial(DAHDI/g2/xxxx) to get to the Definity. This assignment of channels to groups is done in chan_dahdi.conf. If you used dahdi_genconf, the assignments are actually part of the dahdi-channels.conf file as demonstrated in an earlier post.

I hope that makes sense. If not, please post your chan_dahdi.conf and dahdi-channels.conf if it exists. Also, post the dial plan code for the fron-definity context.

Dale

Right, sorry. :smiley:

Anyway, if you’re experiencing an issue with a Digium card, please, please, please contact our Support department directly.

You can open a case via:
digium.com/en/users/support_ … hp?tab=log

or contact us by telephone:

+1 256 428 6000

I used your chan_dahdi.conf verbatim at first Dale, but while I could not get the calls to route throough the cards. I had a tech from Digium ssh’d in and said that needed to be taken out and the group=1( and group=2) line is the best way to group channels. Once he did that, they worked. He said the Trunkgroup option is not used often. We did all of that so the ports could talk together, and presumably they would work once plugged in. It’s close. If I can’t solve it, I may have to get Digium on the line again. I have to say, their customer service was awesome.

dahdi-channels.conf:

; Span 1: TE2/0/1 “T2XXP (PCI) Card 0 Span 1” B8ZS/ESF ClockSource
group=1
context=from-pstn
switchtype = national
signalling = pri_cpe
channel => 1-23
context = from-pstn

; Span 2: TE2/0/2 “T2XXP (PCI) Card 0 Span 2” (MASTER) B8ZS/ESF
group=2
context=from-definity
switchtype = national
signalling = pri_net
channel => 25-47
context = from-definity

cat chan_dahdi.conf:

[channels]
relaxdtmf=yes
usecallerid=yes
hidecallerid=no
callwaiting=no
usecallingpres=yes
callwaitingcallerid=no
threewaycalling=no
transfer=yes
cancallforward=yes
callreturn=no
echocancel=yes
echocancelwhenbridged=yes
rxgain=0.0
txgain=0.0
immediate=no
faxdetect=no

#include dahdi-channels.conf

Glad to hear that You got on with the Digium support and that you are pretty close. I have heard good things about the Digium tech support. Everyone I talked to while I was down there was great. Really good people.

Sorry about the trunk group thing, that configuration is a bit … special. really not what you want at all. I had meant to strip that out before posting, but forgot. For the record: I have two sets of two PRIs as separate trunk groups. Each pair is setup with NFAS and I am splitting the pairs across different cards to minimize the impact if a card would fail. I also need to keep all outbound traffic limited to one set.

The chan_dahdi.conf looks like it should work now.
Good luck and let us know how it turns out.

Dale

No biggie, I appreciate your help very much. I cannot expect you to fix my problem exlicitly without being here. you really helped point me in the right direction. I have to wait to re hook the system back up until either tonight, early tomorrow, or this weekend. That is the problem with IT… All after hours for the good stuff. When I get this working, I will post my entire solution. I may need Digium again to help with this wierd message. Thanks,

Tim

Interesting Posts I will Have to read them all a little deeper kind of scanned through them.
I have been using asterisk since 2008 with various flavors of trixbox and PBX in a flash and Elastix.

Currently using Elastix at work and
Setting up a TE410P Quad T1 to a Definity G3 R6
Interface is through an T1 crossover cable to A120 CSU- DSU that plugs into the definity.
then a T1 card in the definity. Have the Asterisk side up I think but the definity side says it is out of service even though the te410 is green and in CLI pri show channels is OK also … Just have to find what little Line in conf files that I am missing and
get it back up and running…I had it up and working and loaded hylafax on PIAF server and it went away also dahdi commands dissapeared from PBIAF install CLI also so not sure what went wrong.
Overall is not to bad just have to be very carefull and backup before you make changes as the system is a little touchy at times. Gett it working and back it up. then try not to change too much or it might break, Now on Elastix and it is not bad. It has some good features and some things that I dislike but overall a nice system … now just have to get the dEFINITY TO RECOGNIZE THe trunk and get the asterisk talking to it again.

OK was those 2 config files Elastix had done something strange in them adding some group = 1,66 or something…
tuned those up and can call the definity, but no Uniform Dial plan on Definity to allow it to call me back.
In the Trunk I setup NXX so 3 digit calls go to the definity from the Asterisk / elastix box.