Friday, February 25, 2011
DTMF issue on Asterisk
IVR to work with VoIP<-->PSTN system perfectly, DTMF coding must be precise which can't be achieved perfectly with VoIP system (no matter if it is CISCO, AVAYA or Asterisk) all the time.
VoIP<-->VoIP is not a problem as DTMF code is passed as RTP payload and they know what to do with it.
VoIP<----RTP Payload------------RTP Payload------>VoIP
But with VoIP<-->PSTN, those DTMF tone has to be converted to RTP payload or RTP payload has to be converted back to DTMF tone, which doesn't happen precisely all the time.
VoIP <----RTP Payload--------------------DTMF------>PSTN
Q: How can I troubleshoot DTMF on asterisk?
Ans: You can go to /etc/asterisk/logger.conf and add dtmf for logging.
#vi /etc/asterisk/logger.conf
[logfiles]
full => verbose,debug,dtmf
Reload logger in asterisk
#asterisk -rv
CLI> logger reload
Perform test calls.
#tail -f /var/log/asterisk/full [ to see the realtime data logging ]
Press Ctrl + C to get out of the real time data monitoring
Q: I am having issues with duplicate DTMF. It appears that my asterisk box is receiving doubled DTMF signals. What could I do to fix it?
Ans: You have to change the setting in /etc/asterisk/chan_dahdi.conf. Add relaxdtmf=yes in that file.
Please ignore trunkgroups setting if that's not applicable in your environment. You simply need is relaxdtmf=yes under [channels] context
#vi /etc/asterisk/chan_dahdi.conf
[trunkgroups]
trunkgroup => 2,24,48
spanmap => 1,2,l
spanmap => 2,2,0
[channels]
usecallerid=yes
callwaiting=yes
usecallingpres=yes
callwaitingcallerid=yes
threewaycalling=yes
callerid=asreceived
relaxdtmf=yes
;This is PSTN Connection (G2)
context=From_Dahdi
switchtype=national
signalling=pri_cpe
group=2
channel => 1-23
channel => 25-47
Q: What kind of DTMF signalling should I prefer?
Ans: Out-of-band technique or RFT2833 is the most appropriate one and it's default on asterisk. You can explicitly specify
dtmfmode=auto [ Use rfc2833 if offered, inband otherwise ]
or
dtmfmode=rfc2833
If you are using SIP channels/trunks, define dtmfmode in sip.conf under [general] context
For more info you can visit www.voip-info.org
Wednesday, August 11, 2010
Asterisk PRI Trunk Group customization - Top-Down/Bottom-Up Hunting
You might be wondering, what the hell is 'a glare condition'?
A glare condition is the situation when the when a outbound call finds a clear channel and a new inbound call arrives at the very same instant, the inbound call wins, the outbound call gets "all circuts are busy"or vice versa.
So, how to fix it?
Let's say we have 23 channel PRI with D channel - 24. Telco is sending the inbound calls to hunt from channel 1 -> 23. So, I need to set outbound calls to hunt from channel 23 -> 1 to avoid the Channel Busy before ANY possibility of call collision.
How can I do that in Asterisk?
You specify which of four methods the Zap channel module is to use to select a non-busy channel from the channel group by prefixing the group number with one of the letters g, G, r, or R:
g: select the lowest-numbered non-busy Zap channel (aka. ascending sequential hunt group).
G: select the highest-numbered non-busy Zap channel (aka. descending sequential hunt group).
r: use a round-robin search, starting at the next highest channel than last time (aka. ascending rotary hunt group).
R: use a round-robin search, starting at the next lowest channel than last time (aka. descending rotary hunt group). [/color]
Create a new ZAP trunk and specify G0 as the trunk ID, go to your outbound routes. replace any routes calling for the trunk g0 and replace with new trunk G0. Go back and delete the g0 trunk so it will not be accidently selected as it is going to be the first trunk in the pull down list.
Wednesday, May 26, 2010
PRI/T1 having issues.... follow some of the checkpoints
A. Phyical Connection Issues
1. cabling
2. smart jack : It is the jack that can be used by Telco provider to do the loopback test remotely. With that said, it is not the mandatory device to put in the customer side, but Telco installs it on customer side so that they can do loopback test from their end remotely.
3. demarc : Telco line terminates to demarc of the customer primises.
Make a loop back plug. Simply take RJ-45 plug, loop a wire from pin1 to pin4 and another from pin2 to pin 5 and crip down the RJ-45.
If the circuit or the PRI/T1 card showing RED alarm, plug the loopback plug, if the circuit goes green then it says that hardware is good and configuration might also be good. But not 100% sure.
Plug the loopback plug on the smart jack to see if the Telco is having the issue. If the circuit goes green on the smart jack too, then jump to step B.
B. Protocol/signalling/configuration issues
1. Check if you are in sync on the physical layer - one of your T1 endpoints should provide clocking and another end should take clocking from the line
#/etc/zaptel.conf or /etc/dahdi/system.conf
span=<span num>,<clocking>,<LBO>,<framing>,<encoding>
e.g span=1,0,0,esf,b8zs
Here, clocking is set to 0 so it is using internal clock for clocking. So, it's configured like master clock source. The other end should be configured as slave for clocking ( i.e set second parameter to 1). If you are using T1 line from Telco provider, make sure that you set clocking to '0' as Telco is always configured as master for clocking.
esf,b8zs is widely accepted framing and encoding in North America.
2. Then, check if you have the same protocol running by both parties on the D-channel
#/etc/asterisk/zapata.conf or /etc/asterisk/chan_dahdi.conf
switchtype=<specify switchtype>
e.g switchtype=national
3. Finally, check if you have the right master/slave relationship on ISDN level. One side of the link should be set as network while another end should be set as user/slave.
#/etc/asterisk/zapata.conf or /etc/asterisk/chan_dahdi.conf
signalling=<specify signalling>
e.g signalling=pri_cpe #user-side configuration (Slave/User)
e.g signalling=pri_net #network-side configuration (Master)
If you are unsure how the other side is configured just try to set pri_net on Asterisk side. If it works with Telco provider, make sure that you contact them and tell them to change their configuration to NETWORK so that you can change your Asterisk as USER (pri_cpe).
Some bonus information:
Framing:
ESF
D4
CAS
CCS
Encoding:
B8ZS
AMI
HDB3
NCRC2
Signalling:
pri_cpe
pri_net
fxs_ks
fxs_ls
fxs_gs
fxo_ks
fxo_ls
fxo_gs
em (E&M)
em_w (E&M Wink)
em_e1
Switchtype:
Only used for PRI
national --> National ISDN 2 (default)
dms100 --> Nortel DMS100
4ess --> AT&T 4ESS
5ess --> Lucent 5ESS
euroisdn --> EuroISDN (common in Europe)
ni1 --> Old National ISDN 1
qsig --> Q.SIG
Tuesday, May 4, 2010
I have multiple T1 cards on the Asterisk Server. How do I know which T1 card will load first?
Card 0 has Span1-4 as it is loaded first
Card 1 has Span5-8 as it is loaded second
However, what will happen if Card1 loads first. You are in trouble as Card1 will host Span1-4, not the Card0.
To prevent this disaster to happen, Digium has Ident Dial that makes the driver load on the card in specific order. Ident Dial has range from '0-9' 'A-F'.
Now, I would do this
Card0 with Ident set to 0
Card1 with Ident set to 1
This will ensure that Card0 will have Span1-4
and Card1 will have Span5-8
Setting all cards to zero should cause the driver to automatically number the cards. The dial should only be used if a specific order is needed.
http://kb.digium.com/entry/106/
Wednesday, April 28, 2010
Benefits of using trunk group instead of multiple T1/E1 trunks
- Less programming of trunk groups in the CO to manipulate overflow whether it be in or out. That is, if 1 trk group is busy there will be no need for overflow to the other trunk group. If it is one trunk group all the channels will hunt to next channel if they are in use whether it is inbound or outbound. Traditionally, incoming starts from trk member 1, outbound starts from trk member 46.
- You will also get a backup d-channel that wil be available if the primary has a problem. If for some reason another span is needed, depending if the Asterisk is capable of doing this, it can be set-up as a full T1 rather than a PRI. This will get you an additional b-channel for voice and the full T1 can be a rider AND use the the d-channel signaling form the other spans.
Q: How can we achieve that in asterisk?
Ans: NFAS (Non-Facilities Associated Signaling) is an ISDN feature for sharing one ISDN D channel accross multiple ISDN PRI lines.
Friday, April 9, 2010
SPAN in details (for Asterisk)
Trunk can be T1/E1.
span = [span num], [timing], [line build out], [framing], [coding]
e.g span = 1,0,0,esf,b8zs
This means, the specified trunk is mapped to SPAN 1 of the T1 card. It uses internal clock of card as time source as second parameter is 0. LBO is 0 and it doesn't require to be changed most of the time as cable is not going to be more than 133ft from smart jack. Framing is esf. Coding is b8zs.
[ Also remember, each PRI card should have their own independent clock source ]
In brief, you can say, this particular trunk is esf,b8zs with internal clock as time source.
I would like to write about some other parameters defined in /etc/dahdi/system.conf
span = 1,0,0,esf,b8zs
bchan=1-23 #B-Channel defination
dchan=24 #D-Channel defination
Since bchan+dchan=24, it is T1 trunk configuration.
For E1 trunk, bchan+dchan=31
Also note that FRAMING and CODING is main factor that can distinguish between T1 and E1 trunk.
--------------T1----------------------E1
Framing -- esf / d4------------ ccs / cas
Coding ---- b8zs / ami -------- hdb3 / ami
-----------------------------------------
When you talk about Trunk, you also need to specify the switch type. Switchtype parameter is defined in /etc/asterisk/chan_dahdi.conf . It can be National or dms100 or 5ess
Default Switch: National
Nortel Switch : dms100 [ but it's weird that in my case, i had to use 5ess switchtype to interface my Asterisk Server with Nortel Switch]
Dialogic Fax Server Switch : dms100
So, PRI with following configuration can be said as T1 trunk with esf,b8zs signalling and National switchtype.
#/etc/dahdi/system.conf
span = 1,0,0,esf,b8zs
#/etc/asterisk/dahdi.conf
switchtype = National
Wonderful explaination at :
http://www.asteriskguru.com/tutorials/pri_zaptel.html
http://www.asteriskguru.com/tutorials/pri.html
Telcom Terminologies
=> 1.544Mbps line
=> Based on T1/E1
=> Carry DSO signal
BRI : Basic Rate Interface for SOHO
2B + 1D
PRI : Primary Rate Interface for large enterprise
T1: 23B + 1D
E1: 30B + 1D
PRI channels are typically used by medium to large enterprises with digital PBXs to provide them digital access to PSTN.
PRI is service and T1 is the hardware used for delivery. For eg. TE420 is one of the T1 hardware for PRI.
B - Channel : B stands for Bearer; It's an ISDN channel that carries data
D - Channel: D stands for Delta; It's an ISDN channel that carries control and signaling information
CSU/DSU : Channel Service Unit/Data Service Unit
=> It is a digital interface to connect DTE device, like router, to a digital circuit (eg. T1/E1 line)
=> It operates at physical layer of OSI model.