chan_dongle is third party code and no longer supported by its creator. It should not be used for anything missing critical.
The channel structure is defined in include/asterisk/channel.h. However note that it is possible that chan_dongle predates a big structural change in which most accesses to this structure were hidden behind methods, and you may have a major rewrite on your hands.
struct ast_channel contains all the driver independent information for a channel. ->tech_pvt is a pointer to a driver dependent structure that contains information about the state of the channel in the driver currently using that channel.
These are very key constructs in Asterisk internals, so anyone maintaining third party code needs to be familiar with them.
I apologize, but it is possible that you are confusing something.
In Asterisk version asterisk-18.21.0, in the file include/asterisk/channel.h, this structure is defined more than provisionally.
struct ast_channel;
(Line #952).
Alas, my compiler cannot obtain any useful and necessary information for its operation about the variables that make up the structure from this file.
Therefore, it is quite reasonable to complain about the incomplete definition. There’s nothing to even blame him for…
The only place I found a definition of this structure is in the file main/channel_internal_api.c.
But this is not a header file.
It is completely unclear why this such an important structure is defined not in the header, but in the code file, and what to do in this situation.
My mistake. I didn’t look carefully enough even though I didn’t expect to find it. The tech_pvt I found is a method, not an exposed field. I misread it as a field and assumed that, for some reason, it was still in that header. You basically still have all the fields, but they are functions, not fields.
To use the source code you have, you need to do major upgrades (which I think I also said), or use an obsolete, and unsupported Asterisk along with your unsupported channel driver.