AllStarLink / app_rpt

Refactoring and upgrade of AllStarLink's app_rpt, etc.
3 stars 2 forks source link

chan_beagle: Initial port to compile on current Asterisk. #319

Open InterLinked1 opened 2 months ago

InterLinked1 commented 2 months ago

There are still a few unresolved references to SND_PCCV stuff on my machine, but otherwise, this updates the code for current Asterisk APIs. The sample config has been moved out of the module itself into its own sample file.

Resolves: #280

InterLinked1 commented 2 months ago

Note re: unresolved references:

make[1]: Entering directory '/usr/src/asterisk-21.0.0/menuselect'
make[1]: 'makeopts' is up to date.
make[1]: Leaving directory '/usr/src/asterisk-21.0.0/menuselect'
   [CCi] chan_beagle.i -> chan_beagle.o
chan_beagle.c:170:34: error: ‘SND_PCCV_FORMAT_S16_LE’ undeclared here (not in a function); did you mean ‘SND_PCM_FORMAT_S16_LE’?
  170 | static snd_pcm_format_t format = SND_PCCV_FORMAT_S16_LE;
      |                                  ^~~~~~~~~~~~~~~~~~~~~~
      |                                  SND_PCM_FORMAT_S16_LE
chan_beagle.c: In function ‘alsa_card_init’:
chan_beagle.c:516:114: error: ‘SND_PCCV_STREAM_CAPTURE’ undeclared (first use in this function); did you mean ‘SND_PCM_STREAM_CAPTURE’?
  516 |                 ast_log(LOG_DEBUG, "Opening device %s in %s mode\n", dev, (stream == SND_PCCV_STREAM_CAPTURE) ? "read" : "write");
      |                                                                                                                  ^~~~~~~~~~~~~~~~~
      |                                                                                                                  SND_PCM_STREAM_CAPTURE
chan_beagle.c:516:114: note: each undeclared identifier is reported only once for each function it appears in
chan_beagle.c:614:23: error: ‘SND_PCCV_STREAM_PLAYBACK’ undeclared (first use in this function); did you mean ‘SND_PCM_STREAM_PLAYBACK’?
  614 |         if (stream == SND_PCCV_STREAM_PLAYBACK)
      |                       ^~~~~~~~~~~~~~~~~~~~~~~~
      |                       SND_PCM_STREAM_PLAYBACK
chan_beagle.c: In function ‘load_module’:
chan_beagle.c:1909:48: error: ‘SND_PCCV_STREAM_CAPTURE’ undeclared (first use in this function); did you mean ‘SND_PCM_STREAM_CAPTURE’?
 1909 |         alsa.icard = alsa_card_init("default", SND_PCCV_STREAM_CAPTURE);
      |                                                ^~~~~~~~~~~~~~~~~~~~~~~
      |                                                SND_PCM_STREAM_CAPTURE
chan_beagle.c:1910:48: error: ‘SND_PCCV_STREAM_PLAYBACK’ undeclared (first use in this function); did you mean ‘SND_PCM_STREAM_PLAYBACK’?
 1910 |         alsa.ocard = alsa_card_init("default", SND_PCCV_STREAM_PLAYBACK);
      |                                                ^~~~~~~~~~~~~~~~~~~~~~~~
      |                                                SND_PCM_STREAM_PLAYBACK
make[1]: *** [/usr/src/asterisk-21.0.0/Makefile.rules:150: chan_beagle.o] Error 1
make: *** [Makefile:396: channels] Error 2
KB4MDD commented 2 months ago

Out of curiosity I did a search on Google and GitHub and SND_PCCV_FORMAT_S16_LE and SND_PCCV_STREAM_PLAYBACK did not find any matches.

InterLinked1 commented 2 months ago

Out of curiosity I did a search on Google and GitHub and SND_PCCV_FORMAT_S16_LE and SND_PCCV_STREAM_PLAYBACK did not find any matches.

Yeah, me neither - the suggested match for some was SND_PCM instead of SND_PCCV but I didn't want to make any change until we knew a little bit more.