Dahdi, Inbound CallerID and Delays (SOLVED)

Yes you can disabled the callerid per channel. And you are right you can put any setting above the Channel => string to affect that channel. If you dont put anything that measn the next channel will inherit the settings.

Hi Navaismo,

I did think that I could disable per channel but all my attempts have come up empty.
I even tried to put stuff in the System settings using
"usecallerid=yes,1-2"
“usecallerid=no,3-4”

This seemed to be a logical format given the current file layout but again no worthwhile results. Though I forget what effect it had.
I am not sure how the files are used and in what order the data is extracted.

Is there any tools that would simulate an incoming call event and give some verbose debug output of the flow and order of processing.?

I did notice that adding and then deleting bits from the System settings in the Dahdi Module seemed to leave the entry in the database with a value of 1, I had to manually remove those or they were inserted in /etc/dahdi/system.conf on each setting rebuild.

I am not trying to be lazy and be spoon fed a solution, I may have to find the dahdi source and step thru it to get a better understanding but I was hoping someone had already done that.!!

Many thanks for the comments and assistance so far.
Hv.

Should be something like(I’m a little rusty with dahdi):

usecallerid = yes
callerid=asreceived
dahdichan => 1,2

usecallerid =no
dahdichan => 3,4

1 Like

Hi Navaismo,

I see you used the dahdichan => 1,2 format.
So I gave that a go.
Still no joy.

These were the current files.

They all contain the normal #includes but removed here for clarity.

; ########################
IN chan_dahdi.conf:
; ########################
[general]

[channels]
language=en
busydetect=yes
busycount=5
usecallerid=yes
callwaiting=yes
usecallingpres=no
threewaycalling=no
transfer=no
cancallforward=no
callreturn=no
echocancel=yes
echocancelwhenbridged=no
echotraining=800
immediate=yes
faxdetect=no
rxgain=4.5
txgain=3.5

; ########################

; ########################
IN chan_dahdi_groups.conf:
; ########################
signalling=fxs_ks
context=from-analog
group=0
channel=>1

signalling=fxs_ks
context=from-analog
group=0
channel=>2

signalling=fxs_ks
context=from-analog
group=0
channel=>3

signalling=fxs_ks
context=from-analog
group=0
channel=>4
; ########################

; ########################
IN chan_dahdi_channels_custom.conf:
; ########################
usecallerid=yes
cidstart=polarity
cidsignalling=v23
callerid=asreceived
immediate=no
channel => 1
channel => 2

usecallerid=no
cidstart=polarity
cidsignalling=v23
callerid=NoCli<01234567890>
immediate=yes
channel => 3
channel => 4

; Without this next part included ALL CHANNELS will pass “NoCli<01234567890>”
; thru to asterisk. And yet it is only supposed to be setting 3 & 4.
callerid=
; ########################

; ########################
ALTERNATE ATTEMPT
IN chan_dahdi_channels_custom.conf:
; ########################
usecallerid=yes
cidstart=polarity
cidsignalling=v23
callerid=asreceived
immediate=no
dahdichan => 1,2

usecallerid=no
cidstart=polarity
cidsignalling=v23
callerid=NoCli<01234567890>
immediate=yes
dahdichan => 3,4
; ########################

It all look like it should be correct but I must be missing something dam obvious to someone.

Hv.

Not sure if in the new version of FreePBX you can edit the chan_dahdi but I suggest to delete all include files and only use one configuration file either dahdi-channels or chan_dahdi I always hated the way that free pbx include many files for dahdi stuff. Try to use only one file and set there all the settings and remove any include.

1 Like

+1 @navaismo but make sure the “dahdi helper” is disabled or uninstalled in modules or a reload will BYITA.

Hi Navaisom & Dicko,

Many thanks for the continued assistance.
As it is a live system I wont touch it till later but shall attempt the above then.

Am I right in thinking I should remove the Dahdi module from freePbx and then just place all my required config in a single chan_dahdi.conf file in the etc/asterisk folder.

Sounds like a plan, as it does feel like my custom settings are being misplaced somewhere in the process. Just for a test I put in a dummy [section] just after my stuff in the custom file and that thru a right spanner in the works loosing all the context and other default setting I guess. Wish I could find the section in the source that deals with this so I could step thru it and know for sure.

I shall report back when I try that single file stuff later.

Hv.

This covers the config in detail

http://doxygen.asterisk.org/trunk/chan_dahdi.conf.html

I’ve found that the DAHDI module in FreePBX doesn’t always play nice when you are trying to do things using custom config files. Sometimes, it gets it all right - sometimes not. Since it’s hit or miss for me, I just do whatever it takes to get it working and press on from there.

Hey Dicko,

Great tip.! RTFM.
I had read that several times
but have made some subtle errors because I did not read it again.!

Once I get back later I shall see what I can mash together.

Looks promising though.
With the right words anything is possible.

Hv.

While it might be frustrating that you’re not getting the answers you are looking for here, as quickly as one would hope, remember two things:

  1. DAHDI is a Digium product, and it therefore outside the scope of both Asterisk and FreePBX. This is a FreePBX forum.

  2. DAHDI is arcane and overly complicated - instead of splitting it into a series of executables that work for different classes of devices, it is all just thrown in together and managed through a series of “completely different from everything else” configuration files that are neither internally consistent or completely backwards compatible. Things that work in subversion 10 don’t always work in sub-version 11.

