Troubleshooting the CalllerID issue in the FXO cards in Asteirsk
The following section will discuss how Caller ID detection works in Asterisk and the different options that you have avaialble.
In Asterisk, the CallerID detection is done by the chan_dahdi module. Normally its configuration file is located on/etc/asterisk/chan_dahdi.conf and there are three variables that control how the feature works:
usecallerid: Sets whether to use caller ID, "yes" or "no" are the only available options
cidsignalling: Determine type of caller ID signaling in use. The Caller ID signaling types supported by Asterisk are:
bell: bell202 as used in US (default)
v23: v23 as used in the UK
v23_jp: v23 as used in Japan
dtmf: DTMF as used in Denmark, Sweden and Netherlands
smdi: Use SMDI for caller ID. Requires SMDI to be enabled
cidstart: Determine signals the start of caller ID. The options supported by Asterisk are:
ring: A ring signals the start (default)
polarity: Polarity reversal signals the start
polarity_IN: Polarity reversal signals the start, DTMF dialtone detection in India
dtmf: DTMF Caller ID spill begins only with DTMF, at various times before the ring. This causes Asterisk to constantly listen for DTMF CallerID signals on the specified channels
If cidstart is configured to use dtmf, the energy level on the line may need to be tuned to properly identify the DTMF tones. This tuning is done with the dtmfcidlevel configuration option. The specified value is compared to the average over a packet of audio level of the absolute value of 16 bit signed linear samples. The default is set to 256, but this is completely arbitrary. It must be set high enough to prevent false detections, while low enough to ensure no dtmf spills are missed.
useincomingcalleridondahditransfer = yes
callerid = asreceived
sendcalleridafter = 2
Wctdm.c patch by Openvox team
1) you MUST subscribe callerid from your provider.
2) you MUST know the format of callerid(dtmf or fsk). you can ask your provider for that info, if you do not know that.
3) this patch ONLY supports callerid with DTMF format.
4) you MUST know how the callerid is sent(beforeing first ring, or after first ring). You can hear that.
5) you SHOULD know how to compile dahdi and asterisk.
1) download the patch from https://downloads.openvox.cn/pub/drivers/callerid_patches/
download based on your dahdi version to be installed , un tar the file , u can see filename wctdm.c
2) If it is wctdm.c, you replace original wctdm.c(under dahdi-2.5.X/linux/drivers/dahdi) with the newpatched wctdm.c.
3) run command: make all, make install. after rebooting it, you can edit the chan_dahdi.conf and load the module by:
1) you MUST change the two parameters in zapata.conf to this:
cidsignalling=dtmf // MUST BE dtmf
cidstart=polarity // MUST BE polarity
2) modprobe dahdi // load dahdi driver
Optional changes which also have imapact in callerid
The average analog line uses what is called FSK caller ID. This sends the CID info via the FSK format. Now in some areas the CID info is sent through DTMF tones; these are the same tones you use to navigate an IVR.
Below is the steps to enable DTMF CID in Asterisk and Wanpipe.
Add the line "RM_FAKE_POLARITY = YES" into/etc/wanpipe/wanpipe*.confin the wanpipeX section.
Add "cidsignalling=dtmf" and "cidstart=polarity" into/etc/asterisk/chan_dahdi.conf