traud / asterisk-amr

Asterisk 13 transcoding module: AMR-WB
The Unlicense
33 stars 19 forks source link

Compilation fails on Asterisk 14.7.6 #14

Closed sotoz closed 6 years ago

sotoz commented 6 years ago

Hello, I'm trying to build Asterisk 14.7.6 (debian 9) and after applying the patch, I get this on my make

# make
   [CC] res_pjsip_dialog_info_body_generator.c -> res_pjsip_dialog_info_body_generator.o
   [LD] res_pjsip_dialog_info_body_generator.o -> res_pjsip_dialog_info_body_generator.so
   [CC] res_format_attr_amr.c -> res_format_attr_amr.o
res_format_attr_amr.c: In function ‘amr_getjoint’:
res_format_attr_amr.c:397:17: error: ‘ast_format_amrwb’ undeclared (first use in this function)
  if (format1 == ast_format_amrwb || format1 == ast_format_amr) {
                 ^~~~~~~~~~~~~~~~
res_format_attr_amr.c:397:17: note: each undeclared identifier is reported only once for each function it appears in
res_format_attr_amr.c:397:48: error: ‘ast_format_amr’ undeclared (first use in this function)
  if (format1 == ast_format_amrwb || format1 == ast_format_amr) {
                                                ^~~~~~~~~~~~~~
/usr/src/asterisk-14.7.6/Makefile.rules:149: recipe for target 'res_format_attr_amr.o' failed
make[1]: *** [res_format_attr_amr.o] Error 1
Makefile:367: recipe for target 'res' failed
make: *** [res] Error 2

What could be the problem?

traud commented 6 years ago

Asterisk 14 is not supported because of issue #12. Therefore, please, upgrade to Asterisk 15 or the latest master branch – or go back to Asterisk 13. If you really need Asterisk 14, you have to add that patch which is attached to ASTERISK-27850…

Anyway, that is not the cause of your issue. ast_format_amr(wb) are defined in the file include/asterisk/format_cache.h, which was changed by codec_amr.patch. Therefore, please, have a look at that header file: Is ast_format_amr included there? If not, which failures/errors do you get, when you apply that patch.

sotoz commented 6 years ago

Hello, I managed to make it work by reapplying the patches in a fresh installation. I also patched asterisk with this https://gerrit.asterisk.org/#/c/asterisk/+/8968/1/main/rtp_engine.c to make it work with Asterisk 14.

The problem that I'm facing now is this:

[2018-07-20 07:58:02] WARNING[23540]: res_pjsip_sdp_rtp.c:1283 create_outgoing_sdp_stream: Unable to get rtp codec payload code for amrwb
[2018-07-20 07:58:03] WARNING[23540]: channel.c:5661 set_format: Unable to find a codec translation path: (alaw) -> (amrwb)
[2018-07-20 07:58:03] WARNING[23540]: channel.c:5661 set_format: Unable to find a codec translation path: (amrwb) -> (alaw)

Is this related to #12 ?

traud commented 6 years ago

You applied already the patch/fix for issue #12. If you still face the same symptoms, you applied it wrongly or more is broken in Asterisk 14. I do not support Asterisk 14 anymore because it receives only security fixes. Any reason not to go for the latest Asterisk 13 or Asterisk 15?

sotoz commented 6 years ago

Well, I have a backend application that works with the AMI/AGI/ARI and I am not sure if switching to 13 or 15 will break things. In general what is the problem behind a "Unable to find a codec translation path"? Is it related that asterisk cannot find the transcoder for amr? If yes, is there a possibility to use it with just passthrough?

traud commented 6 years ago

The reason/cause has to be analyzed. Could be anything. The cause in #12 was a silly typo somewhere totally different in the Asterisk code. Asterisk 14 does not receive any security updates after 26th of September. Consequently, you should change in the next eight weeks anyway.

You could try rtp_use_dynamic=no in your configuration file sip.conf. Then you do a sip reload on the command-line interface (CLI; or restart your whole Asterisk).

I am closing this because Asterisk 14 is not supported by me. If you are able to reproduce this issue in the latest Asterisk 13, Asterisk 15, or newer, please, re-open this issue report.