Setting up DAHDI configs is one of those things that you never revisit once it’s working, and (for me anyway) is something that I don’t do very often. I might set up one or two of these a year, and I always use the same configuration and cards, so the two months I spent figuring out the crap 10 years ago isn’t right on the tips of my fingers.

For a similar solution from a respected source:-

Hey Dave,
Everything is right on target so far, the help has been perfect.

I know it is not the right forum but I thought it was worth the punt.
Plus if it gets resolved it may help others in the future.

Cheers for the second link Dicko, will have a read later as I really must jump in the shower and start my day ! been putting it off but the time has come.

Hv.

Right,
Shutters down so I can play with the phones.

Had a brain wave, or 30 seconds of Clairvoyance.
Turned out to be very simple in the end.

Looking at the files that are included after the “chan_dahdi_channels_custom.conf”.

Like “chan_dahdi_groups.conf” and “chan_dahdi_additional.conf”

That Groups file is also doing some channel setting, curse you.
So custom stuff has to go at the far end of the chain.

I think the problem is that the last file that is included in the chan_dahdi.conf file
is an auto generated file by freepbx, with advice not to edit it.
And the include ordering is also generated by freepbx, with advice not to edit it.

The last one on the list is "chan_dahdi_additional.conf"
I have no idea what part of the module writes to this file, extensions I think I saw, but I found putting my specific line settings in this file to work peachy.
I guess if the custom file was the last to be included then it would give a more logical flow to things giving the user the final say on settings.

I can understand now why it is easy to misconfigure dahdi.

Oh by the way, doing the Right button, “Restart Dahdi/Asterisk”, does not overwrite any files so it was easy to make a couple of edits without removing the module.
Now to click Write disable.

98% of the way there, just have to top up 2% on the understanding.
I am going to read the links you gave and see what I need to adjust or an alternate method to use the custom file to avoid freepbx overwrites.
Or I could uninstall the module, 50/50 at this point.

For reference this is what was in my “chan_dahdi_additional.conf” File
Although I am not sure of the use of immediate=…

;--------------------------------------------------------------------------------;
; Do NOT edit this file as it is auto-generated by FreePBX. ;
;--------------------------------------------------------------------------------;
usecallerid=yes
callerid=asreceived
cidstart=polarity
cidsignalling=v23
immediate=no
channel => 1-2
;
usecallerid=no
callerid=NoCli<01234567890>
immediate=yes
channel => 3-4

callerid=asreceived
;
;callerid=

To be polite and display some housekeeping I should blank the fields I used at the end. Like:
usecallerid=
callerid=
cidstart=
cidsignalling=
immediate=

Seems to be the preferred practice.

Needless to say thanks to Dave and Dicko for their assistance.
Hope to repay the favour sometime.

Hv.

careful to read the:

a FreePBX reload will unset your changes as the dahdi helper module will overwrite the /etc/dahdi/system.conf and the /etc/asterisk/dahdi*.conf files except the custom ones. Best to disable the helper and go simple with one dahdi.conf file. JMHO

1 Like

Hey Dicko,

Just going to do a reboot and see the damage,
But you are right, the module would appear to play no purpose apart from writing the files. If that is the case then goodbye module.

Hv.

Hey All,
Just a final follow up.
I disabled the writes on the module
did a reboot and the settings vanished.!
But then I pasted them back in and also included them in the groups file.
Done several reboots and seems to hold the change.

Not doubting you at all Dicko, better out than in if it serves no real purpose but the machine is remote so one step at a time. The worse that will happen is the two lines stop producing callerid as default everything is set to answer quickly.

Oops, still not read the manual, I’ll wait till it breaks again maybe.

On an additional note for some extra trickery.
This was my final file, I remove the cidsignaling as I was not convinced it gave the desired result.

;--------------------------------------------------------------------------------;
; Do NOT edit this file as it is auto-generated by FreePBX. ;
;--------------------------------------------------------------------------------;
usecallerid=yes
callerid=asreceived
;cidstart=polarity
;cidsignalling=v23
immediate=no
channel => 1-2

usecallerid=no
immediate=yes
callerid=“NoCli” <1473>
channel => 3
callerid=“NoCli” <1474>
channel => 4

usecallerid=
callerid=
cidstart=
cidsignalling=
immediate=

Not sure on those quotes round the NoCli.! RTFM steve…

I then have outbound routes that filter 1471 thru 1474 and dial the required 1417 on the relevant line. Now they simply hit redial to find the last callers ID on those two lines.

Hopefull that’s all folks.
Thanks again for reading and taking part.

Hv.

You should be able to disable or enable caller id per device in the dahdi module, but, it might just be easier for you to go to module admin and disable the module there (don’t uninstall it, just disable it)

Then it’ll never update your DAHDi settings again!

Hey Rob,

No worries, I may do that in a day or two as I will be up close to the box later in the week (being Friday !).

I do not mind waiting as it would be interesting to see if Fpbx hijacks the files at any point.

But it all works as I would hope at this point so
I am Stoked and I can now find other issues to fix.!

Hv.

If it’s going to do it, it’ll happen when you click ‘reload’ or run ‘fwconsole restart’.

In associated news, the Dahdi configuration module is due to be re-written in FreePBX 14, so this’ll be a lot less messy in the future.