diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/apps/app_confbridge.c asterisk-18.12.0~dfsg+~cs6.12.40431413/apps/app_confbridge.c --- asterisk-18.11.2~dfsg+~cs6.10.40431413/apps/app_confbridge.c 2022-04-14 21:53:34.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/apps/app_confbridge.c 2022-05-12 11:50:59.000000000 +0000 @@ -131,6 +131,11 @@ + + 16.19.0 + 18.5.0 + 19.0.0 + Kicks channel(s) from the requested ConfBridge. @@ -2720,17 +2725,24 @@ ast_autoservice_stop(chan); } - /* Play the Join sound to both the conference and the user entering. */ if (!quiet) { const char *join_sound = conf_get_sound(CONF_SOUND_JOIN, conference->b_profile.sounds); - if (strcmp(conference->b_profile.language, ast_channel_language(chan))) { - ast_stream_and_wait(chan, join_sound, ""); + /* if hear_own_join_sound is enabled play the Join sound to everyone */ + if (ast_test_flag(&user.u_profile, USER_OPT_HEAR_OWN_JOIN_SOUND) ) { + if (strcmp(conference->b_profile.language, ast_channel_language(chan))) { + ast_stream_and_wait(chan, join_sound, ""); + ast_autoservice_start(chan); + play_sound_file(conference, join_sound); + ast_autoservice_stop(chan); + } else { + async_play_sound_file(conference, join_sound, chan); + } + /* if hear_own_join_sound is disabled only play the Join sound to just the conference */ + } else { ast_autoservice_start(chan); play_sound_file(conference, join_sound); ast_autoservice_stop(chan); - } else { - async_play_sound_file(conference, join_sound, chan); } } diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/apps/app_dial.c asterisk-18.12.0~dfsg+~cs6.12.40431413/apps/app_dial.c --- asterisk-18.11.2~dfsg+~cs6.10.40431413/apps/app_dial.c 2022-04-14 21:53:34.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/apps/app_dial.c 2022-05-12 11:50:59.000000000 +0000 @@ -86,6 +86,7 @@ If you need more than one enter them as Technology2/Resource2&Technology3/Resource3&..... + Specifies the number of seconds we attempt to dial the specified devices. @@ -613,12 +614,31 @@ This is the status of the call - - - - - - + + Either the dialed peer exists but is not currently reachable, e.g. + endpoint is not registered, or an attempt was made to call a + nonexistent location, e.g. nonexistent DNS hostname. + + + Channel or switching congestion occured when routing the call. + This can occur if there is a slow or no response from the remote end. + + + Called party did not answer. + + + The called party was busy or indicated a busy status. + Note that some SIP devices will respond with 486 Busy if their Do Not Disturb + modes are active. In this case, you can use DEVICE_STATUS to check if the + endpoint is actually in use, if needed. + + + The call was answered. + Any other result implicitly indicates the call was not answered. + + + Dial was cancelled before call was answered or reached some other terminating event. + For the Privacy and Screening Modes. Will be set if the called party chooses to send the calling party to the 'Go Away' script. @@ -627,7 +647,9 @@ For the Privacy and Screening Modes. Will be set if the called party chooses to send the calling party to the 'torture' script. - + + Dial failed due to invalid syntax. + @@ -2586,9 +2608,11 @@ struct ast_channel *tc; /* channel for this destination */ char *number; char *tech; + int i; size_t tech_len; size_t number_len; struct ast_stream_topology *topology; + struct ast_stream *stream; cur = ast_strip(cur); if (ast_strlen_zero(cur)) { @@ -2654,6 +2678,21 @@ ast_channel_unlock(chan); + for (i = 0; i < ast_stream_topology_get_count(topology); ++i) { + stream = ast_stream_topology_get_stream(topology, i); + /* For both recvonly and sendonly the stream state reflects our state, that is we + * are receiving only and we are sending only. Since we are requesting a + * channel for the peer, we need to swap this to reflect what we will be doing. + * That is, if we are receiving from Alice then we want to be sending to Bob, + * so swap recvonly to sendonly and vice versa. + */ + if (ast_stream_get_state(stream) == AST_STREAM_STATE_RECVONLY) { + ast_stream_set_state(stream, AST_STREAM_STATE_SENDONLY); + } else if (ast_stream_get_state(stream) == AST_STREAM_STATE_SENDONLY) { + ast_stream_set_state(stream, AST_STREAM_STATE_RECVONLY); + } + } + tc = ast_request_with_stream_topology(tmp->tech, topology, NULL, chan, tmp->number, &cause); ast_stream_topology_free(topology); @@ -3602,4 +3641,4 @@ .load = load_module, .unload = unload_module, .requires = "ccss", -); \ No newline at end of file +); diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/apps/app_dtmfstore.c asterisk-18.12.0~dfsg+~cs6.12.40431413/apps/app_dtmfstore.c --- asterisk-18.11.2~dfsg+~cs6.10.40431413/apps/app_dtmfstore.c 2022-04-14 21:53:34.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/apps/app_dtmfstore.c 2022-05-12 11:50:59.000000000 +0000 @@ -41,6 +41,11 @@ /*** DOCUMENTATION + + 16.20.0 + 18.6.0 + 19.0.0 + Stores DTMF digits transmitted or received on a channel. diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/apps/app_meetme.c asterisk-18.12.0~dfsg+~cs6.12.40431413/apps/app_meetme.c --- asterisk-18.11.2~dfsg+~cs6.10.40431413/apps/app_meetme.c 2022-04-14 21:53:34.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/apps/app_meetme.c 2022-05-12 11:50:59.000000000 +0000 @@ -4761,7 +4761,7 @@ } } if (!var) { - ast_debug(1, "%s isn't a valid conference\n", confno); + ast_log(LOG_WARNING, "%s isn't a valid conference\n", confno); } ast_config_destroy(cfg); } @@ -5239,7 +5239,9 @@ if (ast_strlen_zero(data)) { ast_log(LOG_WARNING, "MeetMeAdmin requires an argument!\n"); - pbx_builtin_setvar_helper(chan, "MEETMEADMINSTATUS", "NOPARSE"); + if (chan) { + pbx_builtin_setvar_helper(chan, "MEETMEADMINSTATUS", "NOPARSE"); + } return -1; } @@ -5248,7 +5250,9 @@ if (!args.command) { ast_log(LOG_WARNING, "MeetmeAdmin requires a command!\n"); - pbx_builtin_setvar_helper(chan, "MEETMEADMINSTATUS", "NOPARSE"); + if (chan) { + pbx_builtin_setvar_helper(chan, "MEETMEADMINSTATUS", "NOPARSE"); + } return -1; } @@ -5261,7 +5265,9 @@ if (!cnf) { ast_log(LOG_WARNING, "Conference number '%s' not found!\n", args.confno); AST_LIST_UNLOCK(&confs); - pbx_builtin_setvar_helper(chan, "MEETMEADMINSTATUS", "NOTFOUND"); + if (chan) { + pbx_builtin_setvar_helper(chan, "MEETMEADMINSTATUS", "NOTFOUND"); + } return 0; } @@ -5384,7 +5390,9 @@ AST_LIST_UNLOCK(&confs); dispose_conf(cnf); - pbx_builtin_setvar_helper(chan, "MEETMEADMINSTATUS", res == -2 ? "NOTFOUND" : res ? "FAILED" : "OK"); + if (chan) { + pbx_builtin_setvar_helper(chan, "MEETMEADMINSTATUS", res == -2 ? "NOTFOUND" : res ? "FAILED" : "OK"); + } return 0; } diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/apps/app_mf.c asterisk-18.12.0~dfsg+~cs6.12.40431413/apps/app_mf.c --- asterisk-18.11.2~dfsg+~cs6.10.40431413/apps/app_mf.c 2022-04-14 21:53:34.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/apps/app_mf.c 2022-05-12 11:50:59.000000000 +0000 @@ -42,6 +42,11 @@ /*** DOCUMENTATION + + 16.21.0 + 18.7.0 + 19.0.0 + Detects MF digits on a channel and saves them to a variable. @@ -113,6 +118,11 @@ + + 16.21.0 + 18.7.0 + 19.0.0 + Sends arbitrary MF digits on the current or specified channel. @@ -151,6 +161,11 @@ + + 16.21.0 + 18.7.0 + 19.0.0 + Play MF digit on a specific channel. @@ -226,7 +241,7 @@ * \param maxdigits If greater than 0, only read this many digits no matter what * * \retval 0 if successful - * \retval -1 if unsuccessful. + * \retval -1 if unsuccessful (including hangup). */ static int read_mf_digits(struct ast_channel *chan, char *buf, int buflen, int timeout, int features, int laxkp, int override, int no_kp, int no_st, int maxdigits) { struct ast_dsp *dsp; @@ -236,6 +251,7 @@ int digits_read = 0; int is_start_digit = 0; char *str = buf; + int res = 0; if (!(dsp = ast_dsp_new())) { ast_log(LOG_WARNING, "Unable to allocate DSP!\n"); @@ -318,11 +334,12 @@ } } else { pbx_builtin_setvar_helper(chan, "RECEIVEMFSTATUS", "HANGUP"); + res = -1; } } ast_dsp_free(dsp); ast_debug(3, "channel '%s' - event loop stopped { timeout: %d, remaining_time: %d }\n", ast_channel_name(chan), timeout, remaining_time); - return 0; + return res; } static int read_mf_exec(struct ast_channel *chan, const char *data) @@ -334,7 +351,7 @@ struct ast_flags flags = {0}; char *optargs[OPT_ARG_ARRAY_SIZE]; char *argcopy = NULL; - int features = 0, maxdigits = 0; + int res, features = 0, maxdigits = 0; AST_DECLARE_APP_ARGS(arglist, AST_APP_ARG(variable); @@ -392,15 +409,15 @@ features |= DSP_DIGITMODE_RELAXDTMF; } - read_mf_digits(chan, tmp, BUFFER_SIZE, to, features, (ast_test_flag(&flags, OPT_LAX_KP)), + res = read_mf_digits(chan, tmp, BUFFER_SIZE, to, features, (ast_test_flag(&flags, OPT_LAX_KP)), (ast_test_flag(&flags, OPT_KP_OVERRIDE)), (ast_test_flag(&flags, OPT_NO_KP)), (ast_test_flag(&flags, OPT_NO_ST)), maxdigits); pbx_builtin_setvar_helper(chan, arglist.variable, tmp); if (!ast_strlen_zero(tmp)) { ast_verb(3, "MF digits received: '%s'\n", tmp); - } else { + } else if (!res) { /* if channel hung up, don't print anything out */ ast_verb(3, "No MF digits received.\n"); } - return 0; + return res; } static int sendmf_exec(struct ast_channel *chan, const char *vdata) diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/apps/app_queue.c asterisk-18.12.0~dfsg+~cs6.12.40431413/apps/app_queue.c --- asterisk-18.11.2~dfsg+~cs6.10.40431413/apps/app_queue.c 2022-04-14 21:53:34.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/apps/app_queue.c 2022-05-12 11:50:59.000000000 +0000 @@ -185,10 +185,6 @@ - + + + + @@ -217,14 +230,6 @@ Allow the calling user to write the conversation to disk via Monitor. - - + + 16.24.0 + 18.10.0 + 19.2.0 + Receive a Text Message on a channel. diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/apps/app_sf.c asterisk-18.12.0~dfsg+~cs6.12.40431413/apps/app_sf.c --- asterisk-18.11.2~dfsg+~cs6.10.40431413/apps/app_sf.c 2022-04-14 21:53:34.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/apps/app_sf.c 2022-05-12 11:50:59.000000000 +0000 @@ -42,6 +42,11 @@ /*** DOCUMENTATION + + 16.24.0 + 18.10.0 + 19.2.0 + Detects SF digits on a channel and saves them to a variable. @@ -107,6 +112,11 @@ + + 16.24.0 + 18.10.0 + 19.2.0 + Sends arbitrary SF digits on the current or specified channel. @@ -155,6 +165,21 @@ static const char *readsf_name = "ReceiveSF"; static const char sendsf_name[] = "SendSF"; +/*! + * \brief Detects SF digits on channel using DSP + * + * \param chan channel on which to read digits + * \param buf Buffer in which to store digits + * \param buflen Size of buffer + * \param timeout ms to wait for all digits before giving up + * \param maxdigits Maximum number of digits + * \param freq Frequency to use + * \param features DSP features + * \param extrapulses Whether to recognize extra pulses + * + * \retval 0 if successful + * \retval -1 if unsuccessful (including hangup). + */ static int read_sf_digits(struct ast_channel *chan, char *buf, int buflen, int timeout, int maxdigits, int freq, int features, int extrapulses) { /* Bell System Technical Journal 39 (Nov. 1960) */ #define SF_MIN_OFF 25 @@ -169,6 +194,7 @@ char *str = buf; int hits = 0, digits_read = 0; unsigned short int sf_on = 0; + int res = 0; if (!(dsp = ast_dsp_new())) { ast_log(LOG_WARNING, "Unable to allocate DSP!\n"); @@ -261,7 +287,7 @@ ast_debug(2, "Got more than 10 pulses, truncating to 10\n"); hits = 0; /* 10 dial pulses = digit 0 */ *str++ = hits + '0'; - } + } } else { if (hits == 10) { hits = 0; /* 10 dial pulses = digit 0 */ @@ -281,13 +307,14 @@ ast_frfree(frame); } else { pbx_builtin_setvar_helper(chan, "RECEIVESFSTATUS", "HANGUP"); + res = -1; } } if (dsp) { ast_dsp_free(dsp); } ast_debug(3, "channel '%s' - event loop stopped { timeout: %d, remaining_time: %d }\n", ast_channel_name(chan), timeout, remaining_time); - return 0; + return res; } static int read_sf_exec(struct ast_channel *chan, const char *data) @@ -297,7 +324,7 @@ double tosec; struct ast_flags flags = {0}; char *argcopy = NULL; - int features = 0, digits = 0, to = 0, freq = 2600; + int res, features = 0, digits = 0, to = 0, freq = 2600; AST_DECLARE_APP_ARGS(arglist, AST_APP_ARG(variable); @@ -360,14 +387,14 @@ features |= DSP_DIGITMODE_RELAXDTMF; } - read_sf_digits(chan, tmp, BUFFER_SIZE, to, digits, freq, features, ast_test_flag(&flags, OPT_EXTRAPULSES)); + res = read_sf_digits(chan, tmp, BUFFER_SIZE, to, digits, freq, features, ast_test_flag(&flags, OPT_EXTRAPULSES)); pbx_builtin_setvar_helper(chan, arglist.variable, tmp); if (!ast_strlen_zero(tmp)) { ast_verb(3, "SF digits received: '%s'\n", tmp); - } else { + } else if (!res) { /* if channel hung up, don't print anything out */ ast_verb(3, "No SF digits received.\n"); } - return 0; + return res; } static int sendsf_exec(struct ast_channel *chan, const char *vdata) diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/apps/app_waitforcond.c asterisk-18.12.0~dfsg+~cs6.12.40431413/apps/app_waitforcond.c --- asterisk-18.11.2~dfsg+~cs6.10.40431413/apps/app_waitforcond.c 2022-04-14 21:53:34.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/apps/app_waitforcond.c 2022-05-12 11:50:59.000000000 +0000 @@ -39,6 +39,11 @@ /*** DOCUMENTATION + + 16.20.0 + 18.6.0 + 19.0.0 + Wait (sleep) until the given condition is true. diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/apps/confbridge/conf_config_parser.c asterisk-18.12.0~dfsg+~cs6.12.40431413/apps/confbridge/conf_config_parser.c --- asterisk-18.11.2~dfsg+~cs6.10.40431413/apps/confbridge/conf_config_parser.c 2022-04-14 21:53:34.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/apps/confbridge/conf_config_parser.c 2022-05-12 11:50:59.000000000 +0000 @@ -97,6 +97,9 @@ Silence enter/leave prompts and user intros for this user + + Determines if the user also hears the join sound when they enter a conference + Sets if the number of users should be announced to the user @@ -1574,6 +1577,9 @@ ast_cli(a->fd,"Quiet: %s\n", u_profile.flags & USER_OPT_QUIET ? "enabled" : "disabled"); + ast_cli(a->fd,"Hear Join: %s\n", + u_profile.flags & USER_OPT_HEAR_OWN_JOIN_SOUND ? + "enabled" : "disabled"); ast_cli(a->fd,"Wait Marked: %s\n", u_profile.flags & USER_OPT_WAITMARKED ? "enabled" : "disabled"); @@ -2396,6 +2402,7 @@ aco_option_register(&cfg_info, "startmuted", ACO_EXACT, user_types, "no", OPT_BOOLFLAG_T, 1, FLDSET(struct user_profile, flags), USER_OPT_STARTMUTED); aco_option_register(&cfg_info, "music_on_hold_when_empty", ACO_EXACT, user_types, "no", OPT_BOOLFLAG_T, 1, FLDSET(struct user_profile, flags), USER_OPT_MUSICONHOLD); aco_option_register(&cfg_info, "quiet", ACO_EXACT, user_types, "no", OPT_BOOLFLAG_T, 1, FLDSET(struct user_profile, flags), USER_OPT_QUIET); + aco_option_register(&cfg_info, "hear_own_join_sound", ACO_EXACT, user_types, "yes", OPT_BOOLFLAG_T, 1, FLDSET(struct user_profile, flags), USER_OPT_HEAR_OWN_JOIN_SOUND); aco_option_register_custom(&cfg_info, "announce_user_count_all", ACO_EXACT, user_types, "no", announce_user_count_all_handler, 0); aco_option_register(&cfg_info, "announce_user_count", ACO_EXACT, user_types, "no", OPT_BOOLFLAG_T, 1, FLDSET(struct user_profile, flags), USER_OPT_ANNOUNCEUSERCOUNT); /* Negative logic. Defaults to "yes" and evaluates with ast_false(). If !ast_false(), USER_OPT_NOONLYPERSON is cleared */ diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/apps/confbridge/include/confbridge.h asterisk-18.12.0~dfsg+~cs6.12.40431413/apps/confbridge/include/confbridge.h --- asterisk-18.11.2~dfsg+~cs6.10.40431413/apps/confbridge/include/confbridge.h 2022-04-14 21:53:34.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/apps/confbridge/include/confbridge.h 2022-05-12 11:50:59.000000000 +0000 @@ -70,6 +70,7 @@ USER_OPT_ECHO_EVENTS = (1 << 18), /*!< Send events only to the admin(s) */ USER_OPT_TEXT_MESSAGING = (1 << 19), /*!< Send text messages to the user */ USER_OPT_ANSWER_CHANNEL = (1 << 20), /*!< Sets if the channel should be answered if currently unanswered */ + USER_OPT_HEAR_OWN_JOIN_SOUND = (1 << 21), /*!< Set if the caller should hear the join sound */ }; enum bridge_profile_flags { diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/asterisk-18.11.2-summary.html asterisk-18.12.0~dfsg+~cs6.12.40431413/asterisk-18.11.2-summary.html --- asterisk-18.11.2~dfsg+~cs6.10.40431413/asterisk-18.11.2-summary.html 2022-04-14 21:53:34.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/asterisk-18.11.2-summary.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,46 +0,0 @@ -Release Summary - asterisk-18.11.2

Release Summary

asterisk-18.11.2

Date: 2022-04-14

<asteriskteam@digium.com>


Table of Contents

    -
  1. Summary
  2. -
  3. Contributors
  4. -
  5. Closed Issues
  6. -
  7. Other Changes
  8. -
  9. Diffstat
  10. -

Summary

[Back to Top]

This release has been made to address one or more security vulnerabilities that have been identified. A security advisory document has been published for each vulnerability that includes additional information. Users of versions of Asterisk that are affected are strongly encouraged to review the advisories and determine what action they should take to protect their systems from these issues.

Security Advisories:

The data in this summary reflects changes that have been made since the previous release, asterisk-18.11.1.


Contributors

[Back to Top]

This table lists the people who have submitted code, those that have tested patches, as well as those that reported issues on the issue tracker that were resolved in this release. For coders, the number is how many of their patches (of any size) were committed into this release. For testers, the number is the number of times their name was listed as assisting with testing a patch. Finally, for reporters, the number is the number of issues that they reported that were affected by commits that went into this release.

- - -
CodersTestersReporters
3 Asterisk Development Team
2 Ben Ford
1 Joshua C. Colp
1 Benjamin Keith Ford
1 Clint Ruoho
1 Leandro Dardini

Closed Issues

[Back to Top]

This is a list of all issues from the issue tracker that were closed by changes that went into this release.

Security

Category: Functions/func_odbc

ASTERISK-29838: ${SQL_ESC()} not correctly escaping a terminating \
Reported by: Leandro Dardini
    -
  • [88522c22aa] Joshua C. Colp -- func_odbc: Add SQL_ESC_BACKSLASHES dialplan function.
  • -

Category: Resources/res_stir_shaken

ASTERISK-29476: res_stir_shaken: Blind SSRF vulnerabilities
Reported by: Clint Ruoho
    -
  • [353142a2b4] Ben Ford -- AST-2022-002 - res_stir_shaken/curl: Add ACL checks for Identity header.
  • -
ASTERISK-29872: res_stir_shaken: Resource exhaustion with large files
Reported by: Benjamin Keith Ford
    -
  • [1fdb1a6edf] Ben Ford -- AST-2022-001 - res_stir_shaken/curl: Limit file size and check start.
  • -


Commits Not Associated with an Issue

[Back to Top]

This is a list of all changes that went into this release that did not reference a JIRA issue.

- - - - -
RevisionAuthorSummary
94eac3c13cAsterisk Development TeamDoing a fresh summary
3ca29c9554Asterisk Development TeamUpdate for 18.11.2
1422d098e7Asterisk Development TeamUpdate CHANGES and UPGRADE.txt for 18.11.2

Diffstat Results

[Back to Top]

This is a summary of the changes to the source code that went into this release that was generated using the diffstat utility.

asterisk-18.11.1-summary.html             |   16 -
-asterisk-18.11.1-summary.txt              |   91 -----------
-b/.version                                |    2
-b/CHANGES                                 |   12 +
-b/ChangeLog                               |   57 +++++++
-b/configs/samples/func_odbc.conf.sample   |    4
-b/configs/samples/pjsip.conf.sample       |    4
-b/configs/samples/stir_shaken.conf.sample |   18 ++
-b/funcs/func_odbc.c                       |   39 ++++
-b/include/asterisk/res_pjsip.h            |    2
-b/include/asterisk/res_stir_shaken.h      |   54 ++++++
-b/res/res_pjsip/pjsip_config.xml          |    7
-b/res/res_pjsip/pjsip_configuration.c     |    1
-b/res/res_pjsip_stir_shaken.c             |   14 +
-b/res/res_stir_shaken.c                   |   90 +++++++++--
-b/res/res_stir_shaken/curl.c              |  177 +++++++++++++++++-----
-b/res/res_stir_shaken/curl.h              |    5
-b/res/res_stir_shaken/profile.c           |  241 ++++++++++++++++++++++++++++++
-b/res/res_stir_shaken/profile.h           |   39 ++++
-b/res/res_stir_shaken/profile_private.h   |   40 ++++
-b/res/res_stir_shaken/stir_shaken.c       |   20 --
-21 files changed, 760 insertions(+), 173 deletions(-)

\ No newline at end of file diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/asterisk-18.11.2-summary.txt asterisk-18.12.0~dfsg+~cs6.12.40431413/asterisk-18.11.2-summary.txt --- asterisk-18.11.2~dfsg+~cs6.10.40431413/asterisk-18.11.2-summary.txt 2022-04-14 21:53:34.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/asterisk-18.11.2-summary.txt 1970-01-01 00:00:00.000000000 +0000 @@ -1,140 +0,0 @@ - Release Summary - - asterisk-18.11.2 - - Date: 2022-04-14 - - - - ---------------------------------------------------------------------- - - Table of Contents - - 1. Summary - 2. Contributors - 3. Closed Issues - 4. Other Changes - 5. Diffstat - - ---------------------------------------------------------------------- - - Summary - - [Back to Top] - - This release has been made to address one or more security vulnerabilities - that have been identified. A security advisory document has been published - for each vulnerability that includes additional information. Users of - versions of Asterisk that are affected are strongly encouraged to review - the advisories and determine what action they should take to protect their - systems from these issues. - - Security Advisories: - - * AST-2022-001 - * AST-2022-002 - * AST-2022-003 - - The data in this summary reflects changes that have been made since the - previous release, asterisk-18.11.1. - - ---------------------------------------------------------------------- - - Contributors - - [Back to Top] - - This table lists the people who have submitted code, those that have - tested patches, as well as those that reported issues on the issue tracker - that were resolved in this release. For coders, the number is how many of - their patches (of any size) were committed into this release. For testers, - the number is the number of times their name was listed as assisting with - testing a patch. Finally, for reporters, the number is the number of - issues that they reported that were affected by commits that went into - this release. - - Coders Testers Reporters - 3 Asterisk Development Team 1 Benjamin Keith Ford - 2 Ben Ford 1 Clint Ruoho - 1 Joshua C. Colp 1 Leandro Dardini - - ---------------------------------------------------------------------- - - Closed Issues - - [Back to Top] - - This is a list of all issues from the issue tracker that were closed by - changes that went into this release. - - Security - - Category: Functions/func_odbc - - ASTERISK-29838: ${SQL_ESC()} not correctly escaping a terminating \ - Reported by: Leandro Dardini - * [88522c22aa] Joshua C. Colp -- func_odbc: Add SQL_ESC_BACKSLASHES - dialplan function. - - Category: Resources/res_stir_shaken - - ASTERISK-29476: res_stir_shaken: Blind SSRF vulnerabilities - Reported by: Clint Ruoho - * [353142a2b4] Ben Ford -- AST-2022-002 - res_stir_shaken/curl: Add ACL - checks for Identity header. - ASTERISK-29872: res_stir_shaken: Resource exhaustion with large files - Reported by: Benjamin Keith Ford - * [1fdb1a6edf] Ben Ford -- AST-2022-001 - res_stir_shaken/curl: Limit - file size and check start. - - ---------------------------------------------------------------------- - - Commits Not Associated with an Issue - - [Back to Top] - - This is a list of all changes that went into this release that did not - reference a JIRA issue. - - +------------------------------------------------------------------------+ - | Revision | Author | Summary | - |------------+---------------------------+-------------------------------| - | 94eac3c13c | Asterisk Development Team | Doing a fresh summary | - |------------+---------------------------+-------------------------------| - | 3ca29c9554 | Asterisk Development Team | Update for 18.11.2 | - |------------+---------------------------+-------------------------------| - | 1422d098e7 | Asterisk Development Team | Update CHANGES and | - | | | UPGRADE.txt for 18.11.2 | - +------------------------------------------------------------------------+ - - ---------------------------------------------------------------------- - - Diffstat Results - - [Back to Top] - - This is a summary of the changes to the source code that went into this - release that was generated using the diffstat utility. - - asterisk-18.11.1-summary.html | 16 - - asterisk-18.11.1-summary.txt | 91 ----------- - b/.version | 2 - b/CHANGES | 12 + - b/ChangeLog | 57 +++++++ - b/configs/samples/func_odbc.conf.sample | 4 - b/configs/samples/pjsip.conf.sample | 4 - b/configs/samples/stir_shaken.conf.sample | 18 ++ - b/funcs/func_odbc.c | 39 ++++ - b/include/asterisk/res_pjsip.h | 2 - b/include/asterisk/res_stir_shaken.h | 54 ++++++ - b/res/res_pjsip/pjsip_config.xml | 7 - b/res/res_pjsip/pjsip_configuration.c | 1 - b/res/res_pjsip_stir_shaken.c | 14 + - b/res/res_stir_shaken.c | 90 +++++++++-- - b/res/res_stir_shaken/curl.c | 177 +++++++++++++++++----- - b/res/res_stir_shaken/curl.h | 5 - b/res/res_stir_shaken/profile.c | 241 ++++++++++++++++++++++++++++++ - b/res/res_stir_shaken/profile.h | 39 ++++ - b/res/res_stir_shaken/profile_private.h | 40 ++++ - b/res/res_stir_shaken/stir_shaken.c | 20 -- - 21 files changed, 760 insertions(+), 173 deletions(-) diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/asterisk-18.12.0-summary.html asterisk-18.12.0~dfsg+~cs6.12.40431413/asterisk-18.12.0-summary.html --- asterisk-18.11.2~dfsg+~cs6.10.40431413/asterisk-18.12.0-summary.html 1970-01-01 00:00:00.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/asterisk-18.12.0-summary.html 2022-05-12 11:50:59.000000000 +0000 @@ -0,0 +1,300 @@ +Release Summary - asterisk-18.12.0

Release Summary

asterisk-18.12.0

Date: 2022-05-12

<asteriskteam@digium.com>


Table of Contents

    +
  1. Summary
  2. +
  3. Contributors
  4. +
  5. Closed Issues
  6. +
  7. Other Changes
  8. +
  9. Diffstat
  10. +

Summary

[Back to Top]

This release is a point release of an existing major version. The changes included were made to address problems that have been identified in this release series, or are minor, backwards compatible new features or improvements. Users should be able to safely upgrade to this version if this release series is already in use. Users considering upgrading from a previous version are strongly encouraged to review the UPGRADE.txt document as well as the CHANGES document for information about upgrading to this release series.

The data in this summary reflects changes that have been made since the previous release, asterisk-18.11.0.


Contributors

[Back to Top]

This table lists the people who have submitted code, those that have tested patches, as well as those that reported issues on the issue tracker that were resolved in this release. For coders, the number is how many of their patches (of any size) were committed into this release. For testers, the number is the number of times their name was listed as assisting with testing a patch. Finally, for reporters, the number is the number of issues that they reported that were affected by commits that went into this release.

+ + +
CodersTestersReporters
22 Naveen Albert
6 Joshua C. Colp
5 Sean Bright
4 Asterisk Development Team
4 Ben Ford
3 Mark Petersen
2 Kevin Harwell
2 Philip Prindeville
2 George Joseph
2 Maximilian Fridrich
1 Birger Harzenetter (license 5870)
1 Alexei Gradinari
1 Michael Cargile
1 Hugh McMaster
1 Boris P. Korzun
1 Yury Kirsanov
1 Marcel Wagner
18 N A
3 Mark Petersen
2 Rusty Newton
2 Michael Auracher
2 George Joseph
2 Michael Auracher
1 Michael Cargile
1 Andre Heider
1 Alexei Gradinari
1 Daniel Bonazzi
1 Claude Diderich
1 Scott Griepentrog
1 Arix
1 Stefan Ruijsenaars
1 Benjamin Keith Ford
1 LA
1 Josh Hogan
1 Ross Beer
1 Boris P. Korzun
1 Marcel Wagner
1 INVADE International Ltd.
1 Leandro Dardini
1 Yury Kirsanov
1 Clint Ruoho
1 Jim Van Meggelen
1 Stefan Ruijsenaars
1 Tzafrir Cohen
1 Hugh McMaster
1 Jonathan Harris
1 David Herselman
1 Dmitriy Serov
1 Philip Prindeville
1 Gregory Massel
1 Jasper Hafkenscheid
1 Kevin Harwell
1 Josh Alberts
1 Sebastian Gutierrez

Closed Issues

[Back to Top]

This is a list of all issues from the issue tracker that were closed by changes that went into this release.

Security

Category: Functions/func_odbc

ASTERISK-29838: ${SQL_ESC()} not correctly escaping a terminating \
Reported by: Leandro Dardini
    +
  • [39cd09c246] Joshua C. Colp -- func_odbc: Add SQL_ESC_BACKSLASHES dialplan function.
  • +

Category: Resources/res_stir_shaken

ASTERISK-29476: res_stir_shaken: Blind SSRF vulnerabilities
Reported by: Clint Ruoho
    +
  • [11accf8064] Ben Ford -- AST-2022-002 - res_stir_shaken/curl: Add ACL checks for Identity header.
  • +
ASTERISK-29872: res_stir_shaken: Resource exhaustion with large files
Reported by: Benjamin Keith Ford
    +
  • [33091c2659] Ben Ford -- AST-2022-001 - res_stir_shaken/curl: Limit file size and check start.
  • +

New Feature

Category: Applications/app_confbridge

ASTERISK-29931: Option to allow a user to not hear the join sound on enter but everyone else can
Reported by: Michael Cargile
    +
  • [216a55408e] Michael Cargile -- apps/confbridge: Added hear_own_join_sound option to control who hears sound_join
  • +

Category: Applications/app_queue

ASTERISK-29876: app_queue: Add music on hold option
Reported by: N A
    +
  • [b7edc08e33] Naveen Albert -- app_queue: Add music on hold option to Queue.
  • +

Category: Channels/chan_pjsip

ASTERISK-29941: chan_pjsip: Add ability to send flash events
Reported by: N A
    +
  • [8bc6d42a27] Naveen Albert -- chan_pjsip: Add ability to send flash events.
  • +

Category: Functions/General

ASTERISK-29820: cli: Add command to evaluate a function
Reported by: N A
    +
  • [3686a97d79] Naveen Albert -- cli: Add command to evaluate dialplan functions.
  • +

Category: Functions/NewFeature

ASTERISK-29486: Hint-like extension value lookup function without device state
Reported by: N A
    +
  • [79689d9df8] Naveen Albert -- func_evalexten: Extension evaluation function.
  • +

Category: Functions/func_db

ASTERISK-29968: func_db: Add a function to return cardinality of keys at prefix
Reported by: N A
    +
  • [ce00f8758d] Naveen Albert -- func_db: Add function to return cardinality at prefix
  • +

Bug

Category: Applications/app_meetme

ASTERISK-30002: app_meetme: Don't erroneously set global variables when channel is NULL
Reported by: N A
    +
  • [ff70b2aac6] Naveen Albert -- app_meetme: Don't erroneously set global variables.
  • +

Category: Bridges/bridge_simple

ASTERISK-29253: Incorrect bridging on transfer
Reported by: Yury Kirsanov
    +
  • [6ac08fdcf8] Yury Kirsanov -- bridge_simple.c: Unhold channels on join simple bridge.
  • +

Category: CDR/cdr_adaptive_odbc

ASTERISK-30023: cdr_adaptive_odbc: does not support DATETIME database columns
Reported by: Gregory Massel
    +
  • [ec8ab44b7f] Joshua C. Colp -- cdr_adaptive_odbc: Add support for SQL_DATETIME field type.
  • +

Category: Channels/chan_dahdi

ASTERISK-28518: chan_dahdi: Caller ID FSK Erroneously Sent when Picking Up Dahdi Call On Hold
Reported by: Josh Alberts
    +
  • [a4f04666b5] Naveen Albert -- chan_dahdi: Don't allow MWI FSK if channel not idle.
  • +
ASTERISK-29990: chan_dahdi: adding ring cadences is not idempotent on dahdi restart
Reported by: N A
    +
  • [cb53ad5671] Naveen Albert -- chan_dahdi: Don't append cadences on dahdi restart.
  • +
ASTERISK-29994: chan_dahdi: Round robin array size is too small for max number of groups
Reported by: N A
    +
  • [dd15cd049f] Naveen Albert -- chan_dahdi: Fix insufficient array size for round robin.
  • +

Category: Channels/chan_iax2

ASTERISK-30007: chan_iax2: Prevent crashes due to attempted encryption with missing secrets
Reported by: N A
    +
  • [9dc321cbcb] Naveen Albert -- chan_iax2: Prevent crash if dialing RSA-only call without outkey.
  • +
ASTERISK-29895: chan_iax2: Fix misaligned spacing in iax2 show netstats printout
Reported by: N A
    +
  • [d9e55250dd] Birger Harzenetter -- chan_iax2: Fix spacing in netstats command
  • +
ASTERISK-29048: chan_iax2: "iax2 show registry" shows host for perceived
Reported by: David Herselman
    +
  • [97c499ee34] Naveen Albert -- chan_iax2: Fix perceived showing host address.
  • +

Category: Channels/chan_pjsip

ASTERISK-29842: Do not change 180 Ringing to 183 Progress even if early_media already enabled
Reported by: Mark Petersen
    +
  • [16e59db514] Mark Petersen -- chan_pjsip: add allow_sending_180_after_183 option
  • +
ASTERISK-30006: res_pjsip: UDP transport does not work when async_operations is greater than 1
Reported by: Ross Beer
    +
  • [09e8667fa5] Joshua C. Colp -- res_pjsip: Always set async_operations to 1.
  • +

Category: Channels/chan_sip/General

ASTERISK-29843: Session timers get removed on UPDATE
Reported by: Mark Petersen
    +
  • [bb2102a991] Mark Petersen -- chan_sip.c Session timers get removed on UPDATE
  • +
ASTERISK-29955: chan_sip: SIP route header is missing on UPDATE
Reported by: Mark Petersen
    +
  • [4f7e3d1609] Mark Petersen -- chan_sip: SIP route header is missing on UPDATE
  • +

Category: Channels/chan_sip/Transfers

ASTERISK-29955: chan_sip: SIP route header is missing on UPDATE
Reported by: Mark Petersen
    +
  • [4f7e3d1609] Mark Petersen -- chan_sip: SIP route header is missing on UPDATE
  • +

Category: Channels/chan_vpb

ASTERISK-30021: ast_variable_list_replace_variable uses variable with new keyword
Reported by: Jasper Hafkenscheid
    +
  • [2587e58e05] Sean Bright -- config.h: Don't use C++ keywords as argument names.
  • +

Category: Core/BuildSystem

ASTERISK-29986: build: Asterisk 18.11.0 doesn't compile when wget isn't available
Reported by: Stefan Ruijsenaars
    +
  • [dd704bbba5] George Joseph -- make_xml_documentation: Remove usage of get_sourceable_makeopts
  • +
ASTERISK-29988: REGRESSION: The build process is requiring xmllint or xmlstarlet ro be installed when it shouldn't
Reported by: George Joseph
    +
  • [2d3297d4f3] George Joseph -- Makefile: Disable XML doc validation
  • +

Category: Core/FileFormatInterface

ASTERISK-29943: file.c: seeking to negative file offset is not prevented
Reported by: N A
    +
  • [ea02bc3685] Naveen Albert -- file.c: Prevent formats from seeking negative offsets.
  • +

Category: Core/General

ASTERISK-29948: iostream: Infinite TCP timeout writing data
Reported by: N A
    +
  • [ae1373d12d] Joshua C. Colp -- manager: Terminate session on write error.
  • +
ASTERISK-29674: Adjust for 64bit time_t
Reported by: Andre Heider
    +
  • [f50e793665] Philip Prindeville -- time: add support for time64 libcs
  • +

Category: Core/Logging

ASTERISK-22246: Asterisk's "T" flag is ignored when used with "r" or "R" flags. (documentation bug)
Reported by: Rusty Newton
    +
  • [09e989f972] Naveen Albert -- asterisk.c: Warn of incompatibilities with remote console.
  • +
ASTERISK-29928: logging messages truncated when using MUSL runtime
Reported by: Philip Prindeville
    +
  • [140c19c206] Philip Prindeville -- logger: workaround woefully small BUFSIZ in MUSL
  • +

Category: Core/Netsock

ASTERISK-29948: iostream: Infinite TCP timeout writing data
Reported by: N A
    +
  • [ae1373d12d] Joshua C. Colp -- manager: Terminate session on write error.
  • +

Category: Core/PBX

ASTERISK-26719: pbx: Only up to 127 includes in a dialplan context (AST_PBX_MAX_STACK - 1)
Reported by: Tzafrir Cohen
    +
  • [bd69639a6b] Naveen Albert -- pbx.c: Warn if there are too many includes in a context.
  • +

Category: Documentation

ASTERISK-29939: agi: Fix xmldoc bug with set music
Reported by: N A
    +
  • [dc129b6951] Naveen Albert -- res_agi: Fix xmldocs bug with set music.
  • +
ASTERISK-28891: documentation: AGICommand_set+music documentation arguments displayed incorreclty
Reported by: Jonathan Harris
    +
  • [dc129b6951] Naveen Albert -- res_agi: Fix xmldocs bug with set music.
  • +

Category: General

ASTERISK-29728: menuselect: Disabled by default modules that are enabled are always recompiled
Reported by: N A
    +
  • [b4c17c2044] Naveen Albert -- menuselect: Don't erroneously recompile modules.
  • +
ASTERISK-22246: Asterisk's "T" flag is ignored when used with "r" or "R" flags. (documentation bug)
Reported by: Rusty Newton
    +
  • [09e989f972] Naveen Albert -- asterisk.c: Warn of incompatibilities with remote console.
  • +
ASTERISK-26582: Asterisk seems to ignore the "n" parameter for "disable console colorization"
Reported by: Sebastian Gutierrez
    +
  • [09e989f972] Naveen Albert -- asterisk.c: Warn of incompatibilities with remote console.
  • +

Category: PBX/General

ASTERISK-29950: SayNumber can handle '01' to '07', but not '08' or '09'
Reported by: Jim Van Meggelen
    +
  • [81a990b8d2] Sean Bright -- conversions.c: Specify that we only want to parse decimal numbers.
  • +

Category: Resources/res_ari_recordings

ASTERISK-29960: ari: Retrieving stored recording can returns wrong file
Reported by: Arix
    +
  • [3a7d83087b] Sean Bright -- stasis_recording: Perform a complete match on requested filename.
  • +

Category: Resources/res_pjsip_nat

ASTERISK-29411: Crash in pjsip_msg_find_hdr_by_name
Reported by: LA
    +
  • [ec5b449bcf] Kevin Harwell -- res_pjsip_header_funcs: wrong pool used tdata headers
  • +

Category: Resources/res_pjsip_pubsub

ASTERISK-29961: RLS: domain part of 'uri' list attribute mismatch with SUBSCRIBE request
Reported by: Alexei Gradinari
    +
  • [96a3ff9edd] Alexei Gradinari -- res_pjsip_pubsub: RLS 'uri' list attribute mismatch with SUBSCRIBE request
  • +

Category: Resources/res_pjsip_sdp_rtp

ASTERISK-26689: res_pjsip_sdp_rtp: 183 Session in Progress. Disconnecting channel for lack of RTP activity
Reported by: Dmitriy Serov
    +
  • [82dbfe7783] Boris P. Korzun -- res_pjsip_sdp_rtp: Improve detecting of lack of RTP activity
  • +
ASTERISK-29929: res_pjsip_sdp_rtp: Disconnecting channel for lack of RTP activity in one way sessions
Reported by: Boris P. Korzun
    +
  • [82dbfe7783] Boris P. Korzun -- res_pjsip_sdp_rtp: Improve detecting of lack of RTP activity
  • +

Category: Resources/res_pjsip_session

ASTERISK-29655: res_pjsip_session: No video to caller if no camera available
Reported by: Michael Auracher
    +
  • [1e6991f95e] Maximilian Fridrich -- core_unreal: Flip stream direction of second channel.
  • +
  • [37829b4461] Maximilian Fridrich -- app_dial: Flip stream direction of outgoing channel.
  • +
ASTERISK-29638: res_pjsip_session: No video after early media
Reported by: Michael Auracher
    +
  • [1e6991f95e] Maximilian Fridrich -- core_unreal: Flip stream direction of second channel.
  • +
  • [37829b4461] Maximilian Fridrich -- app_dial: Flip stream direction of outgoing channel.
  • +

Category: Resources/res_stir_shaken

ASTERISK-30024: Failed to sign STIR/SHAKEN payload with functionality not enabled
Reported by: Claude Diderich
    +
  • [40f4268f2d] Ben Ford -- res_pjsip_stir_shaken.c: Fix enabled when not configured.
  • +

Category: pjproject/pjsip

ASTERISK-30015: pjsip / WebRTC: Chrome creating large number of SDP attributes
Reported by: Josh Hogan
    +
  • [8500210611] Joshua C. Colp -- pjsip: Increase maximum number of format attributes.
  • +
ASTERISK-29535: Segmentation fault in libasteriskpj.so.2
Reported by: Daniel Bonazzi
    +
  • [ec5b449bcf] Kevin Harwell -- res_pjsip_header_funcs: wrong pool used tdata headers
  • +

Improvement

Category: Applications/General

ASTERISK-29951: app_mf, app_sf: Return -1 on hangup
Reported by: N A
    +
  • [9024bb989b] Naveen Albert -- app_mf, app_sf: Return -1 if channel hangs up.
  • +

Category: Applications/app_dial

ASTERISK-25716: Documentation: Document explanations and examples for possible values of DIALSTATUS
Reported by: Rusty Newton
    +
  • [a66b6647b2] Naveen Albert -- app_dial: Document DIALSTATUS return values.
  • +

Category: Applications/app_meetme

ASTERISK-29954: app_meetme: Emit warning if conference not found
Reported by: N A
    +
  • [b2d5bd4cb8] Naveen Albert -- app_meetme: Emit warning if conference not found.
  • +

Category: Codecs/codec_opus

ASTERISK-29980: build: External binary modules don't use https
Reported by: INVADE International Ltd.
    +
  • [2b636f3766] Sean Bright -- download_externals: Use HTTPS for downloads
  • +

Category: Core/BuildSystem

ASTERISK-29970: Use pkg-config to find libxml2 headers and libraries
Reported by: Hugh McMaster
    +
  • [b678624f04] Hugh McMaster -- configure.ac: Use pkg-config to detect libxml2
  • +
ASTERISK-29980: build: External binary modules don't use https
Reported by: INVADE International Ltd.
    +
  • [2b636f3766] Sean Bright -- download_externals: Use HTTPS for downloads
  • +

Category: Documentation

ASTERISK-24827: Missing documentation for chan_dahdi dial string ring cadences
Reported by: Scott Griepentrog
    +
  • [085f33b7a3] Naveen Albert -- chan_dahdi: Document dial resource options.
  • +
ASTERISK-29940: general: Add since tags to xmldocs
Reported by: N A
    +
  • [4aac359d79] Naveen Albert -- documentation: Adds versioning information.
  • +
ASTERISK-29976: Should Readme include information about install_prereq script?
Reported by: Marcel Wagner
    +
  • [a893fdd901] Marcel Wagner -- documentation: Add information on running install_prereq script in readme
  • +
ASTERISK-25716: Documentation: Document explanations and examples for possible values of DIALSTATUS
Reported by: Rusty Newton
    +
  • [a66b6647b2] Naveen Albert -- app_dial: Document DIALSTATUS return values.
  • +

Category: PBX/General

ASTERISK-29967: pbx_builtins: Add missing documentation
Reported by: N A
    +
  • [b407511f02] Naveen Albert -- pbx_builtins: Add missing options documentation
  • +

Category: Resources/NewFeature

ASTERISK-29726: Add Asterisk External Application Protocol (AEAP) implementation
Reported by: Kevin Harwell
    +
  • [2fb8667908] Kevin Harwell -- res_aeap & res_speech_aeap: Add Asterisk External Application Protocol
  • +

Category: Resources/res_pjsip

ASTERISK-29351: Qualify pjproject 2.12 for Asterisk
Reported by: George Joseph
    +
  • [e5e02f783d] Joshua C. Colp -- pjproject: Update bundled to 2.12 release.
  • +

Category: Resources/res_speech/NewFeature

ASTERISK-29726: Add Asterisk External Application Protocol (AEAP) implementation
Reported by: Kevin Harwell
    +
  • [2fb8667908] Kevin Harwell -- res_aeap & res_speech_aeap: Add Asterisk External Application Protocol
  • +


Commits Not Associated with an Issue

[Back to Top]

This is a list of all changes that went into this release that did not reference a JIRA issue.

+ + + + + + + +
RevisionAuthorSummary
4c4d11eb6cAsterisk Development TeamUpdate for 18.12.0-rc1
efca7f4e8dAsterisk Development TeamUpdate CHANGES and UPGRADE.txt for 18.12.0
62f8e157fbBen Fordres_aeap: Add basic config skeleton and CLI commands.
801317ae05Asterisk Development TeamUpdate CHANGES and UPGRADE.txt for 18.11.2
f325cb3d13Asterisk Development TeamUpdate CHANGES and UPGRADE.txt for 18.11.0
777e9fde67Sean Brightopenssl: Supress deprecation warnings from OpenSSL 3.0

Diffstat Results

[Back to Top]

This is a summary of the changes to the source code that went into this release that was generated using the diffstat utility.

asterisk-18.11.0-summary.html                                                                 |  147
+asterisk-18.11.0-summary.txt                                                                  |  381
+b/.version                                                                                    |    2
+b/CHANGES                                                                                     |   76
+b/ChangeLog                                                                                   |  910
+b/Makefile                                                                                    |    9
+b/README.md                                                                                   |    5
+b/UPGRADE.txt                                                                                 |   12
+b/apps/app_confbridge.c                                                                       |   22
+b/apps/app_dial.c                                                                             |   55
+b/apps/app_dtmfstore.c                                                                        |    5
+b/apps/app_meetme.c                                                                           |   18
+b/apps/app_mf.c                                                                               |   29
+b/apps/app_queue.c                                                                            |   38
+b/apps/app_sendtext.c                                                                         |    5
+b/apps/app_sf.c                                                                               |   39
+b/apps/app_waitforcond.c                                                                      |    5
+b/apps/confbridge/conf_config_parser.c                                                        |    7
+b/apps/confbridge/include/confbridge.h                                                        |    1
+b/asterisk-18.12.0-rc1-summary.html                                                           |  301
+b/asterisk-18.12.0-rc1-summary.txt                                                            |  715
+b/bridges/bridge_simple.c                                                                     |   21
+b/build_tools/download_externals                                                              |    2
+b/build_tools/make_xml_documentation                                                          |   42
+b/cdr/cdr_adaptive_odbc.c                                                                     |    1
+b/channels/chan_dahdi.c                                                                       |   59
+b/channels/chan_iax2.c                                                                        |   34
+b/channels/chan_pjsip.c                                                                       |   38
+b/channels/chan_sip.c                                                                         |   14
+b/channels/pjsip/dialplan_functions.c                                                         |   16
+b/codecs/codecs.xml                                                                           |   10
+b/configs/samples/aeap.conf.sample                                                            |   21
+b/configs/samples/chan_dahdi.conf.sample                                                      |    5
+b/configs/samples/confbridge.conf.sample                                                      |    6
+b/configs/samples/func_odbc.conf.sample                                                       |    4
+b/configs/samples/pjsip.conf.sample                                                           |   12
+b/configs/samples/queues.conf.sample                                                          |    3
+b/configs/samples/stir_shaken.conf.sample                                                     |   18
+b/configure                                                                                   |18310 +++++-----
+b/configure.ac                                                                                |    1
+b/contrib/ast-db-manage/config/versions/0bee61aa9425_allow_180_ringing_with_sdp.py            |   36
+b/contrib/realtime/mysql/mysql_config.sql                                                     |    6
+b/contrib/realtime/postgresql/postgresql_config.sql                                           |    6
+b/doc/asterisk.8                                                                              |    4
+b/funcs/func_channel.c                                                                        |    5
+b/funcs/func_db.c                                                                             |   72
+b/funcs/func_env.c                                                                            |   10
+b/funcs/func_evalexten.c                                                                      |  147
+b/funcs/func_frame_drop.c                                                                     |    5
+b/funcs/func_json.c                                                                           |    5
+b/funcs/func_math.c                                                                           |   15
+b/funcs/func_odbc.c                                                                           |   39
+b/funcs/func_sayfiles.c                                                                       |    5
+b/funcs/func_scramble.c                                                                       |    5
+b/funcs/func_strings.c                                                                        |    5
+b/funcs/func_talkdetect.c                                                                     |    3
+b/include/asterisk/config.h                                                                   |   13
+b/include/asterisk/pbx.h                                                                      |   19
+b/include/asterisk/res_aeap.h                                                                 |  370
+b/include/asterisk/res_aeap_message.h                                                         |  374
+b/include/asterisk/res_pjsip.h                                                                |    9
+b/include/asterisk/res_stir_shaken.h                                                          |   54
+b/include/asterisk/speech.h                                                                   |    6
+b/include/asterisk/time.h                                                                     |   20
+b/main/Makefile                                                                               |    1
+b/main/asterisk.c                                                                             |   53
+b/main/conversions.c                                                                          |    4
+b/main/core_unreal.c                                                                          |   31
+b/main/file.c                                                                                 |    6
+b/main/logger.c                                                                               |   15
+b/main/manager.c                                                                              |    8
+b/main/pbx.c                                                                                  |   79
+b/main/pbx_builtins.c                                                                         |    7
+b/main/pbx_variables.c                                                                        |   54
+b/main/time.c                                                                                 |   29
+b/menuselect/configure                                                                        | 3730 +-
+b/menuselect/configure.ac                                                                     |    2
+b/menuselect/menuselect.c                                                                     |   70
+b/res/Makefile                                                                                |    1
+b/res/res.xml                                                                                 |    2
+b/res/res_aeap.c                                                                              |  404
+b/res/res_aeap.exports.in                                                                     |    7
+b/res/res_aeap/aeap.c                                                                         |  501
+b/res/res_aeap/general.c                                                                      |   58
+b/res/res_aeap/general.h                                                                      |   41
+b/res/res_aeap/logger.h                                                                       |   60
+b/res/res_aeap/message.c                                                                      |  270
+b/res/res_aeap/message_json.c                                                                 |  191
+b/res/res_aeap/transaction.c                                                                  |  284
+b/res/res_aeap/transaction.h                                                                  |  123
+b/res/res_aeap/transport.c                                                                    |  156
+b/res/res_aeap/transport.h                                                                    |  209
+b/res/res_aeap/transport_websocket.c                                                          |  249
+b/res/res_aeap/transport_websocket.h                                                          |   34
+b/res/res_agi.c                                                                               |   10
+b/res/res_calendar_caldav.c                                                                   |    4
+b/res/res_calendar_icalendar.c                                                                |    4
+b/res/res_crypto.c                                                                            |    2
+b/res/res_http_media_cache.c                                                                  |    7
+b/res/res_odbc.c                                                                              |    4
+b/res/res_pjsip/config_global.c                                                               |   21
+b/res/res_pjsip/config_transport.c                                                            |    6
+b/res/res_pjsip/location.c                                                                    |    5
+b/res/res_pjsip/pjsip_config.xml                                                              |   20
+b/res/res_pjsip/pjsip_configuration.c                                                         |    1
+b/res/res_pjsip/pjsip_options.c                                                               |    4
+b/res/res_pjsip_header_funcs.c                                                                |    8
+b/res/res_pjsip_history.c                                                                     |   25
+b/res/res_pjsip_pubsub.c                                                                      |   19
+b/res/res_pjsip_registrar.c                                                                   |    5
+b/res/res_pjsip_sdp_rtp.c                                                                     |   48
+b/res/res_pjsip_stir_shaken.c                                                                 |   24
+b/res/res_rtp_asterisk.c                                                                      |    1
+b/res/res_speech.c                                                                            |   36
+b/res/res_speech_aeap.c                                                                       |  731
+b/res/res_stir_shaken.c                                                                       |   96
+b/res/res_stir_shaken/curl.c                                                                  |  177
+b/res/res_stir_shaken/curl.h                                                                  |    5
+b/res/res_stir_shaken/profile.c                                                               |  241
+b/res/res_stir_shaken/profile.h                                                               |   39
+b/res/res_stir_shaken/profile_private.h                                                       |   40
+b/res/res_stir_shaken/stir_shaken.c                                                           |   29
+b/res/res_stir_shaken/stir_shaken.h                                                           |    7
+b/res/res_tonedetect.c                                                                        |   15
+b/res/stasis_recording/stored.c                                                               |    6
+b/tests/test_aeap.c                                                                           |  252
+b/tests/test_aeap_speech.c                                                                    |  287
+b/tests/test_aeap_transaction.c                                                               |  179
+b/tests/test_aeap_transport.c                                                                 |  249
+b/tests/test_conversions.c                                                                    |   12
+b/third-party/pjproject/patches/0000-configure-ssl-library-path.patch                         |   29
+b/third-party/pjproject/patches/0000-remove-third-party.patch                                 |   33
+b/third-party/pjproject/patches/0100-allow_multiple_auth_headers.patch                        |  413
+build_tools/get_sourceable_makeopts                                                           |   54
+third-party/pjproject/patches/0000-set_apps_initial_log_level.patch                           |   53
+third-party/pjproject/patches/0000-solaris.patch                                              |  135
+third-party/pjproject/patches/0011-sip_inv_patch.patch                                        |   39
+third-party/pjproject/patches/0020-pjlib_cancel_timer_0.patch                                 |   39
+third-party/pjproject/patches/0050-fix-race-parallel-build.patch                              |   72
+third-party/pjproject/patches/0060-clone-sdp-for-sip-timer-refresh-invite.patch               |   28
+third-party/pjproject/patches/0070-fix-incorrect-copying-when-creating-cancel.patch           |   37
+third-party/pjproject/patches/0080-fix-sdp-neg-modify-local-offer.patch                       |   33
+third-party/pjproject/patches/0090-Skip-unsupported-digest-algorithm-2408.patch               |  212
+third-party/pjproject/patches/0100-fix-double-stun-free.patch                                 |   82
+third-party/pjproject/patches/0110-tls-parent-listener-destroyed.patch                        |  166
+third-party/pjproject/patches/0111-ssl-premature-destroy.patch                                |  136
+third-party/pjproject/patches/0120-pjmedia_sdp_attr_get_rtpmap-Strip-param-trailing-whi.patch |   32
+third-party/pjproject/patches/0130-sip_inv-Additional-multipart-support-2919-2920.patch       |  661
+third-party/pjproject/patches/0140-Fix-incorrect-unescaping-of-tokens-during-parsing-29.patch |  123
+third-party/pjproject/patches/0150-Create-generic-pjsip_hdr_find-functions.patch              |  176
+third-party/pjproject/patches/0160-Additional-multipart-improvements.patch                    |  644
+third-party/pjproject/patches/0170-stun-integer-underflow.patch                               |   26
+third-party/pjproject/patches/0171-dialog-set-free.patch                                      |  114
+third-party/pjproject/patches/0172-prevent-multipart-oob.patch                                |   22
+154 files changed, 21655 insertions(+), 13634 deletions(-)

\ No newline at end of file diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/asterisk-18.12.0-summary.txt asterisk-18.12.0~dfsg+~cs6.12.40431413/asterisk-18.12.0-summary.txt --- asterisk-18.11.2~dfsg+~cs6.10.40431413/asterisk-18.12.0-summary.txt 1970-01-01 00:00:00.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/asterisk-18.12.0-summary.txt 2022-05-12 11:50:59.000000000 +0000 @@ -0,0 +1,716 @@ + Release Summary + + asterisk-18.12.0 + + Date: 2022-05-12 + + + + ---------------------------------------------------------------------- + + Table of Contents + + 1. Summary + 2. Contributors + 3. Closed Issues + 4. Other Changes + 5. Diffstat + + ---------------------------------------------------------------------- + + Summary + + [Back to Top] + + This release is a point release of an existing major version. The changes + included were made to address problems that have been identified in this + release series, or are minor, backwards compatible new features or + improvements. Users should be able to safely upgrade to this version if + this release series is already in use. Users considering upgrading from a + previous version are strongly encouraged to review the UPGRADE.txt + document as well as the CHANGES document for information about upgrading + to this release series. + + The data in this summary reflects changes that have been made since the + previous release, asterisk-18.11.0. + + ---------------------------------------------------------------------- + + Contributors + + [Back to Top] + + This table lists the people who have submitted code, those that have + tested patches, as well as those that reported issues on the issue tracker + that were resolved in this release. For coders, the number is how many of + their patches (of any size) were committed into this release. For testers, + the number is the number of times their name was listed as assisting with + testing a patch. Finally, for reporters, the number is the number of + issues that they reported that were affected by commits that went into + this release. + + Coders Testers Reporters + 22 Naveen Albert 18 N A + 6 Joshua C. Colp 3 Mark Petersen + 5 Sean Bright 2 Rusty Newton + 4 Asterisk Development Team 2 Michael Auracher + 4 Ben Ford 2 George Joseph + 3 Mark Petersen 2 Michael Auracher + 2 Kevin Harwell 1 Michael Cargile + 2 Philip Prindeville 1 Andre Heider + 2 George Joseph 1 Alexei Gradinari + 2 Maximilian Fridrich 1 Daniel Bonazzi + 1 Birger Harzenetter (license 5870) 1 Claude Diderich + 1 Alexei Gradinari 1 Scott Griepentrog + 1 Michael Cargile 1 Arix + 1 Hugh McMaster 1 Stefan Ruijsenaars + 1 Boris P. Korzun 1 Benjamin Keith Ford + 1 Yury Kirsanov 1 LA + 1 Marcel Wagner 1 Josh Hogan + 1 Ross Beer + 1 Boris P. Korzun + 1 Marcel Wagner + 1 INVADE International Ltd. + 1 Leandro Dardini + 1 Yury Kirsanov + 1 Clint Ruoho + 1 Jim Van Meggelen + 1 Stefan Ruijsenaars + 1 Tzafrir Cohen + 1 Hugh McMaster + 1 Jonathan Harris + 1 David Herselman + 1 Dmitriy Serov + 1 Philip Prindeville + 1 Gregory Massel + 1 Jasper Hafkenscheid + 1 Kevin Harwell + 1 Josh Alberts + 1 Sebastian Gutierrez + + ---------------------------------------------------------------------- + + Closed Issues + + [Back to Top] + + This is a list of all issues from the issue tracker that were closed by + changes that went into this release. + + Security + + Category: Functions/func_odbc + + ASTERISK-29838: ${SQL_ESC()} not correctly escaping a terminating \ + Reported by: Leandro Dardini + * [39cd09c246] Joshua C. Colp -- func_odbc: Add SQL_ESC_BACKSLASHES + dialplan function. + + Category: Resources/res_stir_shaken + + ASTERISK-29476: res_stir_shaken: Blind SSRF vulnerabilities + Reported by: Clint Ruoho + * [11accf8064] Ben Ford -- AST-2022-002 - res_stir_shaken/curl: Add ACL + checks for Identity header. + ASTERISK-29872: res_stir_shaken: Resource exhaustion with large files + Reported by: Benjamin Keith Ford + * [33091c2659] Ben Ford -- AST-2022-001 - res_stir_shaken/curl: Limit + file size and check start. + + New Feature + + Category: Applications/app_confbridge + + ASTERISK-29931: Option to allow a user to not hear the join sound on enter + but everyone else can + Reported by: Michael Cargile + * [216a55408e] Michael Cargile -- apps/confbridge: Added + hear_own_join_sound option to control who hears sound_join + + Category: Applications/app_queue + + ASTERISK-29876: app_queue: Add music on hold option + Reported by: N A + * [b7edc08e33] Naveen Albert -- app_queue: Add music on hold option to + Queue. + + Category: Channels/chan_pjsip + + ASTERISK-29941: chan_pjsip: Add ability to send flash events + Reported by: N A + * [8bc6d42a27] Naveen Albert -- chan_pjsip: Add ability to send flash + events. + + Category: Functions/General + + ASTERISK-29820: cli: Add command to evaluate a function + Reported by: N A + * [3686a97d79] Naveen Albert -- cli: Add command to evaluate dialplan + functions. + + Category: Functions/NewFeature + + ASTERISK-29486: Hint-like extension value lookup function without device + state + Reported by: N A + * [79689d9df8] Naveen Albert -- func_evalexten: Extension evaluation + function. + + Category: Functions/func_db + + ASTERISK-29968: func_db: Add a function to return cardinality of keys at + prefix + Reported by: N A + * [ce00f8758d] Naveen Albert -- func_db: Add function to return + cardinality at prefix + + Bug + + Category: Applications/app_meetme + + ASTERISK-30002: app_meetme: Don't erroneously set global variables when + channel is NULL + Reported by: N A + * [ff70b2aac6] Naveen Albert -- app_meetme: Don't erroneously set global + variables. + + Category: Bridges/bridge_simple + + ASTERISK-29253: Incorrect bridging on transfer + Reported by: Yury Kirsanov + * [6ac08fdcf8] Yury Kirsanov -- bridge_simple.c: Unhold channels on join + simple bridge. + + Category: CDR/cdr_adaptive_odbc + + ASTERISK-30023: cdr_adaptive_odbc: does not support DATETIME database + columns + Reported by: Gregory Massel + * [ec8ab44b7f] Joshua C. Colp -- cdr_adaptive_odbc: Add support for + SQL_DATETIME field type. + + Category: Channels/chan_dahdi + + ASTERISK-28518: chan_dahdi: Caller ID FSK Erroneously Sent when Picking Up + Dahdi Call On Hold + Reported by: Josh Alberts + * [a4f04666b5] Naveen Albert -- chan_dahdi: Don't allow MWI FSK if + channel not idle. + ASTERISK-29990: chan_dahdi: adding ring cadences is not idempotent on + dahdi restart + Reported by: N A + * [cb53ad5671] Naveen Albert -- chan_dahdi: Don't append cadences on + dahdi restart. + ASTERISK-29994: chan_dahdi: Round robin array size is too small for max + number of groups + Reported by: N A + * [dd15cd049f] Naveen Albert -- chan_dahdi: Fix insufficient array size + for round robin. + + Category: Channels/chan_iax2 + + ASTERISK-30007: chan_iax2: Prevent crashes due to attempted encryption + with missing secrets + Reported by: N A + * [9dc321cbcb] Naveen Albert -- chan_iax2: Prevent crash if dialing + RSA-only call without outkey. + ASTERISK-29895: chan_iax2: Fix misaligned spacing in iax2 show netstats + printout + Reported by: N A + * [d9e55250dd] Birger Harzenetter -- chan_iax2: Fix spacing in netstats + command + ASTERISK-29048: chan_iax2: "iax2 show registry" shows host for perceived + Reported by: David Herselman + * [97c499ee34] Naveen Albert -- chan_iax2: Fix perceived showing host + address. + + Category: Channels/chan_pjsip + + ASTERISK-29842: Do not change 180 Ringing to 183 Progress even if + early_media already enabled + Reported by: Mark Petersen + * [16e59db514] Mark Petersen -- chan_pjsip: add + allow_sending_180_after_183 option + ASTERISK-30006: res_pjsip: UDP transport does not work when + async_operations is greater than 1 + Reported by: Ross Beer + * [09e8667fa5] Joshua C. Colp -- res_pjsip: Always set async_operations + to 1. + + Category: Channels/chan_sip/General + + ASTERISK-29843: Session timers get removed on UPDATE + Reported by: Mark Petersen + * [bb2102a991] Mark Petersen -- chan_sip.c Session timers get removed on + UPDATE + ASTERISK-29955: chan_sip: SIP route header is missing on UPDATE + Reported by: Mark Petersen + * [4f7e3d1609] Mark Petersen -- chan_sip: SIP route header is missing on + UPDATE + + Category: Channels/chan_sip/Transfers + + ASTERISK-29955: chan_sip: SIP route header is missing on UPDATE + Reported by: Mark Petersen + * [4f7e3d1609] Mark Petersen -- chan_sip: SIP route header is missing on + UPDATE + + Category: Channels/chan_vpb + + ASTERISK-30021: ast_variable_list_replace_variable uses variable with new + keyword + Reported by: Jasper Hafkenscheid + * [2587e58e05] Sean Bright -- config.h: Don't use C++ keywords as + argument names. + + Category: Core/BuildSystem + + ASTERISK-29986: build: Asterisk 18.11.0 doesn't compile when wget isn't + available + Reported by: Stefan Ruijsenaars + * [dd704bbba5] George Joseph -- make_xml_documentation: Remove usage of + get_sourceable_makeopts + ASTERISK-29988: REGRESSION: The build process is requiring xmllint or + xmlstarlet ro be installed when it shouldn't + Reported by: George Joseph + * [2d3297d4f3] George Joseph -- Makefile: Disable XML doc validation + + Category: Core/FileFormatInterface + + ASTERISK-29943: file.c: seeking to negative file offset is not prevented + Reported by: N A + * [ea02bc3685] Naveen Albert -- file.c: Prevent formats from seeking + negative offsets. + + Category: Core/General + + ASTERISK-29948: iostream: Infinite TCP timeout writing data + Reported by: N A + * [ae1373d12d] Joshua C. Colp -- manager: Terminate session on write + error. + ASTERISK-29674: Adjust for 64bit time_t + Reported by: Andre Heider + * [f50e793665] Philip Prindeville -- time: add support for time64 libcs + + Category: Core/Logging + + ASTERISK-22246: Asterisk's "T" flag is ignored when used with "r" or "R" + flags. (documentation bug) + Reported by: Rusty Newton + * [09e989f972] Naveen Albert -- asterisk.c: Warn of incompatibilities + with remote console. + ASTERISK-29928: logging messages truncated when using MUSL runtime + Reported by: Philip Prindeville + * [140c19c206] Philip Prindeville -- logger: workaround woefully small + BUFSIZ in MUSL + + Category: Core/Netsock + + ASTERISK-29948: iostream: Infinite TCP timeout writing data + Reported by: N A + * [ae1373d12d] Joshua C. Colp -- manager: Terminate session on write + error. + + Category: Core/PBX + + ASTERISK-26719: pbx: Only up to 127 includes in a dialplan context + (AST_PBX_MAX_STACK - 1) + Reported by: Tzafrir Cohen + * [bd69639a6b] Naveen Albert -- pbx.c: Warn if there are too many + includes in a context. + + Category: Documentation + + ASTERISK-29939: agi: Fix xmldoc bug with set music + Reported by: N A + * [dc129b6951] Naveen Albert -- res_agi: Fix xmldocs bug with set music. + ASTERISK-28891: documentation: AGICommand_set+music documentation + arguments displayed incorreclty + Reported by: Jonathan Harris + * [dc129b6951] Naveen Albert -- res_agi: Fix xmldocs bug with set music. + + Category: General + + ASTERISK-29728: menuselect: Disabled by default modules that are enabled + are always recompiled + Reported by: N A + * [b4c17c2044] Naveen Albert -- menuselect: Don't erroneously recompile + modules. + ASTERISK-22246: Asterisk's "T" flag is ignored when used with "r" or "R" + flags. (documentation bug) + Reported by: Rusty Newton + * [09e989f972] Naveen Albert -- asterisk.c: Warn of incompatibilities + with remote console. + ASTERISK-26582: Asterisk seems to ignore the "n" parameter for "disable + console colorization" + Reported by: Sebastian Gutierrez + * [09e989f972] Naveen Albert -- asterisk.c: Warn of incompatibilities + with remote console. + + Category: PBX/General + + ASTERISK-29950: SayNumber can handle '01' to '07', but not '08' or '09' + Reported by: Jim Van Meggelen + * [81a990b8d2] Sean Bright -- conversions.c: Specify that we only want + to parse decimal numbers. + + Category: Resources/res_ari_recordings + + ASTERISK-29960: ari: Retrieving stored recording can returns wrong file + Reported by: Arix + * [3a7d83087b] Sean Bright -- stasis_recording: Perform a complete match + on requested filename. + + Category: Resources/res_pjsip_nat + + ASTERISK-29411: Crash in pjsip_msg_find_hdr_by_name + Reported by: LA + * [ec5b449bcf] Kevin Harwell -- res_pjsip_header_funcs: wrong pool used + tdata headers + + Category: Resources/res_pjsip_pubsub + + ASTERISK-29961: RLS: domain part of 'uri' list attribute mismatch with + SUBSCRIBE request + Reported by: Alexei Gradinari + * [96a3ff9edd] Alexei Gradinari -- res_pjsip_pubsub: RLS 'uri' list + attribute mismatch with SUBSCRIBE request + + Category: Resources/res_pjsip_sdp_rtp + + ASTERISK-26689: res_pjsip_sdp_rtp: 183 Session in Progress. Disconnecting + channel for lack of RTP activity + Reported by: Dmitriy Serov + * [82dbfe7783] Boris P. Korzun -- res_pjsip_sdp_rtp: Improve detecting + of lack of RTP activity + ASTERISK-29929: res_pjsip_sdp_rtp: Disconnecting channel for lack of RTP + activity in one way sessions + Reported by: Boris P. Korzun + * [82dbfe7783] Boris P. Korzun -- res_pjsip_sdp_rtp: Improve detecting + of lack of RTP activity + + Category: Resources/res_pjsip_session + + ASTERISK-29655: res_pjsip_session: No video to caller if no camera + available + Reported by: Michael Auracher + * [1e6991f95e] Maximilian Fridrich -- core_unreal: Flip stream direction + of second channel. + * [37829b4461] Maximilian Fridrich -- app_dial: Flip stream direction of + outgoing channel. + ASTERISK-29638: res_pjsip_session: No video after early media + Reported by: Michael Auracher + * [1e6991f95e] Maximilian Fridrich -- core_unreal: Flip stream direction + of second channel. + * [37829b4461] Maximilian Fridrich -- app_dial: Flip stream direction of + outgoing channel. + + Category: Resources/res_stir_shaken + + ASTERISK-30024: Failed to sign STIR/SHAKEN payload with functionality not + enabled + Reported by: Claude Diderich + * [40f4268f2d] Ben Ford -- res_pjsip_stir_shaken.c: Fix enabled when not + configured. + + Category: pjproject/pjsip + + ASTERISK-30015: pjsip / WebRTC: Chrome creating large number of SDP + attributes + Reported by: Josh Hogan + * [8500210611] Joshua C. Colp -- pjsip: Increase maximum number of + format attributes. + ASTERISK-29535: Segmentation fault in libasteriskpj.so.2 + Reported by: Daniel Bonazzi + * [ec5b449bcf] Kevin Harwell -- res_pjsip_header_funcs: wrong pool used + tdata headers + + Improvement + + Category: Applications/General + + ASTERISK-29951: app_mf, app_sf: Return -1 on hangup + Reported by: N A + * [9024bb989b] Naveen Albert -- app_mf, app_sf: Return -1 if channel + hangs up. + + Category: Applications/app_dial + + ASTERISK-25716: Documentation: Document explanations and examples for + possible values of DIALSTATUS + Reported by: Rusty Newton + * [a66b6647b2] Naveen Albert -- app_dial: Document DIALSTATUS return + values. + + Category: Applications/app_meetme + + ASTERISK-29954: app_meetme: Emit warning if conference not found + Reported by: N A + * [b2d5bd4cb8] Naveen Albert -- app_meetme: Emit warning if conference + not found. + + Category: Codecs/codec_opus + + ASTERISK-29980: build: External binary modules don't use https + Reported by: INVADE International Ltd. + * [2b636f3766] Sean Bright -- download_externals: Use HTTPS for + downloads + + Category: Core/BuildSystem + + ASTERISK-29970: Use pkg-config to find libxml2 headers and libraries + Reported by: Hugh McMaster + * [b678624f04] Hugh McMaster -- configure.ac: Use pkg-config to detect + libxml2 + ASTERISK-29980: build: External binary modules don't use https + Reported by: INVADE International Ltd. + * [2b636f3766] Sean Bright -- download_externals: Use HTTPS for + downloads + + Category: Documentation + + ASTERISK-24827: Missing documentation for chan_dahdi dial string ring + cadences + Reported by: Scott Griepentrog + * [085f33b7a3] Naveen Albert -- chan_dahdi: Document dial resource + options. + ASTERISK-29940: general: Add since tags to xmldocs + Reported by: N A + * [4aac359d79] Naveen Albert -- documentation: Adds versioning + information. + ASTERISK-29976: Should Readme include information about install_prereq + script? + Reported by: Marcel Wagner + * [a893fdd901] Marcel Wagner -- documentation: Add information on + running install_prereq script in readme + ASTERISK-25716: Documentation: Document explanations and examples for + possible values of DIALSTATUS + Reported by: Rusty Newton + * [a66b6647b2] Naveen Albert -- app_dial: Document DIALSTATUS return + values. + + Category: PBX/General + + ASTERISK-29967: pbx_builtins: Add missing documentation + Reported by: N A + * [b407511f02] Naveen Albert -- pbx_builtins: Add missing options + documentation + + Category: Resources/NewFeature + + ASTERISK-29726: Add Asterisk External Application Protocol (AEAP) + implementation + Reported by: Kevin Harwell + * [2fb8667908] Kevin Harwell -- res_aeap & res_speech_aeap: Add Asterisk + External Application Protocol + + Category: Resources/res_pjsip + + ASTERISK-29351: Qualify pjproject 2.12 for Asterisk + Reported by: George Joseph + * [e5e02f783d] Joshua C. Colp -- pjproject: Update bundled to 2.12 + release. + + Category: Resources/res_speech/NewFeature + + ASTERISK-29726: Add Asterisk External Application Protocol (AEAP) + implementation + Reported by: Kevin Harwell + * [2fb8667908] Kevin Harwell -- res_aeap & res_speech_aeap: Add Asterisk + External Application Protocol + + ---------------------------------------------------------------------- + + Commits Not Associated with an Issue + + [Back to Top] + + This is a list of all changes that went into this release that did not + reference a JIRA issue. + + +------------------------------------------------------------------------+ + | Revision | Author | Summary | + |------------+----------------------+------------------------------------| + | 4c4d11eb6c | Asterisk Development | Update for 18.12.0-rc1 | + | | Team | | + |------------+----------------------+------------------------------------| + | efca7f4e8d | Asterisk Development | Update CHANGES and UPGRADE.txt for | + | | Team | 18.12.0 | + |------------+----------------------+------------------------------------| + | 62f8e157fb | Ben Ford | res_aeap: Add basic config | + | | | skeleton and CLI commands. | + |------------+----------------------+------------------------------------| + | 801317ae05 | Asterisk Development | Update CHANGES and UPGRADE.txt for | + | | Team | 18.11.2 | + |------------+----------------------+------------------------------------| + | f325cb3d13 | Asterisk Development | Update CHANGES and UPGRADE.txt for | + | | Team | 18.11.0 | + |------------+----------------------+------------------------------------| + | 777e9fde67 | Sean Bright | openssl: Supress deprecation | + | | | warnings from OpenSSL 3.0 | + +------------------------------------------------------------------------+ + + ---------------------------------------------------------------------- + + Diffstat Results + + [Back to Top] + + This is a summary of the changes to the source code that went into this + release that was generated using the diffstat utility. + + asterisk-18.11.0-summary.html | 147 + asterisk-18.11.0-summary.txt | 381 + b/.version | 2 + b/CHANGES | 76 + b/ChangeLog | 910 + b/Makefile | 9 + b/README.md | 5 + b/UPGRADE.txt | 12 + b/apps/app_confbridge.c | 22 + b/apps/app_dial.c | 55 + b/apps/app_dtmfstore.c | 5 + b/apps/app_meetme.c | 18 + b/apps/app_mf.c | 29 + b/apps/app_queue.c | 38 + b/apps/app_sendtext.c | 5 + b/apps/app_sf.c | 39 + b/apps/app_waitforcond.c | 5 + b/apps/confbridge/conf_config_parser.c | 7 + b/apps/confbridge/include/confbridge.h | 1 + b/asterisk-18.12.0-rc1-summary.html | 301 + b/asterisk-18.12.0-rc1-summary.txt | 715 + b/bridges/bridge_simple.c | 21 + b/build_tools/download_externals | 2 + b/build_tools/make_xml_documentation | 42 + b/cdr/cdr_adaptive_odbc.c | 1 + b/channels/chan_dahdi.c | 59 + b/channels/chan_iax2.c | 34 + b/channels/chan_pjsip.c | 38 + b/channels/chan_sip.c | 14 + b/channels/pjsip/dialplan_functions.c | 16 + b/codecs/codecs.xml | 10 + b/configs/samples/aeap.conf.sample | 21 + b/configs/samples/chan_dahdi.conf.sample | 5 + b/configs/samples/confbridge.conf.sample | 6 + b/configs/samples/func_odbc.conf.sample | 4 + b/configs/samples/pjsip.conf.sample | 12 + b/configs/samples/queues.conf.sample | 3 + b/configs/samples/stir_shaken.conf.sample | 18 + b/configure |18310 +++++----- + b/configure.ac | 1 + b/contrib/ast-db-manage/config/versions/0bee61aa9425_allow_180_ringing_with_sdp.py | 36 + b/contrib/realtime/mysql/mysql_config.sql | 6 + b/contrib/realtime/postgresql/postgresql_config.sql | 6 + b/doc/asterisk.8 | 4 + b/funcs/func_channel.c | 5 + b/funcs/func_db.c | 72 + b/funcs/func_env.c | 10 + b/funcs/func_evalexten.c | 147 + b/funcs/func_frame_drop.c | 5 + b/funcs/func_json.c | 5 + b/funcs/func_math.c | 15 + b/funcs/func_odbc.c | 39 + b/funcs/func_sayfiles.c | 5 + b/funcs/func_scramble.c | 5 + b/funcs/func_strings.c | 5 + b/funcs/func_talkdetect.c | 3 + b/include/asterisk/config.h | 13 + b/include/asterisk/pbx.h | 19 + b/include/asterisk/res_aeap.h | 370 + b/include/asterisk/res_aeap_message.h | 374 + b/include/asterisk/res_pjsip.h | 9 + b/include/asterisk/res_stir_shaken.h | 54 + b/include/asterisk/speech.h | 6 + b/include/asterisk/time.h | 20 + b/main/Makefile | 1 + b/main/asterisk.c | 53 + b/main/conversions.c | 4 + b/main/core_unreal.c | 31 + b/main/file.c | 6 + b/main/logger.c | 15 + b/main/manager.c | 8 + b/main/pbx.c | 79 + b/main/pbx_builtins.c | 7 + b/main/pbx_variables.c | 54 + b/main/time.c | 29 + b/menuselect/configure | 3730 +- + b/menuselect/configure.ac | 2 + b/menuselect/menuselect.c | 70 + b/res/Makefile | 1 + b/res/res.xml | 2 + b/res/res_aeap.c | 404 + b/res/res_aeap.exports.in | 7 + b/res/res_aeap/aeap.c | 501 + b/res/res_aeap/general.c | 58 + b/res/res_aeap/general.h | 41 + b/res/res_aeap/logger.h | 60 + b/res/res_aeap/message.c | 270 + b/res/res_aeap/message_json.c | 191 + b/res/res_aeap/transaction.c | 284 + b/res/res_aeap/transaction.h | 123 + b/res/res_aeap/transport.c | 156 + b/res/res_aeap/transport.h | 209 + b/res/res_aeap/transport_websocket.c | 249 + b/res/res_aeap/transport_websocket.h | 34 + b/res/res_agi.c | 10 + b/res/res_calendar_caldav.c | 4 + b/res/res_calendar_icalendar.c | 4 + b/res/res_crypto.c | 2 + b/res/res_http_media_cache.c | 7 + b/res/res_odbc.c | 4 + b/res/res_pjsip/config_global.c | 21 + b/res/res_pjsip/config_transport.c | 6 + b/res/res_pjsip/location.c | 5 + b/res/res_pjsip/pjsip_config.xml | 20 + b/res/res_pjsip/pjsip_configuration.c | 1 + b/res/res_pjsip/pjsip_options.c | 4 + b/res/res_pjsip_header_funcs.c | 8 + b/res/res_pjsip_history.c | 25 + b/res/res_pjsip_pubsub.c | 19 + b/res/res_pjsip_registrar.c | 5 + b/res/res_pjsip_sdp_rtp.c | 48 + b/res/res_pjsip_stir_shaken.c | 24 + b/res/res_rtp_asterisk.c | 1 + b/res/res_speech.c | 36 + b/res/res_speech_aeap.c | 731 + b/res/res_stir_shaken.c | 96 + b/res/res_stir_shaken/curl.c | 177 + b/res/res_stir_shaken/curl.h | 5 + b/res/res_stir_shaken/profile.c | 241 + b/res/res_stir_shaken/profile.h | 39 + b/res/res_stir_shaken/profile_private.h | 40 + b/res/res_stir_shaken/stir_shaken.c | 29 + b/res/res_stir_shaken/stir_shaken.h | 7 + b/res/res_tonedetect.c | 15 + b/res/stasis_recording/stored.c | 6 + b/tests/test_aeap.c | 252 + b/tests/test_aeap_speech.c | 287 + b/tests/test_aeap_transaction.c | 179 + b/tests/test_aeap_transport.c | 249 + b/tests/test_conversions.c | 12 + b/third-party/pjproject/patches/0000-configure-ssl-library-path.patch | 29 + b/third-party/pjproject/patches/0000-remove-third-party.patch | 33 + b/third-party/pjproject/patches/0100-allow_multiple_auth_headers.patch | 413 + build_tools/get_sourceable_makeopts | 54 + third-party/pjproject/patches/0000-set_apps_initial_log_level.patch | 53 + third-party/pjproject/patches/0000-solaris.patch | 135 + third-party/pjproject/patches/0011-sip_inv_patch.patch | 39 + third-party/pjproject/patches/0020-pjlib_cancel_timer_0.patch | 39 + third-party/pjproject/patches/0050-fix-race-parallel-build.patch | 72 + third-party/pjproject/patches/0060-clone-sdp-for-sip-timer-refresh-invite.patch | 28 + third-party/pjproject/patches/0070-fix-incorrect-copying-when-creating-cancel.patch | 37 + third-party/pjproject/patches/0080-fix-sdp-neg-modify-local-offer.patch | 33 + third-party/pjproject/patches/0090-Skip-unsupported-digest-algorithm-2408.patch | 212 + third-party/pjproject/patches/0100-fix-double-stun-free.patch | 82 + third-party/pjproject/patches/0110-tls-parent-listener-destroyed.patch | 166 + third-party/pjproject/patches/0111-ssl-premature-destroy.patch | 136 + third-party/pjproject/patches/0120-pjmedia_sdp_attr_get_rtpmap-Strip-param-trailing-whi.patch | 32 + third-party/pjproject/patches/0130-sip_inv-Additional-multipart-support-2919-2920.patch | 661 + third-party/pjproject/patches/0140-Fix-incorrect-unescaping-of-tokens-during-parsing-29.patch | 123 + third-party/pjproject/patches/0150-Create-generic-pjsip_hdr_find-functions.patch | 176 + third-party/pjproject/patches/0160-Additional-multipart-improvements.patch | 644 + third-party/pjproject/patches/0170-stun-integer-underflow.patch | 26 + third-party/pjproject/patches/0171-dialog-set-free.patch | 114 + third-party/pjproject/patches/0172-prevent-multipart-oob.patch | 22 + 154 files changed, 21655 insertions(+), 13634 deletions(-) diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/bridges/bridge_simple.c asterisk-18.12.0~dfsg+~cs6.12.40431413/bridges/bridge_simple.c --- asterisk-18.11.2~dfsg+~cs6.10.40431413/bridges/bridge_simple.c 2022-04-14 21:53:34.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/bridges/bridge_simple.c 2022-05-12 11:50:59.000000000 +0000 @@ -128,6 +128,7 @@ struct ast_stream_topology *new_top; struct ast_channel *c0 = AST_LIST_FIRST(&bridge->channels)->chan; struct ast_channel *c1 = AST_LIST_LAST(&bridge->channels)->chan; + int unhold_c0, unhold_c1; /* * If this is the first channel we can't make it compatible... @@ -152,9 +153,29 @@ SWAP(c0, c1); } new_top = simple_bridge_request_stream_topology_update(existing_top, req_top); + + /* The ast_channel_hold_state() and ast_channel_name() accessors need to be + * called with the associated channel lock held. + */ + if ((unhold_c1 = ast_channel_hold_state(c1) == AST_CONTROL_HOLD)) { + ast_debug(1, "Channel %s simulating UNHOLD for bridge simple join.\n", ast_channel_name(c1)); + } + + if ((unhold_c0 = ast_channel_hold_state(c0) == AST_CONTROL_HOLD)) { + ast_debug(1, "Channel %s simulating UNHOLD for bridge simple join.\n", ast_channel_name(c0)); + } + ast_channel_unlock(c0); ast_channel_unlock(c1); + if (unhold_c1) { + ast_indicate(c1, AST_CONTROL_UNHOLD); + } + + if (unhold_c0) { + ast_indicate(c0, AST_CONTROL_UNHOLD); + } + if (!new_top) { /* Failure. We'll just have to live with the current topology. */ return 0; diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/build_tools/download_externals asterisk-18.12.0~dfsg+~cs6.12.40431413/build_tools/download_externals --- asterisk-18.11.2~dfsg+~cs6.10.40431413/build_tools/download_externals 2022-04-14 21:53:34.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/build_tools/download_externals 2022-05-12 11:50:59.000000000 +0000 @@ -109,7 +109,7 @@ remote_url="${remote_url}/asterisk-${major_version}/x86-${host_bits}" else directory_name=$(${XMLSTARLET} sel -t -v "/menu/category/member[@name = '${member_name}']/member_data/downloader/@directory_name" ${ASTTOPDIR}/menuselect-tree || :) - remote_url="http://downloads.digium.com/pub/telephony/${directory_name:-${module_name}}/asterisk-${major_version}/x86-${host_bits}" + remote_url="https://downloads.digium.com/pub/telephony/${directory_name:-${module_name}}/asterisk-${major_version}/x86-${host_bits}" fi fi diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/cdr/cdr_adaptive_odbc.c asterisk-18.12.0~dfsg+~cs6.12.40431413/cdr/cdr_adaptive_odbc.c --- asterisk-18.11.2~dfsg+~cs6.10.40431413/cdr/cdr_adaptive_odbc.c 2022-04-14 21:53:34.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/cdr/cdr_adaptive_odbc.c 2022-05-12 11:50:59.000000000 +0000 @@ -564,6 +564,7 @@ break; case SQL_TYPE_TIMESTAMP: case SQL_TIMESTAMP: + case SQL_DATETIME: if (ast_strlen_zero(colptr)) { continue; } else { diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/ChangeLog asterisk-18.12.0~dfsg+~cs6.12.40431413/ChangeLog --- asterisk-18.11.2~dfsg+~cs6.10.40431413/ChangeLog 2022-04-14 21:53:34.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/ChangeLog 2022-05-12 11:50:59.000000000 +0000 @@ -1,19 +1,510 @@ -2022-04-14 21:53 +0000 Asterisk Development Team +2022-05-12 11:50 +0000 Asterisk Development Team - * asterisk 18.11.2 Released. + * asterisk 18.12.0 Released. -2022-04-14 16:37 +0000 [94eac3c13c] Asterisk Development Team +2022-05-05 14:28 +0000 Asterisk Development Team - * Doing a fresh summary + * asterisk 18.12.0-rc1 Released. -2022-04-14 16:00 +0000 [3ca29c9554] Asterisk Development Team +2022-05-05 09:14 +0000 [efca7f4e8d] Asterisk Development Team - * Update for 18.11.2 + * Update CHANGES and UPGRADE.txt for 18.12.0 +2022-04-29 03:47 +0000 [1e6991f95e] Maximilian Fridrich -2022-04-14 15:47 +0000 [1422d098e7] Asterisk Development Team + * core_unreal: Flip stream direction of second channel. + + When a new unreal (local) channel is created, a second (;2) channel is + created as a counterpart which clones the topology of the first + channel. This creates issues when an outgoing stream is sendonly or + recvonly as the stream state of the inbound channel will be the same + as the stream state of the outbound channel. + + Now the stream state is flipped for the streams of the 2nd channel in + ast_unreal_new_channels if the outgoing stream topology is recvonly or + sendonly. + + ASTERISK-29655 + Reported by: Michael Auracher + + ASTERISK-29638 + Reported by: Michael Auracher + + Change-Id: I0cea29635bb20b7bf7fd0fb95498cd44dab98fbf + +2022-03-27 07:33 +0000 [085f33b7a3] Naveen Albert + + * chan_dahdi: Document dial resource options. + + Documents the Dial syntax for DAHDI, namely the channel group, + distinctive ring, answer confirmation, and digital call options + that are specified in the resource itself. + + ASTERISK-24827 #close + + Change-Id: Ib95e78497fb00dc5cbfde1c93a69f034bfd08c30 + +2022-03-29 18:47 +0000 [a4f04666b5] Naveen Albert + + * chan_dahdi: Don't allow MWI FSK if channel not idle. + + For lines that have mailboxes configured on them, with + FSK MWI, DAHDI will periodically try to dispatch FSK + to update MWI. However, this is never supposed to be + done when a channel is not idle. + + There is currently an edge case where MWI FSK can + extraneously get spooled for the channel if a caller + hook flashes and hangs up, which triggers a recall ring. + After one ring, the on hook time threshold in this if + condition has been satisfied and an MWI update is spooled. + This means that when the phone is picked up again, the + answerer gets an FSK spill before being reconnected to + the party on hold. + + To prevent this, we now explicitly check to ensure that + subchannel 0 has no owner. There is no owner when DAHDI + channels are idle, but if the channel is "in use" in some + way (such as in the aforementioned scenario), then there + is an owner, and we shouldn't process MWI at this time. + + ASTERISK-28518 #close + + Change-Id: Ia3904434fd81688d71742f7e84358b7e1c38e92a + +2022-02-23 10:29 +0000 [216a55408e] Michael Cargile + + * apps/confbridge: Added hear_own_join_sound option to control who hears sound_join + + Added the hear_own_join_sound option to the confbridge user profile to + control who hears the sound_join audio file. When set to 'yes' the user + entering the conference and the participants already in the conference + will hear the sound_join audio file. When set to 'no' the user entering + the conference will not hear the sound_join audio file, but the + participants already in the conference will hear the sound_join audio + file. + + ASTERISK-29931 + Added by Michael Cargile + + Change-Id: I856bd66dc0dfa057323860a6418c1371d249abd2 + +2022-03-27 06:23 +0000 [cb53ad5671] Naveen Albert + + * chan_dahdi: Don't append cadences on dahdi restart. + + Currently, if any custom ring cadences are specified, they are + appended to the array of cadences from wherever we left off + last time. This works properly the first time, but on subsequent + dahdi restarts, it means that the existing cadences are left + alone and (most likely) the same cadences are then re-added + afterwards. In short order, the cadence array gets maxed out + and the user begins seeing warnings that the array is full + and no more cadences may be added. + + This buggy behavior persists until Asterisk is completely + restarted; however, if and when dahdi restart is run again, + then the same problem is reintroduced. + + This fixes this behavior so that cadence parsing is more + idempotent, that is so running dahdi restart multiple times + starts adding cadences from the beginning, rather than from + wherever the last cadence was added. + + As before, it is still not possible to revert to the default + cadences by simply removing all cadences in this manner, nor + is it possible to delete existing cadences. However, this + does make it possible to update existing cadences, which + was not possible before, and also ensures that the cadences + remain unchanged if the config remains unchanged. + + ASTERISK-29990 #close + + Change-Id: Ie32ea3e8a243b766756b1afce684d4a31ee7421d + +2022-04-02 16:22 +0000 [9dc321cbcb] Naveen Albert + + * chan_iax2: Prevent crash if dialing RSA-only call without outkey. + + Currently, if attempting to place a call to a peer that only allows + RSA authentication, if we fail to provide an outkey when placing + the call, Asterisk will crash. + + This exposes the broader issue that IAX2 is prone to causing a crash + if encryption or decryption is attempted but we never initialized + the encryption and decryption keys. In other words, if the logic + to use encryption in chan_iax2 is not perfectly aligned with the + decision to build keys in the first place, then a crash is not + only possible but probable. This was demonstrated by ASTERISK_29264, + for instance. + + This permanently prevents such events from causing a crash by explicitly + checking that keys are initialized properly before setting the flags + to use encryption for the call. Instead of crashing, the call will + now abort. + + ASTERISK-30007 #close + + Change-Id: If925c3d86099ceac7f621804f2532baac5050c9a + +2022-02-05 09:03 +0000 [b4c17c2044] Naveen Albert + + * menuselect: Don't erroneously recompile modules. + + A bug in menuselect can cause modules that are disabled + by default to be recompiled every time a recompilation + occurs. This occurs for module categories that are NOT + positive output, as for these categories, the modules + contained in the makeopts file indicate modules which + should NOT be selected. The existing procedure of iterating + through these modules to mark modules as present is thus + insufficient. This has led to modules with a default_enabled + tag of "no" to get deleted and recompiled every time, even + when they haven't changed. + + To fix this, we now modify the mark as present behavior + for module categories that are not positive output. For + these, we start by iterating through the module tree + and marking all modules as present, then go back and + mark anything contained in the makeopts file as not + present. This ensures that makeopt selections are actually + used properly, regardless of whether a module category + uses positive output or not. + + ASTERISK-29728 #close + + Change-Id: Idf2974c4ed8d0ba3738a92f08a6082b234277b95 + +2022-03-31 10:44 +0000 [ff70b2aac6] Naveen Albert + + * app_meetme: Don't erroneously set global variables. + + The admin_exec function in app_meetme is used by the SLA + applications for internal bridging. However, in these cases, + chan is NULL. Currently, this function will set some status + variables that are intended for a channel, but since channel + is NULL, this is erroneously creating meaningless global + variables, which shouldn't be happening. This sets these + variables only if chan is not NULL. + + ASTERISK-30002 #close + + Change-Id: I817df6c26f5bda131678e56791b0b61ba64fc6f7 + +2022-03-14 20:41 +0000 [ce00f8758d] Naveen Albert + + * func_db: Add function to return cardinality at prefix + + Adds the DB_KEYCOUNT function, which can be used to retrieve + the number of keys at a given prefix in AstDB. + + ASTERISK-29968 #close + + Change-Id: Ib2393b77b7e962dbaae6192f8576bc3f6ba92d09 + +2022-03-29 19:22 +0000 [dd15cd049f] Naveen Albert + + * chan_dahdi: Fix insufficient array size for round robin. + + According to chan_dahdi.conf, up to 64 groups (numbered + 0 through 63) can be used when dialing DAHDI channels. + + However, currently dialing round robin with a group number + greater than 31 fails because the array for the round robin + structure is only size 32, instead of 64 as it should be. + + This fixes that so the round robin array size is consistent + with the actual groups capacity. + + ASTERISK-29994 + + Change-Id: I4caa08d7025f78ac75a0539f71aaf3eb3e85b3b7 + +2022-03-05 05:43 +0000 [09e989f972] Naveen Albert + + * asterisk.c: Warn of incompatibilities with remote console. + + Some command line options to Asterisk only apply when Asterisk + is started and cannot be used with remote console mode. If a + user tries to use any of these, they are currently simply + silently ignored. + + This prints out a warning if incompatible options are used, + informing users that an option used cannot be used with remote + console mode. Additionally, some clarifications are added to + the help text and man page. + + ASTERISK-22246 + ASTERISK-26582 + + Change-Id: I980a5380ef2c19e8ea348596396d5382893c4337 + +2021-06-21 07:49 +0000 [79689d9df8] Naveen Albert + + * func_evalexten: Extension evaluation function. + + This adds the EVAL_EXTEN function, which may be used to retrieve + the variable-substituted data at any extension. + + ASTERISK-29486 + + Change-Id: Iad81019689674c9f4ac77d235f5d7234adbb1432 + +2022-02-25 14:58 +0000 [4aac359d79] Naveen Albert + + * documentation: Adds versioning information. + + Adds version information for applications, functions, + and manager events/actions. + + This is not completely exhaustive by any means but + covers most new things added that have release + versioning information in the issue tracker. + + ASTERISK-29940 #close + + Change-Id: I506401e93c799715dbbe97c0a8ba18af2bf5e131 + +2022-02-26 03:07 +0000 [bb2102a991] Mark Petersen + + * chan_sip.c Session timers get removed on UPDATE + + If Asterisk receives a SIP REFER with Session-Timers UAC + maintain Session-Timers when sending UPDATE" + + ASTERISK-29843 + + Change-Id: I8e9a21c13bf757fa34d778f49ba3cf859b29ae5c + +2022-02-28 19:29 +0000 [ea02bc3685] Naveen Albert + + * file.c: Prevent formats from seeking negative offsets. + + Currently, if a user uses an application like ControlPlayback + to try to rewind a file past the beginning, this can throw + warnings when the file format (e.g. PCM) tries to seek to + a negative offset. + + Instead of letting file formats try (and fail) to seek a + negative offset, we instead now catch this in the rewind + function to ensure that we never seek an offset less than 0. + This prevents legitimate user actions from triggering warnings + from any particular file formats. + + ASTERISK-29943 #close + + Change-Id: Ia53f2623f57898f4b8e5c894b968b01e95426967 + +2022-02-26 06:37 +0000 [8bc6d42a27] Naveen Albert + + * chan_pjsip: Add ability to send flash events. + + PJSIP currently is capable of receiving flash events + and converting them to FLASH control frames, but it + currently lacks support for doing the reverse: taking + a FLASH control frame and converting it into a flash + event in the SIP domain. + + This adds the ability for PJSIP to process flash control + frames by converting them into the appropriate SIP INFO + message, which can then be sent to the peer. This allows, + for example, flash events to be sent between Asterisk + systems using PJSIP. + + ASTERISK-29941 #close + + Change-Id: I1590221a4d238597f79672fa5825dd4a920c94dd + +2021-12-26 15:39 +0000 [3686a97d79] Naveen Albert + + * cli: Add command to evaluate dialplan functions. + + Adds the dialplan eval function commands to evaluate a dialplan + function from the CLI. The return value and function result are + printed out and can be used for testing or debugging. + + ASTERISK-29820 #close + + Change-Id: I833e97ea54c49336aca145330a2adeebfad05209 + +2022-03-07 08:11 +0000 [4f7e3d1609] Mark Petersen + + * chan_sip: SIP route header is missing on UPDATE + + if Asterisk need to send an UPDATE before answer + on a channel that uses Record-Route: + it will not include a Route header + + ASTERISK-29955 + + Change-Id: Id1920ecbfea7739a038b14dc94487ecfe7b57eef + +2022-02-21 07:23 +0000 [16e59db514] Mark Petersen + + * chan_pjsip: add allow_sending_180_after_183 option + + added new global config option "allow_sending_180_after_183" + that if enabled will preserve 180 after a 183 + + ASTERISK-29842 + + Change-Id: I8a53f8c35595b6d16d8e86e241b5f110d92f3d18 + +2022-04-25 18:39 +0000 [ae1373d12d] Joshua C. Colp + + * manager: Terminate session on write error. + + On a write error to an AMI session a flag was set to + indicate that the write error had occurred, with the + expected result being that the session be terminated. + This was not actually happening and instead writing + would continue to be attempted. + + This change adds a check for the write error and causes + the session to actually terminate. + + ASTERISK-29948 + + Change-Id: Icaf5d413d4c0d5dc78292a17287fecc8720a31a5 + +2021-06-18 12:54 +0000 [2fb8667908] Kevin Harwell + + * res_aeap & res_speech_aeap: Add Asterisk External Application Protocol + + Add framework to connect to, and read and write protocol based + messages from and to an external application using an Asterisk + External Application Protocol (AEAP). This has been divided into + several abstractions: + + 1. transport - base communication layer (currently websocket only) + 2. message - AEAP description and data (currently JSON only) + 3. transaction - links/binds requests and responses + 4. aeap - transport, message, and transaction handler/manager + + This patch also adds an AEAP implementation for speech to text. + Existing speech API callbacks for speech to text have been completed + making it possible for Asterisk to connect to a configured external + translator service and provide audio for STT. Results can also be + received from the external translator, and made available as speech + results in Asterisk. + + Unit tests have also been created that test the AEAP framework, and + also the speech to text implementation. + + ASTERISK-29726 #close + + Change-Id: Iaa4b259f84aa63501e5fd2a6fb107f900b4d4ed2 + +2022-04-21 09:10 +0000 [6ac08fdcf8] Yury Kirsanov + + * bridge_simple.c: Unhold channels on join simple bridge. + + Patch provided inline by Yury Kirsanov on the linked issue and + approved by Josh Colp. + + ASTERISK-29253 #close + + Change-Id: I5b9ccc67ebf06e875ed061d9e7fc21f47b0a4e1f + +2021-03-29 12:28 +0000 [62f8e157fb] Ben Ford + + * res_aeap: Add basic config skeleton and CLI commands. + + Added support for a basic AEAP configuration read from aeap.conf. + Also added 2 CLI commands for showing individual configurations as + well as all of them: aeap show server and aeap show servers. + + Only one configuration option is required at the moment, and that one is + server_url. It must be a websocket URL. The other option, codecs, is + optional and will be used over the codecs specified on the endpoint if + provided. + + https://wiki.asterisk.org/wiki/pages/viewpage.action?pageId=45482453 + + Change-Id: I567ac5148c92b98d29d2ad83421b416b75ffdaa3 + (cherry picked from commit 45a1977de49f56de5875a2cde951780de146762d) + +2022-04-06 05:23 +0000 [09e8667fa5] Joshua C. Colp + + * res_pjsip: Always set async_operations to 1. + + The async_operations setting on a transport configures how + many simultaneous incoming packets the transport can handle + when multiple threads are polling and waiting on the transport. + As we only use a single thread this was needlessly creating + incoming packets when set to a non-default value, wasting memory. + + ASTERISK-30006 + + Change-Id: I1915973ef352862dc2852a6ba4cfce2ed536e68f + +2022-04-21 10:26 +0000 [40f4268f2d] Ben Ford + + * res_pjsip_stir_shaken.c: Fix enabled when not configured. + + There was an issue with the conditional where STIR/SHAKEN would be + enabled even when not configured. It has been changed to ensure that if + a profile does not exist and stir_shaken is not set in pjsip.conf, then + the conditional will return from the function without performing + STIR/SHAKEN operations. + + ASTERISK-30024 + + Change-Id: I41286a3d35b033ccbfbe4129427a62cb793a86e6 + +2022-04-13 08:12 +0000 [37829b4461] Maximilian Fridrich + + * app_dial: Flip stream direction of outgoing channel. + + When executing dial, the topology of the incoming channel is cloned and + used for the outgoing channel. This creates issues when an incoming + stream is sendonly or recvonly as the stream state of the outgoing + channel will be the same as the stream state of the incoming channel. + + Now the stream state is flipped for the outgoing stream in + dial_exec_full if the incoming stream topology is recvonly or sendonly. + + ASTERISK-29655 + Reported by: Michael Auracher + + ASTERISK-29638 + Reported by: Michael Auracher + + Change-Id: I294dc834ac9a5f048b101b691669959e9df630e1 + +2022-04-19 10:36 +0000 [2587e58e05] Sean Bright + + * config.h: Don't use C++ keywords as argument names. + + ASTERISK-30021 #close + + Change-Id: I70eb59b782a4946b979942e21422746b7563029c + +2022-04-20 07:40 +0000 [ec8ab44b7f] Joshua C. Colp + + * cdr_adaptive_odbc: Add support for SQL_DATETIME field type. + + ASTERISK-30023 + + Change-Id: I0e1697f6af044e9eab7e07bbaeeffd1bb68ac34a + +2022-04-11 04:30 +0000 [8500210611] Joshua C. Colp + + * pjsip: Increase maximum number of format attributes. + + Chrome has added more attributes, causing the limit to be + exceeded. This raises it up some more. + + ASTERISK-30015 + + Change-Id: I964957c005c4e6f7871b15ea1ccd9b4659c7ef32 + +2022-04-14 15:47 +0000 [801317ae05] Asterisk Development Team * Update CHANGES and UPGRADE.txt for 18.11.2 -2022-02-28 11:19 +0000 [353142a2b4] Ben Ford +2022-03-17 10:23 +0000 [f325cb3d13] Asterisk Development Team + + * Update CHANGES and UPGRADE.txt for 18.11.0 +2022-02-28 11:19 +0000 [11accf8064] Ben Ford * AST-2022-002 - res_stir_shaken/curl: Add ACL checks for Identity header. @@ -32,19 +523,7 @@ Change-Id: I87fa61f78a9ea0cd42530691a30da3c781842406 -2022-01-07 08:50 +0000 [1fdb1a6edf] Ben Ford - - * AST-2022-001 - res_stir_shaken/curl: Limit file size and check start. - - Put checks in place to limit how much we will actually download, as well - as a check for the data we receive at the start to ensure it begins with - what we would expect a certificate to begin with. - - ASTERISK-29872 - - Change-Id: Ifd3c6b8bd52b8b6192a04166ccce4fc8a8000b46 - -2022-02-10 06:02 +0000 [88522c22aa] Joshua C. Colp +2022-02-10 06:02 +0000 [39cd09c246] Joshua C. Colp * func_odbc: Add SQL_ESC_BACKSLASHES dialplan function. @@ -63,11 +542,142 @@ Change-Id: I152bf34899b96ddb09cca3e767254d8d78f0c83d -2022-03-29 21:46 +0000 Asterisk Development Team +2022-01-07 08:50 +0000 [33091c2659] Ben Ford + + * AST-2022-001 - res_stir_shaken/curl: Limit file size and check start. + + Put checks in place to limit how much we will actually download, as well + as a check for the data we receive at the start to ensure it begins with + what we would expect a certificate to begin with. + + ASTERISK-29872 + + Change-Id: Ifd3c6b8bd52b8b6192a04166ccce4fc8a8000b46 + +2022-03-04 19:41 +0000 [9024bb989b] Naveen Albert + + * app_mf, app_sf: Return -1 if channel hangs up. + + The ReceiveMF and ReceiveSF applications currently always + return 0, even if a channel has hung up. The call will still + end but generally applications are expected to return -1 if + the channel has hung up. + + We now return -1 if a hangup occured to bring this behavior + in line with this norm. This has no functional impact, but + merely increases conformity with how these modules interact + with the PBX core. + + ASTERISK-29951 #close + + Change-Id: I234d755050ab8ed58f197c6925b968ba26b14033 + +2022-01-22 09:53 +0000 [b7edc08e33] Naveen Albert + + * app_queue: Add music on hold option to Queue. + + Adds the m option to the Queue application, which allows a + music on hold class to be specified at runtime which will + override the class configured in queues.conf. + + This option functions like the m option to Dial. + + ASTERISK-29876 #close + + Change-Id: Ie25a48569cf8755c305c9438b1ed292c3adcf8d7 + +2022-03-05 09:40 +0000 [b2d5bd4cb8] Naveen Albert + + * app_meetme: Emit warning if conference not found. + + Currently, if a user tries to access a non-dynamic + MeetMe conference and the conference is not found, + the call simply silent hangs up. There is no indication + to the user that anything went wrong at all. + + This changes the relevant debug message to a warning + so that the user is notified of this invalidity. + + ASTERISK-29954 #close + + Change-Id: Iebcfae3755d00f2150d676ee211c57bc59530048 + +2022-02-22 14:51 +0000 [82dbfe7783] Boris P. Korzun + + * res_pjsip_sdp_rtp: Improve detecting of lack of RTP activity + + Change RTP timer behavior for detecting RTP only after two-way + SDP channel establishment. Ignore detecting after receiving 183 + with SDP or while direct media is used. + Make rtp_timeout and rtp_timeout_hold options consistent to rtptimeout + and rtpholdtimeout options in chan_sip. + + ASTERISK-26689 #close + ASTERISK-29929 #close + + Change-Id: I07326d5b9c40f25db717fd6075f6f3a8d77279eb + +2022-02-24 11:48 +0000 [e5e02f783d] Joshua C. Colp + + * pjproject: Update bundled to 2.12 release. + + This change removes patches which have been merged into + upstream and updates some existing ones. It also adds + some additional config_site.h changes to restore previous + behavior, as well as a patch to allow multiple Authorization + headers. There seems to be some confusion or disagreement + on language in RFC 8760 in regards to whether multiple + Authorization headers are supported. The RFC implies it + is allowed, as does some past sipcore discussion. There is + also the catch all of "local policy" to allow it. In + the case of Asterisk we allow it. + + ASTERISK-29351 + + Change-Id: Id39ece02dedb7b9f739e0e37ea47d76854af7191 + +2022-03-23 17:45 +0000 [ec5b449bcf] Kevin Harwell + + * res_pjsip_header_funcs: wrong pool used tdata headers + + When adding headers to an outgoing request the headers were cloned using + the dialog's pool when they should have been cloned using tdata's pool. + Under certain circumstances it was possible for the dialog object, and + its pool to be freed while tdata is still active and available. Thus the + cloned header "disappeared", and when tdata tried to later access it a + crash would occur. + + This patch makes it so all added headers are cloned appropriately using + tdata's pool. + + ASTERISK-29411 #close + ASTERISK-29535 #close + + Change-Id: I9852025b5ee93ce1c038209150ee9dba1e0767c5 + +2022-03-05 10:26 +0000 [bd69639a6b] Naveen Albert + + * pbx.c: Warn if there are too many includes in a context. + + The PBX core uses the stack when it comes to includes, which + means that a context can only contain strictly fewer than + AST_PBX_MAX_STACK includes. If this is exceeded, then warnings + will be emitted for each number of includes beyond this if + searching for an extension in the including context, and if + the extension's inclusion is beyond the stack size, it will + simply not be found. + + To address this, we now check if there are too many includes + in a context when the dialplan is reloaded so that if there + is an issue, the user is aware of at "compile time" as opposed + to "run time" only. Secondly, more details are printed out + when this message is encountered so it's clear what has happened. + + ASTERISK-26719 - * asterisk 18.11.1 Released. + Change-Id: Ia3700452e75a7af3391b3e82ee69f06a669f8958 -2022-03-25 09:33 +0000 [663b565647] George Joseph +2022-03-25 09:33 +0000 [dd704bbba5] George Joseph * make_xml_documentation: Remove usage of get_sourceable_makeopts @@ -81,7 +691,7 @@ Change-Id: Idf2a90902228c2558daa5be7a4f8327556099cd2 -2022-03-25 14:00 +0000 [99fa792482] George Joseph +2022-03-25 14:00 +0000 [2d3297d4f3] George Joseph * Makefile: Disable XML doc validation @@ -96,9 +706,211 @@ Change-Id: Idc6c44114e7dd3fadae183a4e22f4fdba0b8a645 -2022-03-24 13:12 +0000 Asterisk Development Team +2022-02-04 18:36 +0000 [d9e55250dd] Birger Harzenetter (license 5870) + + * chan_iax2: Fix spacing in netstats command + + The iax2 show netstats command previously didn't contain + enough spacing in the header to properly align the table + header with the table body. This caused column headers + to not align with the values on longer channel names. + + Some spacing is added to account for the longest channel + names that display (before truncation occurs) so that + columns are always properly aligned. + + ASTERISK-29895 #close + patches: + 61205_misaligned2.patch submitted by Birger Harzenetter (license 5870) + + Change-Id: I450ce6bb81157b9d6d149007e53b749f237b6d9f + +2022-03-23 16:04 +0000 [a893fdd901] Marcel Wagner + + * documentation: Add information on running install_prereq script in readme + + Adding information in the readme about running the install_preqreq script to install components that the ./configure script might indicate as missing. + + ASTERISK-29976 #close + + Change-Id: Ic287b46300168729838bddd8f9265e98fc22bce6 + +2022-03-25 08:19 +0000 [777e9fde67] Sean Bright + + * openssl: Supress deprecation warnings from OpenSSL 3.0 + + There is work going on to update our OpenSSL usage to avoid the + deprecated functions but in the meantime make it possible to compile + in devmode. + + Change-Id: Ib082eb8b3751f0185d8aa8fe127da664c93f0726 + +2022-02-25 11:01 +0000 [dc129b6951] Naveen Albert + + * res_agi: Fix xmldocs bug with set music. + + The XML documentation for the SET MUSIC AGI + command is invalid, as the parameter does not + have a name and the on/off enum options for + the on/off argument are listed separately, which + is incorrect. The cumulative effect of these currently + is that the Asterisk Wiki documentation for SET MUSIC + is broken and external documentation generators crash + on SET MUSIC due to the malformed documentation. + + These issues are corrected so that the documentation + can be successfully parsed as with other similar AGI + commands. + + ASTERISK-29939 #close + ASTERISK-28891 #close + + Change-Id: I8c3d59897531bcbc401cbc7b00c9e2829dcb35f8 + (cherry picked from commit 37ece75677bff5655f0a3fb4dbda2b7c4847bc50) + +2022-03-13 12:46 +0000 [97c499ee34] Naveen Albert + + * chan_iax2: Fix perceived showing host address. + + ASTERISK_22025 introduced a regression that shows + the host IP and port as the perceived IP and port + again, as opposed to showing the actual perceived + address. This fixes this by showing the correct + information. + + ASTERISK-29048 #close + + Change-Id: I0ad3e25bc6b449e83ce72ea5d1a1cdba72aa304a + +2022-03-15 06:56 +0000 [b678624f04] Hugh McMaster + + * configure.ac: Use pkg-config to detect libxml2 + + Use pkg-config to detect libxml2, falling back to xml2-config if the + former is not available. + + This patch ensures Asterisk continues to build on systems without + xml2-config installed. + + The patch also updates the associated 'configure' files. + + ASTERISK-29970 #close + + Change-Id: I3c90dfe0b0590486cbb8e6d426a7c5c4199410c0 + +2022-02-13 13:06 +0000 [f50e793665] Philip Prindeville + + * time: add support for time64 libcs + + Treat time_t's as entirely unique and use the POSIX API's for + converting to/from strings. + + Lastly, a 64-bit integer formats as 20 digits at most in base10. + Don't need to have any 100 byte buffers to hold that. + + ASTERISK-29674 #close + + Signed-off-by: Philip Prindeville + Change-Id: Id7b25bdca8f92e34229f6454f6c3e500f2cd6f56 + +2022-03-15 12:24 +0000 [96a3ff9edd] Alexei Gradinari + + * res_pjsip_pubsub: RLS 'uri' list attribute mismatch with SUBSCRIBE request + + When asterisk generates the RLMI part of NOTIFY request, + the asterisk uses the local contact uri instead of the URI to which + the SUBSCRIBE request is sent. + Because of this mismatch some IP phones (for example Cisco 5XX) ignore + this list. + + According + https://datatracker.ietf.org/doc/html/rfc4662#section-5.2 + The first mandatory attribute is "uri", which contains the uri + that corresponds to the list. Typically, this is the URI to which + the SUBSCRIBE request was sent. + https://datatracker.ietf.org/doc/html/rfc4662#section-5.3 + The "uri" attribute identifies the resource to which the + element corresponds. Typically, this will be a SIP URI that, if + subscribed to, would return the state of the resource. + + This patch makes asterisk to generate URI using SUBSCRIBE request URI. + + ASTERISK-29961 #close + + Change-Id: I1fcfc08fd589677f40608c59a4e143c45ee05f6c + +2022-02-21 19:05 +0000 [140c19c206] Philip Prindeville + + * logger: workaround woefully small BUFSIZ in MUSL + + MUSL defines BUFSIZ as 1024 which is not reasonable for log messages. + + More broadly, BUFSIZ is the amount of buffering stdio.h does, which + is arbitrary and largely orthogonal to what logging should accept + as the maximum message size. + + ASTERISK-29928 + + Signed-off-by: Philip Prindeville + Change-Id: Iaa49fbbab029c64ae3d95e4b18270e0442cce170 + +2022-03-10 11:07 +0000 [3a7d83087b] Sean Bright + + * stasis_recording: Perform a complete match on requested filename. + + Using the length of a file found on the filesystem rather than the + file being requested could result in filenames whose names are + substrings of another to be erroneously matched. + + We now ensure a complete comparison before returning a positive + result. + + ASTERISK-29960 #close + + Change-Id: Id3ffc77681b9b75b8569062f3d952a128a21c71a + +2022-03-22 09:01 +0000 [2b636f3766] Sean Bright + + * download_externals: Use HTTPS for downloads + + ASTERISK-29980 #close + + Change-Id: I7b347665822ea2774dd322276c09be67914d2065 + +2022-03-04 14:26 +0000 [81a990b8d2] Sean Bright + + * conversions.c: Specify that we only want to parse decimal numbers. + + Passing 0 as the last argument to strtoimax() or strtoumax() causes + octal and hexadecimal to be accepted which was not originally + intended. So we now force to only accept decimal. + + ASTERISK-29950 #close + + Change-Id: I93baf0f273441e8280354630a463df263a8c0edd + +2022-03-05 06:04 +0000 [a66b6647b2] Naveen Albert + + * app_dial: Document DIALSTATUS return values. + + Adds documentation for all of the possible return values + for the DIALSTATUS variable in the Dial application. + + ASTERISK-25716 + + Change-Id: Id22593f1f1f7ea86e5734cee49516ec50848e8c0 + +2022-03-14 11:57 +0000 [b407511f02] Naveen Albert + + * pbx_builtins: Add missing options documentation + + BackGround and WaitExten both accept options that are not + currently documented. This adds documentation for these + options to the xml documentation for each application. + + ASTERISK-29967 #close - * asterisk 18.11.0 Released. + Change-Id: If812a9f1ccbba3e4d427a0e7a6dea923c2f905f7 2022-03-17 15:40 +0000 Asterisk Development Team diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/CHANGES asterisk-18.12.0~dfsg+~cs6.12.40431413/CHANGES --- asterisk-18.11.2~dfsg+~cs6.10.40431413/CHANGES 2022-04-14 21:53:34.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/CHANGES 2022-05-12 11:50:59.000000000 +0000 @@ -13,6 +13,70 @@ ============================================================================== ------------------------------------------------------------------------------ +--- Functionality changes from Asterisk 18.11.3 to Asterisk 18.12.0 ---------- +------------------------------------------------------------------------------ + +app_confbridge +------------------ + * Added the hear_own_join_sound option to the confbridge user profile to + control who hears the sound_join audio file. When set to 'yes' the user + entering the conference and the participants already in the conference + will hear the sound_join audio file. When set to 'no' the user entering + the conference will not hear the sound_join audio file, but the + participants already in the conference will hear the sound_join audio file. + +app_queue +------------------ + * The m option now allows an override music on hold + class to be specified for the Queue application + within the dialplan. + +chan_dahdi +------------------ + * Previously, cadences were appended on dahdi restart, + rather than reloaded. This prevented cadences from + being updated and maxed out the available cadences + if reloaded multiple times. This behavior is fixed + so that reloading cadences is idempotent and cadences + can actually be reloaded. + +chan_pjsip +------------------ + * added global config option "allow_sending_180_after_183" + + Allow Asterisk to send 180 Ringing to an endpoint + after 183 Session Progress has been send. + If disabled Asterisk will instead send only a + 183 Session Progress to the endpoint. + + * Hook flash events can now be sent on a PJSIP channel + if requested to do so. + +chan_sip +------------------ + * Session timers get removed on UPDATE + Fix if Asterisk receives a SIP REFER with Session-Timers UAC + that Asterisk maintains Session-Timers when sending UPDATE request + +cli +------------------ + * A new CLI command 'dialplan eval function' has been + added which allows users to test the behavior of + dialplan function calls directly from the CLI. + +func_db +------------------ + * The function DB_KEYCOUNT has been added, which + returns the cardinality of the keys at a specified + prefix in AstDB, i.e. the number of keys at a + given prefix. + +func_evalexten +------------------ + * This adds the EVAL_EXTEN function which may be + used to evaluate data at dialplan extensions. + +------------------------------------------------------------------------------ --- Functionality changes from Asterisk 18.11.1 to Asterisk 18.11.2 ---------- ------------------------------------------------------------------------------ diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/channels/chan_dahdi.c asterisk-18.12.0~dfsg+~cs6.12.40431413/channels/chan_dahdi.c --- asterisk-18.11.2~dfsg+~cs6.10.40431413/channels/chan_dahdi.c 2022-04-14 21:53:34.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/channels/chan_dahdi.c 2022-05-12 11:50:59.000000000 +0000 @@ -234,6 +234,59 @@ + + DAHDI allows several modifiers to be specified as part of the resource. + The general syntax is : + Dial(DAHDI/pseudo[/extension]) + Dial(DAHDI/<channel#>[c|r<cadance#>|d][/extension]) + Dial(DAHDI/(g|G|r|R)<group#(0-63)>[c|r<cadance#>|d][/extension]) + The following modifiers may be used before the channel number: + + + Search forward, dialing on first available channel in group (lowest to highest). + + + Search backward, dialing on first available channel in group (highest to lowest). + + + Round robin search forward, picking up from where last left off (lowest to highest). + + + Round robin search backward, picking up from where last left off (highest to lowest). + + + The following modifiers may be used after the channel number: + + + Wait for DTMF digit # before providing answer supervision. + This can be useful on outbound calls via FXO ports, as otherwise + they would indicate answer immediately. + + + Force bearer capability for ISDN/SS7 call to digital. + + + ISDN span channel restriction. + Used by CC to ensure that the CC recall goes out the same span. + Also to make ISDN channel names dialable when the sequence number + is stripped off. (Used by DTMF attended transfer feature.) + + + Specifies the distinctive ring cadence number to use immediately after + specifying this option. There are 4 default built-in cadences, and up to 24 + total cadences may be configured. + + + + same => n,Dial(DAHDI/g1/5551212) + + + same => n,Dial(DAHDI/4r2) + + + same => n,Dial(DAHDI/3c/5551212) + + Transfer DAHDI Channel. @@ -3410,7 +3463,7 @@ }; /*! Round robin search locations. */ -static struct dahdi_pvt *round_robin[32]; +static struct dahdi_pvt *round_robin[64]; /* groups can range from 0-63 */ int _dahdi_get_index(struct ast_channel *ast, struct dahdi_pvt *p, int nullok, const char *fname, unsigned long line) { @@ -11573,6 +11626,7 @@ && !analog_p->fxsoffhookstate && !last->owner && !ast_strlen_zero(last->mailbox) + && !analog_p->subs[SUB_REAL].owner /* could be a recall ring from a flash hook hold */ && (thispass - analog_p->onhooktime > 3)) { res = has_voicemail(last); if (analog_p->msgstate != res) { @@ -17873,6 +17927,9 @@ int y; struct ast_variable *dahdichan = NULL; + /* Re-parse any cadences from beginning, rather than appending until we run out of room */ + user_has_defined_cadences = 0; + for (; v; v = v->next) { if (!ast_jb_read_conf(&global_jbconf, v->name, v->value)) continue; diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/channels/chan_iax2.c asterisk-18.12.0~dfsg+~cs6.12.40431413/channels/chan_iax2.c --- asterisk-18.11.2~dfsg+~cs6.10.40431413/channels/chan_iax2.c 2022-04-14 21:53:34.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/channels/chan_iax2.c 2022-05-12 11:50:59.000000000 +0000 @@ -6379,6 +6379,18 @@ } } +static int invalid_key(ast_aes_decrypt_key *ecx) +{ + int i; + for (i = 0; i < 60; i++) { + if (ecx->rd_key[i]) { + return 0; /* stop if we encounter anything non-zero */ + } + } + /* if ast_aes_encrypt or ast_aes_decrypt is called, then we'll crash when calling AES_encrypt or AES_decrypt */ + return -1; +} + static void build_encryption_keys(const unsigned char *digest, struct chan_iax2_pvt *pvt) { build_ecx_key(digest, pvt); @@ -7375,7 +7387,7 @@ AST_LIST_TRAVERSE(®istrations, reg, entry) { snprintf(host, sizeof(host), "%s", ast_sockaddr_stringify(®->addr)); - snprintf(perceived, sizeof(perceived), "%s", ast_sockaddr_isnull(®->addr) ? "" : ast_sockaddr_stringify(®->addr)); + snprintf(perceived, sizeof(perceived), "%s", ast_sockaddr_isnull(®->us) ? "" : ast_sockaddr_stringify(®->us)); ast_cli(a->fd, FORMAT, host, (reg->dnsmgr) ? "Y" : "N", @@ -7407,7 +7419,7 @@ AST_LIST_TRAVERSE(®istrations, reg, entry) { snprintf(host, sizeof(host), "%s", ast_sockaddr_stringify(®->addr)); - snprintf(perceived, sizeof(perceived), "%s", ast_sockaddr_isnull(®->addr) ? "" : ast_sockaddr_stringify(®->addr)); + snprintf(perceived, sizeof(perceived), "%s", ast_sockaddr_isnull(®->us) ? "" : ast_sockaddr_stringify(®->us)); astman_append(s, "Event: RegistryEntry\r\n" @@ -7503,7 +7515,7 @@ int numchans = 0; char first_message[10] = { 0, }; char last_message[10] = { 0, }; -#define ACN_FORMAT1 "%-20.25s %4u %4d %4d %5d %3d %5d %4d %6d %4d %4d %5d %3d %5d %4d %6d %s%s %4s%s\n" +#define ACN_FORMAT1 "%-24.25s %4u %4d %4d %5d %3d %5d %4d %6d %4d %4d %5d %3d %5d %4d %6d %s%s %4s%s\n" #define ACN_FORMAT2 "%s %u %d %d %d %d %d %d %d %d %d %d %d %d %d %d %s%s %s%s\n" for (x = 0; x < ARRAY_LEN(iaxs); x++) { ast_mutex_lock(&iaxsl[x]); @@ -7597,8 +7609,8 @@ } if (a->argc != 3) return CLI_SHOWUSAGE; - ast_cli(a->fd, " -------- LOCAL --------------------- -------- REMOTE --------------------\n"); - ast_cli(a->fd, "Channel RTT Jit Del Lost %% Drop OOO Kpkts Jit Del Lost %% Drop OOO Kpkts FirstMsg LastMsg\n"); + ast_cli(a->fd, " -------- LOCAL --------------------- -------- REMOTE --------------------\n"); + ast_cli(a->fd, "Channel RTT Jit Del Lost %% Drop OOO Kpkts Jit Del Lost %% Drop OOO Kpkts FirstMsg LastMsg\n"); numchans = ast_cli_netstats(NULL, a->fd, 1); ast_cli(a->fd, "%d active IAX channel%s\n", numchans, (numchans != 1) ? "s" : ""); return CLI_SUCCESS; @@ -8435,7 +8447,7 @@ iax_ie_append_str(ied, IAX_IE_PASSWORD, secret); res = 0; } else - ast_log(LOG_NOTICE, "No way to send secret to peer '%s' (their methods: %d)\n", ast_sockaddr_stringify_addr(addr), authmethods); + ast_log(LOG_WARNING, "No way to send secret to peer '%s' (their methods: %d)\n", ast_sockaddr_stringify_addr(addr), authmethods); } return res; } @@ -8520,12 +8532,22 @@ } } + if (!(ies->authmethods & (IAX_AUTH_MD5 | IAX_AUTH_PLAINTEXT)) && (ies->authmethods & IAX_AUTH_RSA) && ast_strlen_zero(okey)) { + /* If the only thing available is RSA, and we don't have an outkey, we can't do it... */ + ast_log(LOG_WARNING, "Call terminated. RSA authentication requires an outkey\n"); + return -1; + } + if (ies->encmethods) { if (ast_strlen_zero(p->secret) && ((ies->authmethods & IAX_AUTH_RSA) || (ies->authmethods & IAX_AUTH_MD5) || (ies->authmethods & IAX_AUTH_PLAINTEXT))) { ast_log(LOG_WARNING, "Call terminated. Encryption requested by peer but no secret available locally\n"); return -1; } + /* Don't even THINK about trying to encrypt or decrypt anything if we don't have valid keys, for some reason... */ + /* If either of these happens, it's our fault, not the user's. But we should abort rather than crash. */ + ast_assert_return(!invalid_key(&p->ecx), -1); + ast_assert_return(!invalid_key(&p->dcx), -1); ast_set_flag64(p, IAX_ENCRYPTED | IAX_KEYPOPULATED); } else if (ast_test_flag64(iaxs[callno], IAX_FORCE_ENCRYPT)) { ast_log(LOG_NOTICE, "Call initiated without encryption while forceencryption=yes option is set\n"); diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/channels/chan_pjsip.c asterisk-18.12.0~dfsg+~cs6.12.40431413/channels/chan_pjsip.c --- asterisk-18.11.2~dfsg+~cs6.10.40431413/channels/chan_pjsip.c 2022-04-14 21:53:34.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/channels/chan_pjsip.c 2022-05-12 11:50:59.000000000 +0000 @@ -337,14 +337,6 @@ ast_sockaddr_setnull(&media->direct_media_addr); changed = 1; if (media->rtp) { - /* Direct media has ended - reset time of last received RTP packet - * to avoid premature RTP timeout. Synchronisation between the - * modification of direct_mdedia_addr+last_rx here and reading the - * values in res_pjsip_sdp_rtp.c:rtp_check_timeout() is provided - * by the channel's lock (which is held while this function is - * executed). - */ - ast_rtp_instance_set_last_rx(media->rtp, time(NULL)); ast_rtp_instance_set_prop(media->rtp, AST_RTP_PROPERTY_RTCP, 1); if (position != -1) { ast_channel_set_fd(chan, position + AST_EXTENDED_FDS, ast_rtp_instance_fd(media->rtp, 1)); @@ -1609,6 +1601,10 @@ SCOPE_EXIT_RTN_VALUE(res, "RC: %d\n", res); } +/* Forward declarations */ +static int transmit_info_dtmf(void *data); +static struct info_dtmf_data *info_dtmf_data_alloc(struct ast_sip_session *session, char digit, unsigned int duration); + /*! \brief Function called by core to ask the channel to indicate some sort of condition */ static int chan_pjsip_indicate(struct ast_channel *ast, int condition, const void *data, size_t datalen) { @@ -1629,6 +1625,10 @@ .data.ptr = (void *)data, }; char condition_name[256]; + unsigned int duration; + char digit; + struct info_dtmf_data *dtmf_data; + SCOPE_ENTER(3, "%s: Indicated %s\n", ast_channel_name(ast), ast_frame_subclass2str(&f, condition_name, sizeof(condition_name), NULL, 0)); @@ -1638,8 +1638,12 @@ if (channel->session->endpoint->inband_progress || (channel->session->inv_session && channel->session->inv_session->neg && pjmedia_sdp_neg_get_state(channel->session->inv_session->neg) == PJMEDIA_SDP_NEG_STATE_DONE)) { - response_code = 183; res = -1; + if (ast_sip_get_allow_sending_180_after_183()) { + response_code = 180; + } else { + response_code = 183; + } } else { response_code = 180; } @@ -1684,6 +1688,22 @@ } ast_devstate_changed(AST_DEVICE_UNKNOWN, AST_DEVSTATE_CACHABLE, "PJSIP/%s", ast_sorcery_object_get_id(channel->session->endpoint)); break; + case AST_CONTROL_FLASH: + duration = 300; + digit = '!'; + dtmf_data = info_dtmf_data_alloc(channel->session, digit, duration); + + if (!dtmf_data) { + res = -1; + break; + } + + if (ast_sip_push_task(channel->session->serializer, transmit_info_dtmf, dtmf_data)) { + ast_log(LOG_WARNING, "Error sending FLASH via INFO on channel %s\n", ast_channel_name(ast)); + ao2_ref(dtmf_data, -1); /* dtmf_data can't be null here */ + res = -1; + } + break; case AST_CONTROL_VIDUPDATE: for (i = 0; i < AST_VECTOR_SIZE(&channel->session->active_media_state->sessions); ++i) { media = AST_VECTOR_GET(&channel->session->active_media_state->sessions, i); diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/channels/chan_sip.c asterisk-18.12.0~dfsg+~cs6.12.40431413/channels/chan_sip.c --- asterisk-18.11.2~dfsg+~cs6.10.40431413/channels/chan_sip.c 2022-04-14 21:53:34.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/channels/chan_sip.c 2022-05-12 11:50:59.000000000 +0000 @@ -12441,9 +12441,8 @@ * Send UPDATE to the same destination as CANCEL, if call is not in final state. */ if (!sip_route_empty(&p->route) && - !(sipmethod == SIP_CANCEL || - (sipmethod == SIP_ACK && (p->invitestate == INV_COMPLETED || p->invitestate == INV_CANCELLED)) || - (sipmethod == SIP_UPDATE && (p->invitestate == INV_PROCEEDING || p->invitestate == INV_EARLY_MEDIA)))) { + !(sipmethod == SIP_CANCEL || + (sipmethod == SIP_ACK && (p->invitestate == INV_COMPLETED || p->invitestate == INV_CANCELLED)))) { if (p->socket.type != AST_TRANSPORT_UDP && p->socket.tcptls_session) { /* For TCP/TLS sockets that are connected we won't need * to do any hostname/IP lookups */ @@ -12451,6 +12450,11 @@ /* For NATed traffic, we ignore the contact/route and * simply send to the received-from address. No need * for lookups. */ + } else if (sipmethod == SIP_UPDATE && (p->invitestate == INV_PROCEEDING || p->invitestate == INV_EARLY_MEDIA)) { + /* Calling set_destination for an UPDATE in early dialog + * will result in mangling of the target for a subsequent + * CANCEL according to ASTERISK-24628 so do not do it. + */ } else { set_destination(p, sip_route_first_uri(&p->route)); } @@ -12501,11 +12505,9 @@ An exception to this behavior is the ACK request. Since Asterisk never requires session-timers support from a remote end-point (UAS) in an INVITE, it must not send 'Require: timer' header in the ACK request. - This should only be added in the INVITE transactions, not MESSAGE or REFER or other - in-dialog messages. */ if (p->stimer && p->stimer->st_active == TRUE && p->stimer->st_active_peer_ua == TRUE - && sipmethod == SIP_INVITE) { + && (sipmethod == SIP_INVITE || sipmethod == SIP_UPDATE)) { char se_hdr[256]; snprintf(se_hdr, sizeof(se_hdr), "%d;refresher=%s", p->stimer->st_interval, p->stimer->st_ref == SESSION_TIMER_REFRESHER_US ? "uac" : "uas"); diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/channels/pjsip/dialplan_functions.c asterisk-18.12.0~dfsg+~cs6.12.40431413/channels/pjsip/dialplan_functions.c --- asterisk-18.11.2~dfsg+~cs6.10.40431413/channels/pjsip/dialplan_functions.c 2022-04-14 21:53:34.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/channels/pjsip/dialplan_functions.c 2022-05-12 11:50:59.000000000 +0000 @@ -69,6 +69,12 @@ + + 13.18.0 + 14.7.0 + 15.1.0 + 16.0.0 + Get or change the DTMF mode for a SIP call. @@ -94,6 +100,11 @@ + + 13.12.0 + 14.1.0 + 15.0.0 + W/O: Initiate a session refresh via an UPDATE or re-INVITE on an established media session @@ -135,6 +146,11 @@ + + 13.24.0 + 16.1.0 + 17.0.0 + Parse an uri and return a type part of the URI. diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/codecs/codecs.xml asterisk-18.12.0~dfsg+~cs6.12.40431413/codecs/codecs.xml --- asterisk-18.11.2~dfsg+~cs6.10.40431413/codecs/codecs.xml 2022-04-14 21:53:34.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/codecs/codecs.xml 2022-05-12 11:50:59.000000000 +0000 @@ -1,4 +1,4 @@ - + external no_binary_modules xmlstarlet @@ -6,28 +6,28 @@ res_format_attr_opus no - + external no_binary_modules xmlstarlet bash no - + external no_binary_modules xmlstarlet bash no - + external no_binary_modules xmlstarlet bash no - + external no_binary_modules xmlstarlet diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/configs/samples/aeap.conf.sample asterisk-18.12.0~dfsg+~cs6.12.40431413/configs/samples/aeap.conf.sample --- asterisk-18.11.2~dfsg+~cs6.10.40431413/configs/samples/aeap.conf.sample 1970-01-01 00:00:00.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/configs/samples/aeap.conf.sample 2022-05-12 11:50:59.000000000 +0000 @@ -0,0 +1,21 @@ +; +; This file is used by the res_aeap module to configure parameters +; used for AEAP applications. +; +;[myclient] +; +; type must be "client". +;type=client +; +; URL used to connect to a server. It must be a websocket URL (ws or wss). +;url=ws://127.0.0.1:9099 +; +; codecs is comma separated string of allowed/disallowed codec names. +;codecs=!all,ulaw,alaw,opus +; +; protocol is the implementation specific sub-protocol +;protocol=speech_to_text +; +; "@" parameters can be specified and are used to to set custom values to +; be passed as "params" in the initial "setup" request. +;@language=en-US diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/configs/samples/chan_dahdi.conf.sample asterisk-18.12.0~dfsg+~cs6.12.40431413/configs/samples/chan_dahdi.conf.sample --- asterisk-18.11.2~dfsg+~cs6.10.40431413/configs/samples/chan_dahdi.conf.sample 2022-04-14 21:53:34.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/configs/samples/chan_dahdi.conf.sample 2022-05-12 11:50:59.000000000 +0000 @@ -1286,10 +1286,11 @@ ; You can define your own custom ring cadences here. You can define up to 8 ; pairs. If the silence is negative, it indicates where the caller ID spill is ; to be placed. Also, if you define any custom cadences, the default cadences -; will be turned off. +; will be turned off (overwritten). ; ; This setting is global, rather than per-channel. It will not update on -; a reload. +; a reload, but new and modified cadences will update on dahdi restart. +; A maximum of 24 cadences may be specified. ; ; Syntax is: cadence=ring,silence[,ring,silence[...]] ; diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/configs/samples/confbridge.conf.sample asterisk-18.12.0~dfsg+~cs6.12.40431413/configs/samples/confbridge.conf.sample --- asterisk-18.11.2~dfsg+~cs6.10.40431413/configs/samples/confbridge.conf.sample 2022-04-14 21:53:34.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/configs/samples/confbridge.conf.sample 2022-05-12 11:50:59.000000000 +0000 @@ -41,6 +41,12 @@ ; There are some prompts, such as the prompt to enter a PIN number, ; that must be played regardless of what this option is set to. ; Off by default +;hear_own_join_sound=yes ; Sets if a user joining the conference should hear the sound_join + ; audio sound when they enter the conference. If set to 'no' the + ; user will not hear the sound_join audio but the other participants + ; in the conference will still hear the audio. If set to 'yes' + ; everyone hears the sound_join audio when this user enters the conference. + ; On by default ;announce_user_count=yes ; Sets if the number of users should be announced to the ; caller. Off by default. ;announce_user_count_all=yes ; Sets if the number of users should be announced to diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/configs/samples/pjsip.conf.sample asterisk-18.12.0~dfsg+~cs6.12.40431413/configs/samples/pjsip.conf.sample --- asterisk-18.11.2~dfsg+~cs6.10.40431413/configs/samples/pjsip.conf.sample 2022-04-14 21:53:34.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/configs/samples/pjsip.conf.sample 2022-05-12 11:50:59.000000000 +0000 @@ -1025,8 +1025,6 @@ ;[transport] ; SYNOPSIS: SIP Transport ; -;async_operations=1 ; Number of simultaneous Asynchronous Operations - ; (default: "1") ;bind= ; IP Address and optional port to bind to for this transport (default: ; "") ; Note that for the Websocket transport the TLS configuration is configured @@ -1313,6 +1311,12 @@ ; creating an implicit subscription (see RFC 4488). ; (default: "yes") +;allow_sending_180_after_183=yes ; Allow Asterisk to send 180 Ringing to an endpoint + ; after 183 Session Progress has been send. + ; If disabled Asterisk will instead send only a + ; 183 Session Progress to the endpoint. + ; (default: "no") + ; MODULE PROVIDING BELOW SECTION(S): res_pjsip_acl ;==========================ACL SECTION OPTIONS========================= ;[acl] diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/configs/samples/queues.conf.sample asterisk-18.12.0~dfsg+~cs6.12.40431413/configs/samples/queues.conf.sample --- asterisk-18.11.2~dfsg+~cs6.10.40431413/configs/samples/queues.conf.sample 2022-04-14 21:53:34.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/configs/samples/queues.conf.sample 2022-05-12 11:50:59.000000000 +0000 @@ -64,8 +64,9 @@ ; ; Musicclass sets which music applies for this particular call queue. ; The only class which can override this one is if the MOH class is set +; using the m option when calling the Queue application or if set ; directly on the channel using Set(CHANNEL(musicclass)=whatever) in the -; dialplan. +; dialplan (the latter of which overrides everything). ; ;musicclass = default ; diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/configure asterisk-18.12.0~dfsg+~cs6.12.40431413/configure --- asterisk-18.11.2~dfsg+~cs6.10.40431413/configure 2022-04-14 21:53:34.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/configure 2022-05-12 11:50:59.000000000 +0000 @@ -1,11 +1,12 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for asterisk trunk. +# Generated by GNU Autoconf 2.71 for asterisk trunk. # # Report bugs to . # # -# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. +# Copyright (C) 1992-1996, 1998-2017, 2020-2021 Free Software Foundation, +# Inc. # # # This configure script is free software; the Free Software Foundation @@ -18,14 +19,16 @@ # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : +as_nop=: +if test ${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1 +then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST -else +else $as_nop case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( @@ -35,46 +38,46 @@ fi + +# Reset variables that may have inherited troublesome values from +# the environment. + +# IFS needs to be set, to space, tab, and newline, in precisely that order. +# (If _AS_PATH_WALK were called with IFS unset, it would have the +# side effect of setting IFS to empty, thus disabling word splitting.) +# Quoting is to prevent editors from complaining about space-tab. as_nl=' ' export as_nl -# Printing a long string crashes Solaris 7 /usr/bin/printf. -as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' -as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo -as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo -# Prefer a ksh shell builtin over an external printf program on Solaris, -# but without wasting forks for bash or zsh. -if test -z "$BASH_VERSION$ZSH_VERSION" \ - && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then - as_echo='print -r --' - as_echo_n='print -rn --' -elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then - as_echo='printf %s\n' - as_echo_n='printf %s' -else - if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then - as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' - as_echo_n='/usr/ucb/echo -n' - else - as_echo_body='eval expr "X$1" : "X\\(.*\\)"' - as_echo_n_body='eval - arg=$1; - case $arg in #( - *"$as_nl"*) - expr "X$arg" : "X\\(.*\\)$as_nl"; - arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; - esac; - expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" - ' - export as_echo_n_body - as_echo_n='sh -c $as_echo_n_body as_echo' - fi - export as_echo_body - as_echo='sh -c $as_echo_body as_echo' -fi +IFS=" "" $as_nl" + +PS1='$ ' +PS2='> ' +PS4='+ ' + +# Ensure predictable behavior from utilities with locale-dependent output. +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# We cannot yet rely on "unset" to work, but we need these variables +# to be unset--not just set to an empty or harmless value--now, to +# avoid bugs in old shells (e.g. pre-3.0 UWIN ksh). This construct +# also avoids known problems related to "unset" and subshell syntax +# in other old shells (e.g. bash 2.01 and pdksh 5.2.14). +for as_var in BASH_ENV ENV MAIL MAILPATH CDPATH +do eval test \${$as_var+y} \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : +done + +# Ensure that fds 0, 1, and 2 are open. +if (exec 3>&0) 2>/dev/null; then :; else exec 0&1) 2>/dev/null; then :; else exec 1>/dev/null; fi +if (exec 3>&2) ; then :; else exec 2>/dev/null; fi # The user is always right. -if test "${PATH_SEPARATOR+set}" != set; then +if ${PATH_SEPARATOR+false} :; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || @@ -83,13 +86,6 @@ fi -# IFS -# We need space, tab and new line, in precisely that order. Quoting is -# there to prevent editors from complaining about space-tab. -# (If _AS_PATH_WALK were called with IFS unset, it would disable word -# splitting by setting IFS to empty value.) -IFS=" "" $as_nl" - # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( @@ -98,8 +94,12 @@ for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + test -r "$as_dir$0" && as_myself=$as_dir$0 && break done IFS=$as_save_IFS @@ -111,30 +111,10 @@ as_myself=$0 fi if test ! -f "$as_myself"; then - $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + printf "%s\n" "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi -# Unset variables that we do not need and which cause bugs (e.g. in -# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" -# suppresses any "Segmentation fault" message there. '((' could -# trigger a bug in pdksh 5.2.14. -for as_var in BASH_ENV ENV MAIL MAILPATH -do eval test x\${$as_var+set} = xset \ - && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : -done -PS1='$ ' -PS2='> ' -PS4='+ ' - -# NLS nuisances. -LC_ALL=C -export LC_ALL -LANGUAGE=C -export LANGUAGE - -# CDPATH. -(unset CDPATH) >/dev/null 2>&1 && unset CDPATH # Use a proper internal environment variable to ensure we don't fall # into an infinite loop, continuously re-executing ourselves. @@ -156,20 +136,22 @@ exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. -$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 -as_fn_exit 255 +printf "%s\n" "$0: could not re-execute with $CONFIG_SHELL" >&2 +exit 255 fi # We don't want this to propagate to other subprocesses. { _as_can_reexec=; unset _as_can_reexec;} if test "x$CONFIG_SHELL" = x; then - as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : + as_bourne_compatible="as_nop=: +if test \${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1 +then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST -else +else \$as_nop case \`(set -o) 2>/dev/null\` in #( *posix*) : set -o posix ;; #( @@ -189,42 +171,53 @@ as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } -if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : +if ( set x; as_fn_ret_success y && test x = \"\$1\" ) +then : -else +else \$as_nop exitcode=1; echo positional parameters were not saved. fi test x\$exitcode = x0 || exit 1 +blah=\$(echo \$(echo blah)) +test x\"\$blah\" = xblah || exit 1 test -x / || exit 1" as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 test \$(( 1 + 1 )) = 2 || exit 1" - if (eval "$as_required") 2>/dev/null; then : + if (eval "$as_required") 2>/dev/null +then : as_have_required=yes -else +else $as_nop as_have_required=no fi - if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : + if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null +then : -else +else $as_nop as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_found=false for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac as_found=: case $as_dir in #( /*) for as_base in sh bash ksh sh5; do # Try only shells that exist, to save several forks. - as_shell=$as_dir/$as_base + as_shell=$as_dir$as_base if { test -f "$as_shell" || test -f "$as_shell.exe"; } && - { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : + as_run=a "$as_shell" -c "$as_bourne_compatible""$as_required" 2>/dev/null +then : CONFIG_SHELL=$as_shell as_have_required=yes - if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : + if as_run=a "$as_shell" -c "$as_bourne_compatible""$as_suggested" 2>/dev/null +then : break 2 fi fi @@ -232,14 +225,21 @@ esac as_found=false done -$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && - { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : - CONFIG_SHELL=$SHELL as_have_required=yes -fi; } IFS=$as_save_IFS +if $as_found +then : + +else $as_nop + if { test -f "$SHELL" || test -f "$SHELL.exe"; } && + as_run=a "$SHELL" -c "$as_bourne_compatible""$as_required" 2>/dev/null +then : + CONFIG_SHELL=$SHELL as_have_required=yes +fi +fi - if test "x$CONFIG_SHELL" != x; then : + if test "x$CONFIG_SHELL" != x +then : export CONFIG_SHELL # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also @@ -257,18 +257,19 @@ exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. -$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 +printf "%s\n" "$0: could not re-execute with $CONFIG_SHELL" >&2 exit 255 fi - if test x$as_have_required = xno; then : - $as_echo "$0: This script requires a shell more modern than all" - $as_echo "$0: the shells that I found on your system." - if test x${ZSH_VERSION+set} = xset ; then - $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" - $as_echo "$0: be upgraded to zsh 4.3.4 or later." + if test x$as_have_required = xno +then : + printf "%s\n" "$0: This script requires a shell more modern than all" + printf "%s\n" "$0: the shells that I found on your system." + if test ${ZSH_VERSION+y} ; then + printf "%s\n" "$0: In particular, zsh $ZSH_VERSION has bugs and should" + printf "%s\n" "$0: be upgraded to zsh 4.3.4 or later." else - $as_echo "$0: Please tell bug-autoconf@gnu.org and + printf "%s\n" "$0: Please tell bug-autoconf@gnu.org and $0: https://issues.asterisk.org about your system, $0: including any error possibly output before this $0: message. Then install a modern shell, or manually run @@ -296,6 +297,7 @@ } as_unset=as_fn_unset + # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. @@ -313,6 +315,14 @@ as_fn_set_status $1 exit $1 } # as_fn_exit +# as_fn_nop +# --------- +# Do nothing but, unlike ":", preserve the value of $?. +as_fn_nop () +{ + return $? +} +as_nop=as_fn_nop # as_fn_mkdir_p # ------------- @@ -327,7 +337,7 @@ as_dirs= while :; do case $as_dir in #( - *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *\'*) as_qdir=`printf "%s\n" "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" @@ -336,7 +346,7 @@ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$as_dir" | +printf "%s\n" X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q @@ -375,12 +385,13 @@ # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. -if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null +then : eval 'as_fn_append () { eval $1+=\$2 }' -else +else $as_nop as_fn_append () { eval $1=\$$1\$2 @@ -392,18 +403,27 @@ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. -if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null +then : eval 'as_fn_arith () { as_val=$(( $* )) }' -else +else $as_nop as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith +# as_fn_nop +# --------- +# Do nothing but, unlike ":", preserve the value of $?. +as_fn_nop () +{ + return $? +} +as_nop=as_fn_nop # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- @@ -415,9 +435,9 @@ as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi - $as_echo "$as_me: error: $2" >&2 + printf "%s\n" "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error @@ -444,7 +464,7 @@ $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X/"$0" | +printf "%s\n" X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q @@ -488,7 +508,7 @@ s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || - { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } + { printf "%s\n" "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } # If we had to re-execute with $CONFIG_SHELL, we're ensured to have # already done that, so ensure we don't try to do so again and fall @@ -502,6 +522,10 @@ exit } + +# Determine whether it's possible to make 'echo' print without a newline. +# These variables are no longer used directly by Autoconf, but are AC_SUBSTed +# for compatibility with existing Makefiles. ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) @@ -515,6 +539,13 @@ ECHO_N='-n';; esac +# For backward compatibility with old third-party macros, we provide +# the shell variables $as_echo and $as_echo_n. New code should use +# AS_ECHO(["message"]) and AS_ECHO_N(["message"]), respectively. +as_echo='printf %s\n' +as_echo_n='printf %s' + + rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file @@ -590,41 +621,37 @@ ac_unique_file="main/asterisk.c" # Factoring default headers for most tests. ac_includes_default="\ -#include -#ifdef HAVE_SYS_TYPES_H -# include -#endif -#ifdef HAVE_SYS_STAT_H -# include +#include +#ifdef HAVE_STDIO_H +# include #endif -#ifdef STDC_HEADERS +#ifdef HAVE_STDLIB_H # include -# include -#else -# ifdef HAVE_STDLIB_H -# include -# endif #endif #ifdef HAVE_STRING_H -# if !defined STDC_HEADERS && defined HAVE_MEMORY_H -# include -# endif # include #endif -#ifdef HAVE_STRINGS_H -# include -#endif #ifdef HAVE_INTTYPES_H # include #endif #ifdef HAVE_STDINT_H # include #endif +#ifdef HAVE_STRINGS_H +# include +#endif +#ifdef HAVE_SYS_TYPES_H +# include +#endif +#ifdef HAVE_SYS_STAT_H +# include +#endif #ifdef HAVE_UNISTD_H # include #endif" -ac_header_list= +ac_header_c_list= +ac_func_c_list= ac_subst_vars='LTLIBOBJS PBX_SYSLOG PBX_SYSLOG_FACILITY_LOG_UUCP @@ -707,6 +734,8 @@ PERMANENT_DLOPEN DISABLE_XMLDOC CONFIG_LIBXML2 +LIBXML2_LIBS +LIBXML2_CFLAGS JANSSON_LIBS JANSSON_CFLAGS UUID_LIB @@ -1271,14 +1300,17 @@ AR ac_ct_STRIP STRIP +GREP GNU_MAKE LN_S INSTALL_DATA INSTALL_SCRIPT INSTALL_PROGRAM AWK +EGREP SED CXXCPP +CPP ac_ct_CXX CXXFLAGS CROSS_COMPILING @@ -1312,9 +1344,6 @@ astetcdir astcachedir astsbindir -EGREP -GREP -CPP OBJEXT EXEEXT ac_ct_CC @@ -1474,10 +1503,10 @@ LDFLAGS LIBS CPPFLAGS -CPP CXX CXXFLAGS CCC +CPP CXXCPP PKG_CONFIG PKG_CONFIG_PATH @@ -1491,6 +1520,8 @@ LIBEDIT_LIBS JANSSON_CFLAGS JANSSON_LIBS +LIBXML2_CFLAGS +LIBXML2_LIBS ILBC_CFLAGS ILBC_LIBS NETSNMP_CFLAGS @@ -1575,8 +1606,6 @@ *) ac_optarg=yes ;; esac - # Accept the important Cygnus configure options, so we can diagnose typos. - case $ac_dashdash$ac_option in --) ac_dashdash=yes ;; @@ -1617,9 +1646,9 @@ ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error $? "invalid feature name: $ac_useropt" + as_fn_error $? "invalid feature name: \`$ac_useropt'" ac_useropt_orig=$ac_useropt - ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" @@ -1643,9 +1672,9 @@ ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error $? "invalid feature name: $ac_useropt" + as_fn_error $? "invalid feature name: \`$ac_useropt'" ac_useropt_orig=$ac_useropt - ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" @@ -1856,9 +1885,9 @@ ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error $? "invalid package name: $ac_useropt" + as_fn_error $? "invalid package name: \`$ac_useropt'" ac_useropt_orig=$ac_useropt - ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" @@ -1872,9 +1901,9 @@ ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error $? "invalid package name: $ac_useropt" + as_fn_error $? "invalid package name: \`$ac_useropt'" ac_useropt_orig=$ac_useropt - ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" @@ -1918,9 +1947,9 @@ *) # FIXME: should be removed in autoconf 3.0. - $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 + printf "%s\n" "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && - $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 + printf "%s\n" "$as_me: WARNING: invalid host type: $ac_option" >&2 : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" ;; @@ -1936,7 +1965,7 @@ case $enable_option_checking in no) ;; fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; - *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; + *) printf "%s\n" "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; esac fi @@ -2000,7 +2029,7 @@ X"$as_myself" : 'X\(//\)[^/]' \| \ X"$as_myself" : 'X\(//\)$' \| \ X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$as_myself" | +printf "%s\n" X"$as_myself" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q @@ -2247,9 +2276,9 @@ LIBS libraries to pass to the linker, e.g. -l CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I if you have headers in a nonstandard directory - CPP C preprocessor CXX C++ compiler command CXXFLAGS C++ compiler flags + CPP C preprocessor CXXCPP C++ preprocessor PKG_CONFIG path to pkg-config utility PKG_CONFIG_PATH @@ -2274,6 +2303,10 @@ C compiler flags for JANSSON, overriding pkg-config JANSSON_LIBS linker flags for JANSSON, overriding pkg-config + LIBXML2_CFLAGS + C compiler flags for LIBXML2, overriding pkg-config + LIBXML2_LIBS + linker flags for LIBXML2, overriding pkg-config ILBC_CFLAGS C compiler flags for ILBC, overriding pkg-config ILBC_LIBS linker flags for ILBC, overriding pkg-config NETSNMP_CFLAGS @@ -2321,9 +2354,9 @@ case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) - ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` + ac_dir_suffix=/`printf "%s\n" "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. - ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + ac_top_builddir_sub=`printf "%s\n" "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; @@ -2351,7 +2384,8 @@ ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix cd "$ac_dir" || { ac_status=$?; continue; } - # Check for guested configure. + # Check for configure.gnu first; this name is used for a wrapper for + # Metaconfig's "Configure" on case-insensitive file systems. if test -f "$ac_srcdir/configure.gnu"; then echo && $SHELL "$ac_srcdir/configure.gnu" --help=recursive @@ -2359,7 +2393,7 @@ echo && $SHELL "$ac_srcdir/configure" --help=recursive else - $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 + printf "%s\n" "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done @@ -2369,9 +2403,9 @@ if $ac_init_version; then cat <<\_ACEOF asterisk configure trunk -generated by GNU Autoconf 2.69 +generated by GNU Autoconf 2.71 -Copyright (C) 2012 Free Software Foundation, Inc. +Copyright (C) 2021 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. @@ -2390,14 +2424,14 @@ ac_fn_c_try_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - rm -f conftest.$ac_objext + rm -f conftest.$ac_objext conftest.beam if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 +printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>conftest.err ac_status=$? if test -s conftest.err; then @@ -2405,14 +2439,15 @@ cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest.$ac_objext; then : + } && test -s conftest.$ac_objext +then : ac_retval=0 -else - $as_echo "$as_me: failed program was:" >&5 +else $as_nop + printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 @@ -2422,176 +2457,6 @@ } # ac_fn_c_try_compile -# ac_fn_c_try_cpp LINENO -# ---------------------- -# Try to preprocess conftest.$ac_ext, and return whether this succeeded. -ac_fn_c_try_cpp () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - if { { ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err - ac_status=$? - if test -s conftest.err; then - grep -v '^ *+' conftest.err >conftest.er1 - cat conftest.er1 >&5 - mv -f conftest.er1 conftest.err - fi - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } > conftest.i && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then : - ac_retval=0 -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_retval=1 -fi - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - as_fn_set_status $ac_retval - -} # ac_fn_c_try_cpp - -# ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES -# ------------------------------------------------------- -# Tests whether HEADER exists, giving a warning if it cannot be compiled using -# the include files in INCLUDES and setting the cache variable VAR -# accordingly. -ac_fn_c_check_header_mongrel () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - if eval \${$3+:} false; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -$as_echo_n "checking for $2... " >&6; } -if eval \${$3+:} false; then : - $as_echo_n "(cached) " >&6 -fi -eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -else - # Is the header compilable? -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5 -$as_echo_n "checking $2 usability... " >&6; } -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$4 -#include <$2> -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_header_compiler=yes -else - ac_header_compiler=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5 -$as_echo "$ac_header_compiler" >&6; } - -# Is the header present? -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5 -$as_echo_n "checking $2 presence... " >&6; } -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include <$2> -_ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : - ac_header_preproc=yes -else - ac_header_preproc=no -fi -rm -f conftest.err conftest.i conftest.$ac_ext -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 -$as_echo "$ac_header_preproc" >&6; } - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #(( - yes:no: ) - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5 -$as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 -$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} - ;; - no:yes:* ) - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5 -$as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5 -$as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5 -$as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5 -$as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 -$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} -( $as_echo "## ------------------------------------------ ## -## Report this to https://issues.asterisk.org ## -## ------------------------------------------ ##" - ) | sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -$as_echo_n "checking for $2... " >&6; } -if eval \${$3+:} false; then : - $as_echo_n "(cached) " >&6 -else - eval "$3=\$ac_header_compiler" -fi -eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -fi - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - -} # ac_fn_c_check_header_mongrel - -# ac_fn_c_try_run LINENO -# ---------------------- -# Try to link conftest.$ac_ext, and return whether this succeeded. Assumes -# that executables *can* be run. -ac_fn_c_try_run () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - if { { ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' - { { case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; }; then : - ac_retval=0 -else - $as_echo "$as_me: program exited with status $ac_status" >&5 - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_retval=$ac_status -fi - rm -rf conftest.dSYM conftest_ipa8_conftest.oo - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - as_fn_set_status $ac_retval - -} # ac_fn_c_try_run - # ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES # ------------------------------------------------------- # Tests whether HEADER exists and can be compiled using the include files in @@ -2599,26 +2464,28 @@ ac_fn_c_check_header_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -$as_echo_n "checking for $2... " >&6; } -if eval \${$3+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +printf %s "checking for $2... " >&6; } +if eval test \${$3+y} +then : + printf %s "(cached) " >&6 +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : eval "$3=yes" -else +else $as_nop eval "$3=no" fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_header_compile @@ -2629,14 +2496,14 @@ ac_fn_cxx_try_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - rm -f conftest.$ac_objext + rm -f conftest.$ac_objext conftest.beam if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 +printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>conftest.err ac_status=$? if test -s conftest.err; then @@ -2644,14 +2511,15 @@ cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err - } && test -s conftest.$ac_objext; then : + } && test -s conftest.$ac_objext +then : ac_retval=0 -else - $as_echo "$as_me: failed program was:" >&5 +else $as_nop + printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 @@ -2661,6 +2529,44 @@ } # ac_fn_cxx_try_compile +# ac_fn_c_try_cpp LINENO +# ---------------------- +# Try to preprocess conftest.$ac_ext, and return whether this succeeded. +ac_fn_c_try_cpp () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if { { ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +printf "%s\n" "$ac_try_echo"; } >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } > conftest.i && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + } +then : + ac_retval=0 +else $as_nop + printf "%s\n" "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_c_try_cpp + # ac_fn_cxx_try_cpp LINENO # ------------------------ # Try to preprocess conftest.$ac_ext, and return whether this succeeded. @@ -2673,7 +2579,7 @@ *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 +printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err ac_status=$? if test -s conftest.err; then @@ -2681,14 +2587,15 @@ cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } > conftest.i && { test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || test ! -s conftest.err - }; then : + } +then : ac_retval=0 -else - $as_echo "$as_me: failed program was:" >&5 +else $as_nop + printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 @@ -2704,14 +2611,14 @@ ac_fn_c_try_link () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - rm -f conftest.$ac_objext conftest$ac_exeext + rm -f conftest.$ac_objext conftest.beam conftest$ac_exeext if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 +printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_link") 2>conftest.err ac_status=$? if test -s conftest.err; then @@ -2719,17 +2626,18 @@ cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || test -x conftest$ac_exeext - }; then : + } +then : ac_retval=0 -else - $as_echo "$as_me: failed program was:" >&5 +else $as_nop + printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 @@ -2750,11 +2658,12 @@ ac_fn_c_check_func () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -$as_echo_n "checking for $2... " >&6; } -if eval \${$3+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +printf %s "checking for $2... " >&6; } +if eval test \${$3+y} +then : + printf %s "(cached) " >&6 +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Define $2 to an innocuous variant, in case declares $2. @@ -2762,16 +2671,9 @@ #define $2 innocuous_$2 /* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $2 (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif + which can conflict with char $2 (); below. */ +#include #undef $2 /* Override any GCC internal prototype to avoid an error. @@ -2789,24 +2691,25 @@ #endif int -main () +main (void) { return $2 (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : eval "$3=yes" -else +else $as_nop eval "$3=no" fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext fi eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_func @@ -2818,17 +2721,18 @@ ac_fn_c_check_type () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -$as_echo_n "checking for $2... " >&6; } -if eval \${$3+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +printf %s "checking for $2... " >&6; } +if eval test \${$3+y} +then : + printf %s "(cached) " >&6 +else $as_nop eval "$3=no" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int -main () +main (void) { if (sizeof ($2)) return 0; @@ -2836,12 +2740,13 @@ return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int -main () +main (void) { if (sizeof (($2))) return 0; @@ -2849,55 +2754,101 @@ return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : -else +else $as_nop eval "$3=yes" fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_type -# ac_fn_c_check_member LINENO AGGR MEMBER VAR INCLUDES -# ---------------------------------------------------- -# Tries to find if the field MEMBER exists in type AGGR, after including -# INCLUDES, setting cache variable VAR accordingly. -ac_fn_c_check_member () +# ac_fn_c_try_run LINENO +# ---------------------- +# Try to run conftest.$ac_ext, and return whether this succeeded. Assumes that +# executables *can* be run. +ac_fn_c_try_run () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2.$3" >&5 -$as_echo_n "checking for $2.$3... " >&6; } -if eval \${$4+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$5 -int -main () -{ -static $2 ac_aggr; -if (ac_aggr.$3) -return 0; - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - eval "$4=yes" -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$5 + if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +printf "%s\n" "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' + { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +printf "%s\n" "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; } +then : + ac_retval=0 +else $as_nop + printf "%s\n" "$as_me: program exited with status $ac_status" >&5 + printf "%s\n" "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=$ac_status +fi + rm -rf conftest.dSYM conftest_ipa8_conftest.oo + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_c_try_run + +# ac_fn_c_check_member LINENO AGGR MEMBER VAR INCLUDES +# ---------------------------------------------------- +# Tries to find if the field MEMBER exists in type AGGR, after including +# INCLUDES, setting cache variable VAR accordingly. +ac_fn_c_check_member () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $2.$3" >&5 +printf %s "checking for $2.$3... " >&6; } +if eval test \${$4+y} +then : + printf %s "(cached) " >&6 +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$5 +int +main (void) +{ +static $2 ac_aggr; +if (ac_aggr.$3) +return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + eval "$4=yes" +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$5 int -main () +main (void) { static $2 ac_aggr; if (sizeof ac_aggr.$3) @@ -2906,41 +2857,45 @@ return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : eval "$4=yes" -else +else $as_nop eval "$4=no" fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi eval ac_res=\$$4 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_member -# ac_fn_c_check_decl LINENO SYMBOL VAR INCLUDES -# --------------------------------------------- +# ac_fn_check_decl LINENO SYMBOL VAR INCLUDES EXTRA-OPTIONS FLAG-VAR +# ------------------------------------------------------------------ # Tests whether SYMBOL is declared in INCLUDES, setting cache variable VAR -# accordingly. -ac_fn_c_check_decl () +# accordingly. Pass EXTRA-OPTIONS to the compiler, using FLAG-VAR. +ac_fn_check_decl () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack as_decl_name=`echo $2|sed 's/ *(.*//'` + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $as_decl_name is declared" >&5 +printf %s "checking whether $as_decl_name is declared... " >&6; } +if eval test \${$3+y} +then : + printf %s "(cached) " >&6 +else $as_nop as_decl_use=`echo $2|sed -e 's/(/((/' -e 's/)/) 0&/' -e 's/,/) 0& (/g'` - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $as_decl_name is declared" >&5 -$as_echo_n "checking whether $as_decl_name is declared... " >&6; } -if eval \${$3+:} false; then : - $as_echo_n "(cached) " >&6 -else + eval ac_save_FLAGS=\$$6 + as_fn_append $6 " $5" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int -main () +main (void) { #ifndef $as_decl_name #ifdef __cplusplus @@ -2954,19 +2909,22 @@ return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : eval "$3=yes" -else +else $as_nop eval "$3=no" fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + eval $6=\$ac_save_FLAGS + fi eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno -} # ac_fn_c_check_decl +} # ac_fn_check_decl # ac_fn_c_compute_int LINENO EXPR VAR INCLUDES # -------------------------------------------- @@ -2982,7 +2940,7 @@ /* end confdefs.h. */ $4 int -main () +main (void) { static int test_array [1 - 2 * !(($2) >= 0)]; test_array [0] = 0; @@ -2992,14 +2950,15 @@ return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : ac_lo=0 ac_mid=0 while :; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int -main () +main (void) { static int test_array [1 - 2 * !(($2) <= $ac_mid)]; test_array [0] = 0; @@ -3009,9 +2968,10 @@ return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : ac_hi=$ac_mid; break -else +else $as_nop as_fn_arith $ac_mid + 1 && ac_lo=$as_val if test $ac_lo -le $ac_mid; then ac_lo= ac_hi= @@ -3019,14 +2979,14 @@ fi as_fn_arith 2 '*' $ac_mid + 1 && ac_mid=$as_val fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext done -else +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int -main () +main (void) { static int test_array [1 - 2 * !(($2) < 0)]; test_array [0] = 0; @@ -3036,14 +2996,15 @@ return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : ac_hi=-1 ac_mid=-1 while :; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int -main () +main (void) { static int test_array [1 - 2 * !(($2) >= $ac_mid)]; test_array [0] = 0; @@ -3053,9 +3014,10 @@ return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : ac_lo=$ac_mid; break -else +else $as_nop as_fn_arith '(' $ac_mid ')' - 1 && ac_hi=$as_val if test $ac_mid -le $ac_hi; then ac_lo= ac_hi= @@ -3063,14 +3025,14 @@ fi as_fn_arith 2 '*' $ac_mid && ac_mid=$as_val fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext done -else +else $as_nop ac_lo= ac_hi= fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext # Binary search between lo and hi bounds. while test "x$ac_lo" != "x$ac_hi"; do as_fn_arith '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo && ac_mid=$as_val @@ -3078,7 +3040,7 @@ /* end confdefs.h. */ $4 int -main () +main (void) { static int test_array [1 - 2 * !(($2) <= $ac_mid)]; test_array [0] = 0; @@ -3088,12 +3050,13 @@ return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : ac_hi=$ac_mid -else +else $as_nop as_fn_arith '(' $ac_mid ')' + 1 && ac_lo=$as_val fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext done case $ac_lo in #(( ?*) eval "$3=\$ac_lo"; ac_retval=0 ;; @@ -3103,12 +3066,12 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 -static long int longval () { return $2; } -static unsigned long int ulongval () { return $2; } +static long int longval (void) { return $2; } +static unsigned long int ulongval (void) { return $2; } #include #include int -main () +main (void) { FILE *f = fopen ("conftest.val", "w"); @@ -3136,9 +3099,10 @@ return 0; } _ACEOF -if ac_fn_c_try_run "$LINENO"; then : +if ac_fn_c_try_run "$LINENO" +then : echo >>conftest.val; read $3 &5 +printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_link") 2>conftest.err ac_status=$? if test -s conftest.err; then @@ -3172,17 +3136,18 @@ cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || test -x conftest$ac_exeext - }; then : + } +then : ac_retval=0 -else - $as_echo "$as_me: failed program was:" >&5 +else $as_nop + printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 @@ -3196,14 +3161,34 @@ as_fn_set_status $ac_retval } # ac_fn_cxx_try_link +ac_configure_args_raw= +for ac_arg +do + case $ac_arg in + *\'*) + ac_arg=`printf "%s\n" "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + as_fn_append ac_configure_args_raw " '$ac_arg'" +done + +case $ac_configure_args_raw in + *$as_nl*) + ac_safe_unquote= ;; + *) + ac_unsafe_z='|&;<>()$`\\"*?[ '' ' # This string ends in space, tab. + ac_unsafe_a="$ac_unsafe_z#~" + ac_safe_unquote="s/ '\\([^$ac_unsafe_a][^$ac_unsafe_z]*\\)'/ \\1/g" + ac_configure_args_raw=` printf "%s\n" "$ac_configure_args_raw" | sed "$ac_safe_unquote"`;; +esac + cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by asterisk $as_me trunk, which was -generated by GNU Autoconf 2.69. Invocation command line was +generated by GNU Autoconf 2.71. Invocation command line was - $ $0 $@ + $ $0$ac_configure_args_raw _ACEOF exec 5>>config.log @@ -3236,8 +3221,12 @@ for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - $as_echo "PATH: $as_dir" + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + printf "%s\n" "PATH: $as_dir" done IFS=$as_save_IFS @@ -3272,7 +3261,7 @@ | -silent | --silent | --silen | --sile | --sil) continue ;; *\'*) - ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + ac_arg=`printf "%s\n" "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; @@ -3307,11 +3296,13 @@ # WARNING: Use '\'' to represent an apostrophe within the trap. # WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. trap 'exit_status=$? + # Sanitize IFS. + IFS=" "" $as_nl" # Save into config.log some information that might help in debugging. { echo - $as_echo "## ---------------- ## + printf "%s\n" "## ---------------- ## ## Cache variables. ## ## ---------------- ##" echo @@ -3322,8 +3313,8 @@ case $ac_val in #( *${as_nl}*) case $ac_var in #( - *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 -$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + *_cv_*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 +printf "%s\n" "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( @@ -3347,7 +3338,7 @@ ) echo - $as_echo "## ----------------- ## + printf "%s\n" "## ----------------- ## ## Output variables. ## ## ----------------- ##" echo @@ -3355,14 +3346,14 @@ do eval ac_val=\$$ac_var case $ac_val in - *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + *\'\''*) ac_val=`printf "%s\n" "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac - $as_echo "$ac_var='\''$ac_val'\''" + printf "%s\n" "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then - $as_echo "## ------------------- ## + printf "%s\n" "## ------------------- ## ## File substitutions. ## ## ------------------- ##" echo @@ -3370,15 +3361,15 @@ do eval ac_val=\$$ac_var case $ac_val in - *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + *\'\''*) ac_val=`printf "%s\n" "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac - $as_echo "$ac_var='\''$ac_val'\''" + printf "%s\n" "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then - $as_echo "## ----------- ## + printf "%s\n" "## ----------- ## ## confdefs.h. ## ## ----------- ##" echo @@ -3386,8 +3377,8 @@ echo fi test "$ac_signal" != 0 && - $as_echo "$as_me: caught signal $ac_signal" - $as_echo "$as_me: exit $exit_status" + printf "%s\n" "$as_me: caught signal $ac_signal" + printf "%s\n" "$as_me: exit $exit_status" } >&5 rm -f core *.core core.conftest.* && rm -f -r conftest* confdefs* conf$$* $ac_clean_files && @@ -3401,63 +3392,48 @@ # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -f -r conftest* confdefs.h -$as_echo "/* confdefs.h */" > confdefs.h +printf "%s\n" "/* confdefs.h */" > confdefs.h # Predefined preprocessor variables. -cat >>confdefs.h <<_ACEOF -#define PACKAGE_NAME "$PACKAGE_NAME" -_ACEOF +printf "%s\n" "#define PACKAGE_NAME \"$PACKAGE_NAME\"" >>confdefs.h -cat >>confdefs.h <<_ACEOF -#define PACKAGE_TARNAME "$PACKAGE_TARNAME" -_ACEOF +printf "%s\n" "#define PACKAGE_TARNAME \"$PACKAGE_TARNAME\"" >>confdefs.h -cat >>confdefs.h <<_ACEOF -#define PACKAGE_VERSION "$PACKAGE_VERSION" -_ACEOF +printf "%s\n" "#define PACKAGE_VERSION \"$PACKAGE_VERSION\"" >>confdefs.h -cat >>confdefs.h <<_ACEOF -#define PACKAGE_STRING "$PACKAGE_STRING" -_ACEOF +printf "%s\n" "#define PACKAGE_STRING \"$PACKAGE_STRING\"" >>confdefs.h -cat >>confdefs.h <<_ACEOF -#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" -_ACEOF +printf "%s\n" "#define PACKAGE_BUGREPORT \"$PACKAGE_BUGREPORT\"" >>confdefs.h -cat >>confdefs.h <<_ACEOF -#define PACKAGE_URL "$PACKAGE_URL" -_ACEOF +printf "%s\n" "#define PACKAGE_URL \"$PACKAGE_URL\"" >>confdefs.h # Let the site file select an alternate cache file if it wants to. # Prefer an explicitly selected file to automatically selected ones. -ac_site_file1=NONE -ac_site_file2=NONE if test -n "$CONFIG_SITE"; then - # We do not want a PATH search for config.site. - case $CONFIG_SITE in #(( - -*) ac_site_file1=./$CONFIG_SITE;; - */*) ac_site_file1=$CONFIG_SITE;; - *) ac_site_file1=./$CONFIG_SITE;; - esac + ac_site_files="$CONFIG_SITE" elif test "x$prefix" != xNONE; then - ac_site_file1=$prefix/share/config.site - ac_site_file2=$prefix/etc/config.site + ac_site_files="$prefix/share/config.site $prefix/etc/config.site" else - ac_site_file1=$ac_default_prefix/share/config.site - ac_site_file2=$ac_default_prefix/etc/config.site + ac_site_files="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" fi -for ac_site_file in "$ac_site_file1" "$ac_site_file2" + +for ac_site_file in $ac_site_files do - test "x$ac_site_file" = xNONE && continue - if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 -$as_echo "$as_me: loading site script $ac_site_file" >&6;} + case $ac_site_file in #( + */*) : + ;; #( + *) : + ac_site_file=./$ac_site_file ;; +esac + if test -f "$ac_site_file" && test -r "$ac_site_file"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 +printf "%s\n" "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" \ - || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + || { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "failed to load site script $ac_site_file See \`config.log' for more details" "$LINENO" 5; } fi @@ -3467,813 +3443,836 @@ # Some versions of bash will fail to source /dev/null (special files # actually), so we avoid doing that. DJGPP emulates it as a regular file. if test /dev/null != "$cache_file" && test -f "$cache_file"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 -$as_echo "$as_me: loading cache $cache_file" >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 +printf "%s\n" "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else - { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 -$as_echo "$as_me: creating cache $cache_file" >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 +printf "%s\n" "$as_me: creating cache $cache_file" >&6;} >$cache_file fi -as_fn_append ac_header_list " stdlib.h" -as_fn_append ac_header_list " unistd.h" -as_fn_append ac_header_list " sys/param.h" -as_fn_append ac_header_list " utime.h" -# Check that the precious variables saved in the cache have kept the same -# value. -ac_cache_corrupted=false -for ac_var in $ac_precious_vars; do - eval ac_old_set=\$ac_cv_env_${ac_var}_set - eval ac_new_set=\$ac_env_${ac_var}_set - eval ac_old_val=\$ac_cv_env_${ac_var}_value - eval ac_new_val=\$ac_env_${ac_var}_value - case $ac_old_set,$ac_new_set in - set,) - { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 -$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} - ac_cache_corrupted=: ;; - ,set) - { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 -$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} - ac_cache_corrupted=: ;; - ,);; - *) - if test "x$ac_old_val" != "x$ac_new_val"; then - # differences in whitespace do not lead to failure. - ac_old_val_w=`echo x $ac_old_val` - ac_new_val_w=`echo x $ac_new_val` - if test "$ac_old_val_w" != "$ac_new_val_w"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 -$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} - ac_cache_corrupted=: - else - { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 -$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} - eval $ac_var=\$ac_old_val - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 -$as_echo "$as_me: former value: \`$ac_old_val'" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 -$as_echo "$as_me: current value: \`$ac_new_val'" >&2;} - fi;; - esac - # Pass precious variables to config.status. - if test "$ac_new_set" = set; then - case $ac_new_val in - *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; - *) ac_arg=$ac_var=$ac_new_val ;; - esac - case " $ac_configure_args " in - *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. - *) as_fn_append ac_configure_args " '$ac_arg'" ;; - esac - fi -done -if $ac_cache_corrupted; then - { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 -$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} - as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 -fi -## -------------------- ## -## Main body of script. ## -## -------------------- ## +# Test code for whether the C compiler supports C89 (global declarations) +ac_c_conftest_c89_globals=' +/* Does the compiler advertise C89 conformance? + Do not test the value of __STDC__, because some compilers set it to 0 + while being otherwise adequately conformant. */ +#if !defined __STDC__ +# error "Compiler does not advertise C89 conformance" +#endif -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu +#include +#include +struct stat; +/* Most of the following tests are stolen from RCS 5.7 src/conf.sh. */ +struct buf { int x; }; +struct buf * (*rcsopen) (struct buf *, struct stat *, int); +static char *e (p, i) + char **p; + int i; +{ + return p[i]; +} +static char *f (char * (*g) (char **, int), char **p, ...) +{ + char *s; + va_list v; + va_start (v,p); + s = g (p, va_arg (v,int)); + va_end (v); + return s; +} +/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has + function prototypes and stuff, but not \xHH hex character constants. + These do not provoke an error unfortunately, instead are silently treated + as an "x". The following induces an error, until -std is added to get + proper ANSI mode. Curiously \x00 != x always comes out true, for an + array size at least. It is necessary to write \x00 == 0 to get something + that is true only with -std. */ +int osf4_cc_array ['\''\x00'\'' == 0 ? 1 : -1]; +/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters + inside strings and character constants. */ +#define FOO(x) '\''x'\'' +int xlc6_cc_array[FOO(a) == '\''x'\'' ? 1 : -1]; -# cross-compile macros -ac_aux_dir= -for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do - if test -f "$ac_dir/install-sh"; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/install-sh -c" - break - elif test -f "$ac_dir/install.sh"; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/install.sh -c" - break - elif test -f "$ac_dir/shtool"; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/shtool install -c" - break - fi -done -if test -z "$ac_aux_dir"; then - as_fn_error $? "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5 -fi +int test (int i, double x); +struct s1 {int (*f) (int a);}; +struct s2 {int (*f) (double a);}; +int pairnames (int, char **, int *(*)(struct buf *, struct stat *, int), + int, int);' -# These three variables are undocumented and unsupported, -# and are intended to be withdrawn in a future Autoconf release. -# They can cause serious problems if a builder's source tree is in a directory -# whose full name contains unusual characters. -ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. -ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. -ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. +# Test code for whether the C compiler supports C89 (body of main). +ac_c_conftest_c89_main=' +ok |= (argc == 0 || f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]); +' +# Test code for whether the C compiler supports C99 (global declarations) +ac_c_conftest_c99_globals=' +// Does the compiler advertise C99 conformance? +#if !defined __STDC_VERSION__ || __STDC_VERSION__ < 199901L +# error "Compiler does not advertise C99 conformance" +#endif + +#include +extern int puts (const char *); +extern int printf (const char *, ...); +extern int dprintf (int, const char *, ...); +extern void *malloc (size_t); + +// Check varargs macros. These examples are taken from C99 6.10.3.5. +// dprintf is used instead of fprintf to avoid needing to declare +// FILE and stderr. +#define debug(...) dprintf (2, __VA_ARGS__) +#define showlist(...) puts (#__VA_ARGS__) +#define report(test,...) ((test) ? puts (#test) : printf (__VA_ARGS__)) +static void +test_varargs_macros (void) +{ + int x = 1234; + int y = 5678; + debug ("Flag"); + debug ("X = %d\n", x); + showlist (The first, second, and third items.); + report (x>y, "x is %d but y is %d", x, y); +} + +// Check long long types. +#define BIG64 18446744073709551615ull +#define BIG32 4294967295ul +#define BIG_OK (BIG64 / BIG32 == 4294967297ull && BIG64 % BIG32 == 0) +#if !BIG_OK + #error "your preprocessor is broken" +#endif +#if BIG_OK +#else + #error "your preprocessor is broken" +#endif +static long long int bignum = -9223372036854775807LL; +static unsigned long long int ubignum = BIG64; -# Make sure we can run config.sub. -$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || - as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5 - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 -$as_echo_n "checking build system type... " >&6; } -if ${ac_cv_build+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_build_alias=$build_alias -test "x$ac_build_alias" = x && - ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` -test "x$ac_build_alias" = x && - as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5 -ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || - as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5 +struct incomplete_array +{ + int datasize; + double data[]; +}; -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 -$as_echo "$ac_cv_build" >&6; } -case $ac_cv_build in -*-*-*) ;; -*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;; -esac -build=$ac_cv_build -ac_save_IFS=$IFS; IFS='-' -set x $ac_cv_build -shift -build_cpu=$1 -build_vendor=$2 -shift; shift -# Remember, the first character of IFS is used to create $*, -# except with old shells: -build_os=$* -IFS=$ac_save_IFS -case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac +struct named_init { + int number; + const wchar_t *name; + double average; +}; +typedef const char *ccp; -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 -$as_echo_n "checking host system type... " >&6; } -if ${ac_cv_host+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test "x$host_alias" = x; then - ac_cv_host=$ac_cv_build -else - ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || - as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5 -fi +static inline int +test_restrict (ccp restrict text) +{ + // See if C++-style comments work. + // Iterate through items via the restricted pointer. + // Also check for declarations in for loops. + for (unsigned int i = 0; *(text+i) != '\''\0'\''; ++i) + continue; + return 0; +} -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 -$as_echo "$ac_cv_host" >&6; } -case $ac_cv_host in -*-*-*) ;; -*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;; -esac -host=$ac_cv_host -ac_save_IFS=$IFS; IFS='-' -set x $ac_cv_host -shift -host_cpu=$1 -host_vendor=$2 -shift; shift -# Remember, the first character of IFS is used to create $*, -# except with old shells: -host_os=$* -IFS=$ac_save_IFS -case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac +// Check varargs and va_copy. +static bool +test_varargs (const char *format, ...) +{ + va_list args; + va_start (args, format); + va_list args_copy; + va_copy (args_copy, args); + const char *str = ""; + int number = 0; + float fnumber = 0; + while (*format) + { + switch (*format++) + { + case '\''s'\'': // string + str = va_arg (args_copy, const char *); + break; + case '\''d'\'': // int + number = va_arg (args_copy, int); + break; + case '\''f'\'': // float + fnumber = va_arg (args_copy, double); + break; + default: + break; + } + } + va_end (args_copy); + va_end (args); -# check existence of the package + return *str && number && fnumber; +} +' +# Test code for whether the C compiler supports C99 (body of main). +ac_c_conftest_c99_main=' + // Check bool. + _Bool success = false; + success |= (argc != 0); + + // Check restrict. + if (test_restrict ("String literal") == 0) + success = true; + char *restrict newvar = "Another string"; + + // Check varargs. + success &= test_varargs ("s, d'\'' f .", "string", 65, 34.234); + test_varargs_macros (); + + // Check flexible array members. + struct incomplete_array *ia = + malloc (sizeof (struct incomplete_array) + (sizeof (double) * 10)); + ia->datasize = 10; + for (int i = 0; i < ia->datasize; ++i) + ia->data[i] = i * 1.234; + + // Check named initializers. + struct named_init ni = { + .number = 34, + .name = L"Test wide string", + .average = 543.34343, + }; + + ni.number = 58; + + int dynamic_array[ni.number]; + dynamic_array[0] = argv[0][0]; + dynamic_array[ni.number - 1] = 543; + + // work around unused variable warnings + ok |= (!success || bignum == 0LL || ubignum == 0uLL || newvar[0] == '\''x'\'' + || dynamic_array[ni.number - 1] != 543); +' +# Test code for whether the C compiler supports C11 (global declarations) +ac_c_conftest_c11_globals=' +// Does the compiler advertise C11 conformance? +#if !defined __STDC_VERSION__ || __STDC_VERSION__ < 201112L +# error "Compiler does not advertise C11 conformance" +#endif + +// Check _Alignas. +char _Alignas (double) aligned_as_double; +char _Alignas (0) no_special_alignment; +extern char aligned_as_int; +char _Alignas (0) _Alignas (int) aligned_as_int; + +// Check _Alignof. +enum +{ + int_alignment = _Alignof (int), + int_array_alignment = _Alignof (int[100]), + char_alignment = _Alignof (char) +}; +_Static_assert (0 < -_Alignof (int), "_Alignof is signed"); +// Check _Noreturn. +int _Noreturn does_not_return (void) { for (;;) continue; } -# preserve any CFLAGS or LDFLAGS that may be set -# NOTE: This must be done before calling any macros that end up -# calling AC_PROG_CC or the like, since they will set a default -# set of CFLAGS ("-g -O2") if the user did not supply any, and -# we don't want those default flags to be carried over into the -# rest of the build system since we have other means of controlling -# debugging symbol generation and optimization. -CONFIG_CFLAGS="${CFLAGS}" -CONFIG_LDFLAGS="${LDFLAGS}" +// Check _Static_assert. +struct test_static_assert +{ + int x; + _Static_assert (sizeof (int) <= sizeof (long int), + "_Static_assert does not work in struct"); + long int y; +}; +// Check UTF-8 literals. +#define u8 syntax error! +char const utf8_literal[] = u8"happens to be ASCII" "another string"; + +// Check duplicate typedefs. +typedef long *long_ptr; +typedef long int *long_ptr; +typedef long_ptr long_ptr; + +// Anonymous structures and unions -- taken from C11 6.7.2.1 Example 1. +struct anonymous +{ + union { + struct { int i; int j; }; + struct { int k; long int l; } w; + }; + int m; +} v1; +' +# Test code for whether the C compiler supports C11 (body of main). +ac_c_conftest_c11_main=' + _Static_assert ((offsetof (struct anonymous, i) + == offsetof (struct anonymous, w.k)), + "Anonymous union alignment botch"); + v1.i = 2; + v1.w.k = 5; + ok |= v1.i != 5; +' -# specify output header file -ac_config_headers="$ac_config_headers include/asterisk/autoconfig.h" +# Test code for whether the C compiler supports C11 (complete). +ac_c_conftest_c11_program="${ac_c_conftest_c89_globals} +${ac_c_conftest_c99_globals} +${ac_c_conftest_c11_globals} +int +main (int argc, char **argv) +{ + int ok = 0; + ${ac_c_conftest_c89_main} + ${ac_c_conftest_c99_main} + ${ac_c_conftest_c11_main} + return ok; +} +" -# Note: AC_PROG_CC *must* be specified before AC_USE_SYSTEM_EXTENSIONS or any -# other macro that uses the C compiler, or the default order will be used. -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu -if test -n "$ac_tool_prefix"; then - for ac_prog in gcc cc - do - # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. -set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_CC="$ac_tool_prefix$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS +# Test code for whether the C compiler supports C99 (complete). +ac_c_conftest_c99_program="${ac_c_conftest_c89_globals} +${ac_c_conftest_c99_globals} -fi -fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -$as_echo "$CC" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi +int +main (int argc, char **argv) +{ + int ok = 0; + ${ac_c_conftest_c89_main} + ${ac_c_conftest_c99_main} + return ok; +} +" +# Test code for whether the C compiler supports C89 (complete). +ac_c_conftest_c89_program="${ac_c_conftest_c89_globals} - test -n "$CC" && break - done -fi -if test -z "$CC"; then - ac_ct_CC=$CC - for ac_prog in gcc cc -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_CC"; then - ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_CC="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS +int +main (int argc, char **argv) +{ + int ok = 0; + ${ac_c_conftest_c89_main} + return ok; +} +" -fi -fi -ac_ct_CC=$ac_cv_prog_ac_ct_CC -if test -n "$ac_ct_CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 -$as_echo "$ac_ct_CC" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi +as_fn_append ac_header_c_list " stdio.h stdio_h HAVE_STDIO_H" +as_fn_append ac_header_c_list " stdlib.h stdlib_h HAVE_STDLIB_H" +as_fn_append ac_header_c_list " string.h string_h HAVE_STRING_H" +as_fn_append ac_header_c_list " inttypes.h inttypes_h HAVE_INTTYPES_H" +as_fn_append ac_header_c_list " stdint.h stdint_h HAVE_STDINT_H" +as_fn_append ac_header_c_list " strings.h strings_h HAVE_STRINGS_H" +as_fn_append ac_header_c_list " sys/stat.h sys_stat_h HAVE_SYS_STAT_H" +as_fn_append ac_header_c_list " sys/types.h sys_types_h HAVE_SYS_TYPES_H" +as_fn_append ac_header_c_list " unistd.h unistd_h HAVE_UNISTD_H" +as_fn_append ac_header_c_list " wchar.h wchar_h HAVE_WCHAR_H" +as_fn_append ac_header_c_list " minix/config.h minix_config_h HAVE_MINIX_CONFIG_H" +# Test code for whether the C++ compiler supports C++98 (global declarations) +ac_cxx_conftest_cxx98_globals=' +// Does the compiler advertise C++98 conformance? +#if !defined __cplusplus || __cplusplus < 199711L +# error "Compiler does not advertise C++98 conformance" +#endif + +// These inclusions are to reject old compilers that +// lack the unsuffixed header files. +#include +#include + +// and are *not* freestanding headers in C++98. +extern void assert (int); +namespace std { + extern int strcmp (const char *, const char *); +} + +// Namespaces, exceptions, and templates were all added after "C++ 2.0". +using std::exception; +using std::strcmp; + +namespace { + +void test_exception_syntax() +{ + try { + throw "test"; + } catch (const char *s) { + // Extra parentheses suppress a warning when building autoconf itself, + // due to lint rules shared with more typical C programs. + assert (!(strcmp) (s, "test")); + } +} +template struct test_template +{ + T const val; + explicit test_template(T t) : val(t) {} + template T add(U u) { return static_cast(u) + val; } +}; - test -n "$ac_ct_CC" && break -done +} // anonymous namespace +' - if test "x$ac_ct_CC" = x; then - CC="" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - CC=$ac_ct_CC - fi -fi +# Test code for whether the C++ compiler supports C++98 (body of main) +ac_cxx_conftest_cxx98_main=' + assert (argc); + assert (! argv[0]); +{ + test_exception_syntax (); + test_template tt (2.0); + assert (tt.add (4) == 6.0); + assert (true && !false); +} +' +# Test code for whether the C++ compiler supports C++11 (global declarations) +ac_cxx_conftest_cxx11_globals=' +// Does the compiler advertise C++ 2011 conformance? +#if !defined __cplusplus || __cplusplus < 201103L +# error "Compiler does not advertise C++11 conformance" +#endif -test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "no acceptable C compiler found in \$PATH -See \`config.log' for more details" "$LINENO" 5; } +namespace cxx11test +{ + constexpr int get_val() { return 20; } -# Provide some information about the compiler. -$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 -set X $ac_compile -ac_compiler=$2 -for ac_option in --version -v -V -qversion; do - { { ac_try="$ac_compiler $ac_option >&5" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_compiler $ac_option >&5") 2>conftest.err - ac_status=$? - if test -s conftest.err; then - sed '10a\ -... rest of stderr output deleted ... - 10q' conftest.err >conftest.er1 - cat conftest.er1 >&5 - fi - rm -f conftest.er1 conftest.err - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } -done + struct testinit + { + int i; + double d; + }; -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ + class delegate + { + public: + delegate(int n) : n(n) {} + delegate(): delegate(2354) {} + + virtual int getval() { return this->n; }; + protected: + int n; + }; -int -main () + class overridden : public delegate + { + public: + overridden(int n): delegate(n) {} + virtual int getval() override final { return this->n * 2; } + }; + + class nocopy + { + public: + nocopy(int i): i(i) {} + nocopy() = default; + nocopy(const nocopy&) = delete; + nocopy & operator=(const nocopy&) = delete; + private: + int i; + }; + + // for testing lambda expressions + template Ret eval(Fn f, Ret v) + { + return f(v); + } + + // for testing variadic templates and trailing return types + template auto sum(V first) -> V + { + return first; + } + template auto sum(V first, Args... rest) -> V + { + return first + sum(rest...); + } +} +' + +# Test code for whether the C++ compiler supports C++11 (body of main) +ac_cxx_conftest_cxx11_main=' { + // Test auto and decltype + auto a1 = 6538; + auto a2 = 48573953.4; + auto a3 = "String literal"; - ; - return 0; + int total = 0; + for (auto i = a3; *i; ++i) { total += *i; } + + decltype(a2) a4 = 34895.034; } -_ACEOF -ac_clean_files_save=$ac_clean_files -ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" -# Try to create an executable without -o first, disregard a.out. -# It will help us diagnose broken compilers, and finding out an intuition -# of exeext. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 -$as_echo_n "checking whether the C compiler works... " >&6; } -ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` +{ + // Test constexpr + short sa[cxx11test::get_val()] = { 0 }; +} +{ + // Test initializer lists + cxx11test::testinit il = { 4323, 435234.23544 }; +} +{ + // Test range-based for + int array[] = {9, 7, 13, 15, 4, 18, 12, 10, 5, 3, + 14, 19, 17, 8, 6, 20, 16, 2, 11, 1}; + for (auto &x : array) { x += 23; } +} +{ + // Test lambda expressions + using cxx11test::eval; + assert (eval ([](int x) { return x*2; }, 21) == 42); + double d = 2.0; + assert (eval ([&](double x) { return d += x; }, 3.0) == 5.0); + assert (d == 5.0); + assert (eval ([=](double x) mutable { return d += x; }, 4.0) == 9.0); + assert (d == 5.0); +} +{ + // Test use of variadic templates + using cxx11test::sum; + auto a = sum(1); + auto b = sum(1, 2); + auto c = sum(1.0, 2.0, 3.0); +} +{ + // Test constructor delegation + cxx11test::delegate d1; + cxx11test::delegate d2(); + cxx11test::delegate d3(45); +} +{ + // Test override and final + cxx11test::overridden o1(55464); +} +{ + // Test nullptr + char *c = nullptr; +} +{ + // Test template brackets + test_template<::test_template> v(test_template(12)); +} +{ + // Unicode literals + char const *utf8 = u8"UTF-8 string \u2500"; + char16_t const *utf16 = u"UTF-8 string \u2500"; + char32_t const *utf32 = U"UTF-32 string \u2500"; +} +' -# The possible output files: -ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" +# Test code for whether the C compiler supports C++11 (complete). +ac_cxx_conftest_cxx11_program="${ac_cxx_conftest_cxx98_globals} +${ac_cxx_conftest_cxx11_globals} -ac_rmfiles= -for ac_file in $ac_files -do - case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; - * ) ac_rmfiles="$ac_rmfiles $ac_file";; - esac -done -rm -f $ac_rmfiles +int +main (int argc, char **argv) +{ + int ok = 0; + ${ac_cxx_conftest_cxx98_main} + ${ac_cxx_conftest_cxx11_main} + return ok; +} +" -if { { ac_try="$ac_link_default" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_link_default") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then : - # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. -# So ignore a value of `no', otherwise this would lead to `EXEEXT = no' -# in a Makefile. We should not override ac_cv_exeext if it was cached, -# so that the user can short-circuit this test for compilers unknown to -# Autoconf. -for ac_file in $ac_files '' +# Test code for whether the C compiler supports C++98 (complete). +ac_cxx_conftest_cxx98_program="${ac_cxx_conftest_cxx98_globals} +int +main (int argc, char **argv) +{ + int ok = 0; + ${ac_cxx_conftest_cxx98_main} + return ok; +} +" + +as_fn_append ac_header_c_list " sys/time.h sys_time_h HAVE_SYS_TIME_H" +as_fn_append ac_header_c_list " sys/param.h sys_param_h HAVE_SYS_PARAM_H" +as_fn_append ac_func_c_list " getpagesize HAVE_GETPAGESIZE" +as_fn_append ac_header_c_list " sys/select.h sys_select_h HAVE_SYS_SELECT_H" +as_fn_append ac_header_c_list " sys/socket.h sys_socket_h HAVE_SYS_SOCKET_H" +as_fn_append ac_header_c_list " utime.h utime_h HAVE_UTIME_H" +as_fn_append ac_func_c_list " vprintf HAVE_VPRINTF" + +# Auxiliary files required by this configure script. +ac_aux_files="install-sh config.guess config.sub" + +# Locations in which to look for auxiliary files. +ac_aux_dir_candidates="${srcdir}${PATH_SEPARATOR}${srcdir}/..${PATH_SEPARATOR}${srcdir}/../.." + +# Search for a directory containing all of the required auxiliary files, +# $ac_aux_files, from the $PATH-style list $ac_aux_dir_candidates. +# If we don't find one directory that contains all the files we need, +# we report the set of missing files from the *first* directory in +# $ac_aux_dir_candidates and give up. +ac_missing_aux_files="" +ac_first_candidate=: +printf "%s\n" "$as_me:${as_lineno-$LINENO}: looking for aux files: $ac_aux_files" >&5 +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +as_found=false +for as_dir in $ac_aux_dir_candidates do - test -f "$ac_file" || continue - case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) - ;; - [ab].out ) - # We found the default executable, but exeext='' is most - # certainly right. - break;; - *.* ) - if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; - then :; else - ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` - fi - # We set ac_cv_exeext here because the later test for it is not - # safe: cross compilers may not add the suffix if given an `-o' - # argument, so we may need to know it at that point already. - # Even if this section looks crufty: it has the advantage of - # actually working. - break;; - * ) - break;; + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; esac + as_found=: + + printf "%s\n" "$as_me:${as_lineno-$LINENO}: trying $as_dir" >&5 + ac_aux_dir_found=yes + ac_install_sh= + for ac_aux in $ac_aux_files + do + # As a special case, if "install-sh" is required, that requirement + # can be satisfied by any of "install-sh", "install.sh", or "shtool", + # and $ac_install_sh is set appropriately for whichever one is found. + if test x"$ac_aux" = x"install-sh" + then + if test -f "${as_dir}install-sh"; then + printf "%s\n" "$as_me:${as_lineno-$LINENO}: ${as_dir}install-sh found" >&5 + ac_install_sh="${as_dir}install-sh -c" + elif test -f "${as_dir}install.sh"; then + printf "%s\n" "$as_me:${as_lineno-$LINENO}: ${as_dir}install.sh found" >&5 + ac_install_sh="${as_dir}install.sh -c" + elif test -f "${as_dir}shtool"; then + printf "%s\n" "$as_me:${as_lineno-$LINENO}: ${as_dir}shtool found" >&5 + ac_install_sh="${as_dir}shtool install -c" + else + ac_aux_dir_found=no + if $ac_first_candidate; then + ac_missing_aux_files="${ac_missing_aux_files} install-sh" + else + break + fi + fi + else + if test -f "${as_dir}${ac_aux}"; then + printf "%s\n" "$as_me:${as_lineno-$LINENO}: ${as_dir}${ac_aux} found" >&5 + else + ac_aux_dir_found=no + if $ac_first_candidate; then + ac_missing_aux_files="${ac_missing_aux_files} ${ac_aux}" + else + break + fi + fi + fi + done + if test "$ac_aux_dir_found" = yes; then + ac_aux_dir="$as_dir" + break + fi + ac_first_candidate=false + + as_found=false done -test "$ac_cv_exeext" = no && ac_cv_exeext= +IFS=$as_save_IFS +if $as_found +then : -else - ac_file='' +else $as_nop + as_fn_error $? "cannot find required auxiliary files:$ac_missing_aux_files" "$LINENO" 5 fi -if test -z "$ac_file"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -$as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 -{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error 77 "C compiler cannot create executables -See \`config.log' for more details" "$LINENO" 5; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + +# These three variables are undocumented and unsupported, +# and are intended to be withdrawn in a future Autoconf release. +# They can cause serious problems if a builder's source tree is in a directory +# whose full name contains unusual characters. +if test -f "${ac_aux_dir}config.guess"; then + ac_config_guess="$SHELL ${ac_aux_dir}config.guess" +fi +if test -f "${ac_aux_dir}config.sub"; then + ac_config_sub="$SHELL ${ac_aux_dir}config.sub" +fi +if test -f "$ac_aux_dir/configure"; then + ac_configure="$SHELL ${ac_aux_dir}configure" fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 -$as_echo_n "checking for C compiler default output file name... " >&6; } -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 -$as_echo "$ac_file" >&6; } -ac_exeext=$ac_cv_exeext -rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out -ac_clean_files=$ac_clean_files_save -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 -$as_echo_n "checking for suffix of executables... " >&6; } -if { { ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then : - # If both `conftest.exe' and `conftest' are `present' (well, observable) -# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will -# work properly (i.e., refer to `conftest.exe'), while it won't with -# `rm'. -for ac_file in conftest.exe conftest conftest.*; do - test -f "$ac_file" || continue - case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; - *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` - break;; - * ) break;; +# Check that the precious variables saved in the cache have kept the same +# value. +ac_cache_corrupted=false +for ac_var in $ac_precious_vars; do + eval ac_old_set=\$ac_cv_env_${ac_var}_set + eval ac_new_set=\$ac_env_${ac_var}_set + eval ac_old_val=\$ac_cv_env_${ac_var}_value + eval ac_new_val=\$ac_env_${ac_var}_value + case $ac_old_set,$ac_new_set in + set,) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 +printf "%s\n" "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,set) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 +printf "%s\n" "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,);; + *) + if test "x$ac_old_val" != "x$ac_new_val"; then + # differences in whitespace do not lead to failure. + ac_old_val_w=`echo x $ac_old_val` + ac_new_val_w=`echo x $ac_new_val` + if test "$ac_old_val_w" != "$ac_new_val_w"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 +printf "%s\n" "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} + ac_cache_corrupted=: + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 +printf "%s\n" "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} + eval $ac_var=\$ac_old_val + fi + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 +printf "%s\n" "$as_me: former value: \`$ac_old_val'" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 +printf "%s\n" "$as_me: current value: \`$ac_new_val'" >&2;} + fi;; esac + # Pass precious variables to config.status. + if test "$ac_new_set" = set; then + case $ac_new_val in + *\'*) ac_arg=$ac_var=`printf "%s\n" "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; + *) ac_arg=$ac_var=$ac_new_val ;; + esac + case " $ac_configure_args " in + *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. + *) as_fn_append ac_configure_args " '$ac_arg'" ;; + esac + fi done -else - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "cannot compute suffix of executables: cannot compile and link -See \`config.log' for more details" "$LINENO" 5; } +if $ac_cache_corrupted; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 +printf "%s\n" "$as_me: error: changes in the environment can compromise the build" >&2;} + as_fn_error $? "run \`${MAKE-make} distclean' and/or \`rm $cache_file' + and start over" "$LINENO" 5 fi -rm -f conftest conftest$ac_cv_exeext -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 -$as_echo "$ac_cv_exeext" >&6; } +## -------------------- ## +## Main body of script. ## +## -------------------- ## -rm -f conftest.$ac_ext -EXEEXT=$ac_cv_exeext -ac_exeext=$EXEEXT -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -int -main () -{ -FILE *f = fopen ("conftest.out", "w"); - return ferror (f) || fclose (f) != 0; +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu - ; - return 0; -} -_ACEOF -ac_clean_files="$ac_clean_files conftest.out" -# Check that the compiler produces executables we can run. If not, either -# the compiler is broken, or we cross compile. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 -$as_echo_n "checking whether we are cross compiling... " >&6; } -if test "$cross_compiling" != yes; then - { { ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } - if { ac_try='./conftest$ac_cv_exeext' - { { case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; }; then - cross_compiling=no - else - if test "$cross_compiling" = maybe; then - cross_compiling=yes - else - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "cannot run C compiled programs. -If you meant to cross compile, use \`--host'. -See \`config.log' for more details" "$LINENO" 5; } - fi - fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 -$as_echo "$cross_compiling" >&6; } -rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out -ac_clean_files=$ac_clean_files_save -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 -$as_echo_n "checking for suffix of object files... " >&6; } -if ${ac_cv_objext+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -int -main () -{ +# cross-compile macros - ; - return 0; -} -_ACEOF -rm -f conftest.o conftest.obj -if { { ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_compile") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then : - for ac_file in conftest.o conftest.obj conftest.*; do - test -f "$ac_file" || continue; - case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; - *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` - break;; - esac -done -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 -{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "cannot compute suffix of object files: cannot compile -See \`config.log' for more details" "$LINENO" 5; } -fi -rm -f conftest.$ac_cv_objext conftest.$ac_ext + + # Make sure we can run config.sub. +$SHELL "${ac_aux_dir}config.sub" sun4 >/dev/null 2>&1 || + as_fn_error $? "cannot run $SHELL ${ac_aux_dir}config.sub" "$LINENO" 5 + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 +printf %s "checking build system type... " >&6; } +if test ${ac_cv_build+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_build_alias=$build_alias +test "x$ac_build_alias" = x && + ac_build_alias=`$SHELL "${ac_aux_dir}config.guess"` +test "x$ac_build_alias" = x && + as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5 +ac_cv_build=`$SHELL "${ac_aux_dir}config.sub" $ac_build_alias` || + as_fn_error $? "$SHELL ${ac_aux_dir}config.sub $ac_build_alias failed" "$LINENO" 5 + fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 -$as_echo "$ac_cv_objext" >&6; } -OBJEXT=$ac_cv_objext -ac_objext=$OBJEXT -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 -$as_echo_n "checking whether we are using the GNU C compiler... " >&6; } -if ${ac_cv_c_compiler_gnu+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 +printf "%s\n" "$ac_cv_build" >&6; } +case $ac_cv_build in +*-*-*) ;; +*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;; +esac +build=$ac_cv_build +ac_save_IFS=$IFS; IFS='-' +set x $ac_cv_build +shift +build_cpu=$1 +build_vendor=$2 +shift; shift +# Remember, the first character of IFS is used to create $*, +# except with old shells: +build_os=$* +IFS=$ac_save_IFS +case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac -int -main () -{ -#ifndef __GNUC__ - choke me -#endif - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_compiler_gnu=yes +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 +printf %s "checking host system type... " >&6; } +if test ${ac_cv_host+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test "x$host_alias" = x; then + ac_cv_host=$ac_cv_build else - ac_compiler_gnu=no + ac_cv_host=`$SHELL "${ac_aux_dir}config.sub" $host_alias` || + as_fn_error $? "$SHELL ${ac_aux_dir}config.sub $host_alias failed" "$LINENO" 5 fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -ac_cv_c_compiler_gnu=$ac_compiler_gnu fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 -$as_echo "$ac_cv_c_compiler_gnu" >&6; } -if test $ac_compiler_gnu = yes; then - GCC=yes -else - GCC= -fi -ac_test_CFLAGS=${CFLAGS+set} -ac_save_CFLAGS=$CFLAGS -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 -$as_echo_n "checking whether $CC accepts -g... " >&6; } -if ${ac_cv_prog_cc_g+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_save_c_werror_flag=$ac_c_werror_flag - ac_c_werror_flag=yes - ac_cv_prog_cc_g=no - CFLAGS="-g" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 +printf "%s\n" "$ac_cv_host" >&6; } +case $ac_cv_host in +*-*-*) ;; +*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;; +esac +host=$ac_cv_host +ac_save_IFS=$IFS; IFS='-' +set x $ac_cv_host +shift +host_cpu=$1 +host_vendor=$2 +shift; shift +# Remember, the first character of IFS is used to create $*, +# except with old shells: +host_os=$* +IFS=$ac_save_IFS +case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac -int -main () -{ - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_prog_cc_g=yes -else - CFLAGS="" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -int -main () -{ +# check existence of the package - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : -else - ac_c_werror_flag=$ac_save_c_werror_flag - CFLAGS="-g" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -int -main () -{ - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_prog_cc_g=yes -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - ac_c_werror_flag=$ac_save_c_werror_flag -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 -$as_echo "$ac_cv_prog_cc_g" >&6; } -if test "$ac_test_CFLAGS" = set; then - CFLAGS=$ac_save_CFLAGS -elif test $ac_cv_prog_cc_g = yes; then - if test "$GCC" = yes; then - CFLAGS="-g -O2" - else - CFLAGS="-g" - fi -else - if test "$GCC" = yes; then - CFLAGS="-O2" - else - CFLAGS= - fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 -$as_echo_n "checking for $CC option to accept ISO C89... " >&6; } -if ${ac_cv_prog_cc_c89+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_cv_prog_cc_c89=no -ac_save_CC=$CC -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -#include -struct stat; -/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ -struct buf { int x; }; -FILE * (*rcsopen) (struct buf *, struct stat *, int); -static char *e (p, i) - char **p; - int i; -{ - return p[i]; -} -static char *f (char * (*g) (char **, int), char **p, ...) -{ - char *s; - va_list v; - va_start (v,p); - s = g (p, va_arg (v,int)); - va_end (v); - return s; -} +# preserve any CFLAGS or LDFLAGS that may be set +# NOTE: This must be done before calling any macros that end up +# calling AC_PROG_CC or the like, since they will set a default +# set of CFLAGS ("-g -O2") if the user did not supply any, and +# we don't want those default flags to be carried over into the +# rest of the build system since we have other means of controlling +# debugging symbol generation and optimization. +CONFIG_CFLAGS="${CFLAGS}" +CONFIG_LDFLAGS="${LDFLAGS}" + + + +# specify output header file +ac_config_headers="$ac_config_headers include/asterisk/autoconfig.h" + + +# Note: AC_PROG_CC *must* be specified before AC_USE_SYSTEM_EXTENSIONS or any +# other macro that uses the C compiler, or the default order will be used. -/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has - function prototypes and stuff, but not '\xHH' hex character constants. - These don't provoke an error unfortunately, instead are silently treated - as 'x'. The following induces an error, until -std is added to get - proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an - array size at least. It's necessary to write '\x00'==0 to get something - that's true only with -std. */ -int osf4_cc_array ['\x00' == 0 ? 1 : -1]; -/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters - inside strings and character constants. */ -#define FOO(x) 'x' -int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; -int test (int i, double x); -struct s1 {int (*f) (int a);}; -struct s2 {int (*f) (double a);}; -int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); -int argc; -char **argv; -int -main () -{ -return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; - ; - return 0; -} -_ACEOF -for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ - -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" -do - CC="$ac_save_CC $ac_arg" - if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_prog_cc_c89=$ac_arg -fi -rm -f core conftest.err conftest.$ac_objext - test "x$ac_cv_prog_cc_c89" != "xno" && break -done -rm -f conftest.$ac_ext -CC=$ac_save_CC -fi -# AC_CACHE_VAL -case "x$ac_cv_prog_cc_c89" in - x) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 -$as_echo "none needed" >&6; } ;; - xno) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 -$as_echo "unsupported" >&6; } ;; - *) - CC="$CC $ac_cv_prog_cc_c89" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 -$as_echo "$ac_cv_prog_cc_c89" >&6; } ;; -esac -if test "x$ac_cv_prog_cc_c89" != xno; then : -fi -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu @@ -4282,458 +4281,842 @@ ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 -$as_echo_n "checking how to run the C preprocessor... " >&6; } -# On Suns, sometimes $CPP names a directory. -if test -n "$CPP" && test -d "$CPP"; then - CPP= -fi -if test -z "$CPP"; then - if ${ac_cv_prog_CPP+:} false; then : - $as_echo_n "(cached) " >&6 +if test -n "$ac_tool_prefix"; then + for ac_prog in gcc cc + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. else - # Double quotes because CPP needs to be expanded - for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" - do - ac_preproc_ok=false -for ac_c_preproc_warn_flag in '' yes +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH do - # Use a header file that comes with gcc, so configuring glibc - # with a fresh cross-compiler works. - # Prefer to if __STDC__ is defined, since - # exists even on freestanding compilers. - # On the NeXT, cc -E runs the code through the compiler's parser, - # not just through cpp. "Syntax error" is here to catch this case. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#ifdef __STDC__ -# include -#else -# include -#endif - Syntax error -_ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="$ac_tool_prefix$ac_prog" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS -else - # Broken: fails on valid input. -continue fi -rm -f conftest.err conftest.i conftest.$ac_ext - - # OK, works on sane cases. Now check whether nonexistent headers - # can be detected and how. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -_ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : - # Broken: success on invalid input. -continue -else - # Passes both tests. -ac_preproc_ok=: -break fi -rm -f conftest.err conftest.i conftest.$ac_ext - -done -# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.i conftest.err conftest.$ac_ext -if $ac_preproc_ok; then : - break +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +printf "%s\n" "$CC" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi - done - ac_cv_prog_CPP=$CPP + test -n "$CC" && break + done fi - CPP=$ac_cv_prog_CPP +if test -z "$CC"; then + ac_ct_CC=$CC + for ac_prog in gcc cc +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else - ac_cv_prog_CPP=$CPP -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 -$as_echo "$CPP" >&6; } -ac_preproc_ok=false -for ac_c_preproc_warn_flag in '' yes +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH do - # Use a header file that comes with gcc, so configuring glibc - # with a fresh cross-compiler works. - # Prefer to if __STDC__ is defined, since - # exists even on freestanding compilers. - # On the NeXT, cc -E runs the code through the compiler's parser, - # not just through cpp. "Syntax error" is here to catch this case. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#ifdef __STDC__ -# include -#else -# include -#endif - Syntax error -_ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="$ac_prog" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS -else - # Broken: fails on valid input. -continue fi -rm -f conftest.err conftest.i conftest.$ac_ext - - # OK, works on sane cases. Now check whether nonexistent headers - # can be detected and how. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -_ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : - # Broken: success on invalid input. -continue +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +printf "%s\n" "$ac_ct_CC" >&6; } else - # Passes both tests. -ac_preproc_ok=: -break + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi -rm -f conftest.err conftest.i conftest.$ac_ext + + test -n "$ac_ct_CC" && break done -# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.i conftest.err conftest.$ac_ext -if $ac_preproc_ok; then : -else - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "C preprocessor \"$CPP\" fails sanity check -See \`config.log' for more details" "$LINENO" 5; } + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi fi -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu +test -z "$CC" && { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "no acceptable C compiler found in \$PATH +See \`config.log' for more details" "$LINENO" 5; } -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 -$as_echo_n "checking for grep that handles long lines and -e... " >&6; } -if ${ac_cv_path_GREP+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -z "$GREP"; then - ac_path_GREP_found=false - # Loop through the user's path and test for each of PROGNAME-LIST - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_prog in grep ggrep; do - for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" - as_fn_executable_p "$ac_path_GREP" || continue -# Check for GNU ac_path_GREP and select it if it is found. - # Check for GNU $ac_path_GREP -case `"$ac_path_GREP" --version 2>&1` in -*GNU*) - ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; -*) - ac_count=0 - $as_echo_n 0123456789 >"conftest.in" - while : - do - cat "conftest.in" "conftest.in" >"conftest.tmp" - mv "conftest.tmp" "conftest.in" - cp "conftest.in" "conftest.nl" - $as_echo 'GREP' >> "conftest.nl" - "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break - diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break - as_fn_arith $ac_count + 1 && ac_count=$as_val - if test $ac_count -gt ${ac_path_GREP_max-0}; then - # Best one so far, save it but keep looking for a better one - ac_cv_path_GREP="$ac_path_GREP" - ac_path_GREP_max=$ac_count - fi - # 10*(2^10) chars as input seems more than enough - test $ac_count -gt 10 && break - done - rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +# Provide some information about the compiler. +printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 +set X $ac_compile +ac_compiler=$2 +for ac_option in --version -v -V -qversion -version; do + { { ac_try="$ac_compiler $ac_option >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; esac - - $ac_path_GREP_found && break 3 - done - done - done -IFS=$as_save_IFS - if test -z "$ac_cv_path_GREP"; then - as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +printf "%s\n" "$ac_try_echo"; } >&5 + (eval "$ac_compiler $ac_option >&5") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + sed '10a\ +... rest of stderr output deleted ... + 10q' conftest.err >conftest.er1 + cat conftest.er1 >&5 fi -else - ac_cv_path_GREP=$GREP -fi + rm -f conftest.er1 conftest.err + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +done -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 -$as_echo "$ac_cv_path_GREP" >&6; } - GREP="$ac_cv_path_GREP" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +int +main (void) +{ -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 -$as_echo_n "checking for egrep... " >&6; } -if ${ac_cv_path_EGREP+:} false; then : - $as_echo_n "(cached) " >&6 -else - if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 - then ac_cv_path_EGREP="$GREP -E" - else - if test -z "$EGREP"; then - ac_path_EGREP_found=false - # Loop through the user's path and test for each of PROGNAME-LIST - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin + ; + return 0; +} +_ACEOF +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" +# Try to create an executable without -o first, disregard a.out. +# It will help us diagnose broken compilers, and finding out an intuition +# of exeext. +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 +printf %s "checking whether the C compiler works... " >&6; } +ac_link_default=`printf "%s\n" "$ac_link" | sed 's/ -o *conftest[^ ]*//'` + +# The possible output files: +ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" + +ac_rmfiles= +for ac_file in $ac_files do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_prog in egrep; do - for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" - as_fn_executable_p "$ac_path_EGREP" || continue -# Check for GNU ac_path_EGREP and select it if it is found. - # Check for GNU $ac_path_EGREP -case `"$ac_path_EGREP" --version 2>&1` in -*GNU*) - ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; -*) - ac_count=0 - $as_echo_n 0123456789 >"conftest.in" - while : - do - cat "conftest.in" "conftest.in" >"conftest.tmp" - mv "conftest.tmp" "conftest.in" - cp "conftest.in" "conftest.nl" - $as_echo 'EGREP' >> "conftest.nl" - "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break - diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break - as_fn_arith $ac_count + 1 && ac_count=$as_val - if test $ac_count -gt ${ac_path_EGREP_max-0}; then - # Best one so far, save it but keep looking for a better one - ac_cv_path_EGREP="$ac_path_EGREP" - ac_path_EGREP_max=$ac_count - fi - # 10*(2^10) chars as input seems more than enough - test $ac_count -gt 10 && break - done - rm -f conftest.in conftest.tmp conftest.nl conftest.out;; + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; + * ) ac_rmfiles="$ac_rmfiles $ac_file";; + esac +done +rm -f $ac_rmfiles + +if { { ac_try="$ac_link_default" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +printf "%s\n" "$ac_try_echo"; } >&5 + (eval "$ac_link_default") 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +then : + # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. +# So ignore a value of `no', otherwise this would lead to `EXEEXT = no' +# in a Makefile. We should not override ac_cv_exeext if it was cached, +# so that the user can short-circuit this test for compilers unknown to +# Autoconf. +for ac_file in $ac_files '' +do + test -f "$ac_file" || continue + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) + ;; + [ab].out ) + # We found the default executable, but exeext='' is most + # certainly right. + break;; + *.* ) + if test ${ac_cv_exeext+y} && test "$ac_cv_exeext" != no; + then :; else + ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + fi + # We set ac_cv_exeext here because the later test for it is not + # safe: cross compilers may not add the suffix if given an `-o' + # argument, so we may need to know it at that point already. + # Even if this section looks crufty: it has the advantage of + # actually working. + break;; + * ) + break;; + esac +done +test "$ac_cv_exeext" = no && ac_cv_exeext= - $ac_path_EGREP_found && break 3 - done - done - done -IFS=$as_save_IFS - if test -z "$ac_cv_path_EGREP"; then - as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 - fi -else - ac_cv_path_EGREP=$EGREP +else $as_nop + ac_file='' fi +if test -z "$ac_file" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +printf "%s\n" "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 - fi +{ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "C compiler cannot create executables +See \`config.log' for more details" "$LINENO" 5; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 +printf %s "checking for C compiler default output file name... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 +printf "%s\n" "$ac_file" >&6; } +ac_exeext=$ac_cv_exeext + +rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out +ac_clean_files=$ac_clean_files_save +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 +printf %s "checking for suffix of executables... " >&6; } +if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +printf "%s\n" "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +then : + # If both `conftest.exe' and `conftest' are `present' (well, observable) +# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will +# work properly (i.e., refer to `conftest.exe'), while it won't with +# `rm'. +for ac_file in conftest.exe conftest conftest.*; do + test -f "$ac_file" || continue + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; + *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + break;; + * ) break;; + esac +done +else $as_nop + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot compute suffix of executables: cannot compile and link +See \`config.log' for more details" "$LINENO" 5; } +fi +rm -f conftest conftest$ac_cv_exeext +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 +printf "%s\n" "$ac_cv_exeext" >&6; } + +rm -f conftest.$ac_ext +EXEEXT=$ac_cv_exeext +ac_exeext=$EXEEXT +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main (void) +{ +FILE *f = fopen ("conftest.out", "w"); + return ferror (f) || fclose (f) != 0; + + ; + return 0; +} +_ACEOF +ac_clean_files="$ac_clean_files conftest.out" +# Check that the compiler produces executables we can run. If not, either +# the compiler is broken, or we cross compile. +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 +printf %s "checking whether we are cross compiling... " >&6; } +if test "$cross_compiling" != yes; then + { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +printf "%s\n" "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + if { ac_try='./conftest$ac_cv_exeext' + { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +printf "%s\n" "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; }; then + cross_compiling=no + else + if test "$cross_compiling" = maybe; then + cross_compiling=yes + else + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "cannot run C compiled programs. +If you meant to cross compile, use \`--host'. +See \`config.log' for more details" "$LINENO" 5; } + fi + fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 -$as_echo "$ac_cv_path_EGREP" >&6; } - EGREP="$ac_cv_path_EGREP" +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 +printf "%s\n" "$cross_compiling" >&6; } - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 -$as_echo_n "checking for ANSI C header files... " >&6; } -if ${ac_cv_header_stdc+:} false; then : - $as_echo_n "(cached) " >&6 -else +rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out +ac_clean_files=$ac_clean_files_save +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 +printf %s "checking for suffix of object files... " >&6; } +if test ${ac_cv_objext+y} +then : + printf %s "(cached) " >&6 +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#include -#include -#include -#include int -main () +main (void) { ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_header_stdc=yes -else - ac_cv_header_stdc=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f conftest.o conftest.obj +if { { ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +printf "%s\n" "$ac_try_echo"; } >&5 + (eval "$ac_compile") 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +then : + for ac_file in conftest.o conftest.obj conftest.*; do + test -f "$ac_file" || continue; + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; + *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` + break;; + esac +done +else $as_nop + printf "%s\n" "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 -if test $ac_cv_header_stdc = yes; then - # SunOS 4.x string.h does not declare mem*, contrary to ANSI. +{ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot compute suffix of object files: cannot compile +See \`config.log' for more details" "$LINENO" 5; } +fi +rm -f conftest.$ac_cv_objext conftest.$ac_ext +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 +printf "%s\n" "$ac_cv_objext" >&6; } +OBJEXT=$ac_cv_objext +ac_objext=$OBJEXT +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports GNU C" >&5 +printf %s "checking whether the compiler supports GNU C... " >&6; } +if test ${ac_cv_c_compiler_gnu+y} +then : + printf %s "(cached) " >&6 +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#include -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "memchr" >/dev/null 2>&1; then : +int +main (void) +{ +#ifndef __GNUC__ + choke me +#endif -else - ac_cv_header_stdc=no + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_compiler_gnu=yes +else $as_nop + ac_compiler_gnu=no fi -rm -f conftest* +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +ac_cv_c_compiler_gnu=$ac_compiler_gnu fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 +printf "%s\n" "$ac_cv_c_compiler_gnu" >&6; } +ac_compiler_gnu=$ac_cv_c_compiler_gnu -if test $ac_cv_header_stdc = yes; then - # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +if test $ac_compiler_gnu = yes; then + GCC=yes +else + GCC= +fi +ac_test_CFLAGS=${CFLAGS+y} +ac_save_CFLAGS=$CFLAGS +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 +printf %s "checking whether $CC accepts -g... " >&6; } +if test ${ac_cv_prog_cc_g+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_save_c_werror_flag=$ac_c_werror_flag + ac_c_werror_flag=yes + ac_cv_prog_cc_g=no + CFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#include +int +main (void) +{ + + ; + return 0; +} _ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "free" >/dev/null 2>&1; then : +if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_prog_cc_g=yes +else $as_nop + CFLAGS="" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ -else - ac_cv_header_stdc=no -fi -rm -f conftest* +int +main (void) +{ -fi + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : -if test $ac_cv_header_stdc = yes; then - # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. - if test "$cross_compiling" = yes; then : - : -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else $as_nop + ac_c_werror_flag=$ac_save_c_werror_flag + CFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#include -#include -#if ((' ' & 0x0FF) == 0x020) -# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') -# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) -#else -# define ISLOWER(c) \ - (('a' <= (c) && (c) <= 'i') \ - || ('j' <= (c) && (c) <= 'r') \ - || ('s' <= (c) && (c) <= 'z')) -# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) -#endif -#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) int -main () +main (void) { - int i; - for (i = 0; i < 256; i++) - if (XOR (islower (i), ISLOWER (i)) - || toupper (i) != TOUPPER (i)) - return 2; + + ; return 0; } _ACEOF -if ac_fn_c_try_run "$LINENO"; then : - +if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_prog_cc_g=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + ac_c_werror_flag=$ac_save_c_werror_flag +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 +printf "%s\n" "$ac_cv_prog_cc_g" >&6; } +if test $ac_test_CFLAGS; then + CFLAGS=$ac_save_CFLAGS +elif test $ac_cv_prog_cc_g = yes; then + if test "$GCC" = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-g" + fi else - ac_cv_header_stdc=no + if test "$GCC" = yes; then + CFLAGS="-O2" + else + CFLAGS= + fi fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext +ac_prog_cc_stdc=no +if test x$ac_prog_cc_stdc = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C11 features" >&5 +printf %s "checking for $CC option to enable C11 features... " >&6; } +if test ${ac_cv_prog_cc_c11+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_cv_prog_cc_c11=no +ac_save_CC=$CC +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_c_conftest_c11_program +_ACEOF +for ac_arg in '' -std=gnu11 +do + CC="$ac_save_CC $ac_arg" + if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_prog_cc_c11=$ac_arg +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam + test "x$ac_cv_prog_cc_c11" != "xno" && break +done +rm -f conftest.$ac_ext +CC=$ac_save_CC fi +if test "x$ac_cv_prog_cc_c11" = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +printf "%s\n" "unsupported" >&6; } +else $as_nop + if test "x$ac_cv_prog_cc_c11" = x +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +printf "%s\n" "none needed" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c11" >&5 +printf "%s\n" "$ac_cv_prog_cc_c11" >&6; } + CC="$CC $ac_cv_prog_cc_c11" +fi + ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c11 + ac_prog_cc_stdc=c11 +fi +fi +if test x$ac_prog_cc_stdc = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C99 features" >&5 +printf %s "checking for $CC option to enable C99 features... " >&6; } +if test ${ac_cv_prog_cc_c99+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_cv_prog_cc_c99=no +ac_save_CC=$CC +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_c_conftest_c99_program +_ACEOF +for ac_arg in '' -std=gnu99 -std=c99 -c99 -qlanglvl=extc1x -qlanglvl=extc99 -AC99 -D_STDC_C99= +do + CC="$ac_save_CC $ac_arg" + if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_prog_cc_c99=$ac_arg fi +rm -f core conftest.err conftest.$ac_objext conftest.beam + test "x$ac_cv_prog_cc_c99" != "xno" && break +done +rm -f conftest.$ac_ext +CC=$ac_save_CC fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 -$as_echo "$ac_cv_header_stdc" >&6; } -if test $ac_cv_header_stdc = yes; then -$as_echo "#define STDC_HEADERS 1" >>confdefs.h +if test "x$ac_cv_prog_cc_c99" = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +printf "%s\n" "unsupported" >&6; } +else $as_nop + if test "x$ac_cv_prog_cc_c99" = x +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +printf "%s\n" "none needed" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c99" >&5 +printf "%s\n" "$ac_cv_prog_cc_c99" >&6; } + CC="$CC $ac_cv_prog_cc_c99" +fi + ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c99 + ac_prog_cc_stdc=c99 +fi +fi +if test x$ac_prog_cc_stdc = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C89 features" >&5 +printf %s "checking for $CC option to enable C89 features... " >&6; } +if test ${ac_cv_prog_cc_c89+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_cv_prog_cc_c89=no +ac_save_CC=$CC +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_c_conftest_c89_program +_ACEOF +for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" +do + CC="$ac_save_CC $ac_arg" + if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_prog_cc_c89=$ac_arg +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam + test "x$ac_cv_prog_cc_c89" != "xno" && break +done +rm -f conftest.$ac_ext +CC=$ac_save_CC +fi +if test "x$ac_cv_prog_cc_c89" = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +printf "%s\n" "unsupported" >&6; } +else $as_nop + if test "x$ac_cv_prog_cc_c89" = x +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +printf "%s\n" "none needed" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 +printf "%s\n" "$ac_cv_prog_cc_c89" >&6; } + CC="$CC $ac_cv_prog_cc_c89" +fi + ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c89 + ac_prog_cc_stdc=c89 +fi fi -# On IRIX 5.3, sys/types and inttypes.h are conflicting. -for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ - inttypes.h stdint.h unistd.h -do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default -" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu -fi + +ac_header= ac_cache= +for ac_item in $ac_header_c_list +do + if test $ac_cache; then + ac_fn_c_check_header_compile "$LINENO" $ac_header ac_cv_header_$ac_cache "$ac_includes_default" + if eval test \"x\$ac_cv_header_$ac_cache\" = xyes; then + printf "%s\n" "#define $ac_item 1" >> confdefs.h + fi + ac_header= ac_cache= + elif test $ac_header; then + ac_cache=$ac_item + else + ac_header=$ac_item + fi done - ac_fn_c_check_header_mongrel "$LINENO" "minix/config.h" "ac_cv_header_minix_config_h" "$ac_includes_default" -if test "x$ac_cv_header_minix_config_h" = xyes; then : - MINIX=yes -else - MINIX= -fi - if test "$MINIX" = yes; then -$as_echo "#define _POSIX_SOURCE 1" >>confdefs.h -$as_echo "#define _POSIX_1_SOURCE 2" >>confdefs.h +if test $ac_cv_header_stdlib_h = yes && test $ac_cv_header_string_h = yes +then : + +printf "%s\n" "#define STDC_HEADERS 1" >>confdefs.h +fi -$as_echo "#define _MINIX 1" >>confdefs.h - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether it is safe to define __EXTENSIONS__" >&5 -$as_echo_n "checking whether it is safe to define __EXTENSIONS__... " >&6; } -if ${ac_cv_safe_to_define___extensions__+:} false; then : - $as_echo_n "(cached) " >&6 -else + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether it is safe to define __EXTENSIONS__" >&5 +printf %s "checking whether it is safe to define __EXTENSIONS__... " >&6; } +if test ${ac_cv_safe_to_define___extensions__+y} +then : + printf %s "(cached) " >&6 +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ # define __EXTENSIONS__ 1 $ac_includes_default int -main () +main (void) { ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : ac_cv_safe_to_define___extensions__=yes -else +else $as_nop ac_cv_safe_to_define___extensions__=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_safe_to_define___extensions__" >&5 +printf "%s\n" "$ac_cv_safe_to_define___extensions__" >&6; } + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether _XOPEN_SOURCE should be defined" >&5 +printf %s "checking whether _XOPEN_SOURCE should be defined... " >&6; } +if test ${ac_cv_should_define__xopen_source+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_cv_should_define__xopen_source=no + if test $ac_cv_header_wchar_h = yes +then : + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include + mbstate_t x; +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #define _XOPEN_SOURCE 500 + #include + mbstate_t x; +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_should_define__xopen_source=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_safe_to_define___extensions__" >&5 -$as_echo "$ac_cv_safe_to_define___extensions__" >&6; } - test $ac_cv_safe_to_define___extensions__ = yes && - $as_echo "#define __EXTENSIONS__ 1" >>confdefs.h +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_should_define__xopen_source" >&5 +printf "%s\n" "$ac_cv_should_define__xopen_source" >&6; } + + printf "%s\n" "#define _ALL_SOURCE 1" >>confdefs.h + + printf "%s\n" "#define _DARWIN_C_SOURCE 1" >>confdefs.h + + printf "%s\n" "#define _GNU_SOURCE 1" >>confdefs.h + + printf "%s\n" "#define _HPUX_ALT_XOPEN_SOCKET_API 1" >>confdefs.h + + printf "%s\n" "#define _NETBSD_SOURCE 1" >>confdefs.h + + printf "%s\n" "#define _OPENBSD_SOURCE 1" >>confdefs.h + + printf "%s\n" "#define _POSIX_PTHREAD_SEMANTICS 1" >>confdefs.h + + printf "%s\n" "#define __STDC_WANT_IEC_60559_ATTRIBS_EXT__ 1" >>confdefs.h + + printf "%s\n" "#define __STDC_WANT_IEC_60559_BFP_EXT__ 1" >>confdefs.h + + printf "%s\n" "#define __STDC_WANT_IEC_60559_DFP_EXT__ 1" >>confdefs.h + + printf "%s\n" "#define __STDC_WANT_IEC_60559_FUNCS_EXT__ 1" >>confdefs.h + + printf "%s\n" "#define __STDC_WANT_IEC_60559_TYPES_EXT__ 1" >>confdefs.h + + printf "%s\n" "#define __STDC_WANT_LIB_EXT2__ 1" >>confdefs.h + + printf "%s\n" "#define __STDC_WANT_MATH_SPEC_FUNCS__ 1" >>confdefs.h + + printf "%s\n" "#define _TANDEM_SOURCE 1" >>confdefs.h + + if test $ac_cv_header_minix_config_h = yes +then : + MINIX=yes + printf "%s\n" "#define _MINIX 1" >>confdefs.h - $as_echo "#define _ALL_SOURCE 1" >>confdefs.h + printf "%s\n" "#define _POSIX_SOURCE 1" >>confdefs.h - $as_echo "#define _GNU_SOURCE 1" >>confdefs.h + printf "%s\n" "#define _POSIX_1_SOURCE 2" >>confdefs.h - $as_echo "#define _POSIX_PTHREAD_SEMANTICS 1" >>confdefs.h +else $as_nop + MINIX= +fi + if test $ac_cv_safe_to_define___extensions__ = yes +then : + printf "%s\n" "#define __EXTENSIONS__ 1" >>confdefs.h - $as_echo "#define _TANDEM_SOURCE 1" >>confdefs.h +fi + if test $ac_cv_should_define__xopen_source = yes +then : + printf "%s\n" "#define _XOPEN_SOURCE 500" >>confdefs.h +fi # System default paths astsbindir='${sbindir}' @@ -4798,10 +5181,10 @@ astvarrundir='/Library/Application Support/Asterisk/Run' fi -$as_echo "#define AST_POLL_COMPAT 1" >>confdefs.h +printf "%s\n" "#define AST_POLL_COMPAT 1" >>confdefs.h -$as_echo "#define _DARWIN_UNLIMITED_SELECT 1" >>confdefs.h +printf "%s\n" "#define _DARWIN_UNLIMITED_SELECT 1" >>confdefs.h ;; solaris*) @@ -4898,8 +5281,8 @@ -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether char is unsigned" >&5 -$as_echo_n "checking whether char is unsigned... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether char is unsigned" >&5 +printf %s "checking whether char is unsigned... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -4910,32 +5293,34 @@ _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } CONFIG_SIGNED_CHAR="" -else +else $as_nop - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } CONFIG_SIGNED_CHAR="-fsigned-char" fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext # check for uname if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}uname", so it can be a program name with args. set dummy ${ac_tool_prefix}uname; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_UNAME+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_UNAME+y} +then : + printf %s "(cached) " >&6 +else $as_nop case $UNAME in [\\/]* | ?:[\\/]*) ac_cv_path_UNAME="$UNAME" # Let the user override the test with a path. @@ -4945,11 +5330,15 @@ for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_UNAME="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_UNAME="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -4961,11 +5350,11 @@ fi UNAME=$ac_cv_path_UNAME if test -n "$UNAME"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $UNAME" >&5 -$as_echo "$UNAME" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $UNAME" >&5 +printf "%s\n" "$UNAME" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -4974,11 +5363,12 @@ ac_pt_UNAME=$UNAME # Extract the first word of "uname", so it can be a program name with args. set dummy uname; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_ac_pt_UNAME+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_ac_pt_UNAME+y} +then : + printf %s "(cached) " >&6 +else $as_nop case $ac_pt_UNAME in [\\/]* | ?:[\\/]*) ac_cv_path_ac_pt_UNAME="$ac_pt_UNAME" # Let the user override the test with a path. @@ -4988,11 +5378,15 @@ for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_ac_pt_UNAME="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_ac_pt_UNAME="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -5004,11 +5398,11 @@ fi ac_pt_UNAME=$ac_cv_path_ac_pt_UNAME if test -n "$ac_pt_UNAME"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_UNAME" >&5 -$as_echo "$ac_pt_UNAME" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_pt_UNAME" >&5 +printf "%s\n" "$ac_pt_UNAME" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi if test "x$ac_pt_UNAME" = x; then @@ -5016,8 +5410,8 @@ else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac UNAME=$ac_pt_UNAME @@ -5041,11 +5435,12 @@ if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else @@ -5053,11 +5448,15 @@ for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}gcc" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -5068,11 +5467,11 @@ fi CC=$ac_cv_prog_CC if test -n "$CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -$as_echo "$CC" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +printf "%s\n" "$CC" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -5081,11 +5480,12 @@ ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else @@ -5093,11 +5493,15 @@ for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="gcc" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -5108,11 +5512,11 @@ fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 -$as_echo "$ac_ct_CC" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +printf "%s\n" "$ac_ct_CC" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi if test "x$ac_ct_CC" = x; then @@ -5120,8 +5524,8 @@ else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC @@ -5133,11 +5537,12 @@ if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}g++", so it can be a program name with args. set dummy ${ac_tool_prefix}g++; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CXX+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_CXX+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$CXX"; then ac_cv_prog_CXX="$CXX" # Let the user override the test. else @@ -5145,11 +5550,15 @@ for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_CXX="${ac_tool_prefix}g++" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -5160,11 +5569,11 @@ fi CXX=$ac_cv_prog_CXX if test -n "$CXX"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXX" >&5 -$as_echo "$CXX" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CXX" >&5 +printf "%s\n" "$CXX" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -5173,11 +5582,12 @@ ac_ct_CXX=$CXX # Extract the first word of "g++", so it can be a program name with args. set dummy g++; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_CXX+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_CXX+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$ac_ct_CXX"; then ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test. else @@ -5185,11 +5595,15 @@ for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CXX="g++" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -5200,11 +5614,11 @@ fi ac_ct_CXX=$ac_cv_prog_ac_ct_CXX if test -n "$ac_ct_CXX"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CXX" >&5 -$as_echo "$ac_ct_CXX" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CXX" >&5 +printf "%s\n" "$ac_ct_CXX" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi if test "x$ac_ct_CXX" = x; then @@ -5212,8 +5626,8 @@ else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CXX=$ac_ct_CXX @@ -5225,11 +5639,12 @@ if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ld", so it can be a program name with args. set dummy ${ac_tool_prefix}ld; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_LD+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_LD+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$LD"; then ac_cv_prog_LD="$LD" # Let the user override the test. else @@ -5237,11 +5652,15 @@ for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_LD="${ac_tool_prefix}ld" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -5252,11 +5671,11 @@ fi LD=$ac_cv_prog_LD if test -n "$LD"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LD" >&5 -$as_echo "$LD" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $LD" >&5 +printf "%s\n" "$LD" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -5265,11 +5684,12 @@ ac_ct_LD=$LD # Extract the first word of "ld", so it can be a program name with args. set dummy ld; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_LD+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_LD+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$ac_ct_LD"; then ac_cv_prog_ac_ct_LD="$ac_ct_LD" # Let the user override the test. else @@ -5277,11 +5697,15 @@ for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_LD="ld" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -5292,11 +5716,11 @@ fi ac_ct_LD=$ac_cv_prog_ac_ct_LD if test -n "$ac_ct_LD"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_LD" >&5 -$as_echo "$ac_ct_LD" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_LD" >&5 +printf "%s\n" "$ac_ct_LD" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi if test "x$ac_ct_LD" = x; then @@ -5304,8 +5728,8 @@ else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac LD=$ac_ct_LD @@ -5317,11 +5741,12 @@ if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ac_tool_prefix}ranlib; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_RANLIB+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_RANLIB+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$RANLIB"; then ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. else @@ -5329,11 +5754,15 @@ for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -5344,11 +5773,11 @@ fi RANLIB=$ac_cv_prog_RANLIB if test -n "$RANLIB"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 -$as_echo "$RANLIB" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 +printf "%s\n" "$RANLIB" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -5357,11 +5786,12 @@ ac_ct_RANLIB=$RANLIB # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_RANLIB+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_RANLIB+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$ac_ct_RANLIB"; then ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. else @@ -5369,11 +5799,15 @@ for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_RANLIB="ranlib" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -5384,11 +5818,11 @@ fi ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB if test -n "$ac_ct_RANLIB"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 -$as_echo "$ac_ct_RANLIB" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 +printf "%s\n" "$ac_ct_RANLIB" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi if test "x$ac_ct_RANLIB" = x; then @@ -5396,8 +5830,8 @@ else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac RANLIB=$ac_ct_RANLIB @@ -5411,6 +5845,12 @@ fi # Checks for programs. + + + + + + ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -5421,15 +5861,16 @@ CXX=$CCC else if test -n "$ac_tool_prefix"; then - for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC + for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC clang++ do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CXX+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_CXX+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$CXX"; then ac_cv_prog_CXX="$CXX" # Let the user override the test. else @@ -5437,11 +5878,15 @@ for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_CXX="$ac_tool_prefix$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -5452,11 +5897,11 @@ fi CXX=$ac_cv_prog_CXX if test -n "$CXX"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXX" >&5 -$as_echo "$CXX" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CXX" >&5 +printf "%s\n" "$CXX" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -5465,15 +5910,16 @@ fi if test -z "$CXX"; then ac_ct_CXX=$CXX - for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC + for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC clang++ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_CXX+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_CXX+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$ac_ct_CXX"; then ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test. else @@ -5481,11 +5927,15 @@ for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CXX="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -5496,11 +5946,11 @@ fi ac_ct_CXX=$ac_cv_prog_ac_ct_CXX if test -n "$ac_ct_CXX"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CXX" >&5 -$as_echo "$ac_ct_CXX" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CXX" >&5 +printf "%s\n" "$ac_ct_CXX" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -5512,8 +5962,8 @@ else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CXX=$ac_ct_CXX @@ -5523,7 +5973,7 @@ fi fi # Provide some information about the compiler. -$as_echo "$as_me:${as_lineno-$LINENO}: checking for C++ compiler version" >&5 +printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C++ compiler version" >&5 set X $ac_compile ac_compiler=$2 for ac_option in --version -v -V -qversion; do @@ -5533,7 +5983,7 @@ *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 +printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then @@ -5543,20 +5993,21 @@ cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C++ compiler" >&5 -$as_echo_n "checking whether we are using the GNU C++ compiler... " >&6; } -if ${ac_cv_cxx_compiler_gnu+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports GNU C++" >&5 +printf %s "checking whether the compiler supports GNU C++... " >&6; } +if test ${ac_cv_cxx_compiler_gnu+y} +then : + printf %s "(cached) " >&6 +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int -main () +main (void) { #ifndef __GNUC__ choke me @@ -5566,29 +6017,33 @@ return 0; } _ACEOF -if ac_fn_cxx_try_compile "$LINENO"; then : +if ac_fn_cxx_try_compile "$LINENO" +then : ac_compiler_gnu=yes -else +else $as_nop ac_compiler_gnu=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ac_cv_cxx_compiler_gnu=$ac_compiler_gnu fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cxx_compiler_gnu" >&5 -$as_echo "$ac_cv_cxx_compiler_gnu" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cxx_compiler_gnu" >&5 +printf "%s\n" "$ac_cv_cxx_compiler_gnu" >&6; } +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + if test $ac_compiler_gnu = yes; then GXX=yes else GXX= fi -ac_test_CXXFLAGS=${CXXFLAGS+set} +ac_test_CXXFLAGS=${CXXFLAGS+y} ac_save_CXXFLAGS=$CXXFLAGS -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX accepts -g" >&5 -$as_echo_n "checking whether $CXX accepts -g... " >&6; } -if ${ac_cv_prog_cxx_g+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CXX accepts -g" >&5 +printf %s "checking whether $CXX accepts -g... " >&6; } +if test ${ac_cv_prog_cxx_g+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_save_cxx_werror_flag=$ac_cxx_werror_flag ac_cxx_werror_flag=yes ac_cv_prog_cxx_g=no @@ -5597,57 +6052,60 @@ /* end confdefs.h. */ int -main () +main (void) { ; return 0; } _ACEOF -if ac_fn_cxx_try_compile "$LINENO"; then : +if ac_fn_cxx_try_compile "$LINENO" +then : ac_cv_prog_cxx_g=yes -else +else $as_nop CXXFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int -main () +main (void) { ; return 0; } _ACEOF -if ac_fn_cxx_try_compile "$LINENO"; then : +if ac_fn_cxx_try_compile "$LINENO" +then : -else +else $as_nop ac_cxx_werror_flag=$ac_save_cxx_werror_flag CXXFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int -main () +main (void) { ; return 0; } _ACEOF -if ac_fn_cxx_try_compile "$LINENO"; then : +if ac_fn_cxx_try_compile "$LINENO" +then : ac_cv_prog_cxx_g=yes fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ac_cxx_werror_flag=$ac_save_cxx_werror_flag fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_g" >&5 -$as_echo "$ac_cv_prog_cxx_g" >&6; } -if test "$ac_test_CXXFLAGS" = set; then +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_g" >&5 +printf "%s\n" "$ac_cv_prog_cxx_g" >&6; } +if test $ac_test_CXXFLAGS; then CXXFLAGS=$ac_save_CXXFLAGS elif test $ac_cv_prog_cxx_g = yes; then if test "$GXX" = yes; then @@ -5662,6 +6120,100 @@ CXXFLAGS= fi fi +ac_prog_cxx_stdcxx=no +if test x$ac_prog_cxx_stdcxx = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CXX option to enable C++11 features" >&5 +printf %s "checking for $CXX option to enable C++11 features... " >&6; } +if test ${ac_cv_prog_cxx_11+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_cv_prog_cxx_11=no +ac_save_CXX=$CXX +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_cxx_conftest_cxx11_program +_ACEOF +for ac_arg in '' -std=gnu++11 -std=gnu++0x -std=c++11 -std=c++0x -qlanglvl=extended0x -AA +do + CXX="$ac_save_CXX $ac_arg" + if ac_fn_cxx_try_compile "$LINENO" +then : + ac_cv_prog_cxx_cxx11=$ac_arg +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam + test "x$ac_cv_prog_cxx_cxx11" != "xno" && break +done +rm -f conftest.$ac_ext +CXX=$ac_save_CXX +fi + +if test "x$ac_cv_prog_cxx_cxx11" = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +printf "%s\n" "unsupported" >&6; } +else $as_nop + if test "x$ac_cv_prog_cxx_cxx11" = x +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +printf "%s\n" "none needed" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_cxx11" >&5 +printf "%s\n" "$ac_cv_prog_cxx_cxx11" >&6; } + CXX="$CXX $ac_cv_prog_cxx_cxx11" +fi + ac_cv_prog_cxx_stdcxx=$ac_cv_prog_cxx_cxx11 + ac_prog_cxx_stdcxx=cxx11 +fi +fi +if test x$ac_prog_cxx_stdcxx = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CXX option to enable C++98 features" >&5 +printf %s "checking for $CXX option to enable C++98 features... " >&6; } +if test ${ac_cv_prog_cxx_98+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_cv_prog_cxx_98=no +ac_save_CXX=$CXX +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_cxx_conftest_cxx98_program +_ACEOF +for ac_arg in '' -std=gnu++98 -std=c++98 -qlanglvl=extended -AA +do + CXX="$ac_save_CXX $ac_arg" + if ac_fn_cxx_try_compile "$LINENO" +then : + ac_cv_prog_cxx_cxx98=$ac_arg +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam + test "x$ac_cv_prog_cxx_cxx98" != "xno" && break +done +rm -f conftest.$ac_ext +CXX=$ac_save_CXX +fi + +if test "x$ac_cv_prog_cxx_cxx98" = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +printf "%s\n" "unsupported" >&6; } +else $as_nop + if test "x$ac_cv_prog_cxx_cxx98" = x +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +printf "%s\n" "none needed" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_cxx98" >&5 +printf "%s\n" "$ac_cv_prog_cxx_cxx98" >&6; } + CXX="$CXX $ac_cv_prog_cxx_cxx98" +fi + ac_cv_prog_cxx_stdcxx=$ac_cv_prog_cxx_cxx98 + ac_prog_cxx_stdcxx=cxx98 +fi +fi + ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -5673,40 +6225,36 @@ ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 -$as_echo_n "checking how to run the C preprocessor... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 +printf %s "checking how to run the C preprocessor... " >&6; } # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then - if ${ac_cv_prog_CPP+:} false; then : - $as_echo_n "(cached) " >&6 -else - # Double quotes because CPP needs to be expanded - for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" + if test ${ac_cv_prog_CPP+y} +then : + printf %s "(cached) " >&6 +else $as_nop + # Double quotes because $CC needs to be expanded + for CPP in "$CC -E" "$CC -E -traditional-cpp" cpp /lib/cpp do ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. - # Prefer to if __STDC__ is defined, since - # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#ifdef __STDC__ -# include -#else -# include -#endif +#include Syntax error _ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : +if ac_fn_c_try_cpp "$LINENO" +then : -else +else $as_nop # Broken: fails on valid input. continue fi @@ -5718,10 +6266,11 @@ /* end confdefs.h. */ #include _ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : +if ac_fn_c_try_cpp "$LINENO" +then : # Broken: success on invalid input. continue -else +else $as_nop # Passes both tests. ac_preproc_ok=: break @@ -5731,7 +6280,8 @@ done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext -if $ac_preproc_ok; then : +if $ac_preproc_ok +then : break fi @@ -5743,29 +6293,24 @@ else ac_cv_prog_CPP=$CPP fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 -$as_echo "$CPP" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 +printf "%s\n" "$CPP" >&6; } ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. - # Prefer to if __STDC__ is defined, since - # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#ifdef __STDC__ -# include -#else -# include -#endif +#include Syntax error _ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : +if ac_fn_c_try_cpp "$LINENO" +then : -else +else $as_nop # Broken: fails on valid input. continue fi @@ -5777,10 +6322,11 @@ /* end confdefs.h. */ #include _ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : +if ac_fn_c_try_cpp "$LINENO" +then : # Broken: success on invalid input. continue -else +else $as_nop # Passes both tests. ac_preproc_ok=: break @@ -5790,11 +6336,12 @@ done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext -if $ac_preproc_ok; then : +if $ac_preproc_ok +then : -else - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +else $as_nop + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details" "$LINENO" 5; } fi @@ -5810,36 +6357,32 @@ ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C++ preprocessor" >&5 -$as_echo_n "checking how to run the C++ preprocessor... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to run the C++ preprocessor" >&5 +printf %s "checking how to run the C++ preprocessor... " >&6; } if test -z "$CXXCPP"; then - if ${ac_cv_prog_CXXCPP+:} false; then : - $as_echo_n "(cached) " >&6 -else - # Double quotes because CXXCPP needs to be expanded - for CXXCPP in "$CXX -E" "/lib/cpp" + if test ${ac_cv_prog_CXXCPP+y} +then : + printf %s "(cached) " >&6 +else $as_nop + # Double quotes because $CXX needs to be expanded + for CXXCPP in "$CXX -E" cpp /lib/cpp do ac_preproc_ok=false for ac_cxx_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. - # Prefer to if __STDC__ is defined, since - # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#ifdef __STDC__ -# include -#else -# include -#endif +#include Syntax error _ACEOF -if ac_fn_cxx_try_cpp "$LINENO"; then : +if ac_fn_cxx_try_cpp "$LINENO" +then : -else +else $as_nop # Broken: fails on valid input. continue fi @@ -5851,10 +6394,11 @@ /* end confdefs.h. */ #include _ACEOF -if ac_fn_cxx_try_cpp "$LINENO"; then : +if ac_fn_cxx_try_cpp "$LINENO" +then : # Broken: success on invalid input. continue -else +else $as_nop # Passes both tests. ac_preproc_ok=: break @@ -5864,7 +6408,8 @@ done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext -if $ac_preproc_ok; then : +if $ac_preproc_ok +then : break fi @@ -5876,29 +6421,24 @@ else ac_cv_prog_CXXCPP=$CXXCPP fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXXCPP" >&5 -$as_echo "$CXXCPP" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CXXCPP" >&5 +printf "%s\n" "$CXXCPP" >&6; } ac_preproc_ok=false for ac_cxx_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. - # Prefer to if __STDC__ is defined, since - # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#ifdef __STDC__ -# include -#else -# include -#endif +#include Syntax error _ACEOF -if ac_fn_cxx_try_cpp "$LINENO"; then : +if ac_fn_cxx_try_cpp "$LINENO" +then : -else +else $as_nop # Broken: fails on valid input. continue fi @@ -5910,10 +6450,11 @@ /* end confdefs.h. */ #include _ACEOF -if ac_fn_cxx_try_cpp "$LINENO"; then : +if ac_fn_cxx_try_cpp "$LINENO" +then : # Broken: success on invalid input. continue -else +else $as_nop # Passes both tests. ac_preproc_ok=: break @@ -5923,11 +6464,12 @@ done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext -if $ac_preproc_ok; then : +if $ac_preproc_ok +then : -else - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +else $as_nop + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "C++ preprocessor \"$CXXCPP\" fails sanity check See \`config.log' for more details" "$LINENO" 5; } fi @@ -5940,11 +6482,12 @@ # This macro is just copied into our local acinclude.m4 from libtool.m4 so that # the developers regenerating the configure script don't have to install libtool. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5 -$as_echo_n "checking for a sed that does not truncate output... " >&6; } -if ${ac_cv_path_SED+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5 +printf %s "checking for a sed that does not truncate output... " >&6; } +if test ${ac_cv_path_SED+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ for ac_i in 1 2 3 4 5 6 7; do ac_script="$ac_script$as_nl$ac_script" @@ -5958,10 +6501,15 @@ for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_prog in sed gsed; do + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_prog in sed gsed + do for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_SED="$as_dir/$ac_prog$ac_exec_ext" + ac_path_SED="$as_dir$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_SED" || continue # Check for GNU ac_path_SED and select it if it is found. # Check for GNU $ac_path_SED @@ -5970,13 +6518,13 @@ ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;; *) ac_count=0 - $as_echo_n 0123456789 >"conftest.in" + printf %s 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" - $as_echo '' >> "conftest.nl" + printf "%s\n" '' >> "conftest.nl" "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val @@ -6004,39 +6552,41 @@ fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5 -$as_echo "$ac_cv_path_SED" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5 +printf "%s\n" "$ac_cv_path_SED" >&6; } SED="$ac_cv_path_SED" rm -f conftest.sed -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 -$as_echo_n "checking for egrep... " >&6; } -if ${ac_cv_prog_egrep+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 +printf %s "checking for egrep... " >&6; } +if test ${ac_cv_prog_egrep+y} +then : + printf %s "(cached) " >&6 +else $as_nop if echo a | (grep -E '(a|b)') >/dev/null 2>&1 then ac_cv_prog_egrep='grep -E' else ac_cv_prog_egrep='egrep' fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_egrep" >&5 -$as_echo "$ac_cv_prog_egrep" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_egrep" >&5 +printf "%s\n" "$ac_cv_prog_egrep" >&6; } EGREP=$ac_cv_prog_egrep # Check whether --with-gnu-ld was given. -if test "${with_gnu_ld+set}" = set; then : +if test ${with_gnu_ld+y} +then : withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes -else +else $as_nop with_gnu_ld=no fi ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5 -$as_echo_n "checking for ld used by $CC... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5 +printf %s "checking for ld used by $CC... " >&6; } case $host in *-*-mingw*) # gcc leaves a trailing carriage return which upsets mingw @@ -6065,15 +6615,16 @@ ;; esac elif test "$with_gnu_ld" = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 -$as_echo_n "checking for GNU ld... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 +printf %s "checking for GNU ld... " >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 -$as_echo_n "checking for non-GNU ld... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 +printf %s "checking for non-GNU ld... " >&6; } fi -if ${lt_cv_path_LD+:} false; then : - $as_echo_n "(cached) " >&6 -else +if test ${lt_cv_path_LD+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -z "$LD"; then lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do @@ -6102,18 +6653,19 @@ LD="$lt_cv_path_LD" if test -n "$LD"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LD" >&5 -$as_echo "$LD" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $LD" >&5 +printf "%s\n" "$LD" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 -$as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; } -if ${lt_cv_prog_gnu_ld+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 +printf %s "checking if the linker ($LD) is GNU ld... " >&6; } +if test ${lt_cv_prog_gnu_ld+y} +then : + printf %s "(cached) " >&6 +else $as_nop # I'd rather use --version here, but apparently some GNU lds only accept -v. case `$LD -v 2>&1 &5 -$as_echo "$lt_cv_prog_gnu_ld" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_gnu_ld" >&5 +printf "%s\n" "$lt_cv_prog_gnu_ld" >&6; } with_gnu_ld=$lt_cv_prog_gnu_ld # note, does not work on FreeBSD @@ -6133,11 +6685,12 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_AWK+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_AWK+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$AWK"; then ac_cv_prog_AWK="$AWK" # Let the user override the test. else @@ -6145,11 +6698,15 @@ for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_AWK="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -6160,18 +6717,19 @@ fi AWK=$ac_cv_prog_AWK if test -n "$AWK"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 -$as_echo "$AWK" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 +printf "%s\n" "$AWK" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi test -n "$AWK" && break done -# Find a good install program. We prefer a C program (faster), + + # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: # SysV /etc/install, /usr/sbin/install @@ -6185,20 +6743,25 @@ # OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. # Reject install programs that cannot install multiple files. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 -$as_echo_n "checking for a BSD-compatible install... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 +printf %s "checking for a BSD-compatible install... " >&6; } if test -z "$INSTALL"; then -if ${ac_cv_path_install+:} false; then : - $as_echo_n "(cached) " >&6 -else +if test ${ac_cv_path_install+y} +then : + printf %s "(cached) " >&6 +else $as_nop as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - # Account for people who put trailing slashes in PATH elements. -case $as_dir/ in #(( - ./ | .// | /[cC]/* | \ + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + # Account for fact that we put trailing slashes in our PATH walk. +case $as_dir in #(( + ./ | /[cC]/* | \ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \ /usr/ucb/* ) ;; @@ -6208,13 +6771,13 @@ # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_prog$ac_exec_ext"; then if test $ac_prog = install && - grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + grep dspmsg "$as_dir$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : elif test $ac_prog = install && - grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + grep pwplus "$as_dir$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # program-specific install script used by HP pwplus--don't use. : else @@ -6222,12 +6785,12 @@ echo one > conftest.one echo two > conftest.two mkdir conftest.dir - if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && + if "$as_dir$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir/" && test -s conftest.one && test -s conftest.two && test -s conftest.dir/conftest.one && test -s conftest.dir/conftest.two then - ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" + ac_cv_path_install="$as_dir$ac_prog$ac_exec_ext -c" break 3 fi fi @@ -6243,7 +6806,7 @@ rm -rf conftest.one conftest.two conftest.dir fi - if test "${ac_cv_path_install+set}" = set; then + if test ${ac_cv_path_install+y}; then INSTALL=$ac_cv_path_install else # As a last resort, use the slow shell script. Don't cache a @@ -6253,8 +6816,8 @@ INSTALL=$ac_install_sh fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 -$as_echo "$INSTALL" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 +printf "%s\n" "$INSTALL" >&6; } # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. @@ -6264,25 +6827,26 @@ test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5 -$as_echo_n "checking whether ln -s works... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5 +printf %s "checking whether ln -s works... " >&6; } LN_S=$as_ln_s if test "$LN_S" = "ln -s"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5 -$as_echo "no, using $LN_S" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5 +printf "%s\n" "no, using $LN_S" >&6; } fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ac_tool_prefix}ranlib; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_RANLIB+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_RANLIB+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$RANLIB"; then ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. else @@ -6290,11 +6854,15 @@ for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -6305,11 +6873,11 @@ fi RANLIB=$ac_cv_prog_RANLIB if test -n "$RANLIB"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 -$as_echo "$RANLIB" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 +printf "%s\n" "$RANLIB" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -6318,11 +6886,12 @@ ac_ct_RANLIB=$RANLIB # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_RANLIB+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_RANLIB+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$ac_ct_RANLIB"; then ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. else @@ -6330,11 +6899,15 @@ for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_RANLIB="ranlib" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -6345,11 +6918,11 @@ fi ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB if test -n "$ac_ct_RANLIB"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 -$as_echo "$ac_ct_RANLIB" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 +printf "%s\n" "$ac_ct_RANLIB" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi if test "x$ac_ct_RANLIB" = x; then @@ -6357,8 +6930,8 @@ else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac RANLIB=$ac_ct_RANLIB @@ -6367,11 +6940,12 @@ RANLIB="$ac_cv_prog_RANLIB" fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU make" >&5 -$as_echo_n "checking for GNU make... " >&6; } -if ${ac_cv_GNU_MAKE+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for GNU make" >&5 +printf %s "checking for GNU make... " >&6; } +if test ${ac_cv_GNU_MAKE+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_cv_GNU_MAKE='Not Found' ; ac_cv_GNU_MAKE_VERSION_MAJOR=0 ; ac_cv_GNU_MAKE_VERSION_MINOR=0 ; @@ -6386,8 +6960,8 @@ done ; fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_GNU_MAKE" >&5 -$as_echo "$ac_cv_GNU_MAKE" >&6; } ; +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_GNU_MAKE" >&5 +printf "%s\n" "$ac_cv_GNU_MAKE" >&6; } ; if test "x$ac_cv_GNU_MAKE" = "xNot Found" ; then as_fn_error $? "*** Please install GNU make. It is required to build Asterisk!" "$LINENO" 5 exit 1 @@ -6395,11 +6969,81 @@ GNU_MAKE=$ac_cv_GNU_MAKE -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 -$as_echo_n "checking for egrep... " >&6; } -if ${ac_cv_path_EGREP+:} false; then : - $as_echo_n "(cached) " >&6 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 +printf %s "checking for grep that handles long lines and -e... " >&6; } +if test ${ac_cv_path_GREP+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -z "$GREP"; then + ac_path_GREP_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_prog in grep ggrep + do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_GREP="$as_dir$ac_prog$ac_exec_ext" + as_fn_executable_p "$ac_path_GREP" || continue +# Check for GNU ac_path_GREP and select it if it is found. + # Check for GNU $ac_path_GREP +case `"$ac_path_GREP" --version 2>&1` in +*GNU*) + ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; +*) + ac_count=0 + printf %s 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + printf "%s\n" 'GREP' >> "conftest.nl" + "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_GREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_GREP="$ac_path_GREP" + ac_path_GREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_GREP_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_GREP"; then + as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + fi else + ac_cv_path_GREP=$GREP +fi + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 +printf "%s\n" "$ac_cv_path_GREP" >&6; } + GREP="$ac_cv_path_GREP" + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 +printf %s "checking for egrep... " >&6; } +if test ${ac_cv_path_EGREP+y} +then : + printf %s "(cached) " >&6 +else $as_nop if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 then ac_cv_path_EGREP="$GREP -E" else @@ -6410,10 +7054,15 @@ for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_prog in egrep; do + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_prog in egrep + do for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" + ac_path_EGREP="$as_dir$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_EGREP" || continue # Check for GNU ac_path_EGREP and select it if it is found. # Check for GNU $ac_path_EGREP @@ -6422,13 +7071,13 @@ ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; *) ac_count=0 - $as_echo_n 0123456789 >"conftest.in" + printf %s 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" - $as_echo 'EGREP' >> "conftest.nl" + printf "%s\n" 'EGREP' >> "conftest.nl" "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val @@ -6457,8 +7106,8 @@ fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 -$as_echo "$ac_cv_path_EGREP" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 +printf "%s\n" "$ac_cv_path_EGREP" >&6; } EGREP="$ac_cv_path_EGREP" @@ -6468,11 +7117,12 @@ do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_STRIP+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_STRIP+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else @@ -6480,11 +7130,15 @@ for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_STRIP="$ac_tool_prefix$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -6495,11 +7149,11 @@ fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 -$as_echo "$STRIP" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 +printf "%s\n" "$STRIP" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -6512,11 +7166,12 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_STRIP+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_STRIP+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. else @@ -6524,11 +7179,15 @@ for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_STRIP="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -6539,11 +7198,11 @@ fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 -$as_echo "$ac_ct_STRIP" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 +printf "%s\n" "$ac_ct_STRIP" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -6555,8 +7214,8 @@ else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac STRIP=$ac_ct_STRIP @@ -6568,11 +7227,12 @@ do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_AR+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_AR+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$AR"; then ac_cv_prog_AR="$AR" # Let the user override the test. else @@ -6580,11 +7240,15 @@ for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_AR="$ac_tool_prefix$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -6595,11 +7259,11 @@ fi AR=$ac_cv_prog_AR if test -n "$AR"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 -$as_echo "$AR" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 +printf "%s\n" "$AR" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -6612,11 +7276,12 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_AR+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_AR+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$ac_ct_AR"; then ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. else @@ -6624,11 +7289,15 @@ for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_AR="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -6639,11 +7308,11 @@ fi ac_ct_AR=$ac_cv_prog_ac_ct_AR if test -n "$ac_ct_AR"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 -$as_echo "$ac_ct_AR" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 +printf "%s\n" "$ac_ct_AR" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -6655,8 +7324,8 @@ else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac AR=$ac_ct_AR @@ -6672,11 +7341,12 @@ # Extract the first word of "bison", so it can be a program name with args. set dummy bison; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_BISON+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_BISON+y} +then : + printf %s "(cached) " >&6 +else $as_nop case $BISON in [\\/]* | ?:[\\/]*) ac_cv_path_BISON="$BISON" # Let the user override the test with a path. @@ -6686,11 +7356,15 @@ for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_BISON="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_BISON="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -6703,21 +7377,22 @@ fi BISON=$ac_cv_path_BISON if test -n "$BISON"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BISON" >&5 -$as_echo "$BISON" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $BISON" >&5 +printf "%s\n" "$BISON" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi # Extract the first word of "cmp", so it can be a program name with args. set dummy cmp; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_CMP+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_CMP+y} +then : + printf %s "(cached) " >&6 +else $as_nop case $CMP in [\\/]* | ?:[\\/]*) ac_cv_path_CMP="$CMP" # Let the user override the test with a path. @@ -6727,11 +7402,15 @@ for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_CMP="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_CMP="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -6744,21 +7423,22 @@ fi CMP=$ac_cv_path_CMP if test -n "$CMP"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CMP" >&5 -$as_echo "$CMP" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CMP" >&5 +printf "%s\n" "$CMP" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi # Extract the first word of "cat", so it can be a program name with args. set dummy cat; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_CAT+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_CAT+y} +then : + printf %s "(cached) " >&6 +else $as_nop case $CAT in [\\/]* | ?:[\\/]*) ac_cv_path_CAT="$CAT" # Let the user override the test with a path. @@ -6768,11 +7448,15 @@ for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_CAT="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_CAT="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -6785,21 +7469,22 @@ fi CAT=$ac_cv_path_CAT if test -n "$CAT"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CAT" >&5 -$as_echo "$CAT" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CAT" >&5 +printf "%s\n" "$CAT" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi # Extract the first word of "cut", so it can be a program name with args. set dummy cut; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_CUT+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_CUT+y} +then : + printf %s "(cached) " >&6 +else $as_nop case $CUT in [\\/]* | ?:[\\/]*) ac_cv_path_CUT="$CUT" # Let the user override the test with a path. @@ -6809,11 +7494,15 @@ for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_CUT="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_CUT="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -6826,21 +7515,22 @@ fi CUT=$ac_cv_path_CUT if test -n "$CUT"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CUT" >&5 -$as_echo "$CUT" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CUT" >&5 +printf "%s\n" "$CUT" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi # Extract the first word of "flex", so it can be a program name with args. set dummy flex; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_FLEX+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_FLEX+y} +then : + printf %s "(cached) " >&6 +else $as_nop case $FLEX in [\\/]* | ?:[\\/]*) ac_cv_path_FLEX="$FLEX" # Let the user override the test with a path. @@ -6850,11 +7540,15 @@ for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_FLEX="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_FLEX="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -6867,21 +7561,22 @@ fi FLEX=$ac_cv_path_FLEX if test -n "$FLEX"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $FLEX" >&5 -$as_echo "$FLEX" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $FLEX" >&5 +printf "%s\n" "$FLEX" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi # Extract the first word of "grep", so it can be a program name with args. set dummy grep; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_GREP+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_GREP+y} +then : + printf %s "(cached) " >&6 +else $as_nop case $GREP in [\\/]* | ?:[\\/]*) ac_cv_path_GREP="$GREP" # Let the user override the test with a path. @@ -6891,11 +7586,15 @@ for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_GREP="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_GREP="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -6908,11 +7607,11 @@ fi GREP=$ac_cv_path_GREP if test -n "$GREP"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GREP" >&5 -$as_echo "$GREP" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $GREP" >&5 +printf "%s\n" "$GREP" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -6920,11 +7619,12 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_PYTHON+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_PYTHON+y} +then : + printf %s "(cached) " >&6 +else $as_nop case $PYTHON in [\\/]* | ?:[\\/]*) ac_cv_path_PYTHON="$PYTHON" # Let the user override the test with a path. @@ -6934,11 +7634,15 @@ for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_PYTHON="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_PYTHON="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -6950,11 +7654,11 @@ fi PYTHON=$ac_cv_path_PYTHON if test -n "$PYTHON"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PYTHON" >&5 -$as_echo "$PYTHON" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $PYTHON" >&5 +printf "%s\n" "$PYTHON" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -6964,11 +7668,12 @@ # Extract the first word of "find", so it can be a program name with args. set dummy find; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_FIND+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_FIND+y} +then : + printf %s "(cached) " >&6 +else $as_nop case $FIND in [\\/]* | ?:[\\/]*) ac_cv_path_FIND="$FIND" # Let the user override the test with a path. @@ -6978,11 +7683,15 @@ for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_FIND="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_FIND="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -6995,21 +7704,22 @@ fi FIND=$ac_cv_path_FIND if test -n "$FIND"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $FIND" >&5 -$as_echo "$FIND" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $FIND" >&5 +printf "%s\n" "$FIND" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi # Extract the first word of "basename", so it can be a program name with args. set dummy basename; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_BASENAME+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_BASENAME+y} +then : + printf %s "(cached) " >&6 +else $as_nop case $BASENAME in [\\/]* | ?:[\\/]*) ac_cv_path_BASENAME="$BASENAME" # Let the user override the test with a path. @@ -7019,11 +7729,15 @@ for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_BASENAME="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_BASENAME="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -7036,21 +7750,22 @@ fi BASENAME=$ac_cv_path_BASENAME if test -n "$BASENAME"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BASENAME" >&5 -$as_echo "$BASENAME" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $BASENAME" >&5 +printf "%s\n" "$BASENAME" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi # Extract the first word of "dirname", so it can be a program name with args. set dummy dirname; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_DIRNAME+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_DIRNAME+y} +then : + printf %s "(cached) " >&6 +else $as_nop case $DIRNAME in [\\/]* | ?:[\\/]*) ac_cv_path_DIRNAME="$DIRNAME" # Let the user override the test with a path. @@ -7060,11 +7775,15 @@ for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_DIRNAME="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_DIRNAME="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -7077,21 +7796,22 @@ fi DIRNAME=$ac_cv_path_DIRNAME if test -n "$DIRNAME"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DIRNAME" >&5 -$as_echo "$DIRNAME" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $DIRNAME" >&5 +printf "%s\n" "$DIRNAME" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi # Extract the first word of "sh", so it can be a program name with args. set dummy sh; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_SHELL+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_SHELL+y} +then : + printf %s "(cached) " >&6 +else $as_nop case $SHELL in [\\/]* | ?:[\\/]*) ac_cv_path_SHELL="$SHELL" # Let the user override the test with a path. @@ -7101,11 +7821,15 @@ for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_SHELL="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_SHELL="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -7118,21 +7842,22 @@ fi SHELL=$ac_cv_path_SHELL if test -n "$SHELL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $SHELL" >&5 -$as_echo "$SHELL" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $SHELL" >&5 +printf "%s\n" "$SHELL" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi # Extract the first word of "ln", so it can be a program name with args. set dummy ln; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_LN+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_LN+y} +then : + printf %s "(cached) " >&6 +else $as_nop case $LN in [\\/]* | ?:[\\/]*) ac_cv_path_LN="$LN" # Let the user override the test with a path. @@ -7142,11 +7867,15 @@ for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_LN="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_LN="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -7159,21 +7888,22 @@ fi LN=$ac_cv_path_LN if test -n "$LN"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LN" >&5 -$as_echo "$LN" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $LN" >&5 +printf "%s\n" "$LN" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi # Extract the first word of "doxygen", so it can be a program name with args. set dummy doxygen; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_DOXYGEN+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_DOXYGEN+y} +then : + printf %s "(cached) " >&6 +else $as_nop case $DOXYGEN in [\\/]* | ?:[\\/]*) ac_cv_path_DOXYGEN="$DOXYGEN" # Let the user override the test with a path. @@ -7183,11 +7913,15 @@ for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_DOXYGEN="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_DOXYGEN="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -7200,21 +7934,22 @@ fi DOXYGEN=$ac_cv_path_DOXYGEN if test -n "$DOXYGEN"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DOXYGEN" >&5 -$as_echo "$DOXYGEN" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $DOXYGEN" >&5 +printf "%s\n" "$DOXYGEN" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi # Extract the first word of "dot", so it can be a program name with args. set dummy dot; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_DOT+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_DOT+y} +then : + printf %s "(cached) " >&6 +else $as_nop case $DOT in [\\/]* | ?:[\\/]*) ac_cv_path_DOT="$DOT" # Let the user override the test with a path. @@ -7224,11 +7959,15 @@ for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_DOT="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_DOT="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -7241,21 +7980,22 @@ fi DOT=$ac_cv_path_DOT if test -n "$DOT"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DOT" >&5 -$as_echo "$DOT" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $DOT" >&5 +printf "%s\n" "$DOT" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi # Extract the first word of "wget", so it can be a program name with args. set dummy wget; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_WGET+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_WGET+y} +then : + printf %s "(cached) " >&6 +else $as_nop case $WGET in [\\/]* | ?:[\\/]*) ac_cv_path_WGET="$WGET" # Let the user override the test with a path. @@ -7265,11 +8005,15 @@ for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_WGET="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_WGET="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -7282,21 +8026,22 @@ fi WGET=$ac_cv_path_WGET if test -n "$WGET"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $WGET" >&5 -$as_echo "$WGET" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $WGET" >&5 +printf "%s\n" "$WGET" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi # Extract the first word of "curl", so it can be a program name with args. set dummy curl; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_CURL+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_CURL+y} +then : + printf %s "(cached) " >&6 +else $as_nop case $CURL in [\\/]* | ?:[\\/]*) ac_cv_path_CURL="$CURL" # Let the user override the test with a path. @@ -7306,11 +8051,15 @@ for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_CURL="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_CURL="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -7323,21 +8072,22 @@ fi CURL=$ac_cv_path_CURL if test -n "$CURL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CURL" >&5 -$as_echo "$CURL" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CURL" >&5 +printf "%s\n" "$CURL" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi # Extract the first word of "xmllint", so it can be a program name with args. set dummy xmllint; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_XMLLINT+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_XMLLINT+y} +then : + printf %s "(cached) " >&6 +else $as_nop case $XMLLINT in [\\/]* | ?:[\\/]*) ac_cv_path_XMLLINT="$XMLLINT" # Let the user override the test with a path. @@ -7347,11 +8097,15 @@ for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_XMLLINT="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_XMLLINT="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -7364,11 +8118,11 @@ fi XMLLINT=$ac_cv_path_XMLLINT if test -n "$XMLLINT"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $XMLLINT" >&5 -$as_echo "$XMLLINT" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $XMLLINT" >&5 +printf "%s\n" "$XMLLINT" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -7376,11 +8130,12 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_XMLSTARLET+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_XMLSTARLET+y} +then : + printf %s "(cached) " >&6 +else $as_nop case $XMLSTARLET in [\\/]* | ?:[\\/]*) ac_cv_path_XMLSTARLET="$XMLSTARLET" # Let the user override the test with a path. @@ -7390,11 +8145,15 @@ for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_XMLSTARLET="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_XMLSTARLET="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -7406,11 +8165,11 @@ fi XMLSTARLET=$ac_cv_path_XMLSTARLET if test -n "$XMLSTARLET"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $XMLSTARLET" >&5 -$as_echo "$XMLSTARLET" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $XMLSTARLET" >&5 +printf "%s\n" "$XMLSTARLET" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -7420,11 +8179,12 @@ # Extract the first word of "bash", so it can be a program name with args. set dummy bash; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_BASH+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_BASH+y} +then : + printf %s "(cached) " >&6 +else $as_nop case $BASH in [\\/]* | ?:[\\/]*) ac_cv_path_BASH="$BASH" # Let the user override the test with a path. @@ -7434,11 +8194,15 @@ for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_BASH="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_BASH="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -7451,21 +8215,22 @@ fi BASH=$ac_cv_path_BASH if test -n "$BASH"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BASH" >&5 -$as_echo "$BASH" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $BASH" >&5 +printf "%s\n" "$BASH" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi # Extract the first word of "git", so it can be a program name with args. set dummy git; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_GIT+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_GIT+y} +then : + printf %s "(cached) " >&6 +else $as_nop case $GIT in [\\/]* | ?:[\\/]*) ac_cv_path_GIT="$GIT" # Let the user override the test with a path. @@ -7475,11 +8240,15 @@ for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_GIT="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_GIT="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -7492,21 +8261,22 @@ fi GIT=$ac_cv_path_GIT if test -n "$GIT"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GIT" >&5 -$as_echo "$GIT" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $GIT" >&5 +printf "%s\n" "$GIT" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi # Extract the first word of "alembic", so it can be a program name with args. set dummy alembic; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_ALEMBIC+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_ALEMBIC+y} +then : + printf %s "(cached) " >&6 +else $as_nop case $ALEMBIC in [\\/]* | ?:[\\/]*) ac_cv_path_ALEMBIC="$ALEMBIC" # Let the user override the test with a path. @@ -7516,11 +8286,15 @@ for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_ALEMBIC="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_ALEMBIC="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -7533,21 +8307,22 @@ fi ALEMBIC=$ac_cv_path_ALEMBIC if test -n "$ALEMBIC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ALEMBIC" >&5 -$as_echo "$ALEMBIC" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ALEMBIC" >&5 +printf "%s\n" "$ALEMBIC" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi # Extract the first word of "bzip2", so it can be a program name with args. set dummy bzip2; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_BZIP2+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_BZIP2+y} +then : + printf %s "(cached) " >&6 +else $as_nop case $BZIP2 in [\\/]* | ?:[\\/]*) ac_cv_path_BZIP2="$BZIP2" # Let the user override the test with a path. @@ -7557,11 +8332,15 @@ for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_BZIP2="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_BZIP2="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -7574,21 +8353,22 @@ fi BZIP2=$ac_cv_path_BZIP2 if test -n "$BZIP2"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BZIP2" >&5 -$as_echo "$BZIP2" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $BZIP2" >&5 +printf "%s\n" "$BZIP2" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi # Extract the first word of "tar", so it can be a program name with args. set dummy tar; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_TAR+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_TAR+y} +then : + printf %s "(cached) " >&6 +else $as_nop case $TAR in [\\/]* | ?:[\\/]*) ac_cv_path_TAR="$TAR" # Let the user override the test with a path. @@ -7598,11 +8378,15 @@ for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_TAR="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_TAR="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -7615,21 +8399,22 @@ fi TAR=$ac_cv_path_TAR if test -n "$TAR"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $TAR" >&5 -$as_echo "$TAR" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $TAR" >&5 +printf "%s\n" "$TAR" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi # Extract the first word of "patch", so it can be a program name with args. set dummy patch; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_PATCH+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_PATCH+y} +then : + printf %s "(cached) " >&6 +else $as_nop case $PATCH in [\\/]* | ?:[\\/]*) ac_cv_path_PATCH="$PATCH" # Let the user override the test with a path. @@ -7639,11 +8424,15 @@ for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_PATCH="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_PATCH="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -7656,21 +8445,22 @@ fi PATCH=$ac_cv_path_PATCH if test -n "$PATCH"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PATCH" >&5 -$as_echo "$PATCH" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $PATCH" >&5 +printf "%s\n" "$PATCH" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi # Extract the first word of "sed", so it can be a program name with args. set dummy sed; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_SED+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_SED+y} +then : + printf %s "(cached) " >&6 +else $as_nop case $SED in [\\/]* | ?:[\\/]*) ac_cv_path_SED="$SED" # Let the user override the test with a path. @@ -7680,11 +8470,15 @@ for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_SED="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_SED="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -7697,21 +8491,22 @@ fi SED=$ac_cv_path_SED if test -n "$SED"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $SED" >&5 -$as_echo "$SED" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $SED" >&5 +printf "%s\n" "$SED" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi # Extract the first word of "nm", so it can be a program name with args. set dummy nm; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_NM+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_NM+y} +then : + printf %s "(cached) " >&6 +else $as_nop case $NM in [\\/]* | ?:[\\/]*) ac_cv_path_NM="$NM" # Let the user override the test with a path. @@ -7721,11 +8516,15 @@ for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_NM="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_NM="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -7738,21 +8537,22 @@ fi NM=$ac_cv_path_NM if test -n "$NM"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NM" >&5 -$as_echo "$NM" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $NM" >&5 +printf "%s\n" "$NM" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi # Extract the first word of "realpath", so it can be a program name with args. set dummy realpath; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_REALPATH+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_REALPATH+y} +then : + printf %s "(cached) " >&6 +else $as_nop case $REALPATH in [\\/]* | ?:[\\/]*) ac_cv_path_REALPATH="$REALPATH" # Let the user override the test with a path. @@ -7762,11 +8562,15 @@ for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_REALPATH="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_REALPATH="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -7779,11 +8583,11 @@ fi REALPATH=$ac_cv_path_REALPATH if test -n "$REALPATH"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $REALPATH" >&5 -$as_echo "$REALPATH" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $REALPATH" >&5 +printf "%s\n" "$REALPATH" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -7803,11 +8607,12 @@ else # Extract the first word of "fetch", so it can be a program name with args. set dummy fetch; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_FETCH+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_FETCH+y} +then : + printf %s "(cached) " >&6 +else $as_nop case $FETCH in [\\/]* | ?:[\\/]*) ac_cv_path_FETCH="$FETCH" # Let the user override the test with a path. @@ -7817,11 +8622,15 @@ for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_FETCH="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_FETCH="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -7834,11 +8643,11 @@ fi FETCH=$ac_cv_path_FETCH if test -n "$FETCH"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $FETCH" >&5 -$as_echo "$FETCH" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $FETCH" >&5 +printf "%s\n" "$FETCH" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -7854,11 +8663,12 @@ # Extract the first word of "ldconfig", so it can be a program name with args. set dummy ldconfig; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_LDCONFIG+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_LDCONFIG+y} +then : + printf %s "(cached) " >&6 +else $as_nop case $LDCONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_LDCONFIG="$LDCONFIG" # Let the user override the test with a path. @@ -7868,11 +8678,15 @@ for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_LDCONFIG="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_LDCONFIG="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -7885,21 +8699,22 @@ fi LDCONFIG=$ac_cv_path_LDCONFIG if test -n "$LDCONFIG"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LDCONFIG" >&5 -$as_echo "$LDCONFIG" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $LDCONFIG" >&5 +printf "%s\n" "$LDCONFIG" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi # Extract the first word of "sha1sum", so it can be a program name with args. set dummy sha1sum; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_SHA1SUM+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_SHA1SUM+y} +then : + printf %s "(cached) " >&6 +else $as_nop case $SHA1SUM in [\\/]* | ?:[\\/]*) ac_cv_path_SHA1SUM="$SHA1SUM" # Let the user override the test with a path. @@ -7909,11 +8724,15 @@ for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_SHA1SUM="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_SHA1SUM="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -7926,21 +8745,22 @@ fi SHA1SUM=$ac_cv_path_SHA1SUM if test -n "$SHA1SUM"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $SHA1SUM" >&5 -$as_echo "$SHA1SUM" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $SHA1SUM" >&5 +printf "%s\n" "$SHA1SUM" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi # Extract the first word of "openssl", so it can be a program name with args. set dummy openssl; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_OPENSSL+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_OPENSSL+y} +then : + printf %s "(cached) " >&6 +else $as_nop case $OPENSSL in [\\/]* | ?:[\\/]*) ac_cv_path_OPENSSL="$OPENSSL" # Let the user override the test with a path. @@ -7950,11 +8770,15 @@ for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_OPENSSL="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_OPENSSL="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -7967,11 +8791,11 @@ fi OPENSSL=$ac_cv_path_OPENSSL if test -n "$OPENSSL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OPENSSL" >&5 -$as_echo "$OPENSSL" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $OPENSSL" >&5 +printf "%s\n" "$OPENSSL" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -7987,11 +8811,12 @@ if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args. set dummy ${ac_tool_prefix}pkg-config; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_PKG_CONFIG+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_PKG_CONFIG+y} +then : + printf %s "(cached) " >&6 +else $as_nop case $PKG_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path. @@ -8001,11 +8826,15 @@ for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_PKG_CONFIG="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -8017,11 +8846,11 @@ fi PKG_CONFIG=$ac_cv_path_PKG_CONFIG if test -n "$PKG_CONFIG"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5 -$as_echo "$PKG_CONFIG" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5 +printf "%s\n" "$PKG_CONFIG" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -8030,11 +8859,12 @@ ac_pt_PKG_CONFIG=$PKG_CONFIG # Extract the first word of "pkg-config", so it can be a program name with args. set dummy pkg-config; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_ac_pt_PKG_CONFIG+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_ac_pt_PKG_CONFIG+y} +then : + printf %s "(cached) " >&6 +else $as_nop case $ac_pt_PKG_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path. @@ -8044,11 +8874,15 @@ for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_ac_pt_PKG_CONFIG="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -8060,11 +8894,11 @@ fi ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG if test -n "$ac_pt_PKG_CONFIG"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5 -$as_echo "$ac_pt_PKG_CONFIG" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5 +printf "%s\n" "$ac_pt_PKG_CONFIG" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi if test "x$ac_pt_PKG_CONFIG" = x; then @@ -8072,8 +8906,8 @@ else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac PKG_CONFIG=$ac_pt_PKG_CONFIG @@ -8085,23 +8919,24 @@ fi if test -n "$PKG_CONFIG"; then _pkg_min_version=0.9.0 - { $as_echo "$as_me:${as_lineno-$LINENO}: checking pkg-config is at least version $_pkg_min_version" >&5 -$as_echo_n "checking pkg-config is at least version $_pkg_min_version... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking pkg-config is at least version $_pkg_min_version" >&5 +printf %s "checking pkg-config is at least version $_pkg_min_version... " >&6; } if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } PKG_CONFIG="" fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for bison that supports parse-param" >&5 -$as_echo_n "checking for bison that supports parse-param... " >&6; } -if ${ac_cv_path_BISON2+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for bison that supports parse-param" >&5 +printf %s "checking for bison that supports parse-param... " >&6; } +if test ${ac_cv_path_BISON2+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test "x$BISON" != "x:" ; then # Create a temporary directory $tmp in $TMPDIR (default /tmp). @@ -8132,8 +8967,8 @@ fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_BISON2" >&5 -$as_echo "$ac_cv_path_BISON2" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_BISON2" >&5 +printf "%s\n" "$ac_cv_path_BISON2" >&6; } if test "x${ac_cv_path_BISON2}" = "x" ; then BISON=: PBX_BISON=0 @@ -8166,11 +9001,12 @@ if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}soxmix", so it can be a program name with args. set dummy ${ac_tool_prefix}soxmix; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_SOXMIX+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_SOXMIX+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$SOXMIX"; then ac_cv_prog_SOXMIX="$SOXMIX" # Let the user override the test. else @@ -8178,11 +9014,15 @@ for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_SOXMIX="${ac_tool_prefix}soxmix" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -8193,11 +9033,11 @@ fi SOXMIX=$ac_cv_prog_SOXMIX if test -n "$SOXMIX"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $SOXMIX" >&5 -$as_echo "$SOXMIX" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $SOXMIX" >&5 +printf "%s\n" "$SOXMIX" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -8206,11 +9046,12 @@ ac_ct_SOXMIX=$SOXMIX # Extract the first word of "soxmix", so it can be a program name with args. set dummy soxmix; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_SOXMIX+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_SOXMIX+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$ac_ct_SOXMIX"; then ac_cv_prog_ac_ct_SOXMIX="$ac_ct_SOXMIX" # Let the user override the test. else @@ -8218,11 +9059,15 @@ for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_SOXMIX="soxmix" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -8233,11 +9078,11 @@ fi ac_ct_SOXMIX=$ac_cv_prog_ac_ct_SOXMIX if test -n "$ac_ct_SOXMIX"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_SOXMIX" >&5 -$as_echo "$ac_ct_SOXMIX" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_SOXMIX" >&5 +printf "%s\n" "$ac_ct_SOXMIX" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi if test "x$ac_ct_SOXMIX" = x; then @@ -8245,8 +9090,8 @@ else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac SOXMIX=$ac_ct_SOXMIX @@ -8257,7 +9102,7 @@ if test "x${SOXMIX}" != "x:"; then -$as_echo "#define HAVE_SOXMIX 1" >>confdefs.h +printf "%s\n" "#define HAVE_SOXMIX 1" >>confdefs.h fi @@ -8265,11 +9110,12 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_MD5+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_MD5+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$MD5"; then ac_cv_prog_MD5="$MD5" # Let the user override the test. else @@ -8277,11 +9123,15 @@ for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_MD5="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -8292,11 +9142,11 @@ fi MD5=$ac_cv_prog_MD5 if test -n "$MD5"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MD5" >&5 -$as_echo "$MD5" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $MD5" >&5 +printf "%s\n" "$MD5" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -8308,11 +9158,12 @@ MD5="${MD5} -a md5" fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5 -$as_echo_n "checking for a sed that does not truncate output... " >&6; } -if ${ac_cv_path_SED+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5 +printf %s "checking for a sed that does not truncate output... " >&6; } +if test ${ac_cv_path_SED+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ for ac_i in 1 2 3 4 5 6 7; do ac_script="$ac_script$as_nl$ac_script" @@ -8326,10 +9177,15 @@ for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_prog in sed gsed; do + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_prog in sed gsed + do for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_SED="$as_dir/$ac_prog$ac_exec_ext" + ac_path_SED="$as_dir$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_SED" || continue # Check for GNU ac_path_SED and select it if it is found. # Check for GNU $ac_path_SED @@ -8338,13 +9194,13 @@ ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;; *) ac_count=0 - $as_echo_n 0123456789 >"conftest.in" + printf %s 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" - $as_echo '' >> "conftest.nl" + printf "%s\n" '' >> "conftest.nl" "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val @@ -8372,8 +9228,8 @@ fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5 -$as_echo "$ac_cv_path_SED" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5 +printf "%s\n" "$ac_cv_path_SED" >&6; } SED="$ac_cv_path_SED" rm -f conftest.sed @@ -8381,6 +9237,7 @@ + ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -8400,38 +9257,37 @@ ax_pthread_save_CC="$CC" ax_pthread_save_CFLAGS="$CFLAGS" ax_pthread_save_LIBS="$LIBS" - if test "x$PTHREAD_CC" != "x"; then : + if test "x$PTHREAD_CC" != "x" +then : CC="$PTHREAD_CC" fi CFLAGS="$CFLAGS $PTHREAD_CFLAGS" LIBS="$PTHREAD_LIBS $LIBS" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_join using $CC $PTHREAD_CFLAGS $PTHREAD_LIBS" >&5 -$as_echo_n "checking for pthread_join using $CC $PTHREAD_CFLAGS $PTHREAD_LIBS... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for pthread_join using $CC $PTHREAD_CFLAGS $PTHREAD_LIBS" >&5 +printf %s "checking for pthread_join using $CC $PTHREAD_CFLAGS $PTHREAD_LIBS... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char pthread_join (); int -main () +main (void) { return pthread_join (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ax_pthread_ok=yes fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_pthread_ok" >&5 -$as_echo "$ax_pthread_ok" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_pthread_ok" >&5 +printf "%s\n" "$ax_pthread_ok" >&6; } if test "x$ax_pthread_ok" = "xno"; then PTHREAD_LIBS="" PTHREAD_CFLAGS="" @@ -8507,11 +9363,12 @@ _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "AX_PTHREAD_ZOS_MISSING" >/dev/null 2>&1; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: IBM z/OS requires -D_OPEN_THREADS or -D_UNIX03_THREADS to enable pthreads support." >&5 -$as_echo "$as_me: WARNING: IBM z/OS requires -D_OPEN_THREADS or -D_UNIX03_THREADS to enable pthreads support." >&2;} + $EGREP "AX_PTHREAD_ZOS_MISSING" >/dev/null 2>&1 +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: IBM z/OS requires -D_OPEN_THREADS or -D_UNIX03_THREADS to enable pthreads support." >&5 +printf "%s\n" "$as_me: WARNING: IBM z/OS requires -D_OPEN_THREADS or -D_UNIX03_THREADS to enable pthreads support." >&2;} fi -rm -f conftest* +rm -rf conftest* ;; @@ -8531,7 +9388,8 @@ # GCC generally uses -pthread, or -pthreads on some platforms (e.g. SPARC) -if test "x$GCC" = "xyes"; then : +if test "x$GCC" = "xyes" +then : ax_pthread_flags="-pthread -pthreads $ax_pthread_flags" fi @@ -8552,19 +9410,21 @@ ax_pthread_check_macro="--" ;; esac -if test "x$ax_pthread_check_macro" = "x--"; then : +if test "x$ax_pthread_check_macro" = "x--" +then : ax_pthread_check_cond=0 -else +else $as_nop ax_pthread_check_cond="!defined($ax_pthread_check_macro)" fi # Are we compiling with Clang? -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC is Clang" >&5 -$as_echo_n "checking whether $CC is Clang... " >&6; } -if ${ax_cv_PTHREAD_CLANG+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC is Clang" >&5 +printf %s "checking whether $CC is Clang... " >&6; } +if test ${ax_cv_PTHREAD_CLANG+y} +then : + printf %s "(cached) " >&6 +else $as_nop ax_cv_PTHREAD_CLANG=no # Note that Autoconf sets GCC=yes for Clang as well as GCC if test "x$GCC" = "xyes"; then @@ -8577,16 +9437,17 @@ _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "AX_PTHREAD_CC_IS_CLANG" >/dev/null 2>&1; then : + $EGREP "AX_PTHREAD_CC_IS_CLANG" >/dev/null 2>&1 +then : ax_cv_PTHREAD_CLANG=yes fi -rm -f conftest* +rm -rf conftest* fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_PTHREAD_CLANG" >&5 -$as_echo "$ax_cv_PTHREAD_CLANG" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_PTHREAD_CLANG" >&5 +printf "%s\n" "$ax_cv_PTHREAD_CLANG" >&6; } ax_pthread_clang="$ax_cv_PTHREAD_CLANG" ax_pthread_clang_warning=no @@ -8632,11 +9493,12 @@ # that build with -Werror. So if the active version of Clang has # this misfeature, we search for an option to squash it. - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether Clang needs flag to prevent \"argument unused\" warning when linking with -pthread" >&5 -$as_echo_n "checking whether Clang needs flag to prevent \"argument unused\" warning when linking with -pthread... " >&6; } -if ${ax_cv_PTHREAD_CLANG_NO_WARN_FLAG+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether Clang needs flag to prevent \"argument unused\" warning when linking with -pthread" >&5 +printf %s "checking whether Clang needs flag to prevent \"argument unused\" warning when linking with -pthread... " >&6; } +if test ${ax_cv_PTHREAD_CLANG_NO_WARN_FLAG+y} +then : + printf %s "(cached) " >&6 +else $as_nop ax_cv_PTHREAD_CLANG_NO_WARN_FLAG=unknown # Create an alternate version of $ac_link that compiles and # links in two steps (.c -> .o, .o -> exe) instead of one @@ -8648,7 +9510,8 @@ ax_pthread_2step_ac_link="($ac_compile) && (echo ==== >&5) && ($ax_pthread_link_step)" ax_pthread_save_CFLAGS="$CFLAGS" for ax_pthread_try in '' -Qunused-arguments -Wno-unused-command-line-argument unknown; do - if test "x$ax_pthread_try" = "xunknown"; then : + if test "x$ax_pthread_try" = "xunknown" +then : break fi CFLAGS="-Werror -Wunknown-warning-option $ax_pthread_try -pthread $ax_pthread_save_CFLAGS" @@ -8657,32 +9520,35 @@ /* end confdefs.h. */ int main(void){return 0;} _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_link="$ax_pthread_2step_ac_link" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main(void){return 0;} _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : break fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext done ac_link="$ax_pthread_save_ac_link" CFLAGS="$ax_pthread_save_CFLAGS" - if test "x$ax_pthread_try" = "x"; then : + if test "x$ax_pthread_try" = "x" +then : ax_pthread_try=no fi ax_cv_PTHREAD_CLANG_NO_WARN_FLAG="$ax_pthread_try" fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_PTHREAD_CLANG_NO_WARN_FLAG" >&5 -$as_echo "$ax_cv_PTHREAD_CLANG_NO_WARN_FLAG" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_PTHREAD_CLANG_NO_WARN_FLAG" >&5 +printf "%s\n" "$ax_cv_PTHREAD_CLANG_NO_WARN_FLAG" >&6; } case "$ax_cv_PTHREAD_CLANG_NO_WARN_FLAG" in no | unknown) ;; @@ -8696,31 +9562,32 @@ case $ax_pthread_try_flag in none) - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether pthreads work without any flags" >&5 -$as_echo_n "checking whether pthreads work without any flags... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether pthreads work without any flags" >&5 +printf %s "checking whether pthreads work without any flags... " >&6; } ;; -mt,pthread) - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether pthreads work with -mt -lpthread" >&5 -$as_echo_n "checking whether pthreads work with -mt -lpthread... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether pthreads work with -mt -lpthread" >&5 +printf %s "checking whether pthreads work with -mt -lpthread... " >&6; } PTHREAD_CFLAGS="-mt" PTHREAD_LIBS="-lpthread" ;; -*) - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether pthreads work with $ax_pthread_try_flag" >&5 -$as_echo_n "checking whether pthreads work with $ax_pthread_try_flag... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether pthreads work with $ax_pthread_try_flag" >&5 +printf %s "checking whether pthreads work with $ax_pthread_try_flag... " >&6; } PTHREAD_CFLAGS="$ax_pthread_try_flag" ;; pthread-config) # Extract the first word of "pthread-config", so it can be a program name with args. set dummy pthread-config; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ax_pthread_config+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ax_pthread_config+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$ax_pthread_config"; then ac_cv_prog_ax_pthread_config="$ax_pthread_config" # Let the user override the test. else @@ -8728,11 +9595,15 @@ for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ax_pthread_config="yes" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -8744,15 +9615,16 @@ fi ax_pthread_config=$ac_cv_prog_ax_pthread_config if test -n "$ax_pthread_config"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_pthread_config" >&5 -$as_echo "$ax_pthread_config" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_pthread_config" >&5 +printf "%s\n" "$ax_pthread_config" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi - if test "x$ax_pthread_config" = "xno"; then : + if test "x$ax_pthread_config" = "xno" +then : continue fi PTHREAD_CFLAGS="`pthread-config --cflags`" @@ -8760,8 +9632,8 @@ ;; *) - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for the pthreads library -l$ax_pthread_try_flag" >&5 -$as_echo_n "checking for the pthreads library -l$ax_pthread_try_flag... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for the pthreads library -l$ax_pthread_try_flag" >&5 +printf %s "checking for the pthreads library -l$ax_pthread_try_flag... " >&6; } PTHREAD_LIBS="-l$ax_pthread_try_flag" ;; esac @@ -8790,7 +9662,7 @@ static void routine(void *a) { a = 0; } static void *start_routine(void *a) { return a; } int -main () +main (void) { pthread_t th; pthread_attr_t attr; pthread_create(&th, 0, start_routine, 0); @@ -8802,18 +9674,20 @@ return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ax_pthread_ok=yes fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext CFLAGS="$ax_pthread_save_CFLAGS" LIBS="$ax_pthread_save_LIBS" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_pthread_ok" >&5 -$as_echo "$ax_pthread_ok" >&6; } - if test "x$ax_pthread_ok" = "xyes"; then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_pthread_ok" >&5 +printf "%s\n" "$ax_pthread_ok" >&6; } + if test "x$ax_pthread_ok" = "xyes" +then : break fi @@ -8830,51 +9704,53 @@ LIBS="$PTHREAD_LIBS $LIBS" # Detect AIX lossage: JOINABLE attribute is called UNDETACHED. - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for joinable pthread attribute" >&5 -$as_echo_n "checking for joinable pthread attribute... " >&6; } -if ${ax_cv_PTHREAD_JOINABLE_ATTR+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for joinable pthread attribute" >&5 +printf %s "checking for joinable pthread attribute... " >&6; } +if test ${ax_cv_PTHREAD_JOINABLE_ATTR+y} +then : + printf %s "(cached) " >&6 +else $as_nop ax_cv_PTHREAD_JOINABLE_ATTR=unknown for ax_pthread_attr in PTHREAD_CREATE_JOINABLE PTHREAD_CREATE_UNDETACHED; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int -main () +main (void) { int attr = $ax_pthread_attr; return attr /* ; */ ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ax_cv_PTHREAD_JOINABLE_ATTR=$ax_pthread_attr; break fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext done fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_PTHREAD_JOINABLE_ATTR" >&5 -$as_echo "$ax_cv_PTHREAD_JOINABLE_ATTR" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_PTHREAD_JOINABLE_ATTR" >&5 +printf "%s\n" "$ax_cv_PTHREAD_JOINABLE_ATTR" >&6; } if test "x$ax_cv_PTHREAD_JOINABLE_ATTR" != "xunknown" && \ test "x$ax_cv_PTHREAD_JOINABLE_ATTR" != "xPTHREAD_CREATE_JOINABLE" && \ - test "x$ax_pthread_joinable_attr_defined" != "xyes"; then : + test "x$ax_pthread_joinable_attr_defined" != "xyes" +then : -cat >>confdefs.h <<_ACEOF -#define PTHREAD_CREATE_JOINABLE $ax_cv_PTHREAD_JOINABLE_ATTR -_ACEOF +printf "%s\n" "#define PTHREAD_CREATE_JOINABLE $ax_cv_PTHREAD_JOINABLE_ATTR" >>confdefs.h ax_pthread_joinable_attr_defined=yes fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether more special flags are required for pthreads" >&5 -$as_echo_n "checking whether more special flags are required for pthreads... " >&6; } -if ${ax_cv_PTHREAD_SPECIAL_FLAGS+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether more special flags are required for pthreads" >&5 +printf %s "checking whether more special flags are required for pthreads... " >&6; } +if test ${ax_cv_PTHREAD_SPECIAL_FLAGS+y} +then : + printf %s "(cached) " >&6 +else $as_nop ax_cv_PTHREAD_SPECIAL_FLAGS=no case $host_os in solaris*) @@ -8883,45 +9759,49 @@ esac fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_PTHREAD_SPECIAL_FLAGS" >&5 -$as_echo "$ax_cv_PTHREAD_SPECIAL_FLAGS" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_PTHREAD_SPECIAL_FLAGS" >&5 +printf "%s\n" "$ax_cv_PTHREAD_SPECIAL_FLAGS" >&6; } if test "x$ax_cv_PTHREAD_SPECIAL_FLAGS" != "xno" && \ - test "x$ax_pthread_special_flags_added" != "xyes"; then : + test "x$ax_pthread_special_flags_added" != "xyes" +then : PTHREAD_CFLAGS="$ax_cv_PTHREAD_SPECIAL_FLAGS $PTHREAD_CFLAGS" ax_pthread_special_flags_added=yes fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for PTHREAD_PRIO_INHERIT" >&5 -$as_echo_n "checking for PTHREAD_PRIO_INHERIT... " >&6; } -if ${ax_cv_PTHREAD_PRIO_INHERIT+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for PTHREAD_PRIO_INHERIT" >&5 +printf %s "checking for PTHREAD_PRIO_INHERIT... " >&6; } +if test ${ax_cv_PTHREAD_PRIO_INHERIT+y} +then : + printf %s "(cached) " >&6 +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int -main () +main (void) { int i = PTHREAD_PRIO_INHERIT; ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ax_cv_PTHREAD_PRIO_INHERIT=yes -else +else $as_nop ax_cv_PTHREAD_PRIO_INHERIT=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_PTHREAD_PRIO_INHERIT" >&5 -$as_echo "$ax_cv_PTHREAD_PRIO_INHERIT" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_PTHREAD_PRIO_INHERIT" >&5 +printf "%s\n" "$ax_cv_PTHREAD_PRIO_INHERIT" >&6; } if test "x$ax_cv_PTHREAD_PRIO_INHERIT" = "xyes" && \ - test "x$ax_pthread_prio_inherit_defined" != "xyes"; then : + test "x$ax_pthread_prio_inherit_defined" != "xyes" +then : -$as_echo "#define HAVE_PTHREAD_PRIO_INHERIT 1" >>confdefs.h +printf "%s\n" "#define HAVE_PTHREAD_PRIO_INHERIT 1" >>confdefs.h ax_pthread_prio_inherit_defined=yes @@ -8939,7 +9819,8 @@ #handle absolute path differently from PATH based program lookup case "x$CC" in #( x/*) : - if as_fn_executable_p ${CC}_r; then : + if as_fn_executable_p ${CC}_r +then : PTHREAD_CC="${CC}_r" fi ;; #( *) : @@ -8947,11 +9828,12 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_PTHREAD_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_PTHREAD_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$PTHREAD_CC"; then ac_cv_prog_PTHREAD_CC="$PTHREAD_CC" # Let the user override the test. else @@ -8959,11 +9841,15 @@ for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_PTHREAD_CC="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -8974,11 +9860,11 @@ fi PTHREAD_CC=$ac_cv_prog_PTHREAD_CC if test -n "$PTHREAD_CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PTHREAD_CC" >&5 -$as_echo "$PTHREAD_CC" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $PTHREAD_CC" >&5 +printf "%s\n" "$PTHREAD_CC" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -9004,7 +9890,7 @@ # Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND: if test "x$ax_pthread_ok" = "xyes"; then -$as_echo "#define HAVE_PTHREAD 1" >>confdefs.h +printf "%s\n" "#define HAVE_PTHREAD 1" >>confdefs.h : else @@ -9028,7 +9914,8 @@ PBX_NO_BINARY_MODULES=0 # Check whether --enable-binary-modules was given. -if test "${enable_binary_modules+set}" = set; then : +if test ${enable_binary_modules+y} +then : enableval=$enable_binary_modules; case "${enableval}" in y|ye|yes) PBX_NO_BINARY_MODULES=0 ;; n|no) PBX_NO_BINARY_MODULES=1 ;; @@ -9039,7 +9926,8 @@ # Check whether --enable-dev-mode was given. -if test "${enable_dev_mode+set}" = set; then : +if test ${enable_dev_mode+y} +then : enableval=$enable_dev_mode; case "${enableval}" in y|ye|yes) AST_DEVMODE=yes ;; n|no) AST_DEVMODE=no ;; @@ -9062,7 +9950,8 @@ # Check whether --with-download-cache was given. -if test "${with_download_cache+set}" = set; then : +if test ${with_download_cache+y} +then : withval=$with_download_cache; case ${withval} in n|no) @@ -9077,7 +9966,7 @@ ;; esac -else +else $as_nop : fi @@ -9086,7 +9975,8 @@ # Check whether --with-sounds-cache was given. -if test "${with_sounds_cache+set}" = set; then : +if test ${with_sounds_cache+y} +then : withval=$with_sounds_cache; case ${withval} in n|no) @@ -9101,7 +9991,7 @@ ;; esac -else +else $as_nop : fi @@ -9110,7 +10000,8 @@ # Check whether --with-externals-cache was given. -if test "${with_externals_cache+set}" = set; then : +if test ${with_externals_cache+y} +then : withval=$with_externals_cache; case ${withval} in n|no) @@ -9125,7 +10016,7 @@ ;; esac -else +else $as_nop : fi @@ -9134,7 +10025,8 @@ AST_CODE_COVERAGE=no # Check whether --enable-coverage was given. -if test "${enable_coverage+set}" = set; then : +if test ${enable_coverage+y} +then : enableval=$enable_coverage; case "${enableval}" in y|ye|yes) AST_CODE_COVERAGE=yes ;; n|no) AST_CODE_COVERAGE=no ;; @@ -9145,14 +10037,14 @@ - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for RAII support" >&5 -$as_echo_n "checking for RAII support... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for RAII support" >&5 +printf %s "checking for RAII support... " >&6; } AST_C_COMPILER_FAMILY="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int -main () +main (void) { int main() { @@ -9167,16 +10059,17 @@ } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gcc -fnested-functions" >&5 -$as_echo_n "checking for gcc -fnested-functions... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for gcc -fnested-functions" >&5 +printf %s "checking for gcc -fnested-functions... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int -main () +main (void) { auto void foo(void); void foo(void) {} ; @@ -9184,38 +10077,39 @@ } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : AST_NESTED_FUNCTIONS="" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } -else +else $as_nop AST_NESTED_FUNCTIONS="-fnested-functions" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext AST_C_COMPILER_FAMILY="gcc" -else +else $as_nop - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for clang -fblocks" >&5 -$as_echo_n "checking for clang -fblocks... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for clang -fblocks" >&5 +printf %s "checking for clang -fblocks... " >&6; } if test "`echo 'int main(){return ^{return 42;}();}' | ${CC} -o /dev/null -fblocks -x c - 2>&1`" = ""; then AST_CLANG_BLOCKS_LIBS="" AST_CLANG_BLOCKS="-Wno-unknown-warning-option -fblocks" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } elif test "`echo 'int main(){return ^{return 42;}();}' | ${CC} -o /dev/null -fblocks -x c -lBlocksRuntime - 2>&1`" = ""; then AST_CLANG_BLOCKS_LIBS="-lBlocksRuntime" AST_CLANG_BLOCKS="-fblocks" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } else as_fn_error $? "BlocksRuntime is required for clang, please install libblocksruntime" "$LINENO" 5 fi @@ -9225,7 +10119,7 @@ fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext if test -z "${AST_C_COMPILER_FAMILY}"; then as_fn_error $? "Compiler ${CC} not supported. Mminimum required gcc-4.3 / llvm-gcc-4.3 / clang-3.3 + libblocksruntime-dev" "$LINENO" 5 @@ -9233,8 +10127,8 @@ - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for clang strsep/strcmp optimization" >&5 -$as_echo_n "checking for clang strsep/strcmp optimization... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for clang strsep/strcmp optimization" >&5 +printf %s "checking for clang strsep/strcmp optimization... " >&6; } save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -O1 -Werror=array-bounds" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -9262,32 +10156,34 @@ _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } -else +else $as_nop -$as_echo "#define _HAVE_STRING_ARCH_strcmp 1" >>confdefs.h +printf "%s\n" "#define _HAVE_STRING_ARCH_strcmp 1" >>confdefs.h -$as_echo "#define _HAVE_STRING_ARCH_strsep 1" >>confdefs.h +printf "%s\n" "#define _HAVE_STRING_ARCH_strsep 1" >>confdefs.h - { $as_echo "$as_me:${as_lineno-$LINENO}: result: prevent use of __string2_1bptr_p / strsep / strcmp from bits/string2.h" >&5 -$as_echo "prevent use of __string2_1bptr_p / strsep / strcmp from bits/string2.h" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: prevent use of __string2_1bptr_p / strsep / strcmp from bits/string2.h" >&5 +printf "%s\n" "prevent use of __string2_1bptr_p / strsep / strcmp from bits/string2.h" >&6; } fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext CFLAGS="$save_CFLAGS" JANSSON_BUNDLED=no # Check whether --with-jansson-bundled was given. -if test "${with_jansson_bundled+set}" = set; then : +if test ${with_jansson_bundled+y} +then : withval=$with_jansson_bundled; case "${withval}" in y|ye|yes) JANSSON_BUNDLED=yes ;; *) JANSSON_BUNDLED=no ;; @@ -9300,7 +10196,8 @@ # Check whether --with-pjproject-bundled was given. -if test "${with_pjproject_bundled+set}" = set; then : +if test ${with_pjproject_bundled+y} +then : withval=$with_pjproject_bundled; case "${withval}" in n|no) PJPROJECT_BUNDLED=no ;; *) PJPROJECT_BUNDLED=yes ;; @@ -9323,7 +10220,8 @@ PBX_CRYPTO=0 # Check whether --with-crypto was given. -if test "${with_crypto+set}" = set; then : +if test ${with_crypto+y} +then : withval=$with_crypto; case ${withval} in n|no) @@ -9355,7 +10253,8 @@ PBX_OPENSSL=0 # Check whether --with-ssl was given. -if test "${with_ssl+set}" = set; then : +if test ${with_ssl+y} +then : withval=$with_ssl; case ${withval} in n|no) @@ -9398,25 +10297,25 @@ # and there were no directories atdded to --with-ssl and --with-crypto, and # pkg-config is installed (which is should be by install_prereq). if test "x$PKG_CONFIG" != "x" -a $PBX_OPENSSL -ge 0 -a $PBX_CRYPTO -ge 0 -a "x$OPENSSL_DIR" = "x" ; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking OPENSSL with pkg-config" >&5 -$as_echo "$as_me: checking OPENSSL with pkg-config" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether system openssl > 1.1.0" >&5 -$as_echo "$as_me: checking whether system openssl > 1.1.0" >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking OPENSSL with pkg-config" >&5 +printf "%s\n" "$as_me: checking OPENSSL with pkg-config" >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether system openssl > 1.1.0" >&5 +printf "%s\n" "$as_me: checking whether system openssl > 1.1.0" >&6;} if test "x${PBX_OPENSSL}" != "x1" -a "${USE_OPENSSL}" != "no"; then pkg_failed=no -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for OPENSSL" >&5 -$as_echo_n "checking for OPENSSL... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for openssl >= 1.1.0" >&5 +printf %s "checking for openssl >= 1.1.0... " >&6; } if test -n "$OPENSSL_CFLAGS"; then pkg_cv_OPENSSL_CFLAGS="$OPENSSL_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"openssl >= 1.1.0\""; } >&5 + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"openssl >= 1.1.0\""; } >&5 ($PKG_CONFIG --exists --print-errors "openssl >= 1.1.0") 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_OPENSSL_CFLAGS=`$PKG_CONFIG --cflags "openssl >= 1.1.0" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes @@ -9430,10 +10329,10 @@ pkg_cv_OPENSSL_LIBS="$OPENSSL_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"openssl >= 1.1.0\""; } >&5 + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"openssl >= 1.1.0\""; } >&5 ($PKG_CONFIG --exists --print-errors "openssl >= 1.1.0") 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_OPENSSL_LIBS=`$PKG_CONFIG --libs "openssl >= 1.1.0" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes @@ -9447,8 +10346,8 @@ if test $pkg_failed = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes @@ -9468,8 +10367,8 @@ elif test $pkg_failed = untried; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } PBX_OPENSSL=0 @@ -9477,37 +10376,37 @@ else OPENSSL_CFLAGS=$pkg_cv_OPENSSL_CFLAGS OPENSSL_LIBS=$pkg_cv_OPENSSL_LIBS - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } PBX_OPENSSL=1 OPENSSL_INCLUDE=$(echo ${OPENSSL_CFLAGS} | $SED -e "s|-std=c99||g") OPENSSL_LIB="$OPENSSL_LIBS" -$as_echo "#define HAVE_OPENSSL 1" >>confdefs.h +printf "%s\n" "#define HAVE_OPENSSL 1" >>confdefs.h fi fi if test $PBX_OPENSSL -eq 0 ; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether alternate openssl11 is installed" >&5 -$as_echo "$as_me: checking whether alternate openssl11 is installed" >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether alternate openssl11 is installed" >&5 +printf "%s\n" "$as_me: checking whether alternate openssl11 is installed" >&6;} if test "x${PBX_OPENSSL}" != "x1" -a "${USE_OPENSSL}" != "no"; then pkg_failed=no -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for OPENSSL" >&5 -$as_echo_n "checking for OPENSSL... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for openssl11" >&5 +printf %s "checking for openssl11... " >&6; } if test -n "$OPENSSL_CFLAGS"; then pkg_cv_OPENSSL_CFLAGS="$OPENSSL_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"openssl11\""; } >&5 + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"openssl11\""; } >&5 ($PKG_CONFIG --exists --print-errors "openssl11") 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_OPENSSL_CFLAGS=`$PKG_CONFIG --cflags "openssl11" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes @@ -9521,10 +10420,10 @@ pkg_cv_OPENSSL_LIBS="$OPENSSL_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"openssl11\""; } >&5 + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"openssl11\""; } >&5 ($PKG_CONFIG --exists --print-errors "openssl11") 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_OPENSSL_LIBS=`$PKG_CONFIG --libs "openssl11" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes @@ -9538,8 +10437,8 @@ if test $pkg_failed = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes @@ -9559,8 +10458,8 @@ elif test $pkg_failed = untried; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } PBX_OPENSSL=0 @@ -9568,14 +10467,14 @@ else OPENSSL_CFLAGS=$pkg_cv_OPENSSL_CFLAGS OPENSSL_LIBS=$pkg_cv_OPENSSL_LIBS - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } PBX_OPENSSL=1 OPENSSL_INCLUDE=$(echo ${OPENSSL_CFLAGS} | $SED -e "s|-std=c99||g") OPENSSL_LIB="$OPENSSL_LIBS" -$as_echo "#define HAVE_OPENSSL 1" >>confdefs.h +printf "%s\n" "#define HAVE_OPENSSL 1" >>confdefs.h fi @@ -9583,27 +10482,27 @@ fi if test $PBX_OPENSSL -eq 1 ; then - $as_echo "#define HAVE_OPENSSL_BIO_METHOD 1" >>confdefs.h + printf "%s\n" "#define HAVE_OPENSSL_BIO_METHOD 1" >>confdefs.h PBX_OPENSSL_BIO_METHOD=1 else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking fallback system openssl" >&5 -$as_echo "$as_me: checking fallback system openssl" >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking fallback system openssl" >&5 +printf "%s\n" "$as_me: checking fallback system openssl" >&6;} if test "x${PBX_OPENSSL}" != "x1" -a "${USE_OPENSSL}" != "no"; then pkg_failed=no -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for OPENSSL" >&5 -$as_echo_n "checking for OPENSSL... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for openssl" >&5 +printf %s "checking for openssl... " >&6; } if test -n "$OPENSSL_CFLAGS"; then pkg_cv_OPENSSL_CFLAGS="$OPENSSL_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"openssl\""; } >&5 + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"openssl\""; } >&5 ($PKG_CONFIG --exists --print-errors "openssl") 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_OPENSSL_CFLAGS=`$PKG_CONFIG --cflags "openssl" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes @@ -9617,10 +10516,10 @@ pkg_cv_OPENSSL_LIBS="$OPENSSL_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"openssl\""; } >&5 + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"openssl\""; } >&5 ($PKG_CONFIG --exists --print-errors "openssl") 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_OPENSSL_LIBS=`$PKG_CONFIG --libs "openssl" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes @@ -9634,8 +10533,8 @@ if test $pkg_failed = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes @@ -9655,8 +10554,8 @@ elif test $pkg_failed = untried; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } PBX_OPENSSL=0 @@ -9664,14 +10563,14 @@ else OPENSSL_CFLAGS=$pkg_cv_OPENSSL_CFLAGS OPENSSL_LIBS=$pkg_cv_OPENSSL_LIBS - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } PBX_OPENSSL=1 OPENSSL_INCLUDE=$(echo ${OPENSSL_CFLAGS} | $SED -e "s|-std=c99||g") OPENSSL_LIB="$OPENSSL_LIBS" -$as_echo "#define HAVE_OPENSSL 1" >>confdefs.h +printf "%s\n" "#define HAVE_OPENSSL 1" >>confdefs.h fi @@ -9680,13 +10579,13 @@ fi if test $PBX_OPENSSL -eq 1; then - $as_echo "#define HAVE_CRYPTO 1" >>confdefs.h + printf "%s\n" "#define HAVE_CRYPTO 1" >>confdefs.h PBX_CRYPTO=1 fi else - { $as_echo "$as_me:${as_lineno-$LINENO}: Checking OPENSSL without pkg-config" >&5 -$as_echo "$as_me: Checking OPENSSL without pkg-config" >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: Checking OPENSSL without pkg-config" >&5 +printf "%s\n" "$as_me: Checking OPENSSL without pkg-config" >&6;} if test "x${PBX_CRYPTO}" != "x1" -a "${USE_CRYPTO}" != "no"; then pbxlibdir="" @@ -9701,11 +10600,12 @@ ast_ext_lib_check_save_CFLAGS="${CFLAGS}" CFLAGS="${CFLAGS} " - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for AES_encrypt in -lcrypto" >&5 -$as_echo_n "checking for AES_encrypt in -lcrypto... " >&6; } -if ${ac_cv_lib_crypto_AES_encrypt+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for AES_encrypt in -lcrypto" >&5 +printf %s "checking for AES_encrypt in -lcrypto... " >&6; } +if test ${ac_cv_lib_crypto_AES_encrypt+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcrypto ${pbxlibdir} $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -9714,32 +10614,31 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char AES_encrypt (); int -main () +main (void) { return AES_encrypt (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_crypto_AES_encrypt=yes -else +else $as_nop ac_cv_lib_crypto_AES_encrypt=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_AES_encrypt" >&5 -$as_echo "$ac_cv_lib_crypto_AES_encrypt" >&6; } -if test "x$ac_cv_lib_crypto_AES_encrypt" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_AES_encrypt" >&5 +printf "%s\n" "$ac_cv_lib_crypto_AES_encrypt" >&6; } +if test "x$ac_cv_lib_crypto_AES_encrypt" = xyes +then : AST_CRYPTO_FOUND=yes -else +else $as_nop AST_CRYPTO_FOUND=no fi @@ -9758,14 +10657,14 @@ # check for the header ast_ext_lib_check_saved_CPPFLAGS="${CPPFLAGS}" CPPFLAGS="${CPPFLAGS} ${CRYPTO_INCLUDE}" - ac_fn_c_check_header_mongrel "$LINENO" "openssl/aes.h" "ac_cv_header_openssl_aes_h" "$ac_includes_default" -if test "x$ac_cv_header_openssl_aes_h" = xyes; then : + ac_fn_c_check_header_compile "$LINENO" "openssl/aes.h" "ac_cv_header_openssl_aes_h" "$ac_includes_default" +if test "x$ac_cv_header_openssl_aes_h" = xyes +then : CRYPTO_HEADER_FOUND=1 -else +else $as_nop CRYPTO_HEADER_FOUND=0 fi - CPPFLAGS="${ast_ext_lib_check_saved_CPPFLAGS}" if test "x${CRYPTO_HEADER_FOUND}" = "x0" ; then @@ -9799,11 +10698,12 @@ ast_ext_lib_check_save_CFLAGS="${CFLAGS}" CFLAGS="${CFLAGS} " - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for SSL_connect in -lssl" >&5 -$as_echo_n "checking for SSL_connect in -lssl... " >&6; } -if ${ac_cv_lib_ssl_SSL_connect+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for SSL_connect in -lssl" >&5 +printf %s "checking for SSL_connect in -lssl... " >&6; } +if test ${ac_cv_lib_ssl_SSL_connect+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lssl ${pbxlibdir} -lcrypto $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -9812,32 +10712,31 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char SSL_connect (); int -main () +main (void) { return SSL_connect (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_ssl_SSL_connect=yes -else +else $as_nop ac_cv_lib_ssl_SSL_connect=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ssl_SSL_connect" >&5 -$as_echo "$ac_cv_lib_ssl_SSL_connect" >&6; } -if test "x$ac_cv_lib_ssl_SSL_connect" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ssl_SSL_connect" >&5 +printf "%s\n" "$ac_cv_lib_ssl_SSL_connect" >&6; } +if test "x$ac_cv_lib_ssl_SSL_connect" = xyes +then : AST_OPENSSL_FOUND=yes -else +else $as_nop AST_OPENSSL_FOUND=no fi @@ -9856,14 +10755,14 @@ # check for the header ast_ext_lib_check_saved_CPPFLAGS="${CPPFLAGS}" CPPFLAGS="${CPPFLAGS} ${OPENSSL_INCLUDE}" - ac_fn_c_check_header_mongrel "$LINENO" "openssl/ssl.h" "ac_cv_header_openssl_ssl_h" "$ac_includes_default" -if test "x$ac_cv_header_openssl_ssl_h" = xyes; then : + ac_fn_c_check_header_compile "$LINENO" "openssl/ssl.h" "ac_cv_header_openssl_ssl_h" "$ac_includes_default" +if test "x$ac_cv_header_openssl_ssl_h" = xyes +then : OPENSSL_HEADER_FOUND=1 -else +else $as_nop OPENSSL_HEADER_FOUND=0 fi - CPPFLAGS="${ast_ext_lib_check_saved_CPPFLAGS}" if test "x${OPENSSL_HEADER_FOUND}" = "x0" ; then @@ -9895,11 +10794,12 @@ ast_ext_lib_check_save_CFLAGS="${CFLAGS}" CFLAGS="${CFLAGS} " - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for BIO_meth_new in -lssl" >&5 -$as_echo_n "checking for BIO_meth_new in -lssl... " >&6; } -if ${ac_cv_lib_ssl_BIO_meth_new+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for BIO_meth_new in -lssl" >&5 +printf %s "checking for BIO_meth_new in -lssl... " >&6; } +if test ${ac_cv_lib_ssl_BIO_meth_new+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lssl ${pbxlibdir} -lcrypto $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -9908,32 +10808,31 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char BIO_meth_new (); int -main () +main (void) { return BIO_meth_new (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_ssl_BIO_meth_new=yes -else +else $as_nop ac_cv_lib_ssl_BIO_meth_new=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ssl_BIO_meth_new" >&5 -$as_echo "$ac_cv_lib_ssl_BIO_meth_new" >&6; } -if test "x$ac_cv_lib_ssl_BIO_meth_new" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ssl_BIO_meth_new" >&5 +printf "%s\n" "$ac_cv_lib_ssl_BIO_meth_new" >&6; } +if test "x$ac_cv_lib_ssl_BIO_meth_new" = xyes +then : AST_OPENSSL_BIO_METHOD_FOUND=yes -else +else $as_nop AST_OPENSSL_BIO_METHOD_FOUND=no fi @@ -9952,14 +10851,14 @@ # check for the header ast_ext_lib_check_saved_CPPFLAGS="${CPPFLAGS}" CPPFLAGS="${CPPFLAGS} ${OPENSSL_BIO_METHOD_INCLUDE}" - ac_fn_c_check_header_mongrel "$LINENO" "openssl/ssl.h" "ac_cv_header_openssl_ssl_h" "$ac_includes_default" -if test "x$ac_cv_header_openssl_ssl_h" = xyes; then : + ac_fn_c_check_header_compile "$LINENO" "openssl/ssl.h" "ac_cv_header_openssl_ssl_h" "$ac_includes_default" +if test "x$ac_cv_header_openssl_ssl_h" = xyes +then : OPENSSL_BIO_METHOD_HEADER_FOUND=1 -else +else $as_nop OPENSSL_BIO_METHOD_HEADER_FOUND=0 fi - CPPFLAGS="${ast_ext_lib_check_saved_CPPFLAGS}" if test "x${OPENSSL_BIO_METHOD_HEADER_FOUND}" = "x0" ; then @@ -9980,8 +10879,8 @@ fi fi if test $PBX_OPENSSL -eq 0 ; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: OpenSSL does not seem to be installed" >&5 -$as_echo "$as_me: WARNING: OpenSSL does not seem to be installed" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: OpenSSL does not seem to be installed" >&5 +printf "%s\n" "$as_me: WARNING: OpenSSL does not seem to be installed" >&2;} fi @@ -9996,10 +10895,10 @@ ac_mandatory_list="$ac_mandatory_list JANSSON" JANSSON_DIR="${ac_pwd}/third-party/jansson" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for embedded jansson (may have to download)" >&5 -$as_echo_n "checking for embedded jansson (may have to download)... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: configuring" >&5 -$as_echo "configuring" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for embedded jansson (may have to download)" >&5 +printf %s "checking for embedded jansson (may have to download)... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: configuring" >&5 +printf "%s\n" "configuring" >&6; } if test "x${DOWNLOAD_TO_STDOUT}" = "x" ; then as_fn_error $? "A download utility (wget, curl, or fetch) is required to download bundled jansson" "$LINENO" 5 @@ -10048,15 +10947,15 @@ EXTERNALS_CACHE_DIR="${EXTERNALS_CACHE_DIR:-${AST_DOWNLOAD_CACHE}}" \ configure if test $? -ne 0 ; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: failed" >&5 -$as_echo "failed" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: Unable to configure ${JANSSON_DIR}" >&5 -$as_echo "$as_me: Unable to configure ${JANSSON_DIR}" >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: failed" >&5 +printf "%s\n" "failed" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: Unable to configure ${JANSSON_DIR}" >&5 +printf "%s\n" "$as_me: Unable to configure ${JANSSON_DIR}" >&6;} as_fn_error $? "Re-run the ./configure command with 'NOISY_BUILD=yes' appended to see error details." "$LINENO" 5 fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for bundled jansson" >&5 -$as_echo_n "checking for bundled jansson... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for bundled jansson" >&5 +printf %s "checking for bundled jansson... " >&6; } JANSSON_INCLUDE=-I${JANSSON_DIR}/dest/include JANSSON_CFLAGS="$JANSSON_INCLUDE" @@ -10072,7 +10971,7 @@ /* end confdefs.h. */ #include <$JANSSON_DIR/source/src/jansson.h> int -main () +main (void) { #if !JSON_INTEGER_IS_LONG_LONG #error "not long long" @@ -10082,16 +10981,17 @@ return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : -$as_echo "#define AST_JSON_INT_T long long" >>confdefs.h +printf "%s\n" "#define AST_JSON_INT_T long long" >>confdefs.h -else +else $as_nop -$as_echo "#define AST_JSON_INT_T long" >>confdefs.h +printf "%s\n" "#define AST_JSON_INT_T long" >>confdefs.h fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext CPPFLAGS="${saved_cppflags}" @@ -10099,10 +10999,10 @@ - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } -$as_echo "#define HAVE_JANSSON_BUNDLED 1" >>confdefs.h +printf "%s\n" "#define HAVE_JANSSON_BUNDLED 1" >>confdefs.h fi @@ -10119,10 +11019,10 @@ ac_mandatory_list="$ac_mandatory_list PJPROJECT" PJPROJECT_DIR="${ac_top_build_prefix}third-party/pjproject" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for embedded pjproject (may have to download)" >&5 -$as_echo_n "checking for embedded pjproject (may have to download)... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: configuring" >&5 -$as_echo "configuring" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for embedded pjproject (may have to download)" >&5 +printf %s "checking for embedded pjproject (may have to download)... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: configuring" >&5 +printf "%s\n" "configuring" >&6; } if test "x${DOWNLOAD_TO_STDOUT}" = "x" ; then as_fn_error $? "A download utility (wget, curl, or fetch) is required to download bundled pjproject" "$LINENO" 5 @@ -10192,7 +11092,7 @@ # Determine if we're doing an out-of-tree build... if test -L ${PJPROJECT_DIR}/source -o -d ${PJPROJECT_DIR}/source/.git ; then - $as_echo "#define HAVE_PJPROJECT_BUNDLED_OOT 1" >>confdefs.h + printf "%s\n" "#define HAVE_PJPROJECT_BUNDLED_OOT 1" >>confdefs.h PJPROJECT_BUNDLED_OOT=yes fi @@ -10205,15 +11105,15 @@ PJPROJECT_BUNDLED_OOT="${PJPROJECT_BUNDLED_OOT}" \ configure if test $? -ne 0 ; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: failed" >&5 -$as_echo "failed" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: Unable to configure ${PJPROJECT_DIR}" >&5 -$as_echo "$as_me: Unable to configure ${PJPROJECT_DIR}" >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: failed" >&5 +printf "%s\n" "failed" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: Unable to configure ${PJPROJECT_DIR}" >&5 +printf "%s\n" "$as_me: Unable to configure ${PJPROJECT_DIR}" >&6;} as_fn_error $? "Re-run the ./configure command with 'NOISY_BUILD=yes' appended to see error details." "$LINENO" 5 fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for bundled pjproject" >&5 -$as_echo_n "checking for bundled pjproject... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for bundled pjproject" >&5 +printf %s "checking for bundled pjproject... " >&6; } PJPROJECT_INCLUDE=$(${GNU_MAKE} --quiet --no-print-directory -C ${PJPROJECT_DIR} \ PJPROJECT_CONFIGURE_OPTS="$PJPROJECT_CONFIGURE_OPTS" \ @@ -10224,59 +11124,59 @@ PBX_PJPROJECT=1 -$as_echo "#define HAVE_PJPROJECT 1" >>confdefs.h +printf "%s\n" "#define HAVE_PJPROJECT 1" >>confdefs.h -$as_echo "#define HAVE_PJPROJECT_BUNDLED 1" >>confdefs.h +printf "%s\n" "#define HAVE_PJPROJECT_BUNDLED 1" >>confdefs.h -$as_echo "#define HAVE_PJSIP_DLG_CREATE_UAS_AND_INC_LOCK 1" >>confdefs.h +printf "%s\n" "#define HAVE_PJSIP_DLG_CREATE_UAS_AND_INC_LOCK 1" >>confdefs.h -$as_echo "#define HAVE_PJ_TRANSACTION_GRP_LOCK 1" >>confdefs.h +printf "%s\n" "#define HAVE_PJ_TRANSACTION_GRP_LOCK 1" >>confdefs.h -$as_echo "#define HAVE_PJSIP_REPLACE_MEDIA_STREAM 1" >>confdefs.h +printf "%s\n" "#define HAVE_PJSIP_REPLACE_MEDIA_STREAM 1" >>confdefs.h -$as_echo "#define HAVE_PJSIP_GET_DEST_INFO 1" >>confdefs.h +printf "%s\n" "#define HAVE_PJSIP_GET_DEST_INFO 1" >>confdefs.h -$as_echo "#define HAVE_PJ_SSL_CERT_LOAD_FROM_FILES2 1" >>confdefs.h +printf "%s\n" "#define HAVE_PJ_SSL_CERT_LOAD_FROM_FILES2 1" >>confdefs.h -$as_echo "#define HAVE_PJSIP_EXTERNAL_RESOLVER 1" >>confdefs.h +printf "%s\n" "#define HAVE_PJSIP_EXTERNAL_RESOLVER 1" >>confdefs.h -$as_echo "#define HAVE_PJSIP_TLS_TRANSPORT_PROTO 1" >>confdefs.h +printf "%s\n" "#define HAVE_PJSIP_TLS_TRANSPORT_PROTO 1" >>confdefs.h -$as_echo "#define HAVE_PJSIP_EVSUB_GRP_LOCK 1" >>confdefs.h +printf "%s\n" "#define HAVE_PJSIP_EVSUB_GRP_LOCK 1" >>confdefs.h -$as_echo "#define HAVE_PJSIP_INV_SESSION_REF 1" >>confdefs.h +printf "%s\n" "#define HAVE_PJSIP_INV_SESSION_REF 1" >>confdefs.h -$as_echo "#define HAVE_PJSIP_AUTH_CLT_DEINIT 1" >>confdefs.h +printf "%s\n" "#define HAVE_PJSIP_AUTH_CLT_DEINIT 1" >>confdefs.h -$as_echo "#define HAVE_PJSIP_TSX_LAYER_FIND_TSX2 1" >>confdefs.h +printf "%s\n" "#define HAVE_PJSIP_TSX_LAYER_FIND_TSX2 1" >>confdefs.h -$as_echo "#define HAVE_PJSIP_INV_ACCEPT_MULTIPLE_SDP_ANSWERS 1" >>confdefs.h +printf "%s\n" "#define HAVE_PJSIP_INV_ACCEPT_MULTIPLE_SDP_ANSWERS 1" >>confdefs.h -$as_echo "#define HAVE_PJSIP_ENDPOINT_COMPACT_FORM 1" >>confdefs.h +printf "%s\n" "#define HAVE_PJSIP_ENDPOINT_COMPACT_FORM 1" >>confdefs.h -$as_echo "#define HAVE_PJSIP_TRANSPORT_DISABLE_CONNECTION_REUSE 1" >>confdefs.h +printf "%s\n" "#define HAVE_PJSIP_TRANSPORT_DISABLE_CONNECTION_REUSE 1" >>confdefs.h -$as_echo "#define HAVE_PJSIP_OAUTH_AUTHENTICATION 1" >>confdefs.h +printf "%s\n" "#define HAVE_PJSIP_OAUTH_AUTHENTICATION 1" >>confdefs.h -$as_echo "#define HAVE_PJPROJECT_ON_VALID_ICE_PAIR_CALLBACK 1" >>confdefs.h +printf "%s\n" "#define HAVE_PJPROJECT_ON_VALID_ICE_PAIR_CALLBACK 1" >>confdefs.h @@ -10286,8 +11186,8 @@ - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } fi @@ -10311,7 +11211,8 @@ PBX_ALSA=0 # Check whether --with-asound was given. -if test "${with_asound+set}" = set; then : +if test ${with_asound+y} +then : withval=$with_asound; case ${withval} in n|no) @@ -10343,7 +11244,8 @@ PBX_BFD=0 # Check whether --with-bfd was given. -if test "${with_bfd+set}" = set; then : +if test ${with_bfd+y} +then : withval=$with_bfd; case ${withval} in n|no) @@ -10378,7 +11280,8 @@ PBX_BKTR=0 # Check whether --with-execinfo was given. -if test "${with_execinfo+set}" = set; then : +if test ${with_execinfo+y} +then : withval=$with_execinfo; case ${withval} in n|no) @@ -10410,7 +11313,8 @@ PBX_BLUETOOTH=0 # Check whether --with-bluetooth was given. -if test "${with_bluetooth+set}" = set; then : +if test ${with_bluetooth+y} +then : withval=$with_bluetooth; case ${withval} in n|no) @@ -10442,7 +11346,8 @@ PBX_CAP=0 # Check whether --with-cap was given. -if test "${with_cap+set}" = set; then : +if test ${with_cap+y} +then : withval=$with_cap; case ${withval} in n|no) @@ -10474,7 +11379,8 @@ PBX_CODEC2=0 # Check whether --with-codec2 was given. -if test "${with_codec2+set}" = set; then : +if test ${with_codec2+y} +then : withval=$with_codec2; case ${withval} in n|no) @@ -10506,7 +11412,8 @@ PBX_COROSYNC=0 # Check whether --with-cpg was given. -if test "${with_cpg+set}" = set; then : +if test ${with_cpg+y} +then : withval=$with_cpg; case ${withval} in n|no) @@ -10550,7 +11457,8 @@ PBX_CRYPT=0 # Check whether --with-crypt was given. -if test "${with_crypt+set}" = set; then : +if test ${with_crypt+y} +then : withval=$with_crypt; case ${withval} in n|no) @@ -10582,7 +11490,8 @@ PBX_DAHDI=0 # Check whether --with-dahdi was given. -if test "${with_dahdi+set}" = set; then : +if test ${with_dahdi+y} +then : withval=$with_dahdi; case ${withval} in n|no) @@ -10614,7 +11523,8 @@ PBX_FFMPEG=0 # Check whether --with-avcodec was given. -if test "${with_avcodec+set}" = set; then : +if test ${with_avcodec+y} +then : withval=$with_avcodec; case ${withval} in n|no) @@ -10646,7 +11556,8 @@ PBX_GSM=0 # Check whether --with-gsm was given. -if test "${with_gsm+set}" = set; then : +if test ${with_gsm+y} +then : withval=$with_gsm; case ${withval} in n|no) @@ -10678,7 +11589,8 @@ PBX_ILBC=0 # Check whether --with-ilbc was given. -if test "${with_ilbc+set}" = set; then : +if test ${with_ilbc+y} +then : withval=$with_ilbc; case ${withval} in n|no) @@ -10710,7 +11622,8 @@ PBX_GTK2=0 # Check whether --with-gtk2 was given. -if test "${with_gtk2+set}" = set; then : +if test ${with_gtk2+y} +then : withval=$with_gtk2; case ${withval} in n|no) @@ -10742,7 +11655,8 @@ PBX_GMIME=0 # Check whether --with-gmime was given. -if test "${with_gmime+set}" = set; then : +if test ${with_gmime+y} +then : withval=$with_gmime; case ${withval} in n|no) @@ -10774,7 +11688,8 @@ PBX_HOARD=0 # Check whether --with-hoard was given. -if test "${with_hoard+set}" = set; then : +if test ${with_hoard+y} +then : withval=$with_hoard; case ${withval} in n|no) @@ -10806,7 +11721,8 @@ PBX_ICAL=0 # Check whether --with-ical was given. -if test "${with_ical+set}" = set; then : +if test ${with_ical+y} +then : withval=$with_ical; case ${withval} in n|no) @@ -10838,7 +11754,8 @@ PBX_ICONV=0 # Check whether --with-iconv was given. -if test "${with_iconv+set}" = set; then : +if test ${with_iconv+y} +then : withval=$with_iconv; case ${withval} in n|no) @@ -10870,7 +11787,8 @@ PBX_IKSEMEL=0 # Check whether --with-iksemel was given. -if test "${with_iksemel+set}" = set; then : +if test ${with_iksemel+y} +then : withval=$with_iksemel; case ${withval} in n|no) @@ -10902,7 +11820,8 @@ PBX_IMAP_TK=0 # Check whether --with-imap was given. -if test "${with_imap+set}" = set; then : +if test ${with_imap+y} +then : withval=$with_imap; case ${withval} in n|no) @@ -10934,7 +11853,8 @@ PBX_INOTIFY=0 # Check whether --with-inotify was given. -if test "${with_inotify+set}" = set; then : +if test ${with_inotify+y} +then : withval=$with_inotify; case ${withval} in n|no) @@ -10966,7 +11886,8 @@ PBX_IODBC=0 # Check whether --with-iodbc was given. -if test "${with_iodbc+set}" = set; then : +if test ${with_iodbc+y} +then : withval=$with_iodbc; case ${withval} in n|no) @@ -10998,7 +11919,8 @@ PBX_ISDNNET=0 # Check whether --with-isdnnet was given. -if test "${with_isdnnet+set}" = set; then : +if test ${with_isdnnet+y} +then : withval=$with_isdnnet; case ${withval} in n|no) @@ -11030,7 +11952,8 @@ PBX_JACK=0 # Check whether --with-jack was given. -if test "${with_jack+set}" = set; then : +if test ${with_jack+y} +then : withval=$with_jack; case ${withval} in n|no) @@ -11062,7 +11985,8 @@ PBX_JANSSON=0 # Check whether --with-jansson was given. -if test "${with_jansson+set}" = set; then : +if test ${with_jansson+y} +then : withval=$with_jansson; case ${withval} in n|no) @@ -11094,7 +12018,8 @@ PBX_URIPARSER=0 # Check whether --with-uriparser was given. -if test "${with_uriparser+set}" = set; then : +if test ${with_uriparser+y} +then : withval=$with_uriparser; case ${withval} in n|no) @@ -11126,7 +12051,8 @@ PBX_KQUEUE=0 # Check whether --with-kqueue was given. -if test "${with_kqueue+set}" = set; then : +if test ${with_kqueue+y} +then : withval=$with_kqueue; case ${withval} in n|no) @@ -11158,7 +12084,8 @@ PBX_LDAP=0 # Check whether --with-ldap was given. -if test "${with_ldap+set}" = set; then : +if test ${with_ldap+y} +then : withval=$with_ldap; case ${withval} in n|no) @@ -11212,9 +12139,10 @@ # Check whether --with-libcurl was given. -if test "${with_libcurl+set}" = set; then : +if test ${with_libcurl+y} +then : withval=$with_libcurl; _libcurl_with=$withval -else +else $as_nop _libcurl_with=yes fi @@ -11225,11 +12153,12 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_AWK+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_AWK+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$AWK"; then ac_cv_prog_AWK="$AWK" # Let the user override the test. else @@ -11237,11 +12166,15 @@ for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_AWK="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -11252,11 +12185,11 @@ fi AWK=$ac_cv_prog_AWK if test -n "$AWK"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 -$as_echo "$AWK" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 +printf "%s\n" "$AWK" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -11273,11 +12206,12 @@ _libcurl_ldflags="-L$withval/lib" # Extract the first word of "curl-config", so it can be a program name with args. set dummy curl-config; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path__libcurl_config+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path__libcurl_config+y} +then : + printf %s "(cached) " >&6 +else $as_nop case $_libcurl_config in [\\/]* | ?:[\\/]*) ac_cv_path__libcurl_config="$_libcurl_config" # Let the user override the test with a path. @@ -11287,11 +12221,15 @@ for as_dir in "$withval/bin" do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path__libcurl_config="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path__libcurl_config="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -11303,22 +12241,23 @@ fi _libcurl_config=$ac_cv_path__libcurl_config if test -n "$_libcurl_config"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $_libcurl_config" >&5 -$as_echo "$_libcurl_config" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $_libcurl_config" >&5 +printf "%s\n" "$_libcurl_config" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi else # Extract the first word of "curl-config", so it can be a program name with args. set dummy curl-config; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path__libcurl_config+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path__libcurl_config+y} +then : + printf %s "(cached) " >&6 +else $as_nop case $_libcurl_config in [\\/]* | ?:[\\/]*) ac_cv_path__libcurl_config="$_libcurl_config" # Let the user override the test with a path. @@ -11328,11 +12267,15 @@ for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path__libcurl_config="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path__libcurl_config="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -11344,36 +12287,38 @@ fi _libcurl_config=$ac_cv_path__libcurl_config if test -n "$_libcurl_config"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $_libcurl_config" >&5 -$as_echo "$_libcurl_config" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $_libcurl_config" >&5 +printf "%s\n" "$_libcurl_config" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi fi if test x$_libcurl_config != "x" ; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for the version of libcurl" >&5 -$as_echo_n "checking for the version of libcurl... " >&6; } -if ${libcurl_cv_lib_curl_version+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for the version of libcurl" >&5 +printf %s "checking for the version of libcurl... " >&6; } +if test ${libcurl_cv_lib_curl_version+y} +then : + printf %s "(cached) " >&6 +else $as_nop libcurl_cv_lib_curl_version=`$_libcurl_config --version | $AWK '{print $2}'` fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libcurl_cv_lib_curl_version" >&5 -$as_echo "$libcurl_cv_lib_curl_version" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $libcurl_cv_lib_curl_version" >&5 +printf "%s\n" "$libcurl_cv_lib_curl_version" >&6; } _libcurl_version=`echo $libcurl_cv_lib_curl_version | $_libcurl_version_parse` _libcurl_wanted=`echo 7.10.1 | $_libcurl_version_parse` if test $_libcurl_wanted -gt 0 ; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcurl >= version 7.10.1" >&5 -$as_echo_n "checking for libcurl >= version 7.10.1... " >&6; } -if ${libcurl_cv_lib_version_ok+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libcurl >= version 7.10.1" >&5 +printf %s "checking for libcurl >= version 7.10.1... " >&6; } +if test ${libcurl_cv_lib_version_ok+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test $_libcurl_version -ge $_libcurl_wanted ; then libcurl_cv_lib_version_ok=yes @@ -11382,8 +12327,8 @@ fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libcurl_cv_lib_version_ok" >&5 -$as_echo "$libcurl_cv_lib_version_ok" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $libcurl_cv_lib_version_ok" >&5 +printf "%s\n" "$libcurl_cv_lib_version_ok" >&6; } fi if test $_libcurl_wanted -eq 0 || test x$libcurl_cv_lib_version_ok = xyes ; then @@ -11423,11 +12368,12 @@ # link line (or failing that, "-lcurl") is enough. CURL_LIB=${CURL_LIB-"$_libcurl_ldflags -lcurl"} - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether libcurl is usable" >&5 -$as_echo_n "checking whether libcurl is usable... " >&6; } -if ${libcurl_cv_lib_curl_usable+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether libcurl is usable" >&5 +printf %s "checking whether libcurl is usable... " >&6; } +if test ${libcurl_cv_lib_curl_usable+y} +then : + printf %s "(cached) " >&6 +else $as_nop _libcurl_save_cppflags=$CPPFLAGS CPPFLAGS="$CURL_INCLUDE $CPPFLAGS" @@ -11438,7 +12384,7 @@ /* end confdefs.h. */ #include int -main () +main (void) { /* Try and use a few common options to force a failure if we are @@ -11457,12 +12403,13 @@ return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : libcurl_cv_lib_curl_usable=yes -else +else $as_nop libcurl_cv_lib_curl_usable=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext CPPFLAGS=$_libcurl_save_cppflags @@ -11471,8 +12418,8 @@ unset _libcurl_save_libs fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libcurl_cv_lib_curl_usable" >&5 -$as_echo "$libcurl_cv_lib_curl_usable" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $libcurl_cv_lib_curl_usable" >&5 +printf "%s\n" "$libcurl_cv_lib_curl_usable" >&6; } if test $libcurl_cv_lib_curl_usable = yes ; then @@ -11485,11 +12432,12 @@ LIBS="$LIBS $CURL_LIB" ac_fn_c_check_func "$LINENO" "curl_free" "ac_cv_func_curl_free" -if test "x$ac_cv_func_curl_free" = xyes; then : +if test "x$ac_cv_func_curl_free" = xyes +then : -else +else $as_nop -$as_echo "#define curl_free free" >>confdefs.h +printf "%s\n" "#define curl_free free" >>confdefs.h fi @@ -11500,7 +12448,7 @@ unset _libcurl_save_libs -$as_echo "#define HAVE_CURL 1" >>confdefs.h +printf "%s\n" "#define HAVE_CURL 1" >>confdefs.h @@ -11508,10 +12456,10 @@ for _libcurl_feature in $_libcurl_features ; do cat >>confdefs.h <<_ACEOF -#define `$as_echo "libcurl_feature_$_libcurl_feature" | $as_tr_cpp` 1 +#define `printf "%s\n" "libcurl_feature_$_libcurl_feature" | $as_tr_cpp` 1 _ACEOF - eval `$as_echo "libcurl_feature_$_libcurl_feature" | $as_tr_sh`=yes + eval `printf "%s\n" "libcurl_feature_$_libcurl_feature" | $as_tr_sh`=yes done if test "x$_libcurl_protocols" = "x" ; then @@ -11539,10 +12487,10 @@ for _libcurl_protocol in $_libcurl_protocols ; do cat >>confdefs.h <<_ACEOF -#define `$as_echo "libcurl_protocol_$_libcurl_protocol" | $as_tr_cpp` 1 +#define `printf "%s\n" "libcurl_protocol_$_libcurl_protocol" | $as_tr_cpp` 1 _ACEOF - eval `$as_echo "libcurl_protocol_$_libcurl_protocol" | $as_tr_sh`=yes + eval `printf "%s\n" "libcurl_protocol_$_libcurl_protocol" | $as_tr_sh`=yes done else unset CURL_LIB @@ -11577,7 +12525,8 @@ PBX_LIBEDIT=0 # Check whether --with-libedit was given. -if test "${with_libedit+set}" = set; then : +if test ${with_libedit+y} +then : withval=$with_libedit; case ${withval} in n|no) @@ -11621,7 +12570,8 @@ PBX_LIBXML2=0 # Check whether --with-libxml2 was given. -if test "${with_libxml2+set}" = set; then : +if test ${with_libxml2+y} +then : withval=$with_libxml2; case ${withval} in n|no) @@ -11653,7 +12603,8 @@ PBX_LIBXSLT=0 # Check whether --with-libxslt was given. -if test "${with_libxslt+set}" = set; then : +if test ${with_libxslt+y} +then : withval=$with_libxslt; case ${withval} in n|no) @@ -11697,7 +12648,8 @@ PBX_LUA=0 # Check whether --with-lua was given. -if test "${with_lua+set}" = set; then : +if test ${with_lua+y} +then : withval=$with_lua; case ${withval} in n|no) @@ -11730,7 +12682,8 @@ PBX_MISDN=0 # Check whether --with-misdn was given. -if test "${with_misdn+set}" = set; then : +if test ${with_misdn+y} +then : withval=$with_misdn; case ${withval} in n|no) @@ -11762,7 +12715,8 @@ PBX_MYSQLCLIENT=0 # Check whether --with-mysqlclient was given. -if test "${with_mysqlclient+set}" = set; then : +if test ${with_mysqlclient+y} +then : withval=$with_mysqlclient; case ${withval} in n|no) @@ -11794,7 +12748,8 @@ PBX_NBS=0 # Check whether --with-nbs was given. -if test "${with_nbs+set}" = set; then : +if test ${with_nbs+y} +then : withval=$with_nbs; case ${withval} in n|no) @@ -11826,7 +12781,8 @@ PBX_NEON=0 # Check whether --with-neon was given. -if test "${with_neon+set}" = set; then : +if test ${with_neon+y} +then : withval=$with_neon; case ${withval} in n|no) @@ -11858,7 +12814,8 @@ PBX_NEON29=0 # Check whether --with-neon29 was given. -if test "${with_neon29+set}" = set; then : +if test ${with_neon29+y} +then : withval=$with_neon29; case ${withval} in n|no) @@ -11890,7 +12847,8 @@ PBX_NETSNMP=0 # Check whether --with-netsnmp was given. -if test "${with_netsnmp+set}" = set; then : +if test ${with_netsnmp+y} +then : withval=$with_netsnmp; case ${withval} in n|no) @@ -11922,7 +12880,8 @@ PBX_NEWT=0 # Check whether --with-newt was given. -if test "${with_newt+set}" = set; then : +if test ${with_newt+y} +then : withval=$with_newt; case ${withval} in n|no) @@ -11954,7 +12913,8 @@ PBX_OGG=0 # Check whether --with-ogg was given. -if test "${with_ogg+set}" = set; then : +if test ${with_ogg+y} +then : withval=$with_ogg; case ${withval} in n|no) @@ -11986,7 +12946,8 @@ PBX_OPENR2=0 # Check whether --with-openr2 was given. -if test "${with_openr2+set}" = set; then : +if test ${with_openr2+y} +then : withval=$with_openr2; case ${withval} in n|no) @@ -12018,7 +12979,8 @@ PBX_OPUS=0 # Check whether --with-opus was given. -if test "${with_opus+set}" = set; then : +if test ${with_opus+y} +then : withval=$with_opus; case ${withval} in n|no) @@ -12050,7 +13012,8 @@ PBX_OPUSFILE=0 # Check whether --with-opusfile was given. -if test "${with_opusfile+set}" = set; then : +if test ${with_opusfile+y} +then : withval=$with_opusfile; case ${withval} in n|no) @@ -12082,7 +13045,8 @@ PBX_OSPTK=0 # Check whether --with-osptk was given. -if test "${with_osptk+set}" = set; then : +if test ${with_osptk+y} +then : withval=$with_osptk; case ${withval} in n|no) @@ -12114,7 +13078,8 @@ PBX_OSS=0 # Check whether --with-oss was given. -if test "${with_oss+set}" = set; then : +if test ${with_oss+y} +then : withval=$with_oss; case ${withval} in n|no) @@ -12146,7 +13111,8 @@ PBX_PGSQL=0 # Check whether --with-postgres was given. -if test "${with_postgres+set}" = set; then : +if test ${with_postgres+y} +then : withval=$with_postgres; case ${withval} in n|no) @@ -12178,7 +13144,8 @@ PBX_BEANSTALK=0 # Check whether --with-beanstalk was given. -if test "${with_beanstalk+set}" = set; then : +if test ${with_beanstalk+y} +then : withval=$with_beanstalk; case ${withval} in n|no) @@ -12212,7 +13179,8 @@ PBX_PJPROJECT=0 # Check whether --with-pjproject was given. -if test "${with_pjproject+set}" = set; then : +if test ${with_pjproject+y} +then : withval=$with_pjproject; case ${withval} in n|no) @@ -12426,7 +13394,8 @@ PBX_POPT=0 # Check whether --with-popt was given. -if test "${with_popt+set}" = set; then : +if test ${with_popt+y} +then : withval=$with_popt; case ${withval} in n|no) @@ -12458,7 +13427,8 @@ PBX_PORTAUDIO=0 # Check whether --with-portaudio was given. -if test "${with_portaudio+set}" = set; then : +if test ${with_portaudio+y} +then : withval=$with_portaudio; case ${withval} in n|no) @@ -12490,7 +13460,8 @@ PBX_PRI=0 # Check whether --with-pri was given. -if test "${with_pri+set}" = set; then : +if test ${with_pri+y} +then : withval=$with_pri; case ${withval} in n|no) @@ -12766,7 +13737,8 @@ PBX_RADIUS=0 # Check whether --with-radius was given. -if test "${with_radius+set}" = set; then : +if test ${with_radius+y} +then : withval=$with_radius; case ${withval} in n|no) @@ -12798,7 +13770,8 @@ PBX_FFTW3=0 # Check whether --with-fftw3 was given. -if test "${with_fftw3+set}" = set; then : +if test ${with_fftw3+y} +then : withval=$with_fftw3; case ${withval} in n|no) @@ -12830,7 +13803,8 @@ PBX_RESAMPLE=0 # Check whether --with-resample was given. -if test "${with_resample+set}" = set; then : +if test ${with_resample+y} +then : withval=$with_resample; case ${withval} in n|no) @@ -12862,7 +13836,8 @@ PBX_SNDFILE=0 # Check whether --with-sndfile was given. -if test "${with_sndfile+set}" = set; then : +if test ${with_sndfile+y} +then : withval=$with_sndfile; case ${withval} in n|no) @@ -12894,7 +13869,8 @@ PBX_SDL=0 # Check whether --with-sdl was given. -if test "${with_sdl+set}" = set; then : +if test ${with_sdl+y} +then : withval=$with_sdl; case ${withval} in n|no) @@ -12926,7 +13902,8 @@ PBX_SDL_IMAGE=0 # Check whether --with-SDL_image was given. -if test "${with_SDL_image+set}" = set; then : +if test ${with_SDL_image+y} +then : withval=$with_SDL_image; case ${withval} in n|no) @@ -12958,7 +13935,8 @@ PBX_SPANDSP=0 # Check whether --with-spandsp was given. -if test "${with_spandsp+set}" = set; then : +if test ${with_spandsp+y} +then : withval=$with_spandsp; case ${withval} in n|no) @@ -12990,7 +13968,8 @@ PBX_SS7=0 # Check whether --with-ss7 was given. -if test "${with_ss7+set}" = set; then : +if test ${with_ss7+y} +then : withval=$with_ss7; case ${withval} in n|no) @@ -13022,7 +14001,8 @@ PBX_SPEEX=0 # Check whether --with-speex was given. -if test "${with_speex+set}" = set; then : +if test ${with_speex+y} +then : withval=$with_speex; case ${withval} in n|no) @@ -13054,7 +14034,8 @@ PBX_SPEEX_PREPROCESS=0 # Check whether --with-speex was given. -if test "${with_speex+set}" = set; then : +if test ${with_speex+y} +then : withval=$with_speex; case ${withval} in n|no) @@ -13086,7 +14067,8 @@ PBX_SPEEXDSP=0 # Check whether --with-speexdsp was given. -if test "${with_speexdsp+set}" = set; then : +if test ${with_speexdsp+y} +then : withval=$with_speexdsp; case ${withval} in n|no) @@ -13129,7 +14111,8 @@ PBX_SQLITE=0 # Check whether --with-sqlite was given. -if test "${with_sqlite+set}" = set; then : +if test ${with_sqlite+y} +then : withval=$with_sqlite; case ${withval} in n|no) @@ -13161,7 +14144,8 @@ PBX_SQLITE3=0 # Check whether --with-sqlite3 was given. -if test "${with_sqlite3+set}" = set; then : +if test ${with_sqlite3+y} +then : withval=$with_sqlite3; case ${withval} in n|no) @@ -13193,7 +14177,8 @@ PBX_SRTP=0 # Check whether --with-srtp was given. -if test "${with_srtp+set}" = set; then : +if test ${with_srtp+y} +then : withval=$with_srtp; case ${withval} in n|no) @@ -13297,7 +14282,8 @@ PBX_SUPPSERV=0 # Check whether --with-suppserv was given. -if test "${with_suppserv+set}" = set; then : +if test ${with_suppserv+y} +then : withval=$with_suppserv; case ${withval} in n|no) @@ -13329,7 +14315,8 @@ PBX_FREETDS=0 # Check whether --with-tds was given. -if test "${with_tds+set}" = set; then : +if test ${with_tds+y} +then : withval=$with_tds; case ${withval} in n|no) @@ -13361,7 +14348,8 @@ PBX_TIMERFD=0 # Check whether --with-timerfd was given. -if test "${with_timerfd+set}" = set; then : +if test ${with_timerfd+y} +then : withval=$with_timerfd; case ${withval} in n|no) @@ -13393,7 +14381,8 @@ PBX_TONEZONE=0 # Check whether --with-tonezone was given. -if test "${with_tonezone+set}" = set; then : +if test ${with_tonezone+y} +then : withval=$with_tonezone; case ${withval} in n|no) @@ -13425,7 +14414,8 @@ PBX_UNBOUND=0 # Check whether --with-unbound was given. -if test "${with_unbound+set}" = set; then : +if test ${with_unbound+y} +then : withval=$with_unbound; case ${withval} in n|no) @@ -13457,7 +14447,8 @@ PBX_UNIXODBC=0 # Check whether --with-unixodbc was given. -if test "${with_unixodbc+set}" = set; then : +if test ${with_unixodbc+y} +then : withval=$with_unixodbc; case ${withval} in n|no) @@ -13489,7 +14480,8 @@ PBX_VORBIS=0 # Check whether --with-vorbis was given. -if test "${with_vorbis+set}" = set; then : +if test ${with_vorbis+y} +then : withval=$with_vorbis; case ${withval} in n|no) @@ -13521,7 +14513,8 @@ PBX_VPB=0 # Check whether --with-vpb was given. -if test "${with_vpb+set}" = set; then : +if test ${with_vpb+y} +then : withval=$with_vpb; case ${withval} in n|no) @@ -13553,7 +14546,8 @@ PBX_X11=0 # Check whether --with-x11 was given. -if test "${with_x11+set}" = set; then : +if test ${with_x11+y} +then : withval=$with_x11; case ${withval} in n|no) @@ -13585,7 +14579,8 @@ PBX_ZLIB=0 # Check whether --with-z was given. -if test "${with_z+set}" = set; then : +if test ${with_z+y} +then : withval=$with_z; case ${withval} in n|no) @@ -13616,28 +14611,28 @@ # checking for package libraries ac_fn_c_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default" -if test "x$ac_cv_type_size_t" = xyes; then : +if test "x$ac_cv_type_size_t" = xyes +then : -else +else $as_nop -cat >>confdefs.h <<_ACEOF -#define size_t unsigned int -_ACEOF +printf "%s\n" "#define size_t unsigned int" >>confdefs.h fi # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works # for constant arguments. Useless! -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for working alloca.h" >&5 -$as_echo_n "checking for working alloca.h... " >&6; } -if ${ac_cv_working_alloca_h+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for working alloca.h" >&5 +printf %s "checking for working alloca.h... " >&6; } +if test ${ac_cv_working_alloca_h+y} +then : + printf %s "(cached) " >&6 +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int -main () +main (void) { char *p = (char *) alloca (2 * sizeof (int)); if (p) return 0; @@ -13645,52 +14640,52 @@ return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_working_alloca_h=yes -else +else $as_nop ac_cv_working_alloca_h=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_working_alloca_h" >&5 -$as_echo "$ac_cv_working_alloca_h" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_working_alloca_h" >&5 +printf "%s\n" "$ac_cv_working_alloca_h" >&6; } if test $ac_cv_working_alloca_h = yes; then -$as_echo "#define HAVE_ALLOCA_H 1" >>confdefs.h +printf "%s\n" "#define HAVE_ALLOCA_H 1" >>confdefs.h fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for alloca" >&5 -$as_echo_n "checking for alloca... " >&6; } -if ${ac_cv_func_alloca_works+:} false; then : - $as_echo_n "(cached) " >&6 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for alloca" >&5 +printf %s "checking for alloca... " >&6; } +if test ${ac_cv_func_alloca_works+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test $ac_cv_working_alloca_h = yes; then + ac_cv_func_alloca_works=yes else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#ifdef __GNUC__ -# define alloca __builtin_alloca -#else -# ifdef _MSC_VER +#include +#include +#ifndef alloca +# ifdef __GNUC__ +# define alloca __builtin_alloca +# elif defined _MSC_VER # include # define alloca _alloca # else -# ifdef HAVE_ALLOCA_H -# include -# else -# ifdef _AIX - #pragma alloca -# else -# ifndef alloca /* predefined by HP cc +Olibcalls */ -void *alloca (size_t); -# endif -# endif +# ifdef __cplusplus +extern "C" # endif +void *alloca (size_t); # endif #endif int -main () +main (void) { char *p = (char *) alloca (1); if (p) return 0; @@ -13698,20 +14693,22 @@ return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_func_alloca_works=yes -else +else $as_nop ac_cv_func_alloca_works=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_alloca_works" >&5 -$as_echo "$ac_cv_func_alloca_works" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_alloca_works" >&5 +printf "%s\n" "$ac_cv_func_alloca_works" >&6; } +fi if test $ac_cv_func_alloca_works = yes; then -$as_echo "#define HAVE_ALLOCA 1" >>confdefs.h +printf "%s\n" "#define HAVE_ALLOCA 1" >>confdefs.h else # The SVR3 libPW and SVR4 libucb both contain incompatible functions @@ -13721,58 +14718,19 @@ ALLOCA=\${LIBOBJDIR}alloca.$ac_objext -$as_echo "#define C_ALLOCA 1" >>confdefs.h - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether \`alloca.c' needs Cray hooks" >&5 -$as_echo_n "checking whether \`alloca.c' needs Cray hooks... " >&6; } -if ${ac_cv_os_cray+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#if defined CRAY && ! defined CRAY2 -webecray -#else -wenotbecray -#endif - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "webecray" >/dev/null 2>&1; then : - ac_cv_os_cray=yes -else - ac_cv_os_cray=no -fi -rm -f conftest* - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_os_cray" >&5 -$as_echo "$ac_cv_os_cray" >&6; } -if test $ac_cv_os_cray = yes; then - for ac_func in _getb67 GETB67 getb67; do - as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" -if eval test \"x\$"$as_ac_var"\" = x"yes"; then : - -cat >>confdefs.h <<_ACEOF -#define CRAY_STACKSEG_END $ac_func -_ACEOF - - break -fi +printf "%s\n" "#define C_ALLOCA 1" >>confdefs.h - done -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking stack direction for C alloca" >&5 -$as_echo_n "checking stack direction for C alloca... " >&6; } -if ${ac_cv_c_stack_direction+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test "$cross_compiling" = yes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking stack direction for C alloca" >&5 +printf %s "checking stack direction for C alloca... " >&6; } +if test ${ac_cv_c_stack_direction+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test "$cross_compiling" = yes +then : ac_cv_c_stack_direction=0 -else +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default @@ -13793,9 +14751,10 @@ return find_stack_direction (0, argc + !argv + 20) < 0; } _ACEOF -if ac_fn_c_try_run "$LINENO"; then : +if ac_fn_c_try_run "$LINENO" +then : ac_cv_c_stack_direction=1 -else +else $as_nop ac_cv_c_stack_direction=-1 fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ @@ -13803,30 +14762,29 @@ fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_stack_direction" >&5 -$as_echo "$ac_cv_c_stack_direction" >&6; } -cat >>confdefs.h <<_ACEOF -#define STACK_DIRECTION $ac_cv_c_stack_direction -_ACEOF +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_stack_direction" >&5 +printf "%s\n" "$ac_cv_c_stack_direction" >&6; } +printf "%s\n" "#define STACK_DIRECTION $ac_cv_c_stack_direction" >>confdefs.h fi ac_header_dirent=no for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h; do - as_ac_Header=`$as_echo "ac_cv_header_dirent_$ac_hdr" | $as_tr_sh` -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_hdr that defines DIR" >&5 -$as_echo_n "checking for $ac_hdr that defines DIR... " >&6; } -if eval \${$as_ac_Header+:} false; then : - $as_echo_n "(cached) " >&6 -else + as_ac_Header=`printf "%s\n" "ac_cv_header_dirent_$ac_hdr" | $as_tr_sh` +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_hdr that defines DIR" >&5 +printf %s "checking for $ac_hdr that defines DIR... " >&6; } +if eval test \${$as_ac_Header+y} +then : + printf %s "(cached) " >&6 +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include <$ac_hdr> int -main () +main (void) { if ((DIR *) 0) return 0; @@ -13834,19 +14792,21 @@ return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : eval "$as_ac_Header=yes" -else +else $as_nop eval "$as_ac_Header=no" fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi eval ac_res=\$$as_ac_Header - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } +if eval test \"x\$"$as_ac_Header"\" = x"yes" +then : cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_hdr" | $as_tr_cpp` 1 +#define `printf "%s\n" "HAVE_$ac_hdr" | $as_tr_cpp` 1 _ACEOF ac_header_dirent=$ac_hdr; break @@ -13855,11 +14815,12 @@ done # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix. if test $ac_header_dirent = dirent.h; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing opendir" >&5 -$as_echo_n "checking for library containing opendir... " >&6; } -if ${ac_cv_search_opendir+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for library containing opendir" >&5 +printf %s "checking for library containing opendir... " >&6; } +if test ${ac_cv_search_opendir+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_func_search_save_LIBS=$LIBS cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -13867,56 +14828,59 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char opendir (); int -main () +main (void) { return opendir (); ; return 0; } _ACEOF -for ac_lib in '' dir; do +for ac_lib in '' dir +do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi - if ac_fn_c_try_link "$LINENO"; then : + if ac_fn_c_try_link "$LINENO" +then : ac_cv_search_opendir=$ac_res fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext - if ${ac_cv_search_opendir+:} false; then : + if test ${ac_cv_search_opendir+y} +then : break fi done -if ${ac_cv_search_opendir+:} false; then : +if test ${ac_cv_search_opendir+y} +then : -else +else $as_nop ac_cv_search_opendir=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_opendir" >&5 -$as_echo "$ac_cv_search_opendir" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_opendir" >&5 +printf "%s\n" "$ac_cv_search_opendir" >&6; } ac_res=$ac_cv_search_opendir -if test "$ac_res" != no; then : +if test "$ac_res" != no +then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" fi else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing opendir" >&5 -$as_echo_n "checking for library containing opendir... " >&6; } -if ${ac_cv_search_opendir+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for library containing opendir" >&5 +printf %s "checking for library containing opendir... " >&6; } +if test ${ac_cv_search_opendir+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_func_search_save_LIBS=$LIBS cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -13924,46 +14888,48 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char opendir (); int -main () +main (void) { return opendir (); ; return 0; } _ACEOF -for ac_lib in '' x; do +for ac_lib in '' x +do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi - if ac_fn_c_try_link "$LINENO"; then : + if ac_fn_c_try_link "$LINENO" +then : ac_cv_search_opendir=$ac_res fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext - if ${ac_cv_search_opendir+:} false; then : + if test ${ac_cv_search_opendir+y} +then : break fi done -if ${ac_cv_search_opendir+:} false; then : +if test ${ac_cv_search_opendir+y} +then : -else +else $as_nop ac_cv_search_opendir=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_opendir" >&5 -$as_echo "$ac_cv_search_opendir" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_opendir" >&5 +printf "%s\n" "$ac_cv_search_opendir" >&6; } ac_res=$ac_cv_search_opendir -if test "$ac_res" != no; then : +if test "$ac_res" != no +then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" fi @@ -13974,11 +14940,12 @@ as_fn_error $? "*** Could not find dirent header that defines 'DIR'." "$LINENO" 5 fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sys/wait.h that is POSIX.1 compatible" >&5 -$as_echo_n "checking for sys/wait.h that is POSIX.1 compatible... " >&6; } -if ${ac_cv_header_sys_wait_h+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for sys/wait.h that is POSIX.1 compatible" >&5 +printf %s "checking for sys/wait.h that is POSIX.1 compatible... " >&6; } +if test ${ac_cv_header_sys_wait_h+y} +then : + printf %s "(cached) " >&6 +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include @@ -13991,7 +14958,7 @@ #endif int -main () +main (void) { int s; wait (&s); @@ -14000,18 +14967,19 @@ return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : ac_cv_header_sys_wait_h=yes -else +else $as_nop ac_cv_header_sys_wait_h=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_sys_wait_h" >&5 -$as_echo "$ac_cv_header_sys_wait_h" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_sys_wait_h" >&5 +printf "%s\n" "$ac_cv_header_sys_wait_h" >&6; } if test $ac_cv_header_sys_wait_h = yes; then -$as_echo "#define HAVE_SYS_WAIT_H 1" >>confdefs.h +printf "%s\n" "#define HAVE_SYS_WAIT_H 1" >>confdefs.h fi @@ -14019,10 +14987,7 @@ as_fn_error $? "*** POSIX.1 compatible sys/wait.h is required." "$LINENO" 5 fi -for ac_header in sys/types.h netinet/in.h arpa/nameser.h netdb.h resolv.h -do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "#ifdef HAVE_SYS_TYPES_H +ac_fn_c_check_header_compile "$LINENO" "sys/types.h" "ac_cv_header_sys_types_h" "#ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_NETINET_IN_H @@ -14035,14 +15000,83 @@ # include #endif " -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF +if test "x$ac_cv_header_sys_types_h" = xyes +then : + printf "%s\n" "#define HAVE_SYS_TYPES_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "netinet/in.h" "ac_cv_header_netinet_in_h" "#ifdef HAVE_SYS_TYPES_H +# include +#endif +#ifdef HAVE_NETINET_IN_H +# include /* inet_ functions / structs */ +#endif +#ifdef HAVE_ARPA_NAMESER_H +# include /* DNS HEADER struct */ +#endif +#ifdef HAVE_NETDB_H +# include +#endif +" +if test "x$ac_cv_header_netinet_in_h" = xyes +then : + printf "%s\n" "#define HAVE_NETINET_IN_H 1" >>confdefs.h fi +ac_fn_c_check_header_compile "$LINENO" "arpa/nameser.h" "ac_cv_header_arpa_nameser_h" "#ifdef HAVE_SYS_TYPES_H +# include +#endif +#ifdef HAVE_NETINET_IN_H +# include /* inet_ functions / structs */ +#endif +#ifdef HAVE_ARPA_NAMESER_H +# include /* DNS HEADER struct */ +#endif +#ifdef HAVE_NETDB_H +# include +#endif +" +if test "x$ac_cv_header_arpa_nameser_h" = xyes +then : + printf "%s\n" "#define HAVE_ARPA_NAMESER_H 1" >>confdefs.h -done +fi +ac_fn_c_check_header_compile "$LINENO" "netdb.h" "ac_cv_header_netdb_h" "#ifdef HAVE_SYS_TYPES_H +# include +#endif +#ifdef HAVE_NETINET_IN_H +# include /* inet_ functions / structs */ +#endif +#ifdef HAVE_ARPA_NAMESER_H +# include /* DNS HEADER struct */ +#endif +#ifdef HAVE_NETDB_H +# include +#endif +" +if test "x$ac_cv_header_netdb_h" = xyes +then : + printf "%s\n" "#define HAVE_NETDB_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "resolv.h" "ac_cv_header_resolv_h" "#ifdef HAVE_SYS_TYPES_H +# include +#endif +#ifdef HAVE_NETINET_IN_H +# include /* inet_ functions / structs */ +#endif +#ifdef HAVE_ARPA_NAMESER_H +# include /* DNS HEADER struct */ +#endif +#ifdef HAVE_NETDB_H +# include +#endif +" +if test "x$ac_cv_header_resolv_h" = xyes +then : + printf "%s\n" "#define HAVE_RESOLV_H 1" >>confdefs.h + +fi if test "$ac_cv_header_resolv_h" != "yes"; then @@ -14051,23 +15085,17 @@ # Check for headers that are unconditionally required on all platforms. Do not use # this to check for headers that are only needed by modules. -for ac_header in \ - arpa/nameser.h assert.h ctype.h dlfcn.h errno.h fcntl.h float.h grp.h \ - inttypes.h limits.h locale.h math.h pwd.h netinet/in.h regex.h \ - sched.h stdarg.h stdint.h stdio.h stdlib.h string.h syslog.h \ - sys/file.h sys/ioctl.h sys/param.h sys/resource.h sys/socket.h sys/stat.h \ - sys/time.h sys/types.h sys/un.h \ - termios.h time.h unistd.h \ - + for ac_header in arpa/nameser.h assert.h ctype.h dlfcn.h errno.h fcntl.h float.h grp.h inttypes.h limits.h locale.h math.h pwd.h netinet/in.h regex.h sched.h stdarg.h stdint.h stdio.h stdlib.h string.h syslog.h sys/file.h sys/ioctl.h sys/param.h sys/resource.h sys/socket.h sys/stat.h sys/time.h sys/types.h sys/un.h termios.h time.h unistd.h do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + as_ac_Header=`printf "%s\n" "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" +if eval test \"x\$"$as_ac_Header"\" = x"yes" +then : cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +#define `printf "%s\n" "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF -else +else $as_nop as_fn_error $? "*** A required header was not found." "$LINENO" 5 @@ -14075,19 +15103,54 @@ done +ac_fn_c_check_header_compile "$LINENO" "arpa/inet.h" "ac_cv_header_arpa_inet_h" "$ac_includes_default" +if test "x$ac_cv_header_arpa_inet_h" = xyes +then : + printf "%s\n" "#define HAVE_ARPA_INET_H 1" >>confdefs.h -for ac_header in arpa/inet.h libintl.h malloc.h netdb.h stddef.h strings.h sys/event.h utime.h -do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF +fi +ac_fn_c_check_header_compile "$LINENO" "libintl.h" "ac_cv_header_libintl_h" "$ac_includes_default" +if test "x$ac_cv_header_libintl_h" = xyes +then : + printf "%s\n" "#define HAVE_LIBINTL_H 1" >>confdefs.h fi +ac_fn_c_check_header_compile "$LINENO" "malloc.h" "ac_cv_header_malloc_h" "$ac_includes_default" +if test "x$ac_cv_header_malloc_h" = xyes +then : + printf "%s\n" "#define HAVE_MALLOC_H 1" >>confdefs.h -done +fi +ac_fn_c_check_header_compile "$LINENO" "netdb.h" "ac_cv_header_netdb_h" "$ac_includes_default" +if test "x$ac_cv_header_netdb_h" = xyes +then : + printf "%s\n" "#define HAVE_NETDB_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "stddef.h" "ac_cv_header_stddef_h" "$ac_includes_default" +if test "x$ac_cv_header_stddef_h" = xyes +then : + printf "%s\n" "#define HAVE_STDDEF_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "strings.h" "ac_cv_header_strings_h" "$ac_includes_default" +if test "x$ac_cv_header_strings_h" = xyes +then : + printf "%s\n" "#define HAVE_STRINGS_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "sys/event.h" "ac_cv_header_sys_event_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_event_h" = xyes +then : + printf "%s\n" "#define HAVE_SYS_EVENT_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "utime.h" "ac_cv_header_utime_h" "$ac_includes_default" +if test "x$ac_cv_header_utime_h" = xyes +then : + printf "%s\n" "#define HAVE_UTIME_H 1" >>confdefs.h + +fi # Find required NetBSD Editline library (libedit). @@ -14095,17 +15158,17 @@ if test "x${PBX_LIBEDIT}" != "x1" -a "${USE_LIBEDIT}" != "no"; then pkg_failed=no -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for LIBEDIT" >&5 -$as_echo_n "checking for LIBEDIT... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libedit" >&5 +printf %s "checking for libedit... " >&6; } if test -n "$LIBEDIT_CFLAGS"; then pkg_cv_LIBEDIT_CFLAGS="$LIBEDIT_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libedit\""; } >&5 + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libedit\""; } >&5 ($PKG_CONFIG --exists --print-errors "libedit") 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_LIBEDIT_CFLAGS=`$PKG_CONFIG --cflags "libedit" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes @@ -14119,10 +15182,10 @@ pkg_cv_LIBEDIT_LIBS="$LIBEDIT_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libedit\""; } >&5 + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libedit\""; } >&5 ($PKG_CONFIG --exists --print-errors "libedit") 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_LIBEDIT_LIBS=`$PKG_CONFIG --libs "libedit" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes @@ -14136,8 +15199,8 @@ if test $pkg_failed = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes @@ -14157,8 +15220,8 @@ elif test $pkg_failed = untried; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } PBX_LIBEDIT=0 @@ -14166,14 +15229,14 @@ else LIBEDIT_CFLAGS=$pkg_cv_LIBEDIT_CFLAGS LIBEDIT_LIBS=$pkg_cv_LIBEDIT_LIBS - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } PBX_LIBEDIT=1 LIBEDIT_INCLUDE=$(echo ${LIBEDIT_CFLAGS} | $SED -e "s|-std=c99||g") LIBEDIT_LIB="$LIBEDIT_LIBS" -$as_echo "#define HAVE_LIBEDIT 1" >>confdefs.h +printf "%s\n" "#define HAVE_LIBEDIT 1" >>confdefs.h fi @@ -14194,11 +15257,12 @@ ast_ext_lib_check_save_CFLAGS="${CFLAGS}" CFLAGS="${CFLAGS} " - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for history_init in -ledit" >&5 -$as_echo_n "checking for history_init in -ledit... " >&6; } -if ${ac_cv_lib_edit_history_init+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for history_init in -ledit" >&5 +printf %s "checking for history_init in -ledit... " >&6; } +if test ${ac_cv_lib_edit_history_init+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-ledit ${pbxlibdir} -ltermcap $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -14207,32 +15271,31 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char history_init (); int -main () +main (void) { return history_init (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_edit_history_init=yes -else +else $as_nop ac_cv_lib_edit_history_init=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_edit_history_init" >&5 -$as_echo "$ac_cv_lib_edit_history_init" >&6; } -if test "x$ac_cv_lib_edit_history_init" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_edit_history_init" >&5 +printf "%s\n" "$ac_cv_lib_edit_history_init" >&6; } +if test "x$ac_cv_lib_edit_history_init" = xyes +then : AST_LIBEDIT_FOUND=yes -else +else $as_nop AST_LIBEDIT_FOUND=no fi @@ -14251,14 +15314,14 @@ # check for the header ast_ext_lib_check_saved_CPPFLAGS="${CPPFLAGS}" CPPFLAGS="${CPPFLAGS} ${LIBEDIT_INCLUDE}" - ac_fn_c_check_header_mongrel "$LINENO" "histedit.h" "ac_cv_header_histedit_h" "$ac_includes_default" -if test "x$ac_cv_header_histedit_h" = xyes; then : + ac_fn_c_check_header_compile "$LINENO" "histedit.h" "ac_cv_header_histedit_h" "$ac_includes_default" +if test "x$ac_cv_header_histedit_h" = xyes +then : LIBEDIT_HEADER_FOUND=1 -else +else $as_nop LIBEDIT_HEADER_FOUND=0 fi - CPPFLAGS="${ast_ext_lib_check_saved_CPPFLAGS}" if test "x${LIBEDIT_HEADER_FOUND}" = "x0" ; then @@ -14282,8 +15345,8 @@ fi if test "x${PBX_LIBEDIT_IS_UNICODE}" != "x1" -a "${USE_LIBEDIT_IS_UNICODE}" != "no"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Testing for libedit unicode support" >&5 -$as_echo_n "checking for Testing for libedit unicode support... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for Testing for libedit unicode support" >&5 +printf %s "checking for Testing for libedit unicode support... " >&6; } saved_cppflags="${CPPFLAGS}" if test "x${LIBEDIT_IS_UNICODE_DIR}" != "x"; then LIBEDIT_IS_UNICODE_INCLUDE="-I${LIBEDIT_IS_UNICODE_DIR}/include" @@ -14294,7 +15357,7 @@ /* end confdefs.h. */ #include int -main () +main (void) { el_rfunc_t *callback;; @@ -14302,21 +15365,22 @@ return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } +if ac_fn_c_try_compile "$LINENO" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } PBX_LIBEDIT_IS_UNICODE=1 -$as_echo "#define HAVE_LIBEDIT_IS_UNICODE 1" >>confdefs.h +printf "%s\n" "#define HAVE_LIBEDIT_IS_UNICODE 1" >>confdefs.h -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext CPPFLAGS="${saved_cppflags}" fi @@ -14339,11 +15403,12 @@ ast_ext_lib_check_save_CFLAGS="${CFLAGS}" CFLAGS="${CFLAGS} " - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for uuid_generate_random in -luuid" >&5 -$as_echo_n "checking for uuid_generate_random in -luuid... " >&6; } -if ${ac_cv_lib_uuid_uuid_generate_random+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for uuid_generate_random in -luuid" >&5 +printf %s "checking for uuid_generate_random in -luuid... " >&6; } +if test ${ac_cv_lib_uuid_uuid_generate_random+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-luuid ${pbxlibdir} $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -14352,32 +15417,31 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char uuid_generate_random (); int -main () +main (void) { return uuid_generate_random (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_uuid_uuid_generate_random=yes -else +else $as_nop ac_cv_lib_uuid_uuid_generate_random=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_uuid_uuid_generate_random" >&5 -$as_echo "$ac_cv_lib_uuid_uuid_generate_random" >&6; } -if test "x$ac_cv_lib_uuid_uuid_generate_random" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_uuid_uuid_generate_random" >&5 +printf "%s\n" "$ac_cv_lib_uuid_uuid_generate_random" >&6; } +if test "x$ac_cv_lib_uuid_uuid_generate_random" = xyes +then : AST_LIBUUID_FOUND=yes -else +else $as_nop AST_LIBUUID_FOUND=no fi @@ -14396,14 +15460,14 @@ # check for the header ast_ext_lib_check_saved_CPPFLAGS="${CPPFLAGS}" CPPFLAGS="${CPPFLAGS} ${LIBUUID_INCLUDE}" - ac_fn_c_check_header_mongrel "$LINENO" "uuid/uuid.h" "ac_cv_header_uuid_uuid_h" "$ac_includes_default" -if test "x$ac_cv_header_uuid_uuid_h" = xyes; then : + ac_fn_c_check_header_compile "$LINENO" "uuid/uuid.h" "ac_cv_header_uuid_uuid_h" "$ac_includes_default" +if test "x$ac_cv_header_uuid_uuid_h" = xyes +then : LIBUUID_HEADER_FOUND=1 -else +else $as_nop LIBUUID_HEADER_FOUND=0 fi - CPPFLAGS="${ast_ext_lib_check_saved_CPPFLAGS}" if test "x${LIBUUID_HEADER_FOUND}" = "x0" ; then @@ -14439,11 +15503,12 @@ ast_ext_lib_check_save_CFLAGS="${CFLAGS}" CFLAGS="${CFLAGS} " - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for uuid_generate_random in -le2fs-uuid" >&5 -$as_echo_n "checking for uuid_generate_random in -le2fs-uuid... " >&6; } -if ${ac_cv_lib_e2fs_uuid_uuid_generate_random+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for uuid_generate_random in -le2fs-uuid" >&5 +printf %s "checking for uuid_generate_random in -le2fs-uuid... " >&6; } +if test ${ac_cv_lib_e2fs_uuid_uuid_generate_random+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-le2fs-uuid ${pbxlibdir} $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -14452,32 +15517,31 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char uuid_generate_random (); int -main () +main (void) { return uuid_generate_random (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_e2fs_uuid_uuid_generate_random=yes -else +else $as_nop ac_cv_lib_e2fs_uuid_uuid_generate_random=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_e2fs_uuid_uuid_generate_random" >&5 -$as_echo "$ac_cv_lib_e2fs_uuid_uuid_generate_random" >&6; } -if test "x$ac_cv_lib_e2fs_uuid_uuid_generate_random" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_e2fs_uuid_uuid_generate_random" >&5 +printf "%s\n" "$ac_cv_lib_e2fs_uuid_uuid_generate_random" >&6; } +if test "x$ac_cv_lib_e2fs_uuid_uuid_generate_random" = xyes +then : AST_E2FSUUID_FOUND=yes -else +else $as_nop AST_E2FSUUID_FOUND=no fi @@ -14496,14 +15560,14 @@ # check for the header ast_ext_lib_check_saved_CPPFLAGS="${CPPFLAGS}" CPPFLAGS="${CPPFLAGS} ${E2FSUUID_INCLUDE}" - ac_fn_c_check_header_mongrel "$LINENO" "uuid/uuid.h" "ac_cv_header_uuid_uuid_h" "$ac_includes_default" -if test "x$ac_cv_header_uuid_uuid_h" = xyes; then : + ac_fn_c_check_header_compile "$LINENO" "uuid/uuid.h" "ac_cv_header_uuid_uuid_h" "$ac_includes_default" +if test "x$ac_cv_header_uuid_uuid_h" = xyes +then : E2FSUUID_HEADER_FOUND=1 -else +else $as_nop E2FSUUID_HEADER_FOUND=0 fi - CPPFLAGS="${ast_ext_lib_check_saved_CPPFLAGS}" if test "x${E2FSUUID_HEADER_FOUND}" = "x0" ; then @@ -14525,19 +15589,19 @@ UUID_INCLUDE="$E2FSUUID_INCLUDE" UUID_LIB="$E2FSUUID_LIB" else - for ac_func in uuid_generate_random + + for ac_func in uuid_generate_random do : ac_fn_c_check_func "$LINENO" "uuid_generate_random" "ac_cv_func_uuid_generate_random" -if test "x$ac_cv_func_uuid_generate_random" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_UUID_GENERATE_RANDOM 1 -_ACEOF +if test "x$ac_cv_func_uuid_generate_random" = xyes +then : + printf "%s\n" "#define HAVE_UUID_GENERATE_RANDOM 1" >>confdefs.h SYSUUID=true -else +else $as_nop SYSUUID="" fi -done +done if test "x$SYSUUID" != "x" ; then UUID_INCLUDE="" UUID_LIB="" @@ -14555,17 +15619,17 @@ if test "x${PBX_JANSSON}" != "x1" -a "${USE_JANSSON}" != "no"; then pkg_failed=no -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for JANSSON" >&5 -$as_echo_n "checking for JANSSON... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for jansson >= 2.11" >&5 +printf %s "checking for jansson >= 2.11... " >&6; } if test -n "$JANSSON_CFLAGS"; then pkg_cv_JANSSON_CFLAGS="$JANSSON_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"jansson >= 2.11\""; } >&5 + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"jansson >= 2.11\""; } >&5 ($PKG_CONFIG --exists --print-errors "jansson >= 2.11") 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_JANSSON_CFLAGS=`$PKG_CONFIG --cflags "jansson >= 2.11" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes @@ -14579,10 +15643,10 @@ pkg_cv_JANSSON_LIBS="$JANSSON_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"jansson >= 2.11\""; } >&5 + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"jansson >= 2.11\""; } >&5 ($PKG_CONFIG --exists --print-errors "jansson >= 2.11") 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_JANSSON_LIBS=`$PKG_CONFIG --libs "jansson >= 2.11" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes @@ -14596,8 +15660,8 @@ if test $pkg_failed = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes @@ -14617,8 +15681,8 @@ elif test $pkg_failed = untried; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } PBX_JANSSON=0 @@ -14626,14 +15690,14 @@ else JANSSON_CFLAGS=$pkg_cv_JANSSON_CFLAGS JANSSON_LIBS=$pkg_cv_JANSSON_LIBS - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } PBX_JANSSON=1 JANSSON_INCLUDE=$(echo ${JANSSON_CFLAGS} | $SED -e "s|-std=c99||g") JANSSON_LIB="$JANSSON_LIBS" -$as_echo "#define HAVE_JANSSON 1" >>confdefs.h +printf "%s\n" "#define HAVE_JANSSON 1" >>confdefs.h fi @@ -14654,11 +15718,12 @@ ast_ext_lib_check_save_CFLAGS="${CFLAGS}" CFLAGS="${CFLAGS} " - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for json_sprintf in -ljansson" >&5 -$as_echo_n "checking for json_sprintf in -ljansson... " >&6; } -if ${ac_cv_lib_jansson_json_sprintf+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for json_sprintf in -ljansson" >&5 +printf %s "checking for json_sprintf in -ljansson... " >&6; } +if test ${ac_cv_lib_jansson_json_sprintf+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-ljansson ${pbxlibdir} $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -14667,32 +15732,31 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char json_sprintf (); int -main () +main (void) { return json_sprintf (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_jansson_json_sprintf=yes -else +else $as_nop ac_cv_lib_jansson_json_sprintf=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_jansson_json_sprintf" >&5 -$as_echo "$ac_cv_lib_jansson_json_sprintf" >&6; } -if test "x$ac_cv_lib_jansson_json_sprintf" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_jansson_json_sprintf" >&5 +printf "%s\n" "$ac_cv_lib_jansson_json_sprintf" >&6; } +if test "x$ac_cv_lib_jansson_json_sprintf" = xyes +then : AST_JANSSON_FOUND=yes -else +else $as_nop AST_JANSSON_FOUND=no fi @@ -14711,14 +15775,14 @@ # check for the header ast_ext_lib_check_saved_CPPFLAGS="${CPPFLAGS}" CPPFLAGS="${CPPFLAGS} ${JANSSON_INCLUDE}" - ac_fn_c_check_header_mongrel "$LINENO" "jansson.h" "ac_cv_header_jansson_h" "$ac_includes_default" -if test "x$ac_cv_header_jansson_h" = xyes; then : + ac_fn_c_check_header_compile "$LINENO" "jansson.h" "ac_cv_header_jansson_h" "$ac_includes_default" +if test "x$ac_cv_header_jansson_h" = xyes +then : JANSSON_HEADER_FOUND=1 -else +else $as_nop JANSSON_HEADER_FOUND=0 fi - CPPFLAGS="${ast_ext_lib_check_saved_CPPFLAGS}" if test "x${JANSSON_HEADER_FOUND}" = "x0" ; then @@ -14738,12 +15802,12 @@ if test "${PBX_JANSSON}" != 1; then - { $as_echo "$as_me:${as_lineno-$LINENO}: *** Asterisk requires libjansson >= 2.11 and no system copy was found." >&5 -$as_echo "$as_me: *** Asterisk requires libjansson >= 2.11 and no system copy was found." >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: *** Please install the 'libjansson' development package or" >&5 -$as_echo "$as_me: *** Please install the 'libjansson' development package or" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: *** use './configure --with-jansson-bundled'" >&5 -$as_echo "$as_me: *** use './configure --with-jansson-bundled'" >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: *** Asterisk requires libjansson >= 2.11 and no system copy was found." >&5 +printf "%s\n" "$as_me: *** Asterisk requires libjansson >= 2.11 and no system copy was found." >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: *** Please install the 'libjansson' development package or" >&5 +printf "%s\n" "$as_me: *** Please install the 'libjansson' development package or" >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: *** use './configure --with-jansson-bundled'" >&5 +printf "%s\n" "$as_me: *** use './configure --with-jansson-bundled'" >&6;} exit 1 fi @@ -14754,7 +15818,7 @@ /* end confdefs.h. */ #include int -main () +main (void) { #if !JSON_INTEGER_IS_LONG_LONG #error "not long long" @@ -14764,16 +15828,17 @@ return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : -$as_echo "#define AST_JSON_INT_T long long" >>confdefs.h +printf "%s\n" "#define AST_JSON_INT_T long long" >>confdefs.h -else +else $as_nop -$as_echo "#define AST_JSON_INT_T long" >>confdefs.h +printf "%s\n" "#define AST_JSON_INT_T long" >>confdefs.h fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext CPPFLAGS="${saved_cppflags}" else @@ -14795,11 +15860,12 @@ ast_ext_lib_check_save_CFLAGS="${CFLAGS}" CFLAGS="${CFLAGS} " - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for clock_gettime in -lrt" >&5 -$as_echo_n "checking for clock_gettime in -lrt... " >&6; } -if ${ac_cv_lib_rt_clock_gettime+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for clock_gettime in -lrt" >&5 +printf %s "checking for clock_gettime in -lrt... " >&6; } +if test ${ac_cv_lib_rt_clock_gettime+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lrt ${pbxlibdir} $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -14808,32 +15874,31 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char clock_gettime (); int -main () +main (void) { return clock_gettime (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_rt_clock_gettime=yes -else +else $as_nop ac_cv_lib_rt_clock_gettime=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_rt_clock_gettime" >&5 -$as_echo "$ac_cv_lib_rt_clock_gettime" >&6; } -if test "x$ac_cv_lib_rt_clock_gettime" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_rt_clock_gettime" >&5 +printf "%s\n" "$ac_cv_lib_rt_clock_gettime" >&6; } +if test "x$ac_cv_lib_rt_clock_gettime" = xyes +then : AST_RT_FOUND=yes -else +else $as_nop AST_RT_FOUND=no fi @@ -14869,16 +15934,105 @@ + if test "x${PBX_LIBXML2}" != "x1" -a "${USE_LIBXML2}" != "no"; then + +pkg_failed=no +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libxml-2.0" >&5 +printf %s "checking for libxml-2.0... " >&6; } + +if test -n "$LIBXML2_CFLAGS"; then + pkg_cv_LIBXML2_CFLAGS="$LIBXML2_CFLAGS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libxml-2.0\""; } >&5 + ($PKG_CONFIG --exists --print-errors "libxml-2.0") 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_LIBXML2_CFLAGS=`$PKG_CONFIG --cflags "libxml-2.0" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi +if test -n "$LIBXML2_LIBS"; then + pkg_cv_LIBXML2_LIBS="$LIBXML2_LIBS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libxml-2.0\""; } >&5 + ($PKG_CONFIG --exists --print-errors "libxml-2.0") 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_LIBXML2_LIBS=`$PKG_CONFIG --libs "libxml-2.0" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi + + + +if test $pkg_failed = yes; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then + _pkg_short_errors_supported=yes +else + _pkg_short_errors_supported=no +fi + if test $_pkg_short_errors_supported = yes; then + LIBXML2_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libxml-2.0" 2>&1` + else + LIBXML2_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libxml-2.0" 2>&1` + fi + # Put the nasty error message in config.log where it belongs + echo "$LIBXML2_PKG_ERRORS" >&5 + + + PBX_LIBXML2=0 + + +elif test $pkg_failed = untried; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + + PBX_LIBXML2=0 + + +else + LIBXML2_CFLAGS=$pkg_cv_LIBXML2_CFLAGS + LIBXML2_LIBS=$pkg_cv_LIBXML2_LIBS + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + + PBX_LIBXML2=1 + LIBXML2_INCLUDE=$(echo ${LIBXML2_CFLAGS} | $SED -e "s|-std=c99||g") + LIBXML2_LIB="$LIBXML2_LIBS" + +printf "%s\n" "#define HAVE_LIBXML2 1" >>confdefs.h + + +fi + fi + + if test "x${PBX_LIBXML2}" != "x1" -a "${USE_LIBXML2}" != "no"; then PBX_LIBXML2=0 if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}xml2-config", so it can be a program name with args. set dummy ${ac_tool_prefix}xml2-config; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_CONFIG_LIBXML2+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_CONFIG_LIBXML2+y} +then : + printf %s "(cached) " >&6 +else $as_nop case $CONFIG_LIBXML2 in [\\/]* | ?:[\\/]*) ac_cv_path_CONFIG_LIBXML2="$CONFIG_LIBXML2" # Let the user override the test with a path. @@ -14889,11 +16043,15 @@ for as_dir in $as_dummy do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_CONFIG_LIBXML2="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_CONFIG_LIBXML2="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -14905,11 +16063,11 @@ fi CONFIG_LIBXML2=$ac_cv_path_CONFIG_LIBXML2 if test -n "$CONFIG_LIBXML2"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CONFIG_LIBXML2" >&5 -$as_echo "$CONFIG_LIBXML2" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CONFIG_LIBXML2" >&5 +printf "%s\n" "$CONFIG_LIBXML2" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -14918,11 +16076,12 @@ ac_pt_CONFIG_LIBXML2=$CONFIG_LIBXML2 # Extract the first word of "xml2-config", so it can be a program name with args. set dummy xml2-config; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_ac_pt_CONFIG_LIBXML2+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_ac_pt_CONFIG_LIBXML2+y} +then : + printf %s "(cached) " >&6 +else $as_nop case $ac_pt_CONFIG_LIBXML2 in [\\/]* | ?:[\\/]*) ac_cv_path_ac_pt_CONFIG_LIBXML2="$ac_pt_CONFIG_LIBXML2" # Let the user override the test with a path. @@ -14933,11 +16092,15 @@ for as_dir in $as_dummy do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_ac_pt_CONFIG_LIBXML2="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_ac_pt_CONFIG_LIBXML2="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -14949,11 +16112,11 @@ fi ac_pt_CONFIG_LIBXML2=$ac_cv_path_ac_pt_CONFIG_LIBXML2 if test -n "$ac_pt_CONFIG_LIBXML2"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_CONFIG_LIBXML2" >&5 -$as_echo "$ac_pt_CONFIG_LIBXML2" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_pt_CONFIG_LIBXML2" >&5 +printf "%s\n" "$ac_pt_CONFIG_LIBXML2" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi if test "x$ac_pt_CONFIG_LIBXML2" = x; then @@ -14961,8 +16124,8 @@ else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CONFIG_LIBXML2=$ac_pt_CONFIG_LIBXML2 @@ -14990,19 +16153,20 @@ #include #include int -main () +main (void) { LIBXML_TEST_VERSION; ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : PBX_LIBXML2=1 -$as_echo "#define HAVE_LIBXML2 1" >>confdefs.h +printf "%s\n" "#define HAVE_LIBXML2 1" >>confdefs.h fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext CPPFLAGS="${saved_cppflags}" LIBS="${saved_libs}" @@ -15012,10 +16176,10 @@ if test "${PBX_LIBXML2}" != 1; then - { $as_echo "$as_me:${as_lineno-$LINENO}: *** The Asterisk menuselect tool requires the 'libxml2' development package." >&5 -$as_echo "$as_me: *** The Asterisk menuselect tool requires the 'libxml2' development package." >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: *** Please install the 'libxml2' development package." >&5 -$as_echo "$as_me: *** Please install the 'libxml2' development package." >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: *** The Asterisk menuselect tool requires the 'libxml2' development package." >&5 +printf "%s\n" "$as_me: *** The Asterisk menuselect tool requires the 'libxml2' development package." >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: *** Please install the 'libxml2' development package." >&5 +printf "%s\n" "$as_me: *** Please install the 'libxml2' development package." >&6;} exit 1 fi @@ -15033,11 +16197,12 @@ ast_ext_lib_check_save_CFLAGS="${CFLAGS}" CFLAGS="${CFLAGS} " - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for uriParseUriA in -luriparser" >&5 -$as_echo_n "checking for uriParseUriA in -luriparser... " >&6; } -if ${ac_cv_lib_uriparser_uriParseUriA+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for uriParseUriA in -luriparser" >&5 +printf %s "checking for uriParseUriA in -luriparser... " >&6; } +if test ${ac_cv_lib_uriparser_uriParseUriA+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-luriparser ${pbxlibdir} $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -15046,32 +16211,31 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char uriParseUriA (); int -main () +main (void) { return uriParseUriA (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_uriparser_uriParseUriA=yes -else +else $as_nop ac_cv_lib_uriparser_uriParseUriA=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_uriparser_uriParseUriA" >&5 -$as_echo "$ac_cv_lib_uriparser_uriParseUriA" >&6; } -if test "x$ac_cv_lib_uriparser_uriParseUriA" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_uriparser_uriParseUriA" >&5 +printf "%s\n" "$ac_cv_lib_uriparser_uriParseUriA" >&6; } +if test "x$ac_cv_lib_uriparser_uriParseUriA" = xyes +then : AST_URIPARSER_FOUND=yes -else +else $as_nop AST_URIPARSER_FOUND=no fi @@ -15090,14 +16254,14 @@ # check for the header ast_ext_lib_check_saved_CPPFLAGS="${CPPFLAGS}" CPPFLAGS="${CPPFLAGS} ${URIPARSER_INCLUDE}" - ac_fn_c_check_header_mongrel "$LINENO" "uriparser/Uri.h" "ac_cv_header_uriparser_Uri_h" "$ac_includes_default" -if test "x$ac_cv_header_uriparser_Uri_h" = xyes; then : + ac_fn_c_check_header_compile "$LINENO" "uriparser/Uri.h" "ac_cv_header_uriparser_Uri_h" "$ac_includes_default" +if test "x$ac_cv_header_uriparser_Uri_h" = xyes +then : URIPARSER_HEADER_FOUND=1 -else +else $as_nop URIPARSER_HEADER_FOUND=0 fi - CPPFLAGS="${ast_ext_lib_check_saved_CPPFLAGS}" if test "x${URIPARSER_HEADER_FOUND}" = "x0" ; then @@ -15118,13 +16282,14 @@ # Another mandatory item (unless it's explicitly disabled) # Check whether --enable-xmldoc was given. -if test "${enable_xmldoc+set}" = set; then : +if test ${enable_xmldoc+y} +then : enableval=$enable_xmldoc; case "${enableval}" in y|ye|yes) DISABLE_XMLDOC=no ;; n|no) DISABLE_XMLDOC=yes ;; *) as_fn_error $? "bad value ${enableval} for --disable-xmldoc" "$LINENO" 5 ;; esac -else +else $as_nop DISABLE_XMLDOC=no fi @@ -15132,7 +16297,7 @@ if test "${DISABLE_XMLDOC}" != "yes"; then -$as_echo "#define AST_XML_DOCS 1" >>confdefs.h +printf "%s\n" "#define AST_XML_DOCS 1" >>confdefs.h fi @@ -15150,11 +16315,12 @@ ast_ext_lib_check_save_CFLAGS="${CFLAGS}" CFLAGS="${CFLAGS} ${LIBXML2_INCLUDE}" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for xsltLoadStylesheetPI in -lxslt" >&5 -$as_echo_n "checking for xsltLoadStylesheetPI in -lxslt... " >&6; } -if ${ac_cv_lib_xslt_xsltLoadStylesheetPI+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for xsltLoadStylesheetPI in -lxslt" >&5 +printf %s "checking for xsltLoadStylesheetPI in -lxslt... " >&6; } +if test ${ac_cv_lib_xslt_xsltLoadStylesheetPI+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lxslt ${pbxlibdir} ${LIBXML2_LIB} $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -15163,32 +16329,31 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char xsltLoadStylesheetPI (); int -main () +main (void) { return xsltLoadStylesheetPI (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_xslt_xsltLoadStylesheetPI=yes -else +else $as_nop ac_cv_lib_xslt_xsltLoadStylesheetPI=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_xslt_xsltLoadStylesheetPI" >&5 -$as_echo "$ac_cv_lib_xslt_xsltLoadStylesheetPI" >&6; } -if test "x$ac_cv_lib_xslt_xsltLoadStylesheetPI" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_xslt_xsltLoadStylesheetPI" >&5 +printf "%s\n" "$ac_cv_lib_xslt_xsltLoadStylesheetPI" >&6; } +if test "x$ac_cv_lib_xslt_xsltLoadStylesheetPI" = xyes +then : AST_LIBXSLT_FOUND=yes -else +else $as_nop AST_LIBXSLT_FOUND=no fi @@ -15207,14 +16372,14 @@ # check for the header ast_ext_lib_check_saved_CPPFLAGS="${CPPFLAGS}" CPPFLAGS="${CPPFLAGS} ${LIBXSLT_INCLUDE}" - ac_fn_c_check_header_mongrel "$LINENO" "libxslt/xsltInternals.h" "ac_cv_header_libxslt_xsltInternals_h" "$ac_includes_default" -if test "x$ac_cv_header_libxslt_xsltInternals_h" = xyes; then : + ac_fn_c_check_header_compile "$LINENO" "libxslt/xsltInternals.h" "ac_cv_header_libxslt_xsltInternals_h" "$ac_includes_default" +if test "x$ac_cv_header_libxslt_xsltInternals_h" = xyes +then : LIBXSLT_HEADER_FOUND=1 -else +else $as_nop LIBXSLT_HEADER_FOUND=0 fi - CPPFLAGS="${ast_ext_lib_check_saved_CPPFLAGS}" if test "x${LIBXSLT_HEADER_FOUND}" = "x0" ; then @@ -15246,11 +16411,12 @@ ast_ext_lib_check_save_CFLAGS="${CFLAGS}" CFLAGS="${CFLAGS} ${LIBXML2_INCLUDE}" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for xsltCleanupGlobals in -lxslt" >&5 -$as_echo_n "checking for xsltCleanupGlobals in -lxslt... " >&6; } -if ${ac_cv_lib_xslt_xsltCleanupGlobals+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for xsltCleanupGlobals in -lxslt" >&5 +printf %s "checking for xsltCleanupGlobals in -lxslt... " >&6; } +if test ${ac_cv_lib_xslt_xsltCleanupGlobals+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lxslt ${pbxlibdir} ${LIBXML2_LIB} $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -15259,32 +16425,31 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char xsltCleanupGlobals (); int -main () +main (void) { return xsltCleanupGlobals (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_xslt_xsltCleanupGlobals=yes -else +else $as_nop ac_cv_lib_xslt_xsltCleanupGlobals=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_xslt_xsltCleanupGlobals" >&5 -$as_echo "$ac_cv_lib_xslt_xsltCleanupGlobals" >&6; } -if test "x$ac_cv_lib_xslt_xsltCleanupGlobals" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_xslt_xsltCleanupGlobals" >&5 +printf "%s\n" "$ac_cv_lib_xslt_xsltCleanupGlobals" >&6; } +if test "x$ac_cv_lib_xslt_xsltCleanupGlobals" = xyes +then : AST_LIBXSLT_CLEANUP_FOUND=yes -else +else $as_nop AST_LIBXSLT_CLEANUP_FOUND=no fi @@ -15303,14 +16468,14 @@ # check for the header ast_ext_lib_check_saved_CPPFLAGS="${CPPFLAGS}" CPPFLAGS="${CPPFLAGS} ${LIBXSLT_CLEANUP_INCLUDE}" - ac_fn_c_check_header_mongrel "$LINENO" "libxslt/xsltInternals.h" "ac_cv_header_libxslt_xsltInternals_h" "$ac_includes_default" -if test "x$ac_cv_header_libxslt_xsltInternals_h" = xyes; then : + ac_fn_c_check_header_compile "$LINENO" "libxslt/xsltInternals.h" "ac_cv_header_libxslt_xsltInternals_h" "$ac_includes_default" +if test "x$ac_cv_header_libxslt_xsltInternals_h" = xyes +then : LIBXSLT_CLEANUP_HEADER_FOUND=1 -else +else $as_nop LIBXSLT_CLEANUP_HEADER_FOUND=0 fi - CPPFLAGS="${ast_ext_lib_check_saved_CPPFLAGS}" if test "x${LIBXSLT_CLEANUP_HEADER_FOUND}" = "x0" ; then @@ -15330,13 +16495,14 @@ # Check whether --enable-permanent-dlopen was given. -if test "${enable_permanent_dlopen+set}" = set; then : +if test ${enable_permanent_dlopen+y} +then : enableval=$enable_permanent_dlopen; case "${enableval}" in y|ye|yes) PERMANENT_DLOPEN=yes ;; n|no) PERMANENT_DLOPEN=no ;; *) as_fn_error $? "bad value ${enableval} for --enable-permanent-dlopen" "$LINENO" 5 ;; esac -else +else $as_nop PERMANENT_DLOPEN=no fi @@ -15344,61 +16510,58 @@ if test "${PERMANENT_DLOPEN}" = "yes"; then -$as_echo "#define HAVE_PERMANENT_DLOPEN 1" >>confdefs.h +printf "%s\n" "#define HAVE_PERMANENT_DLOPEN 1" >>confdefs.h fi # some embedded systems omit internationalization (locale) support -for ac_header in xlocale.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "xlocale.h" "ac_cv_header_xlocale_h" "$ac_includes_default" -if test "x$ac_cv_header_xlocale_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_XLOCALE_H 1 -_ACEOF +ac_fn_c_check_header_compile "$LINENO" "xlocale.h" "ac_cv_header_xlocale_h" "$ac_includes_default" +if test "x$ac_cv_header_xlocale_h" = xyes +then : + printf "%s\n" "#define HAVE_XLOCALE_H 1" >>confdefs.h fi -done - -for ac_header in winsock.h winsock2.h -do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF +ac_fn_c_check_header_compile "$LINENO" "winsock.h" "ac_cv_header_winsock_h" "$ac_includes_default" +if test "x$ac_cv_header_winsock_h" = xyes +then : + printf "%s\n" "#define HAVE_WINSOCK_H 1" >>confdefs.h fi +ac_fn_c_check_header_compile "$LINENO" "winsock2.h" "ac_cv_header_winsock2_h" "$ac_includes_default" +if test "x$ac_cv_header_winsock2_h" = xyes +then : + printf "%s\n" "#define HAVE_WINSOCK2_H 1" >>confdefs.h -done +fi -ac_fn_c_check_header_mongrel "$LINENO" "sys/poll.h" "ac_cv_header_sys_poll_h" "$ac_includes_default" -if test "x$ac_cv_header_sys_poll_h" = xyes; then : +ac_fn_c_check_header_compile "$LINENO" "sys/poll.h" "ac_cv_header_sys_poll_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_poll_h" = xyes +then : -else +else $as_nop -$as_echo "#define AST_POLL_COMPAT 1" >>confdefs.h +printf "%s\n" "#define AST_POLL_COMPAT 1" >>confdefs.h fi - # Check whether --enable-largefile was given. -if test "${enable_largefile+set}" = set; then : +if test ${enable_largefile+y} +then : enableval=$enable_largefile; fi if test "$enable_largefile" != no; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for special C compiler options needed for large files" >&5 -$as_echo_n "checking for special C compiler options needed for large files... " >&6; } -if ${ac_cv_sys_largefile_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for special C compiler options needed for large files" >&5 +printf %s "checking for special C compiler options needed for large files... " >&6; } +if test ${ac_cv_sys_largefile_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_cv_sys_largefile_CC=no if test "$GCC" != yes; then ac_save_CC=$CC @@ -15412,44 +16575,47 @@ We can't simply define LARGE_OFF_T to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ -#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) +#define LARGE_OFF_T (((off_t) 1 << 31 << 31) - 1 + ((off_t) 1 << 31 << 31)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; int -main () +main (void) { ; return 0; } _ACEOF - if ac_fn_c_try_compile "$LINENO"; then : + if ac_fn_c_try_compile "$LINENO" +then : break fi -rm -f core conftest.err conftest.$ac_objext +rm -f core conftest.err conftest.$ac_objext conftest.beam CC="$CC -n32" - if ac_fn_c_try_compile "$LINENO"; then : + if ac_fn_c_try_compile "$LINENO" +then : ac_cv_sys_largefile_CC=' -n32'; break fi -rm -f core conftest.err conftest.$ac_objext +rm -f core conftest.err conftest.$ac_objext conftest.beam break done CC=$ac_save_CC rm -f conftest.$ac_ext fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_largefile_CC" >&5 -$as_echo "$ac_cv_sys_largefile_CC" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_largefile_CC" >&5 +printf "%s\n" "$ac_cv_sys_largefile_CC" >&6; } if test "$ac_cv_sys_largefile_CC" != no; then CC=$CC$ac_cv_sys_largefile_CC fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _FILE_OFFSET_BITS value needed for large files" >&5 -$as_echo_n "checking for _FILE_OFFSET_BITS value needed for large files... " >&6; } -if ${ac_cv_sys_file_offset_bits+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for _FILE_OFFSET_BITS value needed for large files" >&5 +printf %s "checking for _FILE_OFFSET_BITS value needed for large files... " >&6; } +if test ${ac_cv_sys_file_offset_bits+y} +then : + printf %s "(cached) " >&6 +else $as_nop while :; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -15458,22 +16624,23 @@ We can't simply define LARGE_OFF_T to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ -#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) +#define LARGE_OFF_T (((off_t) 1 << 31 << 31) - 1 + ((off_t) 1 << 31 << 31)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; int -main () +main (void) { ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : ac_cv_sys_file_offset_bits=no; break fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define _FILE_OFFSET_BITS 64 @@ -15482,43 +16649,43 @@ We can't simply define LARGE_OFF_T to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ -#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) +#define LARGE_OFF_T (((off_t) 1 << 31 << 31) - 1 + ((off_t) 1 << 31 << 31)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; int -main () +main (void) { ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : ac_cv_sys_file_offset_bits=64; break fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ac_cv_sys_file_offset_bits=unknown break done fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_file_offset_bits" >&5 -$as_echo "$ac_cv_sys_file_offset_bits" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_file_offset_bits" >&5 +printf "%s\n" "$ac_cv_sys_file_offset_bits" >&6; } case $ac_cv_sys_file_offset_bits in #( no | unknown) ;; *) -cat >>confdefs.h <<_ACEOF -#define _FILE_OFFSET_BITS $ac_cv_sys_file_offset_bits -_ACEOF +printf "%s\n" "#define _FILE_OFFSET_BITS $ac_cv_sys_file_offset_bits" >>confdefs.h ;; esac rm -rf conftest* if test $ac_cv_sys_file_offset_bits = unknown; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _LARGE_FILES value needed for large files" >&5 -$as_echo_n "checking for _LARGE_FILES value needed for large files... " >&6; } -if ${ac_cv_sys_large_files+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for _LARGE_FILES value needed for large files" >&5 +printf %s "checking for _LARGE_FILES value needed for large files... " >&6; } +if test ${ac_cv_sys_large_files+y} +then : + printf %s "(cached) " >&6 +else $as_nop while :; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -15527,22 +16694,23 @@ We can't simply define LARGE_OFF_T to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ -#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) +#define LARGE_OFF_T (((off_t) 1 << 31 << 31) - 1 + ((off_t) 1 << 31 << 31)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; int -main () +main (void) { ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : ac_cv_sys_large_files=no; break fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define _LARGE_FILES 1 @@ -15551,147 +16719,194 @@ We can't simply define LARGE_OFF_T to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ -#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) +#define LARGE_OFF_T (((off_t) 1 << 31 << 31) - 1 + ((off_t) 1 << 31 << 31)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; int -main () +main (void) { ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : ac_cv_sys_large_files=1; break fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ac_cv_sys_large_files=unknown break done fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_large_files" >&5 -$as_echo "$ac_cv_sys_large_files" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_large_files" >&5 +printf "%s\n" "$ac_cv_sys_large_files" >&6; } case $ac_cv_sys_large_files in #( no | unknown) ;; *) -cat >>confdefs.h <<_ACEOF -#define _LARGE_FILES $ac_cv_sys_large_files -_ACEOF +printf "%s\n" "#define _LARGE_FILES $ac_cv_sys_large_files" >>confdefs.h ;; esac rm -rf conftest* fi - - fi # Checks for typedefs, structures, and compiler characteristics. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for stdbool.h that conforms to C99" >&5 -$as_echo_n "checking for stdbool.h that conforms to C99... " >&6; } -if ${ac_cv_header_stdbool_h+:} false; then : - $as_echo_n "(cached) " >&6 -else +ac_fn_c_check_type "$LINENO" "_Bool" "ac_cv_type__Bool" "$ac_includes_default" +if test "x$ac_cv_type__Bool" = xyes +then : + +printf "%s\n" "#define HAVE__BOOL 1" >>confdefs.h + + +fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for stdbool.h that conforms to C99" >&5 +printf %s "checking for stdbool.h that conforms to C99... " >&6; } +if test ${ac_cv_header_stdbool_h+y} +then : + printf %s "(cached) " >&6 +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ +#include - #include - #ifndef bool - "error: bool is not defined" - #endif - #ifndef false - "error: false is not defined" - #endif - #if false - "error: false is not 0" + #ifndef __bool_true_false_are_defined + #error "__bool_true_false_are_defined is not defined" #endif - #ifndef true - "error: true is not defined" + char a[__bool_true_false_are_defined == 1 ? 1 : -1]; + + /* Regardless of whether this is C++ or "_Bool" is a + valid type name, "true" and "false" should be usable + in #if expressions and integer constant expressions, + and "bool" should be a valid type name. */ + + #if !true + #error "'true' is not true" #endif #if true != 1 - "error: true is not 1" + #error "'true' is not equal to 1" #endif - #ifndef __bool_true_false_are_defined - "error: __bool_true_false_are_defined is not defined" + char b[true == 1 ? 1 : -1]; + char c[true]; + + #if false + #error "'false' is not false" + #endif + #if false != 0 + #error "'false' is not equal to 0" #endif + char d[false == 0 ? 1 : -1]; + + enum { e = false, f = true, g = false * true, h = true * 256 }; + + char i[(bool) 0.5 == true ? 1 : -1]; + char j[(bool) 0.0 == false ? 1 : -1]; + char k[sizeof (bool) > 0 ? 1 : -1]; - struct s { _Bool s: 1; _Bool t; } s; + struct sb { bool s: 1; bool t; } s; + char l[sizeof s.t > 0 ? 1 : -1]; - char a[true == 1 ? 1 : -1]; - char b[false == 0 ? 1 : -1]; - char c[__bool_true_false_are_defined == 1 ? 1 : -1]; - char d[(bool) 0.5 == true ? 1 : -1]; - /* See body of main program for 'e'. */ - char f[(_Bool) 0.0 == false ? 1 : -1]; - char g[true]; - char h[sizeof (_Bool)]; - char i[sizeof s.t]; - enum { j = false, k = true, l = false * true, m = true * 256 }; /* The following fails for HP aC++/ANSI C B3910B A.05.55 [Dec 04 2003]. */ - _Bool n[m]; - char o[sizeof n == m * sizeof n[0] ? 1 : -1]; - char p[-1 - (_Bool) 0 < 0 && -1 - (bool) 0 < 0 ? 1 : -1]; + bool m[h]; + char n[sizeof m == h * sizeof m[0] ? 1 : -1]; + char o[-1 - (bool) 0 < 0 ? 1 : -1]; /* Catch a bug in an HP-UX C compiler. See - http://gcc.gnu.org/ml/gcc-patches/2003-12/msg02303.html - http://lists.gnu.org/archive/html/bug-coreutils/2005-11/msg00161.html + https://gcc.gnu.org/ml/gcc-patches/2003-12/msg02303.html + https://lists.gnu.org/archive/html/bug-coreutils/2005-11/msg00161.html */ - _Bool q = true; - _Bool *pq = &q; + bool p = true; + bool *pp = &p; + + /* C 1999 specifies that bool, true, and false are to be + macros, but C++ 2011 and later overrule this. */ + #if __cplusplus < 201103 + #ifndef bool + #error "bool is not defined" + #endif + #ifndef false + #error "false is not defined" + #endif + #ifndef true + #error "true is not defined" + #endif + #endif + + /* If _Bool is available, repeat with it all the tests + above that used bool. */ + #ifdef HAVE__BOOL + struct sB { _Bool s: 1; _Bool t; } t; + + char q[(_Bool) 0.5 == true ? 1 : -1]; + char r[(_Bool) 0.0 == false ? 1 : -1]; + char u[sizeof (_Bool) > 0 ? 1 : -1]; + char v[sizeof t.t > 0 ? 1 : -1]; + + _Bool w[h]; + char x[sizeof m == h * sizeof m[0] ? 1 : -1]; + char y[-1 - (_Bool) 0 < 0 ? 1 : -1]; + _Bool z = true; + _Bool *pz = &p; + #endif int -main () +main (void) { - bool e = &s; - *pq |= q; - *pq |= ! q; - /* Refer to every declared value, to avoid compiler optimizations. */ - return (!a + !b + !c + !d + !e + !f + !g + !h + !i + !!j + !k + !!l - + !m + !n + !o + !p + !q + !pq); + bool ps = &s; + *pp |= p; + *pp |= ! p; + + #ifdef HAVE__BOOL + _Bool pt = &t; + *pz |= z; + *pz |= ! z; + #endif + + /* Refer to every declared value, so they cannot be + discarded as unused. */ + return (!a + !b + !c + !d + !e + !f + !g + !h + !i + !j + !k + + !l + !m + !n + !o + !p + !pp + !ps + #ifdef HAVE__BOOL + + !q + !r + !u + !v + !w + !x + !y + !z + !pt + #endif + ); ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : ac_cv_header_stdbool_h=yes -else +else $as_nop ac_cv_header_stdbool_h=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdbool_h" >&5 -$as_echo "$ac_cv_header_stdbool_h" >&6; } - ac_fn_c_check_type "$LINENO" "_Bool" "ac_cv_type__Bool" "$ac_includes_default" -if test "x$ac_cv_type__Bool" = xyes; then : - -cat >>confdefs.h <<_ACEOF -#define HAVE__BOOL 1 -_ACEOF - - +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi - +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdbool_h" >&5 +printf "%s\n" "$ac_cv_header_stdbool_h" >&6; } if test $ac_cv_header_stdbool_h = yes; then -$as_echo "#define HAVE_STDBOOL_H 1" >>confdefs.h +printf "%s\n" "#define HAVE_STDBOOL_H 1" >>confdefs.h fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for an ANSI C-conforming const" >&5 -$as_echo_n "checking for an ANSI C-conforming const... " >&6; } -if ${ac_cv_c_const+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for an ANSI C-conforming const" >&5 +printf %s "checking for an ANSI C-conforming const... " >&6; } +if test ${ac_cv_c_const+y} +then : + printf %s "(cached) " >&6 +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int -main () +main (void) { #ifndef __cplusplus @@ -15704,7 +16919,7 @@ /* NEC SVR4.0.2 mips cc rejects this. */ struct point {int x, y;}; static struct point const zero = {0,0}; - /* AIX XL C 1.02.0.0 rejects this. + /* IBM XL C 1.02.0.0 rejects this. It does not let you subtract one const X* pointer from another in an arm of an if-expression whose if-part is not a constant expression */ @@ -15732,7 +16947,7 @@ iptr p = 0; ++p; } - { /* AIX XL C 1.02.0.0 rejects this sort of thing, saying + { /* IBM XL C 1.02.0.0 rejects this sort of thing, saying "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */ struct s { int j; const int *ap[3]; } bx; struct s *b = &bx; b->j = 5; @@ -15748,77 +16963,82 @@ return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : ac_cv_c_const=yes -else +else $as_nop ac_cv_c_const=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_const" >&5 -$as_echo "$ac_cv_c_const" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_const" >&5 +printf "%s\n" "$ac_cv_c_const" >&6; } if test $ac_cv_c_const = no; then -$as_echo "#define const /**/" >>confdefs.h +printf "%s\n" "#define const /**/" >>confdefs.h fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for uid_t in sys/types.h" >&5 -$as_echo_n "checking for uid_t in sys/types.h... " >&6; } -if ${ac_cv_type_uid_t+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for uid_t in sys/types.h" >&5 +printf %s "checking for uid_t in sys/types.h... " >&6; } +if test ${ac_cv_type_uid_t+y} +then : + printf %s "(cached) " >&6 +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "uid_t" >/dev/null 2>&1; then : + $EGREP "uid_t" >/dev/null 2>&1 +then : ac_cv_type_uid_t=yes -else +else $as_nop ac_cv_type_uid_t=no fi -rm -f conftest* +rm -rf conftest* fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_uid_t" >&5 -$as_echo "$ac_cv_type_uid_t" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_uid_t" >&5 +printf "%s\n" "$ac_cv_type_uid_t" >&6; } if test $ac_cv_type_uid_t = no; then -$as_echo "#define uid_t int" >>confdefs.h +printf "%s\n" "#define uid_t int" >>confdefs.h -$as_echo "#define gid_t int" >>confdefs.h +printf "%s\n" "#define gid_t int" >>confdefs.h fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for inline" >&5 -$as_echo_n "checking for inline... " >&6; } -if ${ac_cv_c_inline+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for inline" >&5 +printf %s "checking for inline... " >&6; } +if test ${ac_cv_c_inline+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_cv_c_inline=no for ac_kw in inline __inline__ __inline; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifndef __cplusplus typedef int foo_t; -static $ac_kw foo_t static_foo () {return 0; } -$ac_kw foo_t foo () {return 0; } +static $ac_kw foo_t static_foo (void) {return 0; } +$ac_kw foo_t foo (void) {return 0; } #endif _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : ac_cv_c_inline=$ac_kw fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext test "$ac_cv_c_inline" != no && break done fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_inline" >&5 -$as_echo "$ac_cv_c_inline" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_inline" >&5 +printf "%s\n" "$ac_cv_c_inline" >&6; } case $ac_cv_c_inline in inline | yes) ;; @@ -15836,11 +17056,12 @@ esac - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for long double with more range or precision than double" >&5 -$as_echo_n "checking for long double with more range or precision than double... " >&6; } -if ${ac_cv_type_long_double_wider+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for long double with more range or precision than double" >&5 +printf %s "checking for long double with more range or precision than double... " >&6; } +if test ${ac_cv_type_long_double_wider+y} +then : + printf %s "(cached) " >&6 +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include @@ -15857,7 +17078,7 @@ } int -main () +main (void) { static int test_array [1 - 2 * !((0 < ((DBL_MAX_EXP < LDBL_MAX_EXP) + (DBL_MANT_DIG < LDBL_MANT_DIG) @@ -15872,71 +17093,94 @@ return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : ac_cv_type_long_double_wider=yes -else +else $as_nop ac_cv_type_long_double_wider=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_long_double_wider" >&5 -$as_echo "$ac_cv_type_long_double_wider" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_long_double_wider" >&5 +printf "%s\n" "$ac_cv_type_long_double_wider" >&6; } if test $ac_cv_type_long_double_wider = yes; then -$as_echo "#define HAVE_LONG_DOUBLE_WIDER 1" >>confdefs.h +printf "%s\n" "#define HAVE_LONG_DOUBLE_WIDER 1" >>confdefs.h fi ac_fn_c_check_type "$LINENO" "mode_t" "ac_cv_type_mode_t" "$ac_includes_default" -if test "x$ac_cv_type_mode_t" = xyes; then : +if test "x$ac_cv_type_mode_t" = xyes +then : -else +else $as_nop -cat >>confdefs.h <<_ACEOF -#define mode_t int -_ACEOF +printf "%s\n" "#define mode_t int" >>confdefs.h fi ac_fn_c_check_type "$LINENO" "off_t" "ac_cv_type_off_t" "$ac_includes_default" -if test "x$ac_cv_type_off_t" = xyes; then : +if test "x$ac_cv_type_off_t" = xyes +then : -else +else $as_nop -cat >>confdefs.h <<_ACEOF -#define off_t long int -_ACEOF +printf "%s\n" "#define off_t long int" >>confdefs.h fi -ac_fn_c_check_type "$LINENO" "pid_t" "ac_cv_type_pid_t" "$ac_includes_default" -if test "x$ac_cv_type_pid_t" = xyes; then : -else + ac_fn_c_check_type "$LINENO" "pid_t" "ac_cv_type_pid_t" "$ac_includes_default +" +if test "x$ac_cv_type_pid_t" = xyes +then : + +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #if defined _WIN64 && !defined __CYGWIN__ + LLP64 + #endif + +int +main (void) +{ + + ; + return 0; +} -cat >>confdefs.h <<_ACEOF -#define pid_t int _ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_pid_type='int' +else $as_nop + ac_pid_type='__int64' +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + +printf "%s\n" "#define pid_t $ac_pid_type" >>confdefs.h + fi + ac_fn_c_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default" -if test "x$ac_cv_type_size_t" = xyes; then : +if test "x$ac_cv_type_size_t" = xyes +then : -else +else $as_nop -cat >>confdefs.h <<_ACEOF -#define size_t unsigned int -_ACEOF +printf "%s\n" "#define size_t unsigned int" >>confdefs.h fi ac_fn_c_check_member "$LINENO" "struct stat" "st_blksize" "ac_cv_member_struct_stat_st_blksize" "$ac_includes_default" -if test "x$ac_cv_member_struct_stat_st_blksize" = xyes; then : +if test "x$ac_cv_member_struct_stat_st_blksize" = xyes +then : -cat >>confdefs.h <<_ACEOF -#define HAVE_STRUCT_STAT_ST_BLKSIZE 1 -_ACEOF +printf "%s\n" "#define HAVE_STRUCT_STAT_ST_BLKSIZE 1" >>confdefs.h fi @@ -15944,95 +17188,67 @@ ac_fn_c_check_member "$LINENO" "struct ucred" "uid" "ac_cv_member_struct_ucred_uid" "#include #include " -if test "x$ac_cv_member_struct_ucred_uid" = xyes; then : +if test "x$ac_cv_member_struct_ucred_uid" = xyes +then : -cat >>confdefs.h <<_ACEOF -#define HAVE_STRUCT_UCRED_UID 1 -_ACEOF +printf "%s\n" "#define HAVE_STRUCT_UCRED_UID 1" >>confdefs.h fi ac_fn_c_check_member "$LINENO" "struct ucred" "cr_uid" "ac_cv_member_struct_ucred_cr_uid" "#include #include " -if test "x$ac_cv_member_struct_ucred_cr_uid" = xyes; then : +if test "x$ac_cv_member_struct_ucred_cr_uid" = xyes +then : -cat >>confdefs.h <<_ACEOF -#define HAVE_STRUCT_UCRED_CR_UID 1 -_ACEOF +printf "%s\n" "#define HAVE_STRUCT_UCRED_CR_UID 1" >>confdefs.h fi ac_fn_c_check_member "$LINENO" "struct sockpeercred" "uid" "ac_cv_member_struct_sockpeercred_uid" "#include #include " -if test "x$ac_cv_member_struct_sockpeercred_uid" = xyes; then : +if test "x$ac_cv_member_struct_sockpeercred_uid" = xyes +then : -cat >>confdefs.h <<_ACEOF -#define HAVE_STRUCT_SOCKPEERCRED_UID 1 -_ACEOF +printf "%s\n" "#define HAVE_STRUCT_SOCKPEERCRED_UID 1" >>confdefs.h fi ac_fn_c_check_member "$LINENO" "struct ifreq" "ifr_ifru.ifru_hwaddr" "ac_cv_member_struct_ifreq_ifr_ifru_ifru_hwaddr" "#include " -if test "x$ac_cv_member_struct_ifreq_ifr_ifru_ifru_hwaddr" = xyes; then : +if test "x$ac_cv_member_struct_ifreq_ifr_ifru_ifru_hwaddr" = xyes +then : -cat >>confdefs.h <<_ACEOF -#define HAVE_STRUCT_IFREQ_IFR_IFRU_IFRU_HWADDR 1 -_ACEOF +printf "%s\n" "#define HAVE_STRUCT_IFREQ_IFR_IFRU_IFRU_HWADDR 1" >>confdefs.h fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether time.h and sys/time.h may both be included" >&5 -$as_echo_n "checking whether time.h and sys/time.h may both be included... " >&6; } -if ${ac_cv_header_time+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -#include -#include -int -main () -{ -if ((struct tm *) 0) -return 0; - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_header_time=yes -else - ac_cv_header_time=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_time" >&5 -$as_echo "$ac_cv_header_time" >&6; } -if test $ac_cv_header_time = yes; then -$as_echo "#define TIME_WITH_SYS_TIME 1" >>confdefs.h +# Obsolete code to be removed. +if test $ac_cv_header_sys_time_h = yes; then + +printf "%s\n" "#define TIME_WITH_SYS_TIME 1" >>confdefs.h fi +# End of obsolete code. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether struct tm is in sys/time.h or time.h" >&5 -$as_echo_n "checking whether struct tm is in sys/time.h or time.h... " >&6; } -if ${ac_cv_struct_tm+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether struct tm is in sys/time.h or time.h" >&5 +printf %s "checking whether struct tm is in sys/time.h or time.h... " >&6; } +if test ${ac_cv_struct_tm+y} +then : + printf %s "(cached) " >&6 +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int -main () +main (void) { struct tm tm; int *p = &tm.tm_sec; @@ -16041,31 +17257,33 @@ return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : ac_cv_struct_tm=time.h -else +else $as_nop ac_cv_struct_tm=sys/time.h fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_struct_tm" >&5 -$as_echo "$ac_cv_struct_tm" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_struct_tm" >&5 +printf "%s\n" "$ac_cv_struct_tm" >&6; } if test $ac_cv_struct_tm = sys/time.h; then -$as_echo "#define TM_IN_SYS_TIME 1" >>confdefs.h +printf "%s\n" "#define TM_IN_SYS_TIME 1" >>confdefs.h fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for working volatile" >&5 -$as_echo_n "checking for working volatile... " >&6; } -if ${ac_cv_c_volatile+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for working volatile" >&5 +printf %s "checking for working volatile... " >&6; } +if test ${ac_cv_c_volatile+y} +then : + printf %s "(cached) " >&6 +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int -main () +main (void) { volatile int x; @@ -16075,27 +17293,27 @@ return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : ac_cv_c_volatile=yes -else +else $as_nop ac_cv_c_volatile=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_volatile" >&5 -$as_echo "$ac_cv_c_volatile" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_volatile" >&5 +printf "%s\n" "$ac_cv_c_volatile" >&6; } if test $ac_cv_c_volatile = no; then -$as_echo "#define volatile /**/" >>confdefs.h +printf "%s\n" "#define volatile /**/" >>confdefs.h fi ac_fn_c_check_type "$LINENO" "ptrdiff_t" "ac_cv_type_ptrdiff_t" "$ac_includes_default" -if test "x$ac_cv_type_ptrdiff_t" = xyes; then : +if test "x$ac_cv_type_ptrdiff_t" = xyes +then : -cat >>confdefs.h <<_ACEOF -#define HAVE_PTRDIFF_T 1 -_ACEOF +printf "%s\n" "#define HAVE_PTRDIFF_T 1" >>confdefs.h fi @@ -16103,69 +17321,61 @@ stat_nsec_found=no ac_fn_c_check_member "$LINENO" "struct stat" "st_mtim" "ac_cv_member_struct_stat_st_mtim" "#include " -if test "x$ac_cv_member_struct_stat_st_mtim" = xyes; then : +if test "x$ac_cv_member_struct_stat_st_mtim" = xyes +then : -cat >>confdefs.h <<_ACEOF -#define HAVE_STRUCT_STAT_ST_MTIM 1 -_ACEOF +printf "%s\n" "#define HAVE_STRUCT_STAT_ST_MTIM 1" >>confdefs.h stat_nsec_found=yes fi ac_fn_c_check_member "$LINENO" "struct stat" "st_mtimensec" "ac_cv_member_struct_stat_st_mtimensec" "#include " -if test "x$ac_cv_member_struct_stat_st_mtimensec" = xyes; then : +if test "x$ac_cv_member_struct_stat_st_mtimensec" = xyes +then : -cat >>confdefs.h <<_ACEOF -#define HAVE_STRUCT_STAT_ST_MTIMENSEC 1 -_ACEOF +printf "%s\n" "#define HAVE_STRUCT_STAT_ST_MTIMENSEC 1" >>confdefs.h stat_nsec_found=yes fi ac_fn_c_check_member "$LINENO" "struct stat" "st_mtimespec" "ac_cv_member_struct_stat_st_mtimespec" "#include " -if test "x$ac_cv_member_struct_stat_st_mtimespec" = xyes; then : +if test "x$ac_cv_member_struct_stat_st_mtimespec" = xyes +then : -cat >>confdefs.h <<_ACEOF -#define HAVE_STRUCT_STAT_ST_MTIMESPEC 1 -_ACEOF +printf "%s\n" "#define HAVE_STRUCT_STAT_ST_MTIMESPEC 1" >>confdefs.h stat_nsec_found=yes fi if test "${stat_nsec_found}" != yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Cannot determine nanosecond field of struct stat" >&5 -$as_echo "$as_me: WARNING: Cannot determine nanosecond field of struct stat" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: Cannot determine nanosecond field of struct stat" >&5 +printf "%s\n" "$as_me: WARNING: Cannot determine nanosecond field of struct stat" >&2;} fi # Checks for library functions. -for ac_header in unistd.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "unistd.h" "ac_cv_header_unistd_h" "$ac_includes_default" -if test "x$ac_cv_header_unistd_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_UNISTD_H 1 -_ACEOF - -fi - -done - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for working chown" >&5 -$as_echo_n "checking for working chown... " >&6; } -if ${ac_cv_func_chown_works+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test "$cross_compiling" = yes; then : - ac_cv_func_chown_works=no -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for working chown" >&5 +printf %s "checking for working chown... " >&6; } +if test ${ac_cv_func_chown_works+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test "$cross_compiling" = yes +then : + case "$host_os" in # (( + # Guess yes on glibc systems. + *-gnu*) ac_cv_func_chown_works=yes ;; + # If we don't know, assume the worst. + *) ac_cv_func_chown_works=no ;; + esac +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default #include int -main () +main (void) { char *f = "conftest.chown"; struct stat before, after; @@ -16184,9 +17394,10 @@ return 0; } _ACEOF -if ac_fn_c_try_run "$LINENO"; then : +if ac_fn_c_try_run "$LINENO" +then : ac_cv_func_chown_works=yes -else +else $as_nop ac_cv_func_chown_works=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ @@ -16196,82 +17407,79 @@ rm -f conftest.chown fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_chown_works" >&5 -$as_echo "$ac_cv_func_chown_works" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_chown_works" >&5 +printf "%s\n" "$ac_cv_func_chown_works" >&6; } if test $ac_cv_func_chown_works = yes; then -$as_echo "#define HAVE_CHOWN 1" >>confdefs.h +printf "%s\n" "#define HAVE_CHOWN 1" >>confdefs.h fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether closedir returns void" >&5 -$as_echo_n "checking whether closedir returns void... " >&6; } -if ${ac_cv_func_closedir_void+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test "$cross_compiling" = yes; then : - ac_cv_func_closedir_void=yes -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether closedir returns void" >&5 +printf %s "checking whether closedir returns void... " >&6; } +if test ${ac_cv_func_closedir_void+y} +then : + printf %s "(cached) " >&6 +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -$ac_includes_default + #include <$ac_header_dirent> -#ifndef __cplusplus -int closedir (); -#endif int -main () +main (void) { -return closedir (opendir (".")) != 0; + + return closedir(0); + ; return 0; } _ACEOF -if ac_fn_c_try_run "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : ac_cv_func_closedir_void=no -else +else $as_nop ac_cv_func_closedir_void=yes fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext -fi - +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_closedir_void" >&5 -$as_echo "$ac_cv_func_closedir_void" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_closedir_void" >&5 +printf "%s\n" "$ac_cv_func_closedir_void" >&6; } if test $ac_cv_func_closedir_void = yes; then -$as_echo "#define CLOSEDIR_VOID 1" >>confdefs.h +printf "%s\n" "#define CLOSEDIR_VOID 1" >>confdefs.h fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for error_at_line" >&5 -$as_echo_n "checking for error_at_line... " >&6; } -if ${ac_cv_lib_error_at_line+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for error_at_line" >&5 +printf %s "checking for error_at_line... " >&6; } +if test ${ac_cv_lib_error_at_line+y} +then : + printf %s "(cached) " >&6 +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int -main () +main (void) { error_at_line (0, 0, "", 0, "an error occurred"); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_error_at_line=yes -else +else $as_nop ac_cv_lib_error_at_line=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_error_at_line" >&5 -$as_echo "$ac_cv_lib_error_at_line" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_error_at_line" >&5 +printf "%s\n" "$ac_cv_lib_error_at_line" >&6; } if test $ac_cv_lib_error_at_line = no; then case " $LIBOBJS " in *" error.$ac_objext "* ) ;; @@ -16281,44 +17489,42 @@ fi -for ac_header in vfork.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "vfork.h" "ac_cv_header_vfork_h" "$ac_includes_default" -if test "x$ac_cv_header_vfork_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_VFORK_H 1 -_ACEOF +ac_fn_c_check_header_compile "$LINENO" "vfork.h" "ac_cv_header_vfork_h" "$ac_includes_default" +if test "x$ac_cv_header_vfork_h" = xyes +then : + printf "%s\n" "#define HAVE_VFORK_H 1" >>confdefs.h fi -done +ac_fn_c_check_func "$LINENO" "fork" "ac_cv_func_fork" +if test "x$ac_cv_func_fork" = xyes +then : + printf "%s\n" "#define HAVE_FORK 1" >>confdefs.h -for ac_func in fork vfork -do : - as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" -if eval test \"x\$"$as_ac_var"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF +fi +ac_fn_c_check_func "$LINENO" "vfork" "ac_cv_func_vfork" +if test "x$ac_cv_func_vfork" = xyes +then : + printf "%s\n" "#define HAVE_VFORK 1" >>confdefs.h fi -done if test "x$ac_cv_func_fork" = xyes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working fork" >&5 -$as_echo_n "checking for working fork... " >&6; } -if ${ac_cv_func_fork_works+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test "$cross_compiling" = yes; then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for working fork" >&5 +printf %s "checking for working fork... " >&6; } +if test ${ac_cv_func_fork_works+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test "$cross_compiling" = yes +then : ac_cv_func_fork_works=cross -else +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default int -main () +main (void) { /* By Ruediger Kuhlmann. */ @@ -16328,9 +17534,10 @@ return 0; } _ACEOF -if ac_fn_c_try_run "$LINENO"; then : +if ac_fn_c_try_run "$LINENO" +then : ac_cv_func_fork_works=yes -else +else $as_nop ac_cv_func_fork_works=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ @@ -16338,8 +17545,8 @@ fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_fork_works" >&5 -$as_echo "$ac_cv_func_fork_works" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_fork_works" >&5 +printf "%s\n" "$ac_cv_func_fork_works" >&6; } else ac_cv_func_fork_works=$ac_cv_func_fork @@ -16354,27 +17561,37 @@ ac_cv_func_fork_works=yes ;; esac - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: result $ac_cv_func_fork_works guessed because of cross compilation" >&5 -$as_echo "$as_me: WARNING: result $ac_cv_func_fork_works guessed because of cross compilation" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: result $ac_cv_func_fork_works guessed because of cross compilation" >&5 +printf "%s\n" "$as_me: WARNING: result $ac_cv_func_fork_works guessed because of cross compilation" >&2;} fi ac_cv_func_vfork_works=$ac_cv_func_vfork if test "x$ac_cv_func_vfork" = xyes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working vfork" >&5 -$as_echo_n "checking for working vfork... " >&6; } -if ${ac_cv_func_vfork_works+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test "$cross_compiling" = yes; then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for working vfork" >&5 +printf %s "checking for working vfork... " >&6; } +if test ${ac_cv_func_vfork_works+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test "$cross_compiling" = yes +then : ac_cv_func_vfork_works=cross -else +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Thanks to Paul Eggert for this test. */ $ac_includes_default +#include #include #ifdef HAVE_VFORK_H # include #endif + +static void +do_nothing (int sig) +{ + (void) sig; +} + /* On some sparc systems, changes by the child to local and incoming argument registers are propagated back to the parent. The compiler is told about this with #include , but some compilers @@ -16382,11 +17599,7 @@ static variable whose address is put into a register that is clobbered by the vfork. */ static void -#ifdef __cplusplus sparc_address_test (int arg) -# else -sparc_address_test (arg) int arg; -#endif { static pid_t child; if (!child) { @@ -16404,13 +17617,18 @@ } int -main () +main (void) { pid_t parent = getpid (); pid_t child; sparc_address_test (0); + /* On Solaris 2.4, changes by the child to the signal handler + also munge signal handlers in the parent. To detect this, + start by putting the parent's handler in a known state. */ + signal (SIGTERM, SIG_DFL); + child = vfork (); if (child == 0) { @@ -16432,6 +17650,10 @@ || p != p5 || p != p6 || p != p7) _exit(1); + /* Alter the child's signal handler. */ + if (signal (SIGTERM, do_nothing) != SIG_DFL) + _exit(1); + /* On some systems (e.g. IRIX 3.3), vfork doesn't separate parent from child file descriptors. If the child closes a descriptor before it execs or exits, this munges the parent's descriptor @@ -16447,6 +17669,9 @@ /* Was there some problem with vforking? */ child < 0 + /* Did the child munge the parent's signal handler? */ + || signal (SIGTERM, SIG_DFL) != SIG_DFL + /* Did the child fail? (This shouldn't happen.) */ || status @@ -16459,9 +17684,10 @@ } } _ACEOF -if ac_fn_c_try_run "$LINENO"; then : +if ac_fn_c_try_run "$LINENO" +then : ac_cv_func_vfork_works=yes -else +else $as_nop ac_cv_func_vfork_works=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ @@ -16469,45 +17695,46 @@ fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_vfork_works" >&5 -$as_echo "$ac_cv_func_vfork_works" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_vfork_works" >&5 +printf "%s\n" "$ac_cv_func_vfork_works" >&6; } fi; if test "x$ac_cv_func_fork_works" = xcross; then ac_cv_func_vfork_works=$ac_cv_func_vfork - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: result $ac_cv_func_vfork_works guessed because of cross compilation" >&5 -$as_echo "$as_me: WARNING: result $ac_cv_func_vfork_works guessed because of cross compilation" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: result $ac_cv_func_vfork_works guessed because of cross compilation" >&5 +printf "%s\n" "$as_me: WARNING: result $ac_cv_func_vfork_works guessed because of cross compilation" >&2;} fi if test "x$ac_cv_func_vfork_works" = xyes; then -$as_echo "#define HAVE_WORKING_VFORK 1" >>confdefs.h +printf "%s\n" "#define HAVE_WORKING_VFORK 1" >>confdefs.h else -$as_echo "#define vfork fork" >>confdefs.h +printf "%s\n" "#define vfork fork" >>confdefs.h fi if test "x$ac_cv_func_fork_works" = xyes; then -$as_echo "#define HAVE_WORKING_FORK 1" >>confdefs.h +printf "%s\n" "#define HAVE_WORKING_FORK 1" >>confdefs.h PBX_WORKING_FORK=1 fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for _LARGEFILE_SOURCE value needed for large files" >&5 -$as_echo_n "checking for _LARGEFILE_SOURCE value needed for large files... " >&6; } -if ${ac_cv_sys_largefile_source+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for _LARGEFILE_SOURCE value needed for large files" >&5 +printf %s "checking for _LARGEFILE_SOURCE value needed for large files... " >&6; } +if test ${ac_cv_sys_largefile_source+y} +then : + printf %s "(cached) " >&6 +else $as_nop while :; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include /* for off_t */ #include int -main () +main (void) { int (*fp) (FILE *, off_t, int) = fseeko; return fseeko (stdin, 0, 0) && fp (stdin, 0, 0); @@ -16515,10 +17742,11 @@ return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_sys_largefile_source=no; break fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -16526,7 +17754,7 @@ #include /* for off_t */ #include int -main () +main (void) { int (*fp) (FILE *, off_t, int) = fseeko; return fseeko (stdin, 0, 0) && fp (stdin, 0, 0); @@ -16534,23 +17762,22 @@ return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_sys_largefile_source=1; break fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext ac_cv_sys_largefile_source=unknown break done fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_largefile_source" >&5 -$as_echo "$ac_cv_sys_largefile_source" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_largefile_source" >&5 +printf "%s\n" "$ac_cv_sys_largefile_source" >&6; } case $ac_cv_sys_largefile_source in #( no | unknown) ;; *) -cat >>confdefs.h <<_ACEOF -#define _LARGEFILE_SOURCE $ac_cv_sys_largefile_source -_ACEOF +printf "%s\n" "#define _LARGEFILE_SOURCE $ac_cv_sys_largefile_source" >>confdefs.h ;; esac rm -rf conftest* @@ -16560,16 +17787,17 @@ # If you want fseeko and ftello with glibc, upgrade to a fixed glibc. if test $ac_cv_sys_largefile_source != unknown; then -$as_echo "#define HAVE_FSEEKO 1" >>confdefs.h +printf "%s\n" "#define HAVE_FSEEKO 1" >>confdefs.h fi if test $ac_cv_c_compiler_gnu = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC needs -traditional" >&5 -$as_echo_n "checking whether $CC needs -traditional... " >&6; } -if ${ac_cv_prog_gcc_traditional+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC needs -traditional" >&5 +printf %s "checking whether $CC needs -traditional... " >&6; } +if test ${ac_cv_prog_gcc_traditional+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_pattern="Autoconf.*'x'" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -16577,12 +17805,13 @@ Autoconf TIOCGETP _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "$ac_pattern" >/dev/null 2>&1; then : + $EGREP "$ac_pattern" >/dev/null 2>&1 +then : ac_cv_prog_gcc_traditional=yes -else +else $as_nop ac_cv_prog_gcc_traditional=no fi -rm -f conftest* +rm -rf conftest* if test $ac_cv_prog_gcc_traditional = no; then @@ -16592,15 +17821,16 @@ Autoconf TCGETA _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "$ac_pattern" >/dev/null 2>&1; then : + $EGREP "$ac_pattern" >/dev/null 2>&1 +then : ac_cv_prog_gcc_traditional=yes fi -rm -f conftest* +rm -rf conftest* fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_gcc_traditional" >&5 -$as_echo "$ac_cv_prog_gcc_traditional" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_gcc_traditional" >&5 +printf "%s\n" "$ac_cv_prog_gcc_traditional" >&6; } if test $ac_cv_prog_gcc_traditional = yes; then CC="$CC -traditional" fi @@ -16610,19 +17840,21 @@ # acts exactly like glibc's or not # AC_FUNC_MALLOC # AC_FUNC_REALLOC -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for working memcmp" >&5 -$as_echo_n "checking for working memcmp... " >&6; } -if ${ac_cv_func_memcmp_working+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test "$cross_compiling" = yes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for working memcmp" >&5 +printf %s "checking for working memcmp... " >&6; } +if test ${ac_cv_func_memcmp_working+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test "$cross_compiling" = yes +then : ac_cv_func_memcmp_working=no -else +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default int -main () +main (void) { /* Some versions of memcmp are not 8-bit clean. */ @@ -16653,9 +17885,10 @@ return 0; } _ACEOF -if ac_fn_c_try_run "$LINENO"; then : +if ac_fn_c_try_run "$LINENO" +then : ac_cv_func_memcmp_working=yes -else +else $as_nop ac_cv_func_memcmp_working=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ @@ -16663,8 +17896,8 @@ fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_memcmp_working" >&5 -$as_echo "$ac_cv_func_memcmp_working" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_memcmp_working" >&5 +printf "%s\n" "$ac_cv_func_memcmp_working" >&6; } test $ac_cv_func_memcmp_working = no && case " $LIBOBJS " in *" memcmp.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS memcmp.$ac_objext" @@ -16673,48 +17906,36 @@ - - - for ac_header in $ac_header_list -do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default -" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - -fi - +ac_func= +for ac_item in $ac_func_c_list +do + if test $ac_func; then + ac_fn_c_check_func "$LINENO" $ac_func ac_cv_func_$ac_func + if eval test \"x\$ac_cv_func_$ac_func\" = xyes; then + echo "#define $ac_item 1" >> confdefs.h + fi + ac_func= + else + ac_func=$ac_item + fi done - - - - - - -for ac_func in getpagesize -do : - ac_fn_c_check_func "$LINENO" "getpagesize" "ac_cv_func_getpagesize" -if test "x$ac_cv_func_getpagesize" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_GETPAGESIZE 1 -_ACEOF - -fi -done - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for working mmap" >&5 -$as_echo_n "checking for working mmap... " >&6; } -if ${ac_cv_func_mmap_fixed_mapped+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test "$cross_compiling" = yes; then : - ac_cv_func_mmap_fixed_mapped=no -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for working mmap" >&5 +printf %s "checking for working mmap... " >&6; } +if test ${ac_cv_func_mmap_fixed_mapped+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test "$cross_compiling" = yes +then : + case "$host_os" in # (( + # Guess yes on platforms where we know the result. + linux*) ac_cv_func_mmap_fixed_mapped=yes ;; + # If we don't know, assume the worst. + *) ac_cv_func_mmap_fixed_mapped=no ;; + esac +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default @@ -16746,10 +17967,6 @@ #include #include -#if !defined STDC_HEADERS && !defined HAVE_STDLIB_H -char *malloc (); -#endif - /* This mess was copied from the GNU getpagesize.h. */ #ifndef HAVE_GETPAGESIZE # ifdef _SC_PAGESIZE @@ -16783,7 +18000,7 @@ #endif /* no HAVE_GETPAGESIZE */ int -main () +main (void) { char *data, *data2, *data3; const char *cdata2; @@ -16851,12 +18068,15 @@ if (*(data + i) != *(data3 + i)) return 14; close (fd); + free (data); + free (data3); return 0; } _ACEOF -if ac_fn_c_try_run "$LINENO"; then : +if ac_fn_c_try_run "$LINENO" +then : ac_cv_func_mmap_fixed_mapped=yes -else +else $as_nop ac_cv_func_mmap_fixed_mapped=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ @@ -16864,34 +18084,26 @@ fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_mmap_fixed_mapped" >&5 -$as_echo "$ac_cv_func_mmap_fixed_mapped" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_mmap_fixed_mapped" >&5 +printf "%s\n" "$ac_cv_func_mmap_fixed_mapped" >&6; } if test $ac_cv_func_mmap_fixed_mapped = yes; then -$as_echo "#define HAVE_MMAP 1" >>confdefs.h +printf "%s\n" "#define HAVE_MMAP 1" >>confdefs.h fi rm -f conftest.mmap conftest.txt -for ac_header in sys/select.h sys/socket.h -do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF -fi -done -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking types of arguments for select" >&5 -$as_echo_n "checking types of arguments for select... " >&6; } -if ${ac_cv_func_select_args+:} false; then : - $as_echo_n "(cached) " >&6 -else - for ac_arg234 in 'fd_set *' 'int *' 'void *'; do +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking types of arguments for select" >&5 +printf %s "checking types of arguments for select... " >&6; } +if test ${ac_cv_func_select_args+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_cv_func_select_args='int,int *,struct timeval *' +for ac_arg234 in 'fd_set *' 'int *' 'void *'; do for ac_arg1 in 'int' 'size_t' 'unsigned long int' 'unsigned int'; do for ac_arg5 in 'struct timeval *' 'const struct timeval *'; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -16905,7 +18117,7 @@ #endif int -main () +main (void) { extern int select ($ac_arg1, $ac_arg234, $ac_arg234, $ac_arg234, @@ -16914,56 +18126,56 @@ return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : ac_cv_func_select_args="$ac_arg1,$ac_arg234,$ac_arg5"; break 3 fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext done done done -# Provide a safe default value. -: "${ac_cv_func_select_args=int,int *,struct timeval *}" fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_select_args" >&5 -$as_echo "$ac_cv_func_select_args" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_select_args" >&5 +printf "%s\n" "$ac_cv_func_select_args" >&6; } ac_save_IFS=$IFS; IFS=',' set dummy `echo "$ac_cv_func_select_args" | sed 's/\*/\*/g'` IFS=$ac_save_IFS shift -cat >>confdefs.h <<_ACEOF -#define SELECT_TYPE_ARG1 $1 -_ACEOF +printf "%s\n" "#define SELECT_TYPE_ARG1 $1" >>confdefs.h -cat >>confdefs.h <<_ACEOF -#define SELECT_TYPE_ARG234 ($2) -_ACEOF +printf "%s\n" "#define SELECT_TYPE_ARG234 ($2)" >>confdefs.h -cat >>confdefs.h <<_ACEOF -#define SELECT_TYPE_ARG5 ($3) -_ACEOF +printf "%s\n" "#define SELECT_TYPE_ARG5 ($3)" >>confdefs.h -rm -f conftest* +rm -rf conftest* -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether lstat correctly handles trailing slash" >&5 -$as_echo_n "checking whether lstat correctly handles trailing slash... " >&6; } -if ${ac_cv_func_lstat_dereferences_slashed_symlink+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether lstat correctly handles trailing slash" >&5 +printf %s "checking whether lstat correctly handles trailing slash... " >&6; } +if test ${ac_cv_func_lstat_dereferences_slashed_symlink+y} +then : + printf %s "(cached) " >&6 +else $as_nop rm -f conftest.sym conftest.file echo >conftest.file if test "$as_ln_s" = "ln -s" && ln -s conftest.file conftest.sym; then - if test "$cross_compiling" = yes; then : - ac_cv_func_lstat_dereferences_slashed_symlink=no -else + if test "$cross_compiling" = yes +then : + case "$host_os" in # (( + # Guess yes on glibc systems. + *-gnu*) ac_cv_func_lstat_dereferences_slashed_symlink=yes ;; + # If we don't know, assume the worst. + *) ac_cv_func_lstat_dereferences_slashed_symlink=no ;; + esac +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default int -main () +main (void) { struct stat sbuf; /* Linux will dereference the symlink and fail, as required by POSIX. @@ -16974,9 +18186,10 @@ return 0; } _ACEOF -if ac_fn_c_try_run "$LINENO"; then : +if ac_fn_c_try_run "$LINENO" +then : ac_cv_func_lstat_dereferences_slashed_symlink=yes -else +else $as_nop ac_cv_func_lstat_dereferences_slashed_symlink=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ @@ -16991,14 +18204,12 @@ rm -f conftest.sym conftest.file fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_lstat_dereferences_slashed_symlink" >&5 -$as_echo "$ac_cv_func_lstat_dereferences_slashed_symlink" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_lstat_dereferences_slashed_symlink" >&5 +printf "%s\n" "$ac_cv_func_lstat_dereferences_slashed_symlink" >&6; } test $ac_cv_func_lstat_dereferences_slashed_symlink = yes && -cat >>confdefs.h <<_ACEOF -#define LSTAT_FOLLOWS_SLASHED_SYMLINK 1 -_ACEOF +printf "%s\n" "#define LSTAT_FOLLOWS_SLASHED_SYMLINK 1" >>confdefs.h if test "x$ac_cv_func_lstat_dereferences_slashed_symlink" = xno; then @@ -17010,19 +18221,21 @@ fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stat accepts an empty string" >&5 -$as_echo_n "checking whether stat accepts an empty string... " >&6; } -if ${ac_cv_func_stat_empty_string_bug+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test "$cross_compiling" = yes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether stat accepts an empty string" >&5 +printf %s "checking whether stat accepts an empty string... " >&6; } +if test ${ac_cv_func_stat_empty_string_bug+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test "$cross_compiling" = yes +then : ac_cv_func_stat_empty_string_bug=yes -else +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default int -main () +main (void) { struct stat sbuf; return stat ("", &sbuf) == 0; @@ -17030,9 +18243,10 @@ return 0; } _ACEOF -if ac_fn_c_try_run "$LINENO"; then : +if ac_fn_c_try_run "$LINENO" +then : ac_cv_func_stat_empty_string_bug=no -else +else $as_nop ac_cv_func_stat_empty_string_bug=yes fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ @@ -17040,8 +18254,8 @@ fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_stat_empty_string_bug" >&5 -$as_echo "$ac_cv_func_stat_empty_string_bug" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_stat_empty_string_bug" >&5 +printf "%s\n" "$ac_cv_func_stat_empty_string_bug" >&6; } if test $ac_cv_func_stat_empty_string_bug = yes; then case " $LIBOBJS " in *" stat.$ac_objext "* ) ;; @@ -17050,25 +18264,30 @@ esac -cat >>confdefs.h <<_ACEOF -#define HAVE_STAT_EMPTY_STRING_BUG 1 -_ACEOF +printf "%s\n" "#define HAVE_STAT_EMPTY_STRING_BUG 1" >>confdefs.h fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for working strcoll" >&5 -$as_echo_n "checking for working strcoll... " >&6; } -if ${ac_cv_func_strcoll_works+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test "$cross_compiling" = yes; then : - ac_cv_func_strcoll_works=no -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for working strcoll" >&5 +printf %s "checking for working strcoll... " >&6; } +if test ${ac_cv_func_strcoll_works+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test "$cross_compiling" = yes +then : + case "$host_os" in # (( + # Guess yes on glibc systems. + *-gnu*) ac_cv_func_strcoll_works=yes ;; + # If we don't know, assume the worst. + *) ac_cv_func_strcoll_works=no ;; + esac +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default int -main () +main (void) { return (strcoll ("abc", "def") >= 0 || strcoll ("ABC", "DEF") >= 0 || @@ -17077,9 +18296,10 @@ return 0; } _ACEOF -if ac_fn_c_try_run "$LINENO"; then : +if ac_fn_c_try_run "$LINENO" +then : ac_cv_func_strcoll_works=yes -else +else $as_nop ac_cv_func_strcoll_works=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ @@ -17087,29 +18307,30 @@ fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_strcoll_works" >&5 -$as_echo "$ac_cv_func_strcoll_works" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_strcoll_works" >&5 +printf "%s\n" "$ac_cv_func_strcoll_works" >&6; } if test $ac_cv_func_strcoll_works = yes; then -$as_echo "#define HAVE_STRCOLL 1" >>confdefs.h +printf "%s\n" "#define HAVE_STRCOLL 1" >>confdefs.h fi -for ac_func in strftime + + for ac_func in strftime do : ac_fn_c_check_func "$LINENO" "strftime" "ac_cv_func_strftime" -if test "x$ac_cv_func_strftime" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_STRFTIME 1 -_ACEOF +if test "x$ac_cv_func_strftime" = xyes +then : + printf "%s\n" "#define HAVE_STRFTIME 1" >>confdefs.h -else +else $as_nop # strftime is in -lintl on SCO UNIX. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for strftime in -lintl" >&5 -$as_echo_n "checking for strftime in -lintl... " >&6; } -if ${ac_cv_lib_intl_strftime+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for strftime in -lintl" >&5 +printf %s "checking for strftime in -lintl... " >&6; } +if test ${ac_cv_lib_intl_strftime+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lintl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -17118,55 +18339,56 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char strftime (); int -main () +main (void) { return strftime (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_intl_strftime=yes -else +else $as_nop ac_cv_lib_intl_strftime=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_intl_strftime" >&5 -$as_echo "$ac_cv_lib_intl_strftime" >&6; } -if test "x$ac_cv_lib_intl_strftime" = xyes; then : - $as_echo "#define HAVE_STRFTIME 1" >>confdefs.h +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_intl_strftime" >&5 +printf "%s\n" "$ac_cv_lib_intl_strftime" >&6; } +if test "x$ac_cv_lib_intl_strftime" = xyes +then : + printf "%s\n" "#define HAVE_STRFTIME 1" >>confdefs.h LIBS="-lintl $LIBS" fi fi -done - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working strnlen" >&5 -$as_echo_n "checking for working strnlen... " >&6; } -if ${ac_cv_func_strnlen_working+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test "$cross_compiling" = yes; then : +done + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for working strnlen" >&5 +printf %s "checking for working strnlen... " >&6; } +if test ${ac_cv_func_strnlen_working+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test "$cross_compiling" = yes +then : # Guess no on AIX systems, yes otherwise. case "$host_os" in aix*) ac_cv_func_strnlen_working=no;; *) ac_cv_func_strnlen_working=yes;; esac -else +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default int -main () +main (void) { #define S "foobar" @@ -17188,9 +18410,10 @@ return 0; } _ACEOF -if ac_fn_c_try_run "$LINENO"; then : +if ac_fn_c_try_run "$LINENO" +then : ac_cv_func_strnlen_working=yes -else +else $as_nop ac_cv_func_strnlen_working=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ @@ -17198,8 +18421,8 @@ fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_strnlen_working" >&5 -$as_echo "$ac_cv_func_strnlen_working" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_strnlen_working" >&5 +printf "%s\n" "$ac_cv_func_strnlen_working" >&6; } test $ac_cv_func_strnlen_working = no && case " $LIBOBJS " in *" strnlen.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS strnlen.$ac_objext" @@ -17207,14 +18430,16 @@ esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for working strtod" >&5 -$as_echo_n "checking for working strtod... " >&6; } -if ${ac_cv_func_strtod+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test "$cross_compiling" = yes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for working strtod" >&5 +printf %s "checking for working strtod... " >&6; } +if test ${ac_cv_func_strtod+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test "$cross_compiling" = yes +then : ac_cv_func_strtod=no -else +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -17223,7 +18448,7 @@ double strtod (); #endif int -main() +main (void) { { /* Some versions of Linux strtod mis-parse strings with leading '+'. */ @@ -17248,9 +18473,10 @@ } _ACEOF -if ac_fn_c_try_run "$LINENO"; then : +if ac_fn_c_try_run "$LINENO" +then : ac_cv_func_strtod=yes -else +else $as_nop ac_cv_func_strtod=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ @@ -17258,8 +18484,8 @@ fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_strtod" >&5 -$as_echo "$ac_cv_func_strtod" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_strtod" >&5 +printf "%s\n" "$ac_cv_func_strtod" >&6; } if test $ac_cv_func_strtod = no; then case " $LIBOBJS " in *" strtod.$ac_objext "* ) ;; @@ -17268,16 +18494,18 @@ esac ac_fn_c_check_func "$LINENO" "pow" "ac_cv_func_pow" -if test "x$ac_cv_func_pow" = xyes; then : +if test "x$ac_cv_func_pow" = xyes +then : fi if test $ac_cv_func_pow = no; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pow in -lm" >&5 -$as_echo_n "checking for pow in -lm... " >&6; } -if ${ac_cv_lib_m_pow+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for pow in -lm" >&5 +printf %s "checking for pow in -lm... " >&6; } +if test ${ac_cv_lib_m_pow+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lm $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -17286,34 +18514,33 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char pow (); int -main () +main (void) { return pow (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_m_pow=yes -else +else $as_nop ac_cv_lib_m_pow=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_pow" >&5 -$as_echo "$ac_cv_lib_m_pow" >&6; } -if test "x$ac_cv_lib_m_pow" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_pow" >&5 +printf "%s\n" "$ac_cv_lib_m_pow" >&6; } +if test "x$ac_cv_lib_m_pow" = xyes +then : POW_LIB=-lm -else - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cannot find library containing definition of pow" >&5 -$as_echo "$as_me: WARNING: cannot find library containing definition of pow" >&2;} +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: cannot find library containing definition of pow" >&5 +printf "%s\n" "$as_me: WARNING: cannot find library containing definition of pow" >&2;} fi fi @@ -17322,17 +18549,18 @@ - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether utime accepts a null argument" >&5 -$as_echo_n "checking whether utime accepts a null argument... " >&6; } -if ${ac_cv_func_utime_null+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether utime accepts a null argument" >&5 +printf %s "checking whether utime accepts a null argument... " >&6; } +if test ${ac_cv_func_utime_null+y} +then : + printf %s "(cached) " >&6 +else $as_nop rm -f conftest.data; >conftest.data # Sequent interprets utime(file, 0) to mean use start of epoch. Wrong. -if test "$cross_compiling" = yes; then : +if test "$cross_compiling" = yes +then : ac_cv_func_utime_null='guessing yes' -else +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default @@ -17340,7 +18568,7 @@ # include #endif int -main () +main (void) { struct stat s, t; return ! (stat ("conftest.data", &s) == 0 @@ -17352,9 +18580,10 @@ return 0; } _ACEOF -if ac_fn_c_try_run "$LINENO"; then : +if ac_fn_c_try_run "$LINENO" +then : ac_cv_func_utime_null=yes -else +else $as_nop ac_cv_func_utime_null=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ @@ -17362,236 +18591,823 @@ fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_utime_null" >&5 -$as_echo "$ac_cv_func_utime_null" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_utime_null" >&5 +printf "%s\n" "$ac_cv_func_utime_null" >&6; } if test "x$ac_cv_func_utime_null" != xno; then ac_cv_func_utime_null=yes -$as_echo "#define HAVE_UTIME_NULL 1" >>confdefs.h +printf "%s\n" "#define HAVE_UTIME_NULL 1" >>confdefs.h fi rm -f conftest.data -for ac_func in vprintf -do : - ac_fn_c_check_func "$LINENO" "vprintf" "ac_cv_func_vprintf" -if test "x$ac_cv_func_vprintf" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_VPRINTF 1 + + +if test "x$ac_cv_func_vprintf" = xno +then : + ac_fn_c_check_func "$LINENO" "_doprnt" "ac_cv_func__doprnt" +if test "x$ac_cv_func__doprnt" = xyes +then : + +printf "%s\n" "#define HAVE_DOPRNT 1" >>confdefs.h + +fi + +fi +ac_fn_c_check_func "$LINENO" "asprintf" "ac_cv_func_asprintf" +if test "x$ac_cv_func_asprintf" = xyes +then : + printf "%s\n" "#define HAVE_ASPRINTF 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "atexit" "ac_cv_func_atexit" +if test "x$ac_cv_func_atexit" = xyes +then : + printf "%s\n" "#define HAVE_ATEXIT 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "closefrom" "ac_cv_func_closefrom" +if test "x$ac_cv_func_closefrom" = xyes +then : + printf "%s\n" "#define HAVE_CLOSEFROM 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "dup2" "ac_cv_func_dup2" +if test "x$ac_cv_func_dup2" = xyes +then : + printf "%s\n" "#define HAVE_DUP2 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "eaccess" "ac_cv_func_eaccess" +if test "x$ac_cv_func_eaccess" = xyes +then : + printf "%s\n" "#define HAVE_EACCESS 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "endpwent" "ac_cv_func_endpwent" +if test "x$ac_cv_func_endpwent" = xyes +then : + printf "%s\n" "#define HAVE_ENDPWENT 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "euidaccess" "ac_cv_func_euidaccess" +if test "x$ac_cv_func_euidaccess" = xyes +then : + printf "%s\n" "#define HAVE_EUIDACCESS 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "ffsll" "ac_cv_func_ffsll" +if test "x$ac_cv_func_ffsll" = xyes +then : + printf "%s\n" "#define HAVE_FFSLL 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "ftruncate" "ac_cv_func_ftruncate" +if test "x$ac_cv_func_ftruncate" = xyes +then : + printf "%s\n" "#define HAVE_FTRUNCATE 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "getcwd" "ac_cv_func_getcwd" +if test "x$ac_cv_func_getcwd" = xyes +then : + printf "%s\n" "#define HAVE_GETCWD 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "gethostbyname" "ac_cv_func_gethostbyname" +if test "x$ac_cv_func_gethostbyname" = xyes +then : + printf "%s\n" "#define HAVE_GETHOSTBYNAME 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "gethostname" "ac_cv_func_gethostname" +if test "x$ac_cv_func_gethostname" = xyes +then : + printf "%s\n" "#define HAVE_GETHOSTNAME 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "getloadavg" "ac_cv_func_getloadavg" +if test "x$ac_cv_func_getloadavg" = xyes +then : + printf "%s\n" "#define HAVE_GETLOADAVG 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "gettimeofday" "ac_cv_func_gettimeofday" +if test "x$ac_cv_func_gettimeofday" = xyes +then : + printf "%s\n" "#define HAVE_GETTIMEOFDAY 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "glob" "ac_cv_func_glob" +if test "x$ac_cv_func_glob" = xyes +then : + printf "%s\n" "#define HAVE_GLOB 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "ioperm" "ac_cv_func_ioperm" +if test "x$ac_cv_func_ioperm" = xyes +then : + printf "%s\n" "#define HAVE_IOPERM 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "inet_ntoa" "ac_cv_func_inet_ntoa" +if test "x$ac_cv_func_inet_ntoa" = xyes +then : + printf "%s\n" "#define HAVE_INET_NTOA 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "isascii" "ac_cv_func_isascii" +if test "x$ac_cv_func_isascii" = xyes +then : + printf "%s\n" "#define HAVE_ISASCII 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "memchr" "ac_cv_func_memchr" +if test "x$ac_cv_func_memchr" = xyes +then : + printf "%s\n" "#define HAVE_MEMCHR 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "memmove" "ac_cv_func_memmove" +if test "x$ac_cv_func_memmove" = xyes +then : + printf "%s\n" "#define HAVE_MEMMOVE 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "memset" "ac_cv_func_memset" +if test "x$ac_cv_func_memset" = xyes +then : + printf "%s\n" "#define HAVE_MEMSET 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "mkdir" "ac_cv_func_mkdir" +if test "x$ac_cv_func_mkdir" = xyes +then : + printf "%s\n" "#define HAVE_MKDIR 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "mkdtemp" "ac_cv_func_mkdtemp" +if test "x$ac_cv_func_mkdtemp" = xyes +then : + printf "%s\n" "#define HAVE_MKDTEMP 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "munmap" "ac_cv_func_munmap" +if test "x$ac_cv_func_munmap" = xyes +then : + printf "%s\n" "#define HAVE_MUNMAP 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "newlocale" "ac_cv_func_newlocale" +if test "x$ac_cv_func_newlocale" = xyes +then : + printf "%s\n" "#define HAVE_NEWLOCALE 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "pipe2" "ac_cv_func_pipe2" +if test "x$ac_cv_func_pipe2" = xyes +then : + printf "%s\n" "#define HAVE_PIPE2 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "ppoll" "ac_cv_func_ppoll" +if test "x$ac_cv_func_ppoll" = xyes +then : + printf "%s\n" "#define HAVE_PPOLL 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "putenv" "ac_cv_func_putenv" +if test "x$ac_cv_func_putenv" = xyes +then : + printf "%s\n" "#define HAVE_PUTENV 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "re_comp" "ac_cv_func_re_comp" +if test "x$ac_cv_func_re_comp" = xyes +then : + printf "%s\n" "#define HAVE_RE_COMP 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "regcomp" "ac_cv_func_regcomp" +if test "x$ac_cv_func_regcomp" = xyes +then : + printf "%s\n" "#define HAVE_REGCOMP 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "select" "ac_cv_func_select" +if test "x$ac_cv_func_select" = xyes +then : + printf "%s\n" "#define HAVE_SELECT 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "setenv" "ac_cv_func_setenv" +if test "x$ac_cv_func_setenv" = xyes +then : + printf "%s\n" "#define HAVE_SETENV 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "socket" "ac_cv_func_socket" +if test "x$ac_cv_func_socket" = xyes +then : + printf "%s\n" "#define HAVE_SOCKET 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "strcasecmp" "ac_cv_func_strcasecmp" +if test "x$ac_cv_func_strcasecmp" = xyes +then : + printf "%s\n" "#define HAVE_STRCASECMP 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "strcasestr" "ac_cv_func_strcasestr" +if test "x$ac_cv_func_strcasestr" = xyes +then : + printf "%s\n" "#define HAVE_STRCASESTR 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "strchr" "ac_cv_func_strchr" +if test "x$ac_cv_func_strchr" = xyes +then : + printf "%s\n" "#define HAVE_STRCHR 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "strcspn" "ac_cv_func_strcspn" +if test "x$ac_cv_func_strcspn" = xyes +then : + printf "%s\n" "#define HAVE_STRCSPN 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "strdup" "ac_cv_func_strdup" +if test "x$ac_cv_func_strdup" = xyes +then : + printf "%s\n" "#define HAVE_STRDUP 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "strerror" "ac_cv_func_strerror" +if test "x$ac_cv_func_strerror" = xyes +then : + printf "%s\n" "#define HAVE_STRERROR 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "strlcat" "ac_cv_func_strlcat" +if test "x$ac_cv_func_strlcat" = xyes +then : + printf "%s\n" "#define HAVE_STRLCAT 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "strlcpy" "ac_cv_func_strlcpy" +if test "x$ac_cv_func_strlcpy" = xyes +then : + printf "%s\n" "#define HAVE_STRLCPY 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "strncasecmp" "ac_cv_func_strncasecmp" +if test "x$ac_cv_func_strncasecmp" = xyes +then : + printf "%s\n" "#define HAVE_STRNCASECMP 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "strndup" "ac_cv_func_strndup" +if test "x$ac_cv_func_strndup" = xyes +then : + printf "%s\n" "#define HAVE_STRNDUP 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "strnlen" "ac_cv_func_strnlen" +if test "x$ac_cv_func_strnlen" = xyes +then : + printf "%s\n" "#define HAVE_STRNLEN 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "strrchr" "ac_cv_func_strrchr" +if test "x$ac_cv_func_strrchr" = xyes +then : + printf "%s\n" "#define HAVE_STRRCHR 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "strsep" "ac_cv_func_strsep" +if test "x$ac_cv_func_strsep" = xyes +then : + printf "%s\n" "#define HAVE_STRSEP 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "strspn" "ac_cv_func_strspn" +if test "x$ac_cv_func_strspn" = xyes +then : + printf "%s\n" "#define HAVE_STRSPN 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "strstr" "ac_cv_func_strstr" +if test "x$ac_cv_func_strstr" = xyes +then : + printf "%s\n" "#define HAVE_STRSTR 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "strtod" "ac_cv_func_strtod" +if test "x$ac_cv_func_strtod" = xyes +then : + printf "%s\n" "#define HAVE_STRTOD 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "strtol" "ac_cv_func_strtol" +if test "x$ac_cv_func_strtol" = xyes +then : + printf "%s\n" "#define HAVE_STRTOL 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "strtold" "ac_cv_func_strtold" +if test "x$ac_cv_func_strtold" = xyes +then : + printf "%s\n" "#define HAVE_STRTOLD 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "strtoq" "ac_cv_func_strtoq" +if test "x$ac_cv_func_strtoq" = xyes +then : + printf "%s\n" "#define HAVE_STRTOQ 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "unsetenv" "ac_cv_func_unsetenv" +if test "x$ac_cv_func_unsetenv" = xyes +then : + printf "%s\n" "#define HAVE_UNSETENV 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "uselocale" "ac_cv_func_uselocale" +if test "x$ac_cv_func_uselocale" = xyes +then : + printf "%s\n" "#define HAVE_USELOCALE 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "utime" "ac_cv_func_utime" +if test "x$ac_cv_func_utime" = xyes +then : + printf "%s\n" "#define HAVE_UTIME 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "vasprintf" "ac_cv_func_vasprintf" +if test "x$ac_cv_func_vasprintf" = xyes +then : + printf "%s\n" "#define HAVE_VASPRINTF 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "getpeereid" "ac_cv_func_getpeereid" +if test "x$ac_cv_func_getpeereid" = xyes +then : + printf "%s\n" "#define HAVE_GETPEEREID 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "sysctl" "ac_cv_func_sysctl" +if test "x$ac_cv_func_sysctl" = xyes +then : + printf "%s\n" "#define HAVE_SYSCTL 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "swapctl" "ac_cv_func_swapctl" +if test "x$ac_cv_func_swapctl" = xyes +then : + printf "%s\n" "#define HAVE_SWAPCTL 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "malloc_trim" "ac_cv_func_malloc_trim" +if test "x$ac_cv_func_malloc_trim" = xyes +then : + printf "%s\n" "#define HAVE_MALLOC_TRIM 1" >>confdefs.h + +fi + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for htonll" >&5 +printf %s "checking for htonll... " >&6; } +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main (void) +{ +return htonll(0); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + +printf "%s\n" "#define HAVE_HTONLL 1" >>confdefs.h + +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for ntohll" >&5 +printf %s "checking for ntohll... " >&6; } +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main (void) +{ +return ntohll(0); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + +printf "%s\n" "#define HAVE_NTOHLL 1" >>confdefs.h + +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + +# NOTE: we use AC_CHECK_LIB to get -lm into the arguments for later checks, +# so that AC_CHECK_FUNCS can detect functions in that library. +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for sqrt in -lm" >&5 +printf %s "checking for sqrt in -lm... " >&6; } +if test ${ac_cv_lib_m_sqrt+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_check_lib_save_LIBS=$LIBS +LIBS="-lm $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +char sqrt (); +int +main (void) +{ +return sqrt (); + ; + return 0; +} _ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_m_sqrt=yes +else $as_nop + ac_cv_lib_m_sqrt=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_sqrt" >&5 +printf "%s\n" "$ac_cv_lib_m_sqrt" >&6; } +if test "x$ac_cv_lib_m_sqrt" = xyes +then : + printf "%s\n" "#define HAVE_LIBM 1" >>confdefs.h + + LIBS="-lm $LIBS" + +fi + +# BSD might not have exp2, and/or log2 +ac_fn_c_check_func "$LINENO" "exp2" "ac_cv_func_exp2" +if test "x$ac_cv_func_exp2" = xyes +then : + printf "%s\n" "#define HAVE_EXP2 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "log2" "ac_cv_func_log2" +if test "x$ac_cv_func_log2" = xyes +then : + printf "%s\n" "#define HAVE_LOG2 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "exp10" "ac_cv_func_exp10" +if test "x$ac_cv_func_exp10" = xyes +then : + printf "%s\n" "#define HAVE_EXP10 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "log10" "ac_cv_func_log10" +if test "x$ac_cv_func_log10" = xyes +then : + printf "%s\n" "#define HAVE_LOG10 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "sin" "ac_cv_func_sin" +if test "x$ac_cv_func_sin" = xyes +then : + printf "%s\n" "#define HAVE_SIN 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "cos" "ac_cv_func_cos" +if test "x$ac_cv_func_cos" = xyes +then : + printf "%s\n" "#define HAVE_COS 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "tan" "ac_cv_func_tan" +if test "x$ac_cv_func_tan" = xyes +then : + printf "%s\n" "#define HAVE_TAN 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "asin" "ac_cv_func_asin" +if test "x$ac_cv_func_asin" = xyes +then : + printf "%s\n" "#define HAVE_ASIN 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "acos" "ac_cv_func_acos" +if test "x$ac_cv_func_acos" = xyes +then : + printf "%s\n" "#define HAVE_ACOS 1" >>confdefs.h -ac_fn_c_check_func "$LINENO" "_doprnt" "ac_cv_func__doprnt" -if test "x$ac_cv_func__doprnt" = xyes; then : +fi +ac_fn_c_check_func "$LINENO" "atan" "ac_cv_func_atan" +if test "x$ac_cv_func_atan" = xyes +then : + printf "%s\n" "#define HAVE_ATAN 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "atan2" "ac_cv_func_atan2" +if test "x$ac_cv_func_atan2" = xyes +then : + printf "%s\n" "#define HAVE_ATAN2 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "pow" "ac_cv_func_pow" +if test "x$ac_cv_func_pow" = xyes +then : + printf "%s\n" "#define HAVE_POW 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "rint" "ac_cv_func_rint" +if test "x$ac_cv_func_rint" = xyes +then : + printf "%s\n" "#define HAVE_RINT 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "exp" "ac_cv_func_exp" +if test "x$ac_cv_func_exp" = xyes +then : + printf "%s\n" "#define HAVE_EXP 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "log" "ac_cv_func_log" +if test "x$ac_cv_func_log" = xyes +then : + printf "%s\n" "#define HAVE_LOG 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "remainder" "ac_cv_func_remainder" +if test "x$ac_cv_func_remainder" = xyes +then : + printf "%s\n" "#define HAVE_REMAINDER 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "fmod" "ac_cv_func_fmod" +if test "x$ac_cv_func_fmod" = xyes +then : + printf "%s\n" "#define HAVE_FMOD 1" >>confdefs.h -$as_echo "#define HAVE_DOPRNT 1" >>confdefs.h +fi +ac_fn_c_check_func "$LINENO" "round" "ac_cv_func_round" +if test "x$ac_cv_func_round" = xyes +then : + printf "%s\n" "#define HAVE_ROUND 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "roundf" "ac_cv_func_roundf" +if test "x$ac_cv_func_roundf" = xyes +then : + printf "%s\n" "#define HAVE_ROUNDF 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "trunc" "ac_cv_func_trunc" +if test "x$ac_cv_func_trunc" = xyes +then : + printf "%s\n" "#define HAVE_TRUNC 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "floor" "ac_cv_func_floor" +if test "x$ac_cv_func_floor" = xyes +then : + printf "%s\n" "#define HAVE_FLOOR 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "ceil" "ac_cv_func_ceil" +if test "x$ac_cv_func_ceil" = xyes +then : + printf "%s\n" "#define HAVE_CEIL 1" >>confdefs.h + +fi + + +# Certain architectures don't really have long double, even though +# AC_CHECK_FUNCS would otherwise find the following functions. +if test "x${ac_cv_type_long_double_wider}" = "xyes" ; then + ac_fn_c_check_func "$LINENO" "exp2l" "ac_cv_func_exp2l" +if test "x$ac_cv_func_exp2l" = xyes +then : + printf "%s\n" "#define HAVE_EXP2L 1" >>confdefs.h fi +ac_fn_c_check_func "$LINENO" "log2l" "ac_cv_func_log2l" +if test "x$ac_cv_func_log2l" = xyes +then : + printf "%s\n" "#define HAVE_LOG2L 1" >>confdefs.h fi -done - - -for ac_func in asprintf atexit closefrom dup2 eaccess endpwent euidaccess ffsll ftruncate getcwd gethostbyname gethostname getloadavg gettimeofday glob ioperm inet_ntoa isascii memchr memmove memset mkdir mkdtemp munmap newlocale pipe2 ppoll putenv re_comp regcomp select setenv socket strcasecmp strcasestr strchr strcspn strdup strerror strlcat strlcpy strncasecmp strndup strnlen strrchr strsep strspn strstr strtod strtol strtold strtoq unsetenv uselocale utime vasprintf getpeereid sysctl swapctl malloc_trim -do : - as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" -if eval test \"x\$"$as_ac_var"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF +ac_fn_c_check_func "$LINENO" "exp10l" "ac_cv_func_exp10l" +if test "x$ac_cv_func_exp10l" = xyes +then : + printf "%s\n" "#define HAVE_EXP10L 1" >>confdefs.h fi -done +ac_fn_c_check_func "$LINENO" "log10l" "ac_cv_func_log10l" +if test "x$ac_cv_func_log10l" = xyes +then : + printf "%s\n" "#define HAVE_LOG10L 1" >>confdefs.h +fi +ac_fn_c_check_func "$LINENO" "sinl" "ac_cv_func_sinl" +if test "x$ac_cv_func_sinl" = xyes +then : + printf "%s\n" "#define HAVE_SINL 1" >>confdefs.h -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for htonll" >&5 -$as_echo_n "checking for htonll... " >&6; } -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -int -main () -{ -return htonll(0); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } +fi +ac_fn_c_check_func "$LINENO" "cosl" "ac_cv_func_cosl" +if test "x$ac_cv_func_cosl" = xyes +then : + printf "%s\n" "#define HAVE_COSL 1" >>confdefs.h -$as_echo "#define HAVE_HTONLL 1" >>confdefs.h +fi +ac_fn_c_check_func "$LINENO" "tanl" "ac_cv_func_tanl" +if test "x$ac_cv_func_tanl" = xyes +then : + printf "%s\n" "#define HAVE_TANL 1" >>confdefs.h -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } +fi +ac_fn_c_check_func "$LINENO" "asinl" "ac_cv_func_asinl" +if test "x$ac_cv_func_asinl" = xyes +then : + printf "%s\n" "#define HAVE_ASINL 1" >>confdefs.h fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext +ac_fn_c_check_func "$LINENO" "acosl" "ac_cv_func_acosl" +if test "x$ac_cv_func_acosl" = xyes +then : + printf "%s\n" "#define HAVE_ACOSL 1" >>confdefs.h -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ntohll" >&5 -$as_echo_n "checking for ntohll... " >&6; } -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -int -main () -{ -return ntohll(0); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } +fi +ac_fn_c_check_func "$LINENO" "atanl" "ac_cv_func_atanl" +if test "x$ac_cv_func_atanl" = xyes +then : + printf "%s\n" "#define HAVE_ATANL 1" >>confdefs.h -$as_echo "#define HAVE_NTOHLL 1" >>confdefs.h +fi +ac_fn_c_check_func "$LINENO" "atan2l" "ac_cv_func_atan2l" +if test "x$ac_cv_func_atan2l" = xyes +then : + printf "%s\n" "#define HAVE_ATAN2L 1" >>confdefs.h -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } +fi +ac_fn_c_check_func "$LINENO" "powl" "ac_cv_func_powl" +if test "x$ac_cv_func_powl" = xyes +then : + printf "%s\n" "#define HAVE_POWL 1" >>confdefs.h fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext +ac_fn_c_check_func "$LINENO" "sqrtl" "ac_cv_func_sqrtl" +if test "x$ac_cv_func_sqrtl" = xyes +then : + printf "%s\n" "#define HAVE_SQRTL 1" >>confdefs.h -# NOTE: we use AC_CHECK_LIB to get -lm into the arguments for later checks, -# so that AC_CHECK_FUNCS can detect functions in that library. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sqrt in -lm" >&5 -$as_echo_n "checking for sqrt in -lm... " >&6; } -if ${ac_cv_lib_m_sqrt+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lm $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ +fi +ac_fn_c_check_func "$LINENO" "rintl" "ac_cv_func_rintl" +if test "x$ac_cv_func_rintl" = xyes +then : + printf "%s\n" "#define HAVE_RINTL 1" >>confdefs.h -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char sqrt (); -int -main () -{ -return sqrt (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_m_sqrt=yes -else - ac_cv_lib_m_sqrt=no fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS +ac_fn_c_check_func "$LINENO" "expl" "ac_cv_func_expl" +if test "x$ac_cv_func_expl" = xyes +then : + printf "%s\n" "#define HAVE_EXPL 1" >>confdefs.h + fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_sqrt" >&5 -$as_echo "$ac_cv_lib_m_sqrt" >&6; } -if test "x$ac_cv_lib_m_sqrt" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_LIBM 1 -_ACEOF +ac_fn_c_check_func "$LINENO" "logl" "ac_cv_func_logl" +if test "x$ac_cv_func_logl" = xyes +then : + printf "%s\n" "#define HAVE_LOGL 1" >>confdefs.h - LIBS="-lm $LIBS" +fi +ac_fn_c_check_func "$LINENO" "remainderl" "ac_cv_func_remainderl" +if test "x$ac_cv_func_remainderl" = xyes +then : + printf "%s\n" "#define HAVE_REMAINDERL 1" >>confdefs.h fi +ac_fn_c_check_func "$LINENO" "fmodl" "ac_cv_func_fmodl" +if test "x$ac_cv_func_fmodl" = xyes +then : + printf "%s\n" "#define HAVE_FMODL 1" >>confdefs.h -# BSD might not have exp2, and/or log2 -for ac_func in exp2 log2 exp10 log10 sin cos tan asin acos atan atan2 pow rint exp log remainder fmod round roundf trunc floor ceil -do : - as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" -if eval test \"x\$"$as_ac_var"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF +fi +ac_fn_c_check_func "$LINENO" "roundl" "ac_cv_func_roundl" +if test "x$ac_cv_func_roundl" = xyes +then : + printf "%s\n" "#define HAVE_ROUNDL 1" >>confdefs.h fi -done +ac_fn_c_check_func "$LINENO" "truncl" "ac_cv_func_truncl" +if test "x$ac_cv_func_truncl" = xyes +then : + printf "%s\n" "#define HAVE_TRUNCL 1" >>confdefs.h +fi +ac_fn_c_check_func "$LINENO" "floorl" "ac_cv_func_floorl" +if test "x$ac_cv_func_floorl" = xyes +then : + printf "%s\n" "#define HAVE_FLOORL 1" >>confdefs.h -# Certain architectures don't really have long double, even though -# AC_CHECK_FUNCS would otherwise find the following functions. -if test "x${ac_cv_type_long_double_wider}" = "xyes" ; then - for ac_func in exp2l log2l exp10l log10l sinl cosl tanl asinl acosl atanl atan2l powl sqrtl rintl expl logl remainderl fmodl roundl truncl floorl ceill -do : - as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" -if eval test \"x\$"$as_ac_var"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF +fi +ac_fn_c_check_func "$LINENO" "ceill" "ac_cv_func_ceill" +if test "x$ac_cv_func_ceill" = xyes +then : + printf "%s\n" "#define HAVE_CEILL 1" >>confdefs.h fi -done fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for LLONG_MAX in limits.h" >&5 -$as_echo_n "checking for LLONG_MAX in limits.h... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for LLONG_MAX in limits.h" >&5 +printf %s "checking for LLONG_MAX in limits.h... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int -main () +main (void) { long long foo = LLONG_MAX ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } +if ac_fn_c_try_link "$LINENO" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } -$as_echo "#define HAVE_LLONG_MAX 1" >>confdefs.h +printf "%s\n" "#define HAVE_LLONG_MAX 1" >>confdefs.h -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for timersub in time.h" >&5 -$as_echo_n "checking for timersub in time.h... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for timersub in time.h" >&5 +printf %s "checking for timersub in time.h... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int -main () +main (void) { struct timeval *a; timersub(a, a, a); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } +if ac_fn_c_try_link "$LINENO" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } -$as_echo "#define HAVE_TIMERSUB 1" >>confdefs.h +printf "%s\n" "#define HAVE_TIMERSUB 1" >>confdefs.h -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a version of GNU ld that supports the --dynamic-list flag" >&5 -$as_echo_n "checking for a version of GNU ld that supports the --dynamic-list flag... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a version of GNU ld that supports the --dynamic-list flag" >&5 +printf %s "checking for a version of GNU ld that supports the --dynamic-list flag... " >&6; } old_LDFLAGS=${LDFLAGS} cat >conftest.dynamics <<_ACEOF { @@ -17604,40 +19420,42 @@ /* end confdefs.h. */ int -main () +main (void) { ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : PBX_DYNAMIC_LIST=1 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=${old_LDFLAGS} rm -f conftest.dynamics -ac_fn_c_check_header_mongrel "$LINENO" "sys/poll.h" "ac_cv_header_sys_poll_h" "$ac_includes_default" -if test "x$ac_cv_header_sys_poll_h" = xyes; then : +ac_fn_c_check_header_compile "$LINENO" "sys/poll.h" "ac_cv_header_sys_poll_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_poll_h" = xyes +then : HAS_POLL=1 -$as_echo "#define HAVE_SYS_POLL_H 1" >>confdefs.h +printf "%s\n" "#define HAVE_SYS_POLL_H 1" >>confdefs.h fi - # Check whether --enable-internal-poll was given. -if test "${enable_internal_poll+set}" = set; then : +if test ${enable_internal_poll+y} +then : enableval=$enable_internal_poll; case "${enableval}" in y|ye|yes) HAS_POLL="";; n|no) HAS_POLL="${HAS_POLL}" ;; @@ -17648,86 +19466,164 @@ # Check whether --enable-asteriskssl was given. -if test "${enable_asteriskssl+set}" = set; then : +if test ${enable_asteriskssl+y} +then : enableval=$enable_asteriskssl; case "${enableval}" in y|ye|yes) AST_ASTERISKSSL=yes ;; n|no) AST_ASTERISKSSL=no ;; *) as_fn_error $? "bad value ${enableval} for --disable-asteriskssl" "$LINENO" 5 ;; esac -else +else $as_nop AST_ASTERISKSSL=yes fi -for ac_func in inet_aton -do : - ac_fn_c_check_func "$LINENO" "inet_aton" "ac_cv_func_inet_aton" -if test "x$ac_cv_func_inet_aton" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_INET_ATON 1 -_ACEOF +ac_fn_c_check_func "$LINENO" "inet_aton" "ac_cv_func_inet_aton" +if test "x$ac_cv_func_inet_aton" = xyes +then : + printf "%s\n" "#define HAVE_INET_ATON 1" >>confdefs.h fi -done # check if we have IP_PKTINFO constant defined -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for IP_PKTINFO" >&5 -$as_echo_n "checking for IP_PKTINFO... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for IP_PKTINFO" >&5 +printf %s "checking for IP_PKTINFO... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int -main () +main (void) { int pi = IP_PKTINFO; ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } +if ac_fn_c_try_link "$LINENO" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } -$as_echo "#define HAVE_PKTINFO 1" >>confdefs.h +printf "%s\n" "#define HAVE_PKTINFO 1" >>confdefs.h -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext # NetBSD libc ships with an internal-only incompatible symbol gethostbyname_r -ac_fn_c_check_decl "$LINENO" "gethostbyname_r" "ac_cv_have_decl_gethostbyname_r" "#include +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC options needed to detect all undeclared functions" >&5 +printf %s "checking for $CC options needed to detect all undeclared functions... " >&6; } +if test ${ac_cv_c_undeclared_builtin_options+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_save_CFLAGS=$CFLAGS + ac_cv_c_undeclared_builtin_options='cannot detect' + for ac_arg in '' -fno-builtin; do + CFLAGS="$ac_save_CFLAGS $ac_arg" + # This test program should *not* compile successfully. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ +(void) strchr; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + +else $as_nop + # This test program should compile successfully. + # No library function is consistently available on + # freestanding implementations, so test against a dummy + # declaration. Include always-available headers on the + # off chance that they somehow elicit warnings. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +#include +#include +extern void ac_decl (int, char *); + +int +main (void) +{ +(void) ac_decl (0, (char *) 0); + (void) ac_decl; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + if test x"$ac_arg" = x +then : + ac_cv_c_undeclared_builtin_options='none needed' +else $as_nop + ac_cv_c_undeclared_builtin_options=$ac_arg +fi + break +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + done + CFLAGS=$ac_save_CFLAGS + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_undeclared_builtin_options" >&5 +printf "%s\n" "$ac_cv_c_undeclared_builtin_options" >&6; } + case $ac_cv_c_undeclared_builtin_options in #( + 'cannot detect') : + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot make $CC report undeclared builtins +See \`config.log' for more details" "$LINENO" 5; } ;; #( + 'none needed') : + ac_c_undeclared_builtin_options='' ;; #( + *) : + ac_c_undeclared_builtin_options=$ac_cv_c_undeclared_builtin_options ;; +esac + +ac_fn_check_decl "$LINENO" "gethostbyname_r" "ac_cv_have_decl_gethostbyname_r" "#include #include -" -if test "x$ac_cv_have_decl_gethostbyname_r" = xyes; then : +" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_gethostbyname_r" = xyes +then : ac_have_decl=1 -else +else $as_nop ac_have_decl=0 fi - -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_GETHOSTBYNAME_R $ac_have_decl -_ACEOF -if test $ac_have_decl = 1; then : +printf "%s\n" "#define HAVE_DECL_GETHOSTBYNAME_R $ac_have_decl" >>confdefs.h +if test $ac_have_decl = 1 +then : have_gethostbyname_r_public_declaration=yes -else +else $as_nop have_gethostbyname_r_public_declaration=no fi if test "x$have_gethostbyname_r_public_declaration" = "xyes"; then # some systems already have gethostbyname_r so we don't need to build ours in main/utils.c - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing gethostbyname_r" >&5 -$as_echo_n "checking for library containing gethostbyname_r... " >&6; } -if ${ac_cv_search_gethostbyname_r+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for library containing gethostbyname_r" >&5 +printf %s "checking for library containing gethostbyname_r... " >&6; } +if test ${ac_cv_search_gethostbyname_r+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_func_search_save_LIBS=$LIBS cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -17735,284 +19631,292 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char gethostbyname_r (); int -main () +main (void) { return gethostbyname_r (); ; return 0; } _ACEOF -for ac_lib in '' socket nsl; do +for ac_lib in '' socket nsl +do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi - if ac_fn_c_try_link "$LINENO"; then : + if ac_fn_c_try_link "$LINENO" +then : ac_cv_search_gethostbyname_r=$ac_res fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext - if ${ac_cv_search_gethostbyname_r+:} false; then : + if test ${ac_cv_search_gethostbyname_r+y} +then : break fi done -if ${ac_cv_search_gethostbyname_r+:} false; then : +if test ${ac_cv_search_gethostbyname_r+y} +then : -else +else $as_nop ac_cv_search_gethostbyname_r=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_gethostbyname_r" >&5 -$as_echo "$ac_cv_search_gethostbyname_r" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_gethostbyname_r" >&5 +printf "%s\n" "$ac_cv_search_gethostbyname_r" >&6; } ac_res=$ac_cv_search_gethostbyname_r -if test "$ac_res" != no; then : +if test "$ac_res" != no +then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gethostbyname_r with 6 arguments" >&5 -$as_echo_n "checking for gethostbyname_r with 6 arguments... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for gethostbyname_r with 6 arguments" >&5 +printf %s "checking for gethostbyname_r with 6 arguments... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int -main () +main (void) { struct hostent *he = gethostbyname_r((const char *)NULL, (struct hostent *)NULL, (char *)NULL, (int)0, (struct hostent **)NULL, (int *)NULL); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } +if ac_fn_c_try_link "$LINENO" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } -$as_echo "#define HAVE_GETHOSTBYNAME_R_6 1" >>confdefs.h +printf "%s\n" "#define HAVE_GETHOSTBYNAME_R_6 1" >>confdefs.h -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gethostbyname_r with 5 arguments" >&5 -$as_echo_n "checking for gethostbyname_r with 5 arguments... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for gethostbyname_r with 5 arguments" >&5 +printf %s "checking for gethostbyname_r with 5 arguments... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int -main () +main (void) { struct hostent *he = gethostbyname_r((const char *)NULL, (struct hostent *)NULL, (char *)NULL, (int)0, (int *)NULL); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } +if ac_fn_c_try_link "$LINENO" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } -$as_echo "#define HAVE_GETHOSTBYNAME_R_5 1" >>confdefs.h +printf "%s\n" "#define HAVE_GETHOSTBYNAME_R_5 1" >>confdefs.h -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext fi -ac_fn_c_check_header_mongrel "$LINENO" "byteswap.h" "ac_cv_header_byteswap_h" "$ac_includes_default" -if test "x$ac_cv_header_byteswap_h" = xyes; then : +ac_fn_c_check_header_compile "$LINENO" "byteswap.h" "ac_cv_header_byteswap_h" "$ac_includes_default" +if test "x$ac_cv_header_byteswap_h" = xyes +then : -cat >>confdefs.h <<_ACEOF -#define HAVE_BYTESWAP_H 1 -_ACEOF +printf "%s\n" "#define HAVE_BYTESWAP_H 1" >>confdefs.h fi - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for __swap16 variant of byteswapping macros" >&5 -$as_echo_n "checking for __swap16 variant of byteswapping macros... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for __swap16 variant of byteswapping macros" >&5 +printf %s "checking for __swap16 variant of byteswapping macros... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int -main () +main (void) { int a = 1; int b = __swap16(a); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } +if ac_fn_c_try_link "$LINENO" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } -$as_echo "#define HAVE_SYS_ENDIAN_SWAP16 1" >>confdefs.h +printf "%s\n" "#define HAVE_SYS_ENDIAN_SWAP16 1" >>confdefs.h -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for bswap16 variant of byteswapping macros" >&5 -$as_echo_n "checking for bswap16 variant of byteswapping macros... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for bswap16 variant of byteswapping macros" >&5 +printf %s "checking for bswap16 variant of byteswapping macros... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int -main () +main (void) { int a = 1; int b = bswap16(a); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } +if ac_fn_c_try_link "$LINENO" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } -$as_echo "#define HAVE_SYS_ENDIAN_BSWAP16 1" >>confdefs.h +printf "%s\n" "#define HAVE_SYS_ENDIAN_BSWAP16 1" >>confdefs.h -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for locale_t in locale.h" >&5 -$as_echo_n "checking for locale_t in locale.h... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for locale_t in locale.h" >&5 +printf %s "checking for locale_t in locale.h... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int -main () +main (void) { locale_t lt = NULL ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - -$as_echo "#define HAVE_LOCALE_T_IN_LOCALE_H 1" >>confdefs.h - -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for locale_t in xlocale.h" >&5 -$as_echo_n "checking for locale_t in xlocale.h... " >&6; } +if ac_fn_c_try_link "$LINENO" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + +printf "%s\n" "#define HAVE_LOCALE_T_IN_LOCALE_H 1" >>confdefs.h + +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for locale_t in xlocale.h" >&5 +printf %s "checking for locale_t in xlocale.h... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int -main () +main (void) { locale_t lt = NULL ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } +if ac_fn_c_try_link "$LINENO" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } -$as_echo "#define HAVE_LOCALE_T_IN_XLOCALE_H 1" >>confdefs.h +printf "%s\n" "#define HAVE_LOCALE_T_IN_XLOCALE_H 1" >>confdefs.h -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for O_EVTONLY in fcntl.h" >&5 -$as_echo_n "checking for O_EVTONLY in fcntl.h... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for O_EVTONLY in fcntl.h" >&5 +printf %s "checking for O_EVTONLY in fcntl.h... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int -main () +main (void) { int a = O_EVTONLY; ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } +if ac_fn_c_try_link "$LINENO" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } -$as_echo "#define HAVE_O_EVTONLY 1" >>confdefs.h +printf "%s\n" "#define HAVE_O_EVTONLY 1" >>confdefs.h -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for O_SYMLINK in fcntl.h" >&5 -$as_echo_n "checking for O_SYMLINK in fcntl.h... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for O_SYMLINK in fcntl.h" >&5 +printf %s "checking for O_SYMLINK in fcntl.h... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int -main () +main (void) { int a = O_SYMLINK; ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } +if ac_fn_c_try_link "$LINENO" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } -$as_echo "#define HAVE_O_SYMLINK 1" >>confdefs.h +printf "%s\n" "#define HAVE_O_SYMLINK 1" >>confdefs.h -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext if test "x${PBX_PTHREAD_RWLOCK_INITIALIZER}" != "x1"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for PTHREAD_RWLOCK_INITIALIZER in pthread.h" >&5 -$as_echo_n "checking for PTHREAD_RWLOCK_INITIALIZER in pthread.h... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for PTHREAD_RWLOCK_INITIALIZER in pthread.h" >&5 +printf %s "checking for PTHREAD_RWLOCK_INITIALIZER in pthread.h... " >&6; } saved_cppflags="${CPPFLAGS}" if test "x${PTHREAD_RWLOCK_INITIALIZER_DIR}" != "x"; then PTHREAD_RWLOCK_INITIALIZER_INCLUDE="-I${PTHREAD_RWLOCK_INITIALIZER_DIR}/include" @@ -18023,7 +19927,7 @@ /* end confdefs.h. */ #include int -main () +main (void) { #if defined(PTHREAD_RWLOCK_INITIALIZER) int foo = 0; @@ -18036,132 +19940,137 @@ return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } +if ac_fn_c_try_compile "$LINENO" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } PBX_PTHREAD_RWLOCK_INITIALIZER=1 -$as_echo "#define HAVE_PTHREAD_RWLOCK_INITIALIZER 1" >>confdefs.h +printf "%s\n" "#define HAVE_PTHREAD_RWLOCK_INITIALIZER 1" >>confdefs.h -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext CPPFLAGS="${saved_cppflags}" fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for PTHREAD_RWLOCK_PREFER_WRITER_NP in pthread.h" >&5 -$as_echo_n "checking for PTHREAD_RWLOCK_PREFER_WRITER_NP in pthread.h... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for PTHREAD_RWLOCK_PREFER_WRITER_NP in pthread.h" >&5 +printf %s "checking for PTHREAD_RWLOCK_PREFER_WRITER_NP in pthread.h... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int -main () +main (void) { int a = PTHREAD_RWLOCK_PREFER_WRITER_NP; ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } +if ac_fn_c_try_link "$LINENO" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } -$as_echo "#define HAVE_PTHREAD_RWLOCK_PREFER_WRITER_NP 1" >>confdefs.h +printf "%s\n" "#define HAVE_PTHREAD_RWLOCK_PREFER_WRITER_NP 1" >>confdefs.h -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for PTHREAD_MUTEX_RECURSIVE_NP in pthread.h" >&5 -$as_echo_n "checking for PTHREAD_MUTEX_RECURSIVE_NP in pthread.h... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for PTHREAD_MUTEX_RECURSIVE_NP in pthread.h" >&5 +printf %s "checking for PTHREAD_MUTEX_RECURSIVE_NP in pthread.h... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int -main () +main (void) { int a = PTHREAD_MUTEX_RECURSIVE_NP; ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } +if ac_fn_c_try_link "$LINENO" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } -$as_echo "#define HAVE_PTHREAD_MUTEX_RECURSIVE_NP 1" >>confdefs.h +printf "%s\n" "#define HAVE_PTHREAD_MUTEX_RECURSIVE_NP 1" >>confdefs.h -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for PTHREAD_MUTEX_ADAPTIVE_NP in pthread.h" >&5 -$as_echo_n "checking for PTHREAD_MUTEX_ADAPTIVE_NP in pthread.h... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for PTHREAD_MUTEX_ADAPTIVE_NP in pthread.h" >&5 +printf %s "checking for PTHREAD_MUTEX_ADAPTIVE_NP in pthread.h... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int -main () +main (void) { int a = PTHREAD_MUTEX_ADAPTIVE_NP; ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } +if ac_fn_c_try_link "$LINENO" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } -$as_echo "#define HAVE_PTHREAD_MUTEX_ADAPTIVE_NP 1" >>confdefs.h +printf "%s\n" "#define HAVE_PTHREAD_MUTEX_ADAPTIVE_NP 1" >>confdefs.h -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_spinlock_t in pthread.h" >&5 -$as_echo_n "checking for pthread_spinlock_t in pthread.h... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for pthread_spinlock_t in pthread.h" >&5 +printf %s "checking for pthread_spinlock_t in pthread.h... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int -main () +main (void) { pthread_spinlock_t spin; ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } +if ac_fn_c_try_link "$LINENO" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } -$as_echo "#define HAVE_PTHREAD_SPINLOCK 1" >>confdefs.h +printf "%s\n" "#define HAVE_PTHREAD_SPINLOCK 1" >>confdefs.h -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext save_LIBS="$LIBS" @@ -18169,14 +20078,14 @@ LIBS="$PTHREAD_LIBS $LIBS" CFLAGS="$CFLAGS $PTHREAD_CFLAGS" -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_rwlock_timedwrlock() in pthread.h" >&5 -$as_echo_n "checking for pthread_rwlock_timedwrlock() in pthread.h... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for pthread_rwlock_timedwrlock() in pthread.h" >&5 +printf %s "checking for pthread_rwlock_timedwrlock() in pthread.h... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int -main () +main (void) { pthread_rwlock_t foo; struct timespec bar; pthread_rwlock_timedwrlock(&foo, &bar) ; @@ -18184,56 +20093,59 @@ } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } ac_cv_pthread_rwlock_timedwrlock="yes" -else +else $as_nop - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } ac_cv_pthread_rwlock_timedwrlock="no" fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext # Some platforms define sem_init(), but only support sem_open(). joyous. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for working unnamed semaphores" >&5 -$as_echo_n "checking for working unnamed semaphores... " >&6; } -if test "$cross_compiling" = yes; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: cross-compile" >&5 -$as_echo "cross-compile" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: result yes guessed because of cross compilation" >&5 -$as_echo "$as_me: WARNING: result yes guessed because of cross compilation" >&6;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for working unnamed semaphores" >&5 +printf %s "checking for working unnamed semaphores... " >&6; } +if test "$cross_compiling" = yes +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: cross-compile" >&5 +printf "%s\n" "cross-compile" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: result yes guessed because of cross compilation" >&5 +printf "%s\n" "$as_me: WARNING: result yes guessed because of cross compilation" >&6;} -$as_echo "#define HAS_WORKING_SEMAPHORE 1" >>confdefs.h +printf "%s\n" "#define HAS_WORKING_SEMAPHORE 1" >>confdefs.h -else +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int -main () +main (void) { sem_t sem; return sem_init(&sem, 0, 0); ; return 0; } _ACEOF -if ac_fn_c_try_run "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - -$as_echo "#define HAS_WORKING_SEMAPHORE 1" >>confdefs.h - -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } +if ac_fn_c_try_run "$LINENO" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + +printf "%s\n" "#define HAS_WORKING_SEMAPHORE 1" >>confdefs.h + +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext @@ -18244,12 +20156,12 @@ CFLAGS="$save_CFLAGS" if test "${ac_cv_pthread_rwlock_timedwrlock}" = "yes"; then -$as_echo "#define HAVE_PTHREAD_RWLOCK_TIMEDWRLOCK 1" >>confdefs.h +printf "%s\n" "#define HAVE_PTHREAD_RWLOCK_TIMEDWRLOCK 1" >>confdefs.h fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if PTHREAD_ONCE_INIT needs braces" >&5 -$as_echo_n "checking if PTHREAD_ONCE_INIT needs braces... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if PTHREAD_ONCE_INIT needs braces" >&5 +printf %s "checking if PTHREAD_ONCE_INIT needs braces... " >&6; } saved_CFLAGS="${CFLAGS}" CFLAGS="${CFLAGS} -Werror -Wmissing-braces" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -18257,7 +20169,7 @@ #include void empty(){} int -main () +main (void) { pthread_once_t once = PTHREAD_ONCE_INIT; pthread_once(&once, empty); ; @@ -18265,32 +20177,33 @@ } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } ac_cv_pthread_once_needsbraces="no" -else +else $as_nop - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } ac_cv_pthread_once_needsbraces="yes" fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext CFLAGS="${saved_CFLAGS}" if test "${ac_cv_pthread_once_needsbraces}" = "yes"; then -$as_echo "#define PTHREAD_ONCE_INIT_NEEDS_BRACES 1" >>confdefs.h +printf "%s\n" "#define PTHREAD_ONCE_INIT_NEEDS_BRACES 1" >>confdefs.h fi if test "x${PBX_PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP}" != "x1"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP in pthread.h" >&5 -$as_echo_n "checking for PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP in pthread.h... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP in pthread.h" >&5 +printf %s "checking for PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP in pthread.h... " >&6; } saved_cppflags="${CPPFLAGS}" if test "x${PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP_DIR}" != "x"; then PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP_INCLUDE="-I${PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP_DIR}/include" @@ -18301,7 +20214,7 @@ /* end confdefs.h. */ #include int -main () +main (void) { #if defined(PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP) int foo = 0; @@ -18314,21 +20227,22 @@ return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } +if ac_fn_c_try_compile "$LINENO" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } PBX_PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP=1 -$as_echo "#define HAVE_PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP 1" >>confdefs.h +printf "%s\n" "#define HAVE_PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP 1" >>confdefs.h -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext CPPFLAGS="${saved_cppflags}" fi @@ -18336,13 +20250,13 @@ # Can we compare a mutex to its initial value? # Generally yes on OpenBSD/FreeBSD and no on Mac OS X. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we can compare a mutex to its initial value" >&5 -$as_echo_n "checking whether we can compare a mutex to its initial value... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we can compare a mutex to its initial value" >&5 +printf %s "checking whether we can compare a mutex to its initial value... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int -main () +main (void) { pthread_mutex_t lock; if ((lock) != ((pthread_mutex_t) PTHREAD_MUTEX_INITIALIZER)) { @@ -18353,18 +20267,19 @@ return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } +if ac_fn_c_try_link "$LINENO" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } -$as_echo "#define CAN_COMPARE_MUTEX_TO_INIT_VALUE 1" >>confdefs.h +printf "%s\n" "#define CAN_COMPARE_MUTEX_TO_INIT_VALUE 1" >>confdefs.h -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext #if test "${cross_compiling}" = "no"; @@ -18383,73 +20298,70 @@ #fi # for FreeBSD thr_self -for ac_header in sys/thr.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "sys/thr.h" "ac_cv_header_sys_thr_h" "$ac_includes_default" -if test "x$ac_cv_header_sys_thr_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_SYS_THR_H 1 -_ACEOF +ac_fn_c_check_header_compile "$LINENO" "sys/thr.h" "ac_cv_header_sys_thr_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_thr_h" = xyes +then : + printf "%s\n" "#define HAVE_SYS_THR_H 1" >>confdefs.h fi -done - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for compiler sync operations" >&5 -$as_echo_n "checking for compiler sync operations... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for compiler sync operations" >&5 +printf %s "checking for compiler sync operations... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int -main () +main (void) { int foo1; int foo2 = __sync_fetch_and_add(&foo1, 1); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } +if ac_fn_c_try_link "$LINENO" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } ax_cv_have_gcc_atomics=1 -$as_echo "#define HAVE_GCC_ATOMICS 1" >>confdefs.h +printf "%s\n" "#define HAVE_GCC_ATOMICS 1" >>confdefs.h -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for compiler atomic operations" >&5 -$as_echo_n "checking for compiler atomic operations... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for compiler atomic operations" >&5 +printf %s "checking for compiler atomic operations... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int -main () +main (void) { int foo1; int foo2 = __atomic_fetch_add(&foo1, 1, __ATOMIC_RELAXED); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } +if ac_fn_c_try_link "$LINENO" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } ax_cv_have_c_atomics=1 -$as_echo "#define HAVE_C_ATOMICS 1" >>confdefs.h +printf "%s\n" "#define HAVE_C_ATOMICS 1" >>confdefs.h -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext if test -z $ax_cv_have_c_atomics$ax_cv_have_gcc_atomics; then @@ -18457,47 +20369,50 @@ fi # glibc, AFAIK, is the only C library that makes printing a NULL to a string safe. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if your system printf is NULL-safe." >&5 -$as_echo_n "checking if your system printf is NULL-safe.... " >&6; } -if test "$cross_compiling" = yes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if your system printf is NULL-safe." >&5 +printf %s "checking if your system printf is NULL-safe.... " >&6; } +if test "$cross_compiling" = yes +then : # It's unlikely an embedded system will have this. - { $as_echo "$as_me:${as_lineno-$LINENO}: result: unknown" >&5 -$as_echo "unknown" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unknown" >&5 +printf "%s\n" "unknown" >&6; } -else +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int -main () +main (void) { printf("%s", NULL) ; return 0; } _ACEOF -if ac_fn_c_try_run "$LINENO"; then : +if ac_fn_c_try_run "$LINENO" +then : -$as_echo "#define HAVE_NULLSAFE_PRINTF 1" >>confdefs.h +printf "%s\n" "#define HAVE_NULLSAFE_PRINTF 1" >>confdefs.h - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if socket() accepts SOCK_NONBLOCK" >&5 -$as_echo_n "checking if socket() accepts SOCK_NONBLOCK... " >&6; } -if test "$cross_compiling" = yes; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: cross-compile" >&5 -$as_echo "cross-compile" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if socket() accepts SOCK_NONBLOCK" >&5 +printf %s "checking if socket() accepts SOCK_NONBLOCK... " >&6; } +if test "$cross_compiling" = yes +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: cross-compile" >&5 +printf "%s\n" "cross-compile" >&6; } -else +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -18509,7 +20424,7 @@ #endif int -main () +main (void) { if (socket(AF_INET, SOCK_STREAM | SOCK_NONBLOCK, 0) < 0) { @@ -18521,28 +20436,30 @@ return 0; } _ACEOF -if ac_fn_c_try_run "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - -$as_echo "#define HAVE_SOCK_NONBLOCK 1" >>confdefs.h - -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } +if ac_fn_c_try_run "$LINENO" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + +printf "%s\n" "#define HAVE_SOCK_NONBLOCK 1" >>confdefs.h + +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can increase the maximum select-able file descriptor" >&5 -$as_echo_n "checking if we can increase the maximum select-able file descriptor... " >&6; } -if test "$cross_compiling" = yes; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: cross-compile" >&5 -$as_echo "cross-compile" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if we can increase the maximum select-able file descriptor" >&5 +printf %s "checking if we can increase the maximum select-able file descriptor... " >&6; } +if test "$cross_compiling" = yes +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: cross-compile" >&5 +printf "%s\n" "cross-compile" >&6; } -else +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -18559,7 +20476,7 @@ #include int -main () +main (void) { struct rlimit rlim = { FD_SETSIZE * 2, FD_SETSIZE * 2 }; @@ -18577,15 +20494,16 @@ return 0; } _ACEOF -if ac_fn_c_try_run "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - -$as_echo "#define HAVE_VARIABLE_FDSET 1" >>confdefs.h - -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } +if ac_fn_c_try_run "$LINENO" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + +printf "%s\n" "#define HAVE_VARIABLE_FDSET 1" >>confdefs.h + +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext @@ -18593,12 +20511,13 @@ if test "${ac_cv_have_variable_fdset}x" = "0x"; then - if test "$cross_compiling" = yes; then : - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + if test "$cross_compiling" = yes +then : + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot run test program while cross compiling See \`config.log' for more details" "$LINENO" 5; } -else +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -18607,16 +20526,17 @@ #include int -main () +main (void) { if (getuid() != 0) { exit(1); } ; return 0; } _ACEOF -if ac_fn_c_try_run "$LINENO"; then : +if ac_fn_c_try_run "$LINENO" +then : -$as_echo "#define CONFIGURE_RAN_AS_ROOT 1" >>confdefs.h +printf "%s\n" "#define CONFIGURE_RAN_AS_ROOT 1" >>confdefs.h fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ @@ -18625,33 +20545,35 @@ fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if we have usable eventfd support" >&5 -$as_echo_n "checking if we have usable eventfd support... " >&6; } -if test "$cross_compiling" = yes; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: cross-compile" >&5 -$as_echo "cross-compile" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if we have usable eventfd support" >&5 +printf %s "checking if we have usable eventfd support... " >&6; } +if test "$cross_compiling" = yes +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: cross-compile" >&5 +printf "%s\n" "cross-compile" >&6; } -else +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int -main () +main (void) { return eventfd(0, EFD_NONBLOCK | EFD_SEMAPHORE) == -1; ; return 0; } _ACEOF -if ac_fn_c_try_run "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - -$as_echo "#define HAVE_EVENTFD 1" >>confdefs.h - -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } +if ac_fn_c_try_run "$LINENO" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + +printf "%s\n" "#define HAVE_EVENTFD 1" >>confdefs.h + +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext @@ -18659,8 +20581,8 @@ -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for compiler 'attribute pure' support" >&5 -$as_echo_n "checking for compiler 'attribute pure' support... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for compiler 'attribute pure' support" >&5 +printf %s "checking for compiler 'attribute pure' support... " >&6; } saved_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -Wall -Wno-unused -Werror" @@ -18670,37 +20592,36 @@ /* end confdefs.h. */ void __attribute__((pure)) *test(void *muffin, ...) {return (void *) 0;} int -main () +main (void) { ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } +if ac_fn_c_try_compile "$LINENO" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } ax_cv_have_func_attribute_pure=1 -cat >>confdefs.h <<_ACEOF -#define HAVE_ATTRIBUTE_pure 1 -_ACEOF +printf "%s\n" "#define HAVE_ATTRIBUTE_pure 1" >>confdefs.h -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext CFLAGS="$saved_CFLAGS" -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for compiler 'attribute malloc' support" >&5 -$as_echo_n "checking for compiler 'attribute malloc' support... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for compiler 'attribute malloc' support" >&5 +printf %s "checking for compiler 'attribute malloc' support... " >&6; } saved_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -Wall -Wno-unused -Werror" @@ -18710,37 +20631,36 @@ /* end confdefs.h. */ void __attribute__((malloc)) *test(void *muffin, ...) {return (void *) 0;} int -main () +main (void) { ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } +if ac_fn_c_try_compile "$LINENO" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } ax_cv_have_func_attribute_malloc=1 -cat >>confdefs.h <<_ACEOF -#define HAVE_ATTRIBUTE_malloc 1 -_ACEOF +printf "%s\n" "#define HAVE_ATTRIBUTE_malloc 1" >>confdefs.h -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext CFLAGS="$saved_CFLAGS" -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for compiler 'attribute const' support" >&5 -$as_echo_n "checking for compiler 'attribute const' support... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for compiler 'attribute const' support" >&5 +printf %s "checking for compiler 'attribute const' support... " >&6; } saved_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -Wall -Wno-unused -Werror" @@ -18750,37 +20670,36 @@ /* end confdefs.h. */ void __attribute__((const)) *test(void *muffin, ...) {return (void *) 0;} int -main () +main (void) { ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } +if ac_fn_c_try_compile "$LINENO" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } ax_cv_have_func_attribute_const=1 -cat >>confdefs.h <<_ACEOF -#define HAVE_ATTRIBUTE_const 1 -_ACEOF +printf "%s\n" "#define HAVE_ATTRIBUTE_const 1" >>confdefs.h -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext CFLAGS="$saved_CFLAGS" -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for compiler 'attribute unused' support" >&5 -$as_echo_n "checking for compiler 'attribute unused' support... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for compiler 'attribute unused' support" >&5 +printf %s "checking for compiler 'attribute unused' support... " >&6; } saved_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -Wall -Wno-unused -Werror" @@ -18790,37 +20709,36 @@ /* end confdefs.h. */ void __attribute__((unused)) *test(void *muffin, ...) {return (void *) 0;} int -main () +main (void) { ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } +if ac_fn_c_try_compile "$LINENO" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } ax_cv_have_func_attribute_unused=1 -cat >>confdefs.h <<_ACEOF -#define HAVE_ATTRIBUTE_unused 1 -_ACEOF +printf "%s\n" "#define HAVE_ATTRIBUTE_unused 1" >>confdefs.h -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext CFLAGS="$saved_CFLAGS" -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for compiler 'attribute always_inline' support" >&5 -$as_echo_n "checking for compiler 'attribute always_inline' support... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for compiler 'attribute always_inline' support" >&5 +printf %s "checking for compiler 'attribute always_inline' support... " >&6; } saved_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -Wall -Wno-unused -Werror" @@ -18830,37 +20748,36 @@ /* end confdefs.h. */ void __attribute__((always_inline)) *test(void *muffin, ...) {return (void *) 0;} int -main () +main (void) { ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } +if ac_fn_c_try_compile "$LINENO" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } ax_cv_have_func_attribute_always_inline=1 -cat >>confdefs.h <<_ACEOF -#define HAVE_ATTRIBUTE_always_inline 1 -_ACEOF +printf "%s\n" "#define HAVE_ATTRIBUTE_always_inline 1" >>confdefs.h -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext CFLAGS="$saved_CFLAGS" -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for compiler 'attribute deprecated' support" >&5 -$as_echo_n "checking for compiler 'attribute deprecated' support... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for compiler 'attribute deprecated' support" >&5 +printf %s "checking for compiler 'attribute deprecated' support... " >&6; } saved_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -Wall -Wno-unused -Werror" @@ -18870,37 +20787,36 @@ /* end confdefs.h. */ void __attribute__((deprecated)) *test(void *muffin, ...) {return (void *) 0;} int -main () +main (void) { ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } +if ac_fn_c_try_compile "$LINENO" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } ax_cv_have_func_attribute_deprecated=1 -cat >>confdefs.h <<_ACEOF -#define HAVE_ATTRIBUTE_deprecated 1 -_ACEOF +printf "%s\n" "#define HAVE_ATTRIBUTE_deprecated 1" >>confdefs.h -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext CFLAGS="$saved_CFLAGS" -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for compiler 'attribute sentinel' support" >&5 -$as_echo_n "checking for compiler 'attribute sentinel' support... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for compiler 'attribute sentinel' support" >&5 +printf %s "checking for compiler 'attribute sentinel' support... " >&6; } saved_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -Wall -Wno-unused -Werror" @@ -18910,37 +20826,36 @@ /* end confdefs.h. */ void __attribute__((sentinel)) *test(void *muffin, ...) {return (void *) 0;} int -main () +main (void) { ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } +if ac_fn_c_try_compile "$LINENO" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } ax_cv_have_func_attribute_sentinel=1 -cat >>confdefs.h <<_ACEOF -#define HAVE_ATTRIBUTE_sentinel 1 -_ACEOF +printf "%s\n" "#define HAVE_ATTRIBUTE_sentinel 1" >>confdefs.h -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext CFLAGS="$saved_CFLAGS" -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for compiler 'attribute warn_unused_result' support" >&5 -$as_echo_n "checking for compiler 'attribute warn_unused_result' support... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for compiler 'attribute warn_unused_result' support" >&5 +printf %s "checking for compiler 'attribute warn_unused_result' support... " >&6; } saved_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -Wall -Wno-unused -Werror" @@ -18950,37 +20865,36 @@ /* end confdefs.h. */ void __attribute__((warn_unused_result)) *test(void *muffin, ...) {return (void *) 0;} int -main () +main (void) { ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } +if ac_fn_c_try_compile "$LINENO" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } ax_cv_have_func_attribute_warn_unused_result=1 -cat >>confdefs.h <<_ACEOF -#define HAVE_ATTRIBUTE_warn_unused_result 1 -_ACEOF +printf "%s\n" "#define HAVE_ATTRIBUTE_warn_unused_result 1" >>confdefs.h -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext CFLAGS="$saved_CFLAGS" -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for compiler 'attribute may_alias' support" >&5 -$as_echo_n "checking for compiler 'attribute may_alias' support... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for compiler 'attribute may_alias' support" >&5 +printf %s "checking for compiler 'attribute may_alias' support... " >&6; } saved_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -Wall -Wno-unused -Werror" @@ -18990,37 +20904,36 @@ /* end confdefs.h. */ void __attribute__((may_alias)) *test(void *muffin, ...) {return (void *) 0;} int -main () +main (void) { ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } +if ac_fn_c_try_compile "$LINENO" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } ax_cv_have_func_attribute_may_alias=1 -cat >>confdefs.h <<_ACEOF -#define HAVE_ATTRIBUTE_may_alias 1 -_ACEOF +printf "%s\n" "#define HAVE_ATTRIBUTE_may_alias 1" >>confdefs.h -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext CFLAGS="$saved_CFLAGS" -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for compiler 'attribute constructor' support" >&5 -$as_echo_n "checking for compiler 'attribute constructor' support... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for compiler 'attribute constructor' support" >&5 +printf %s "checking for compiler 'attribute constructor' support... " >&6; } saved_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -Wall -Wno-unused -Werror" @@ -19030,29 +20943,28 @@ /* end confdefs.h. */ void __attribute__((constructor)) *test(void *muffin, ...) {return (void *) 0;} int -main () +main (void) { ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } +if ac_fn_c_try_compile "$LINENO" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } ax_cv_have_func_attribute_constructor=1 -cat >>confdefs.h <<_ACEOF -#define HAVE_ATTRIBUTE_constructor 1 -_ACEOF +printf "%s\n" "#define HAVE_ATTRIBUTE_constructor 1" >>confdefs.h -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext CFLAGS="$saved_CFLAGS" @@ -19063,8 +20975,8 @@ fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for compiler 'attribute destructor' support" >&5 -$as_echo_n "checking for compiler 'attribute destructor' support... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for compiler 'attribute destructor' support" >&5 +printf %s "checking for compiler 'attribute destructor' support... " >&6; } saved_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -Wall -Wno-unused -Werror" @@ -19074,29 +20986,28 @@ /* end confdefs.h. */ void __attribute__((destructor)) *test(void *muffin, ...) {return (void *) 0;} int -main () +main (void) { ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } +if ac_fn_c_try_compile "$LINENO" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } ax_cv_have_func_attribute_destructor=1 -cat >>confdefs.h <<_ACEOF -#define HAVE_ATTRIBUTE_destructor 1 -_ACEOF +printf "%s\n" "#define HAVE_ATTRIBUTE_destructor 1" >>confdefs.h -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext CFLAGS="$saved_CFLAGS" @@ -19106,8 +21017,8 @@ as_fn_error $? "*** Function destructor attribute is not supported by your compiler." "$LINENO" 5 fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for compiler 'attribute noreturn' support" >&5 -$as_echo_n "checking for compiler 'attribute noreturn' support... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for compiler 'attribute noreturn' support" >&5 +printf %s "checking for compiler 'attribute noreturn' support... " >&6; } saved_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -Wall -Wno-unused -Werror" @@ -19117,37 +21028,36 @@ /* end confdefs.h. */ void __attribute__((noreturn)) *test(void *muffin, ...) ; int -main () +main (void) { ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } +if ac_fn_c_try_compile "$LINENO" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } ax_cv_have_func_attribute_noreturn=1 -cat >>confdefs.h <<_ACEOF -#define HAVE_ATTRIBUTE_noreturn 1 -_ACEOF +printf "%s\n" "#define HAVE_ATTRIBUTE_noreturn 1" >>confdefs.h -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext CFLAGS="$saved_CFLAGS" -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for -fsanitize=address support" >&5 -$as_echo_n "checking for -fsanitize=address support... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for -fsanitize=address support" >&5 +printf %s "checking for -fsanitize=address support... " >&6; } saved_sanitize_CFLAGS="${CFLAGS}" saved_sanitize_LDFLAGS="${LDFLAGS}" CFLAGS="-fsanitize=address -fno-omit-frame-pointer" @@ -19156,30 +21066,31 @@ /* end confdefs.h. */ int -main () +main (void) { int x = 1; ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } +if ac_fn_c_try_compile "$LINENO" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } AST_ADDRESS_SANITIZER=1 -else +else $as_nop AST_ADDRESS_SANITIZER=0 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext CFLAGS="${saved_sanitize_CFLAGS}" LDFLAGS="${saved_sanitize_LDFLAGS}" -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for -fsanitize=thread support" >&5 -$as_echo_n "checking for -fsanitize=thread support... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for -fsanitize=thread support" >&5 +printf %s "checking for -fsanitize=thread support... " >&6; } saved_sanitize_CFLAGS="${CFLAGS}" saved_sanitize_LDFLAGS="${LDFLAGS}" CFLAGS="-fno-omit-frame-pointer -pie -fPIE -fsanitize=thread" @@ -19188,30 +21099,31 @@ /* end confdefs.h. */ int -main () +main (void) { int x = 1; ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } +if ac_fn_c_try_compile "$LINENO" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } AST_THREAD_SANITIZER=1 -else +else $as_nop AST_THREAD_SANITIZER=0 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext CFLAGS="${saved_sanitize_CFLAGS}" LDFLAGS="${saved_sanitize_LDFLAGS}" -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for -fsanitize=leak support" >&5 -$as_echo_n "checking for -fsanitize=leak support... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for -fsanitize=leak support" >&5 +printf %s "checking for -fsanitize=leak support... " >&6; } saved_sanitize_CFLAGS="${CFLAGS}" saved_sanitize_LDFLAGS="${LDFLAGS}" CFLAGS="-fno-omit-frame-pointer -fsanitize=leak" @@ -19220,30 +21132,31 @@ /* end confdefs.h. */ int -main () +main (void) { int x = 1; ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } +if ac_fn_c_try_compile "$LINENO" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } AST_LEAK_SANITIZER=1 -else +else $as_nop AST_LEAK_SANITIZER=0 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext CFLAGS="${saved_sanitize_CFLAGS}" LDFLAGS="${saved_sanitize_LDFLAGS}" -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for -fsanitize=undefined support" >&5 -$as_echo_n "checking for -fsanitize=undefined support... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for -fsanitize=undefined support" >&5 +printf %s "checking for -fsanitize=undefined support... " >&6; } saved_sanitize_CFLAGS="${CFLAGS}" saved_sanitize_LDFLAGS="${LDFLAGS}" CFLAGS="-fno-omit-frame-pointer -fsanitize=undefined" @@ -19252,194 +21165,198 @@ /* end confdefs.h. */ int -main () +main (void) { int x = 1; ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } +if ac_fn_c_try_compile "$LINENO" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } AST_UNDEFINED_SANITIZER=1 -else +else $as_nop AST_UNDEFINED_SANITIZER=0 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext CFLAGS="${saved_sanitize_CFLAGS}" LDFLAGS="${saved_sanitize_LDFLAGS}" -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for -Wdeclaration-after-statement support" >&5 -$as_echo_n "checking for -Wdeclaration-after-statement support... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for -Wdeclaration-after-statement support" >&5 +printf %s "checking for -Wdeclaration-after-statement support... " >&6; } if $(${CC} -Wdeclaration-after-statement -Werror -S -o /dev/null -xc /dev/null > /dev/null 2>&1); then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } AST_DECLARATION_AFTER_STATEMENT=-Wdeclaration-after-statement else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } AST_DECLARATION_AFTER_STATEMENT= fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for -Wtrampolines support" >&5 -$as_echo_n "checking for -Wtrampolines support... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for -Wtrampolines support" >&5 +printf %s "checking for -Wtrampolines support... " >&6; } if $(${CC} -Wtrampolines -Werror -S -o /dev/null -xc /dev/null > /dev/null 2>&1); then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } AST_TRAMPOLINES=-Wtrampolines else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } AST_TRAMPOLINES= fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for _FORTIFY_SOURCE support" >&5 -$as_echo_n "checking for _FORTIFY_SOURCE support... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for _FORTIFY_SOURCE support" >&5 +printf %s "checking for _FORTIFY_SOURCE support... " >&6; } if $(${CC} -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -S -o /dev/null -xc /dev/null > /dev/null 2>&1); then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } AST_FORTIFY_SOURCE="-U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2" else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } AST_FORTIFY_SOURCE= fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for -fno-strict-overflow" >&5 -$as_echo_n "checking for -fno-strict-overflow... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for -fno-strict-overflow" >&5 +printf %s "checking for -fno-strict-overflow... " >&6; } if $(${CC} -O2 -fno-strict-overflow -S -o /dev/null -xc /dev/null > /dev/null 2>&1); then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } AST_NO_STRICT_OVERFLOW=-fno-strict-overflow else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } AST_NO_STRICT_OVERFLOW= fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for -Wno-format-truncation" >&5 -$as_echo_n "checking for -Wno-format-truncation... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for -Wno-format-truncation" >&5 +printf %s "checking for -Wno-format-truncation... " >&6; } if $(${CC} -Wno-format-truncation -Werror -S -o /dev/null -xc /dev/null > /dev/null 2>&1); then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } AST_NO_FORMAT_TRUNCATION=-Wno-format-truncation else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } AST_NO_FORMAT_TRUNCATION= fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for -Wno-stringop-truncation" >&5 -$as_echo_n "checking for -Wno-stringop-truncation... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for -Wno-stringop-truncation" >&5 +printf %s "checking for -Wno-stringop-truncation... " >&6; } if $(${CC} -Wno-stringop-truncation -Werror -S -o /dev/null -xc /dev/null > /dev/null 2>&1); then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } AST_NO_STRINGOP_TRUNCATION=-Wno-stringop-truncation else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } AST_NO_STRINGOP_TRUNCATION= fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for -Wshadow" >&5 -$as_echo_n "checking for -Wshadow... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for -Wshadow" >&5 +printf %s "checking for -Wshadow... " >&6; } if $(${CC} -Wshadow -Werror -S -o /dev/null -xc /dev/null > /dev/null 2>&1); then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } AST_SHADOW_WARNINGS=-Wshadow else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } AST_SHADOW_WARNINGS= fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for -march=native support" >&5 -$as_echo_n "checking for -march=native support... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for -march=native support" >&5 +printf %s "checking for -march=native support... " >&6; } if $(${CC} -march=native -S -o /dev/null -xc /dev/null > /dev/null 2>&1); then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } AST_NATIVE_ARCH=1 else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } AST_NATIVE_ARCH=0 fi # Check whether --enable-rpath was given. -if test "${enable_rpath+set}" = set; then : +if test ${enable_rpath+y} +then : enableval=$enable_rpath; case "${enableval}" in y|ye|yes) check_rpath=yes ;; n|no) check_rpath=no ;; *) as_fn_error $? "bad value ${enableval} for --disable-rpath" "$LINENO" 5 ;; esac -else +else $as_nop check_rpath=yes fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use rpath" >&5 -$as_echo_n "checking whether to use rpath... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to use rpath" >&5 +printf %s "checking whether to use rpath... " >&6; } AST_RPATH= if test "${OSARCH}" = "NetBSD"; then AST_RPATH="-Wl,-rpath,/usr/pkg/lib" fi if test "${check_rpath}" != yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: skipped" >&5 -$as_echo "skipped" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: skipped" >&5 +printf "%s\n" "skipped" >&6; } elif test "${prefix}" = /usr || test "${prefix}" = NONE; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: not needed" >&5 -$as_echo "not needed" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: not needed" >&5 +printf "%s\n" "not needed" >&6; } else AST_RPATH="-Wl,-rpath,${libdir}" fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysinfo" >&5 -$as_echo_n "checking for sysinfo... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for sysinfo" >&5 +printf %s "checking for sysinfo... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int -main () +main (void) { struct sysinfo sys_info; int uptime = sys_info.uptime ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } +if ac_fn_c_try_link "$LINENO" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } -$as_echo "#define HAVE_SYSINFO 1" >>confdefs.h +printf "%s\n" "#define HAVE_SYSINFO 1" >>confdefs.h -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing res_9_ninit" >&5 -$as_echo_n "checking for library containing res_9_ninit... " >&6; } -if ${ac_cv_search_res_9_ninit+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for library containing res_9_ninit" >&5 +printf %s "checking for library containing res_9_ninit... " >&6; } +if test ${ac_cv_search_res_9_ninit+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_func_search_save_LIBS=$LIBS cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -19447,52 +21364,54 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char res_9_ninit (); int -main () +main (void) { return res_9_ninit (); ; return 0; } _ACEOF -for ac_lib in '' resolv; do +for ac_lib in '' resolv +do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi - if ac_fn_c_try_link "$LINENO"; then : + if ac_fn_c_try_link "$LINENO" +then : ac_cv_search_res_9_ninit=$ac_res fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext - if ${ac_cv_search_res_9_ninit+:} false; then : + if test ${ac_cv_search_res_9_ninit+y} +then : break fi done -if ${ac_cv_search_res_9_ninit+:} false; then : +if test ${ac_cv_search_res_9_ninit+y} +then : -else +else $as_nop ac_cv_search_res_9_ninit=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_res_9_ninit" >&5 -$as_echo "$ac_cv_search_res_9_ninit" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_res_9_ninit" >&5 +printf "%s\n" "$ac_cv_search_res_9_ninit" >&6; } ac_res=$ac_cv_search_res_9_ninit -if test "$ac_res" != no; then : +if test "$ac_res" != no +then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for res_ninit" >&5 -$as_echo_n "checking for res_ninit... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for res_ninit" >&5 +printf %s "checking for res_ninit... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -19507,24 +21426,26 @@ #endif #include int -main () +main (void) { int foo = res_ninit(NULL); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - -$as_echo "#define HAVE_RES_NINIT 1" >>confdefs.h - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing res_9_ndestroy" >&5 -$as_echo_n "checking for library containing res_9_ndestroy... " >&6; } -if ${ac_cv_search_res_9_ndestroy+:} false; then : - $as_echo_n "(cached) " >&6 -else +if ac_fn_c_try_link "$LINENO" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + +printf "%s\n" "#define HAVE_RES_NINIT 1" >>confdefs.h + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for library containing res_9_ndestroy" >&5 +printf %s "checking for library containing res_9_ndestroy... " >&6; } +if test ${ac_cv_search_res_9_ndestroy+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_func_search_save_LIBS=$LIBS cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -19532,52 +21453,54 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char res_9_ndestroy (); int -main () +main (void) { return res_9_ndestroy (); ; return 0; } _ACEOF -for ac_lib in '' resolv; do +for ac_lib in '' resolv +do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi - if ac_fn_c_try_link "$LINENO"; then : + if ac_fn_c_try_link "$LINENO" +then : ac_cv_search_res_9_ndestroy=$ac_res fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext - if ${ac_cv_search_res_9_ndestroy+:} false; then : + if test ${ac_cv_search_res_9_ndestroy+y} +then : break fi done -if ${ac_cv_search_res_9_ndestroy+:} false; then : +if test ${ac_cv_search_res_9_ndestroy+y} +then : -else +else $as_nop ac_cv_search_res_9_ndestroy=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_res_9_ndestroy" >&5 -$as_echo "$ac_cv_search_res_9_ndestroy" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_res_9_ndestroy" >&5 +printf "%s\n" "$ac_cv_search_res_9_ndestroy" >&6; } ac_res=$ac_cv_search_res_9_ndestroy -if test "$ac_res" != no; then : +if test "$ac_res" != no +then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for res_ndestroy" >&5 -$as_echo_n "checking for res_ndestroy... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for res_ndestroy" >&5 +printf %s "checking for res_ndestroy... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -19592,31 +21515,33 @@ #endif #include int -main () +main (void) { res_ndestroy(NULL); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - -$as_echo "#define HAVE_RES_NDESTROY 1" >>confdefs.h - -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing res_9_close" >&5 -$as_echo_n "checking for library containing res_9_close... " >&6; } -if ${ac_cv_search_res_9_close+:} false; then : - $as_echo_n "(cached) " >&6 -else +if ac_fn_c_try_link "$LINENO" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + +printf "%s\n" "#define HAVE_RES_NDESTROY 1" >>confdefs.h + +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for library containing res_9_close" >&5 +printf %s "checking for library containing res_9_close... " >&6; } +if test ${ac_cv_search_res_9_close+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_func_search_save_LIBS=$LIBS cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -19624,52 +21549,54 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char res_9_close (); int -main () +main (void) { return res_9_close (); ; return 0; } _ACEOF -for ac_lib in '' resolv; do +for ac_lib in '' resolv +do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi - if ac_fn_c_try_link "$LINENO"; then : + if ac_fn_c_try_link "$LINENO" +then : ac_cv_search_res_9_close=$ac_res fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext - if ${ac_cv_search_res_9_close+:} false; then : + if test ${ac_cv_search_res_9_close+y} +then : break fi done -if ${ac_cv_search_res_9_close+:} false; then : +if test ${ac_cv_search_res_9_close+y} +then : -else +else $as_nop ac_cv_search_res_9_close=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_res_9_close" >&5 -$as_echo "$ac_cv_search_res_9_close" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_res_9_close" >&5 +printf "%s\n" "$ac_cv_search_res_9_close" >&6; } ac_res=$ac_cv_search_res_9_close -if test "$ac_res" != no; then : +if test "$ac_res" != no +then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for res_close" >&5 -$as_echo_n "checking for res_close... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for res_close" >&5 +printf %s "checking for res_close... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -19684,47 +21611,47 @@ #endif #include int -main () +main (void) { res_close(); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } +if ac_fn_c_try_link "$LINENO" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } -$as_echo "#define HAVE_RES_CLOSE 1" >>confdefs.h +printf "%s\n" "#define HAVE_RES_CLOSE 1" >>confdefs.h -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext ac_fn_c_check_member "$LINENO" "struct __res_state" "_u._ext.nsaddrs" "ac_cv_member_struct___res_state__u__ext_nsaddrs" "#include " -if test "x$ac_cv_member_struct___res_state__u__ext_nsaddrs" = xyes; then : +if test "x$ac_cv_member_struct___res_state__u__ext_nsaddrs" = xyes +then : -cat >>confdefs.h <<_ACEOF -#define HAVE_STRUCT___RES_STATE__U__EXT_NSADDRS 1 -_ACEOF +printf "%s\n" "#define HAVE_STRUCT___RES_STATE__U__EXT_NSADDRS 1" >>confdefs.h fi -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for BIND_8_COMPAT required" >&5 -$as_echo_n "checking for BIND_8_COMPAT required... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for BIND_8_COMPAT required" >&5 +printf %s "checking for BIND_8_COMPAT required... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -19732,28 +21659,29 @@ #include int -main () +main (void) { int x = NXDOMAIN ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } +if ac_fn_c_try_compile "$LINENO" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } BIND8_CFLAGS=-DBIND_8_COMPAT fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext if test "x${PBX_GLOB_NOMAGIC}" != "x1"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GLOB_NOMAGIC in glob.h" >&5 -$as_echo_n "checking for GLOB_NOMAGIC in glob.h... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for GLOB_NOMAGIC in glob.h" >&5 +printf %s "checking for GLOB_NOMAGIC in glob.h... " >&6; } saved_cppflags="${CPPFLAGS}" if test "x${GLOB_NOMAGIC_DIR}" != "x"; then GLOB_NOMAGIC_INCLUDE="-I${GLOB_NOMAGIC_DIR}/include" @@ -19764,7 +21692,7 @@ /* end confdefs.h. */ #include int -main () +main (void) { #if defined(GLOB_NOMAGIC) int foo = 0; @@ -19777,21 +21705,22 @@ return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } +if ac_fn_c_try_compile "$LINENO" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } PBX_GLOB_NOMAGIC=1 -$as_echo "#define HAVE_GLOB_NOMAGIC 1" >>confdefs.h +printf "%s\n" "#define HAVE_GLOB_NOMAGIC 1" >>confdefs.h -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext CPPFLAGS="${saved_cppflags}" fi @@ -19799,8 +21728,8 @@ if test "x${PBX_GLOB_BRACE}" != "x1"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GLOB_BRACE in glob.h" >&5 -$as_echo_n "checking for GLOB_BRACE in glob.h... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for GLOB_BRACE in glob.h" >&5 +printf %s "checking for GLOB_BRACE in glob.h... " >&6; } saved_cppflags="${CPPFLAGS}" if test "x${GLOB_BRACE_DIR}" != "x"; then GLOB_BRACE_INCLUDE="-I${GLOB_BRACE_DIR}/include" @@ -19811,7 +21740,7 @@ /* end confdefs.h. */ #include int -main () +main (void) { #if defined(GLOB_BRACE) int foo = 0; @@ -19824,21 +21753,22 @@ return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } +if ac_fn_c_try_compile "$LINENO" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } PBX_GLOB_BRACE=1 -$as_echo "#define HAVE_GLOB_BRACE 1" >>confdefs.h +printf "%s\n" "#define HAVE_GLOB_BRACE 1" >>confdefs.h -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext CPPFLAGS="${saved_cppflags}" fi @@ -19846,8 +21776,8 @@ if test "x${PBX_RTLD_NOLOAD}" != "x1"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for RTLD_NOLOAD in dlfcn.h" >&5 -$as_echo_n "checking for RTLD_NOLOAD in dlfcn.h... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for RTLD_NOLOAD in dlfcn.h" >&5 +printf %s "checking for RTLD_NOLOAD in dlfcn.h... " >&6; } saved_cppflags="${CPPFLAGS}" if test "x${RTLD_NOLOAD_DIR}" != "x"; then RTLD_NOLOAD_INCLUDE="-I${RTLD_NOLOAD_DIR}/include" @@ -19858,7 +21788,7 @@ /* end confdefs.h. */ #include int -main () +main (void) { #if defined(RTLD_NOLOAD) int foo = 0; @@ -19871,21 +21801,22 @@ return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } +if ac_fn_c_try_compile "$LINENO" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } PBX_RTLD_NOLOAD=1 -$as_echo "#define HAVE_RTLD_NOLOAD 1" >>confdefs.h +printf "%s\n" "#define HAVE_RTLD_NOLOAD 1" >>confdefs.h -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext CPPFLAGS="${saved_cppflags}" fi @@ -19893,8 +21824,8 @@ if test "x${PBX_IP_MTU_DISCOVER}" != "x1"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for IP_MTU_DISCOVER in netinet/in.h" >&5 -$as_echo_n "checking for IP_MTU_DISCOVER in netinet/in.h... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for IP_MTU_DISCOVER in netinet/in.h" >&5 +printf %s "checking for IP_MTU_DISCOVER in netinet/in.h... " >&6; } saved_cppflags="${CPPFLAGS}" if test "x${IP_MTU_DISCOVER_DIR}" != "x"; then IP_MTU_DISCOVER_INCLUDE="-I${IP_MTU_DISCOVER_DIR}/include" @@ -19905,7 +21836,7 @@ /* end confdefs.h. */ #include int -main () +main (void) { #if defined(IP_MTU_DISCOVER) int foo = 0; @@ -19918,21 +21849,22 @@ return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } +if ac_fn_c_try_compile "$LINENO" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } PBX_IP_MTU_DISCOVER=1 -$as_echo "#define HAVE_IP_MTU_DISCOVER 1" >>confdefs.h +printf "%s\n" "#define HAVE_IP_MTU_DISCOVER 1" >>confdefs.h -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext CPPFLAGS="${saved_cppflags}" fi @@ -19942,17 +21874,19 @@ # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of int" >&5 -$as_echo_n "checking size of int... " >&6; } -if ${ac_cv_sizeof_int+:} false; then : - $as_echo_n "(cached) " >&6 -else - if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (int))" "ac_cv_sizeof_int" "$ac_includes_default"; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking size of int" >&5 +printf %s "checking size of int... " >&6; } +if test ${ac_cv_sizeof_int+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (int))" "ac_cv_sizeof_int" "$ac_includes_default" +then : -else +else $as_nop if test "$ac_cv_type_int" = yes; then - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "cannot compute sizeof (int) See \`config.log' for more details" "$LINENO" 5; } else @@ -19961,31 +21895,31 @@ fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_int" >&5 -$as_echo "$ac_cv_sizeof_int" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_int" >&5 +printf "%s\n" "$ac_cv_sizeof_int" >&6; } -cat >>confdefs.h <<_ACEOF -#define SIZEOF_INT $ac_cv_sizeof_int -_ACEOF +printf "%s\n" "#define SIZEOF_INT $ac_cv_sizeof_int" >>confdefs.h # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of long" >&5 -$as_echo_n "checking size of long... " >&6; } -if ${ac_cv_sizeof_long+:} false; then : - $as_echo_n "(cached) " >&6 -else - if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (long))" "ac_cv_sizeof_long" "$ac_includes_default"; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking size of long" >&5 +printf %s "checking size of long... " >&6; } +if test ${ac_cv_sizeof_long+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (long))" "ac_cv_sizeof_long" "$ac_includes_default" +then : -else +else $as_nop if test "$ac_cv_type_long" = yes; then - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "cannot compute sizeof (long) See \`config.log' for more details" "$LINENO" 5; } else @@ -19994,31 +21928,31 @@ fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_long" >&5 -$as_echo "$ac_cv_sizeof_long" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_long" >&5 +printf "%s\n" "$ac_cv_sizeof_long" >&6; } -cat >>confdefs.h <<_ACEOF -#define SIZEOF_LONG $ac_cv_sizeof_long -_ACEOF +printf "%s\n" "#define SIZEOF_LONG $ac_cv_sizeof_long" >>confdefs.h # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of long long" >&5 -$as_echo_n "checking size of long long... " >&6; } -if ${ac_cv_sizeof_long_long+:} false; then : - $as_echo_n "(cached) " >&6 -else - if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (long long))" "ac_cv_sizeof_long_long" "$ac_includes_default"; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking size of long long" >&5 +printf %s "checking size of long long... " >&6; } +if test ${ac_cv_sizeof_long_long+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (long long))" "ac_cv_sizeof_long_long" "$ac_includes_default" +then : -else +else $as_nop if test "$ac_cv_type_long_long" = yes; then - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "cannot compute sizeof (long long) See \`config.log' for more details" "$LINENO" 5; } else @@ -20027,31 +21961,31 @@ fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_long_long" >&5 -$as_echo "$ac_cv_sizeof_long_long" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_long_long" >&5 +printf "%s\n" "$ac_cv_sizeof_long_long" >&6; } -cat >>confdefs.h <<_ACEOF -#define SIZEOF_LONG_LONG $ac_cv_sizeof_long_long -_ACEOF +printf "%s\n" "#define SIZEOF_LONG_LONG $ac_cv_sizeof_long_long" >>confdefs.h # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of char *" >&5 -$as_echo_n "checking size of char *... " >&6; } -if ${ac_cv_sizeof_char_p+:} false; then : - $as_echo_n "(cached) " >&6 -else - if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (char *))" "ac_cv_sizeof_char_p" "$ac_includes_default"; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking size of char *" >&5 +printf %s "checking size of char *... " >&6; } +if test ${ac_cv_sizeof_char_p+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (char *))" "ac_cv_sizeof_char_p" "$ac_includes_default" +then : -else +else $as_nop if test "$ac_cv_type_char_p" = yes; then - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "cannot compute sizeof (char *) See \`config.log' for more details" "$LINENO" 5; } else @@ -20060,31 +21994,31 @@ fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_char_p" >&5 -$as_echo "$ac_cv_sizeof_char_p" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_char_p" >&5 +printf "%s\n" "$ac_cv_sizeof_char_p" >&6; } -cat >>confdefs.h <<_ACEOF -#define SIZEOF_CHAR_P $ac_cv_sizeof_char_p -_ACEOF +printf "%s\n" "#define SIZEOF_CHAR_P $ac_cv_sizeof_char_p" >>confdefs.h # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of long" >&5 -$as_echo_n "checking size of long... " >&6; } -if ${ac_cv_sizeof_long+:} false; then : - $as_echo_n "(cached) " >&6 -else - if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (long))" "ac_cv_sizeof_long" "$ac_includes_default"; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking size of long" >&5 +printf %s "checking size of long... " >&6; } +if test ${ac_cv_sizeof_long+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (long))" "ac_cv_sizeof_long" "$ac_includes_default" +then : -else +else $as_nop if test "$ac_cv_type_long" = yes; then - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "cannot compute sizeof (long) See \`config.log' for more details" "$LINENO" 5; } else @@ -20093,31 +22027,31 @@ fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_long" >&5 -$as_echo "$ac_cv_sizeof_long" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_long" >&5 +printf "%s\n" "$ac_cv_sizeof_long" >&6; } -cat >>confdefs.h <<_ACEOF -#define SIZEOF_LONG $ac_cv_sizeof_long -_ACEOF +printf "%s\n" "#define SIZEOF_LONG $ac_cv_sizeof_long" >>confdefs.h # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of long long" >&5 -$as_echo_n "checking size of long long... " >&6; } -if ${ac_cv_sizeof_long_long+:} false; then : - $as_echo_n "(cached) " >&6 -else - if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (long long))" "ac_cv_sizeof_long_long" "$ac_includes_default"; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking size of long long" >&5 +printf %s "checking size of long long... " >&6; } +if test ${ac_cv_sizeof_long_long+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (long long))" "ac_cv_sizeof_long_long" "$ac_includes_default" +then : -else +else $as_nop if test "$ac_cv_type_long_long" = yes; then - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "cannot compute sizeof (long long) See \`config.log' for more details" "$LINENO" 5; } else @@ -20126,18 +22060,17 @@ fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_long_long" >&5 -$as_echo "$ac_cv_sizeof_long_long" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_long_long" >&5 +printf "%s\n" "$ac_cv_sizeof_long_long" >&6; } -cat >>confdefs.h <<_ACEOF -#define SIZEOF_LONG_LONG $ac_cv_sizeof_long_long -_ACEOF +printf "%s\n" "#define SIZEOF_LONG_LONG $ac_cv_sizeof_long_long" >>confdefs.h if ac_fn_c_compute_int "$LINENO" "sizeof(foo.fds_bits[0])" "ac_cv_sizeof_fd_set_fds_bits" "$ac_includes_default -fd_set foo;"; then : +fd_set foo;" +then : fi @@ -20147,17 +22080,19 @@ # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of fd_set.fds_bits" >&5 -$as_echo_n "checking size of fd_set.fds_bits... " >&6; } -if ${ac_cv_sizeof_fd_set_fds_bits+:} false; then : - $as_echo_n "(cached) " >&6 -else - if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (fd_set.fds_bits))" "ac_cv_sizeof_fd_set_fds_bits" "$ac_includes_default"; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking size of fd_set.fds_bits" >&5 +printf %s "checking size of fd_set.fds_bits... " >&6; } +if test ${ac_cv_sizeof_fd_set_fds_bits+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (fd_set.fds_bits))" "ac_cv_sizeof_fd_set_fds_bits" "$ac_includes_default" +then : -else +else $as_nop if test "$ac_cv_type_fd_set_fds_bits" = yes; then - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "cannot compute sizeof (fd_set.fds_bits) See \`config.log' for more details" "$LINENO" 5; } else @@ -20166,14 +22101,12 @@ fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_fd_set_fds_bits" >&5 -$as_echo "$ac_cv_sizeof_fd_set_fds_bits" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_fd_set_fds_bits" >&5 +printf "%s\n" "$ac_cv_sizeof_fd_set_fds_bits" >&6; } -cat >>confdefs.h <<_ACEOF -#define SIZEOF_FD_SET_FDS_BITS $ac_cv_sizeof_fd_set_fds_bits -_ACEOF +printf "%s\n" "#define SIZEOF_FD_SET_FDS_BITS $ac_cv_sizeof_fd_set_fds_bits" >>confdefs.h @@ -20182,20 +22115,20 @@ # correctly if the size is wrong. if test $ac_cv_sizeof_int = $ac_cv_sizeof_fd_set_fds_bits; then -$as_echo "#define TYPEOF_FD_SET_FDS_BITS int" >>confdefs.h +printf "%s\n" "#define TYPEOF_FD_SET_FDS_BITS int" >>confdefs.h elif test $ac_cv_sizeof_long = $ac_cv_sizeof_fd_set_fds_bits; then -$as_echo "#define TYPEOF_FD_SET_FDS_BITS long" >>confdefs.h +printf "%s\n" "#define TYPEOF_FD_SET_FDS_BITS long" >>confdefs.h elif test $ac_cv_sizeof_long_long = $ac_cv_sizeof_fd_set_fds_bits; then -$as_echo "#define TYPEOF_FD_SET_FDS_BITS long long" >>confdefs.h +printf "%s\n" "#define TYPEOF_FD_SET_FDS_BITS long long" >>confdefs.h fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for dladdr in dlfcn.h" >&5 -$as_echo_n "checking for dladdr in dlfcn.h... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for dladdr in dlfcn.h" >&5 +printf %s "checking for dladdr in dlfcn.h... " >&6; } PBX_DLADDR=0 old_LIBS=${LIBS} LIBS="${LIBS} -ldl" @@ -20204,7 +22137,7 @@ #define _GNU_SOURCE 1 #include int -main () +main (void) { dladdr((void *)0, (void *)0) @@ -20212,34 +22145,35 @@ return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } +if ac_fn_c_try_link "$LINENO" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } PBX_DLADDR=1 -$as_echo "#define HAVE_DLADDR 1" >>confdefs.h +printf "%s\n" "#define HAVE_DLADDR 1" >>confdefs.h -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=${old_LIBS} # re-check without -ldl # Non-Linux platforms like FreeBSD and NetBSD do not need a library libdl.so. if test "${PBX_DLADDR}" = "0"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dladdr in dlfcn.h without -ldl" >&5 -$as_echo_n "checking for dladdr in dlfcn.h without -ldl... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for dladdr in dlfcn.h without -ldl" >&5 +printf %s "checking for dladdr in dlfcn.h without -ldl... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define _GNU_SOURCE 1 #include int -main () +main (void) { dladdr((void *)0, (void *)0) @@ -20247,20 +22181,21 @@ return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } +if ac_fn_c_try_link "$LINENO" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } PBX_DLADDR=1 -$as_echo "#define HAVE_DLADDR 1" >>confdefs.h +printf "%s\n" "#define HAVE_DLADDR 1" >>confdefs.h -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext fi @@ -20281,11 +22216,12 @@ ast_ext_lib_check_save_CFLAGS="${CFLAGS}" CFLAGS="${CFLAGS} " - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for snd_pcm_open in -lasound" >&5 -$as_echo_n "checking for snd_pcm_open in -lasound... " >&6; } -if ${ac_cv_lib_asound_snd_pcm_open+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for snd_pcm_open in -lasound" >&5 +printf %s "checking for snd_pcm_open in -lasound... " >&6; } +if test ${ac_cv_lib_asound_snd_pcm_open+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lasound ${pbxlibdir} $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -20294,32 +22230,31 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char snd_pcm_open (); int -main () +main (void) { return snd_pcm_open (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_asound_snd_pcm_open=yes -else +else $as_nop ac_cv_lib_asound_snd_pcm_open=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_asound_snd_pcm_open" >&5 -$as_echo "$ac_cv_lib_asound_snd_pcm_open" >&6; } -if test "x$ac_cv_lib_asound_snd_pcm_open" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_asound_snd_pcm_open" >&5 +printf "%s\n" "$ac_cv_lib_asound_snd_pcm_open" >&6; } +if test "x$ac_cv_lib_asound_snd_pcm_open" = xyes +then : AST_ALSA_FOUND=yes -else +else $as_nop AST_ALSA_FOUND=no fi @@ -20338,14 +22273,14 @@ # check for the header ast_ext_lib_check_saved_CPPFLAGS="${CPPFLAGS}" CPPFLAGS="${CPPFLAGS} ${ALSA_INCLUDE}" - ac_fn_c_check_header_mongrel "$LINENO" "alsa/asoundlib.h" "ac_cv_header_alsa_asoundlib_h" "$ac_includes_default" -if test "x$ac_cv_header_alsa_asoundlib_h" = xyes; then : + ac_fn_c_check_header_compile "$LINENO" "alsa/asoundlib.h" "ac_cv_header_alsa_asoundlib_h" "$ac_includes_default" +if test "x$ac_cv_header_alsa_asoundlib_h" = xyes +then : ALSA_HEADER_FOUND=1 -else +else $as_nop ALSA_HEADER_FOUND=0 fi - CPPFLAGS="${ast_ext_lib_check_saved_CPPFLAGS}" if test "x${ALSA_HEADER_FOUND}" = "x0" ; then @@ -20378,11 +22313,12 @@ ast_ext_lib_check_save_CFLAGS="${CFLAGS}" CFLAGS="${CFLAGS} " - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for bfd_openr in -lbfd" >&5 -$as_echo_n "checking for bfd_openr in -lbfd... " >&6; } -if ${ac_cv_lib_bfd_bfd_openr+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for bfd_openr in -lbfd" >&5 +printf %s "checking for bfd_openr in -lbfd... " >&6; } +if test ${ac_cv_lib_bfd_bfd_openr+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lbfd ${pbxlibdir} $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -20391,32 +22327,31 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char bfd_openr (); int -main () +main (void) { return bfd_openr (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_bfd_bfd_openr=yes -else +else $as_nop ac_cv_lib_bfd_bfd_openr=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bfd_bfd_openr" >&5 -$as_echo "$ac_cv_lib_bfd_bfd_openr" >&6; } -if test "x$ac_cv_lib_bfd_bfd_openr" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bfd_bfd_openr" >&5 +printf "%s\n" "$ac_cv_lib_bfd_bfd_openr" >&6; } +if test "x$ac_cv_lib_bfd_bfd_openr" = xyes +then : AST_BFD_FOUND=yes -else +else $as_nop AST_BFD_FOUND=no fi @@ -20435,14 +22370,14 @@ # check for the header ast_ext_lib_check_saved_CPPFLAGS="${CPPFLAGS}" CPPFLAGS="${CPPFLAGS} ${BFD_INCLUDE}" - ac_fn_c_check_header_mongrel "$LINENO" "bfd.h" "ac_cv_header_bfd_h" "$ac_includes_default" -if test "x$ac_cv_header_bfd_h" = xyes; then : + ac_fn_c_check_header_compile "$LINENO" "bfd.h" "ac_cv_header_bfd_h" "$ac_includes_default" +if test "x$ac_cv_header_bfd_h" = xyes +then : BFD_HEADER_FOUND=1 -else +else $as_nop BFD_HEADER_FOUND=0 fi - CPPFLAGS="${ast_ext_lib_check_saved_CPPFLAGS}" if test "x${BFD_HEADER_FOUND}" = "x0" ; then @@ -20475,11 +22410,12 @@ ast_ext_lib_check_save_CFLAGS="${CFLAGS}" CFLAGS="${CFLAGS} " - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for bfd_openr in -lbfd" >&5 -$as_echo_n "checking for bfd_openr in -lbfd... " >&6; } -if ${ac_cv_lib_bfd_bfd_openr+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for bfd_openr in -lbfd" >&5 +printf %s "checking for bfd_openr in -lbfd... " >&6; } +if test ${ac_cv_lib_bfd_bfd_openr+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lbfd ${pbxlibdir} -ldl -liberty $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -20488,32 +22424,31 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char bfd_openr (); int -main () +main (void) { return bfd_openr (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_bfd_bfd_openr=yes -else +else $as_nop ac_cv_lib_bfd_bfd_openr=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bfd_bfd_openr" >&5 -$as_echo "$ac_cv_lib_bfd_bfd_openr" >&6; } -if test "x$ac_cv_lib_bfd_bfd_openr" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bfd_bfd_openr" >&5 +printf "%s\n" "$ac_cv_lib_bfd_bfd_openr" >&6; } +if test "x$ac_cv_lib_bfd_bfd_openr" = xyes +then : AST_BFD_FOUND=yes -else +else $as_nop AST_BFD_FOUND=no fi @@ -20532,14 +22467,14 @@ # check for the header ast_ext_lib_check_saved_CPPFLAGS="${CPPFLAGS}" CPPFLAGS="${CPPFLAGS} ${BFD_INCLUDE}" - ac_fn_c_check_header_mongrel "$LINENO" "bfd.h" "ac_cv_header_bfd_h" "$ac_includes_default" -if test "x$ac_cv_header_bfd_h" = xyes; then : + ac_fn_c_check_header_compile "$LINENO" "bfd.h" "ac_cv_header_bfd_h" "$ac_includes_default" +if test "x$ac_cv_header_bfd_h" = xyes +then : BFD_HEADER_FOUND=1 -else +else $as_nop BFD_HEADER_FOUND=0 fi - CPPFLAGS="${ast_ext_lib_check_saved_CPPFLAGS}" if test "x${BFD_HEADER_FOUND}" = "x0" ; then @@ -20572,11 +22507,12 @@ ast_ext_lib_check_save_CFLAGS="${CFLAGS}" CFLAGS="${CFLAGS} " - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for bfd_openr in -lbfd" >&5 -$as_echo_n "checking for bfd_openr in -lbfd... " >&6; } -if ${ac_cv_lib_bfd_bfd_openr+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for bfd_openr in -lbfd" >&5 +printf %s "checking for bfd_openr in -lbfd... " >&6; } +if test ${ac_cv_lib_bfd_bfd_openr+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lbfd ${pbxlibdir} -ldl -liberty -lz $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -20585,32 +22521,31 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char bfd_openr (); int -main () +main (void) { return bfd_openr (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_bfd_bfd_openr=yes -else +else $as_nop ac_cv_lib_bfd_bfd_openr=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bfd_bfd_openr" >&5 -$as_echo "$ac_cv_lib_bfd_bfd_openr" >&6; } -if test "x$ac_cv_lib_bfd_bfd_openr" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bfd_bfd_openr" >&5 +printf "%s\n" "$ac_cv_lib_bfd_bfd_openr" >&6; } +if test "x$ac_cv_lib_bfd_bfd_openr" = xyes +then : AST_BFD_FOUND=yes -else +else $as_nop AST_BFD_FOUND=no fi @@ -20629,14 +22564,14 @@ # check for the header ast_ext_lib_check_saved_CPPFLAGS="${CPPFLAGS}" CPPFLAGS="${CPPFLAGS} ${BFD_INCLUDE}" - ac_fn_c_check_header_mongrel "$LINENO" "bfd.h" "ac_cv_header_bfd_h" "$ac_includes_default" -if test "x$ac_cv_header_bfd_h" = xyes; then : + ac_fn_c_check_header_compile "$LINENO" "bfd.h" "ac_cv_header_bfd_h" "$ac_includes_default" +if test "x$ac_cv_header_bfd_h" = xyes +then : BFD_HEADER_FOUND=1 -else +else $as_nop BFD_HEADER_FOUND=0 fi - CPPFLAGS="${ast_ext_lib_check_saved_CPPFLAGS}" if test "x${BFD_HEADER_FOUND}" = "x0" ; then @@ -20671,11 +22606,12 @@ ast_ext_lib_check_save_CFLAGS="${CFLAGS}" CFLAGS="${CFLAGS} " - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for cap_from_text in -lcap" >&5 -$as_echo_n "checking for cap_from_text in -lcap... " >&6; } -if ${ac_cv_lib_cap_cap_from_text+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for cap_from_text in -lcap" >&5 +printf %s "checking for cap_from_text in -lcap... " >&6; } +if test ${ac_cv_lib_cap_cap_from_text+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcap ${pbxlibdir} $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -20684,32 +22620,31 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char cap_from_text (); int -main () +main (void) { return cap_from_text (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_cap_cap_from_text=yes -else +else $as_nop ac_cv_lib_cap_cap_from_text=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cap_cap_from_text" >&5 -$as_echo "$ac_cv_lib_cap_cap_from_text" >&6; } -if test "x$ac_cv_lib_cap_cap_from_text" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cap_cap_from_text" >&5 +printf "%s\n" "$ac_cv_lib_cap_cap_from_text" >&6; } +if test "x$ac_cv_lib_cap_cap_from_text" = xyes +then : AST_CAP_FOUND=yes -else +else $as_nop AST_CAP_FOUND=no fi @@ -20728,14 +22663,14 @@ # check for the header ast_ext_lib_check_saved_CPPFLAGS="${CPPFLAGS}" CPPFLAGS="${CPPFLAGS} ${CAP_INCLUDE}" - ac_fn_c_check_header_mongrel "$LINENO" "sys/capability.h" "ac_cv_header_sys_capability_h" "$ac_includes_default" -if test "x$ac_cv_header_sys_capability_h" = xyes; then : + ac_fn_c_check_header_compile "$LINENO" "sys/capability.h" "ac_cv_header_sys_capability_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_capability_h" = xyes +then : CAP_HEADER_FOUND=1 -else +else $as_nop CAP_HEADER_FOUND=0 fi - CPPFLAGS="${ast_ext_lib_check_saved_CPPFLAGS}" if test "x${CAP_HEADER_FOUND}" = "x0" ; then @@ -20758,8 +22693,8 @@ if test "x${PBX_DAHDI}" != "x1"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for DAHDI_RESET_COUNTERS in dahdi/user.h" >&5 -$as_echo_n "checking for DAHDI_RESET_COUNTERS in dahdi/user.h... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for DAHDI_RESET_COUNTERS in dahdi/user.h" >&5 +printf %s "checking for DAHDI_RESET_COUNTERS in dahdi/user.h... " >&6; } saved_cppflags="${CPPFLAGS}" if test "x${DAHDI_DIR}" != "x"; then DAHDI_INCLUDE="-I${DAHDI_DIR}/include" @@ -20770,7 +22705,7 @@ /* end confdefs.h. */ #include int -main () +main (void) { #if defined(DAHDI_RESET_COUNTERS) int foo = 0; @@ -20783,31 +22718,32 @@ return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } +if ac_fn_c_try_compile "$LINENO" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } PBX_DAHDI=1 -$as_echo "#define HAVE_DAHDI 1" >>confdefs.h +printf "%s\n" "#define HAVE_DAHDI 1" >>confdefs.h -$as_echo "#define HAVE_DAHDI_VERSION 230" >>confdefs.h +printf "%s\n" "#define HAVE_DAHDI_VERSION 230" >>confdefs.h -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext CPPFLAGS="${saved_cppflags}" fi if test "x${PBX_DAHDI}" != "x1"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for DAHDI_DEFAULT_MTU_MRU in dahdi/user.h" >&5 -$as_echo_n "checking for DAHDI_DEFAULT_MTU_MRU in dahdi/user.h... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for DAHDI_DEFAULT_MTU_MRU in dahdi/user.h" >&5 +printf %s "checking for DAHDI_DEFAULT_MTU_MRU in dahdi/user.h... " >&6; } saved_cppflags="${CPPFLAGS}" if test "x${DAHDI_DIR}" != "x"; then DAHDI_INCLUDE="-I${DAHDI_DIR}/include" @@ -20818,7 +22754,7 @@ /* end confdefs.h. */ #include int -main () +main (void) { #if defined(DAHDI_DEFAULT_MTU_MRU) int foo = 0; @@ -20831,31 +22767,32 @@ return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } +if ac_fn_c_try_compile "$LINENO" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } PBX_DAHDI=1 -$as_echo "#define HAVE_DAHDI 1" >>confdefs.h +printf "%s\n" "#define HAVE_DAHDI 1" >>confdefs.h -$as_echo "#define HAVE_DAHDI_VERSION 220" >>confdefs.h +printf "%s\n" "#define HAVE_DAHDI_VERSION 220" >>confdefs.h -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext CPPFLAGS="${saved_cppflags}" fi if test "x${PBX_DAHDI}" != "x1"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for DAHDI_CODE in dahdi/user.h" >&5 -$as_echo_n "checking for DAHDI_CODE in dahdi/user.h... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for DAHDI_CODE in dahdi/user.h" >&5 +printf %s "checking for DAHDI_CODE in dahdi/user.h... " >&6; } saved_cppflags="${CPPFLAGS}" if test "x${DAHDI_DIR}" != "x"; then DAHDI_INCLUDE="-I${DAHDI_DIR}/include" @@ -20866,7 +22803,7 @@ /* end confdefs.h. */ #include int -main () +main (void) { #if defined(DAHDI_CODE) int foo = 0; @@ -20879,23 +22816,24 @@ return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } +if ac_fn_c_try_compile "$LINENO" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } PBX_DAHDI=1 -$as_echo "#define HAVE_DAHDI 1" >>confdefs.h +printf "%s\n" "#define HAVE_DAHDI 1" >>confdefs.h -$as_echo "#define HAVE_DAHDI_VERSION 200" >>confdefs.h +printf "%s\n" "#define HAVE_DAHDI_VERSION 200" >>confdefs.h -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext CPPFLAGS="${saved_cppflags}" fi @@ -20903,8 +22841,8 @@ if test "x${PBX_DAHDI_HALF_FULL}" != "x1"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for DAHDI_POLICY_HALF_FULL in dahdi/user.h" >&5 -$as_echo_n "checking for DAHDI_POLICY_HALF_FULL in dahdi/user.h... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for DAHDI_POLICY_HALF_FULL in dahdi/user.h" >&5 +printf %s "checking for DAHDI_POLICY_HALF_FULL in dahdi/user.h... " >&6; } saved_cppflags="${CPPFLAGS}" if test "x${DAHDI_HALF_FULL_DIR}" != "x"; then DAHDI_HALF_FULL_INCLUDE="-I${DAHDI_HALF_FULL_DIR}/include" @@ -20915,7 +22853,7 @@ /* end confdefs.h. */ #include int -main () +main (void) { #if defined(DAHDI_POLICY_HALF_FULL) int foo = 0; @@ -20928,21 +22866,22 @@ return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } +if ac_fn_c_try_compile "$LINENO" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } PBX_DAHDI_HALF_FULL=1 -$as_echo "#define HAVE_DAHDI_HALF_FULL 1" >>confdefs.h +printf "%s\n" "#define HAVE_DAHDI_HALF_FULL 1" >>confdefs.h -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext CPPFLAGS="${saved_cppflags}" fi @@ -20950,8 +22889,8 @@ if test "x${PBX_DAHDI_LINEREVERSE_VMWI}" != "x1" -a "${USE_DAHDI_LINEREVERSE_VMWI}" != "no"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for enhanced dahdi vmwi support" >&5 -$as_echo_n "checking for enhanced dahdi vmwi support... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for enhanced dahdi vmwi support" >&5 +printf %s "checking for enhanced dahdi vmwi support... " >&6; } saved_cppflags="${CPPFLAGS}" if test "x${DAHDI_LINEREVERSE_VMWI_DIR}" != "x"; then DAHDI_LINEREVERSE_VMWI_INCLUDE="-I${DAHDI_LINEREVERSE_VMWI_DIR}/include" @@ -20962,7 +22901,7 @@ /* end confdefs.h. */ #include int -main () +main (void) { struct dahdi_vmwi_info booger; @@ -20970,29 +22909,30 @@ return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } +if ac_fn_c_try_compile "$LINENO" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } PBX_DAHDI_LINEREVERSE_VMWI=1 -$as_echo "#define HAVE_DAHDI_LINEREVERSE_VMWI 1" >>confdefs.h +printf "%s\n" "#define HAVE_DAHDI_LINEREVERSE_VMWI 1" >>confdefs.h -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext CPPFLAGS="${saved_cppflags}" fi if test "x${PBX_DAHDI_ECHOCANCEL_FAX_MODE}" != "x1" -a "${USE_DAHDI_ECHOCANCEL_FAX_MODE}" != "no"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if \"int foo = DAHDI_ECHOCANCEL_FAX_MODE\" compiles using dahdi/user.h" >&5 -$as_echo_n "checking if \"int foo = DAHDI_ECHOCANCEL_FAX_MODE\" compiles using dahdi/user.h... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if \"int foo = DAHDI_ECHOCANCEL_FAX_MODE\" compiles using dahdi/user.h" >&5 +printf %s "checking if \"int foo = DAHDI_ECHOCANCEL_FAX_MODE\" compiles using dahdi/user.h... " >&6; } saved_cppflags="${CPPFLAGS}" if test "x${DAHDI_ECHOCANCEL_FAX_MODE_DIR}" != "x"; then DAHDI_ECHOCANCEL_FAX_MODE_INCLUDE="-I${DAHDI_ECHOCANCEL_FAX_MODE_DIR}/include" @@ -21003,7 +22943,7 @@ /* end confdefs.h. */ #include int -main () +main (void) { int foo = DAHDI_ECHOCANCEL_FAX_MODE; @@ -21011,29 +22951,30 @@ return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } +if ac_fn_c_try_compile "$LINENO" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } PBX_DAHDI_ECHOCANCEL_FAX_MODE=1 -$as_echo "#define HAVE_DAHDI_ECHOCANCEL_FAX_MODE 1" >>confdefs.h +printf "%s\n" "#define HAVE_DAHDI_ECHOCANCEL_FAX_MODE 1" >>confdefs.h -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext CPPFLAGS="${saved_cppflags}" fi if test "x${PBX_GETIFADDRS}" != "x1" -a "${USE_GETIFADDRS}" != "no"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for getifaddrs() support" >&5 -$as_echo_n "checking for getifaddrs() support... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for getifaddrs() support" >&5 +printf %s "checking for getifaddrs() support... " >&6; } saved_cppflags="${CPPFLAGS}" if test "x${GETIFADDRS_DIR}" != "x"; then GETIFADDRS_INCLUDE="-I${GETIFADDRS_DIR}/include" @@ -21044,7 +22985,7 @@ /* end confdefs.h. */ #include int -main () +main (void) { struct ifaddrs *p; getifaddrs(&p); @@ -21052,28 +22993,29 @@ return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } +if ac_fn_c_try_compile "$LINENO" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } PBX_GETIFADDRS=1 -$as_echo "#define HAVE_GETIFADDRS 1" >>confdefs.h +printf "%s\n" "#define HAVE_GETIFADDRS 1" >>confdefs.h -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext CPPFLAGS="${saved_cppflags}" fi if test "x${PBX_TIMERFD}" != "x1" -a "${USE_TIMERFD}" != "no"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for timerfd support" >&5 -$as_echo_n "checking for timerfd support... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for timerfd support" >&5 +printf %s "checking for timerfd support... " >&6; } saved_cppflags="${CPPFLAGS}" if test "x${TIMERFD_DIR}" != "x"; then TIMERFD_INCLUDE="-I${TIMERFD_DIR}/include" @@ -21084,7 +23026,7 @@ /* end confdefs.h. */ #include int -main () +main (void) { timerfd_create(0,0); timerfd_settime(0,0,NULL,NULL);; @@ -21092,21 +23034,22 @@ return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } +if ac_fn_c_try_compile "$LINENO" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } PBX_TIMERFD=1 -$as_echo "#define HAVE_TIMERFD 1" >>confdefs.h +printf "%s\n" "#define HAVE_TIMERFD 1" >>confdefs.h -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext CPPFLAGS="${saved_cppflags}" fi @@ -21129,11 +23072,12 @@ gsmlibdir="-L${GSM_DIR}" fi fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gsm_create in -lgsm" >&5 -$as_echo_n "checking for gsm_create in -lgsm... " >&6; } -if ${ac_cv_lib_gsm_gsm_create+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for gsm_create in -lgsm" >&5 +printf %s "checking for gsm_create in -lgsm... " >&6; } +if test ${ac_cv_lib_gsm_gsm_create+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lgsm ${gsmlibdir} $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -21142,86 +23086,83 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char gsm_create (); int -main () +main (void) { return gsm_create (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_gsm_gsm_create=yes -else +else $as_nop ac_cv_lib_gsm_gsm_create=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_gsm_gsm_create" >&5 -$as_echo "$ac_cv_lib_gsm_gsm_create" >&6; } -if test "x$ac_cv_lib_gsm_gsm_create" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_gsm_gsm_create" >&5 +printf "%s\n" "$ac_cv_lib_gsm_gsm_create" >&6; } +if test "x$ac_cv_lib_gsm_gsm_create" = xyes +then : -cat >>confdefs.h <<_ACEOF -#define HAVE_GSM 1 -_ACEOF +printf "%s\n" "#define HAVE_GSM 1" >>confdefs.h fi if test "${ac_cv_lib_gsm_gsm_create}" = "yes"; then if test "x${GSM_DIR}" != "x" ; then - as_ac_Header=`$as_echo "ac_cv_header_${GSM_DIR}/include/gsm.h" | $as_tr_sh` -ac_fn_c_check_header_mongrel "$LINENO" "${GSM_DIR}/include/gsm.h" "$as_ac_Header" "$ac_includes_default" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + as_ac_Header=`printf "%s\n" "ac_cv_header_${GSM_DIR}/include/gsm.h" | $as_tr_sh` +ac_fn_c_check_header_compile "$LINENO" "${GSM_DIR}/include/gsm.h" "$as_ac_Header" "$ac_includes_default" +if eval test \"x\$"$as_ac_Header"\" = x"yes" +then : GSM_HEADER_FOUND=1 -else +else $as_nop GSM_HEADER_FOUND=0 fi - - as_ac_Header=`$as_echo "ac_cv_header_${GSM_DIR}/include/gsm/gsm.h" | $as_tr_sh` -ac_fn_c_check_header_mongrel "$LINENO" "${GSM_DIR}/include/gsm/gsm.h" "$as_ac_Header" "$ac_includes_default" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + as_ac_Header=`printf "%s\n" "ac_cv_header_${GSM_DIR}/include/gsm/gsm.h" | $as_tr_sh` +ac_fn_c_check_header_compile "$LINENO" "${GSM_DIR}/include/gsm/gsm.h" "$as_ac_Header" "$ac_includes_default" +if eval test \"x\$"$as_ac_Header"\" = x"yes" +then : GSM_GSM_HEADER_FOUND=1 -else +else $as_nop GSM_GSM_HEADER_FOUND=0 fi - else - ac_fn_c_check_header_mongrel "$LINENO" "gsm.h" "ac_cv_header_gsm_h" "$ac_includes_default" -if test "x$ac_cv_header_gsm_h" = xyes; then : + ac_fn_c_check_header_compile "$LINENO" "gsm.h" "ac_cv_header_gsm_h" "$ac_includes_default" +if test "x$ac_cv_header_gsm_h" = xyes +then : GSM_HEADER_FOUND=1 -else +else $as_nop GSM_HEADER_FOUND=0 fi - - ac_fn_c_check_header_mongrel "$LINENO" "gsm/gsm.h" "ac_cv_header_gsm_gsm_h" "$ac_includes_default" -if test "x$ac_cv_header_gsm_gsm_h" = xyes; then : + ac_fn_c_check_header_compile "$LINENO" "gsm/gsm.h" "ac_cv_header_gsm_gsm_h" "$ac_includes_default" +if test "x$ac_cv_header_gsm_gsm_h" = xyes +then : GSM_GSM_HEADER_FOUND=1 -else +else $as_nop GSM_GSM_HEADER_FOUND=0 fi - fi if test "${GSM_HEADER_FOUND}" = "0" ; then if test "{GSM_GSM_HEADER_FOUND}" = "0" ; then if test "x${GSM_MANDATORY}" = "xyes" ; then - { $as_echo "$as_me:${as_lineno-$LINENO}: ***" >&5 -$as_echo "$as_me: ***" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: *** It appears that you do not have the gsm development package installed." >&5 -$as_echo "$as_me: *** It appears that you do not have the gsm development package installed." >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: *** Please install it to include ${GSM_DESCRIP} support, or re-run configure" >&5 -$as_echo "$as_me: *** Please install it to include ${GSM_DESCRIP} support, or re-run configure" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: *** without explicitly specifying --with-${GSM_OPTION}" >&5 -$as_echo "$as_me: *** without explicitly specifying --with-${GSM_OPTION}" >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: ***" >&5 +printf "%s\n" "$as_me: ***" >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: *** It appears that you do not have the gsm development package installed." >&5 +printf "%s\n" "$as_me: *** It appears that you do not have the gsm development package installed." >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: *** Please install it to include ${GSM_DESCRIP} support, or re-run configure" >&5 +printf "%s\n" "$as_me: *** Please install it to include ${GSM_DESCRIP} support, or re-run configure" >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: *** without explicitly specifying --with-${GSM_OPTION}" >&5 +printf "%s\n" "$as_me: *** without explicitly specifying --with-${GSM_OPTION}" >&6;} exit 1 fi fi @@ -21229,16 +23170,12 @@ GSM_OK=0 if test "${GSM_HEADER_FOUND}" = "1" ; then -cat >>confdefs.h <<_ACEOF -#define HAVE_GSM_HEADER 1 -_ACEOF +printf "%s\n" "#define HAVE_GSM_HEADER 1" >>confdefs.h GSM_OK=1 elif test "${GSM_GSM_HEADER_FOUND}" = "1" ; then -cat >>confdefs.h <<_ACEOF -#define HAVE_GSM_GSM_HEADER 1 -_ACEOF +printf "%s\n" "#define HAVE_GSM_GSM_HEADER 1" >>confdefs.h GSM_OK=1 fi @@ -21256,9 +23193,7 @@ if test "${GSM_INTERNAL}" = "yes"; then PBX_GSM=1 -cat >>confdefs.h <<_ACEOF -#define HAVE_GSM_HEADER 1 -_ACEOF +printf "%s\n" "#define HAVE_GSM_HEADER 1" >>confdefs.h fi fi @@ -21277,17 +23212,17 @@ if test "x${PBX_ILBC}" != "x1" -a "${USE_ILBC}" != "no"; then pkg_failed=no -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ILBC" >&5 -$as_echo_n "checking for ILBC... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libilbc" >&5 +printf %s "checking for libilbc... " >&6; } if test -n "$ILBC_CFLAGS"; then pkg_cv_ILBC_CFLAGS="$ILBC_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libilbc\""; } >&5 + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libilbc\""; } >&5 ($PKG_CONFIG --exists --print-errors "libilbc") 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_ILBC_CFLAGS=`$PKG_CONFIG --cflags "libilbc" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes @@ -21301,10 +23236,10 @@ pkg_cv_ILBC_LIBS="$ILBC_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libilbc\""; } >&5 + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libilbc\""; } >&5 ($PKG_CONFIG --exists --print-errors "libilbc") 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_ILBC_LIBS=`$PKG_CONFIG --libs "libilbc" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes @@ -21318,8 +23253,8 @@ if test $pkg_failed = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes @@ -21339,8 +23274,8 @@ elif test $pkg_failed = untried; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } PBX_ILBC=0 @@ -21348,14 +23283,14 @@ else ILBC_CFLAGS=$pkg_cv_ILBC_CFLAGS ILBC_LIBS=$pkg_cv_ILBC_LIBS - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } PBX_ILBC=1 ILBC_INCLUDE=$(echo ${ILBC_CFLAGS} | $SED -e "s|-std=c99||g") ILBC_LIB="$ILBC_LIBS" -$as_echo "#define HAVE_ILBC 1" >>confdefs.h +printf "%s\n" "#define HAVE_ILBC 1" >>confdefs.h fi @@ -21384,11 +23319,12 @@ ast_ext_lib_check_save_CFLAGS="${CFLAGS}" CFLAGS="${CFLAGS} " - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for iconv_open in -liconv" >&5 -$as_echo_n "checking for iconv_open in -liconv... " >&6; } -if ${ac_cv_lib_iconv_iconv_open+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for iconv_open in -liconv" >&5 +printf %s "checking for iconv_open in -liconv... " >&6; } +if test ${ac_cv_lib_iconv_iconv_open+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-liconv ${pbxlibdir} $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -21397,32 +23333,31 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char iconv_open (); int -main () +main (void) { return iconv_open (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_iconv_iconv_open=yes -else +else $as_nop ac_cv_lib_iconv_iconv_open=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_iconv_iconv_open" >&5 -$as_echo "$ac_cv_lib_iconv_iconv_open" >&6; } -if test "x$ac_cv_lib_iconv_iconv_open" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_iconv_iconv_open" >&5 +printf "%s\n" "$ac_cv_lib_iconv_iconv_open" >&6; } +if test "x$ac_cv_lib_iconv_iconv_open" = xyes +then : AST_ICONV_FOUND=yes -else +else $as_nop AST_ICONV_FOUND=no fi @@ -21441,14 +23376,14 @@ # check for the header ast_ext_lib_check_saved_CPPFLAGS="${CPPFLAGS}" CPPFLAGS="${CPPFLAGS} ${ICONV_INCLUDE}" - ac_fn_c_check_header_mongrel "$LINENO" "iconv.h" "ac_cv_header_iconv_h" "$ac_includes_default" -if test "x$ac_cv_header_iconv_h" = xyes; then : + ac_fn_c_check_header_compile "$LINENO" "iconv.h" "ac_cv_header_iconv_h" "$ac_includes_default" +if test "x$ac_cv_header_iconv_h" = xyes +then : ICONV_HEADER_FOUND=1 -else +else $as_nop ICONV_HEADER_FOUND=0 fi - CPPFLAGS="${ast_ext_lib_check_saved_CPPFLAGS}" if test "x${ICONV_HEADER_FOUND}" = "x0" ; then @@ -21481,11 +23416,12 @@ ast_ext_lib_check_save_CFLAGS="${CFLAGS}" CFLAGS="${CFLAGS} " - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libiconv_open in -liconv" >&5 -$as_echo_n "checking for libiconv_open in -liconv... " >&6; } -if ${ac_cv_lib_iconv_libiconv_open+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libiconv_open in -liconv" >&5 +printf %s "checking for libiconv_open in -liconv... " >&6; } +if test ${ac_cv_lib_iconv_libiconv_open+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-liconv ${pbxlibdir} $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -21494,32 +23430,31 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libiconv_open (); int -main () +main (void) { return libiconv_open (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_iconv_libiconv_open=yes -else +else $as_nop ac_cv_lib_iconv_libiconv_open=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_iconv_libiconv_open" >&5 -$as_echo "$ac_cv_lib_iconv_libiconv_open" >&6; } -if test "x$ac_cv_lib_iconv_libiconv_open" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_iconv_libiconv_open" >&5 +printf "%s\n" "$ac_cv_lib_iconv_libiconv_open" >&6; } +if test "x$ac_cv_lib_iconv_libiconv_open" = xyes +then : AST_ICONV_FOUND=yes -else +else $as_nop AST_ICONV_FOUND=no fi @@ -21538,14 +23473,14 @@ # check for the header ast_ext_lib_check_saved_CPPFLAGS="${CPPFLAGS}" CPPFLAGS="${CPPFLAGS} ${ICONV_INCLUDE}" - ac_fn_c_check_header_mongrel "$LINENO" "iconv.h" "ac_cv_header_iconv_h" "$ac_includes_default" -if test "x$ac_cv_header_iconv_h" = xyes; then : + ac_fn_c_check_header_compile "$LINENO" "iconv.h" "ac_cv_header_iconv_h" "$ac_includes_default" +if test "x$ac_cv_header_iconv_h" = xyes +then : ICONV_HEADER_FOUND=1 -else +else $as_nop ICONV_HEADER_FOUND=0 fi - CPPFLAGS="${ast_ext_lib_check_saved_CPPFLAGS}" if test "x${ICONV_HEADER_FOUND}" = "x0" ; then @@ -21578,11 +23513,12 @@ ast_ext_lib_check_save_CFLAGS="${CFLAGS}" CFLAGS="${CFLAGS} " - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for iconv_close in -lc" >&5 -$as_echo_n "checking for iconv_close in -lc... " >&6; } -if ${ac_cv_lib_c_iconv_close+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for iconv_close in -lc" >&5 +printf %s "checking for iconv_close in -lc... " >&6; } +if test ${ac_cv_lib_c_iconv_close+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lc ${pbxlibdir} $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -21591,32 +23527,31 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char iconv_close (); int -main () +main (void) { return iconv_close (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_c_iconv_close=yes -else +else $as_nop ac_cv_lib_c_iconv_close=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_c_iconv_close" >&5 -$as_echo "$ac_cv_lib_c_iconv_close" >&6; } -if test "x$ac_cv_lib_c_iconv_close" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_c_iconv_close" >&5 +printf "%s\n" "$ac_cv_lib_c_iconv_close" >&6; } +if test "x$ac_cv_lib_c_iconv_close" = xyes +then : AST_ICONV_FOUND=yes -else +else $as_nop AST_ICONV_FOUND=no fi @@ -21635,14 +23570,14 @@ # check for the header ast_ext_lib_check_saved_CPPFLAGS="${CPPFLAGS}" CPPFLAGS="${CPPFLAGS} ${ICONV_INCLUDE}" - ac_fn_c_check_header_mongrel "$LINENO" "iconv.h" "ac_cv_header_iconv_h" "$ac_includes_default" -if test "x$ac_cv_header_iconv_h" = xyes; then : + ac_fn_c_check_header_compile "$LINENO" "iconv.h" "ac_cv_header_iconv_h" "$ac_includes_default" +if test "x$ac_cv_header_iconv_h" = xyes +then : ICONV_HEADER_FOUND=1 -else +else $as_nop ICONV_HEADER_FOUND=0 fi - CPPFLAGS="${ast_ext_lib_check_saved_CPPFLAGS}" if test "x${ICONV_HEADER_FOUND}" = "x0" ; then @@ -21676,11 +23611,12 @@ ast_ext_lib_check_save_CFLAGS="${CFLAGS}" CFLAGS="${CFLAGS} ${PTHREAD_CFLAGS}" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for icaltimezone_get_utc_timezone in -lical" >&5 -$as_echo_n "checking for icaltimezone_get_utc_timezone in -lical... " >&6; } -if ${ac_cv_lib_ical_icaltimezone_get_utc_timezone+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for icaltimezone_get_utc_timezone in -lical" >&5 +printf %s "checking for icaltimezone_get_utc_timezone in -lical... " >&6; } +if test ${ac_cv_lib_ical_icaltimezone_get_utc_timezone+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lical ${pbxlibdir} ${PTHREAD_LIBS} $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -21689,32 +23625,31 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char icaltimezone_get_utc_timezone (); int -main () +main (void) { return icaltimezone_get_utc_timezone (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_ical_icaltimezone_get_utc_timezone=yes -else +else $as_nop ac_cv_lib_ical_icaltimezone_get_utc_timezone=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ical_icaltimezone_get_utc_timezone" >&5 -$as_echo "$ac_cv_lib_ical_icaltimezone_get_utc_timezone" >&6; } -if test "x$ac_cv_lib_ical_icaltimezone_get_utc_timezone" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ical_icaltimezone_get_utc_timezone" >&5 +printf "%s\n" "$ac_cv_lib_ical_icaltimezone_get_utc_timezone" >&6; } +if test "x$ac_cv_lib_ical_icaltimezone_get_utc_timezone" = xyes +then : AST_ICAL_FOUND=yes -else +else $as_nop AST_ICAL_FOUND=no fi @@ -21733,14 +23668,14 @@ # check for the header ast_ext_lib_check_saved_CPPFLAGS="${CPPFLAGS}" CPPFLAGS="${CPPFLAGS} ${ICAL_INCLUDE}" - ac_fn_c_check_header_mongrel "$LINENO" "libical/ical.h" "ac_cv_header_libical_ical_h" "$ac_includes_default" -if test "x$ac_cv_header_libical_ical_h" = xyes; then : + ac_fn_c_check_header_compile "$LINENO" "libical/ical.h" "ac_cv_header_libical_ical_h" "$ac_includes_default" +if test "x$ac_cv_header_libical_ical_h" = xyes +then : ICAL_HEADER_FOUND=1 -else +else $as_nop ICAL_HEADER_FOUND=0 fi - CPPFLAGS="${ast_ext_lib_check_saved_CPPFLAGS}" if test "x${ICAL_HEADER_FOUND}" = "x0" ; then @@ -21773,11 +23708,12 @@ ast_ext_lib_check_save_CFLAGS="${CFLAGS}" CFLAGS="${CFLAGS} " - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for iks_start_sasl in -liksemel" >&5 -$as_echo_n "checking for iks_start_sasl in -liksemel... " >&6; } -if ${ac_cv_lib_iksemel_iks_start_sasl+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for iks_start_sasl in -liksemel" >&5 +printf %s "checking for iks_start_sasl in -liksemel... " >&6; } +if test ${ac_cv_lib_iksemel_iks_start_sasl+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-liksemel ${pbxlibdir} $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -21786,32 +23722,31 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char iks_start_sasl (); int -main () +main (void) { return iks_start_sasl (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_iksemel_iks_start_sasl=yes -else +else $as_nop ac_cv_lib_iksemel_iks_start_sasl=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_iksemel_iks_start_sasl" >&5 -$as_echo "$ac_cv_lib_iksemel_iks_start_sasl" >&6; } -if test "x$ac_cv_lib_iksemel_iks_start_sasl" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_iksemel_iks_start_sasl" >&5 +printf "%s\n" "$ac_cv_lib_iksemel_iks_start_sasl" >&6; } +if test "x$ac_cv_lib_iksemel_iks_start_sasl" = xyes +then : AST_IKSEMEL_FOUND=yes -else +else $as_nop AST_IKSEMEL_FOUND=no fi @@ -21830,14 +23765,14 @@ # check for the header ast_ext_lib_check_saved_CPPFLAGS="${CPPFLAGS}" CPPFLAGS="${CPPFLAGS} ${IKSEMEL_INCLUDE}" - ac_fn_c_check_header_mongrel "$LINENO" "iksemel.h" "ac_cv_header_iksemel_h" "$ac_includes_default" -if test "x$ac_cv_header_iksemel_h" = xyes; then : + ac_fn_c_check_header_compile "$LINENO" "iksemel.h" "ac_cv_header_iksemel_h" "$ac_includes_default" +if test "x$ac_cv_header_iksemel_h" = xyes +then : IKSEMEL_HEADER_FOUND=1 -else +else $as_nop IKSEMEL_HEADER_FOUND=0 fi - CPPFLAGS="${ast_ext_lib_check_saved_CPPFLAGS}" if test "x${IKSEMEL_HEADER_FOUND}" = "x0" ; then @@ -21865,8 +23800,8 @@ switch_to_system_on_failure="yes" fi if test "${IMAP_TK_DIR}" != "system"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for UW IMAP Toolkit c-client library" >&5 -$as_echo_n "checking for UW IMAP Toolkit c-client library... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for UW IMAP Toolkit c-client library" >&5 +printf %s "checking for UW IMAP Toolkit c-client library... " >&6; } if test -f "${IMAP_TK_DIR}/c-client/LDFLAGS"; then imap_ldflags=`cat ${IMAP_TK_DIR}/c-client/LDFLAGS` fi @@ -21923,7 +23858,7 @@ { } int -main () +main (void) { MAILSTREAM *foo = mail_open(NULL, "", 0); @@ -21933,13 +23868,14 @@ return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_imap_tk="yes" -else +else $as_nop ac_cv_imap_tk="no" fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext if test "${ac_cv_imap_tk}" = "yes"; then cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -21991,7 +23927,7 @@ { } int -main () +main (void) { long check = mail_expunge_full(NULL, "", 0); @@ -22001,25 +23937,26 @@ return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_imap_tk2006="yes" -else +else $as_nop ac_cv_imap_tk2006="no" fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext fi CPPFLAGS="${saved_cppflags}" LIBS="${saved_libs}" if test "${ac_cv_imap_tk}" = "no"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } if test "${switch_to_system_on_failure}" = "yes"; then IMAP_TK_DIR="system" else #This means they specified a directory. Search for a package installation there too - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for system c-client library..." >&5 -$as_echo_n "checking for system c-client library...... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for system c-client library..." >&5 +printf %s "checking for system c-client library...... " >&6; } CPPFLAGS="${saved_cppflags}" LIBS="${saved_libs}" imap_include="-I${IMAP_TK_DIR}/include" @@ -22076,7 +24013,7 @@ { } int -main () +main (void) { MAILSTREAM *foo = mail_open(NULL, "", 0); @@ -22086,13 +24023,14 @@ return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_imap_tk="yes" -else +else $as_nop ac_cv_imap_tk="no" fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext if test "${ac_cv_imap_tk}" = "yes"; then cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -22144,7 +24082,7 @@ { } int -main () +main (void) { long check = mail_expunge_full(NULL, "", 0); @@ -22154,13 +24092,14 @@ return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_imap_tk2006="yes" -else +else $as_nop ac_cv_imap_tk2006="no" fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext fi fi @@ -22168,8 +24107,8 @@ fi if test "${IMAP_TK_DIR}" = "system"; then #We will enter here if user specified "system" or if any of above checks failed - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for system c-client library..." >&5 -$as_echo_n "checking for system c-client library...... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for system c-client library..." >&5 +printf %s "checking for system c-client library...... " >&6; } CPPFLAGS="${saved_cppflags}" LIBS="${saved_libs}" imap_ldflags="" @@ -22227,7 +24166,7 @@ { } int -main () +main (void) { MAILSTREAM *foo = mail_open(NULL, "", 0); @@ -22237,13 +24176,14 @@ return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_imap_tk="yes" -else +else $as_nop ac_cv_imap_tk="no" fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext if test "${ac_cv_imap_tk}" = "yes"; then cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -22296,7 +24236,7 @@ { } int -main () +main (void) { long check = mail_expunge_full(NULL, "", 0); @@ -22306,13 +24246,14 @@ return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_imap_tk2006="yes" -else +else $as_nop ac_cv_imap_tk2006="no" fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext else #looking in imap directory didn't work, try c-client imap_ldflags="" @@ -22372,7 +24313,7 @@ { } int -main () +main (void) { MAILSTREAM *foo = mail_open(NULL, "", 0); @@ -22382,13 +24323,14 @@ return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_imap_tk="yes" -else +else $as_nop ac_cv_imap_tk="no" fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext if test "${ac_cv_imap_tk}" = "no"; then imap_libs="-lcrypto -lssl -lc-client4" @@ -22443,7 +24385,7 @@ { } int -main () +main (void) { MAILSTREAM *foo = mail_open(NULL, "", 0); @@ -22453,13 +24395,14 @@ return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_imap_tk="yes" -else +else $as_nop ac_cv_imap_tk="no" fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext fi if test "${ac_cv_imap_tk}" = "yes"; then @@ -22513,7 +24456,7 @@ { } int -main () +main (void) { long check = mail_expunge_full(NULL, "", 0); @@ -22523,34 +24466,35 @@ return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_imap_tk2006="yes" -else +else $as_nop ac_cv_imap_tk2006="no" fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext fi fi fi if test "${ac_cv_imap_tk}" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } IMAP_TK_LIB="${imap_libs} "`echo ${imap_ldflags}` IMAP_TK_INCLUDE="${imap_include}" PBX_IMAP_TK=1 -$as_echo "#define HAVE_IMAP_TK 1" >>confdefs.h +printf "%s\n" "#define HAVE_IMAP_TK 1" >>confdefs.h if test "${ac_cv_imap_tk2006}" = "yes"; then -$as_echo "#define HAVE_IMAP_TK2006 1" >>confdefs.h +printf "%s\n" "#define HAVE_IMAP_TK2006 1" >>confdefs.h fi else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi CPPFLAGS="${saved_cppflags}" LIBS="${saved_libs}" @@ -22570,11 +24514,12 @@ ast_ext_lib_check_save_CFLAGS="${CFLAGS}" CFLAGS="${CFLAGS} ${PTHREAD_CFLAGS}" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for SQLConnect in -liodbc" >&5 -$as_echo_n "checking for SQLConnect in -liodbc... " >&6; } -if ${ac_cv_lib_iodbc_SQLConnect+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for SQLConnect in -liodbc" >&5 +printf %s "checking for SQLConnect in -liodbc... " >&6; } +if test ${ac_cv_lib_iodbc_SQLConnect+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-liodbc ${pbxlibdir} ${PTHREAD_LIBS} $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -22583,32 +24528,31 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char SQLConnect (); int -main () +main (void) { return SQLConnect (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_iodbc_SQLConnect=yes -else +else $as_nop ac_cv_lib_iodbc_SQLConnect=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_iodbc_SQLConnect" >&5 -$as_echo "$ac_cv_lib_iodbc_SQLConnect" >&6; } -if test "x$ac_cv_lib_iodbc_SQLConnect" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_iodbc_SQLConnect" >&5 +printf "%s\n" "$ac_cv_lib_iodbc_SQLConnect" >&6; } +if test "x$ac_cv_lib_iodbc_SQLConnect" = xyes +then : AST_IODBC_FOUND=yes -else +else $as_nop AST_IODBC_FOUND=no fi @@ -22627,14 +24571,14 @@ # check for the header ast_ext_lib_check_saved_CPPFLAGS="${CPPFLAGS}" CPPFLAGS="${CPPFLAGS} ${IODBC_INCLUDE}" - ac_fn_c_check_header_mongrel "$LINENO" "sql.h" "ac_cv_header_sql_h" "$ac_includes_default" -if test "x$ac_cv_header_sql_h" = xyes; then : + ac_fn_c_check_header_compile "$LINENO" "sql.h" "ac_cv_header_sql_h" "$ac_includes_default" +if test "x$ac_cv_header_sql_h" = xyes +then : IODBC_HEADER_FOUND=1 -else +else $as_nop IODBC_HEADER_FOUND=0 fi - CPPFLAGS="${ast_ext_lib_check_saved_CPPFLAGS}" if test "x${IODBC_HEADER_FOUND}" = "x0" ; then @@ -22667,11 +24611,12 @@ ast_ext_lib_check_save_CFLAGS="${CFLAGS}" CFLAGS="${CFLAGS} " - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for inotify_init in -lc" >&5 -$as_echo_n "checking for inotify_init in -lc... " >&6; } -if ${ac_cv_lib_c_inotify_init+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for inotify_init in -lc" >&5 +printf %s "checking for inotify_init in -lc... " >&6; } +if test ${ac_cv_lib_c_inotify_init+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lc ${pbxlibdir} $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -22680,32 +24625,31 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char inotify_init (); int -main () +main (void) { return inotify_init (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_c_inotify_init=yes -else +else $as_nop ac_cv_lib_c_inotify_init=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_c_inotify_init" >&5 -$as_echo "$ac_cv_lib_c_inotify_init" >&6; } -if test "x$ac_cv_lib_c_inotify_init" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_c_inotify_init" >&5 +printf "%s\n" "$ac_cv_lib_c_inotify_init" >&6; } +if test "x$ac_cv_lib_c_inotify_init" = xyes +then : AST_INOTIFY_FOUND=yes -else +else $as_nop AST_INOTIFY_FOUND=no fi @@ -22724,14 +24668,14 @@ # check for the header ast_ext_lib_check_saved_CPPFLAGS="${CPPFLAGS}" CPPFLAGS="${CPPFLAGS} ${INOTIFY_INCLUDE}" - ac_fn_c_check_header_mongrel "$LINENO" "sys/inotify.h" "ac_cv_header_sys_inotify_h" "$ac_includes_default" -if test "x$ac_cv_header_sys_inotify_h" = xyes; then : + ac_fn_c_check_header_compile "$LINENO" "sys/inotify.h" "ac_cv_header_sys_inotify_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_inotify_h" = xyes +then : INOTIFY_HEADER_FOUND=1 -else +else $as_nop INOTIFY_HEADER_FOUND=0 fi - CPPFLAGS="${ast_ext_lib_check_saved_CPPFLAGS}" if test "x${INOTIFY_HEADER_FOUND}" = "x0" ; then @@ -22764,11 +24708,12 @@ ast_ext_lib_check_save_CFLAGS="${CFLAGS}" CFLAGS="${CFLAGS} " - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for jack_activate in -ljack" >&5 -$as_echo_n "checking for jack_activate in -ljack... " >&6; } -if ${ac_cv_lib_jack_jack_activate+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for jack_activate in -ljack" >&5 +printf %s "checking for jack_activate in -ljack... " >&6; } +if test ${ac_cv_lib_jack_jack_activate+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-ljack ${pbxlibdir} $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -22777,32 +24722,31 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char jack_activate (); int -main () +main (void) { return jack_activate (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_jack_jack_activate=yes -else +else $as_nop ac_cv_lib_jack_jack_activate=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_jack_jack_activate" >&5 -$as_echo "$ac_cv_lib_jack_jack_activate" >&6; } -if test "x$ac_cv_lib_jack_jack_activate" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_jack_jack_activate" >&5 +printf "%s\n" "$ac_cv_lib_jack_jack_activate" >&6; } +if test "x$ac_cv_lib_jack_jack_activate" = xyes +then : AST_JACK_FOUND=yes -else +else $as_nop AST_JACK_FOUND=no fi @@ -22821,14 +24765,14 @@ # check for the header ast_ext_lib_check_saved_CPPFLAGS="${CPPFLAGS}" CPPFLAGS="${CPPFLAGS} ${JACK_INCLUDE}" - ac_fn_c_check_header_mongrel "$LINENO" "jack/jack.h" "ac_cv_header_jack_jack_h" "$ac_includes_default" -if test "x$ac_cv_header_jack_jack_h" = xyes; then : + ac_fn_c_check_header_compile "$LINENO" "jack/jack.h" "ac_cv_header_jack_jack_h" "$ac_includes_default" +if test "x$ac_cv_header_jack_jack_h" = xyes +then : JACK_HEADER_FOUND=1 -else +else $as_nop JACK_HEADER_FOUND=0 fi - CPPFLAGS="${ast_ext_lib_check_saved_CPPFLAGS}" if test "x${JACK_HEADER_FOUND}" = "x0" ; then @@ -22862,11 +24806,12 @@ ast_ext_lib_check_save_CFLAGS="${CFLAGS}" CFLAGS="${CFLAGS} " - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for kqueue in -lc" >&5 -$as_echo_n "checking for kqueue in -lc... " >&6; } -if ${ac_cv_lib_c_kqueue+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for kqueue in -lc" >&5 +printf %s "checking for kqueue in -lc... " >&6; } +if test ${ac_cv_lib_c_kqueue+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lc ${pbxlibdir} $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -22875,32 +24820,31 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char kqueue (); int -main () +main (void) { return kqueue (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_c_kqueue=yes -else +else $as_nop ac_cv_lib_c_kqueue=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_c_kqueue" >&5 -$as_echo "$ac_cv_lib_c_kqueue" >&6; } -if test "x$ac_cv_lib_c_kqueue" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_c_kqueue" >&5 +printf "%s\n" "$ac_cv_lib_c_kqueue" >&6; } +if test "x$ac_cv_lib_c_kqueue" = xyes +then : AST_KQUEUE_FOUND=yes -else +else $as_nop AST_KQUEUE_FOUND=no fi @@ -22919,14 +24863,14 @@ # check for the header ast_ext_lib_check_saved_CPPFLAGS="${CPPFLAGS}" CPPFLAGS="${CPPFLAGS} ${KQUEUE_INCLUDE}" - ac_fn_c_check_header_mongrel "$LINENO" "sys/event.h" "ac_cv_header_sys_event_h" "$ac_includes_default" -if test "x$ac_cv_header_sys_event_h" = xyes; then : + ac_fn_c_check_header_compile "$LINENO" "sys/event.h" "ac_cv_header_sys_event_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_event_h" = xyes +then : KQUEUE_HEADER_FOUND=1 -else +else $as_nop KQUEUE_HEADER_FOUND=0 fi - CPPFLAGS="${ast_ext_lib_check_saved_CPPFLAGS}" if test "x${KQUEUE_HEADER_FOUND}" = "x0" ; then @@ -22946,16 +24890,12 @@ # 64-bit version of kevent (from kqueue) on OS X -for ac_func in kevent64 -do : - ac_fn_c_check_func "$LINENO" "kevent64" "ac_cv_func_kevent64" -if test "x$ac_cv_func_kevent64" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_KEVENT64 1 -_ACEOF +ac_fn_c_check_func "$LINENO" "kevent64" "ac_cv_func_kevent64" +if test "x$ac_cv_func_kevent64" = xyes +then : + printf "%s\n" "#define HAVE_KEVENT64 1" >>confdefs.h fi -done @@ -22972,11 +24912,12 @@ ast_ext_lib_check_save_CFLAGS="${CFLAGS}" CFLAGS="${CFLAGS} " - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ldap_initialize in -lldap" >&5 -$as_echo_n "checking for ldap_initialize in -lldap... " >&6; } -if ${ac_cv_lib_ldap_ldap_initialize+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for ldap_initialize in -lldap" >&5 +printf %s "checking for ldap_initialize in -lldap... " >&6; } +if test ${ac_cv_lib_ldap_ldap_initialize+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lldap ${pbxlibdir} $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -22985,32 +24926,31 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char ldap_initialize (); int -main () +main (void) { return ldap_initialize (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_ldap_ldap_initialize=yes -else +else $as_nop ac_cv_lib_ldap_ldap_initialize=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ldap_ldap_initialize" >&5 -$as_echo "$ac_cv_lib_ldap_ldap_initialize" >&6; } -if test "x$ac_cv_lib_ldap_ldap_initialize" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ldap_ldap_initialize" >&5 +printf "%s\n" "$ac_cv_lib_ldap_ldap_initialize" >&6; } +if test "x$ac_cv_lib_ldap_ldap_initialize" = xyes +then : AST_LDAP_FOUND=yes -else +else $as_nop AST_LDAP_FOUND=no fi @@ -23029,14 +24969,14 @@ # check for the header ast_ext_lib_check_saved_CPPFLAGS="${CPPFLAGS}" CPPFLAGS="${CPPFLAGS} ${LDAP_INCLUDE}" - ac_fn_c_check_header_mongrel "$LINENO" "ldap.h" "ac_cv_header_ldap_h" "$ac_includes_default" -if test "x$ac_cv_header_ldap_h" = xyes; then : + ac_fn_c_check_header_compile "$LINENO" "ldap.h" "ac_cv_header_ldap_h" "$ac_includes_default" +if test "x$ac_cv_header_ldap_h" = xyes +then : LDAP_HEADER_FOUND=1 -else +else $as_nop LDAP_HEADER_FOUND=0 fi - CPPFLAGS="${ast_ext_lib_check_saved_CPPFLAGS}" if test "x${LDAP_HEADER_FOUND}" = "x0" ; then @@ -23069,11 +25009,12 @@ ast_ext_lib_check_save_CFLAGS="${CFLAGS}" CFLAGS="${CFLAGS} " - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for mISDN_open in -lmISDN" >&5 -$as_echo_n "checking for mISDN_open in -lmISDN... " >&6; } -if ${ac_cv_lib_mISDN_mISDN_open+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for mISDN_open in -lmISDN" >&5 +printf %s "checking for mISDN_open in -lmISDN... " >&6; } +if test ${ac_cv_lib_mISDN_mISDN_open+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lmISDN ${pbxlibdir} $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -23082,32 +25023,31 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char mISDN_open (); int -main () +main (void) { return mISDN_open (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_mISDN_mISDN_open=yes -else +else $as_nop ac_cv_lib_mISDN_mISDN_open=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_mISDN_mISDN_open" >&5 -$as_echo "$ac_cv_lib_mISDN_mISDN_open" >&6; } -if test "x$ac_cv_lib_mISDN_mISDN_open" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_mISDN_mISDN_open" >&5 +printf "%s\n" "$ac_cv_lib_mISDN_mISDN_open" >&6; } +if test "x$ac_cv_lib_mISDN_mISDN_open" = xyes +then : AST_MISDN_FOUND=yes -else +else $as_nop AST_MISDN_FOUND=no fi @@ -23126,14 +25066,14 @@ # check for the header ast_ext_lib_check_saved_CPPFLAGS="${CPPFLAGS}" CPPFLAGS="${CPPFLAGS} ${MISDN_INCLUDE}" - ac_fn_c_check_header_mongrel "$LINENO" "mISDNuser/mISDNlib.h" "ac_cv_header_mISDNuser_mISDNlib_h" "$ac_includes_default" -if test "x$ac_cv_header_mISDNuser_mISDNlib_h" = xyes; then : + ac_fn_c_check_header_compile "$LINENO" "mISDNuser/mISDNlib.h" "ac_cv_header_mISDNuser_mISDNlib_h" "$ac_includes_default" +if test "x$ac_cv_header_mISDNuser_mISDNlib_h" = xyes +then : MISDN_HEADER_FOUND=1 -else +else $as_nop MISDN_HEADER_FOUND=0 fi - CPPFLAGS="${ast_ext_lib_check_saved_CPPFLAGS}" if test "x${MISDN_HEADER_FOUND}" = "x0" ; then @@ -23167,11 +25107,12 @@ ast_ext_lib_check_save_CFLAGS="${CFLAGS}" CFLAGS="${CFLAGS} " - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for init_manager in -lisdnnet" >&5 -$as_echo_n "checking for init_manager in -lisdnnet... " >&6; } -if ${ac_cv_lib_isdnnet_init_manager+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for init_manager in -lisdnnet" >&5 +printf %s "checking for init_manager in -lisdnnet... " >&6; } +if test ${ac_cv_lib_isdnnet_init_manager+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lisdnnet ${pbxlibdir} -lmISDN -lpthread $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -23180,32 +25121,31 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char init_manager (); int -main () +main (void) { return init_manager (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_isdnnet_init_manager=yes -else +else $as_nop ac_cv_lib_isdnnet_init_manager=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_isdnnet_init_manager" >&5 -$as_echo "$ac_cv_lib_isdnnet_init_manager" >&6; } -if test "x$ac_cv_lib_isdnnet_init_manager" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_isdnnet_init_manager" >&5 +printf "%s\n" "$ac_cv_lib_isdnnet_init_manager" >&6; } +if test "x$ac_cv_lib_isdnnet_init_manager" = xyes +then : AST_ISDNNET_FOUND=yes -else +else $as_nop AST_ISDNNET_FOUND=no fi @@ -23224,14 +25164,14 @@ # check for the header ast_ext_lib_check_saved_CPPFLAGS="${CPPFLAGS}" CPPFLAGS="${CPPFLAGS} ${ISDNNET_INCLUDE}" - ac_fn_c_check_header_mongrel "$LINENO" "mISDNuser/isdn_net.h" "ac_cv_header_mISDNuser_isdn_net_h" "$ac_includes_default" -if test "x$ac_cv_header_mISDNuser_isdn_net_h" = xyes; then : + ac_fn_c_check_header_compile "$LINENO" "mISDNuser/isdn_net.h" "ac_cv_header_mISDNuser_isdn_net_h" "$ac_includes_default" +if test "x$ac_cv_header_mISDNuser_isdn_net_h" = xyes +then : ISDNNET_HEADER_FOUND=1 -else +else $as_nop ISDNNET_HEADER_FOUND=0 fi - CPPFLAGS="${ast_ext_lib_check_saved_CPPFLAGS}" if test "x${ISDNNET_HEADER_FOUND}" = "x0" ; then @@ -23263,11 +25203,12 @@ ast_ext_lib_check_save_CFLAGS="${CFLAGS}" CFLAGS="${CFLAGS} " - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for encodeFac in -lsuppserv" >&5 -$as_echo_n "checking for encodeFac in -lsuppserv... " >&6; } -if ${ac_cv_lib_suppserv_encodeFac+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for encodeFac in -lsuppserv" >&5 +printf %s "checking for encodeFac in -lsuppserv... " >&6; } +if test ${ac_cv_lib_suppserv_encodeFac+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lsuppserv ${pbxlibdir} $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -23276,32 +25217,31 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char encodeFac (); int -main () +main (void) { return encodeFac (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_suppserv_encodeFac=yes -else +else $as_nop ac_cv_lib_suppserv_encodeFac=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_suppserv_encodeFac" >&5 -$as_echo "$ac_cv_lib_suppserv_encodeFac" >&6; } -if test "x$ac_cv_lib_suppserv_encodeFac" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_suppserv_encodeFac" >&5 +printf "%s\n" "$ac_cv_lib_suppserv_encodeFac" >&6; } +if test "x$ac_cv_lib_suppserv_encodeFac" = xyes +then : AST_SUPPSERV_FOUND=yes -else +else $as_nop AST_SUPPSERV_FOUND=no fi @@ -23320,14 +25260,14 @@ # check for the header ast_ext_lib_check_saved_CPPFLAGS="${CPPFLAGS}" CPPFLAGS="${CPPFLAGS} ${SUPPSERV_INCLUDE}" - ac_fn_c_check_header_mongrel "$LINENO" "mISDNuser/suppserv.h" "ac_cv_header_mISDNuser_suppserv_h" "$ac_includes_default" -if test "x$ac_cv_header_mISDNuser_suppserv_h" = xyes; then : + ac_fn_c_check_header_compile "$LINENO" "mISDNuser/suppserv.h" "ac_cv_header_mISDNuser_suppserv_h" "$ac_includes_default" +if test "x$ac_cv_header_mISDNuser_suppserv_h" = xyes +then : SUPPSERV_HEADER_FOUND=1 -else +else $as_nop SUPPSERV_HEADER_FOUND=0 fi - CPPFLAGS="${ast_ext_lib_check_saved_CPPFLAGS}" if test "x${SUPPSERV_HEADER_FOUND}" = "x0" ; then @@ -23347,8 +25287,8 @@ if test "x${PBX_MISDN_FAC_RESULT}" != "x1"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Fac_RESULT in mISDNuser/suppserv.h" >&5 -$as_echo_n "checking for Fac_RESULT in mISDNuser/suppserv.h... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for Fac_RESULT in mISDNuser/suppserv.h" >&5 +printf %s "checking for Fac_RESULT in mISDNuser/suppserv.h... " >&6; } saved_cppflags="${CPPFLAGS}" if test "x${MISDN_FAC_RESULT_DIR}" != "x"; then MISDN_FAC_RESULT_INCLUDE="-I${MISDN_FAC_RESULT_DIR}/include" @@ -23359,7 +25299,7 @@ /* end confdefs.h. */ #include int -main () +main (void) { #if defined(Fac_RESULT) int foo = 0; @@ -23372,29 +25312,30 @@ return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } +if ac_fn_c_try_compile "$LINENO" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } PBX_MISDN_FAC_RESULT=1 -$as_echo "#define HAVE_MISDN_FAC_RESULT 1" >>confdefs.h +printf "%s\n" "#define HAVE_MISDN_FAC_RESULT 1" >>confdefs.h -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext CPPFLAGS="${saved_cppflags}" fi if test "x${PBX_MISDN_FAC_ERROR}" != "x1"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Fac_ERROR in mISDNuser/suppserv.h" >&5 -$as_echo_n "checking for Fac_ERROR in mISDNuser/suppserv.h... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for Fac_ERROR in mISDNuser/suppserv.h" >&5 +printf %s "checking for Fac_ERROR in mISDNuser/suppserv.h... " >&6; } saved_cppflags="${CPPFLAGS}" if test "x${MISDN_FAC_ERROR_DIR}" != "x"; then MISDN_FAC_ERROR_INCLUDE="-I${MISDN_FAC_ERROR_DIR}/include" @@ -23405,7 +25346,7 @@ /* end confdefs.h. */ #include int -main () +main (void) { #if defined(Fac_ERROR) int foo = 0; @@ -23418,40 +25359,40 @@ return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } +if ac_fn_c_try_compile "$LINENO" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } PBX_MISDN_FAC_ERROR=1 -$as_echo "#define HAVE_MISDN_FAC_ERROR 1" >>confdefs.h +printf "%s\n" "#define HAVE_MISDN_FAC_ERROR 1" >>confdefs.h -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext CPPFLAGS="${saved_cppflags}" fi - ac_fn_c_check_header_mongrel "$LINENO" "linux/mISDNdsp.h" "ac_cv_header_linux_mISDNdsp_h" "$ac_includes_default" -if test "x$ac_cv_header_linux_mISDNdsp_h" = xyes; then : + ac_fn_c_check_header_compile "$LINENO" "linux/mISDNdsp.h" "ac_cv_header_linux_mISDNdsp_h" "$ac_includes_default" +if test "x$ac_cv_header_linux_mISDNdsp_h" = xyes +then : -cat >>confdefs.h <<_ACEOF -#define MISDN_1_2 1 -_ACEOF +printf "%s\n" "#define MISDN_1_2 1" >>confdefs.h fi - ac_fn_c_check_member "$LINENO" "Q931_info_t" "redirect_dn" "ac_cv_member_Q931_info_t_redirect_dn" "#include " -if test "x$ac_cv_member_Q931_info_t_redirect_dn" = xyes; then : +if test "x$ac_cv_member_Q931_info_t_redirect_dn" = xyes +then : -else +else $as_nop PBX_MISDN=0 fi @@ -23464,11 +25405,12 @@ if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}mysql_config", so it can be a program name with args. set dummy ${ac_tool_prefix}mysql_config; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_CONFIG_MYSQLCLIENT+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_CONFIG_MYSQLCLIENT+y} +then : + printf %s "(cached) " >&6 +else $as_nop case $CONFIG_MYSQLCLIENT in [\\/]* | ?:[\\/]*) ac_cv_path_CONFIG_MYSQLCLIENT="$CONFIG_MYSQLCLIENT" # Let the user override the test with a path. @@ -23479,11 +25421,15 @@ for as_dir in $as_dummy do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_CONFIG_MYSQLCLIENT="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_CONFIG_MYSQLCLIENT="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -23495,11 +25441,11 @@ fi CONFIG_MYSQLCLIENT=$ac_cv_path_CONFIG_MYSQLCLIENT if test -n "$CONFIG_MYSQLCLIENT"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CONFIG_MYSQLCLIENT" >&5 -$as_echo "$CONFIG_MYSQLCLIENT" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CONFIG_MYSQLCLIENT" >&5 +printf "%s\n" "$CONFIG_MYSQLCLIENT" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -23508,11 +25454,12 @@ ac_pt_CONFIG_MYSQLCLIENT=$CONFIG_MYSQLCLIENT # Extract the first word of "mysql_config", so it can be a program name with args. set dummy mysql_config; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_ac_pt_CONFIG_MYSQLCLIENT+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_ac_pt_CONFIG_MYSQLCLIENT+y} +then : + printf %s "(cached) " >&6 +else $as_nop case $ac_pt_CONFIG_MYSQLCLIENT in [\\/]* | ?:[\\/]*) ac_cv_path_ac_pt_CONFIG_MYSQLCLIENT="$ac_pt_CONFIG_MYSQLCLIENT" # Let the user override the test with a path. @@ -23523,11 +25470,15 @@ for as_dir in $as_dummy do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_ac_pt_CONFIG_MYSQLCLIENT="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_ac_pt_CONFIG_MYSQLCLIENT="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -23539,11 +25490,11 @@ fi ac_pt_CONFIG_MYSQLCLIENT=$ac_cv_path_ac_pt_CONFIG_MYSQLCLIENT if test -n "$ac_pt_CONFIG_MYSQLCLIENT"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_CONFIG_MYSQLCLIENT" >&5 -$as_echo "$ac_pt_CONFIG_MYSQLCLIENT" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_pt_CONFIG_MYSQLCLIENT" >&5 +printf "%s\n" "$ac_pt_CONFIG_MYSQLCLIENT" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi if test "x$ac_pt_CONFIG_MYSQLCLIENT" = x; then @@ -23551,8 +25502,8 @@ else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CONFIG_MYSQLCLIENT=$ac_pt_CONFIG_MYSQLCLIENT @@ -23571,7 +25522,7 @@ PBX_MYSQLCLIENT=1 -$as_echo "#define HAVE_MYSQLCLIENT 1" >>confdefs.h +printf "%s\n" "#define HAVE_MYSQLCLIENT 1" >>confdefs.h fi @@ -23579,57 +25530,59 @@ if test "${PBX_MYSQLCLIENT}" = 1; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for MySQL client bool support" >&5 -$as_echo_n "checking for MySQL client bool support... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for MySQL client bool support" >&5 +printf %s "checking for MySQL client bool support... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int -main () +main (void) { bool test = 1; ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } +if ac_fn_c_try_link "$LINENO" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } -$as_echo "#define HAVE_MYSQLCLIENT_BOOL 1" >>confdefs.h +printf "%s\n" "#define HAVE_MYSQLCLIENT_BOOL 1" >>confdefs.h -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for MySQL client my_bool support" >&5 -$as_echo_n "checking for MySQL client my_bool support... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for MySQL client my_bool support" >&5 +printf %s "checking for MySQL client my_bool support... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int -main () +main (void) { my_bool test = 1; ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } +if ac_fn_c_try_link "$LINENO" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } -$as_echo "#define HAVE_MYSQLCLIENT_MY_BOOL 1" >>confdefs.h +printf "%s\n" "#define HAVE_MYSQLCLIENT_MY_BOOL 1" >>confdefs.h -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext fi @@ -23647,11 +25600,12 @@ ast_ext_lib_check_save_CFLAGS="${CFLAGS}" CFLAGS="${CFLAGS} " - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for nbs_connect in -lnbs" >&5 -$as_echo_n "checking for nbs_connect in -lnbs... " >&6; } -if ${ac_cv_lib_nbs_nbs_connect+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for nbs_connect in -lnbs" >&5 +printf %s "checking for nbs_connect in -lnbs... " >&6; } +if test ${ac_cv_lib_nbs_nbs_connect+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lnbs ${pbxlibdir} $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -23660,32 +25614,31 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char nbs_connect (); int -main () +main (void) { return nbs_connect (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_nbs_nbs_connect=yes -else +else $as_nop ac_cv_lib_nbs_nbs_connect=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_nbs_nbs_connect" >&5 -$as_echo "$ac_cv_lib_nbs_nbs_connect" >&6; } -if test "x$ac_cv_lib_nbs_nbs_connect" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_nbs_nbs_connect" >&5 +printf "%s\n" "$ac_cv_lib_nbs_nbs_connect" >&6; } +if test "x$ac_cv_lib_nbs_nbs_connect" = xyes +then : AST_NBS_FOUND=yes -else +else $as_nop AST_NBS_FOUND=no fi @@ -23704,14 +25657,14 @@ # check for the header ast_ext_lib_check_saved_CPPFLAGS="${CPPFLAGS}" CPPFLAGS="${CPPFLAGS} ${NBS_INCLUDE}" - ac_fn_c_check_header_mongrel "$LINENO" "nbs.h" "ac_cv_header_nbs_h" "$ac_includes_default" -if test "x$ac_cv_header_nbs_h" = xyes; then : + ac_fn_c_check_header_compile "$LINENO" "nbs.h" "ac_cv_header_nbs_h" "$ac_includes_default" +if test "x$ac_cv_header_nbs_h" = xyes +then : NBS_HEADER_FOUND=1 -else +else $as_nop NBS_HEADER_FOUND=0 fi - CPPFLAGS="${ast_ext_lib_check_saved_CPPFLAGS}" if test "x${NBS_HEADER_FOUND}" = "x0" ; then @@ -23736,11 +25689,12 @@ if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}neon-config", so it can be a program name with args. set dummy ${ac_tool_prefix}neon-config; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_CONFIG_NEON+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_CONFIG_NEON+y} +then : + printf %s "(cached) " >&6 +else $as_nop case $CONFIG_NEON in [\\/]* | ?:[\\/]*) ac_cv_path_CONFIG_NEON="$CONFIG_NEON" # Let the user override the test with a path. @@ -23751,11 +25705,15 @@ for as_dir in $as_dummy do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_CONFIG_NEON="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_CONFIG_NEON="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -23767,11 +25725,11 @@ fi CONFIG_NEON=$ac_cv_path_CONFIG_NEON if test -n "$CONFIG_NEON"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CONFIG_NEON" >&5 -$as_echo "$CONFIG_NEON" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CONFIG_NEON" >&5 +printf "%s\n" "$CONFIG_NEON" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -23780,11 +25738,12 @@ ac_pt_CONFIG_NEON=$CONFIG_NEON # Extract the first word of "neon-config", so it can be a program name with args. set dummy neon-config; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_ac_pt_CONFIG_NEON+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_ac_pt_CONFIG_NEON+y} +then : + printf %s "(cached) " >&6 +else $as_nop case $ac_pt_CONFIG_NEON in [\\/]* | ?:[\\/]*) ac_cv_path_ac_pt_CONFIG_NEON="$ac_pt_CONFIG_NEON" # Let the user override the test with a path. @@ -23795,11 +25754,15 @@ for as_dir in $as_dummy do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_ac_pt_CONFIG_NEON="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_ac_pt_CONFIG_NEON="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -23811,11 +25774,11 @@ fi ac_pt_CONFIG_NEON=$ac_cv_path_ac_pt_CONFIG_NEON if test -n "$ac_pt_CONFIG_NEON"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_CONFIG_NEON" >&5 -$as_echo "$ac_pt_CONFIG_NEON" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_pt_CONFIG_NEON" >&5 +printf "%s\n" "$ac_pt_CONFIG_NEON" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi if test "x$ac_pt_CONFIG_NEON" = x; then @@ -23823,8 +25786,8 @@ else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CONFIG_NEON=$ac_pt_CONFIG_NEON @@ -23843,7 +25806,7 @@ PBX_NEON=1 -$as_echo "#define HAVE_NEON 1" >>confdefs.h +printf "%s\n" "#define HAVE_NEON 1" >>confdefs.h fi @@ -23856,11 +25819,12 @@ if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}neon-config", so it can be a program name with args. set dummy ${ac_tool_prefix}neon-config; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_CONFIG_NEON29+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_CONFIG_NEON29+y} +then : + printf %s "(cached) " >&6 +else $as_nop case $CONFIG_NEON29 in [\\/]* | ?:[\\/]*) ac_cv_path_CONFIG_NEON29="$CONFIG_NEON29" # Let the user override the test with a path. @@ -23871,11 +25835,15 @@ for as_dir in $as_dummy do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_CONFIG_NEON29="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_CONFIG_NEON29="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -23887,11 +25855,11 @@ fi CONFIG_NEON29=$ac_cv_path_CONFIG_NEON29 if test -n "$CONFIG_NEON29"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CONFIG_NEON29" >&5 -$as_echo "$CONFIG_NEON29" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CONFIG_NEON29" >&5 +printf "%s\n" "$CONFIG_NEON29" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -23900,11 +25868,12 @@ ac_pt_CONFIG_NEON29=$CONFIG_NEON29 # Extract the first word of "neon-config", so it can be a program name with args. set dummy neon-config; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_ac_pt_CONFIG_NEON29+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_ac_pt_CONFIG_NEON29+y} +then : + printf %s "(cached) " >&6 +else $as_nop case $ac_pt_CONFIG_NEON29 in [\\/]* | ?:[\\/]*) ac_cv_path_ac_pt_CONFIG_NEON29="$ac_pt_CONFIG_NEON29" # Let the user override the test with a path. @@ -23915,11 +25884,15 @@ for as_dir in $as_dummy do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_ac_pt_CONFIG_NEON29="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_ac_pt_CONFIG_NEON29="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -23931,11 +25904,11 @@ fi ac_pt_CONFIG_NEON29=$ac_cv_path_ac_pt_CONFIG_NEON29 if test -n "$ac_pt_CONFIG_NEON29"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_CONFIG_NEON29" >&5 -$as_echo "$ac_pt_CONFIG_NEON29" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_pt_CONFIG_NEON29" >&5 +printf "%s\n" "$ac_pt_CONFIG_NEON29" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi if test "x$ac_pt_CONFIG_NEON29" = x; then @@ -23943,8 +25916,8 @@ else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CONFIG_NEON29=$ac_pt_CONFIG_NEON29 @@ -23971,7 +25944,7 @@ /* end confdefs.h. */ #include int -main () +main (void) { #ifndef NE_AUTH_NTLM #error Need libneon >= 0.29.0 @@ -23980,12 +25953,13 @@ return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : PBX_NEON29=1 -$as_echo "#define HAVE_NEON29 1" >>confdefs.h +printf "%s\n" "#define HAVE_NEON29 1" >>confdefs.h fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext CPPFLAGS="${saved_cppflags}" LIBS="${saved_libs}" @@ -23998,17 +25972,17 @@ if test "x${PBX_NETSNMP}" != "x1" -a "${USE_NETSNMP}" != "no"; then pkg_failed=no -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for NETSNMP" >&5 -$as_echo_n "checking for NETSNMP... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for netsnmp-agent" >&5 +printf %s "checking for netsnmp-agent... " >&6; } if test -n "$NETSNMP_CFLAGS"; then pkg_cv_NETSNMP_CFLAGS="$NETSNMP_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"netsnmp-agent\""; } >&5 + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"netsnmp-agent\""; } >&5 ($PKG_CONFIG --exists --print-errors "netsnmp-agent") 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_NETSNMP_CFLAGS=`$PKG_CONFIG --cflags "netsnmp-agent" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes @@ -24022,10 +25996,10 @@ pkg_cv_NETSNMP_LIBS="$NETSNMP_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"netsnmp-agent\""; } >&5 + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"netsnmp-agent\""; } >&5 ($PKG_CONFIG --exists --print-errors "netsnmp-agent") 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_NETSNMP_LIBS=`$PKG_CONFIG --libs "netsnmp-agent" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes @@ -24039,8 +26013,8 @@ if test $pkg_failed = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes @@ -24060,8 +26034,8 @@ elif test $pkg_failed = untried; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } PBX_NETSNMP=0 @@ -24069,14 +26043,14 @@ else NETSNMP_CFLAGS=$pkg_cv_NETSNMP_CFLAGS NETSNMP_LIBS=$pkg_cv_NETSNMP_LIBS - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } PBX_NETSNMP=1 NETSNMP_INCLUDE=$(echo ${NETSNMP_CFLAGS} | $SED -e "s|-std=c99||g") NETSNMP_LIB="$NETSNMP_LIBS" -$as_echo "#define HAVE_NETSNMP 1" >>confdefs.h +printf "%s\n" "#define HAVE_NETSNMP 1" >>confdefs.h fi @@ -24088,11 +26062,12 @@ if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}net-snmp-config", so it can be a program name with args. set dummy ${ac_tool_prefix}net-snmp-config; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_CONFIG_NETSNMP+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_CONFIG_NETSNMP+y} +then : + printf %s "(cached) " >&6 +else $as_nop case $CONFIG_NETSNMP in [\\/]* | ?:[\\/]*) ac_cv_path_CONFIG_NETSNMP="$CONFIG_NETSNMP" # Let the user override the test with a path. @@ -24103,11 +26078,15 @@ for as_dir in $as_dummy do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_CONFIG_NETSNMP="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_CONFIG_NETSNMP="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -24119,11 +26098,11 @@ fi CONFIG_NETSNMP=$ac_cv_path_CONFIG_NETSNMP if test -n "$CONFIG_NETSNMP"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CONFIG_NETSNMP" >&5 -$as_echo "$CONFIG_NETSNMP" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CONFIG_NETSNMP" >&5 +printf "%s\n" "$CONFIG_NETSNMP" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -24132,11 +26111,12 @@ ac_pt_CONFIG_NETSNMP=$CONFIG_NETSNMP # Extract the first word of "net-snmp-config", so it can be a program name with args. set dummy net-snmp-config; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_ac_pt_CONFIG_NETSNMP+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_ac_pt_CONFIG_NETSNMP+y} +then : + printf %s "(cached) " >&6 +else $as_nop case $ac_pt_CONFIG_NETSNMP in [\\/]* | ?:[\\/]*) ac_cv_path_ac_pt_CONFIG_NETSNMP="$ac_pt_CONFIG_NETSNMP" # Let the user override the test with a path. @@ -24147,11 +26127,15 @@ for as_dir in $as_dummy do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_ac_pt_CONFIG_NETSNMP="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_ac_pt_CONFIG_NETSNMP="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -24163,11 +26147,11 @@ fi ac_pt_CONFIG_NETSNMP=$ac_cv_path_ac_pt_CONFIG_NETSNMP if test -n "$ac_pt_CONFIG_NETSNMP"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_CONFIG_NETSNMP" >&5 -$as_echo "$ac_pt_CONFIG_NETSNMP" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_pt_CONFIG_NETSNMP" >&5 +printf "%s\n" "$ac_pt_CONFIG_NETSNMP" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi if test "x$ac_pt_CONFIG_NETSNMP" = x; then @@ -24175,8 +26159,8 @@ else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CONFIG_NETSNMP=$ac_pt_CONFIG_NETSNMP @@ -24205,19 +26189,20 @@ #include #include int -main () +main (void) { int callback = snmp_register_callback(0, 0, NULL, NULL); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : PBX_NETSNMP=1 -$as_echo "#define HAVE_NETSNMP 1" >>confdefs.h +printf "%s\n" "#define HAVE_NETSNMP 1" >>confdefs.h fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext CPPFLAGS="${saved_cppflags}" LIBS="${saved_libs}" @@ -24240,11 +26225,12 @@ ast_ext_lib_check_save_CFLAGS="${CFLAGS}" CFLAGS="${CFLAGS} " - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for newtBell in -lnewt" >&5 -$as_echo_n "checking for newtBell in -lnewt... " >&6; } -if ${ac_cv_lib_newt_newtBell+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for newtBell in -lnewt" >&5 +printf %s "checking for newtBell in -lnewt... " >&6; } +if test ${ac_cv_lib_newt_newtBell+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lnewt ${pbxlibdir} $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -24253,32 +26239,31 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char newtBell (); int -main () +main (void) { return newtBell (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_newt_newtBell=yes -else +else $as_nop ac_cv_lib_newt_newtBell=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_newt_newtBell" >&5 -$as_echo "$ac_cv_lib_newt_newtBell" >&6; } -if test "x$ac_cv_lib_newt_newtBell" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_newt_newtBell" >&5 +printf "%s\n" "$ac_cv_lib_newt_newtBell" >&6; } +if test "x$ac_cv_lib_newt_newtBell" = xyes +then : AST_NEWT_FOUND=yes -else +else $as_nop AST_NEWT_FOUND=no fi @@ -24297,14 +26282,14 @@ # check for the header ast_ext_lib_check_saved_CPPFLAGS="${CPPFLAGS}" CPPFLAGS="${CPPFLAGS} ${NEWT_INCLUDE}" - ac_fn_c_check_header_mongrel "$LINENO" "newt.h" "ac_cv_header_newt_h" "$ac_includes_default" -if test "x$ac_cv_header_newt_h" = xyes; then : + ac_fn_c_check_header_compile "$LINENO" "newt.h" "ac_cv_header_newt_h" "$ac_includes_default" +if test "x$ac_cv_header_newt_h" = xyes +then : NEWT_HEADER_FOUND=1 -else +else $as_nop NEWT_HEADER_FOUND=0 fi - CPPFLAGS="${ast_ext_lib_check_saved_CPPFLAGS}" if test "x${NEWT_HEADER_FOUND}" = "x0" ; then @@ -24338,11 +26323,12 @@ ast_ext_lib_check_save_CFLAGS="${CFLAGS}" CFLAGS="${CFLAGS} " - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ub_ctx_delete in -lunbound" >&5 -$as_echo_n "checking for ub_ctx_delete in -lunbound... " >&6; } -if ${ac_cv_lib_unbound_ub_ctx_delete+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for ub_ctx_delete in -lunbound" >&5 +printf %s "checking for ub_ctx_delete in -lunbound... " >&6; } +if test ${ac_cv_lib_unbound_ub_ctx_delete+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lunbound ${pbxlibdir} $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -24351,32 +26337,31 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char ub_ctx_delete (); int -main () +main (void) { return ub_ctx_delete (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_unbound_ub_ctx_delete=yes -else +else $as_nop ac_cv_lib_unbound_ub_ctx_delete=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_unbound_ub_ctx_delete" >&5 -$as_echo "$ac_cv_lib_unbound_ub_ctx_delete" >&6; } -if test "x$ac_cv_lib_unbound_ub_ctx_delete" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_unbound_ub_ctx_delete" >&5 +printf "%s\n" "$ac_cv_lib_unbound_ub_ctx_delete" >&6; } +if test "x$ac_cv_lib_unbound_ub_ctx_delete" = xyes +then : AST_UNBOUND_FOUND=yes -else +else $as_nop AST_UNBOUND_FOUND=no fi @@ -24395,21 +26380,21 @@ # check for the header ast_ext_lib_check_saved_CPPFLAGS="${CPPFLAGS}" CPPFLAGS="${CPPFLAGS} ${UNBOUND_INCLUDE}" - ac_fn_c_check_header_mongrel "$LINENO" "unbound.h" "ac_cv_header_unbound_h" "$ac_includes_default" -if test "x$ac_cv_header_unbound_h" = xyes; then : + ac_fn_c_check_header_compile "$LINENO" "unbound.h" "ac_cv_header_unbound_h" "$ac_includes_default" +if test "x$ac_cv_header_unbound_h" = xyes +then : UNBOUND_HEADER_FOUND=1 -else +else $as_nop UNBOUND_HEADER_FOUND=0 fi - CPPFLAGS="${ast_ext_lib_check_saved_CPPFLAGS}" fi # Validate the package with the supplied code. if test "x${UNBOUND_HEADER_FOUND}" = "x1" ; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for unbound version >= 1.5" >&5 -$as_echo_n "checking for unbound version >= 1.5... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for unbound version >= 1.5" >&5 +printf %s "checking for unbound version >= 1.5... " >&6; } ast_ext_lib_check_saved_CPPFLAGS="${CPPFLAGS}" CPPFLAGS="${CPPFLAGS} ${UNBOUND_INCLUDE}" ast_ext_lib_check_saved_LIBS="${LIBS}" @@ -24419,7 +26404,7 @@ #include int -main () +main (void) { #if (UNBOUND_VERSION_MAJOR < 1 || (UNBOUND_VERSION_MAJOR == 1 && UNBOUND_VERSION_MINOR < 5 )) @@ -24432,32 +26417,33 @@ } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : if test "x${cross_compiling}" = "xyes" ; then UNBOUND_VALIDATED="1" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes (guessed for cross-compile)" >&5 -$as_echo "yes (guessed for cross-compile)" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes (guessed for cross-compile)" >&5 +printf "%s\n" "yes (guessed for cross-compile)" >&6; } else ./conftest$EXEEXT if test $? -eq 0 ; then UNBOUND_VALIDATED="1" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi fi -else +else $as_nop - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext CPPFLAGS="${ast_ext_lib_check_saved_CPPFLAGS}" LIBS="${ast_ext_lib_check_saved_LIBS}" @@ -24492,11 +26478,12 @@ ast_ext_lib_check_save_CFLAGS="${CFLAGS}" CFLAGS="${CFLAGS} " - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for SQLConnect in -lodbc" >&5 -$as_echo_n "checking for SQLConnect in -lodbc... " >&6; } -if ${ac_cv_lib_odbc_SQLConnect+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for SQLConnect in -lodbc" >&5 +printf %s "checking for SQLConnect in -lodbc... " >&6; } +if test ${ac_cv_lib_odbc_SQLConnect+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lodbc ${pbxlibdir} $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -24505,32 +26492,31 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char SQLConnect (); int -main () +main (void) { return SQLConnect (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_odbc_SQLConnect=yes -else +else $as_nop ac_cv_lib_odbc_SQLConnect=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_odbc_SQLConnect" >&5 -$as_echo "$ac_cv_lib_odbc_SQLConnect" >&6; } -if test "x$ac_cv_lib_odbc_SQLConnect" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_odbc_SQLConnect" >&5 +printf "%s\n" "$ac_cv_lib_odbc_SQLConnect" >&6; } +if test "x$ac_cv_lib_odbc_SQLConnect" = xyes +then : AST_UNIXODBC_FOUND=yes -else +else $as_nop AST_UNIXODBC_FOUND=no fi @@ -24549,14 +26535,14 @@ # check for the header ast_ext_lib_check_saved_CPPFLAGS="${CPPFLAGS}" CPPFLAGS="${CPPFLAGS} ${UNIXODBC_INCLUDE}" - ac_fn_c_check_header_mongrel "$LINENO" "sql.h" "ac_cv_header_sql_h" "$ac_includes_default" -if test "x$ac_cv_header_sql_h" = xyes; then : + ac_fn_c_check_header_compile "$LINENO" "sql.h" "ac_cv_header_sql_h" "$ac_includes_default" +if test "x$ac_cv_header_sql_h" = xyes +then : UNIXODBC_HEADER_FOUND=1 -else +else $as_nop UNIXODBC_HEADER_FOUND=0 fi - CPPFLAGS="${ast_ext_lib_check_saved_CPPFLAGS}" if test "x${UNIXODBC_HEADER_FOUND}" = "x0" ; then @@ -24589,11 +26575,12 @@ ast_ext_lib_check_save_CFLAGS="${CFLAGS}" CFLAGS="${CFLAGS} " - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ogg_stream_init in -logg" >&5 -$as_echo_n "checking for ogg_stream_init in -logg... " >&6; } -if ${ac_cv_lib_ogg_ogg_stream_init+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for ogg_stream_init in -logg" >&5 +printf %s "checking for ogg_stream_init in -logg... " >&6; } +if test ${ac_cv_lib_ogg_ogg_stream_init+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-logg ${pbxlibdir} $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -24601,33 +26588,32 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif + builtin and then its argument prototype would still apply. */ char ogg_stream_init (); int -main () +main (void) { return ogg_stream_init (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_ogg_ogg_stream_init=yes -else +else $as_nop ac_cv_lib_ogg_ogg_stream_init=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ogg_ogg_stream_init" >&5 -$as_echo "$ac_cv_lib_ogg_ogg_stream_init" >&6; } -if test "x$ac_cv_lib_ogg_ogg_stream_init" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ogg_ogg_stream_init" >&5 +printf "%s\n" "$ac_cv_lib_ogg_ogg_stream_init" >&6; } +if test "x$ac_cv_lib_ogg_ogg_stream_init" = xyes +then : AST_OGG_FOUND=yes -else +else $as_nop AST_OGG_FOUND=no fi @@ -24646,14 +26632,14 @@ # check for the header ast_ext_lib_check_saved_CPPFLAGS="${CPPFLAGS}" CPPFLAGS="${CPPFLAGS} ${OGG_INCLUDE}" - ac_fn_c_check_header_mongrel "$LINENO" "ogg/ogg.h" "ac_cv_header_ogg_ogg_h" "$ac_includes_default" -if test "x$ac_cv_header_ogg_ogg_h" = xyes; then : + ac_fn_c_check_header_compile "$LINENO" "ogg/ogg.h" "ac_cv_header_ogg_ogg_h" "$ac_includes_default" +if test "x$ac_cv_header_ogg_ogg_h" = xyes +then : OGG_HEADER_FOUND=1 -else +else $as_nop OGG_HEADER_FOUND=0 fi - CPPFLAGS="${ast_ext_lib_check_saved_CPPFLAGS}" if test "x${OGG_HEADER_FOUND}" = "x0" ; then @@ -24687,11 +26673,12 @@ ast_ext_lib_check_save_CFLAGS="${CFLAGS}" CFLAGS="${CFLAGS} " - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for backtrace in -lexecinfo" >&5 -$as_echo_n "checking for backtrace in -lexecinfo... " >&6; } -if ${ac_cv_lib_execinfo_backtrace+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for backtrace in -lexecinfo" >&5 +printf %s "checking for backtrace in -lexecinfo... " >&6; } +if test ${ac_cv_lib_execinfo_backtrace+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lexecinfo ${pbxlibdir} $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -24700,32 +26687,31 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char backtrace (); int -main () +main (void) { return backtrace (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_execinfo_backtrace=yes -else +else $as_nop ac_cv_lib_execinfo_backtrace=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_execinfo_backtrace" >&5 -$as_echo "$ac_cv_lib_execinfo_backtrace" >&6; } -if test "x$ac_cv_lib_execinfo_backtrace" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_execinfo_backtrace" >&5 +printf "%s\n" "$ac_cv_lib_execinfo_backtrace" >&6; } +if test "x$ac_cv_lib_execinfo_backtrace" = xyes +then : AST_BKTR_FOUND=yes -else +else $as_nop AST_BKTR_FOUND=no fi @@ -24744,14 +26730,14 @@ # check for the header ast_ext_lib_check_saved_CPPFLAGS="${CPPFLAGS}" CPPFLAGS="${CPPFLAGS} ${BKTR_INCLUDE}" - ac_fn_c_check_header_mongrel "$LINENO" "execinfo.h" "ac_cv_header_execinfo_h" "$ac_includes_default" -if test "x$ac_cv_header_execinfo_h" = xyes; then : + ac_fn_c_check_header_compile "$LINENO" "execinfo.h" "ac_cv_header_execinfo_h" "$ac_includes_default" +if test "x$ac_cv_header_execinfo_h" = xyes +then : BKTR_HEADER_FOUND=1 -else +else $as_nop BKTR_HEADER_FOUND=0 fi - CPPFLAGS="${ast_ext_lib_check_saved_CPPFLAGS}" if test "x${BKTR_HEADER_FOUND}" = "x0" ; then @@ -24784,11 +26770,12 @@ ast_ext_lib_check_save_CFLAGS="${CFLAGS}" CFLAGS="${CFLAGS} " - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for backtrace in -lc" >&5 -$as_echo_n "checking for backtrace in -lc... " >&6; } -if ${ac_cv_lib_c_backtrace+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for backtrace in -lc" >&5 +printf %s "checking for backtrace in -lc... " >&6; } +if test ${ac_cv_lib_c_backtrace+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lc ${pbxlibdir} $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -24797,32 +26784,31 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char backtrace (); int -main () +main (void) { return backtrace (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_c_backtrace=yes -else +else $as_nop ac_cv_lib_c_backtrace=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_c_backtrace" >&5 -$as_echo "$ac_cv_lib_c_backtrace" >&6; } -if test "x$ac_cv_lib_c_backtrace" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_c_backtrace" >&5 +printf "%s\n" "$ac_cv_lib_c_backtrace" >&6; } +if test "x$ac_cv_lib_c_backtrace" = xyes +then : AST_BKTR_FOUND=yes -else +else $as_nop AST_BKTR_FOUND=no fi @@ -24841,14 +26827,14 @@ # check for the header ast_ext_lib_check_saved_CPPFLAGS="${CPPFLAGS}" CPPFLAGS="${CPPFLAGS} ${BKTR_INCLUDE}" - ac_fn_c_check_header_mongrel "$LINENO" "execinfo.h" "ac_cv_header_execinfo_h" "$ac_includes_default" -if test "x$ac_cv_header_execinfo_h" = xyes; then : + ac_fn_c_check_header_compile "$LINENO" "execinfo.h" "ac_cv_header_execinfo_h" "$ac_includes_default" +if test "x$ac_cv_header_execinfo_h" = xyes +then : BKTR_HEADER_FOUND=1 -else +else $as_nop BKTR_HEADER_FOUND=0 fi - CPPFLAGS="${ast_ext_lib_check_saved_CPPFLAGS}" if test "x${BKTR_HEADER_FOUND}" = "x0" ; then @@ -24881,11 +26867,12 @@ ast_ext_lib_check_save_CFLAGS="${CFLAGS}" CFLAGS="${CFLAGS} " - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ba2str in -lbluetooth" >&5 -$as_echo_n "checking for ba2str in -lbluetooth... " >&6; } -if ${ac_cv_lib_bluetooth_ba2str+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for ba2str in -lbluetooth" >&5 +printf %s "checking for ba2str in -lbluetooth... " >&6; } +if test ${ac_cv_lib_bluetooth_ba2str+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lbluetooth ${pbxlibdir} $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -24894,32 +26881,31 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char ba2str (); int -main () +main (void) { return ba2str (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_bluetooth_ba2str=yes -else +else $as_nop ac_cv_lib_bluetooth_ba2str=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bluetooth_ba2str" >&5 -$as_echo "$ac_cv_lib_bluetooth_ba2str" >&6; } -if test "x$ac_cv_lib_bluetooth_ba2str" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bluetooth_ba2str" >&5 +printf "%s\n" "$ac_cv_lib_bluetooth_ba2str" >&6; } +if test "x$ac_cv_lib_bluetooth_ba2str" = xyes +then : AST_BLUETOOTH_FOUND=yes -else +else $as_nop AST_BLUETOOTH_FOUND=no fi @@ -24938,14 +26924,14 @@ # check for the header ast_ext_lib_check_saved_CPPFLAGS="${CPPFLAGS}" CPPFLAGS="${CPPFLAGS} ${BLUETOOTH_INCLUDE}" - ac_fn_c_check_header_mongrel "$LINENO" "bluetooth/bluetooth.h" "ac_cv_header_bluetooth_bluetooth_h" "$ac_includes_default" -if test "x$ac_cv_header_bluetooth_bluetooth_h" = xyes; then : + ac_fn_c_check_header_compile "$LINENO" "bluetooth/bluetooth.h" "ac_cv_header_bluetooth_bluetooth_h" "$ac_includes_default" +if test "x$ac_cv_header_bluetooth_bluetooth_h" = xyes +then : BLUETOOTH_HEADER_FOUND=1 -else +else $as_nop BLUETOOTH_HEADER_FOUND=0 fi - CPPFLAGS="${ast_ext_lib_check_saved_CPPFLAGS}" if test "x${BLUETOOTH_HEADER_FOUND}" = "x0" ; then @@ -24978,11 +26964,12 @@ ast_ext_lib_check_save_CFLAGS="${CFLAGS}" CFLAGS="${CFLAGS} " - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for bs_version in -lbeanstalk" >&5 -$as_echo_n "checking for bs_version in -lbeanstalk... " >&6; } -if ${ac_cv_lib_beanstalk_bs_version+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for bs_version in -lbeanstalk" >&5 +printf %s "checking for bs_version in -lbeanstalk... " >&6; } +if test ${ac_cv_lib_beanstalk_bs_version+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lbeanstalk ${pbxlibdir} $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -24991,32 +26978,31 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char bs_version (); int -main () +main (void) { return bs_version (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_beanstalk_bs_version=yes -else +else $as_nop ac_cv_lib_beanstalk_bs_version=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_beanstalk_bs_version" >&5 -$as_echo "$ac_cv_lib_beanstalk_bs_version" >&6; } -if test "x$ac_cv_lib_beanstalk_bs_version" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_beanstalk_bs_version" >&5 +printf "%s\n" "$ac_cv_lib_beanstalk_bs_version" >&6; } +if test "x$ac_cv_lib_beanstalk_bs_version" = xyes +then : AST_BEANSTALK_FOUND=yes -else +else $as_nop AST_BEANSTALK_FOUND=no fi @@ -25035,14 +27021,14 @@ # check for the header ast_ext_lib_check_saved_CPPFLAGS="${CPPFLAGS}" CPPFLAGS="${CPPFLAGS} ${BEANSTALK_INCLUDE}" - ac_fn_c_check_header_mongrel "$LINENO" "beanstalk.h" "ac_cv_header_beanstalk_h" "$ac_includes_default" -if test "x$ac_cv_header_beanstalk_h" = xyes; then : + ac_fn_c_check_header_compile "$LINENO" "beanstalk.h" "ac_cv_header_beanstalk_h" "$ac_includes_default" +if test "x$ac_cv_header_beanstalk_h" = xyes +then : BEANSTALK_HEADER_FOUND=1 -else +else $as_nop BEANSTALK_HEADER_FOUND=0 fi - CPPFLAGS="${ast_ext_lib_check_saved_CPPFLAGS}" if test "x${BEANSTALK_HEADER_FOUND}" = "x0" ; then @@ -25090,14 +27076,14 @@ # check for the header ast_ext_lib_check_saved_CPPFLAGS="${CPPFLAGS}" CPPFLAGS="${CPPFLAGS} ${OSS_INCLUDE}" - ac_fn_c_check_header_mongrel "$LINENO" "linux/soundcard.h" "ac_cv_header_linux_soundcard_h" "$ac_includes_default" -if test "x$ac_cv_header_linux_soundcard_h" = xyes; then : + ac_fn_c_check_header_compile "$LINENO" "linux/soundcard.h" "ac_cv_header_linux_soundcard_h" "$ac_includes_default" +if test "x$ac_cv_header_linux_soundcard_h" = xyes +then : OSS_HEADER_FOUND=1 -else +else $as_nop OSS_HEADER_FOUND=0 fi - CPPFLAGS="${ast_ext_lib_check_saved_CPPFLAGS}" if test "x${OSS_HEADER_FOUND}" = "x0" ; then @@ -25146,14 +27132,14 @@ # check for the header ast_ext_lib_check_saved_CPPFLAGS="${CPPFLAGS}" CPPFLAGS="${CPPFLAGS} ${OSS_INCLUDE}" - ac_fn_c_check_header_mongrel "$LINENO" "sys/soundcard.h" "ac_cv_header_sys_soundcard_h" "$ac_includes_default" -if test "x$ac_cv_header_sys_soundcard_h" = xyes; then : + ac_fn_c_check_header_compile "$LINENO" "sys/soundcard.h" "ac_cv_header_sys_soundcard_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_soundcard_h" = xyes +then : OSS_HEADER_FOUND=1 -else +else $as_nop OSS_HEADER_FOUND=0 fi - CPPFLAGS="${ast_ext_lib_check_saved_CPPFLAGS}" if test "x${OSS_HEADER_FOUND}" = "x0" ; then @@ -25188,11 +27174,12 @@ ast_ext_lib_check_save_CFLAGS="${CFLAGS}" CFLAGS="${CFLAGS} " - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for oss_ioctl_mixer in -lossaudio" >&5 -$as_echo_n "checking for oss_ioctl_mixer in -lossaudio... " >&6; } -if ${ac_cv_lib_ossaudio_oss_ioctl_mixer+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for oss_ioctl_mixer in -lossaudio" >&5 +printf %s "checking for oss_ioctl_mixer in -lossaudio... " >&6; } +if test ${ac_cv_lib_ossaudio_oss_ioctl_mixer+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lossaudio ${pbxlibdir} $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -25201,32 +27188,31 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char oss_ioctl_mixer (); int -main () +main (void) { return oss_ioctl_mixer (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_ossaudio_oss_ioctl_mixer=yes -else +else $as_nop ac_cv_lib_ossaudio_oss_ioctl_mixer=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ossaudio_oss_ioctl_mixer" >&5 -$as_echo "$ac_cv_lib_ossaudio_oss_ioctl_mixer" >&6; } -if test "x$ac_cv_lib_ossaudio_oss_ioctl_mixer" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ossaudio_oss_ioctl_mixer" >&5 +printf "%s\n" "$ac_cv_lib_ossaudio_oss_ioctl_mixer" >&6; } +if test "x$ac_cv_lib_ossaudio_oss_ioctl_mixer" = xyes +then : AST_OSS_FOUND=yes -else +else $as_nop AST_OSS_FOUND=no fi @@ -25245,14 +27231,14 @@ # check for the header ast_ext_lib_check_saved_CPPFLAGS="${CPPFLAGS}" CPPFLAGS="${CPPFLAGS} ${OSS_INCLUDE}" - ac_fn_c_check_header_mongrel "$LINENO" "soundcard.h" "ac_cv_header_soundcard_h" "$ac_includes_default" -if test "x$ac_cv_header_soundcard_h" = xyes; then : + ac_fn_c_check_header_compile "$LINENO" "soundcard.h" "ac_cv_header_soundcard_h" "$ac_includes_default" +if test "x$ac_cv_header_soundcard_h" = xyes +then : OSS_HEADER_FOUND=1 -else +else $as_nop OSS_HEADER_FOUND=0 fi - CPPFLAGS="${ast_ext_lib_check_saved_CPPFLAGS}" if test "x${OSS_HEADER_FOUND}" = "x0" ; then @@ -25277,11 +27263,12 @@ if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}pg_config", so it can be a program name with args. set dummy ${ac_tool_prefix}pg_config; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_PG_CONFIG+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_PG_CONFIG+y} +then : + printf %s "(cached) " >&6 +else $as_nop case $PG_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_PG_CONFIG="$PG_CONFIG" # Let the user override the test with a path. @@ -25291,11 +27278,15 @@ for as_dir in ${PGSQL_DIR}/bin do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_PG_CONFIG="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_PG_CONFIG="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -25307,11 +27298,11 @@ fi PG_CONFIG=$ac_cv_path_PG_CONFIG if test -n "$PG_CONFIG"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PG_CONFIG" >&5 -$as_echo "$PG_CONFIG" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $PG_CONFIG" >&5 +printf "%s\n" "$PG_CONFIG" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -25320,11 +27311,12 @@ ac_pt_PG_CONFIG=$PG_CONFIG # Extract the first word of "pg_config", so it can be a program name with args. set dummy pg_config; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_ac_pt_PG_CONFIG+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_ac_pt_PG_CONFIG+y} +then : + printf %s "(cached) " >&6 +else $as_nop case $ac_pt_PG_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_ac_pt_PG_CONFIG="$ac_pt_PG_CONFIG" # Let the user override the test with a path. @@ -25334,11 +27326,15 @@ for as_dir in ${PGSQL_DIR}/bin do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_ac_pt_PG_CONFIG="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_ac_pt_PG_CONFIG="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -25350,11 +27346,11 @@ fi ac_pt_PG_CONFIG=$ac_cv_path_ac_pt_PG_CONFIG if test -n "$ac_pt_PG_CONFIG"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PG_CONFIG" >&5 -$as_echo "$ac_pt_PG_CONFIG" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PG_CONFIG" >&5 +printf "%s\n" "$ac_pt_PG_CONFIG" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi if test "x$ac_pt_PG_CONFIG" = x; then @@ -25362,8 +27358,8 @@ else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac PG_CONFIG=$ac_pt_PG_CONFIG @@ -25373,27 +27369,28 @@ fi if test "${PG_CONFIG}" = ":"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: ***" >&5 -$as_echo "$as_me: ***" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: *** pg_config was not found in the path you specified:" >&5 -$as_echo "$as_me: *** pg_config was not found in the path you specified:" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: *** ${PGSQL_DIR}/bin" >&5 -$as_echo "$as_me: *** ${PGSQL_DIR}/bin" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: *** Either correct the installation, or run configure" >&5 -$as_echo "$as_me: *** Either correct the installation, or run configure" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: *** including --without-postgres" >&5 -$as_echo "$as_me: *** including --without-postgres" >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: ***" >&5 +printf "%s\n" "$as_me: ***" >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: *** pg_config was not found in the path you specified:" >&5 +printf "%s\n" "$as_me: *** pg_config was not found in the path you specified:" >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: *** ${PGSQL_DIR}/bin" >&5 +printf "%s\n" "$as_me: *** ${PGSQL_DIR}/bin" >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: *** Either correct the installation, or run configure" >&5 +printf "%s\n" "$as_me: *** Either correct the installation, or run configure" >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: *** including --without-postgres" >&5 +printf "%s\n" "$as_me: *** including --without-postgres" >&6;} exit 1 fi else if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}pg_config", so it can be a program name with args. set dummy ${ac_tool_prefix}pg_config; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_PG_CONFIG+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_PG_CONFIG+y} +then : + printf %s "(cached) " >&6 +else $as_nop case $PG_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_PG_CONFIG="$PG_CONFIG" # Let the user override the test with a path. @@ -25403,11 +27400,15 @@ for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_PG_CONFIG="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_PG_CONFIG="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -25419,11 +27420,11 @@ fi PG_CONFIG=$ac_cv_path_PG_CONFIG if test -n "$PG_CONFIG"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PG_CONFIG" >&5 -$as_echo "$PG_CONFIG" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $PG_CONFIG" >&5 +printf "%s\n" "$PG_CONFIG" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -25432,11 +27433,12 @@ ac_pt_PG_CONFIG=$PG_CONFIG # Extract the first word of "pg_config", so it can be a program name with args. set dummy pg_config; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_ac_pt_PG_CONFIG+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_ac_pt_PG_CONFIG+y} +then : + printf %s "(cached) " >&6 +else $as_nop case $ac_pt_PG_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_ac_pt_PG_CONFIG="$ac_pt_PG_CONFIG" # Let the user override the test with a path. @@ -25446,11 +27448,15 @@ for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_ac_pt_PG_CONFIG="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_ac_pt_PG_CONFIG="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -25462,11 +27468,11 @@ fi ac_pt_PG_CONFIG=$ac_cv_path_ac_pt_PG_CONFIG if test -n "$ac_pt_PG_CONFIG"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PG_CONFIG" >&5 -$as_echo "$ac_pt_PG_CONFIG" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PG_CONFIG" >&5 +printf "%s\n" "$ac_pt_PG_CONFIG" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi if test "x$ac_pt_PG_CONFIG" = x; then @@ -25474,8 +27480,8 @@ else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac PG_CONFIG=$ac_pt_PG_CONFIG @@ -25491,22 +27497,23 @@ PGSQL_includedir=`${PG_CONFIG} --includedir` if test "x$?" != "x0" ; then if test -n "${PGSQL_MANDATORY}" ; then - { $as_echo "$as_me:${as_lineno-$LINENO}: ***" >&5 -$as_echo "$as_me: ***" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: *** The PostgreSQL installation on this system appears to be broken." >&5 -$as_echo "$as_me: *** The PostgreSQL installation on this system appears to be broken." >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: *** Either correct the installation, or run configure" >&5 -$as_echo "$as_me: *** Either correct the installation, or run configure" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: *** including --without-postgres" >&5 -$as_echo "$as_me: *** including --without-postgres" >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: ***" >&5 +printf "%s\n" "$as_me: ***" >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: *** The PostgreSQL installation on this system appears to be broken." >&5 +printf "%s\n" "$as_me: *** The PostgreSQL installation on this system appears to be broken." >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: *** Either correct the installation, or run configure" >&5 +printf "%s\n" "$as_me: *** Either correct the installation, or run configure" >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: *** including --without-postgres" >&5 +printf "%s\n" "$as_me: *** including --without-postgres" >&6;} exit 1 fi else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for PQescapeStringConn in -lpq" >&5 -$as_echo_n "checking for PQescapeStringConn in -lpq... " >&6; } -if ${ac_cv_lib_pq_PQescapeStringConn+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for PQescapeStringConn in -lpq" >&5 +printf %s "checking for PQescapeStringConn in -lpq... " >&6; } +if test ${ac_cv_lib_pq_PQescapeStringConn+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lpq -L${PGSQL_libdir} -lz $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -25515,40 +27522,37 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char PQescapeStringConn (); int -main () +main (void) { return PQescapeStringConn (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_pq_PQescapeStringConn=yes -else +else $as_nop ac_cv_lib_pq_PQescapeStringConn=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pq_PQescapeStringConn" >&5 -$as_echo "$ac_cv_lib_pq_PQescapeStringConn" >&6; } -if test "x$ac_cv_lib_pq_PQescapeStringConn" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pq_PQescapeStringConn" >&5 +printf "%s\n" "$ac_cv_lib_pq_PQescapeStringConn" >&6; } +if test "x$ac_cv_lib_pq_PQescapeStringConn" = xyes +then : -cat >>confdefs.h <<_ACEOF -#define HAVE_PGSQL 1 -_ACEOF +printf "%s\n" "#define HAVE_PGSQL 1" >>confdefs.h fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pg_encoding_to_char within Postgres headers" >&5 -$as_echo_n "checking for pg_encoding_to_char within Postgres headers... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for pg_encoding_to_char within Postgres headers" >&5 +printf %s "checking for pg_encoding_to_char within Postgres headers... " >&6; } old_CFLAGS=${CFLAGS} CFLAGS="${CFLAGS} -I${PGSQL_includedir} -Werror" old_LDFLAGS=${LDFLAGS} @@ -25557,26 +27561,25 @@ /* end confdefs.h. */ #include int -main () +main (void) { const char *foo = pg_encoding_to_char(1) ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - -cat >>confdefs.h <<_ACEOF -#define HAVE_PGSQL_pg_encoding_to_char 1 -_ACEOF - -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } +if ac_fn_c_try_link "$LINENO" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + +printf "%s\n" "#define HAVE_PGSQL_pg_encoding_to_char 1" >>confdefs.h + +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext CFLAGS=${old_CFLAGS} LDFLAGS=${old_LDFLAGS} @@ -25587,14 +27590,14 @@ PBX_PGSQL=1 elif test -n "${PGSQL_MANDATORY}"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: ***" >&5 -$as_echo "$as_me: ***" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: *** The PostgreSQL installation on this system appears to be broken." >&5 -$as_echo "$as_me: *** The PostgreSQL installation on this system appears to be broken." >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: *** Either correct the installation, or run configure" >&5 -$as_echo "$as_me: *** Either correct the installation, or run configure" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: *** including --without-postgres" >&5 -$as_echo "$as_me: *** including --without-postgres" >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: ***" >&5 +printf "%s\n" "$as_me: ***" >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: *** The PostgreSQL installation on this system appears to be broken." >&5 +printf "%s\n" "$as_me: *** The PostgreSQL installation on this system appears to be broken." >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: *** Either correct the installation, or run configure" >&5 +printf "%s\n" "$as_me: *** Either correct the installation, or run configure" >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: *** including --without-postgres" >&5 +printf "%s\n" "$as_me: *** including --without-postgres" >&6;} exit 1 fi fi @@ -25606,17 +27609,17 @@ if test "x${PBX_PJPROJECT}" != "x1" -a "${USE_PJPROJECT}" != "no"; then pkg_failed=no -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for PJPROJECT" >&5 -$as_echo_n "checking for PJPROJECT... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libpjproject" >&5 +printf %s "checking for libpjproject... " >&6; } if test -n "$PJPROJECT_CFLAGS"; then pkg_cv_PJPROJECT_CFLAGS="$PJPROJECT_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libpjproject\""; } >&5 + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libpjproject\""; } >&5 ($PKG_CONFIG --exists --print-errors "libpjproject") 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_PJPROJECT_CFLAGS=`$PKG_CONFIG --cflags "libpjproject" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes @@ -25630,10 +27633,10 @@ pkg_cv_PJPROJECT_LIBS="$PJPROJECT_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libpjproject\""; } >&5 + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libpjproject\""; } >&5 ($PKG_CONFIG --exists --print-errors "libpjproject") 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_PJPROJECT_LIBS=`$PKG_CONFIG --libs "libpjproject" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes @@ -25647,8 +27650,8 @@ if test $pkg_failed = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes @@ -25668,8 +27671,8 @@ elif test $pkg_failed = untried; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } PBX_PJPROJECT=0 @@ -25677,14 +27680,14 @@ else PJPROJECT_CFLAGS=$pkg_cv_PJPROJECT_CFLAGS PJPROJECT_LIBS=$pkg_cv_PJPROJECT_LIBS - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } PBX_PJPROJECT=1 PJPROJECT_INCLUDE=$(echo ${PJPROJECT_CFLAGS} | $SED -e "s|-std=c99||g") PJPROJECT_LIB="$PJPROJECT_LIBS" -$as_echo "#define HAVE_PJPROJECT 1" >>confdefs.h +printf "%s\n" "#define HAVE_PJPROJECT 1" >>confdefs.h fi @@ -25705,11 +27708,12 @@ ast_ext_lib_check_save_CFLAGS="${CFLAGS}" CFLAGS="${CFLAGS} $PJPROJECT_CFLAGS" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pjsip_dlg_create_uas_and_inc_lock in -lpjsip" >&5 -$as_echo_n "checking for pjsip_dlg_create_uas_and_inc_lock in -lpjsip... " >&6; } -if ${ac_cv_lib_pjsip_pjsip_dlg_create_uas_and_inc_lock+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for pjsip_dlg_create_uas_and_inc_lock in -lpjsip" >&5 +printf %s "checking for pjsip_dlg_create_uas_and_inc_lock in -lpjsip... " >&6; } +if test ${ac_cv_lib_pjsip_pjsip_dlg_create_uas_and_inc_lock+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lpjsip ${pbxlibdir} $PJPROJECT_LIB $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -25718,32 +27722,31 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char pjsip_dlg_create_uas_and_inc_lock (); int -main () +main (void) { return pjsip_dlg_create_uas_and_inc_lock (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_pjsip_pjsip_dlg_create_uas_and_inc_lock=yes -else +else $as_nop ac_cv_lib_pjsip_pjsip_dlg_create_uas_and_inc_lock=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pjsip_pjsip_dlg_create_uas_and_inc_lock" >&5 -$as_echo "$ac_cv_lib_pjsip_pjsip_dlg_create_uas_and_inc_lock" >&6; } -if test "x$ac_cv_lib_pjsip_pjsip_dlg_create_uas_and_inc_lock" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pjsip_pjsip_dlg_create_uas_and_inc_lock" >&5 +printf "%s\n" "$ac_cv_lib_pjsip_pjsip_dlg_create_uas_and_inc_lock" >&6; } +if test "x$ac_cv_lib_pjsip_pjsip_dlg_create_uas_and_inc_lock" = xyes +then : AST_PJSIP_DLG_CREATE_UAS_AND_INC_LOCK_FOUND=yes -else +else $as_nop AST_PJSIP_DLG_CREATE_UAS_AND_INC_LOCK_FOUND=no fi @@ -25762,14 +27765,14 @@ # check for the header ast_ext_lib_check_saved_CPPFLAGS="${CPPFLAGS}" CPPFLAGS="${CPPFLAGS} ${PJSIP_DLG_CREATE_UAS_AND_INC_LOCK_INCLUDE}" - ac_fn_c_check_header_mongrel "$LINENO" "pjsip.h" "ac_cv_header_pjsip_h" "$ac_includes_default" -if test "x$ac_cv_header_pjsip_h" = xyes; then : + ac_fn_c_check_header_compile "$LINENO" "pjsip.h" "ac_cv_header_pjsip_h" "$ac_includes_default" +if test "x$ac_cv_header_pjsip_h" = xyes +then : PJSIP_DLG_CREATE_UAS_AND_INC_LOCK_HEADER_FOUND=1 -else +else $as_nop PJSIP_DLG_CREATE_UAS_AND_INC_LOCK_HEADER_FOUND=0 fi - CPPFLAGS="${ast_ext_lib_check_saved_CPPFLAGS}" if test "x${PJSIP_DLG_CREATE_UAS_AND_INC_LOCK_HEADER_FOUND}" = "x0" ; then @@ -25801,11 +27804,12 @@ ast_ext_lib_check_save_CFLAGS="${CFLAGS}" CFLAGS="${CFLAGS} $PJPROJECT_CFLAGS" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pjsip_tsx_create_uac2 in -lpjsip" >&5 -$as_echo_n "checking for pjsip_tsx_create_uac2 in -lpjsip... " >&6; } -if ${ac_cv_lib_pjsip_pjsip_tsx_create_uac2+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for pjsip_tsx_create_uac2 in -lpjsip" >&5 +printf %s "checking for pjsip_tsx_create_uac2 in -lpjsip... " >&6; } +if test ${ac_cv_lib_pjsip_pjsip_tsx_create_uac2+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lpjsip ${pbxlibdir} $PJPROJECT_LIB $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -25814,32 +27818,31 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char pjsip_tsx_create_uac2 (); int -main () +main (void) { return pjsip_tsx_create_uac2 (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_pjsip_pjsip_tsx_create_uac2=yes -else +else $as_nop ac_cv_lib_pjsip_pjsip_tsx_create_uac2=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pjsip_pjsip_tsx_create_uac2" >&5 -$as_echo "$ac_cv_lib_pjsip_pjsip_tsx_create_uac2" >&6; } -if test "x$ac_cv_lib_pjsip_pjsip_tsx_create_uac2" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pjsip_pjsip_tsx_create_uac2" >&5 +printf "%s\n" "$ac_cv_lib_pjsip_pjsip_tsx_create_uac2" >&6; } +if test "x$ac_cv_lib_pjsip_pjsip_tsx_create_uac2" = xyes +then : AST_PJ_TRANSACTION_GRP_LOCK_FOUND=yes -else +else $as_nop AST_PJ_TRANSACTION_GRP_LOCK_FOUND=no fi @@ -25858,14 +27861,14 @@ # check for the header ast_ext_lib_check_saved_CPPFLAGS="${CPPFLAGS}" CPPFLAGS="${CPPFLAGS} ${PJ_TRANSACTION_GRP_LOCK_INCLUDE}" - ac_fn_c_check_header_mongrel "$LINENO" "pjsip.h" "ac_cv_header_pjsip_h" "$ac_includes_default" -if test "x$ac_cv_header_pjsip_h" = xyes; then : + ac_fn_c_check_header_compile "$LINENO" "pjsip.h" "ac_cv_header_pjsip_h" "$ac_includes_default" +if test "x$ac_cv_header_pjsip_h" = xyes +then : PJ_TRANSACTION_GRP_LOCK_HEADER_FOUND=1 -else +else $as_nop PJ_TRANSACTION_GRP_LOCK_HEADER_FOUND=0 fi - CPPFLAGS="${ast_ext_lib_check_saved_CPPFLAGS}" if test "x${PJ_TRANSACTION_GRP_LOCK_HEADER_FOUND}" = "x0" ; then @@ -25890,8 +27893,8 @@ LIBS="${LIBS} ${PJPROJECT_LIB}" if test "x${PBX_PJSIP_REPLACE_MEDIA_STREAM}" != "x1" -a "${USE_PJSIP_REPLACE_MEDIA_STREAM}" != "no"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if \"pjmedia_mod_offer_flag flag = PJMEDIA_SDP_NEG_ALLOW_MEDIA_CHANGE\" compiles using pjmedia.h" >&5 -$as_echo_n "checking if \"pjmedia_mod_offer_flag flag = PJMEDIA_SDP_NEG_ALLOW_MEDIA_CHANGE\" compiles using pjmedia.h... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if \"pjmedia_mod_offer_flag flag = PJMEDIA_SDP_NEG_ALLOW_MEDIA_CHANGE\" compiles using pjmedia.h" >&5 +printf %s "checking if \"pjmedia_mod_offer_flag flag = PJMEDIA_SDP_NEG_ALLOW_MEDIA_CHANGE\" compiles using pjmedia.h... " >&6; } saved_cppflags="${CPPFLAGS}" if test "x${PJSIP_REPLACE_MEDIA_STREAM_DIR}" != "x"; then PJSIP_REPLACE_MEDIA_STREAM_INCLUDE="-I${PJSIP_REPLACE_MEDIA_STREAM_DIR}/include" @@ -25902,7 +27905,7 @@ /* end confdefs.h. */ #include int -main () +main (void) { pjmedia_mod_offer_flag flag = PJMEDIA_SDP_NEG_ALLOW_MEDIA_CHANGE; @@ -25910,21 +27913,22 @@ return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } +if ac_fn_c_try_compile "$LINENO" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } PBX_PJSIP_REPLACE_MEDIA_STREAM=1 -$as_echo "#define HAVE_PJSIP_REPLACE_MEDIA_STREAM 1" >>confdefs.h +printf "%s\n" "#define HAVE_PJSIP_REPLACE_MEDIA_STREAM 1" >>confdefs.h -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext CPPFLAGS="${saved_cppflags}" fi @@ -25945,11 +27949,12 @@ ast_ext_lib_check_save_CFLAGS="${CFLAGS}" CFLAGS="${CFLAGS} $PJPROJECT_CFLAGS" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pjsip_get_dest_info in -lpjsip" >&5 -$as_echo_n "checking for pjsip_get_dest_info in -lpjsip... " >&6; } -if ${ac_cv_lib_pjsip_pjsip_get_dest_info+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for pjsip_get_dest_info in -lpjsip" >&5 +printf %s "checking for pjsip_get_dest_info in -lpjsip... " >&6; } +if test ${ac_cv_lib_pjsip_pjsip_get_dest_info+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lpjsip ${pbxlibdir} $PJPROJECT_LIB $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -25958,32 +27963,31 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char pjsip_get_dest_info (); int -main () +main (void) { return pjsip_get_dest_info (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_pjsip_pjsip_get_dest_info=yes -else +else $as_nop ac_cv_lib_pjsip_pjsip_get_dest_info=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pjsip_pjsip_get_dest_info" >&5 -$as_echo "$ac_cv_lib_pjsip_pjsip_get_dest_info" >&6; } -if test "x$ac_cv_lib_pjsip_pjsip_get_dest_info" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pjsip_pjsip_get_dest_info" >&5 +printf "%s\n" "$ac_cv_lib_pjsip_pjsip_get_dest_info" >&6; } +if test "x$ac_cv_lib_pjsip_pjsip_get_dest_info" = xyes +then : AST_PJSIP_GET_DEST_INFO_FOUND=yes -else +else $as_nop AST_PJSIP_GET_DEST_INFO_FOUND=no fi @@ -26002,14 +28006,14 @@ # check for the header ast_ext_lib_check_saved_CPPFLAGS="${CPPFLAGS}" CPPFLAGS="${CPPFLAGS} ${PJSIP_GET_DEST_INFO_INCLUDE}" - ac_fn_c_check_header_mongrel "$LINENO" "pjsip.h" "ac_cv_header_pjsip_h" "$ac_includes_default" -if test "x$ac_cv_header_pjsip_h" = xyes; then : + ac_fn_c_check_header_compile "$LINENO" "pjsip.h" "ac_cv_header_pjsip_h" "$ac_includes_default" +if test "x$ac_cv_header_pjsip_h" = xyes +then : PJSIP_GET_DEST_INFO_HEADER_FOUND=1 -else +else $as_nop PJSIP_GET_DEST_INFO_HEADER_FOUND=0 fi - CPPFLAGS="${ast_ext_lib_check_saved_CPPFLAGS}" if test "x${PJSIP_GET_DEST_INFO_HEADER_FOUND}" = "x0" ; then @@ -26041,11 +28045,12 @@ ast_ext_lib_check_save_CFLAGS="${CFLAGS}" CFLAGS="${CFLAGS} $PJPROJECT_CFLAGS" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pj_ssl_cert_load_from_files2 in -lpj" >&5 -$as_echo_n "checking for pj_ssl_cert_load_from_files2 in -lpj... " >&6; } -if ${ac_cv_lib_pj_pj_ssl_cert_load_from_files2+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for pj_ssl_cert_load_from_files2 in -lpj" >&5 +printf %s "checking for pj_ssl_cert_load_from_files2 in -lpj... " >&6; } +if test ${ac_cv_lib_pj_pj_ssl_cert_load_from_files2+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lpj ${pbxlibdir} $PJPROJECT_LIB $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -26054,32 +28059,31 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char pj_ssl_cert_load_from_files2 (); int -main () +main (void) { return pj_ssl_cert_load_from_files2 (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_pj_pj_ssl_cert_load_from_files2=yes -else +else $as_nop ac_cv_lib_pj_pj_ssl_cert_load_from_files2=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pj_pj_ssl_cert_load_from_files2" >&5 -$as_echo "$ac_cv_lib_pj_pj_ssl_cert_load_from_files2" >&6; } -if test "x$ac_cv_lib_pj_pj_ssl_cert_load_from_files2" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pj_pj_ssl_cert_load_from_files2" >&5 +printf "%s\n" "$ac_cv_lib_pj_pj_ssl_cert_load_from_files2" >&6; } +if test "x$ac_cv_lib_pj_pj_ssl_cert_load_from_files2" = xyes +then : AST_PJ_SSL_CERT_LOAD_FROM_FILES2_FOUND=yes -else +else $as_nop AST_PJ_SSL_CERT_LOAD_FROM_FILES2_FOUND=no fi @@ -26098,14 +28102,14 @@ # check for the header ast_ext_lib_check_saved_CPPFLAGS="${CPPFLAGS}" CPPFLAGS="${CPPFLAGS} ${PJ_SSL_CERT_LOAD_FROM_FILES2_INCLUDE}" - ac_fn_c_check_header_mongrel "$LINENO" "pjlib.h" "ac_cv_header_pjlib_h" "$ac_includes_default" -if test "x$ac_cv_header_pjlib_h" = xyes; then : + ac_fn_c_check_header_compile "$LINENO" "pjlib.h" "ac_cv_header_pjlib_h" "$ac_includes_default" +if test "x$ac_cv_header_pjlib_h" = xyes +then : PJ_SSL_CERT_LOAD_FROM_FILES2_HEADER_FOUND=1 -else +else $as_nop PJ_SSL_CERT_LOAD_FROM_FILES2_HEADER_FOUND=0 fi - CPPFLAGS="${ast_ext_lib_check_saved_CPPFLAGS}" if test "x${PJ_SSL_CERT_LOAD_FROM_FILES2_HEADER_FOUND}" = "x0" ; then @@ -26137,11 +28141,12 @@ ast_ext_lib_check_save_CFLAGS="${CFLAGS}" CFLAGS="${CFLAGS} $PJPROJECT_CFLAGS" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pjsip_endpt_set_ext_resolver in -lpjsip" >&5 -$as_echo_n "checking for pjsip_endpt_set_ext_resolver in -lpjsip... " >&6; } -if ${ac_cv_lib_pjsip_pjsip_endpt_set_ext_resolver+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for pjsip_endpt_set_ext_resolver in -lpjsip" >&5 +printf %s "checking for pjsip_endpt_set_ext_resolver in -lpjsip... " >&6; } +if test ${ac_cv_lib_pjsip_pjsip_endpt_set_ext_resolver+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lpjsip ${pbxlibdir} $PJPROJECT_LIB $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -26150,32 +28155,31 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char pjsip_endpt_set_ext_resolver (); int -main () +main (void) { return pjsip_endpt_set_ext_resolver (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_pjsip_pjsip_endpt_set_ext_resolver=yes -else +else $as_nop ac_cv_lib_pjsip_pjsip_endpt_set_ext_resolver=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pjsip_pjsip_endpt_set_ext_resolver" >&5 -$as_echo "$ac_cv_lib_pjsip_pjsip_endpt_set_ext_resolver" >&6; } -if test "x$ac_cv_lib_pjsip_pjsip_endpt_set_ext_resolver" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pjsip_pjsip_endpt_set_ext_resolver" >&5 +printf "%s\n" "$ac_cv_lib_pjsip_pjsip_endpt_set_ext_resolver" >&6; } +if test "x$ac_cv_lib_pjsip_pjsip_endpt_set_ext_resolver" = xyes +then : AST_PJSIP_EXTERNAL_RESOLVER_FOUND=yes -else +else $as_nop AST_PJSIP_EXTERNAL_RESOLVER_FOUND=no fi @@ -26194,14 +28198,14 @@ # check for the header ast_ext_lib_check_saved_CPPFLAGS="${CPPFLAGS}" CPPFLAGS="${CPPFLAGS} ${PJSIP_EXTERNAL_RESOLVER_INCLUDE}" - ac_fn_c_check_header_mongrel "$LINENO" "pjsip.h" "ac_cv_header_pjsip_h" "$ac_includes_default" -if test "x$ac_cv_header_pjsip_h" = xyes; then : + ac_fn_c_check_header_compile "$LINENO" "pjsip.h" "ac_cv_header_pjsip_h" "$ac_includes_default" +if test "x$ac_cv_header_pjsip_h" = xyes +then : PJSIP_EXTERNAL_RESOLVER_HEADER_FOUND=1 -else +else $as_nop PJSIP_EXTERNAL_RESOLVER_HEADER_FOUND=0 fi - CPPFLAGS="${ast_ext_lib_check_saved_CPPFLAGS}" if test "x${PJSIP_EXTERNAL_RESOLVER_HEADER_FOUND}" = "x0" ; then @@ -26226,8 +28230,8 @@ LIBS="${LIBS} ${PJPROJECT_LIB}" if test "x${PBX_PJSIP_TLS_TRANSPORT_PROTO}" != "x1" -a "${USE_PJSIP_TLS_TRANSPORT_PROTO}" != "no"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if \"struct pjsip_tls_setting setting; int proto; proto = setting.proto;\" compiles using pjsip.h" >&5 -$as_echo_n "checking if \"struct pjsip_tls_setting setting; int proto; proto = setting.proto;\" compiles using pjsip.h... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if \"struct pjsip_tls_setting setting; int proto; proto = setting.proto;\" compiles using pjsip.h" >&5 +printf %s "checking if \"struct pjsip_tls_setting setting; int proto; proto = setting.proto;\" compiles using pjsip.h... " >&6; } saved_cppflags="${CPPFLAGS}" if test "x${PJSIP_TLS_TRANSPORT_PROTO_DIR}" != "x"; then PJSIP_TLS_TRANSPORT_PROTO_INCLUDE="-I${PJSIP_TLS_TRANSPORT_PROTO_DIR}/include" @@ -26238,7 +28242,7 @@ /* end confdefs.h. */ #include int -main () +main (void) { struct pjsip_tls_setting setting; int proto; proto = setting.proto;; @@ -26246,28 +28250,29 @@ return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } +if ac_fn_c_try_compile "$LINENO" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } PBX_PJSIP_TLS_TRANSPORT_PROTO=1 -$as_echo "#define HAVE_PJSIP_TLS_TRANSPORT_PROTO 1" >>confdefs.h +printf "%s\n" "#define HAVE_PJSIP_TLS_TRANSPORT_PROTO 1" >>confdefs.h -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext CPPFLAGS="${saved_cppflags}" fi if test "x${PBX_PJSIP_INV_ACCEPT_MULTIPLE_SDP_ANSWERS}" != "x1" -a "${USE_PJSIP_INV_ACCEPT_MULTIPLE_SDP_ANSWERS}" != "no"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if \"pjsip_cfg()->endpt.accept_multiple_sdp_answers = 0;\" compiles using pjsip.h" >&5 -$as_echo_n "checking if \"pjsip_cfg()->endpt.accept_multiple_sdp_answers = 0;\" compiles using pjsip.h... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if \"pjsip_cfg()->endpt.accept_multiple_sdp_answers = 0;\" compiles using pjsip.h" >&5 +printf %s "checking if \"pjsip_cfg()->endpt.accept_multiple_sdp_answers = 0;\" compiles using pjsip.h... " >&6; } saved_cppflags="${CPPFLAGS}" if test "x${PJSIP_INV_ACCEPT_MULTIPLE_SDP_ANSWERS_DIR}" != "x"; then PJSIP_INV_ACCEPT_MULTIPLE_SDP_ANSWERS_INCLUDE="-I${PJSIP_INV_ACCEPT_MULTIPLE_SDP_ANSWERS_DIR}/include" @@ -26278,7 +28283,7 @@ /* end confdefs.h. */ #include int -main () +main (void) { pjsip_cfg()->endpt.accept_multiple_sdp_answers = 0;; @@ -26286,28 +28291,29 @@ return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } +if ac_fn_c_try_compile "$LINENO" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } PBX_PJSIP_INV_ACCEPT_MULTIPLE_SDP_ANSWERS=1 -$as_echo "#define HAVE_PJSIP_INV_ACCEPT_MULTIPLE_SDP_ANSWERS 1" >>confdefs.h +printf "%s\n" "#define HAVE_PJSIP_INV_ACCEPT_MULTIPLE_SDP_ANSWERS 1" >>confdefs.h -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext CPPFLAGS="${saved_cppflags}" fi if test "x${PBX_PJSIP_ENDPOINT_COMPACT_FORM}" != "x1" -a "${USE_PJSIP_ENDPOINT_COMPACT_FORM}" != "no"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if \"pjsip_cfg()->endpt.use_compact_form = PJ_TRUE;\" compiles using pjsip.h" >&5 -$as_echo_n "checking if \"pjsip_cfg()->endpt.use_compact_form = PJ_TRUE;\" compiles using pjsip.h... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if \"pjsip_cfg()->endpt.use_compact_form = PJ_TRUE;\" compiles using pjsip.h" >&5 +printf %s "checking if \"pjsip_cfg()->endpt.use_compact_form = PJ_TRUE;\" compiles using pjsip.h... " >&6; } saved_cppflags="${CPPFLAGS}" if test "x${PJSIP_ENDPOINT_COMPACT_FORM_DIR}" != "x"; then PJSIP_ENDPOINT_COMPACT_FORM_INCLUDE="-I${PJSIP_ENDPOINT_COMPACT_FORM_DIR}/include" @@ -26318,7 +28324,7 @@ /* end confdefs.h. */ #include int -main () +main (void) { pjsip_cfg()->endpt.use_compact_form = PJ_TRUE;; @@ -26326,28 +28332,29 @@ return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } +if ac_fn_c_try_compile "$LINENO" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } PBX_PJSIP_ENDPOINT_COMPACT_FORM=1 -$as_echo "#define HAVE_PJSIP_ENDPOINT_COMPACT_FORM 1" >>confdefs.h +printf "%s\n" "#define HAVE_PJSIP_ENDPOINT_COMPACT_FORM 1" >>confdefs.h -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext CPPFLAGS="${saved_cppflags}" fi if test "x${PBX_PJSIP_TRANSPORT_DISABLE_CONNECTION_REUSE}" != "x1" -a "${USE_PJSIP_TRANSPORT_DISABLE_CONNECTION_REUSE}" != "no"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if \"struct pjsip_tpselector sel; sel.disable_connection_reuse = PJ_TRUE;\" compiles using pjsip.h" >&5 -$as_echo_n "checking if \"struct pjsip_tpselector sel; sel.disable_connection_reuse = PJ_TRUE;\" compiles using pjsip.h... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if \"struct pjsip_tpselector sel; sel.disable_connection_reuse = PJ_TRUE;\" compiles using pjsip.h" >&5 +printf %s "checking if \"struct pjsip_tpselector sel; sel.disable_connection_reuse = PJ_TRUE;\" compiles using pjsip.h... " >&6; } saved_cppflags="${CPPFLAGS}" if test "x${PJSIP_TRANSPORT_DISABLE_CONNECTION_REUSE_DIR}" != "x"; then PJSIP_TRANSPORT_DISABLE_CONNECTION_REUSE_INCLUDE="-I${PJSIP_TRANSPORT_DISABLE_CONNECTION_REUSE_DIR}/include" @@ -26358,7 +28365,7 @@ /* end confdefs.h. */ #include int -main () +main (void) { struct pjsip_tpselector sel; sel.disable_connection_reuse = PJ_TRUE;; @@ -26366,28 +28373,29 @@ return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } +if ac_fn_c_try_compile "$LINENO" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } PBX_PJSIP_TRANSPORT_DISABLE_CONNECTION_REUSE=1 -$as_echo "#define HAVE_PJSIP_TRANSPORT_DISABLE_CONNECTION_REUSE 1" >>confdefs.h +printf "%s\n" "#define HAVE_PJSIP_TRANSPORT_DISABLE_CONNECTION_REUSE 1" >>confdefs.h -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext CPPFLAGS="${saved_cppflags}" fi if test "x${PBX_PJSIP_OAUTH_AUTHENTICATION}" != "x1" -a "${USE_PJSIP_OAUTH_AUTHENTICATION}" != "no"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if \"struct pjsip_oauth_credential credential;\" compiles using pjsip.h" >&5 -$as_echo_n "checking if \"struct pjsip_oauth_credential credential;\" compiles using pjsip.h... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if \"struct pjsip_oauth_credential credential;\" compiles using pjsip.h" >&5 +printf %s "checking if \"struct pjsip_oauth_credential credential;\" compiles using pjsip.h... " >&6; } saved_cppflags="${CPPFLAGS}" if test "x${PJSIP_OAUTH_AUTHENTICATION_DIR}" != "x"; then PJSIP_OAUTH_AUTHENTICATION_INCLUDE="-I${PJSIP_OAUTH_AUTHENTICATION_DIR}/include" @@ -26398,7 +28406,7 @@ /* end confdefs.h. */ #include int -main () +main (void) { struct pjsip_oauth_credential credential;; @@ -26406,26 +28414,27 @@ return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } +if ac_fn_c_try_compile "$LINENO" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } PBX_PJSIP_OAUTH_AUTHENTICATION=1 -$as_echo "#define HAVE_PJSIP_OAUTH_AUTHENTICATION 1" >>confdefs.h +printf "%s\n" "#define HAVE_PJSIP_OAUTH_AUTHENTICATION 1" >>confdefs.h -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext CPPFLAGS="${saved_cppflags}" fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pjproject on_valid_pair callback" >&5 -$as_echo_n "checking for pjproject on_valid_pair callback... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for pjproject on_valid_pair callback" >&5 +printf %s "checking for pjproject on_valid_pair callback... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include @@ -26436,7 +28445,7 @@ void on_rx_data(pj_ice_sess *ice, unsigned comp_id, unsigned transport_id, void *pkt, pj_size_t size, const pj_sockaddr_t *src_addr, unsigned src_addr_len) {} pj_status_t on_tx_pkt(pj_ice_sess *ice, unsigned comp_id, unsigned transport_id, const void *pkt, pj_size_t size, const pj_sockaddr_t *dst_addr, unsigned dst_addr_len) {} int -main () +main (void) { pj_ice_sess_cb ice_sess_cb = { .on_valid_pair = on_valid_pair, @@ -26448,18 +28457,19 @@ return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } +if ac_fn_c_try_link "$LINENO" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } -$as_echo "#define HAVE_PJPROJECT_ON_VALID_ICE_PAIR_CALLBACK 1" >>confdefs.h +printf "%s\n" "#define HAVE_PJPROJECT_ON_VALID_ICE_PAIR_CALLBACK 1" >>confdefs.h -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS="${saved_libs}" CPPFLAGS="${saved_cppflags}" @@ -26478,11 +28488,12 @@ ast_ext_lib_check_save_CFLAGS="${CFLAGS}" CFLAGS="${CFLAGS} $PJPROJECT_CFLAGS" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pjsip_evsub_add_ref in -lpjsip" >&5 -$as_echo_n "checking for pjsip_evsub_add_ref in -lpjsip... " >&6; } -if ${ac_cv_lib_pjsip_pjsip_evsub_add_ref+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for pjsip_evsub_add_ref in -lpjsip" >&5 +printf %s "checking for pjsip_evsub_add_ref in -lpjsip... " >&6; } +if test ${ac_cv_lib_pjsip_pjsip_evsub_add_ref+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lpjsip ${pbxlibdir} $PJPROJECT_LIB $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -26491,32 +28502,31 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char pjsip_evsub_add_ref (); int -main () +main (void) { return pjsip_evsub_add_ref (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_pjsip_pjsip_evsub_add_ref=yes -else +else $as_nop ac_cv_lib_pjsip_pjsip_evsub_add_ref=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pjsip_pjsip_evsub_add_ref" >&5 -$as_echo "$ac_cv_lib_pjsip_pjsip_evsub_add_ref" >&6; } -if test "x$ac_cv_lib_pjsip_pjsip_evsub_add_ref" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pjsip_pjsip_evsub_add_ref" >&5 +printf "%s\n" "$ac_cv_lib_pjsip_pjsip_evsub_add_ref" >&6; } +if test "x$ac_cv_lib_pjsip_pjsip_evsub_add_ref" = xyes +then : AST_PJSIP_EVSUB_GRP_LOCK_FOUND=yes -else +else $as_nop AST_PJSIP_EVSUB_GRP_LOCK_FOUND=no fi @@ -26535,14 +28545,14 @@ # check for the header ast_ext_lib_check_saved_CPPFLAGS="${CPPFLAGS}" CPPFLAGS="${CPPFLAGS} ${PJSIP_EVSUB_GRP_LOCK_INCLUDE}" - ac_fn_c_check_header_mongrel "$LINENO" "pjsip.h" "ac_cv_header_pjsip_h" "$ac_includes_default" -if test "x$ac_cv_header_pjsip_h" = xyes; then : + ac_fn_c_check_header_compile "$LINENO" "pjsip.h" "ac_cv_header_pjsip_h" "$ac_includes_default" +if test "x$ac_cv_header_pjsip_h" = xyes +then : PJSIP_EVSUB_GRP_LOCK_HEADER_FOUND=1 -else +else $as_nop PJSIP_EVSUB_GRP_LOCK_HEADER_FOUND=0 fi - CPPFLAGS="${ast_ext_lib_check_saved_CPPFLAGS}" if test "x${PJSIP_EVSUB_GRP_LOCK_HEADER_FOUND}" = "x0" ; then @@ -26574,11 +28584,12 @@ ast_ext_lib_check_save_CFLAGS="${CFLAGS}" CFLAGS="${CFLAGS} $PJPROJECT_CFLAGS" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pjsip_inv_add_ref in -lpjsip" >&5 -$as_echo_n "checking for pjsip_inv_add_ref in -lpjsip... " >&6; } -if ${ac_cv_lib_pjsip_pjsip_inv_add_ref+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for pjsip_inv_add_ref in -lpjsip" >&5 +printf %s "checking for pjsip_inv_add_ref in -lpjsip... " >&6; } +if test ${ac_cv_lib_pjsip_pjsip_inv_add_ref+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lpjsip ${pbxlibdir} $PJPROJECT_LIB $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -26587,32 +28598,31 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char pjsip_inv_add_ref (); int -main () +main (void) { return pjsip_inv_add_ref (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_pjsip_pjsip_inv_add_ref=yes -else +else $as_nop ac_cv_lib_pjsip_pjsip_inv_add_ref=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pjsip_pjsip_inv_add_ref" >&5 -$as_echo "$ac_cv_lib_pjsip_pjsip_inv_add_ref" >&6; } -if test "x$ac_cv_lib_pjsip_pjsip_inv_add_ref" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pjsip_pjsip_inv_add_ref" >&5 +printf "%s\n" "$ac_cv_lib_pjsip_pjsip_inv_add_ref" >&6; } +if test "x$ac_cv_lib_pjsip_pjsip_inv_add_ref" = xyes +then : AST_PJSIP_INV_SESSION_REF_FOUND=yes -else +else $as_nop AST_PJSIP_INV_SESSION_REF_FOUND=no fi @@ -26631,14 +28641,14 @@ # check for the header ast_ext_lib_check_saved_CPPFLAGS="${CPPFLAGS}" CPPFLAGS="${CPPFLAGS} ${PJSIP_INV_SESSION_REF_INCLUDE}" - ac_fn_c_check_header_mongrel "$LINENO" "pjsip.h" "ac_cv_header_pjsip_h" "$ac_includes_default" -if test "x$ac_cv_header_pjsip_h" = xyes; then : + ac_fn_c_check_header_compile "$LINENO" "pjsip.h" "ac_cv_header_pjsip_h" "$ac_includes_default" +if test "x$ac_cv_header_pjsip_h" = xyes +then : PJSIP_INV_SESSION_REF_HEADER_FOUND=1 -else +else $as_nop PJSIP_INV_SESSION_REF_HEADER_FOUND=0 fi - CPPFLAGS="${ast_ext_lib_check_saved_CPPFLAGS}" if test "x${PJSIP_INV_SESSION_REF_HEADER_FOUND}" = "x0" ; then @@ -26670,11 +28680,12 @@ ast_ext_lib_check_save_CFLAGS="${CFLAGS}" CFLAGS="${CFLAGS} $PJPROJECT_CFLAGS" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pjsip_auth_clt_deinit in -lpjsip" >&5 -$as_echo_n "checking for pjsip_auth_clt_deinit in -lpjsip... " >&6; } -if ${ac_cv_lib_pjsip_pjsip_auth_clt_deinit+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for pjsip_auth_clt_deinit in -lpjsip" >&5 +printf %s "checking for pjsip_auth_clt_deinit in -lpjsip... " >&6; } +if test ${ac_cv_lib_pjsip_pjsip_auth_clt_deinit+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lpjsip ${pbxlibdir} $PJPROJECT_LIB $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -26683,32 +28694,31 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char pjsip_auth_clt_deinit (); int -main () +main (void) { return pjsip_auth_clt_deinit (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_pjsip_pjsip_auth_clt_deinit=yes -else +else $as_nop ac_cv_lib_pjsip_pjsip_auth_clt_deinit=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pjsip_pjsip_auth_clt_deinit" >&5 -$as_echo "$ac_cv_lib_pjsip_pjsip_auth_clt_deinit" >&6; } -if test "x$ac_cv_lib_pjsip_pjsip_auth_clt_deinit" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pjsip_pjsip_auth_clt_deinit" >&5 +printf "%s\n" "$ac_cv_lib_pjsip_pjsip_auth_clt_deinit" >&6; } +if test "x$ac_cv_lib_pjsip_pjsip_auth_clt_deinit" = xyes +then : AST_PJSIP_AUTH_CLT_DEINIT_FOUND=yes -else +else $as_nop AST_PJSIP_AUTH_CLT_DEINIT_FOUND=no fi @@ -26727,14 +28737,14 @@ # check for the header ast_ext_lib_check_saved_CPPFLAGS="${CPPFLAGS}" CPPFLAGS="${CPPFLAGS} ${PJSIP_AUTH_CLT_DEINIT_INCLUDE}" - ac_fn_c_check_header_mongrel "$LINENO" "pjsip.h" "ac_cv_header_pjsip_h" "$ac_includes_default" -if test "x$ac_cv_header_pjsip_h" = xyes; then : + ac_fn_c_check_header_compile "$LINENO" "pjsip.h" "ac_cv_header_pjsip_h" "$ac_includes_default" +if test "x$ac_cv_header_pjsip_h" = xyes +then : PJSIP_AUTH_CLT_DEINIT_HEADER_FOUND=1 -else +else $as_nop PJSIP_AUTH_CLT_DEINIT_HEADER_FOUND=0 fi - CPPFLAGS="${ast_ext_lib_check_saved_CPPFLAGS}" if test "x${PJSIP_AUTH_CLT_DEINIT_HEADER_FOUND}" = "x0" ; then @@ -26766,11 +28776,12 @@ ast_ext_lib_check_save_CFLAGS="${CFLAGS}" CFLAGS="${CFLAGS} $PJPROJECT_CFLAGS" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pjsip_tsx_layer_find_tsx2 in -lpjsip" >&5 -$as_echo_n "checking for pjsip_tsx_layer_find_tsx2 in -lpjsip... " >&6; } -if ${ac_cv_lib_pjsip_pjsip_tsx_layer_find_tsx2+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for pjsip_tsx_layer_find_tsx2 in -lpjsip" >&5 +printf %s "checking for pjsip_tsx_layer_find_tsx2 in -lpjsip... " >&6; } +if test ${ac_cv_lib_pjsip_pjsip_tsx_layer_find_tsx2+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lpjsip ${pbxlibdir} $PJPROJECT_LIB $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -26779,32 +28790,31 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char pjsip_tsx_layer_find_tsx2 (); int -main () +main (void) { return pjsip_tsx_layer_find_tsx2 (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_pjsip_pjsip_tsx_layer_find_tsx2=yes -else +else $as_nop ac_cv_lib_pjsip_pjsip_tsx_layer_find_tsx2=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pjsip_pjsip_tsx_layer_find_tsx2" >&5 -$as_echo "$ac_cv_lib_pjsip_pjsip_tsx_layer_find_tsx2" >&6; } -if test "x$ac_cv_lib_pjsip_pjsip_tsx_layer_find_tsx2" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pjsip_pjsip_tsx_layer_find_tsx2" >&5 +printf "%s\n" "$ac_cv_lib_pjsip_pjsip_tsx_layer_find_tsx2" >&6; } +if test "x$ac_cv_lib_pjsip_pjsip_tsx_layer_find_tsx2" = xyes +then : AST_PJSIP_TSX_LAYER_FIND_TSX2_FOUND=yes -else +else $as_nop AST_PJSIP_TSX_LAYER_FIND_TSX2_FOUND=no fi @@ -26823,14 +28833,14 @@ # check for the header ast_ext_lib_check_saved_CPPFLAGS="${CPPFLAGS}" CPPFLAGS="${CPPFLAGS} ${PJSIP_TSX_LAYER_FIND_TSX2_INCLUDE}" - ac_fn_c_check_header_mongrel "$LINENO" "pjsip.h" "ac_cv_header_pjsip_h" "$ac_includes_default" -if test "x$ac_cv_header_pjsip_h" = xyes; then : + ac_fn_c_check_header_compile "$LINENO" "pjsip.h" "ac_cv_header_pjsip_h" "$ac_includes_default" +if test "x$ac_cv_header_pjsip_h" = xyes +then : PJSIP_TSX_LAYER_FIND_TSX2_HEADER_FOUND=1 -else +else $as_nop PJSIP_TSX_LAYER_FIND_TSX2_HEADER_FOUND=0 fi - CPPFLAGS="${ast_ext_lib_check_saved_CPPFLAGS}" if test "x${PJSIP_TSX_LAYER_FIND_TSX2_HEADER_FOUND}" = "x0" ; then @@ -26859,17 +28869,17 @@ if test "x${PBX_PYTHONDEV}" != "x1" -a "${USE_PYTHONDEV}" != "no"; then pkg_failed=no -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for PYTHONDEV" >&5 -$as_echo_n "checking for PYTHONDEV... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for python-2.7" >&5 +printf %s "checking for python-2.7... " >&6; } if test -n "$PYTHONDEV_CFLAGS"; then pkg_cv_PYTHONDEV_CFLAGS="$PYTHONDEV_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"python-2.7\""; } >&5 + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"python-2.7\""; } >&5 ($PKG_CONFIG --exists --print-errors "python-2.7") 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_PYTHONDEV_CFLAGS=`$PKG_CONFIG --cflags "python-2.7" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes @@ -26883,10 +28893,10 @@ pkg_cv_PYTHONDEV_LIBS="$PYTHONDEV_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"python-2.7\""; } >&5 + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"python-2.7\""; } >&5 ($PKG_CONFIG --exists --print-errors "python-2.7") 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_PYTHONDEV_LIBS=`$PKG_CONFIG --libs "python-2.7" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes @@ -26900,8 +28910,8 @@ if test $pkg_failed = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes @@ -26921,8 +28931,8 @@ elif test $pkg_failed = untried; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } PBX_PYTHONDEV=0 @@ -26930,14 +28940,14 @@ else PYTHONDEV_CFLAGS=$pkg_cv_PYTHONDEV_CFLAGS PYTHONDEV_LIBS=$pkg_cv_PYTHONDEV_LIBS - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } PBX_PYTHONDEV=1 PYTHONDEV_INCLUDE=$(echo ${PYTHONDEV_CFLAGS} | $SED -e "s|-std=c99||g") PYTHONDEV_LIB="$PYTHONDEV_LIBS" -$as_echo "#define HAVE_PYTHONDEV 1" >>confdefs.h +printf "%s\n" "#define HAVE_PYTHONDEV 1" >>confdefs.h fi @@ -26947,17 +28957,17 @@ if test "x${PBX_PYTHONDEV}" != "x1" -a "${USE_PYTHONDEV}" != "no"; then pkg_failed=no -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for PYTHONDEV" >&5 -$as_echo_n "checking for PYTHONDEV... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for python2" >&5 +printf %s "checking for python2... " >&6; } if test -n "$PYTHONDEV_CFLAGS"; then pkg_cv_PYTHONDEV_CFLAGS="$PYTHONDEV_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"python2\""; } >&5 + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"python2\""; } >&5 ($PKG_CONFIG --exists --print-errors "python2") 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_PYTHONDEV_CFLAGS=`$PKG_CONFIG --cflags "python2" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes @@ -26971,10 +28981,10 @@ pkg_cv_PYTHONDEV_LIBS="$PYTHONDEV_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"python2\""; } >&5 + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"python2\""; } >&5 ($PKG_CONFIG --exists --print-errors "python2") 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_PYTHONDEV_LIBS=`$PKG_CONFIG --libs "python2" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes @@ -26988,8 +28998,8 @@ if test $pkg_failed = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes @@ -27009,8 +29019,8 @@ elif test $pkg_failed = untried; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } PBX_PYTHONDEV=0 @@ -27018,14 +29028,14 @@ else PYTHONDEV_CFLAGS=$pkg_cv_PYTHONDEV_CFLAGS PYTHONDEV_LIBS=$pkg_cv_PYTHONDEV_LIBS - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } PBX_PYTHONDEV=1 PYTHONDEV_INCLUDE=$(echo ${PYTHONDEV_CFLAGS} | $SED -e "s|-std=c99||g") PYTHONDEV_LIB="$PYTHONDEV_LIBS" -$as_echo "#define HAVE_PYTHONDEV 1" >>confdefs.h +printf "%s\n" "#define HAVE_PYTHONDEV 1" >>confdefs.h fi @@ -27035,17 +29045,17 @@ if test "x${PBX_PYTHONDEV}" != "x1" -a "${USE_PYTHONDEV}" != "no"; then pkg_failed=no -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for PYTHONDEV" >&5 -$as_echo_n "checking for PYTHONDEV... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for python" >&5 +printf %s "checking for python... " >&6; } if test -n "$PYTHONDEV_CFLAGS"; then pkg_cv_PYTHONDEV_CFLAGS="$PYTHONDEV_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"python\""; } >&5 + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"python\""; } >&5 ($PKG_CONFIG --exists --print-errors "python") 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_PYTHONDEV_CFLAGS=`$PKG_CONFIG --cflags "python" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes @@ -27059,10 +29069,10 @@ pkg_cv_PYTHONDEV_LIBS="$PYTHONDEV_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"python\""; } >&5 + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"python\""; } >&5 ($PKG_CONFIG --exists --print-errors "python") 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_PYTHONDEV_LIBS=`$PKG_CONFIG --libs "python" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes @@ -27076,8 +29086,8 @@ if test $pkg_failed = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes @@ -27097,8 +29107,8 @@ elif test $pkg_failed = untried; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } PBX_PYTHONDEV=0 @@ -27106,14 +29116,14 @@ else PYTHONDEV_CFLAGS=$pkg_cv_PYTHONDEV_CFLAGS PYTHONDEV_LIBS=$pkg_cv_PYTHONDEV_LIBS - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } PBX_PYTHONDEV=1 PYTHONDEV_INCLUDE=$(echo ${PYTHONDEV_CFLAGS} | $SED -e "s|-std=c99||g") PYTHONDEV_LIB="$PYTHONDEV_LIBS" -$as_echo "#define HAVE_PYTHONDEV 1" >>confdefs.h +printf "%s\n" "#define HAVE_PYTHONDEV 1" >>confdefs.h fi @@ -27144,11 +29154,12 @@ ast_ext_lib_check_save_CFLAGS="${CFLAGS}" CFLAGS="${CFLAGS} " - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for poptStrerror in -lpopt" >&5 -$as_echo_n "checking for poptStrerror in -lpopt... " >&6; } -if ${ac_cv_lib_popt_poptStrerror+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for poptStrerror in -lpopt" >&5 +printf %s "checking for poptStrerror in -lpopt... " >&6; } +if test ${ac_cv_lib_popt_poptStrerror+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lpopt ${pbxlibdir} $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -27157,32 +29168,31 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char poptStrerror (); int -main () +main (void) { return poptStrerror (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_popt_poptStrerror=yes -else +else $as_nop ac_cv_lib_popt_poptStrerror=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_popt_poptStrerror" >&5 -$as_echo "$ac_cv_lib_popt_poptStrerror" >&6; } -if test "x$ac_cv_lib_popt_poptStrerror" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_popt_poptStrerror" >&5 +printf "%s\n" "$ac_cv_lib_popt_poptStrerror" >&6; } +if test "x$ac_cv_lib_popt_poptStrerror" = xyes +then : AST_POPT_FOUND=yes -else +else $as_nop AST_POPT_FOUND=no fi @@ -27201,14 +29211,14 @@ # check for the header ast_ext_lib_check_saved_CPPFLAGS="${CPPFLAGS}" CPPFLAGS="${CPPFLAGS} ${POPT_INCLUDE}" - ac_fn_c_check_header_mongrel "$LINENO" "popt.h" "ac_cv_header_popt_h" "$ac_includes_default" -if test "x$ac_cv_header_popt_h" = xyes; then : + ac_fn_c_check_header_compile "$LINENO" "popt.h" "ac_cv_header_popt_h" "$ac_includes_default" +if test "x$ac_cv_header_popt_h" = xyes +then : POPT_HEADER_FOUND=1 -else +else $as_nop POPT_HEADER_FOUND=0 fi - CPPFLAGS="${ast_ext_lib_check_saved_CPPFLAGS}" if test "x${POPT_HEADER_FOUND}" = "x0" ; then @@ -27231,17 +29241,17 @@ if test "x${PBX_PORTAUDIO}" != "x1" -a "${USE_PORTAUDIO}" != "no"; then pkg_failed=no -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for PORTAUDIO" >&5 -$as_echo_n "checking for PORTAUDIO... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for portaudio-2.0" >&5 +printf %s "checking for portaudio-2.0... " >&6; } if test -n "$PORTAUDIO_CFLAGS"; then pkg_cv_PORTAUDIO_CFLAGS="$PORTAUDIO_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"portaudio-2.0\""; } >&5 + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"portaudio-2.0\""; } >&5 ($PKG_CONFIG --exists --print-errors "portaudio-2.0") 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_PORTAUDIO_CFLAGS=`$PKG_CONFIG --cflags "portaudio-2.0" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes @@ -27255,10 +29265,10 @@ pkg_cv_PORTAUDIO_LIBS="$PORTAUDIO_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"portaudio-2.0\""; } >&5 + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"portaudio-2.0\""; } >&5 ($PKG_CONFIG --exists --print-errors "portaudio-2.0") 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_PORTAUDIO_LIBS=`$PKG_CONFIG --libs "portaudio-2.0" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes @@ -27272,8 +29282,8 @@ if test $pkg_failed = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes @@ -27293,8 +29303,8 @@ elif test $pkg_failed = untried; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } PBX_PORTAUDIO=0 @@ -27302,14 +29312,14 @@ else PORTAUDIO_CFLAGS=$pkg_cv_PORTAUDIO_CFLAGS PORTAUDIO_LIBS=$pkg_cv_PORTAUDIO_LIBS - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } PBX_PORTAUDIO=1 PORTAUDIO_INCLUDE=$(echo ${PORTAUDIO_CFLAGS} | $SED -e "s|-std=c99||g") PORTAUDIO_LIB="$PORTAUDIO_LIBS" -$as_echo "#define HAVE_PORTAUDIO 1" >>confdefs.h +printf "%s\n" "#define HAVE_PORTAUDIO 1" >>confdefs.h fi @@ -27329,11 +29339,12 @@ ast_ext_lib_check_save_CFLAGS="${CFLAGS}" CFLAGS="${CFLAGS} " - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Pa_GetDeviceCount in -lportaudio" >&5 -$as_echo_n "checking for Pa_GetDeviceCount in -lportaudio... " >&6; } -if ${ac_cv_lib_portaudio_Pa_GetDeviceCount+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for Pa_GetDeviceCount in -lportaudio" >&5 +printf %s "checking for Pa_GetDeviceCount in -lportaudio... " >&6; } +if test ${ac_cv_lib_portaudio_Pa_GetDeviceCount+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lportaudio ${pbxlibdir} $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -27342,32 +29353,31 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char Pa_GetDeviceCount (); int -main () +main (void) { return Pa_GetDeviceCount (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_portaudio_Pa_GetDeviceCount=yes -else +else $as_nop ac_cv_lib_portaudio_Pa_GetDeviceCount=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_portaudio_Pa_GetDeviceCount" >&5 -$as_echo "$ac_cv_lib_portaudio_Pa_GetDeviceCount" >&6; } -if test "x$ac_cv_lib_portaudio_Pa_GetDeviceCount" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_portaudio_Pa_GetDeviceCount" >&5 +printf "%s\n" "$ac_cv_lib_portaudio_Pa_GetDeviceCount" >&6; } +if test "x$ac_cv_lib_portaudio_Pa_GetDeviceCount" = xyes +then : AST_PORTAUDIO_FOUND=yes -else +else $as_nop AST_PORTAUDIO_FOUND=no fi @@ -27386,14 +29396,14 @@ # check for the header ast_ext_lib_check_saved_CPPFLAGS="${CPPFLAGS}" CPPFLAGS="${CPPFLAGS} ${PORTAUDIO_INCLUDE}" - ac_fn_c_check_header_mongrel "$LINENO" "portaudio.h" "ac_cv_header_portaudio_h" "$ac_includes_default" -if test "x$ac_cv_header_portaudio_h" = xyes; then : + ac_fn_c_check_header_compile "$LINENO" "portaudio.h" "ac_cv_header_portaudio_h" "$ac_includes_default" +if test "x$ac_cv_header_portaudio_h" = xyes +then : PORTAUDIO_HEADER_FOUND=1 -else +else $as_nop PORTAUDIO_HEADER_FOUND=0 fi - CPPFLAGS="${ast_ext_lib_check_saved_CPPFLAGS}" if test "x${PORTAUDIO_HEADER_FOUND}" = "x0" ; then @@ -27426,11 +29436,12 @@ ast_ext_lib_check_save_CFLAGS="${CFLAGS}" CFLAGS="${CFLAGS} " - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pri_connected_line_update in -lpri" >&5 -$as_echo_n "checking for pri_connected_line_update in -lpri... " >&6; } -if ${ac_cv_lib_pri_pri_connected_line_update+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for pri_connected_line_update in -lpri" >&5 +printf %s "checking for pri_connected_line_update in -lpri... " >&6; } +if test ${ac_cv_lib_pri_pri_connected_line_update+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lpri ${pbxlibdir} $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -27439,32 +29450,31 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char pri_connected_line_update (); int -main () +main (void) { return pri_connected_line_update (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_pri_pri_connected_line_update=yes -else +else $as_nop ac_cv_lib_pri_pri_connected_line_update=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pri_pri_connected_line_update" >&5 -$as_echo "$ac_cv_lib_pri_pri_connected_line_update" >&6; } -if test "x$ac_cv_lib_pri_pri_connected_line_update" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pri_pri_connected_line_update" >&5 +printf "%s\n" "$ac_cv_lib_pri_pri_connected_line_update" >&6; } +if test "x$ac_cv_lib_pri_pri_connected_line_update" = xyes +then : AST_PRI_FOUND=yes -else +else $as_nop AST_PRI_FOUND=no fi @@ -27483,14 +29493,14 @@ # check for the header ast_ext_lib_check_saved_CPPFLAGS="${CPPFLAGS}" CPPFLAGS="${CPPFLAGS} ${PRI_INCLUDE}" - ac_fn_c_check_header_mongrel "$LINENO" "libpri.h" "ac_cv_header_libpri_h" "$ac_includes_default" -if test "x$ac_cv_header_libpri_h" = xyes; then : + ac_fn_c_check_header_compile "$LINENO" "libpri.h" "ac_cv_header_libpri_h" "$ac_includes_default" +if test "x$ac_cv_header_libpri_h" = xyes +then : PRI_HEADER_FOUND=1 -else +else $as_nop PRI_HEADER_FOUND=0 fi - CPPFLAGS="${ast_ext_lib_check_saved_CPPFLAGS}" if test "x${PRI_HEADER_FOUND}" = "x0" ; then @@ -27523,11 +29533,12 @@ ast_ext_lib_check_save_CFLAGS="${CFLAGS}" CFLAGS="${CFLAGS} " - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pri_setup_ack in -lpri" >&5 -$as_echo_n "checking for pri_setup_ack in -lpri... " >&6; } -if ${ac_cv_lib_pri_pri_setup_ack+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for pri_setup_ack in -lpri" >&5 +printf %s "checking for pri_setup_ack in -lpri... " >&6; } +if test ${ac_cv_lib_pri_pri_setup_ack+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lpri ${pbxlibdir} $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -27536,32 +29547,31 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char pri_setup_ack (); int -main () +main (void) { return pri_setup_ack (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_pri_pri_setup_ack=yes -else +else $as_nop ac_cv_lib_pri_pri_setup_ack=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pri_pri_setup_ack" >&5 -$as_echo "$ac_cv_lib_pri_pri_setup_ack" >&6; } -if test "x$ac_cv_lib_pri_pri_setup_ack" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pri_pri_setup_ack" >&5 +printf "%s\n" "$ac_cv_lib_pri_pri_setup_ack" >&6; } +if test "x$ac_cv_lib_pri_pri_setup_ack" = xyes +then : AST_PRI_SETUP_ACK_INBAND_FOUND=yes -else +else $as_nop AST_PRI_SETUP_ACK_INBAND_FOUND=no fi @@ -27580,14 +29590,14 @@ # check for the header ast_ext_lib_check_saved_CPPFLAGS="${CPPFLAGS}" CPPFLAGS="${CPPFLAGS} ${PRI_SETUP_ACK_INBAND_INCLUDE}" - ac_fn_c_check_header_mongrel "$LINENO" "libpri.h" "ac_cv_header_libpri_h" "$ac_includes_default" -if test "x$ac_cv_header_libpri_h" = xyes; then : + ac_fn_c_check_header_compile "$LINENO" "libpri.h" "ac_cv_header_libpri_h" "$ac_includes_default" +if test "x$ac_cv_header_libpri_h" = xyes +then : PRI_SETUP_ACK_INBAND_HEADER_FOUND=1 -else +else $as_nop PRI_SETUP_ACK_INBAND_HEADER_FOUND=0 fi - CPPFLAGS="${ast_ext_lib_check_saved_CPPFLAGS}" if test "x${PRI_SETUP_ACK_INBAND_HEADER_FOUND}" = "x0" ; then @@ -27619,11 +29629,12 @@ ast_ext_lib_check_save_CFLAGS="${CFLAGS}" CFLAGS="${CFLAGS} " - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pri_persistent_layer2_option in -lpri" >&5 -$as_echo_n "checking for pri_persistent_layer2_option in -lpri... " >&6; } -if ${ac_cv_lib_pri_pri_persistent_layer2_option+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for pri_persistent_layer2_option in -lpri" >&5 +printf %s "checking for pri_persistent_layer2_option in -lpri... " >&6; } +if test ${ac_cv_lib_pri_pri_persistent_layer2_option+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lpri ${pbxlibdir} $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -27632,32 +29643,31 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char pri_persistent_layer2_option (); int -main () +main (void) { return pri_persistent_layer2_option (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_pri_pri_persistent_layer2_option=yes -else +else $as_nop ac_cv_lib_pri_pri_persistent_layer2_option=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pri_pri_persistent_layer2_option" >&5 -$as_echo "$ac_cv_lib_pri_pri_persistent_layer2_option" >&6; } -if test "x$ac_cv_lib_pri_pri_persistent_layer2_option" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pri_pri_persistent_layer2_option" >&5 +printf "%s\n" "$ac_cv_lib_pri_pri_persistent_layer2_option" >&6; } +if test "x$ac_cv_lib_pri_pri_persistent_layer2_option" = xyes +then : AST_PRI_L2_PERSISTENCE_FOUND=yes -else +else $as_nop AST_PRI_L2_PERSISTENCE_FOUND=no fi @@ -27676,14 +29686,14 @@ # check for the header ast_ext_lib_check_saved_CPPFLAGS="${CPPFLAGS}" CPPFLAGS="${CPPFLAGS} ${PRI_L2_PERSISTENCE_INCLUDE}" - ac_fn_c_check_header_mongrel "$LINENO" "libpri.h" "ac_cv_header_libpri_h" "$ac_includes_default" -if test "x$ac_cv_header_libpri_h" = xyes; then : + ac_fn_c_check_header_compile "$LINENO" "libpri.h" "ac_cv_header_libpri_h" "$ac_includes_default" +if test "x$ac_cv_header_libpri_h" = xyes +then : PRI_L2_PERSISTENCE_HEADER_FOUND=1 -else +else $as_nop PRI_L2_PERSISTENCE_HEADER_FOUND=0 fi - CPPFLAGS="${ast_ext_lib_check_saved_CPPFLAGS}" if test "x${PRI_L2_PERSISTENCE_HEADER_FOUND}" = "x0" ; then @@ -27715,11 +29725,12 @@ ast_ext_lib_check_save_CFLAGS="${CFLAGS}" CFLAGS="${CFLAGS} " - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pri_date_time_send_option in -lpri" >&5 -$as_echo_n "checking for pri_date_time_send_option in -lpri... " >&6; } -if ${ac_cv_lib_pri_pri_date_time_send_option+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for pri_date_time_send_option in -lpri" >&5 +printf %s "checking for pri_date_time_send_option in -lpri... " >&6; } +if test ${ac_cv_lib_pri_pri_date_time_send_option+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lpri ${pbxlibdir} $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -27728,32 +29739,31 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char pri_date_time_send_option (); int -main () +main (void) { return pri_date_time_send_option (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_pri_pri_date_time_send_option=yes -else +else $as_nop ac_cv_lib_pri_pri_date_time_send_option=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pri_pri_date_time_send_option" >&5 -$as_echo "$ac_cv_lib_pri_pri_date_time_send_option" >&6; } -if test "x$ac_cv_lib_pri_pri_date_time_send_option" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pri_pri_date_time_send_option" >&5 +printf "%s\n" "$ac_cv_lib_pri_pri_date_time_send_option" >&6; } +if test "x$ac_cv_lib_pri_pri_date_time_send_option" = xyes +then : AST_PRI_DATETIME_SEND_FOUND=yes -else +else $as_nop AST_PRI_DATETIME_SEND_FOUND=no fi @@ -27772,14 +29782,14 @@ # check for the header ast_ext_lib_check_saved_CPPFLAGS="${CPPFLAGS}" CPPFLAGS="${CPPFLAGS} ${PRI_DATETIME_SEND_INCLUDE}" - ac_fn_c_check_header_mongrel "$LINENO" "libpri.h" "ac_cv_header_libpri_h" "$ac_includes_default" -if test "x$ac_cv_header_libpri_h" = xyes; then : + ac_fn_c_check_header_compile "$LINENO" "libpri.h" "ac_cv_header_libpri_h" "$ac_includes_default" +if test "x$ac_cv_header_libpri_h" = xyes +then : PRI_DATETIME_SEND_HEADER_FOUND=1 -else +else $as_nop PRI_DATETIME_SEND_HEADER_FOUND=0 fi - CPPFLAGS="${ast_ext_lib_check_saved_CPPFLAGS}" if test "x${PRI_DATETIME_SEND_HEADER_FOUND}" = "x0" ; then @@ -27811,11 +29821,12 @@ ast_ext_lib_check_save_CFLAGS="${CFLAGS}" CFLAGS="${CFLAGS} " - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pri_mwi_indicate_v2 in -lpri" >&5 -$as_echo_n "checking for pri_mwi_indicate_v2 in -lpri... " >&6; } -if ${ac_cv_lib_pri_pri_mwi_indicate_v2+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for pri_mwi_indicate_v2 in -lpri" >&5 +printf %s "checking for pri_mwi_indicate_v2 in -lpri... " >&6; } +if test ${ac_cv_lib_pri_pri_mwi_indicate_v2+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lpri ${pbxlibdir} $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -27824,32 +29835,31 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char pri_mwi_indicate_v2 (); int -main () +main (void) { return pri_mwi_indicate_v2 (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_pri_pri_mwi_indicate_v2=yes -else +else $as_nop ac_cv_lib_pri_pri_mwi_indicate_v2=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pri_pri_mwi_indicate_v2" >&5 -$as_echo "$ac_cv_lib_pri_pri_mwi_indicate_v2" >&6; } -if test "x$ac_cv_lib_pri_pri_mwi_indicate_v2" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pri_pri_mwi_indicate_v2" >&5 +printf "%s\n" "$ac_cv_lib_pri_pri_mwi_indicate_v2" >&6; } +if test "x$ac_cv_lib_pri_pri_mwi_indicate_v2" = xyes +then : AST_PRI_MWI_V2_FOUND=yes -else +else $as_nop AST_PRI_MWI_V2_FOUND=no fi @@ -27868,14 +29878,14 @@ # check for the header ast_ext_lib_check_saved_CPPFLAGS="${CPPFLAGS}" CPPFLAGS="${CPPFLAGS} ${PRI_MWI_V2_INCLUDE}" - ac_fn_c_check_header_mongrel "$LINENO" "libpri.h" "ac_cv_header_libpri_h" "$ac_includes_default" -if test "x$ac_cv_header_libpri_h" = xyes; then : + ac_fn_c_check_header_compile "$LINENO" "libpri.h" "ac_cv_header_libpri_h" "$ac_includes_default" +if test "x$ac_cv_header_libpri_h" = xyes +then : PRI_MWI_V2_HEADER_FOUND=1 -else +else $as_nop PRI_MWI_V2_HEADER_FOUND=0 fi - CPPFLAGS="${ast_ext_lib_check_saved_CPPFLAGS}" if test "x${PRI_MWI_V2_HEADER_FOUND}" = "x0" ; then @@ -27907,11 +29917,12 @@ ast_ext_lib_check_save_CFLAGS="${CFLAGS}" CFLAGS="${CFLAGS} " - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pri_display_text in -lpri" >&5 -$as_echo_n "checking for pri_display_text in -lpri... " >&6; } -if ${ac_cv_lib_pri_pri_display_text+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for pri_display_text in -lpri" >&5 +printf %s "checking for pri_display_text in -lpri... " >&6; } +if test ${ac_cv_lib_pri_pri_display_text+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lpri ${pbxlibdir} $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -27920,32 +29931,31 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char pri_display_text (); int -main () +main (void) { return pri_display_text (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_pri_pri_display_text=yes -else +else $as_nop ac_cv_lib_pri_pri_display_text=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pri_pri_display_text" >&5 -$as_echo "$ac_cv_lib_pri_pri_display_text" >&6; } -if test "x$ac_cv_lib_pri_pri_display_text" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pri_pri_display_text" >&5 +printf "%s\n" "$ac_cv_lib_pri_pri_display_text" >&6; } +if test "x$ac_cv_lib_pri_pri_display_text" = xyes +then : AST_PRI_DISPLAY_TEXT_FOUND=yes -else +else $as_nop AST_PRI_DISPLAY_TEXT_FOUND=no fi @@ -27964,14 +29974,14 @@ # check for the header ast_ext_lib_check_saved_CPPFLAGS="${CPPFLAGS}" CPPFLAGS="${CPPFLAGS} ${PRI_DISPLAY_TEXT_INCLUDE}" - ac_fn_c_check_header_mongrel "$LINENO" "libpri.h" "ac_cv_header_libpri_h" "$ac_includes_default" -if test "x$ac_cv_header_libpri_h" = xyes; then : + ac_fn_c_check_header_compile "$LINENO" "libpri.h" "ac_cv_header_libpri_h" "$ac_includes_default" +if test "x$ac_cv_header_libpri_h" = xyes +then : PRI_DISPLAY_TEXT_HEADER_FOUND=1 -else +else $as_nop PRI_DISPLAY_TEXT_HEADER_FOUND=0 fi - CPPFLAGS="${ast_ext_lib_check_saved_CPPFLAGS}" if test "x${PRI_DISPLAY_TEXT_HEADER_FOUND}" = "x0" ; then @@ -28003,11 +30013,12 @@ ast_ext_lib_check_save_CFLAGS="${CFLAGS}" CFLAGS="${CFLAGS} " - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pri_mwi_indicate in -lpri" >&5 -$as_echo_n "checking for pri_mwi_indicate in -lpri... " >&6; } -if ${ac_cv_lib_pri_pri_mwi_indicate+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for pri_mwi_indicate in -lpri" >&5 +printf %s "checking for pri_mwi_indicate in -lpri... " >&6; } +if test ${ac_cv_lib_pri_pri_mwi_indicate+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lpri ${pbxlibdir} $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -28016,32 +30027,31 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char pri_mwi_indicate (); int -main () +main (void) { return pri_mwi_indicate (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_pri_pri_mwi_indicate=yes -else +else $as_nop ac_cv_lib_pri_pri_mwi_indicate=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pri_pri_mwi_indicate" >&5 -$as_echo "$ac_cv_lib_pri_pri_mwi_indicate" >&6; } -if test "x$ac_cv_lib_pri_pri_mwi_indicate" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pri_pri_mwi_indicate" >&5 +printf "%s\n" "$ac_cv_lib_pri_pri_mwi_indicate" >&6; } +if test "x$ac_cv_lib_pri_pri_mwi_indicate" = xyes +then : AST_PRI_MWI_FOUND=yes -else +else $as_nop AST_PRI_MWI_FOUND=no fi @@ -28060,14 +30070,14 @@ # check for the header ast_ext_lib_check_saved_CPPFLAGS="${CPPFLAGS}" CPPFLAGS="${CPPFLAGS} ${PRI_MWI_INCLUDE}" - ac_fn_c_check_header_mongrel "$LINENO" "libpri.h" "ac_cv_header_libpri_h" "$ac_includes_default" -if test "x$ac_cv_header_libpri_h" = xyes; then : + ac_fn_c_check_header_compile "$LINENO" "libpri.h" "ac_cv_header_libpri_h" "$ac_includes_default" +if test "x$ac_cv_header_libpri_h" = xyes +then : PRI_MWI_HEADER_FOUND=1 -else +else $as_nop PRI_MWI_HEADER_FOUND=0 fi - CPPFLAGS="${ast_ext_lib_check_saved_CPPFLAGS}" if test "x${PRI_MWI_HEADER_FOUND}" = "x0" ; then @@ -28099,11 +30109,12 @@ ast_ext_lib_check_save_CFLAGS="${CFLAGS}" CFLAGS="${CFLAGS} " - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pri_mcid_enable in -lpri" >&5 -$as_echo_n "checking for pri_mcid_enable in -lpri... " >&6; } -if ${ac_cv_lib_pri_pri_mcid_enable+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for pri_mcid_enable in -lpri" >&5 +printf %s "checking for pri_mcid_enable in -lpri... " >&6; } +if test ${ac_cv_lib_pri_pri_mcid_enable+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lpri ${pbxlibdir} $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -28112,32 +30123,31 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char pri_mcid_enable (); int -main () +main (void) { return pri_mcid_enable (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_pri_pri_mcid_enable=yes -else +else $as_nop ac_cv_lib_pri_pri_mcid_enable=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pri_pri_mcid_enable" >&5 -$as_echo "$ac_cv_lib_pri_pri_mcid_enable" >&6; } -if test "x$ac_cv_lib_pri_pri_mcid_enable" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pri_pri_mcid_enable" >&5 +printf "%s\n" "$ac_cv_lib_pri_pri_mcid_enable" >&6; } +if test "x$ac_cv_lib_pri_pri_mcid_enable" = xyes +then : AST_PRI_MCID_FOUND=yes -else +else $as_nop AST_PRI_MCID_FOUND=no fi @@ -28156,14 +30166,14 @@ # check for the header ast_ext_lib_check_saved_CPPFLAGS="${CPPFLAGS}" CPPFLAGS="${CPPFLAGS} ${PRI_MCID_INCLUDE}" - ac_fn_c_check_header_mongrel "$LINENO" "libpri.h" "ac_cv_header_libpri_h" "$ac_includes_default" -if test "x$ac_cv_header_libpri_h" = xyes; then : + ac_fn_c_check_header_compile "$LINENO" "libpri.h" "ac_cv_header_libpri_h" "$ac_includes_default" +if test "x$ac_cv_header_libpri_h" = xyes +then : PRI_MCID_HEADER_FOUND=1 -else +else $as_nop PRI_MCID_HEADER_FOUND=0 fi - CPPFLAGS="${ast_ext_lib_check_saved_CPPFLAGS}" if test "x${PRI_MCID_HEADER_FOUND}" = "x0" ; then @@ -28195,11 +30205,12 @@ ast_ext_lib_check_save_CFLAGS="${CFLAGS}" CFLAGS="${CFLAGS} " - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pri_connect_ack_enable in -lpri" >&5 -$as_echo_n "checking for pri_connect_ack_enable in -lpri... " >&6; } -if ${ac_cv_lib_pri_pri_connect_ack_enable+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for pri_connect_ack_enable in -lpri" >&5 +printf %s "checking for pri_connect_ack_enable in -lpri... " >&6; } +if test ${ac_cv_lib_pri_pri_connect_ack_enable+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lpri ${pbxlibdir} $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -28208,32 +30219,31 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char pri_connect_ack_enable (); int -main () +main (void) { return pri_connect_ack_enable (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_pri_pri_connect_ack_enable=yes -else +else $as_nop ac_cv_lib_pri_pri_connect_ack_enable=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pri_pri_connect_ack_enable" >&5 -$as_echo "$ac_cv_lib_pri_pri_connect_ack_enable" >&6; } -if test "x$ac_cv_lib_pri_pri_connect_ack_enable" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pri_pri_connect_ack_enable" >&5 +printf "%s\n" "$ac_cv_lib_pri_pri_connect_ack_enable" >&6; } +if test "x$ac_cv_lib_pri_pri_connect_ack_enable" = xyes +then : AST_PRI_CALL_WAITING_FOUND=yes -else +else $as_nop AST_PRI_CALL_WAITING_FOUND=no fi @@ -28252,14 +30262,14 @@ # check for the header ast_ext_lib_check_saved_CPPFLAGS="${CPPFLAGS}" CPPFLAGS="${CPPFLAGS} ${PRI_CALL_WAITING_INCLUDE}" - ac_fn_c_check_header_mongrel "$LINENO" "libpri.h" "ac_cv_header_libpri_h" "$ac_includes_default" -if test "x$ac_cv_header_libpri_h" = xyes; then : + ac_fn_c_check_header_compile "$LINENO" "libpri.h" "ac_cv_header_libpri_h" "$ac_includes_default" +if test "x$ac_cv_header_libpri_h" = xyes +then : PRI_CALL_WAITING_HEADER_FOUND=1 -else +else $as_nop PRI_CALL_WAITING_HEADER_FOUND=0 fi - CPPFLAGS="${ast_ext_lib_check_saved_CPPFLAGS}" if test "x${PRI_CALL_WAITING_HEADER_FOUND}" = "x0" ; then @@ -28291,11 +30301,12 @@ ast_ext_lib_check_save_CFLAGS="${CFLAGS}" CFLAGS="${CFLAGS} " - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pri_aoc_events_enable in -lpri" >&5 -$as_echo_n "checking for pri_aoc_events_enable in -lpri... " >&6; } -if ${ac_cv_lib_pri_pri_aoc_events_enable+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for pri_aoc_events_enable in -lpri" >&5 +printf %s "checking for pri_aoc_events_enable in -lpri... " >&6; } +if test ${ac_cv_lib_pri_pri_aoc_events_enable+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lpri ${pbxlibdir} $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -28304,32 +30315,31 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char pri_aoc_events_enable (); int -main () +main (void) { return pri_aoc_events_enable (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_pri_pri_aoc_events_enable=yes -else +else $as_nop ac_cv_lib_pri_pri_aoc_events_enable=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pri_pri_aoc_events_enable" >&5 -$as_echo "$ac_cv_lib_pri_pri_aoc_events_enable" >&6; } -if test "x$ac_cv_lib_pri_pri_aoc_events_enable" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pri_pri_aoc_events_enable" >&5 +printf "%s\n" "$ac_cv_lib_pri_pri_aoc_events_enable" >&6; } +if test "x$ac_cv_lib_pri_pri_aoc_events_enable" = xyes +then : AST_PRI_AOC_EVENTS_FOUND=yes -else +else $as_nop AST_PRI_AOC_EVENTS_FOUND=no fi @@ -28348,14 +30358,14 @@ # check for the header ast_ext_lib_check_saved_CPPFLAGS="${CPPFLAGS}" CPPFLAGS="${CPPFLAGS} ${PRI_AOC_EVENTS_INCLUDE}" - ac_fn_c_check_header_mongrel "$LINENO" "libpri.h" "ac_cv_header_libpri_h" "$ac_includes_default" -if test "x$ac_cv_header_libpri_h" = xyes; then : + ac_fn_c_check_header_compile "$LINENO" "libpri.h" "ac_cv_header_libpri_h" "$ac_includes_default" +if test "x$ac_cv_header_libpri_h" = xyes +then : PRI_AOC_EVENTS_HEADER_FOUND=1 -else +else $as_nop PRI_AOC_EVENTS_HEADER_FOUND=0 fi - CPPFLAGS="${ast_ext_lib_check_saved_CPPFLAGS}" if test "x${PRI_AOC_EVENTS_HEADER_FOUND}" = "x0" ; then @@ -28387,11 +30397,12 @@ ast_ext_lib_check_save_CFLAGS="${CFLAGS}" CFLAGS="${CFLAGS} " - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pri_transfer_enable in -lpri" >&5 -$as_echo_n "checking for pri_transfer_enable in -lpri... " >&6; } -if ${ac_cv_lib_pri_pri_transfer_enable+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for pri_transfer_enable in -lpri" >&5 +printf %s "checking for pri_transfer_enable in -lpri... " >&6; } +if test ${ac_cv_lib_pri_pri_transfer_enable+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lpri ${pbxlibdir} $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -28400,32 +30411,31 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char pri_transfer_enable (); int -main () +main (void) { return pri_transfer_enable (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_pri_pri_transfer_enable=yes -else +else $as_nop ac_cv_lib_pri_pri_transfer_enable=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pri_pri_transfer_enable" >&5 -$as_echo "$ac_cv_lib_pri_pri_transfer_enable" >&6; } -if test "x$ac_cv_lib_pri_pri_transfer_enable" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pri_pri_transfer_enable" >&5 +printf "%s\n" "$ac_cv_lib_pri_pri_transfer_enable" >&6; } +if test "x$ac_cv_lib_pri_pri_transfer_enable" = xyes +then : AST_PRI_TRANSFER_FOUND=yes -else +else $as_nop AST_PRI_TRANSFER_FOUND=no fi @@ -28444,14 +30454,14 @@ # check for the header ast_ext_lib_check_saved_CPPFLAGS="${CPPFLAGS}" CPPFLAGS="${CPPFLAGS} ${PRI_TRANSFER_INCLUDE}" - ac_fn_c_check_header_mongrel "$LINENO" "libpri.h" "ac_cv_header_libpri_h" "$ac_includes_default" -if test "x$ac_cv_header_libpri_h" = xyes; then : + ac_fn_c_check_header_compile "$LINENO" "libpri.h" "ac_cv_header_libpri_h" "$ac_includes_default" +if test "x$ac_cv_header_libpri_h" = xyes +then : PRI_TRANSFER_HEADER_FOUND=1 -else +else $as_nop PRI_TRANSFER_HEADER_FOUND=0 fi - CPPFLAGS="${ast_ext_lib_check_saved_CPPFLAGS}" if test "x${PRI_TRANSFER_HEADER_FOUND}" = "x0" ; then @@ -28483,45 +30493,45 @@ ast_ext_lib_check_save_CFLAGS="${CFLAGS}" CFLAGS="${CFLAGS} " - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pri_cc_enable in -lpri" >&5 -$as_echo_n "checking for pri_cc_enable in -lpri... " >&6; } -if ${ac_cv_lib_pri_pri_cc_enable+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for pri_cc_enable in -lpri" >&5 +printf %s "checking for pri_cc_enable in -lpri... " >&6; } +if test ${ac_cv_lib_pri_pri_cc_enable+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lpri ${pbxlibdir} $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ char pri_cc_enable (); int -main () +main (void) { return pri_cc_enable (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_pri_pri_cc_enable=yes -else +else $as_nop ac_cv_lib_pri_pri_cc_enable=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pri_pri_cc_enable" >&5 -$as_echo "$ac_cv_lib_pri_pri_cc_enable" >&6; } -if test "x$ac_cv_lib_pri_pri_cc_enable" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pri_pri_cc_enable" >&5 +printf "%s\n" "$ac_cv_lib_pri_pri_cc_enable" >&6; } +if test "x$ac_cv_lib_pri_pri_cc_enable" = xyes +then : AST_PRI_CCSS_FOUND=yes -else +else $as_nop AST_PRI_CCSS_FOUND=no fi @@ -28540,14 +30550,14 @@ # check for the header ast_ext_lib_check_saved_CPPFLAGS="${CPPFLAGS}" CPPFLAGS="${CPPFLAGS} ${PRI_CCSS_INCLUDE}" - ac_fn_c_check_header_mongrel "$LINENO" "libpri.h" "ac_cv_header_libpri_h" "$ac_includes_default" -if test "x$ac_cv_header_libpri_h" = xyes; then : + ac_fn_c_check_header_compile "$LINENO" "libpri.h" "ac_cv_header_libpri_h" "$ac_includes_default" +if test "x$ac_cv_header_libpri_h" = xyes +then : PRI_CCSS_HEADER_FOUND=1 -else +else $as_nop PRI_CCSS_HEADER_FOUND=0 fi - CPPFLAGS="${ast_ext_lib_check_saved_CPPFLAGS}" if test "x${PRI_CCSS_HEADER_FOUND}" = "x0" ; then @@ -28579,11 +30589,12 @@ ast_ext_lib_check_save_CFLAGS="${CFLAGS}" CFLAGS="${CFLAGS} " - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pri_hangup_fix_enable in -lpri" >&5 -$as_echo_n "checking for pri_hangup_fix_enable in -lpri... " >&6; } -if ${ac_cv_lib_pri_pri_hangup_fix_enable+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for pri_hangup_fix_enable in -lpri" >&5 +printf %s "checking for pri_hangup_fix_enable in -lpri... " >&6; } +if test ${ac_cv_lib_pri_pri_hangup_fix_enable+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lpri ${pbxlibdir} $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -28592,32 +30603,31 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char pri_hangup_fix_enable (); int -main () +main (void) { return pri_hangup_fix_enable (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_pri_pri_hangup_fix_enable=yes -else +else $as_nop ac_cv_lib_pri_pri_hangup_fix_enable=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pri_pri_hangup_fix_enable" >&5 -$as_echo "$ac_cv_lib_pri_pri_hangup_fix_enable" >&6; } -if test "x$ac_cv_lib_pri_pri_hangup_fix_enable" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pri_pri_hangup_fix_enable" >&5 +printf "%s\n" "$ac_cv_lib_pri_pri_hangup_fix_enable" >&6; } +if test "x$ac_cv_lib_pri_pri_hangup_fix_enable" = xyes +then : AST_PRI_HANGUP_FIX_FOUND=yes -else +else $as_nop AST_PRI_HANGUP_FIX_FOUND=no fi @@ -28636,14 +30646,14 @@ # check for the header ast_ext_lib_check_saved_CPPFLAGS="${CPPFLAGS}" CPPFLAGS="${CPPFLAGS} ${PRI_HANGUP_FIX_INCLUDE}" - ac_fn_c_check_header_mongrel "$LINENO" "libpri.h" "ac_cv_header_libpri_h" "$ac_includes_default" -if test "x$ac_cv_header_libpri_h" = xyes; then : + ac_fn_c_check_header_compile "$LINENO" "libpri.h" "ac_cv_header_libpri_h" "$ac_includes_default" +if test "x$ac_cv_header_libpri_h" = xyes +then : PRI_HANGUP_FIX_HEADER_FOUND=1 -else +else $as_nop PRI_HANGUP_FIX_HEADER_FOUND=0 fi - CPPFLAGS="${ast_ext_lib_check_saved_CPPFLAGS}" if test "x${PRI_HANGUP_FIX_HEADER_FOUND}" = "x0" ; then @@ -28675,11 +30685,12 @@ ast_ext_lib_check_save_CFLAGS="${CFLAGS}" CFLAGS="${CFLAGS} " - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pri_sr_set_called_subaddress in -lpri" >&5 -$as_echo_n "checking for pri_sr_set_called_subaddress in -lpri... " >&6; } -if ${ac_cv_lib_pri_pri_sr_set_called_subaddress+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for pri_sr_set_called_subaddress in -lpri" >&5 +printf %s "checking for pri_sr_set_called_subaddress in -lpri... " >&6; } +if test ${ac_cv_lib_pri_pri_sr_set_called_subaddress+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lpri ${pbxlibdir} $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -28688,32 +30699,31 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char pri_sr_set_called_subaddress (); int -main () +main (void) { return pri_sr_set_called_subaddress (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_pri_pri_sr_set_called_subaddress=yes -else +else $as_nop ac_cv_lib_pri_pri_sr_set_called_subaddress=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pri_pri_sr_set_called_subaddress" >&5 -$as_echo "$ac_cv_lib_pri_pri_sr_set_called_subaddress" >&6; } -if test "x$ac_cv_lib_pri_pri_sr_set_called_subaddress" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pri_pri_sr_set_called_subaddress" >&5 +printf "%s\n" "$ac_cv_lib_pri_pri_sr_set_called_subaddress" >&6; } +if test "x$ac_cv_lib_pri_pri_sr_set_called_subaddress" = xyes +then : AST_PRI_SUBADDR_FOUND=yes -else +else $as_nop AST_PRI_SUBADDR_FOUND=no fi @@ -28732,14 +30742,14 @@ # check for the header ast_ext_lib_check_saved_CPPFLAGS="${CPPFLAGS}" CPPFLAGS="${CPPFLAGS} ${PRI_SUBADDR_INCLUDE}" - ac_fn_c_check_header_mongrel "$LINENO" "libpri.h" "ac_cv_header_libpri_h" "$ac_includes_default" -if test "x$ac_cv_header_libpri_h" = xyes; then : + ac_fn_c_check_header_compile "$LINENO" "libpri.h" "ac_cv_header_libpri_h" "$ac_includes_default" +if test "x$ac_cv_header_libpri_h" = xyes +then : PRI_SUBADDR_HEADER_FOUND=1 -else +else $as_nop PRI_SUBADDR_HEADER_FOUND=0 fi - CPPFLAGS="${ast_ext_lib_check_saved_CPPFLAGS}" if test "x${PRI_SUBADDR_HEADER_FOUND}" = "x0" ; then @@ -28771,11 +30781,12 @@ ast_ext_lib_check_save_CFLAGS="${CFLAGS}" CFLAGS="${CFLAGS} " - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pri_hold_enable in -lpri" >&5 -$as_echo_n "checking for pri_hold_enable in -lpri... " >&6; } -if ${ac_cv_lib_pri_pri_hold_enable+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for pri_hold_enable in -lpri" >&5 +printf %s "checking for pri_hold_enable in -lpri... " >&6; } +if test ${ac_cv_lib_pri_pri_hold_enable+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lpri ${pbxlibdir} $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -28784,32 +30795,31 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char pri_hold_enable (); int -main () +main (void) { return pri_hold_enable (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_pri_pri_hold_enable=yes -else +else $as_nop ac_cv_lib_pri_pri_hold_enable=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pri_pri_hold_enable" >&5 -$as_echo "$ac_cv_lib_pri_pri_hold_enable" >&6; } -if test "x$ac_cv_lib_pri_pri_hold_enable" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pri_pri_hold_enable" >&5 +printf "%s\n" "$ac_cv_lib_pri_pri_hold_enable" >&6; } +if test "x$ac_cv_lib_pri_pri_hold_enable" = xyes +then : AST_PRI_CALL_HOLD_FOUND=yes -else +else $as_nop AST_PRI_CALL_HOLD_FOUND=no fi @@ -28828,14 +30838,14 @@ # check for the header ast_ext_lib_check_saved_CPPFLAGS="${CPPFLAGS}" CPPFLAGS="${CPPFLAGS} ${PRI_CALL_HOLD_INCLUDE}" - ac_fn_c_check_header_mongrel "$LINENO" "libpri.h" "ac_cv_header_libpri_h" "$ac_includes_default" -if test "x$ac_cv_header_libpri_h" = xyes; then : + ac_fn_c_check_header_compile "$LINENO" "libpri.h" "ac_cv_header_libpri_h" "$ac_includes_default" +if test "x$ac_cv_header_libpri_h" = xyes +then : PRI_CALL_HOLD_HEADER_FOUND=1 -else +else $as_nop PRI_CALL_HOLD_HEADER_FOUND=0 fi - CPPFLAGS="${ast_ext_lib_check_saved_CPPFLAGS}" if test "x${PRI_CALL_HOLD_HEADER_FOUND}" = "x0" ; then @@ -28867,11 +30877,12 @@ ast_ext_lib_check_save_CFLAGS="${CFLAGS}" CFLAGS="${CFLAGS} " - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pri_reroute_enable in -lpri" >&5 -$as_echo_n "checking for pri_reroute_enable in -lpri... " >&6; } -if ${ac_cv_lib_pri_pri_reroute_enable+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for pri_reroute_enable in -lpri" >&5 +printf %s "checking for pri_reroute_enable in -lpri... " >&6; } +if test ${ac_cv_lib_pri_pri_reroute_enable+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lpri ${pbxlibdir} $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -28880,32 +30891,31 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char pri_reroute_enable (); int -main () +main (void) { return pri_reroute_enable (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_pri_pri_reroute_enable=yes -else +else $as_nop ac_cv_lib_pri_pri_reroute_enable=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pri_pri_reroute_enable" >&5 -$as_echo "$ac_cv_lib_pri_pri_reroute_enable" >&6; } -if test "x$ac_cv_lib_pri_pri_reroute_enable" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pri_pri_reroute_enable" >&5 +printf "%s\n" "$ac_cv_lib_pri_pri_reroute_enable" >&6; } +if test "x$ac_cv_lib_pri_pri_reroute_enable" = xyes +then : AST_PRI_CALL_REROUTING_FOUND=yes -else +else $as_nop AST_PRI_CALL_REROUTING_FOUND=no fi @@ -28924,14 +30934,14 @@ # check for the header ast_ext_lib_check_saved_CPPFLAGS="${CPPFLAGS}" CPPFLAGS="${CPPFLAGS} ${PRI_CALL_REROUTING_INCLUDE}" - ac_fn_c_check_header_mongrel "$LINENO" "libpri.h" "ac_cv_header_libpri_h" "$ac_includes_default" -if test "x$ac_cv_header_libpri_h" = xyes; then : + ac_fn_c_check_header_compile "$LINENO" "libpri.h" "ac_cv_header_libpri_h" "$ac_includes_default" +if test "x$ac_cv_header_libpri_h" = xyes +then : PRI_CALL_REROUTING_HEADER_FOUND=1 -else +else $as_nop PRI_CALL_REROUTING_HEADER_FOUND=0 fi - CPPFLAGS="${ast_ext_lib_check_saved_CPPFLAGS}" if test "x${PRI_CALL_REROUTING_HEADER_FOUND}" = "x0" ; then @@ -28963,11 +30973,12 @@ ast_ext_lib_check_save_CFLAGS="${CFLAGS}" CFLAGS="${CFLAGS} " - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pri_sr_set_keypad_digits in -lpri" >&5 -$as_echo_n "checking for pri_sr_set_keypad_digits in -lpri... " >&6; } -if ${ac_cv_lib_pri_pri_sr_set_keypad_digits+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for pri_sr_set_keypad_digits in -lpri" >&5 +printf %s "checking for pri_sr_set_keypad_digits in -lpri... " >&6; } +if test ${ac_cv_lib_pri_pri_sr_set_keypad_digits+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lpri ${pbxlibdir} $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -28976,32 +30987,31 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char pri_sr_set_keypad_digits (); int -main () +main (void) { return pri_sr_set_keypad_digits (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_pri_pri_sr_set_keypad_digits=yes -else +else $as_nop ac_cv_lib_pri_pri_sr_set_keypad_digits=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pri_pri_sr_set_keypad_digits" >&5 -$as_echo "$ac_cv_lib_pri_pri_sr_set_keypad_digits" >&6; } -if test "x$ac_cv_lib_pri_pri_sr_set_keypad_digits" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pri_pri_sr_set_keypad_digits" >&5 +printf "%s\n" "$ac_cv_lib_pri_pri_sr_set_keypad_digits" >&6; } +if test "x$ac_cv_lib_pri_pri_sr_set_keypad_digits" = xyes +then : AST_PRI_SETUP_KEYPAD_FOUND=yes -else +else $as_nop AST_PRI_SETUP_KEYPAD_FOUND=no fi @@ -29020,14 +31030,14 @@ # check for the header ast_ext_lib_check_saved_CPPFLAGS="${CPPFLAGS}" CPPFLAGS="${CPPFLAGS} ${PRI_SETUP_KEYPAD_INCLUDE}" - ac_fn_c_check_header_mongrel "$LINENO" "libpri.h" "ac_cv_header_libpri_h" "$ac_includes_default" -if test "x$ac_cv_header_libpri_h" = xyes; then : + ac_fn_c_check_header_compile "$LINENO" "libpri.h" "ac_cv_header_libpri_h" "$ac_includes_default" +if test "x$ac_cv_header_libpri_h" = xyes +then : PRI_SETUP_KEYPAD_HEADER_FOUND=1 -else +else $as_nop PRI_SETUP_KEYPAD_HEADER_FOUND=0 fi - CPPFLAGS="${ast_ext_lib_check_saved_CPPFLAGS}" if test "x${PRI_SETUP_KEYPAD_HEADER_FOUND}" = "x0" ; then @@ -29063,11 +31073,12 @@ ast_ext_lib_check_save_CFLAGS="${CFLAGS}" CFLAGS="${CFLAGS} " - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pri_progress_with_cause in -lpri" >&5 -$as_echo_n "checking for pri_progress_with_cause in -lpri... " >&6; } -if ${ac_cv_lib_pri_pri_progress_with_cause+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for pri_progress_with_cause in -lpri" >&5 +printf %s "checking for pri_progress_with_cause in -lpri... " >&6; } +if test ${ac_cv_lib_pri_pri_progress_with_cause+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lpri ${pbxlibdir} $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -29076,32 +31087,31 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char pri_progress_with_cause (); int -main () +main (void) { return pri_progress_with_cause (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_pri_pri_progress_with_cause=yes -else +else $as_nop ac_cv_lib_pri_pri_progress_with_cause=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pri_pri_progress_with_cause" >&5 -$as_echo "$ac_cv_lib_pri_pri_progress_with_cause" >&6; } -if test "x$ac_cv_lib_pri_pri_progress_with_cause" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pri_pri_progress_with_cause" >&5 +printf "%s\n" "$ac_cv_lib_pri_pri_progress_with_cause" >&6; } +if test "x$ac_cv_lib_pri_pri_progress_with_cause" = xyes +then : AST_PRI_PROG_W_CAUSE_FOUND=yes -else +else $as_nop AST_PRI_PROG_W_CAUSE_FOUND=no fi @@ -29120,14 +31130,14 @@ # check for the header ast_ext_lib_check_saved_CPPFLAGS="${CPPFLAGS}" CPPFLAGS="${CPPFLAGS} ${PRI_PROG_W_CAUSE_INCLUDE}" - ac_fn_c_check_header_mongrel "$LINENO" "libpri.h" "ac_cv_header_libpri_h" "$ac_includes_default" -if test "x$ac_cv_header_libpri_h" = xyes; then : + ac_fn_c_check_header_compile "$LINENO" "libpri.h" "ac_cv_header_libpri_h" "$ac_includes_default" +if test "x$ac_cv_header_libpri_h" = xyes +then : PRI_PROG_W_CAUSE_HEADER_FOUND=1 -else +else $as_nop PRI_PROG_W_CAUSE_HEADER_FOUND=0 fi - CPPFLAGS="${ast_ext_lib_check_saved_CPPFLAGS}" if test "x${PRI_PROG_W_CAUSE_HEADER_FOUND}" = "x0" ; then @@ -29159,11 +31169,12 @@ ast_ext_lib_check_save_CFLAGS="${CFLAGS}" CFLAGS="${CFLAGS} " - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pri_set_inbanddisconnect in -lpri" >&5 -$as_echo_n "checking for pri_set_inbanddisconnect in -lpri... " >&6; } -if ${ac_cv_lib_pri_pri_set_inbanddisconnect+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for pri_set_inbanddisconnect in -lpri" >&5 +printf %s "checking for pri_set_inbanddisconnect in -lpri... " >&6; } +if test ${ac_cv_lib_pri_pri_set_inbanddisconnect+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lpri ${pbxlibdir} $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -29172,32 +31183,31 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char pri_set_inbanddisconnect (); int -main () +main (void) { return pri_set_inbanddisconnect (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_pri_pri_set_inbanddisconnect=yes -else +else $as_nop ac_cv_lib_pri_pri_set_inbanddisconnect=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pri_pri_set_inbanddisconnect" >&5 -$as_echo "$ac_cv_lib_pri_pri_set_inbanddisconnect" >&6; } -if test "x$ac_cv_lib_pri_pri_set_inbanddisconnect" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pri_pri_set_inbanddisconnect" >&5 +printf "%s\n" "$ac_cv_lib_pri_pri_set_inbanddisconnect" >&6; } +if test "x$ac_cv_lib_pri_pri_set_inbanddisconnect" = xyes +then : AST_PRI_INBANDDISCONNECT_FOUND=yes -else +else $as_nop AST_PRI_INBANDDISCONNECT_FOUND=no fi @@ -29216,14 +31226,14 @@ # check for the header ast_ext_lib_check_saved_CPPFLAGS="${CPPFLAGS}" CPPFLAGS="${CPPFLAGS} ${PRI_INBANDDISCONNECT_INCLUDE}" - ac_fn_c_check_header_mongrel "$LINENO" "libpri.h" "ac_cv_header_libpri_h" "$ac_includes_default" -if test "x$ac_cv_header_libpri_h" = xyes; then : + ac_fn_c_check_header_compile "$LINENO" "libpri.h" "ac_cv_header_libpri_h" "$ac_includes_default" +if test "x$ac_cv_header_libpri_h" = xyes +then : PRI_INBANDDISCONNECT_HEADER_FOUND=1 -else +else $as_nop PRI_INBANDDISCONNECT_HEADER_FOUND=0 fi - CPPFLAGS="${ast_ext_lib_check_saved_CPPFLAGS}" if test "x${PRI_INBANDDISCONNECT_HEADER_FOUND}" = "x0" ; then @@ -29255,11 +31265,12 @@ ast_ext_lib_check_save_CFLAGS="${CFLAGS}" CFLAGS="${CFLAGS} " - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pri_maintenance_service in -lpri" >&5 -$as_echo_n "checking for pri_maintenance_service in -lpri... " >&6; } -if ${ac_cv_lib_pri_pri_maintenance_service+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for pri_maintenance_service in -lpri" >&5 +printf %s "checking for pri_maintenance_service in -lpri... " >&6; } +if test ${ac_cv_lib_pri_pri_maintenance_service+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lpri ${pbxlibdir} $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -29268,32 +31279,31 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char pri_maintenance_service (); int -main () +main (void) { return pri_maintenance_service (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_pri_pri_maintenance_service=yes -else +else $as_nop ac_cv_lib_pri_pri_maintenance_service=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pri_pri_maintenance_service" >&5 -$as_echo "$ac_cv_lib_pri_pri_maintenance_service" >&6; } -if test "x$ac_cv_lib_pri_pri_maintenance_service" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pri_pri_maintenance_service" >&5 +printf "%s\n" "$ac_cv_lib_pri_pri_maintenance_service" >&6; } +if test "x$ac_cv_lib_pri_pri_maintenance_service" = xyes +then : AST_PRI_SERVICE_MESSAGES_FOUND=yes -else +else $as_nop AST_PRI_SERVICE_MESSAGES_FOUND=no fi @@ -29312,14 +31322,14 @@ # check for the header ast_ext_lib_check_saved_CPPFLAGS="${CPPFLAGS}" CPPFLAGS="${CPPFLAGS} ${PRI_SERVICE_MESSAGES_INCLUDE}" - ac_fn_c_check_header_mongrel "$LINENO" "libpri.h" "ac_cv_header_libpri_h" "$ac_includes_default" -if test "x$ac_cv_header_libpri_h" = xyes; then : + ac_fn_c_check_header_compile "$LINENO" "libpri.h" "ac_cv_header_libpri_h" "$ac_includes_default" +if test "x$ac_cv_header_libpri_h" = xyes +then : PRI_SERVICE_MESSAGES_HEADER_FOUND=1 -else +else $as_nop PRI_SERVICE_MESSAGES_HEADER_FOUND=0 fi - CPPFLAGS="${ast_ext_lib_check_saved_CPPFLAGS}" if test "x${PRI_SERVICE_MESSAGES_HEADER_FOUND}" = "x0" ; then @@ -29351,11 +31361,12 @@ ast_ext_lib_check_save_CFLAGS="${CFLAGS}" CFLAGS="${CFLAGS} " - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pri_sr_set_reversecharge in -lpri" >&5 -$as_echo_n "checking for pri_sr_set_reversecharge in -lpri... " >&6; } -if ${ac_cv_lib_pri_pri_sr_set_reversecharge+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for pri_sr_set_reversecharge in -lpri" >&5 +printf %s "checking for pri_sr_set_reversecharge in -lpri... " >&6; } +if test ${ac_cv_lib_pri_pri_sr_set_reversecharge+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lpri ${pbxlibdir} $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -29364,32 +31375,31 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char pri_sr_set_reversecharge (); int -main () +main (void) { return pri_sr_set_reversecharge (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_pri_pri_sr_set_reversecharge=yes -else +else $as_nop ac_cv_lib_pri_pri_sr_set_reversecharge=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pri_pri_sr_set_reversecharge" >&5 -$as_echo "$ac_cv_lib_pri_pri_sr_set_reversecharge" >&6; } -if test "x$ac_cv_lib_pri_pri_sr_set_reversecharge" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pri_pri_sr_set_reversecharge" >&5 +printf "%s\n" "$ac_cv_lib_pri_pri_sr_set_reversecharge" >&6; } +if test "x$ac_cv_lib_pri_pri_sr_set_reversecharge" = xyes +then : AST_PRI_REVERSE_CHARGE_FOUND=yes -else +else $as_nop AST_PRI_REVERSE_CHARGE_FOUND=no fi @@ -29408,14 +31418,14 @@ # check for the header ast_ext_lib_check_saved_CPPFLAGS="${CPPFLAGS}" CPPFLAGS="${CPPFLAGS} ${PRI_REVERSE_CHARGE_INCLUDE}" - ac_fn_c_check_header_mongrel "$LINENO" "libpri.h" "ac_cv_header_libpri_h" "$ac_includes_default" -if test "x$ac_cv_header_libpri_h" = xyes; then : + ac_fn_c_check_header_compile "$LINENO" "libpri.h" "ac_cv_header_libpri_h" "$ac_includes_default" +if test "x$ac_cv_header_libpri_h" = xyes +then : PRI_REVERSE_CHARGE_HEADER_FOUND=1 -else +else $as_nop PRI_REVERSE_CHARGE_HEADER_FOUND=0 fi - CPPFLAGS="${ast_ext_lib_check_saved_CPPFLAGS}" if test "x${PRI_REVERSE_CHARGE_HEADER_FOUND}" = "x0" ; then @@ -29450,11 +31460,12 @@ ast_ext_lib_check_save_CFLAGS="${CFLAGS}" CFLAGS="${CFLAGS} " - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for resample_open in -lresample" >&5 -$as_echo_n "checking for resample_open in -lresample... " >&6; } -if ${ac_cv_lib_resample_resample_open+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for resample_open in -lresample" >&5 +printf %s "checking for resample_open in -lresample... " >&6; } +if test ${ac_cv_lib_resample_resample_open+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lresample ${pbxlibdir} -lm $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -29463,32 +31474,31 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char resample_open (); int -main () +main (void) { return resample_open (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_resample_resample_open=yes -else +else $as_nop ac_cv_lib_resample_resample_open=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_resample_resample_open" >&5 -$as_echo "$ac_cv_lib_resample_resample_open" >&6; } -if test "x$ac_cv_lib_resample_resample_open" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_resample_resample_open" >&5 +printf "%s\n" "$ac_cv_lib_resample_resample_open" >&6; } +if test "x$ac_cv_lib_resample_resample_open" = xyes +then : AST_RESAMPLE_FOUND=yes -else +else $as_nop AST_RESAMPLE_FOUND=no fi @@ -29507,14 +31517,14 @@ # check for the header ast_ext_lib_check_saved_CPPFLAGS="${CPPFLAGS}" CPPFLAGS="${CPPFLAGS} ${RESAMPLE_INCLUDE}" - ac_fn_c_check_header_mongrel "$LINENO" "libresample.h" "ac_cv_header_libresample_h" "$ac_includes_default" -if test "x$ac_cv_header_libresample_h" = xyes; then : + ac_fn_c_check_header_compile "$LINENO" "libresample.h" "ac_cv_header_libresample_h" "$ac_includes_default" +if test "x$ac_cv_header_libresample_h" = xyes +then : RESAMPLE_HEADER_FOUND=1 -else +else $as_nop RESAMPLE_HEADER_FOUND=0 fi - CPPFLAGS="${ast_ext_lib_check_saved_CPPFLAGS}" if test "x${RESAMPLE_HEADER_FOUND}" = "x0" ; then @@ -29546,11 +31556,12 @@ ast_ext_lib_check_save_CFLAGS="${CFLAGS}" CFLAGS="${CFLAGS} " - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for fftw_malloc in -lfftw3" >&5 -$as_echo_n "checking for fftw_malloc in -lfftw3... " >&6; } -if ${ac_cv_lib_fftw3_fftw_malloc+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for fftw_malloc in -lfftw3" >&5 +printf %s "checking for fftw_malloc in -lfftw3... " >&6; } +if test ${ac_cv_lib_fftw3_fftw_malloc+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lfftw3 ${pbxlibdir} $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -29559,32 +31570,31 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char fftw_malloc (); int -main () +main (void) { return fftw_malloc (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_fftw3_fftw_malloc=yes -else +else $as_nop ac_cv_lib_fftw3_fftw_malloc=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fftw3_fftw_malloc" >&5 -$as_echo "$ac_cv_lib_fftw3_fftw_malloc" >&6; } -if test "x$ac_cv_lib_fftw3_fftw_malloc" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fftw3_fftw_malloc" >&5 +printf "%s\n" "$ac_cv_lib_fftw3_fftw_malloc" >&6; } +if test "x$ac_cv_lib_fftw3_fftw_malloc" = xyes +then : AST_FFTW3_FOUND=yes -else +else $as_nop AST_FFTW3_FOUND=no fi @@ -29603,14 +31613,14 @@ # check for the header ast_ext_lib_check_saved_CPPFLAGS="${CPPFLAGS}" CPPFLAGS="${CPPFLAGS} ${FFTW3_INCLUDE}" - ac_fn_c_check_header_mongrel "$LINENO" "fftw3.h" "ac_cv_header_fftw3_h" "$ac_includes_default" -if test "x$ac_cv_header_fftw3_h" = xyes; then : + ac_fn_c_check_header_compile "$LINENO" "fftw3.h" "ac_cv_header_fftw3_h" "$ac_includes_default" +if test "x$ac_cv_header_fftw3_h" = xyes +then : FFTW3_HEADER_FOUND=1 -else +else $as_nop FFTW3_HEADER_FOUND=0 fi - CPPFLAGS="${ast_ext_lib_check_saved_CPPFLAGS}" if test "x${FFTW3_HEADER_FOUND}" = "x0" ; then @@ -29642,11 +31652,12 @@ ast_ext_lib_check_save_CFLAGS="${CFLAGS}" CFLAGS="${CFLAGS} " - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sf_open in -lsndfile" >&5 -$as_echo_n "checking for sf_open in -lsndfile... " >&6; } -if ${ac_cv_lib_sndfile_sf_open+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for sf_open in -lsndfile" >&5 +printf %s "checking for sf_open in -lsndfile... " >&6; } +if test ${ac_cv_lib_sndfile_sf_open+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lsndfile ${pbxlibdir} $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -29655,32 +31666,31 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char sf_open (); int -main () +main (void) { return sf_open (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_sndfile_sf_open=yes -else +else $as_nop ac_cv_lib_sndfile_sf_open=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_sndfile_sf_open" >&5 -$as_echo "$ac_cv_lib_sndfile_sf_open" >&6; } -if test "x$ac_cv_lib_sndfile_sf_open" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_sndfile_sf_open" >&5 +printf "%s\n" "$ac_cv_lib_sndfile_sf_open" >&6; } +if test "x$ac_cv_lib_sndfile_sf_open" = xyes +then : AST_SNDFILE_FOUND=yes -else +else $as_nop AST_SNDFILE_FOUND=no fi @@ -29699,14 +31709,14 @@ # check for the header ast_ext_lib_check_saved_CPPFLAGS="${CPPFLAGS}" CPPFLAGS="${CPPFLAGS} ${SNDFILE_INCLUDE}" - ac_fn_c_check_header_mongrel "$LINENO" "sndfile.h" "ac_cv_header_sndfile_h" "$ac_includes_default" -if test "x$ac_cv_header_sndfile_h" = xyes; then : + ac_fn_c_check_header_compile "$LINENO" "sndfile.h" "ac_cv_header_sndfile_h" "$ac_includes_default" +if test "x$ac_cv_header_sndfile_h" = xyes +then : SNDFILE_HEADER_FOUND=1 -else +else $as_nop SNDFILE_HEADER_FOUND=0 fi - CPPFLAGS="${ast_ext_lib_check_saved_CPPFLAGS}" if test "x${SNDFILE_HEADER_FOUND}" = "x0" ; then @@ -29727,8 +31737,8 @@ if test "x${PBX_SPANDSP}" != "x1" -a "${USE_SPANDSP}" != "no"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for minimum version of SpanDSP" >&5 -$as_echo_n "checking for minimum version of SpanDSP... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for minimum version of SpanDSP" >&5 +printf %s "checking for minimum version of SpanDSP... " >&6; } saved_cppflags="${CPPFLAGS}" if test "x${SPANDSP_DIR}" != "x"; then SPANDSP_INCLUDE="-I${SPANDSP_DIR}/include" @@ -29739,7 +31749,7 @@ /* end confdefs.h. */ #include int -main () +main (void) { #if SPANDSP_RELEASE_DATE < 20080516 @@ -29751,21 +31761,22 @@ return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } +if ac_fn_c_try_compile "$LINENO" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } PBX_SPANDSP=1 -$as_echo "#define HAVE_SPANDSP 1" >>confdefs.h +printf "%s\n" "#define HAVE_SPANDSP 1" >>confdefs.h -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext CPPFLAGS="${saved_cppflags}" fi @@ -29788,11 +31799,12 @@ ast_ext_lib_check_save_CFLAGS="${CFLAGS}" CFLAGS="${CFLAGS} " - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for span_set_message_handler in -lspandsp" >&5 -$as_echo_n "checking for span_set_message_handler in -lspandsp... " >&6; } -if ${ac_cv_lib_spandsp_span_set_message_handler+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for span_set_message_handler in -lspandsp" >&5 +printf %s "checking for span_set_message_handler in -lspandsp... " >&6; } +if test ${ac_cv_lib_spandsp_span_set_message_handler+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lspandsp ${pbxlibdir} -ltiff $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -29801,32 +31813,31 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char span_set_message_handler (); int -main () +main (void) { return span_set_message_handler (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_spandsp_span_set_message_handler=yes -else +else $as_nop ac_cv_lib_spandsp_span_set_message_handler=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_spandsp_span_set_message_handler" >&5 -$as_echo "$ac_cv_lib_spandsp_span_set_message_handler" >&6; } -if test "x$ac_cv_lib_spandsp_span_set_message_handler" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_spandsp_span_set_message_handler" >&5 +printf "%s\n" "$ac_cv_lib_spandsp_span_set_message_handler" >&6; } +if test "x$ac_cv_lib_spandsp_span_set_message_handler" = xyes +then : AST_SPANDSP_FOUND=yes -else +else $as_nop AST_SPANDSP_FOUND=no fi @@ -29845,14 +31856,14 @@ # check for the header ast_ext_lib_check_saved_CPPFLAGS="${CPPFLAGS}" CPPFLAGS="${CPPFLAGS} ${SPANDSP_INCLUDE}" - ac_fn_c_check_header_mongrel "$LINENO" "spandsp.h" "ac_cv_header_spandsp_h" "$ac_includes_default" -if test "x$ac_cv_header_spandsp_h" = xyes; then : + ac_fn_c_check_header_compile "$LINENO" "spandsp.h" "ac_cv_header_spandsp_h" "$ac_includes_default" +if test "x$ac_cv_header_spandsp_h" = xyes +then : SPANDSP_HEADER_FOUND=1 -else +else $as_nop SPANDSP_HEADER_FOUND=0 fi - CPPFLAGS="${ast_ext_lib_check_saved_CPPFLAGS}" if test "x${SPANDSP_HEADER_FOUND}" = "x0" ; then @@ -29889,11 +31900,12 @@ ast_ext_lib_check_save_CFLAGS="${CFLAGS}" CFLAGS="${CFLAGS} " - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for t38_terminal_init in -lspandsp" >&5 -$as_echo_n "checking for t38_terminal_init in -lspandsp... " >&6; } -if ${ac_cv_lib_spandsp_t38_terminal_init+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for t38_terminal_init in -lspandsp" >&5 +printf %s "checking for t38_terminal_init in -lspandsp... " >&6; } +if test ${ac_cv_lib_spandsp_t38_terminal_init+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lspandsp ${pbxlibdir} -ltiff $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -29902,32 +31914,31 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char t38_terminal_init (); int -main () +main (void) { return t38_terminal_init (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_spandsp_t38_terminal_init=yes -else +else $as_nop ac_cv_lib_spandsp_t38_terminal_init=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_spandsp_t38_terminal_init" >&5 -$as_echo "$ac_cv_lib_spandsp_t38_terminal_init" >&6; } -if test "x$ac_cv_lib_spandsp_t38_terminal_init" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_spandsp_t38_terminal_init" >&5 +printf "%s\n" "$ac_cv_lib_spandsp_t38_terminal_init" >&6; } +if test "x$ac_cv_lib_spandsp_t38_terminal_init" = xyes +then : AST_SPANDSP_FOUND=yes -else +else $as_nop AST_SPANDSP_FOUND=no fi @@ -29946,14 +31957,14 @@ # check for the header ast_ext_lib_check_saved_CPPFLAGS="${CPPFLAGS}" CPPFLAGS="${CPPFLAGS} ${SPANDSP_INCLUDE}" - ac_fn_c_check_header_mongrel "$LINENO" "spandsp.h" "ac_cv_header_spandsp_h" "$ac_includes_default" -if test "x$ac_cv_header_spandsp_h" = xyes; then : + ac_fn_c_check_header_compile "$LINENO" "spandsp.h" "ac_cv_header_spandsp_h" "$ac_includes_default" +if test "x$ac_cv_header_spandsp_h" = xyes +then : SPANDSP_HEADER_FOUND=1 -else +else $as_nop SPANDSP_HEADER_FOUND=0 fi - CPPFLAGS="${ast_ext_lib_check_saved_CPPFLAGS}" if test "x${SPANDSP_HEADER_FOUND}" = "x0" ; then @@ -29988,11 +31999,12 @@ ast_ext_lib_check_save_CFLAGS="${CFLAGS}" CFLAGS="${CFLAGS} " - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ss7_set_isup_timer in -lss7" >&5 -$as_echo_n "checking for ss7_set_isup_timer in -lss7... " >&6; } -if ${ac_cv_lib_ss7_ss7_set_isup_timer+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for ss7_set_isup_timer in -lss7" >&5 +printf %s "checking for ss7_set_isup_timer in -lss7... " >&6; } +if test ${ac_cv_lib_ss7_ss7_set_isup_timer+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lss7 ${pbxlibdir} $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -30001,32 +32013,31 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char ss7_set_isup_timer (); int -main () +main (void) { return ss7_set_isup_timer (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_ss7_ss7_set_isup_timer=yes -else +else $as_nop ac_cv_lib_ss7_ss7_set_isup_timer=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ss7_ss7_set_isup_timer" >&5 -$as_echo "$ac_cv_lib_ss7_ss7_set_isup_timer" >&6; } -if test "x$ac_cv_lib_ss7_ss7_set_isup_timer" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ss7_ss7_set_isup_timer" >&5 +printf "%s\n" "$ac_cv_lib_ss7_ss7_set_isup_timer" >&6; } +if test "x$ac_cv_lib_ss7_ss7_set_isup_timer" = xyes +then : AST_SS7_FOUND=yes -else +else $as_nop AST_SS7_FOUND=no fi @@ -30045,14 +32056,14 @@ # check for the header ast_ext_lib_check_saved_CPPFLAGS="${CPPFLAGS}" CPPFLAGS="${CPPFLAGS} ${SS7_INCLUDE}" - ac_fn_c_check_header_mongrel "$LINENO" "libss7.h" "ac_cv_header_libss7_h" "$ac_includes_default" -if test "x$ac_cv_header_libss7_h" = xyes; then : + ac_fn_c_check_header_compile "$LINENO" "libss7.h" "ac_cv_header_libss7_h" "$ac_includes_default" +if test "x$ac_cv_header_libss7_h" = xyes +then : SS7_HEADER_FOUND=1 -else +else $as_nop SS7_HEADER_FOUND=0 fi - CPPFLAGS="${ast_ext_lib_check_saved_CPPFLAGS}" if test "x${SS7_HEADER_FOUND}" = "x0" ; then @@ -30085,11 +32096,12 @@ ast_ext_lib_check_save_CFLAGS="${CFLAGS}" CFLAGS="${CFLAGS} " - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for openr2_chan_new in -lopenr2" >&5 -$as_echo_n "checking for openr2_chan_new in -lopenr2... " >&6; } -if ${ac_cv_lib_openr2_openr2_chan_new+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for openr2_chan_new in -lopenr2" >&5 +printf %s "checking for openr2_chan_new in -lopenr2... " >&6; } +if test ${ac_cv_lib_openr2_openr2_chan_new+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lopenr2 ${pbxlibdir} $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -30098,32 +32110,31 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char openr2_chan_new (); int -main () +main (void) { return openr2_chan_new (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_openr2_openr2_chan_new=yes -else +else $as_nop ac_cv_lib_openr2_openr2_chan_new=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_openr2_openr2_chan_new" >&5 -$as_echo "$ac_cv_lib_openr2_openr2_chan_new" >&6; } -if test "x$ac_cv_lib_openr2_openr2_chan_new" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_openr2_openr2_chan_new" >&5 +printf "%s\n" "$ac_cv_lib_openr2_openr2_chan_new" >&6; } +if test "x$ac_cv_lib_openr2_openr2_chan_new" = xyes +then : AST_OPENR2_FOUND=yes -else +else $as_nop AST_OPENR2_FOUND=no fi @@ -30142,14 +32153,14 @@ # check for the header ast_ext_lib_check_saved_CPPFLAGS="${CPPFLAGS}" CPPFLAGS="${CPPFLAGS} ${OPENR2_INCLUDE}" - ac_fn_c_check_header_mongrel "$LINENO" "openr2.h" "ac_cv_header_openr2_h" "$ac_includes_default" -if test "x$ac_cv_header_openr2_h" = xyes; then : + ac_fn_c_check_header_compile "$LINENO" "openr2.h" "ac_cv_header_openr2_h" "$ac_includes_default" +if test "x$ac_cv_header_openr2_h" = xyes +then : OPENR2_HEADER_FOUND=1 -else +else $as_nop OPENR2_HEADER_FOUND=0 fi - CPPFLAGS="${ast_ext_lib_check_saved_CPPFLAGS}" if test "x${OPENR2_HEADER_FOUND}" = "x0" ; then @@ -30182,11 +32193,12 @@ ast_ext_lib_check_save_CFLAGS="${CFLAGS}" CFLAGS="${CFLAGS} " - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for opus_encoder_create in -lopus" >&5 -$as_echo_n "checking for opus_encoder_create in -lopus... " >&6; } -if ${ac_cv_lib_opus_opus_encoder_create+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for opus_encoder_create in -lopus" >&5 +printf %s "checking for opus_encoder_create in -lopus... " >&6; } +if test ${ac_cv_lib_opus_opus_encoder_create+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lopus ${pbxlibdir} $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -30195,32 +32207,31 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char opus_encoder_create (); int -main () +main (void) { return opus_encoder_create (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_opus_opus_encoder_create=yes -else +else $as_nop ac_cv_lib_opus_opus_encoder_create=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_opus_opus_encoder_create" >&5 -$as_echo "$ac_cv_lib_opus_opus_encoder_create" >&6; } -if test "x$ac_cv_lib_opus_opus_encoder_create" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_opus_opus_encoder_create" >&5 +printf "%s\n" "$ac_cv_lib_opus_opus_encoder_create" >&6; } +if test "x$ac_cv_lib_opus_opus_encoder_create" = xyes +then : AST_OPUS_FOUND=yes -else +else $as_nop AST_OPUS_FOUND=no fi @@ -30239,14 +32250,14 @@ # check for the header ast_ext_lib_check_saved_CPPFLAGS="${CPPFLAGS}" CPPFLAGS="${CPPFLAGS} ${OPUS_INCLUDE}" - ac_fn_c_check_header_mongrel "$LINENO" "opus/opus.h" "ac_cv_header_opus_opus_h" "$ac_includes_default" -if test "x$ac_cv_header_opus_opus_h" = xyes; then : + ac_fn_c_check_header_compile "$LINENO" "opus/opus.h" "ac_cv_header_opus_opus_h" "$ac_includes_default" +if test "x$ac_cv_header_opus_opus_h" = xyes +then : OPUS_HEADER_FOUND=1 -else +else $as_nop OPUS_HEADER_FOUND=0 fi - CPPFLAGS="${ast_ext_lib_check_saved_CPPFLAGS}" if test "x${OPUS_HEADER_FOUND}" = "x0" ; then @@ -30284,11 +32295,12 @@ ast_ext_lib_check_save_CFLAGS="${CFLAGS}" CFLAGS="${CFLAGS} $__opus_include" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for op_open_callbacks in -lopusfile" >&5 -$as_echo_n "checking for op_open_callbacks in -lopusfile... " >&6; } -if ${ac_cv_lib_opusfile_op_open_callbacks+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for op_open_callbacks in -lopusfile" >&5 +printf %s "checking for op_open_callbacks in -lopusfile... " >&6; } +if test ${ac_cv_lib_opusfile_op_open_callbacks+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lopusfile ${pbxlibdir} $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -30297,32 +32309,31 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char op_open_callbacks (); int -main () +main (void) { return op_open_callbacks (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_opusfile_op_open_callbacks=yes -else +else $as_nop ac_cv_lib_opusfile_op_open_callbacks=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_opusfile_op_open_callbacks" >&5 -$as_echo "$ac_cv_lib_opusfile_op_open_callbacks" >&6; } -if test "x$ac_cv_lib_opusfile_op_open_callbacks" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_opusfile_op_open_callbacks" >&5 +printf "%s\n" "$ac_cv_lib_opusfile_op_open_callbacks" >&6; } +if test "x$ac_cv_lib_opusfile_op_open_callbacks" = xyes +then : AST_OPUSFILE_FOUND=yes -else +else $as_nop AST_OPUSFILE_FOUND=no fi @@ -30341,14 +32352,14 @@ # check for the header ast_ext_lib_check_saved_CPPFLAGS="${CPPFLAGS}" CPPFLAGS="${CPPFLAGS} ${OPUSFILE_INCLUDE}" - ac_fn_c_check_header_mongrel "$LINENO" "opus/opusfile.h" "ac_cv_header_opus_opusfile_h" "$ac_includes_default" -if test "x$ac_cv_header_opus_opusfile_h" = xyes; then : + ac_fn_c_check_header_compile "$LINENO" "opus/opusfile.h" "ac_cv_header_opus_opusfile_h" "$ac_includes_default" +if test "x$ac_cv_header_opus_opusfile_h" = xyes +then : OPUSFILE_HEADER_FOUND=1 -else +else $as_nop OPUSFILE_HEADER_FOUND=0 fi - CPPFLAGS="${ast_ext_lib_check_saved_CPPFLAGS}" if test "x${OPUSFILE_HEADER_FOUND}" = "x0" ; then @@ -30382,12 +32393,13 @@ ast_ext_lib_check_save_CFLAGS="${CFLAGS}" CFLAGS="${CFLAGS} " - as_ac_Lib=`$as_echo "ac_cv_lib_lua${ver}''_luaL_newstate" | $as_tr_sh` -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for luaL_newstate in -llua${ver}" >&5 -$as_echo_n "checking for luaL_newstate in -llua${ver}... " >&6; } -if eval \${$as_ac_Lib+:} false; then : - $as_echo_n "(cached) " >&6 -else + as_ac_Lib=`printf "%s\n" "ac_cv_lib_lua${ver}""_luaL_newstate" | $as_tr_sh` +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for luaL_newstate in -llua${ver}" >&5 +printf %s "checking for luaL_newstate in -llua${ver}... " >&6; } +if eval test \${$as_ac_Lib+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-llua${ver} ${pbxlibdir} -lm $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -30396,33 +32408,32 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char luaL_newstate (); int -main () +main (void) { return luaL_newstate (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : eval "$as_ac_Lib=yes" -else +else $as_nop eval "$as_ac_Lib=no" fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi eval ac_res=\$$as_ac_Lib - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if eval test \"x\$"$as_ac_Lib"\" = x"yes"; then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } +if eval test \"x\$"$as_ac_Lib"\" = x"yes" +then : AST_LUA_FOUND=yes -else +else $as_nop AST_LUA_FOUND=no fi @@ -30441,15 +32452,15 @@ # check for the header ast_ext_lib_check_saved_CPPFLAGS="${CPPFLAGS}" CPPFLAGS="${CPPFLAGS} ${LUA_INCLUDE}" - as_ac_Header=`$as_echo "ac_cv_header_lua${ver}/lua.h" | $as_tr_sh` -ac_fn_c_check_header_mongrel "$LINENO" "lua${ver}/lua.h" "$as_ac_Header" "$ac_includes_default" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + as_ac_Header=`printf "%s\n" "ac_cv_header_lua${ver}/lua.h" | $as_tr_sh` +ac_fn_c_check_header_compile "$LINENO" "lua${ver}/lua.h" "$as_ac_Header" "$ac_includes_default" +if eval test \"x\$"$as_ac_Header"\" = x"yes" +then : LUA_HEADER_FOUND=1 -else +else $as_nop LUA_HEADER_FOUND=0 fi - CPPFLAGS="${ast_ext_lib_check_saved_CPPFLAGS}" if test "x${LUA_HEADER_FOUND}" = "x0" ; then @@ -30493,11 +32504,12 @@ ast_ext_lib_check_save_CFLAGS="${CFLAGS}" CFLAGS="${CFLAGS} " - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for luaL_newstate in -llua" >&5 -$as_echo_n "checking for luaL_newstate in -llua... " >&6; } -if ${ac_cv_lib_lua_luaL_newstate+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for luaL_newstate in -llua" >&5 +printf %s "checking for luaL_newstate in -llua... " >&6; } +if test ${ac_cv_lib_lua_luaL_newstate+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-llua ${pbxlibdir} -lm $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -30506,32 +32518,31 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char luaL_newstate (); int -main () +main (void) { return luaL_newstate (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_lua_luaL_newstate=yes -else +else $as_nop ac_cv_lib_lua_luaL_newstate=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_lua_luaL_newstate" >&5 -$as_echo "$ac_cv_lib_lua_luaL_newstate" >&6; } -if test "x$ac_cv_lib_lua_luaL_newstate" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_lua_luaL_newstate" >&5 +printf "%s\n" "$ac_cv_lib_lua_luaL_newstate" >&6; } +if test "x$ac_cv_lib_lua_luaL_newstate" = xyes +then : AST_LUA_FOUND=yes -else +else $as_nop AST_LUA_FOUND=no fi @@ -30550,14 +32561,14 @@ # check for the header ast_ext_lib_check_saved_CPPFLAGS="${CPPFLAGS}" CPPFLAGS="${CPPFLAGS} ${LUA_INCLUDE}" - ac_fn_c_check_header_mongrel "$LINENO" "lua.h" "ac_cv_header_lua_h" "$ac_includes_default" -if test "x$ac_cv_header_lua_h" = xyes; then : + ac_fn_c_check_header_compile "$LINENO" "lua.h" "ac_cv_header_lua_h" "$ac_includes_default" +if test "x$ac_cv_header_lua_h" = xyes +then : LUA_HEADER_FOUND=1 -else +else $as_nop LUA_HEADER_FOUND=0 fi - CPPFLAGS="${ast_ext_lib_check_saved_CPPFLAGS}" if test "x${LUA_HEADER_FOUND}" = "x0" ; then @@ -30593,11 +32604,12 @@ ast_ext_lib_check_save_CFLAGS="${CFLAGS}" CFLAGS="${CFLAGS} " - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for rc_read_config in -lfreeradius-client" >&5 -$as_echo_n "checking for rc_read_config in -lfreeradius-client... " >&6; } -if ${ac_cv_lib_freeradius_client_rc_read_config+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for rc_read_config in -lfreeradius-client" >&5 +printf %s "checking for rc_read_config in -lfreeradius-client... " >&6; } +if test ${ac_cv_lib_freeradius_client_rc_read_config+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lfreeradius-client ${pbxlibdir} $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -30606,32 +32618,31 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char rc_read_config (); int -main () +main (void) { return rc_read_config (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_freeradius_client_rc_read_config=yes -else +else $as_nop ac_cv_lib_freeradius_client_rc_read_config=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_freeradius_client_rc_read_config" >&5 -$as_echo "$ac_cv_lib_freeradius_client_rc_read_config" >&6; } -if test "x$ac_cv_lib_freeradius_client_rc_read_config" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_freeradius_client_rc_read_config" >&5 +printf "%s\n" "$ac_cv_lib_freeradius_client_rc_read_config" >&6; } +if test "x$ac_cv_lib_freeradius_client_rc_read_config" = xyes +then : AST_RADIUS_FOUND=yes -else +else $as_nop AST_RADIUS_FOUND=no fi @@ -30650,14 +32661,14 @@ # check for the header ast_ext_lib_check_saved_CPPFLAGS="${CPPFLAGS}" CPPFLAGS="${CPPFLAGS} ${RADIUS_INCLUDE}" - ac_fn_c_check_header_mongrel "$LINENO" "freeradius-client.h" "ac_cv_header_freeradius_client_h" "$ac_includes_default" -if test "x$ac_cv_header_freeradius_client_h" = xyes; then : + ac_fn_c_check_header_compile "$LINENO" "freeradius-client.h" "ac_cv_header_freeradius_client_h" "$ac_includes_default" +if test "x$ac_cv_header_freeradius_client_h" = xyes +then : RADIUS_HEADER_FOUND=1 -else +else $as_nop RADIUS_HEADER_FOUND=0 fi - CPPFLAGS="${ast_ext_lib_check_saved_CPPFLAGS}" if test "x${RADIUS_HEADER_FOUND}" = "x0" ; then @@ -30677,7 +32688,7 @@ if test "x${PBX_RADIUS}" = "x1"; then -$as_echo "#define RADIUS_HEADER_STR " >>confdefs.h +printf "%s\n" "#define RADIUS_HEADER_STR " >>confdefs.h else @@ -30694,11 +32705,12 @@ ast_ext_lib_check_save_CFLAGS="${CFLAGS}" CFLAGS="${CFLAGS} " - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for rc_read_config in -lradiusclient-ng" >&5 -$as_echo_n "checking for rc_read_config in -lradiusclient-ng... " >&6; } -if ${ac_cv_lib_radiusclient_ng_rc_read_config+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for rc_read_config in -lradiusclient-ng" >&5 +printf %s "checking for rc_read_config in -lradiusclient-ng... " >&6; } +if test ${ac_cv_lib_radiusclient_ng_rc_read_config+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lradiusclient-ng ${pbxlibdir} $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -30707,32 +32719,31 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char rc_read_config (); int -main () +main (void) { return rc_read_config (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_radiusclient_ng_rc_read_config=yes -else +else $as_nop ac_cv_lib_radiusclient_ng_rc_read_config=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_radiusclient_ng_rc_read_config" >&5 -$as_echo "$ac_cv_lib_radiusclient_ng_rc_read_config" >&6; } -if test "x$ac_cv_lib_radiusclient_ng_rc_read_config" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_radiusclient_ng_rc_read_config" >&5 +printf "%s\n" "$ac_cv_lib_radiusclient_ng_rc_read_config" >&6; } +if test "x$ac_cv_lib_radiusclient_ng_rc_read_config" = xyes +then : AST_RADIUS_FOUND=yes -else +else $as_nop AST_RADIUS_FOUND=no fi @@ -30751,14 +32762,14 @@ # check for the header ast_ext_lib_check_saved_CPPFLAGS="${CPPFLAGS}" CPPFLAGS="${CPPFLAGS} ${RADIUS_INCLUDE}" - ac_fn_c_check_header_mongrel "$LINENO" "radiusclient-ng.h" "ac_cv_header_radiusclient_ng_h" "$ac_includes_default" -if test "x$ac_cv_header_radiusclient_ng_h" = xyes; then : + ac_fn_c_check_header_compile "$LINENO" "radiusclient-ng.h" "ac_cv_header_radiusclient_ng_h" "$ac_includes_default" +if test "x$ac_cv_header_radiusclient_ng_h" = xyes +then : RADIUS_HEADER_FOUND=1 -else +else $as_nop RADIUS_HEADER_FOUND=0 fi - CPPFLAGS="${ast_ext_lib_check_saved_CPPFLAGS}" if test "x${RADIUS_HEADER_FOUND}" = "x0" ; then @@ -30778,7 +32789,7 @@ if test "x${PBX_RADIUS}" = "x1"; then -$as_echo "#define RADIUS_HEADER_STR " >>confdefs.h +printf "%s\n" "#define RADIUS_HEADER_STR " >>confdefs.h else @@ -30795,11 +32806,12 @@ ast_ext_lib_check_save_CFLAGS="${CFLAGS}" CFLAGS="${CFLAGS} " - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for rc_read_config in -lradcli" >&5 -$as_echo_n "checking for rc_read_config in -lradcli... " >&6; } -if ${ac_cv_lib_radcli_rc_read_config+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for rc_read_config in -lradcli" >&5 +printf %s "checking for rc_read_config in -lradcli... " >&6; } +if test ${ac_cv_lib_radcli_rc_read_config+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lradcli ${pbxlibdir} $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -30808,32 +32820,31 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char rc_read_config (); int -main () +main (void) { return rc_read_config (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_radcli_rc_read_config=yes -else +else $as_nop ac_cv_lib_radcli_rc_read_config=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_radcli_rc_read_config" >&5 -$as_echo "$ac_cv_lib_radcli_rc_read_config" >&6; } -if test "x$ac_cv_lib_radcli_rc_read_config" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_radcli_rc_read_config" >&5 +printf "%s\n" "$ac_cv_lib_radcli_rc_read_config" >&6; } +if test "x$ac_cv_lib_radcli_rc_read_config" = xyes +then : AST_RADIUS_FOUND=yes -else +else $as_nop AST_RADIUS_FOUND=no fi @@ -30852,14 +32863,14 @@ # check for the header ast_ext_lib_check_saved_CPPFLAGS="${CPPFLAGS}" CPPFLAGS="${CPPFLAGS} ${RADIUS_INCLUDE}" - ac_fn_c_check_header_mongrel "$LINENO" "radcli/radcli.h" "ac_cv_header_radcli_radcli_h" "$ac_includes_default" -if test "x$ac_cv_header_radcli_radcli_h" = xyes; then : + ac_fn_c_check_header_compile "$LINENO" "radcli/radcli.h" "ac_cv_header_radcli_radcli_h" "$ac_includes_default" +if test "x$ac_cv_header_radcli_radcli_h" = xyes +then : RADIUS_HEADER_FOUND=1 -else +else $as_nop RADIUS_HEADER_FOUND=0 fi - CPPFLAGS="${ast_ext_lib_check_saved_CPPFLAGS}" if test "x${RADIUS_HEADER_FOUND}" = "x0" ; then @@ -30879,7 +32890,7 @@ if test "x${PBX_RADIUS}" = "x1"; then -$as_echo "#define RADIUS_HEADER_STR " >>confdefs.h +printf "%s\n" "#define RADIUS_HEADER_STR " >>confdefs.h fi fi @@ -30899,11 +32910,12 @@ ast_ext_lib_check_save_CFLAGS="${CFLAGS}" CFLAGS="${CFLAGS} " - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for codec2_create in -lcodec2" >&5 -$as_echo_n "checking for codec2_create in -lcodec2... " >&6; } -if ${ac_cv_lib_codec2_codec2_create+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for codec2_create in -lcodec2" >&5 +printf %s "checking for codec2_create in -lcodec2... " >&6; } +if test ${ac_cv_lib_codec2_codec2_create+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcodec2 ${pbxlibdir} $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -30912,32 +32924,31 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char codec2_create (); int -main () +main (void) { return codec2_create (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_codec2_codec2_create=yes -else +else $as_nop ac_cv_lib_codec2_codec2_create=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_codec2_codec2_create" >&5 -$as_echo "$ac_cv_lib_codec2_codec2_create" >&6; } -if test "x$ac_cv_lib_codec2_codec2_create" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_codec2_codec2_create" >&5 +printf "%s\n" "$ac_cv_lib_codec2_codec2_create" >&6; } +if test "x$ac_cv_lib_codec2_codec2_create" = xyes +then : AST_CODEC2_FOUND=yes -else +else $as_nop AST_CODEC2_FOUND=no fi @@ -30956,14 +32967,14 @@ # check for the header ast_ext_lib_check_saved_CPPFLAGS="${CPPFLAGS}" CPPFLAGS="${CPPFLAGS} ${CODEC2_INCLUDE}" - ac_fn_c_check_header_mongrel "$LINENO" "codec2/codec2.h" "ac_cv_header_codec2_codec2_h" "$ac_includes_default" -if test "x$ac_cv_header_codec2_codec2_h" = xyes; then : + ac_fn_c_check_header_compile "$LINENO" "codec2/codec2.h" "ac_cv_header_codec2_codec2_h" "$ac_includes_default" +if test "x$ac_cv_header_codec2_codec2_h" = xyes +then : CODEC2_HEADER_FOUND=1 -else +else $as_nop CODEC2_HEADER_FOUND=0 fi - CPPFLAGS="${ast_ext_lib_check_saved_CPPFLAGS}" if test "x${CODEC2_HEADER_FOUND}" = "x0" ; then @@ -30996,11 +33007,12 @@ ast_ext_lib_check_save_CFLAGS="${CFLAGS}" CFLAGS="${CFLAGS} " - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for cpg_join in -lcpg" >&5 -$as_echo_n "checking for cpg_join in -lcpg... " >&6; } -if ${ac_cv_lib_cpg_cpg_join+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for cpg_join in -lcpg" >&5 +printf %s "checking for cpg_join in -lcpg... " >&6; } +if test ${ac_cv_lib_cpg_cpg_join+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcpg ${pbxlibdir} -lcpg -lcfg $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -31009,32 +33021,31 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char cpg_join (); int -main () +main (void) { return cpg_join (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_cpg_cpg_join=yes -else +else $as_nop ac_cv_lib_cpg_cpg_join=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cpg_cpg_join" >&5 -$as_echo "$ac_cv_lib_cpg_cpg_join" >&6; } -if test "x$ac_cv_lib_cpg_cpg_join" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cpg_cpg_join" >&5 +printf "%s\n" "$ac_cv_lib_cpg_cpg_join" >&6; } +if test "x$ac_cv_lib_cpg_cpg_join" = xyes +then : AST_COROSYNC_FOUND=yes -else +else $as_nop AST_COROSYNC_FOUND=no fi @@ -31053,14 +33064,14 @@ # check for the header ast_ext_lib_check_saved_CPPFLAGS="${CPPFLAGS}" CPPFLAGS="${CPPFLAGS} ${COROSYNC_INCLUDE}" - ac_fn_c_check_header_mongrel "$LINENO" "corosync/cpg.h" "ac_cv_header_corosync_cpg_h" "$ac_includes_default" -if test "x$ac_cv_header_corosync_cpg_h" = xyes; then : + ac_fn_c_check_header_compile "$LINENO" "corosync/cpg.h" "ac_cv_header_corosync_cpg_h" "$ac_includes_default" +if test "x$ac_cv_header_corosync_cpg_h" = xyes +then : COROSYNC_HEADER_FOUND=1 -else +else $as_nop COROSYNC_HEADER_FOUND=0 fi - CPPFLAGS="${ast_ext_lib_check_saved_CPPFLAGS}" if test "x${COROSYNC_HEADER_FOUND}" = "x0" ; then @@ -31092,11 +33103,12 @@ ast_ext_lib_check_save_CFLAGS="${CFLAGS}" CFLAGS="${CFLAGS} " - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for corosync_cfg_state_track in -lcfg" >&5 -$as_echo_n "checking for corosync_cfg_state_track in -lcfg... " >&6; } -if ${ac_cv_lib_cfg_corosync_cfg_state_track+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for corosync_cfg_state_track in -lcfg" >&5 +printf %s "checking for corosync_cfg_state_track in -lcfg... " >&6; } +if test ${ac_cv_lib_cfg_corosync_cfg_state_track+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcfg ${pbxlibdir} -lcfg $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -31105,32 +33117,31 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char corosync_cfg_state_track (); int -main () +main (void) { return corosync_cfg_state_track (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_cfg_corosync_cfg_state_track=yes -else +else $as_nop ac_cv_lib_cfg_corosync_cfg_state_track=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cfg_corosync_cfg_state_track" >&5 -$as_echo "$ac_cv_lib_cfg_corosync_cfg_state_track" >&6; } -if test "x$ac_cv_lib_cfg_corosync_cfg_state_track" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cfg_corosync_cfg_state_track" >&5 +printf "%s\n" "$ac_cv_lib_cfg_corosync_cfg_state_track" >&6; } +if test "x$ac_cv_lib_cfg_corosync_cfg_state_track" = xyes +then : AST_COROSYNC_CFG_STATE_TRACK_FOUND=yes -else +else $as_nop AST_COROSYNC_CFG_STATE_TRACK_FOUND=no fi @@ -31149,14 +33160,14 @@ # check for the header ast_ext_lib_check_saved_CPPFLAGS="${CPPFLAGS}" CPPFLAGS="${CPPFLAGS} ${COROSYNC_CFG_STATE_TRACK_INCLUDE}" - ac_fn_c_check_header_mongrel "$LINENO" "corosync/cfg.h" "ac_cv_header_corosync_cfg_h" "$ac_includes_default" -if test "x$ac_cv_header_corosync_cfg_h" = xyes; then : + ac_fn_c_check_header_compile "$LINENO" "corosync/cfg.h" "ac_cv_header_corosync_cfg_h" "$ac_includes_default" +if test "x$ac_cv_header_corosync_cfg_h" = xyes +then : COROSYNC_CFG_STATE_TRACK_HEADER_FOUND=1 -else +else $as_nop COROSYNC_CFG_STATE_TRACK_HEADER_FOUND=0 fi - CPPFLAGS="${ast_ext_lib_check_saved_CPPFLAGS}" if test "x${COROSYNC_CFG_STATE_TRACK_HEADER_FOUND}" = "x0" ; then @@ -31189,11 +33200,12 @@ ast_ext_lib_check_save_CFLAGS="${CFLAGS}" CFLAGS="${CFLAGS} " - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for speex_encode in -lspeex" >&5 -$as_echo_n "checking for speex_encode in -lspeex... " >&6; } -if ${ac_cv_lib_speex_speex_encode+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for speex_encode in -lspeex" >&5 +printf %s "checking for speex_encode in -lspeex... " >&6; } +if test ${ac_cv_lib_speex_speex_encode+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lspeex ${pbxlibdir} -lm $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -31202,32 +33214,31 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char speex_encode (); int -main () +main (void) { return speex_encode (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_speex_speex_encode=yes -else +else $as_nop ac_cv_lib_speex_speex_encode=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_speex_speex_encode" >&5 -$as_echo "$ac_cv_lib_speex_speex_encode" >&6; } -if test "x$ac_cv_lib_speex_speex_encode" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_speex_speex_encode" >&5 +printf "%s\n" "$ac_cv_lib_speex_speex_encode" >&6; } +if test "x$ac_cv_lib_speex_speex_encode" = xyes +then : AST_SPEEX_FOUND=yes -else +else $as_nop AST_SPEEX_FOUND=no fi @@ -31246,14 +33257,14 @@ # check for the header ast_ext_lib_check_saved_CPPFLAGS="${CPPFLAGS}" CPPFLAGS="${CPPFLAGS} ${SPEEX_INCLUDE}" - ac_fn_c_check_header_mongrel "$LINENO" "speex/speex.h" "ac_cv_header_speex_speex_h" "$ac_includes_default" -if test "x$ac_cv_header_speex_speex_h" = xyes; then : + ac_fn_c_check_header_compile "$LINENO" "speex/speex.h" "ac_cv_header_speex_speex_h" "$ac_includes_default" +if test "x$ac_cv_header_speex_speex_h" = xyes +then : SPEEX_HEADER_FOUND=1 -else +else $as_nop SPEEX_HEADER_FOUND=0 fi - CPPFLAGS="${ast_ext_lib_check_saved_CPPFLAGS}" if test "x${SPEEX_HEADER_FOUND}" = "x0" ; then @@ -31287,11 +33298,12 @@ ast_ext_lib_check_save_CFLAGS="${CFLAGS}" CFLAGS="${CFLAGS} " - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for speex_preprocess_ctl in -lspeex" >&5 -$as_echo_n "checking for speex_preprocess_ctl in -lspeex... " >&6; } -if ${ac_cv_lib_speex_speex_preprocess_ctl+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for speex_preprocess_ctl in -lspeex" >&5 +printf %s "checking for speex_preprocess_ctl in -lspeex... " >&6; } +if test ${ac_cv_lib_speex_speex_preprocess_ctl+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lspeex ${pbxlibdir} -lm $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -31300,32 +33312,31 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char speex_preprocess_ctl (); int -main () +main (void) { return speex_preprocess_ctl (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_speex_speex_preprocess_ctl=yes -else +else $as_nop ac_cv_lib_speex_speex_preprocess_ctl=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_speex_speex_preprocess_ctl" >&5 -$as_echo "$ac_cv_lib_speex_speex_preprocess_ctl" >&6; } -if test "x$ac_cv_lib_speex_speex_preprocess_ctl" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_speex_speex_preprocess_ctl" >&5 +printf "%s\n" "$ac_cv_lib_speex_speex_preprocess_ctl" >&6; } +if test "x$ac_cv_lib_speex_speex_preprocess_ctl" = xyes +then : AST_SPEEX_PREPROCESS_FOUND=yes -else +else $as_nop AST_SPEEX_PREPROCESS_FOUND=no fi @@ -31344,14 +33355,14 @@ # check for the header ast_ext_lib_check_saved_CPPFLAGS="${CPPFLAGS}" CPPFLAGS="${CPPFLAGS} ${SPEEX_PREPROCESS_INCLUDE}" - ac_fn_c_check_header_mongrel "$LINENO" "speex/speex.h" "ac_cv_header_speex_speex_h" "$ac_includes_default" -if test "x$ac_cv_header_speex_speex_h" = xyes; then : + ac_fn_c_check_header_compile "$LINENO" "speex/speex.h" "ac_cv_header_speex_speex_h" "$ac_includes_default" +if test "x$ac_cv_header_speex_speex_h" = xyes +then : SPEEX_PREPROCESS_HEADER_FOUND=1 -else +else $as_nop SPEEX_PREPROCESS_HEADER_FOUND=0 fi - CPPFLAGS="${ast_ext_lib_check_saved_CPPFLAGS}" if test "x${SPEEX_PREPROCESS_HEADER_FOUND}" = "x0" ; then @@ -31387,11 +33398,12 @@ ast_ext_lib_check_save_CFLAGS="${CFLAGS}" CFLAGS="${CFLAGS} " - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for speex_preprocess_ctl in -lspeexdsp" >&5 -$as_echo_n "checking for speex_preprocess_ctl in -lspeexdsp... " >&6; } -if ${ac_cv_lib_speexdsp_speex_preprocess_ctl+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for speex_preprocess_ctl in -lspeexdsp" >&5 +printf %s "checking for speex_preprocess_ctl in -lspeexdsp... " >&6; } +if test ${ac_cv_lib_speexdsp_speex_preprocess_ctl+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lspeexdsp ${pbxlibdir} -lm $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -31400,32 +33412,31 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char speex_preprocess_ctl (); int -main () +main (void) { return speex_preprocess_ctl (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_speexdsp_speex_preprocess_ctl=yes -else +else $as_nop ac_cv_lib_speexdsp_speex_preprocess_ctl=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_speexdsp_speex_preprocess_ctl" >&5 -$as_echo "$ac_cv_lib_speexdsp_speex_preprocess_ctl" >&6; } -if test "x$ac_cv_lib_speexdsp_speex_preprocess_ctl" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_speexdsp_speex_preprocess_ctl" >&5 +printf "%s\n" "$ac_cv_lib_speexdsp_speex_preprocess_ctl" >&6; } +if test "x$ac_cv_lib_speexdsp_speex_preprocess_ctl" = xyes +then : AST_SPEEXDSP_FOUND=yes -else +else $as_nop AST_SPEEXDSP_FOUND=no fi @@ -31444,14 +33455,14 @@ # check for the header ast_ext_lib_check_saved_CPPFLAGS="${CPPFLAGS}" CPPFLAGS="${CPPFLAGS} ${SPEEXDSP_INCLUDE}" - ac_fn_c_check_header_mongrel "$LINENO" "speex/speex.h" "ac_cv_header_speex_speex_h" "$ac_includes_default" -if test "x$ac_cv_header_speex_speex_h" = xyes; then : + ac_fn_c_check_header_compile "$LINENO" "speex/speex.h" "ac_cv_header_speex_speex_h" "$ac_includes_default" +if test "x$ac_cv_header_speex_speex_h" = xyes +then : SPEEXDSP_HEADER_FOUND=1 -else +else $as_nop SPEEXDSP_HEADER_FOUND=0 fi - CPPFLAGS="${ast_ext_lib_check_saved_CPPFLAGS}" if test "x${SPEEXDSP_HEADER_FOUND}" = "x0" ; then @@ -31489,11 +33500,12 @@ ast_ext_lib_check_save_CFLAGS="${CFLAGS}" CFLAGS="${CFLAGS} " - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sqlite_exec in -lsqlite" >&5 -$as_echo_n "checking for sqlite_exec in -lsqlite... " >&6; } -if ${ac_cv_lib_sqlite_sqlite_exec+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for sqlite_exec in -lsqlite" >&5 +printf %s "checking for sqlite_exec in -lsqlite... " >&6; } +if test ${ac_cv_lib_sqlite_sqlite_exec+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lsqlite ${pbxlibdir} $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -31502,32 +33514,31 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char sqlite_exec (); int -main () +main (void) { return sqlite_exec (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_sqlite_sqlite_exec=yes -else +else $as_nop ac_cv_lib_sqlite_sqlite_exec=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_sqlite_sqlite_exec" >&5 -$as_echo "$ac_cv_lib_sqlite_sqlite_exec" >&6; } -if test "x$ac_cv_lib_sqlite_sqlite_exec" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_sqlite_sqlite_exec" >&5 +printf "%s\n" "$ac_cv_lib_sqlite_sqlite_exec" >&6; } +if test "x$ac_cv_lib_sqlite_sqlite_exec" = xyes +then : AST_SQLITE_FOUND=yes -else +else $as_nop AST_SQLITE_FOUND=no fi @@ -31546,14 +33557,14 @@ # check for the header ast_ext_lib_check_saved_CPPFLAGS="${CPPFLAGS}" CPPFLAGS="${CPPFLAGS} ${SQLITE_INCLUDE}" - ac_fn_c_check_header_mongrel "$LINENO" "sqlite.h" "ac_cv_header_sqlite_h" "$ac_includes_default" -if test "x$ac_cv_header_sqlite_h" = xyes; then : + ac_fn_c_check_header_compile "$LINENO" "sqlite.h" "ac_cv_header_sqlite_h" "$ac_includes_default" +if test "x$ac_cv_header_sqlite_h" = xyes +then : SQLITE_HEADER_FOUND=1 -else +else $as_nop SQLITE_HEADER_FOUND=0 fi - CPPFLAGS="${ast_ext_lib_check_saved_CPPFLAGS}" if test "x${SQLITE_HEADER_FOUND}" = "x0" ; then @@ -31586,11 +33597,12 @@ ast_ext_lib_check_save_CFLAGS="${CFLAGS}" CFLAGS="${CFLAGS} ${PTHREAD_CFLAGS}" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sqlite3_open in -lsqlite3" >&5 -$as_echo_n "checking for sqlite3_open in -lsqlite3... " >&6; } -if ${ac_cv_lib_sqlite3_sqlite3_open+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for sqlite3_open in -lsqlite3" >&5 +printf %s "checking for sqlite3_open in -lsqlite3... " >&6; } +if test ${ac_cv_lib_sqlite3_sqlite3_open+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lsqlite3 ${pbxlibdir} ${PTHREAD_LIBS} $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -31599,32 +33611,31 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char sqlite3_open (); int -main () +main (void) { return sqlite3_open (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_sqlite3_sqlite3_open=yes -else +else $as_nop ac_cv_lib_sqlite3_sqlite3_open=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_sqlite3_sqlite3_open" >&5 -$as_echo "$ac_cv_lib_sqlite3_sqlite3_open" >&6; } -if test "x$ac_cv_lib_sqlite3_sqlite3_open" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_sqlite3_sqlite3_open" >&5 +printf "%s\n" "$ac_cv_lib_sqlite3_sqlite3_open" >&6; } +if test "x$ac_cv_lib_sqlite3_sqlite3_open" = xyes +then : AST_SQLITE3_FOUND=yes -else +else $as_nop AST_SQLITE3_FOUND=no fi @@ -31643,14 +33654,14 @@ # check for the header ast_ext_lib_check_saved_CPPFLAGS="${CPPFLAGS}" CPPFLAGS="${CPPFLAGS} ${SQLITE3_INCLUDE}" - ac_fn_c_check_header_mongrel "$LINENO" "sqlite3.h" "ac_cv_header_sqlite3_h" "$ac_includes_default" -if test "x$ac_cv_header_sqlite3_h" = xyes; then : + ac_fn_c_check_header_compile "$LINENO" "sqlite3.h" "ac_cv_header_sqlite3_h" "$ac_includes_default" +if test "x$ac_cv_header_sqlite3_h" = xyes +then : SQLITE3_HEADER_FOUND=1 -else +else $as_nop SQLITE3_HEADER_FOUND=0 fi - CPPFLAGS="${ast_ext_lib_check_saved_CPPFLAGS}" if test "x${SQLITE3_HEADER_FOUND}" = "x0" ; then @@ -31692,11 +33703,12 @@ ast_ext_lib_check_save_CFLAGS="${CFLAGS}" CFLAGS="${CFLAGS} " - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for crypt in -lcrypt" >&5 -$as_echo_n "checking for crypt in -lcrypt... " >&6; } -if ${ac_cv_lib_crypt_crypt+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for crypt in -lcrypt" >&5 +printf %s "checking for crypt in -lcrypt... " >&6; } +if test ${ac_cv_lib_crypt_crypt+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcrypt ${pbxlibdir} $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -31705,32 +33717,31 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char crypt (); int -main () +main (void) { return crypt (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_crypt_crypt=yes -else +else $as_nop ac_cv_lib_crypt_crypt=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypt_crypt" >&5 -$as_echo "$ac_cv_lib_crypt_crypt" >&6; } -if test "x$ac_cv_lib_crypt_crypt" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypt_crypt" >&5 +printf "%s\n" "$ac_cv_lib_crypt_crypt" >&6; } +if test "x$ac_cv_lib_crypt_crypt" = xyes +then : AST_LIBCRYPT_FOUND=yes -else +else $as_nop AST_LIBCRYPT_FOUND=no fi @@ -31749,14 +33760,14 @@ # check for the header ast_ext_lib_check_saved_CPPFLAGS="${CPPFLAGS}" CPPFLAGS="${CPPFLAGS} ${LIBCRYPT_INCLUDE}" - ac_fn_c_check_header_mongrel "$LINENO" "crypt.h" "ac_cv_header_crypt_h" "$ac_includes_default" -if test "x$ac_cv_header_crypt_h" = xyes; then : + ac_fn_c_check_header_compile "$LINENO" "crypt.h" "ac_cv_header_crypt_h" "$ac_includes_default" +if test "x$ac_cv_header_crypt_h" = xyes +then : LIBCRYPT_HEADER_FOUND=1 -else +else $as_nop LIBCRYPT_HEADER_FOUND=0 fi - CPPFLAGS="${ast_ext_lib_check_saved_CPPFLAGS}" if test "x${LIBCRYPT_HEADER_FOUND}" = "x0" ; then @@ -31775,9 +33786,10 @@ ac_fn_c_check_func "$LINENO" "crypt" "ac_cv_func_crypt" -if test "x$ac_cv_func_crypt" = xyes; then : +if test "x$ac_cv_func_crypt" = xyes +then : SYSCRYPT=true -else +else $as_nop SYSCRYPT="" fi @@ -31786,13 +33798,13 @@ CRYPT_LIB="$LIBCRYPT_LIB" CRYPT_INCLUDE="$LIBCRYPT_INCLUDE" -$as_echo "#define HAVE_CRYPT 1" >>confdefs.h +printf "%s\n" "#define HAVE_CRYPT 1" >>confdefs.h elif test "x$SYSCRYPT" != "x" ; then CRYPT_LIB="" CRYPT_INCLUDE="" -$as_echo "#define HAVE_CRYPT 1" >>confdefs.h +printf "%s\n" "#define HAVE_CRYPT 1" >>confdefs.h fi @@ -31800,11 +33812,12 @@ # Find crypt_r support -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for crypt_r in -lcrypt" >&5 -$as_echo_n "checking for crypt_r in -lcrypt... " >&6; } -if ${ac_cv_lib_crypt_crypt_r+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for crypt_r in -lcrypt" >&5 +printf %s "checking for crypt_r in -lcrypt... " >&6; } +if test ${ac_cv_lib_crypt_crypt_r+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcrypt $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -31813,32 +33826,31 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char crypt_r (); int -main () +main (void) { return crypt_r (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_crypt_crypt_r=yes -else +else $as_nop ac_cv_lib_crypt_crypt_r=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypt_crypt_r" >&5 -$as_echo "$ac_cv_lib_crypt_crypt_r" >&6; } -if test "x$ac_cv_lib_crypt_crypt_r" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypt_crypt_r" >&5 +printf "%s\n" "$ac_cv_lib_crypt_crypt_r" >&6; } +if test "x$ac_cv_lib_crypt_crypt_r" = xyes +then : -$as_echo "#define HAVE_CRYPT_R 1" >>confdefs.h +printf "%s\n" "#define HAVE_CRYPT_R 1" >>confdefs.h fi @@ -31860,25 +33872,26 @@ # check for the header osptk_saved_cppflags="${CPPFLAGS}" CPPFLAGS="${CPPFLAGS} ${osptk_cflags}" - ac_fn_c_check_header_mongrel "$LINENO" "osp/osp.h" "ac_cv_header_osp_osp_h" "$ac_includes_default" -if test "x$ac_cv_header_osp_osp_h" = xyes; then : + ac_fn_c_check_header_compile "$LINENO" "osp/osp.h" "ac_cv_header_osp_osp_h" "$ac_includes_default" +if test "x$ac_cv_header_osp_osp_h" = xyes +then : osptk_header_found=yes -else +else $as_nop osptk_header_found=no fi - CPPFLAGS="${osptk_saved_cppflags}" # check for the library if test "${osptk_header_found}" = "yes"; then osptk_extralibs="-lssl -lcrypto" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for OSPPInit in -losptk" >&5 -$as_echo_n "checking for OSPPInit in -losptk... " >&6; } -if ${ac_cv_lib_osptk_OSPPInit+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for OSPPInit in -losptk" >&5 +printf %s "checking for OSPPInit in -losptk... " >&6; } +if test ${ac_cv_lib_osptk_OSPPInit+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-losptk ${osptk_ldflags} ${osptk_extralibs} $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -31887,49 +33900,49 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char OSPPInit (); int -main () +main (void) { return OSPPInit (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_osptk_OSPPInit=yes -else +else $as_nop ac_cv_lib_osptk_OSPPInit=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_osptk_OSPPInit" >&5 -$as_echo "$ac_cv_lib_osptk_OSPPInit" >&6; } -if test "x$ac_cv_lib_osptk_OSPPInit" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_osptk_OSPPInit" >&5 +printf "%s\n" "$ac_cv_lib_osptk_OSPPInit" >&6; } +if test "x$ac_cv_lib_osptk_OSPPInit" = xyes +then : osptk_library_found=yes -else +else $as_nop osptk_library_found=no fi # check OSP Toolkit version if test "${osptk_library_found}" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if OSP Toolkit version is compatible with app_osplookup" >&5 -$as_echo_n "checking if OSP Toolkit version is compatible with app_osplookup... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if OSP Toolkit version is compatible with app_osplookup" >&5 +printf %s "checking if OSP Toolkit version is compatible with app_osplookup... " >&6; } osptk_saved_cppflags="${CPPFLAGS}" CPPFLAGS="${CPPFLAGS} ${osptk_cflags}" - if test "$cross_compiling" = yes; then : - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + if test "$cross_compiling" = yes +then : + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot run test program while cross compiling See \`config.log' for more details" "$LINENO" 5; } -else +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -31941,9 +33954,10 @@ } _ACEOF -if ac_fn_c_try_run "$LINENO"; then : +if ac_fn_c_try_run "$LINENO" +then : osptk_compatible=yes -else +else $as_nop osptk_compatible=no fi @@ -31954,19 +33968,17 @@ CPPFLAGS="${osptk_saved_cppflags}" if test "${osptk_compatible}" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } PBX_OSPTK=1 OSPTK_INCLUDE="${osptk_cflags}" OSPTK_LIB="${osptk_ldflags} -losptk ${osptk_extralibs}" -cat >>confdefs.h <<_ACEOF -#define HAVE_OSPTK 1 -_ACEOF +printf "%s\n" "#define HAVE_OSPTK 1" >>confdefs.h else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi fi fi @@ -31988,11 +34000,12 @@ ast_ext_lib_check_save_CFLAGS="${CFLAGS}" CFLAGS="${CFLAGS} " - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for srtp_init in -lsrtp2" >&5 -$as_echo_n "checking for srtp_init in -lsrtp2... " >&6; } -if ${ac_cv_lib_srtp2_srtp_init+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for srtp_init in -lsrtp2" >&5 +printf %s "checking for srtp_init in -lsrtp2... " >&6; } +if test ${ac_cv_lib_srtp2_srtp_init+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lsrtp2 ${pbxlibdir} $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -32001,32 +34014,31 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char srtp_init (); int -main () +main (void) { return srtp_init (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_srtp2_srtp_init=yes -else +else $as_nop ac_cv_lib_srtp2_srtp_init=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_srtp2_srtp_init" >&5 -$as_echo "$ac_cv_lib_srtp2_srtp_init" >&6; } -if test "x$ac_cv_lib_srtp2_srtp_init" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_srtp2_srtp_init" >&5 +printf "%s\n" "$ac_cv_lib_srtp2_srtp_init" >&6; } +if test "x$ac_cv_lib_srtp2_srtp_init" = xyes +then : AST_SRTP_FOUND=yes -else +else $as_nop AST_SRTP_FOUND=no fi @@ -32045,14 +34057,14 @@ # check for the header ast_ext_lib_check_saved_CPPFLAGS="${CPPFLAGS}" CPPFLAGS="${CPPFLAGS} ${SRTP_INCLUDE}" - ac_fn_c_check_header_mongrel "$LINENO" "srtp2/srtp.h" "ac_cv_header_srtp2_srtp_h" "$ac_includes_default" -if test "x$ac_cv_header_srtp2_srtp_h" = xyes; then : + ac_fn_c_check_header_compile "$LINENO" "srtp2/srtp.h" "ac_cv_header_srtp2_srtp_h" "$ac_includes_default" +if test "x$ac_cv_header_srtp2_srtp_h" = xyes +then : SRTP_HEADER_FOUND=1 -else +else $as_nop SRTP_HEADER_FOUND=0 fi - CPPFLAGS="${ast_ext_lib_check_saved_CPPFLAGS}" if test "x${SRTP_HEADER_FOUND}" = "x0" ; then @@ -32082,14 +34094,14 @@ LIBS="${LIBS} ${SRTP_LIB} " LDFLAGS="${LDFLAGS} -shared -fPIC" CFLAGS="${CFLAGS} ${SRTP_INCLUDE} " - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for the ability of -lsrtp2 to be linked in a shared object" >&5 -$as_echo_n "checking for the ability of -lsrtp2 to be linked in a shared object... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for the ability of -lsrtp2 to be linked in a shared object" >&5 +printf %s "checking for the ability of -lsrtp2 to be linked in a shared object... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int -main () +main (void) { srtp_init(); @@ -32098,47 +34110,48 @@ } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } -else +else $as_nop - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: ***" >&5 -$as_echo "$as_me: WARNING: ***" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: *** libsrtp2 could not be linked as a shared object." >&5 -$as_echo "$as_me: WARNING: *** libsrtp2 could not be linked as a shared object." >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: *** Try compiling libsrtp2 manually. Configure libsrtp2" >&5 -$as_echo "$as_me: WARNING: *** Try compiling libsrtp2 manually. Configure libsrtp2" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: *** with ./configure --prefix=/usr replacing /usr with" >&5 -$as_echo "$as_me: WARNING: *** with ./configure --prefix=/usr replacing /usr with" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: *** the prefix of your choice, and then make with" >&5 -$as_echo "$as_me: WARNING: *** the prefix of your choice, and then make with" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: *** 'make libsrtp2.so'" >&5 -$as_echo "$as_me: WARNING: *** 'make libsrtp2.so'" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: ***" >&5 -$as_echo "$as_me: WARNING: ***" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: *** After re-installing libsrtp2, re-run the Asterisk" >&5 -$as_echo "$as_me: WARNING: *** After re-installing libsrtp2, re-run the Asterisk" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: *** configure script." >&5 -$as_echo "$as_me: WARNING: *** configure script." >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: ***" >&5 -$as_echo "$as_me: WARNING: ***" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: *** If you do not need SRTP support re-run configure" >&5 -$as_echo "$as_me: WARNING: *** If you do not need SRTP support re-run configure" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: *** with the --without-srtp option." >&5 -$as_echo "$as_me: WARNING: *** with the --without-srtp option." >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: ***" >&5 +printf "%s\n" "$as_me: WARNING: ***" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: *** libsrtp2 could not be linked as a shared object." >&5 +printf "%s\n" "$as_me: WARNING: *** libsrtp2 could not be linked as a shared object." >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: *** Try compiling libsrtp2 manually. Configure libsrtp2" >&5 +printf "%s\n" "$as_me: WARNING: *** Try compiling libsrtp2 manually. Configure libsrtp2" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: *** with ./configure --prefix=/usr replacing /usr with" >&5 +printf "%s\n" "$as_me: WARNING: *** with ./configure --prefix=/usr replacing /usr with" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: *** the prefix of your choice, and then make with" >&5 +printf "%s\n" "$as_me: WARNING: *** the prefix of your choice, and then make with" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: *** 'make libsrtp2.so'" >&5 +printf "%s\n" "$as_me: WARNING: *** 'make libsrtp2.so'" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: ***" >&5 +printf "%s\n" "$as_me: WARNING: ***" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: *** After re-installing libsrtp2, re-run the Asterisk" >&5 +printf "%s\n" "$as_me: WARNING: *** After re-installing libsrtp2, re-run the Asterisk" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: *** configure script." >&5 +printf "%s\n" "$as_me: WARNING: *** configure script." >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: ***" >&5 +printf "%s\n" "$as_me: WARNING: ***" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: *** If you do not need SRTP support re-run configure" >&5 +printf "%s\n" "$as_me: WARNING: *** If you do not need SRTP support re-run configure" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: *** with the --without-srtp option." >&5 +printf "%s\n" "$as_me: WARNING: *** with the --without-srtp option." >&2;} exit 1 fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext CFLAGS="${ast_ext_lib_check_shared_saved_cflags}" LDFLAGS="${ast_ext_lib_check_shared_saved_ldflags}" @@ -32162,11 +34175,12 @@ ast_ext_lib_check_save_CFLAGS="${CFLAGS}" CFLAGS="${CFLAGS} " - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for srtp_crypto_policy_set_aes_cm_256_hmac_sha1_80 in -lsrtp2" >&5 -$as_echo_n "checking for srtp_crypto_policy_set_aes_cm_256_hmac_sha1_80 in -lsrtp2... " >&6; } -if ${ac_cv_lib_srtp2_srtp_crypto_policy_set_aes_cm_256_hmac_sha1_80+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for srtp_crypto_policy_set_aes_cm_256_hmac_sha1_80 in -lsrtp2" >&5 +printf %s "checking for srtp_crypto_policy_set_aes_cm_256_hmac_sha1_80 in -lsrtp2... " >&6; } +if test ${ac_cv_lib_srtp2_srtp_crypto_policy_set_aes_cm_256_hmac_sha1_80+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lsrtp2 ${pbxlibdir} $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -32175,32 +34189,31 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char srtp_crypto_policy_set_aes_cm_256_hmac_sha1_80 (); int -main () +main (void) { return srtp_crypto_policy_set_aes_cm_256_hmac_sha1_80 (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_srtp2_srtp_crypto_policy_set_aes_cm_256_hmac_sha1_80=yes -else +else $as_nop ac_cv_lib_srtp2_srtp_crypto_policy_set_aes_cm_256_hmac_sha1_80=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_srtp2_srtp_crypto_policy_set_aes_cm_256_hmac_sha1_80" >&5 -$as_echo "$ac_cv_lib_srtp2_srtp_crypto_policy_set_aes_cm_256_hmac_sha1_80" >&6; } -if test "x$ac_cv_lib_srtp2_srtp_crypto_policy_set_aes_cm_256_hmac_sha1_80" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_srtp2_srtp_crypto_policy_set_aes_cm_256_hmac_sha1_80" >&5 +printf "%s\n" "$ac_cv_lib_srtp2_srtp_crypto_policy_set_aes_cm_256_hmac_sha1_80" >&6; } +if test "x$ac_cv_lib_srtp2_srtp_crypto_policy_set_aes_cm_256_hmac_sha1_80" = xyes +then : AST_SRTP_256_FOUND=yes -else +else $as_nop AST_SRTP_256_FOUND=no fi @@ -32248,11 +34261,12 @@ ast_ext_lib_check_save_CFLAGS="${CFLAGS}" CFLAGS="${CFLAGS} " - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for srtp_crypto_policy_set_aes_cm_192_hmac_sha1_80 in -lsrtp2" >&5 -$as_echo_n "checking for srtp_crypto_policy_set_aes_cm_192_hmac_sha1_80 in -lsrtp2... " >&6; } -if ${ac_cv_lib_srtp2_srtp_crypto_policy_set_aes_cm_192_hmac_sha1_80+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for srtp_crypto_policy_set_aes_cm_192_hmac_sha1_80 in -lsrtp2" >&5 +printf %s "checking for srtp_crypto_policy_set_aes_cm_192_hmac_sha1_80 in -lsrtp2... " >&6; } +if test ${ac_cv_lib_srtp2_srtp_crypto_policy_set_aes_cm_192_hmac_sha1_80+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lsrtp2 ${pbxlibdir} $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -32261,32 +34275,31 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char srtp_crypto_policy_set_aes_cm_192_hmac_sha1_80 (); int -main () +main (void) { return srtp_crypto_policy_set_aes_cm_192_hmac_sha1_80 (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_srtp2_srtp_crypto_policy_set_aes_cm_192_hmac_sha1_80=yes -else +else $as_nop ac_cv_lib_srtp2_srtp_crypto_policy_set_aes_cm_192_hmac_sha1_80=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_srtp2_srtp_crypto_policy_set_aes_cm_192_hmac_sha1_80" >&5 -$as_echo "$ac_cv_lib_srtp2_srtp_crypto_policy_set_aes_cm_192_hmac_sha1_80" >&6; } -if test "x$ac_cv_lib_srtp2_srtp_crypto_policy_set_aes_cm_192_hmac_sha1_80" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_srtp2_srtp_crypto_policy_set_aes_cm_192_hmac_sha1_80" >&5 +printf "%s\n" "$ac_cv_lib_srtp2_srtp_crypto_policy_set_aes_cm_192_hmac_sha1_80" >&6; } +if test "x$ac_cv_lib_srtp2_srtp_crypto_policy_set_aes_cm_192_hmac_sha1_80" = xyes +then : AST_SRTP_192_FOUND=yes -else +else $as_nop AST_SRTP_192_FOUND=no fi @@ -32334,11 +34347,12 @@ ast_ext_lib_check_save_CFLAGS="${CFLAGS}" CFLAGS="${CFLAGS} " - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for srtp_crypto_policy_set_aes_gcm_128_8_auth in -lsrtp2" >&5 -$as_echo_n "checking for srtp_crypto_policy_set_aes_gcm_128_8_auth in -lsrtp2... " >&6; } -if ${ac_cv_lib_srtp2_srtp_crypto_policy_set_aes_gcm_128_8_auth+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for srtp_crypto_policy_set_aes_gcm_128_8_auth in -lsrtp2" >&5 +printf %s "checking for srtp_crypto_policy_set_aes_gcm_128_8_auth in -lsrtp2... " >&6; } +if test ${ac_cv_lib_srtp2_srtp_crypto_policy_set_aes_gcm_128_8_auth+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lsrtp2 ${pbxlibdir} $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -32347,32 +34361,31 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char srtp_crypto_policy_set_aes_gcm_128_8_auth (); int -main () +main (void) { return srtp_crypto_policy_set_aes_gcm_128_8_auth (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_srtp2_srtp_crypto_policy_set_aes_gcm_128_8_auth=yes -else +else $as_nop ac_cv_lib_srtp2_srtp_crypto_policy_set_aes_gcm_128_8_auth=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_srtp2_srtp_crypto_policy_set_aes_gcm_128_8_auth" >&5 -$as_echo "$ac_cv_lib_srtp2_srtp_crypto_policy_set_aes_gcm_128_8_auth" >&6; } -if test "x$ac_cv_lib_srtp2_srtp_crypto_policy_set_aes_gcm_128_8_auth" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_srtp2_srtp_crypto_policy_set_aes_gcm_128_8_auth" >&5 +printf "%s\n" "$ac_cv_lib_srtp2_srtp_crypto_policy_set_aes_gcm_128_8_auth" >&6; } +if test "x$ac_cv_lib_srtp2_srtp_crypto_policy_set_aes_gcm_128_8_auth" = xyes +then : AST_SRTP_GCM_FOUND=yes -else +else $as_nop AST_SRTP_GCM_FOUND=no fi @@ -32420,11 +34433,12 @@ ast_ext_lib_check_save_CFLAGS="${CFLAGS}" CFLAGS="${CFLAGS} " - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for srtp_shutdown in -lsrtp2" >&5 -$as_echo_n "checking for srtp_shutdown in -lsrtp2... " >&6; } -if ${ac_cv_lib_srtp2_srtp_shutdown+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for srtp_shutdown in -lsrtp2" >&5 +printf %s "checking for srtp_shutdown in -lsrtp2... " >&6; } +if test ${ac_cv_lib_srtp2_srtp_shutdown+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lsrtp2 ${pbxlibdir} $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -32433,32 +34447,31 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char srtp_shutdown (); int -main () +main (void) { return srtp_shutdown (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_srtp2_srtp_shutdown=yes -else +else $as_nop ac_cv_lib_srtp2_srtp_shutdown=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_srtp2_srtp_shutdown" >&5 -$as_echo "$ac_cv_lib_srtp2_srtp_shutdown" >&6; } -if test "x$ac_cv_lib_srtp2_srtp_shutdown" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_srtp2_srtp_shutdown" >&5 +printf "%s\n" "$ac_cv_lib_srtp2_srtp_shutdown" >&6; } +if test "x$ac_cv_lib_srtp2_srtp_shutdown" = xyes +then : AST_SRTP_SHUTDOWN_FOUND=yes -else +else $as_nop AST_SRTP_SHUTDOWN_FOUND=no fi @@ -32477,14 +34490,14 @@ # check for the header ast_ext_lib_check_saved_CPPFLAGS="${CPPFLAGS}" CPPFLAGS="${CPPFLAGS} ${SRTP_SHUTDOWN_INCLUDE}" - ac_fn_c_check_header_mongrel "$LINENO" "srtp2/srtp.h" "ac_cv_header_srtp2_srtp_h" "$ac_includes_default" -if test "x$ac_cv_header_srtp2_srtp_h" = xyes; then : + ac_fn_c_check_header_compile "$LINENO" "srtp2/srtp.h" "ac_cv_header_srtp2_srtp_h" "$ac_includes_default" +if test "x$ac_cv_header_srtp2_srtp_h" = xyes +then : SRTP_SHUTDOWN_HEADER_FOUND=1 -else +else $as_nop SRTP_SHUTDOWN_HEADER_FOUND=0 fi - CPPFLAGS="${ast_ext_lib_check_saved_CPPFLAGS}" if test "x${SRTP_SHUTDOWN_HEADER_FOUND}" = "x0" ; then @@ -32516,11 +34529,12 @@ ast_ext_lib_check_save_CFLAGS="${CFLAGS}" CFLAGS="${CFLAGS} " - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for srtp_get_version_string in -lsrtp2" >&5 -$as_echo_n "checking for srtp_get_version_string in -lsrtp2... " >&6; } -if ${ac_cv_lib_srtp2_srtp_get_version_string+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for srtp_get_version_string in -lsrtp2" >&5 +printf %s "checking for srtp_get_version_string in -lsrtp2... " >&6; } +if test ${ac_cv_lib_srtp2_srtp_get_version_string+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lsrtp2 ${pbxlibdir} $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -32529,32 +34543,31 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char srtp_get_version_string (); int -main () +main (void) { return srtp_get_version_string (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_srtp2_srtp_get_version_string=yes -else +else $as_nop ac_cv_lib_srtp2_srtp_get_version_string=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_srtp2_srtp_get_version_string" >&5 -$as_echo "$ac_cv_lib_srtp2_srtp_get_version_string" >&6; } -if test "x$ac_cv_lib_srtp2_srtp_get_version_string" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_srtp2_srtp_get_version_string" >&5 +printf "%s\n" "$ac_cv_lib_srtp2_srtp_get_version_string" >&6; } +if test "x$ac_cv_lib_srtp2_srtp_get_version_string" = xyes +then : AST_SRTP_GET_VERSION_FOUND=yes -else +else $as_nop AST_SRTP_GET_VERSION_FOUND=no fi @@ -32573,14 +34586,14 @@ # check for the header ast_ext_lib_check_saved_CPPFLAGS="${CPPFLAGS}" CPPFLAGS="${CPPFLAGS} ${SRTP_GET_VERSION_INCLUDE}" - ac_fn_c_check_header_mongrel "$LINENO" "srtp2/srtp.h" "ac_cv_header_srtp2_srtp_h" "$ac_includes_default" -if test "x$ac_cv_header_srtp2_srtp_h" = xyes; then : + ac_fn_c_check_header_compile "$LINENO" "srtp2/srtp.h" "ac_cv_header_srtp2_srtp_h" "$ac_includes_default" +if test "x$ac_cv_header_srtp2_srtp_h" = xyes +then : SRTP_GET_VERSION_HEADER_FOUND=1 -else +else $as_nop SRTP_GET_VERSION_HEADER_FOUND=0 fi - CPPFLAGS="${ast_ext_lib_check_saved_CPPFLAGS}" if test "x${SRTP_GET_VERSION_HEADER_FOUND}" = "x0" ; then @@ -32602,12 +34615,12 @@ # libsrtp2 removed support for PRNG, so we require OpenSSL if test "x$PBX_OPENSSL" != x1; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: ***" >&5 -$as_echo "$as_me: WARNING: ***" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: *** OpenSSL required when using libsrtp2, checking for libsrtp instead." >&5 -$as_echo "$as_me: WARNING: *** OpenSSL required when using libsrtp2, checking for libsrtp instead." >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: ***" >&5 -$as_echo "$as_me: WARNING: ***" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: ***" >&5 +printf "%s\n" "$as_me: WARNING: ***" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: *** OpenSSL required when using libsrtp2, checking for libsrtp instead." >&5 +printf "%s\n" "$as_me: WARNING: *** OpenSSL required when using libsrtp2, checking for libsrtp instead." >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: ***" >&5 +printf "%s\n" "$as_me: WARNING: ***" >&2;} PBX_SRTP=0 fi fi @@ -32628,11 +34641,12 @@ ast_ext_lib_check_save_CFLAGS="${CFLAGS}" CFLAGS="${CFLAGS} " - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for srtp_init in -lsrtp" >&5 -$as_echo_n "checking for srtp_init in -lsrtp... " >&6; } -if ${ac_cv_lib_srtp_srtp_init+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for srtp_init in -lsrtp" >&5 +printf %s "checking for srtp_init in -lsrtp... " >&6; } +if test ${ac_cv_lib_srtp_srtp_init+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lsrtp ${pbxlibdir} $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -32641,32 +34655,31 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char srtp_init (); int -main () +main (void) { return srtp_init (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_srtp_srtp_init=yes -else +else $as_nop ac_cv_lib_srtp_srtp_init=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_srtp_srtp_init" >&5 -$as_echo "$ac_cv_lib_srtp_srtp_init" >&6; } -if test "x$ac_cv_lib_srtp_srtp_init" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_srtp_srtp_init" >&5 +printf "%s\n" "$ac_cv_lib_srtp_srtp_init" >&6; } +if test "x$ac_cv_lib_srtp_srtp_init" = xyes +then : AST_SRTP_FOUND=yes -else +else $as_nop AST_SRTP_FOUND=no fi @@ -32685,14 +34698,14 @@ # check for the header ast_ext_lib_check_saved_CPPFLAGS="${CPPFLAGS}" CPPFLAGS="${CPPFLAGS} ${SRTP_INCLUDE}" - ac_fn_c_check_header_mongrel "$LINENO" "srtp/srtp.h" "ac_cv_header_srtp_srtp_h" "$ac_includes_default" -if test "x$ac_cv_header_srtp_srtp_h" = xyes; then : + ac_fn_c_check_header_compile "$LINENO" "srtp/srtp.h" "ac_cv_header_srtp_srtp_h" "$ac_includes_default" +if test "x$ac_cv_header_srtp_srtp_h" = xyes +then : SRTP_HEADER_FOUND=1 -else +else $as_nop SRTP_HEADER_FOUND=0 fi - CPPFLAGS="${ast_ext_lib_check_saved_CPPFLAGS}" if test "x${SRTP_HEADER_FOUND}" = "x0" ; then @@ -32722,14 +34735,14 @@ LIBS="${LIBS} ${SRTP_LIB} " LDFLAGS="${LDFLAGS} -shared -fPIC" CFLAGS="${CFLAGS} ${SRTP_INCLUDE} " - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for the ability of -lsrtp to be linked in a shared object" >&5 -$as_echo_n "checking for the ability of -lsrtp to be linked in a shared object... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for the ability of -lsrtp to be linked in a shared object" >&5 +printf %s "checking for the ability of -lsrtp to be linked in a shared object... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int -main () +main (void) { srtp_init(); @@ -32738,43 +34751,44 @@ } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } -else +else $as_nop - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: ***" >&5 -$as_echo "$as_me: WARNING: ***" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: *** libsrtp could not be linked as a shared object." >&5 -$as_echo "$as_me: WARNING: *** libsrtp could not be linked as a shared object." >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: *** Try compiling libsrtp manually. Configure libsrtp" >&5 -$as_echo "$as_me: WARNING: *** Try compiling libsrtp manually. Configure libsrtp" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: *** with ./configure CFLAGS=-fPIC --prefix=/usr" >&5 -$as_echo "$as_me: WARNING: *** with ./configure CFLAGS=-fPIC --prefix=/usr" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: *** replacing /usr with the prefix of your choice." >&5 -$as_echo "$as_me: WARNING: *** replacing /usr with the prefix of your choice." >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: *** After re-installing libsrtp, re-run the Asterisk" >&5 -$as_echo "$as_me: WARNING: *** After re-installing libsrtp, re-run the Asterisk" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: *** configure script." >&5 -$as_echo "$as_me: WARNING: *** configure script." >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: ***" >&5 -$as_echo "$as_me: WARNING: ***" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: *** If you do not need SRTP support re-run configure" >&5 -$as_echo "$as_me: WARNING: *** If you do not need SRTP support re-run configure" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: *** with the --without-srtp option." >&5 -$as_echo "$as_me: WARNING: *** with the --without-srtp option." >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: ***" >&5 +printf "%s\n" "$as_me: WARNING: ***" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: *** libsrtp could not be linked as a shared object." >&5 +printf "%s\n" "$as_me: WARNING: *** libsrtp could not be linked as a shared object." >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: *** Try compiling libsrtp manually. Configure libsrtp" >&5 +printf "%s\n" "$as_me: WARNING: *** Try compiling libsrtp manually. Configure libsrtp" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: *** with ./configure CFLAGS=-fPIC --prefix=/usr" >&5 +printf "%s\n" "$as_me: WARNING: *** with ./configure CFLAGS=-fPIC --prefix=/usr" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: *** replacing /usr with the prefix of your choice." >&5 +printf "%s\n" "$as_me: WARNING: *** replacing /usr with the prefix of your choice." >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: *** After re-installing libsrtp, re-run the Asterisk" >&5 +printf "%s\n" "$as_me: WARNING: *** After re-installing libsrtp, re-run the Asterisk" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: *** configure script." >&5 +printf "%s\n" "$as_me: WARNING: *** configure script." >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: ***" >&5 +printf "%s\n" "$as_me: WARNING: ***" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: *** If you do not need SRTP support re-run configure" >&5 +printf "%s\n" "$as_me: WARNING: *** If you do not need SRTP support re-run configure" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: *** with the --without-srtp option." >&5 +printf "%s\n" "$as_me: WARNING: *** with the --without-srtp option." >&2;} exit 1 fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext CFLAGS="${ast_ext_lib_check_shared_saved_cflags}" LDFLAGS="${ast_ext_lib_check_shared_saved_ldflags}" @@ -32798,11 +34812,12 @@ ast_ext_lib_check_save_CFLAGS="${CFLAGS}" CFLAGS="${CFLAGS} " - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for crypto_policy_set_aes_cm_256_hmac_sha1_80 in -lsrtp" >&5 -$as_echo_n "checking for crypto_policy_set_aes_cm_256_hmac_sha1_80 in -lsrtp... " >&6; } -if ${ac_cv_lib_srtp_crypto_policy_set_aes_cm_256_hmac_sha1_80+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for crypto_policy_set_aes_cm_256_hmac_sha1_80 in -lsrtp" >&5 +printf %s "checking for crypto_policy_set_aes_cm_256_hmac_sha1_80 in -lsrtp... " >&6; } +if test ${ac_cv_lib_srtp_crypto_policy_set_aes_cm_256_hmac_sha1_80+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lsrtp ${pbxlibdir} $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -32811,32 +34826,31 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char crypto_policy_set_aes_cm_256_hmac_sha1_80 (); int -main () +main (void) { return crypto_policy_set_aes_cm_256_hmac_sha1_80 (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_srtp_crypto_policy_set_aes_cm_256_hmac_sha1_80=yes -else +else $as_nop ac_cv_lib_srtp_crypto_policy_set_aes_cm_256_hmac_sha1_80=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_srtp_crypto_policy_set_aes_cm_256_hmac_sha1_80" >&5 -$as_echo "$ac_cv_lib_srtp_crypto_policy_set_aes_cm_256_hmac_sha1_80" >&6; } -if test "x$ac_cv_lib_srtp_crypto_policy_set_aes_cm_256_hmac_sha1_80" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_srtp_crypto_policy_set_aes_cm_256_hmac_sha1_80" >&5 +printf "%s\n" "$ac_cv_lib_srtp_crypto_policy_set_aes_cm_256_hmac_sha1_80" >&6; } +if test "x$ac_cv_lib_srtp_crypto_policy_set_aes_cm_256_hmac_sha1_80" = xyes +then : AST_SRTP_256_FOUND=yes -else +else $as_nop AST_SRTP_256_FOUND=no fi @@ -32884,11 +34898,12 @@ ast_ext_lib_check_save_CFLAGS="${CFLAGS}" CFLAGS="${CFLAGS} " - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for crypto_policy_set_aes_cm_192_hmac_sha1_80 in -lsrtp" >&5 -$as_echo_n "checking for crypto_policy_set_aes_cm_192_hmac_sha1_80 in -lsrtp... " >&6; } -if ${ac_cv_lib_srtp_crypto_policy_set_aes_cm_192_hmac_sha1_80+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for crypto_policy_set_aes_cm_192_hmac_sha1_80 in -lsrtp" >&5 +printf %s "checking for crypto_policy_set_aes_cm_192_hmac_sha1_80 in -lsrtp... " >&6; } +if test ${ac_cv_lib_srtp_crypto_policy_set_aes_cm_192_hmac_sha1_80+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lsrtp ${pbxlibdir} $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -32897,32 +34912,31 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char crypto_policy_set_aes_cm_192_hmac_sha1_80 (); int -main () +main (void) { return crypto_policy_set_aes_cm_192_hmac_sha1_80 (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_srtp_crypto_policy_set_aes_cm_192_hmac_sha1_80=yes -else +else $as_nop ac_cv_lib_srtp_crypto_policy_set_aes_cm_192_hmac_sha1_80=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_srtp_crypto_policy_set_aes_cm_192_hmac_sha1_80" >&5 -$as_echo "$ac_cv_lib_srtp_crypto_policy_set_aes_cm_192_hmac_sha1_80" >&6; } -if test "x$ac_cv_lib_srtp_crypto_policy_set_aes_cm_192_hmac_sha1_80" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_srtp_crypto_policy_set_aes_cm_192_hmac_sha1_80" >&5 +printf "%s\n" "$ac_cv_lib_srtp_crypto_policy_set_aes_cm_192_hmac_sha1_80" >&6; } +if test "x$ac_cv_lib_srtp_crypto_policy_set_aes_cm_192_hmac_sha1_80" = xyes +then : AST_SRTP_192_FOUND=yes -else +else $as_nop AST_SRTP_192_FOUND=no fi @@ -32970,11 +34984,12 @@ ast_ext_lib_check_save_CFLAGS="${CFLAGS}" CFLAGS="${CFLAGS} " - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for crypto_policy_set_aes_gcm_128_8_auth in -lsrtp" >&5 -$as_echo_n "checking for crypto_policy_set_aes_gcm_128_8_auth in -lsrtp... " >&6; } -if ${ac_cv_lib_srtp_crypto_policy_set_aes_gcm_128_8_auth+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for crypto_policy_set_aes_gcm_128_8_auth in -lsrtp" >&5 +printf %s "checking for crypto_policy_set_aes_gcm_128_8_auth in -lsrtp... " >&6; } +if test ${ac_cv_lib_srtp_crypto_policy_set_aes_gcm_128_8_auth+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lsrtp ${pbxlibdir} $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -32983,32 +34998,31 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char crypto_policy_set_aes_gcm_128_8_auth (); int -main () +main (void) { return crypto_policy_set_aes_gcm_128_8_auth (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_srtp_crypto_policy_set_aes_gcm_128_8_auth=yes -else +else $as_nop ac_cv_lib_srtp_crypto_policy_set_aes_gcm_128_8_auth=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_srtp_crypto_policy_set_aes_gcm_128_8_auth" >&5 -$as_echo "$ac_cv_lib_srtp_crypto_policy_set_aes_gcm_128_8_auth" >&6; } -if test "x$ac_cv_lib_srtp_crypto_policy_set_aes_gcm_128_8_auth" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_srtp_crypto_policy_set_aes_gcm_128_8_auth" >&5 +printf "%s\n" "$ac_cv_lib_srtp_crypto_policy_set_aes_gcm_128_8_auth" >&6; } +if test "x$ac_cv_lib_srtp_crypto_policy_set_aes_gcm_128_8_auth" = xyes +then : AST_SRTP_GCM_FOUND=yes -else +else $as_nop AST_SRTP_GCM_FOUND=no fi @@ -33056,11 +35070,12 @@ ast_ext_lib_check_save_CFLAGS="${CFLAGS}" CFLAGS="${CFLAGS} " - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for srtp_shutdown in -lsrtp" >&5 -$as_echo_n "checking for srtp_shutdown in -lsrtp... " >&6; } -if ${ac_cv_lib_srtp_srtp_shutdown+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for srtp_shutdown in -lsrtp" >&5 +printf %s "checking for srtp_shutdown in -lsrtp... " >&6; } +if test ${ac_cv_lib_srtp_srtp_shutdown+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lsrtp ${pbxlibdir} $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -33069,32 +35084,31 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char srtp_shutdown (); int -main () +main (void) { return srtp_shutdown (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_srtp_srtp_shutdown=yes -else +else $as_nop ac_cv_lib_srtp_srtp_shutdown=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_srtp_srtp_shutdown" >&5 -$as_echo "$ac_cv_lib_srtp_srtp_shutdown" >&6; } -if test "x$ac_cv_lib_srtp_srtp_shutdown" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_srtp_srtp_shutdown" >&5 +printf "%s\n" "$ac_cv_lib_srtp_srtp_shutdown" >&6; } +if test "x$ac_cv_lib_srtp_srtp_shutdown" = xyes +then : AST_SRTP_SHUTDOWN_FOUND=yes -else +else $as_nop AST_SRTP_SHUTDOWN_FOUND=no fi @@ -33113,14 +35127,14 @@ # check for the header ast_ext_lib_check_saved_CPPFLAGS="${CPPFLAGS}" CPPFLAGS="${CPPFLAGS} ${SRTP_SHUTDOWN_INCLUDE}" - ac_fn_c_check_header_mongrel "$LINENO" "srtp/srtp.h" "ac_cv_header_srtp_srtp_h" "$ac_includes_default" -if test "x$ac_cv_header_srtp_srtp_h" = xyes; then : + ac_fn_c_check_header_compile "$LINENO" "srtp/srtp.h" "ac_cv_header_srtp_srtp_h" "$ac_includes_default" +if test "x$ac_cv_header_srtp_srtp_h" = xyes +then : SRTP_SHUTDOWN_HEADER_FOUND=1 -else +else $as_nop SRTP_SHUTDOWN_HEADER_FOUND=0 fi - CPPFLAGS="${ast_ext_lib_check_saved_CPPFLAGS}" if test "x${SRTP_SHUTDOWN_HEADER_FOUND}" = "x0" ; then @@ -33152,11 +35166,12 @@ ast_ext_lib_check_save_CFLAGS="${CFLAGS}" CFLAGS="${CFLAGS} " - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for srtp_get_version_string in -lsrtp" >&5 -$as_echo_n "checking for srtp_get_version_string in -lsrtp... " >&6; } -if ${ac_cv_lib_srtp_srtp_get_version_string+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for srtp_get_version_string in -lsrtp" >&5 +printf %s "checking for srtp_get_version_string in -lsrtp... " >&6; } +if test ${ac_cv_lib_srtp_srtp_get_version_string+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lsrtp ${pbxlibdir} $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -33165,32 +35180,31 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char srtp_get_version_string (); int -main () +main (void) { return srtp_get_version_string (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_srtp_srtp_get_version_string=yes -else +else $as_nop ac_cv_lib_srtp_srtp_get_version_string=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_srtp_srtp_get_version_string" >&5 -$as_echo "$ac_cv_lib_srtp_srtp_get_version_string" >&6; } -if test "x$ac_cv_lib_srtp_srtp_get_version_string" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_srtp_srtp_get_version_string" >&5 +printf "%s\n" "$ac_cv_lib_srtp_srtp_get_version_string" >&6; } +if test "x$ac_cv_lib_srtp_srtp_get_version_string" = xyes +then : AST_SRTP_GET_VERSION_FOUND=yes -else +else $as_nop AST_SRTP_GET_VERSION_FOUND=no fi @@ -33209,14 +35223,14 @@ # check for the header ast_ext_lib_check_saved_CPPFLAGS="${CPPFLAGS}" CPPFLAGS="${CPPFLAGS} ${SRTP_GET_VERSION_INCLUDE}" - ac_fn_c_check_header_mongrel "$LINENO" "srtp/srtp.h" "ac_cv_header_srtp_srtp_h" "$ac_includes_default" -if test "x$ac_cv_header_srtp_srtp_h" = xyes; then : + ac_fn_c_check_header_compile "$LINENO" "srtp/srtp.h" "ac_cv_header_srtp_srtp_h" "$ac_includes_default" +if test "x$ac_cv_header_srtp_srtp_h" = xyes +then : SRTP_GET_VERSION_HEADER_FOUND=1 -else +else $as_nop SRTP_GET_VERSION_HEADER_FOUND=0 fi - CPPFLAGS="${ast_ext_lib_check_saved_CPPFLAGS}" if test "x${SRTP_GET_VERSION_HEADER_FOUND}" = "x0" ; then @@ -33242,17 +35256,17 @@ if test "x${PBX_GMIME}" != "x1" -a "${USE_GMIME}" != "no"; then pkg_failed=no -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for GMIME" >&5 -$as_echo_n "checking for GMIME... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for gmime-$ver" >&5 +printf %s "checking for gmime-$ver... " >&6; } if test -n "$GMIME_CFLAGS"; then pkg_cv_GMIME_CFLAGS="$GMIME_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gmime-\$ver\""; } >&5 + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gmime-\$ver\""; } >&5 ($PKG_CONFIG --exists --print-errors "gmime-$ver") 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_GMIME_CFLAGS=`$PKG_CONFIG --cflags "gmime-$ver" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes @@ -33266,10 +35280,10 @@ pkg_cv_GMIME_LIBS="$GMIME_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gmime-\$ver\""; } >&5 + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gmime-\$ver\""; } >&5 ($PKG_CONFIG --exists --print-errors "gmime-$ver") 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_GMIME_LIBS=`$PKG_CONFIG --libs "gmime-$ver" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes @@ -33283,8 +35297,8 @@ if test $pkg_failed = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes @@ -33304,8 +35318,8 @@ elif test $pkg_failed = untried; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } PBX_GMIME=0 @@ -33313,14 +35327,14 @@ else GMIME_CFLAGS=$pkg_cv_GMIME_CFLAGS GMIME_LIBS=$pkg_cv_GMIME_LIBS - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } PBX_GMIME=1 GMIME_INCLUDE=$(echo ${GMIME_CFLAGS} | $SED -e "s|-std=c99||g") GMIME_LIB="$GMIME_LIBS" -$as_echo "#define HAVE_GMIME 1" >>confdefs.h +printf "%s\n" "#define HAVE_GMIME 1" >>confdefs.h fi @@ -33345,11 +35359,12 @@ ast_ext_lib_check_save_CFLAGS="${CFLAGS}" CFLAGS="${CFLAGS} " - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for malloc in -lhoard" >&5 -$as_echo_n "checking for malloc in -lhoard... " >&6; } -if ${ac_cv_lib_hoard_malloc+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for malloc in -lhoard" >&5 +printf %s "checking for malloc in -lhoard... " >&6; } +if test ${ac_cv_lib_hoard_malloc+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lhoard ${pbxlibdir} $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -33358,32 +35373,31 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char malloc (); int -main () +main (void) { return malloc (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_hoard_malloc=yes -else +else $as_nop ac_cv_lib_hoard_malloc=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_hoard_malloc" >&5 -$as_echo "$ac_cv_lib_hoard_malloc" >&6; } -if test "x$ac_cv_lib_hoard_malloc" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_hoard_malloc" >&5 +printf "%s\n" "$ac_cv_lib_hoard_malloc" >&6; } +if test "x$ac_cv_lib_hoard_malloc" = xyes +then : AST_HOARD_FOUND=yes -else +else $as_nop AST_HOARD_FOUND=no fi @@ -33432,11 +35446,12 @@ ast_ext_lib_check_save_CFLAGS="${CFLAGS}" CFLAGS="${CFLAGS} " - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dbinit in -lsybdb" >&5 -$as_echo_n "checking for dbinit in -lsybdb... " >&6; } -if ${ac_cv_lib_sybdb_dbinit+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for dbinit in -lsybdb" >&5 +printf %s "checking for dbinit in -lsybdb... " >&6; } +if test ${ac_cv_lib_sybdb_dbinit+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lsybdb ${pbxlibdir} $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -33445,32 +35460,31 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char dbinit (); int -main () +main (void) { return dbinit (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_sybdb_dbinit=yes -else +else $as_nop ac_cv_lib_sybdb_dbinit=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_sybdb_dbinit" >&5 -$as_echo "$ac_cv_lib_sybdb_dbinit" >&6; } -if test "x$ac_cv_lib_sybdb_dbinit" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_sybdb_dbinit" >&5 +printf "%s\n" "$ac_cv_lib_sybdb_dbinit" >&6; } +if test "x$ac_cv_lib_sybdb_dbinit" = xyes +then : AST_FREETDS_FOUND=yes -else +else $as_nop AST_FREETDS_FOUND=no fi @@ -33489,14 +35503,14 @@ # check for the header ast_ext_lib_check_saved_CPPFLAGS="${CPPFLAGS}" CPPFLAGS="${CPPFLAGS} ${FREETDS_INCLUDE}" - ac_fn_c_check_header_mongrel "$LINENO" "sybdb.h" "ac_cv_header_sybdb_h" "$ac_includes_default" -if test "x$ac_cv_header_sybdb_h" = xyes; then : + ac_fn_c_check_header_compile "$LINENO" "sybdb.h" "ac_cv_header_sybdb_h" "$ac_includes_default" +if test "x$ac_cv_header_sybdb_h" = xyes +then : FREETDS_HEADER_FOUND=1 -else +else $as_nop FREETDS_HEADER_FOUND=0 fi - CPPFLAGS="${ast_ext_lib_check_saved_CPPFLAGS}" if test "x${FREETDS_HEADER_FOUND}" = "x0" ; then @@ -33515,11 +35529,12 @@ -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for tone_zone_find_by_num in -ltonezone" >&5 -$as_echo_n "checking for tone_zone_find_by_num in -ltonezone... " >&6; } -if ${ac_cv_lib_tonezone_tone_zone_find_by_num+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for tone_zone_find_by_num in -ltonezone" >&5 +printf %s "checking for tone_zone_find_by_num in -ltonezone... " >&6; } +if test ${ac_cv_lib_tonezone_tone_zone_find_by_num+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-ltonezone $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -33528,32 +35543,31 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char tone_zone_find_by_num (); int -main () +main (void) { return tone_zone_find_by_num (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_tonezone_tone_zone_find_by_num=yes -else +else $as_nop ac_cv_lib_tonezone_tone_zone_find_by_num=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_tonezone_tone_zone_find_by_num" >&5 -$as_echo "$ac_cv_lib_tonezone_tone_zone_find_by_num" >&6; } -if test "x$ac_cv_lib_tonezone_tone_zone_find_by_num" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_tonezone_tone_zone_find_by_num" >&5 +printf "%s\n" "$ac_cv_lib_tonezone_tone_zone_find_by_num" >&6; } +if test "x$ac_cv_lib_tonezone_tone_zone_find_by_num" = xyes +then : tonezone_does_not_need_lm=yes -else +else $as_nop tonezone_does_not_need_lm=no fi @@ -33576,11 +35590,12 @@ ast_ext_lib_check_save_CFLAGS="${CFLAGS}" CFLAGS="${CFLAGS} " - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for tone_zone_find in -ltonezone" >&5 -$as_echo_n "checking for tone_zone_find in -ltonezone... " >&6; } -if ${ac_cv_lib_tonezone_tone_zone_find+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for tone_zone_find in -ltonezone" >&5 +printf %s "checking for tone_zone_find in -ltonezone... " >&6; } +if test ${ac_cv_lib_tonezone_tone_zone_find+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-ltonezone ${pbxlibdir} ${tonezone_extra} ${DAHDI_INCLUDE} $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -33589,32 +35604,31 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char tone_zone_find (); int -main () +main (void) { return tone_zone_find (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_tonezone_tone_zone_find=yes -else +else $as_nop ac_cv_lib_tonezone_tone_zone_find=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_tonezone_tone_zone_find" >&5 -$as_echo "$ac_cv_lib_tonezone_tone_zone_find" >&6; } -if test "x$ac_cv_lib_tonezone_tone_zone_find" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_tonezone_tone_zone_find" >&5 +printf "%s\n" "$ac_cv_lib_tonezone_tone_zone_find" >&6; } +if test "x$ac_cv_lib_tonezone_tone_zone_find" = xyes +then : AST_TONEZONE_FOUND=yes -else +else $as_nop AST_TONEZONE_FOUND=no fi @@ -33633,14 +35647,14 @@ # check for the header ast_ext_lib_check_saved_CPPFLAGS="${CPPFLAGS}" CPPFLAGS="${CPPFLAGS} ${TONEZONE_INCLUDE}" - ac_fn_c_check_header_mongrel "$LINENO" "dahdi/tonezone.h" "ac_cv_header_dahdi_tonezone_h" "$ac_includes_default" -if test "x$ac_cv_header_dahdi_tonezone_h" = xyes; then : + ac_fn_c_check_header_compile "$LINENO" "dahdi/tonezone.h" "ac_cv_header_dahdi_tonezone_h" "$ac_includes_default" +if test "x$ac_cv_header_dahdi_tonezone_h" = xyes +then : TONEZONE_HEADER_FOUND=1 -else +else $as_nop TONEZONE_HEADER_FOUND=0 fi - CPPFLAGS="${ast_ext_lib_check_saved_CPPFLAGS}" if test "x${TONEZONE_HEADER_FOUND}" = "x0" ; then @@ -33673,11 +35687,12 @@ ast_ext_lib_check_save_CFLAGS="${CFLAGS}" CFLAGS="${CFLAGS} " - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for vorbis_info_init in -lvorbis" >&5 -$as_echo_n "checking for vorbis_info_init in -lvorbis... " >&6; } -if ${ac_cv_lib_vorbis_vorbis_info_init+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for vorbis_info_init in -lvorbis" >&5 +printf %s "checking for vorbis_info_init in -lvorbis... " >&6; } +if test ${ac_cv_lib_vorbis_vorbis_info_init+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lvorbis ${pbxlibdir} -lm -lvorbisenc -lvorbisfile $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -33686,32 +35701,31 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char vorbis_info_init (); int -main () +main (void) { return vorbis_info_init (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_vorbis_vorbis_info_init=yes -else +else $as_nop ac_cv_lib_vorbis_vorbis_info_init=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_vorbis_vorbis_info_init" >&5 -$as_echo "$ac_cv_lib_vorbis_vorbis_info_init" >&6; } -if test "x$ac_cv_lib_vorbis_vorbis_info_init" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_vorbis_vorbis_info_init" >&5 +printf "%s\n" "$ac_cv_lib_vorbis_vorbis_info_init" >&6; } +if test "x$ac_cv_lib_vorbis_vorbis_info_init" = xyes +then : AST_VORBIS_FOUND=yes -else +else $as_nop AST_VORBIS_FOUND=no fi @@ -33730,14 +35744,14 @@ # check for the header ast_ext_lib_check_saved_CPPFLAGS="${CPPFLAGS}" CPPFLAGS="${CPPFLAGS} ${VORBIS_INCLUDE}" - ac_fn_c_check_header_mongrel "$LINENO" "vorbis/codec.h" "ac_cv_header_vorbis_codec_h" "$ac_includes_default" -if test "x$ac_cv_header_vorbis_codec_h" = xyes; then : + ac_fn_c_check_header_compile "$LINENO" "vorbis/codec.h" "ac_cv_header_vorbis_codec_h" "$ac_includes_default" +if test "x$ac_cv_header_vorbis_codec_h" = xyes +then : VORBIS_HEADER_FOUND=1 -else +else $as_nop VORBIS_HEADER_FOUND=0 fi - CPPFLAGS="${ast_ext_lib_check_saved_CPPFLAGS}" if test "x${VORBIS_HEADER_FOUND}" = "x0" ; then @@ -33757,8 +35771,8 @@ if test "x${PBX_VORBIS_OPEN_CALLBACKS}" != "x1" -a "${USE_VORBIS_OPEN_CALLBACKS}" != "no"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for OV_CALLBACKS_NOCLOSE declared in vorbis/vorbisfile.h" >&5 -$as_echo_n "checking for OV_CALLBACKS_NOCLOSE declared in vorbis/vorbisfile.h... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for OV_CALLBACKS_NOCLOSE declared in vorbis/vorbisfile.h" >&5 +printf %s "checking for OV_CALLBACKS_NOCLOSE declared in vorbis/vorbisfile.h... " >&6; } saved_cppflags="${CPPFLAGS}" if test "x${VORBIS_OPEN_CALLBACKS_DIR}" != "x"; then VORBIS_OPEN_CALLBACKS_INCLUDE="-I${VORBIS_OPEN_CALLBACKS_DIR}/include" @@ -33769,7 +35783,7 @@ /* end confdefs.h. */ #include int -main () +main (void) { #if !defined(OV_CALLBACKS_NOCLOSE) (void) OV_CALLBACKS_NOCLOSE; @@ -33779,21 +35793,22 @@ return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } +if ac_fn_c_try_compile "$LINENO" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } PBX_VORBIS_OPEN_CALLBACKS=1 -$as_echo "#define HAVE_VORBIS_OPEN_CALLBACKS 1" >>confdefs.h +printf "%s\n" "#define HAVE_VORBIS_OPEN_CALLBACKS 1" >>confdefs.h -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext CPPFLAGS="${saved_cppflags}" fi @@ -33807,8 +35822,8 @@ if test "${USE_VPB}" != "no"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for vpb_open in -lvpb" >&5 -$as_echo_n "checking for vpb_open in -lvpb... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for vpb_open in -lvpb" >&5 +printf %s "checking for vpb_open in -lvpb... " >&6; } saved_libs="${LIBS}" saved_cppflags="${CPPFLAGS}" if test "x${VPB_DIR}" != "x"; then @@ -33828,7 +35843,7 @@ #include int -main () +main (void) { int q = vpb_open(0,0); ; @@ -33836,19 +35851,20 @@ } _ACEOF -if ac_fn_cxx_try_link "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } +if ac_fn_cxx_try_link "$LINENO" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } ac_cv_lib_vpb_vpb_open="yes" -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } ac_cv_lib_vpb_vpb_open="no" fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS="${saved_libs}" CPPFLAGS="${saved_cppflags}" @@ -33860,7 +35876,7 @@ fi PBX_VPB=1 -$as_echo "#define HAVE_VPB 1" >>confdefs.h +printf "%s\n" "#define HAVE_VPB 1" >>confdefs.h fi fi @@ -33886,11 +35902,12 @@ ast_ext_lib_check_save_CFLAGS="${CFLAGS}" CFLAGS="${CFLAGS} " - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for compress in -lz" >&5 -$as_echo_n "checking for compress in -lz... " >&6; } -if ${ac_cv_lib_z_compress+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for compress in -lz" >&5 +printf %s "checking for compress in -lz... " >&6; } +if test ${ac_cv_lib_z_compress+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lz ${pbxlibdir} $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -33899,32 +35916,31 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char compress (); int -main () +main (void) { return compress (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_z_compress=yes -else +else $as_nop ac_cv_lib_z_compress=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_z_compress" >&5 -$as_echo "$ac_cv_lib_z_compress" >&6; } -if test "x$ac_cv_lib_z_compress" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_z_compress" >&5 +printf "%s\n" "$ac_cv_lib_z_compress" >&6; } +if test "x$ac_cv_lib_z_compress" = xyes +then : AST_ZLIB_FOUND=yes -else +else $as_nop AST_ZLIB_FOUND=no fi @@ -33943,14 +35959,14 @@ # check for the header ast_ext_lib_check_saved_CPPFLAGS="${CPPFLAGS}" CPPFLAGS="${CPPFLAGS} ${ZLIB_INCLUDE}" - ac_fn_c_check_header_mongrel "$LINENO" "zlib.h" "ac_cv_header_zlib_h" "$ac_includes_default" -if test "x$ac_cv_header_zlib_h" = xyes; then : + ac_fn_c_check_header_compile "$LINENO" "zlib.h" "ac_cv_header_zlib_h" "$ac_includes_default" +if test "x$ac_cv_header_zlib_h" = xyes +then : ZLIB_HEADER_FOUND=1 -else +else $as_nop ZLIB_HEADER_FOUND=0 fi - CPPFLAGS="${ast_ext_lib_check_saved_CPPFLAGS}" if test "x${ZLIB_HEADER_FOUND}" = "x0" ; then @@ -33971,46 +35987,45 @@ if test "x${PBX_UNIXODBC}" = "x1" -o "x${PBX_IODBC}" = "x1"; then # Does ODBC support wide characters? - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ODBC has support for Unicode types" >&5 -$as_echo_n "checking whether ODBC has support for Unicode types... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether ODBC has support for Unicode types" >&5 +printf %s "checking whether ODBC has support for Unicode types... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int -main () +main (void) { int foo = SQL_WCHAR ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } +if ac_fn_c_try_link "$LINENO" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } -$as_echo "#define HAVE_ODBC_WCHAR 1" >>confdefs.h +printf "%s\n" "#define HAVE_ODBC_WCHAR 1" >>confdefs.h -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext fi -ac_fn_c_check_header_mongrel "$LINENO" "linux/compiler.h" "ac_cv_header_linux_compiler_h" "$ac_includes_default" -if test "x$ac_cv_header_linux_compiler_h" = xyes; then : +ac_fn_c_check_header_compile "$LINENO" "linux/compiler.h" "ac_cv_header_linux_compiler_h" "$ac_includes_default" +if test "x$ac_cv_header_linux_compiler_h" = xyes +then : -cat >>confdefs.h <<_ACEOF -#define HAVE_LINUX_COMPILER_H 1 -_ACEOF +printf "%s\n" "#define HAVE_LINUX_COMPILER_H 1" >>confdefs.h fi - ac_fn_c_check_header_compile "$LINENO" "linux/ixjuser.h" "ac_cv_header_linux_ixjuser_h" " #include #ifdef HAVE_LINUX_COMPILER_H @@ -34018,20 +36033,20 @@ #endif " -if test "x$ac_cv_header_linux_ixjuser_h" = xyes; then : +if test "x$ac_cv_header_linux_ixjuser_h" = xyes +then : PBX_IXJUSER=1 -else +else $as_nop PBX_IXJUSER=0 fi - # Used in res/res_pktccops if test "x${PBX_MSG_NOSIGNAL}" != "x1"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for MSG_NOSIGNAL in sys/socket.h" >&5 -$as_echo_n "checking for MSG_NOSIGNAL in sys/socket.h... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for MSG_NOSIGNAL in sys/socket.h" >&5 +printf %s "checking for MSG_NOSIGNAL in sys/socket.h... " >&6; } saved_cppflags="${CPPFLAGS}" if test "x${MSG_NOSIGNAL_DIR}" != "x"; then MSG_NOSIGNAL_INCLUDE="-I${MSG_NOSIGNAL_DIR}/include" @@ -34042,7 +36057,7 @@ /* end confdefs.h. */ #include int -main () +main (void) { #if defined(MSG_NOSIGNAL) int foo = 0; @@ -34055,29 +36070,30 @@ return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } +if ac_fn_c_try_compile "$LINENO" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } PBX_MSG_NOSIGNAL=1 -$as_echo "#define HAVE_MSG_NOSIGNAL 1" >>confdefs.h +printf "%s\n" "#define HAVE_MSG_NOSIGNAL 1" >>confdefs.h -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext CPPFLAGS="${saved_cppflags}" fi if test "x${PBX_SO_NOSIGPIPE}" != "x1"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for SO_NOSIGPIPE in sys/socket.h" >&5 -$as_echo_n "checking for SO_NOSIGPIPE in sys/socket.h... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for SO_NOSIGPIPE in sys/socket.h" >&5 +printf %s "checking for SO_NOSIGPIPE in sys/socket.h... " >&6; } saved_cppflags="${CPPFLAGS}" if test "x${SO_NOSIGPIPE_DIR}" != "x"; then SO_NOSIGPIPE_INCLUDE="-I${SO_NOSIGPIPE_DIR}/include" @@ -34088,7 +36104,7 @@ /* end confdefs.h. */ #include int -main () +main (void) { #if defined(SO_NOSIGPIPE) int foo = 0; @@ -34101,21 +36117,22 @@ return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } +if ac_fn_c_try_compile "$LINENO" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } PBX_SO_NOSIGPIPE=1 -$as_echo "#define HAVE_SO_NOSIGPIPE 1" >>confdefs.h +printf "%s\n" "#define HAVE_SO_NOSIGPIPE 1" >>confdefs.h -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext CPPFLAGS="${saved_cppflags}" fi @@ -34127,11 +36144,12 @@ if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}sdl-config", so it can be a program name with args. set dummy ${ac_tool_prefix}sdl-config; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_CONFIG_SDL+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_CONFIG_SDL+y} +then : + printf %s "(cached) " >&6 +else $as_nop case $CONFIG_SDL in [\\/]* | ?:[\\/]*) ac_cv_path_CONFIG_SDL="$CONFIG_SDL" # Let the user override the test with a path. @@ -34142,11 +36160,15 @@ for as_dir in $as_dummy do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_CONFIG_SDL="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_CONFIG_SDL="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -34158,11 +36180,11 @@ fi CONFIG_SDL=$ac_cv_path_CONFIG_SDL if test -n "$CONFIG_SDL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CONFIG_SDL" >&5 -$as_echo "$CONFIG_SDL" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CONFIG_SDL" >&5 +printf "%s\n" "$CONFIG_SDL" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -34171,11 +36193,12 @@ ac_pt_CONFIG_SDL=$CONFIG_SDL # Extract the first word of "sdl-config", so it can be a program name with args. set dummy sdl-config; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_ac_pt_CONFIG_SDL+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_ac_pt_CONFIG_SDL+y} +then : + printf %s "(cached) " >&6 +else $as_nop case $ac_pt_CONFIG_SDL in [\\/]* | ?:[\\/]*) ac_cv_path_ac_pt_CONFIG_SDL="$ac_pt_CONFIG_SDL" # Let the user override the test with a path. @@ -34186,11 +36209,15 @@ for as_dir in $as_dummy do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_ac_pt_CONFIG_SDL="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_ac_pt_CONFIG_SDL="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -34202,11 +36229,11 @@ fi ac_pt_CONFIG_SDL=$ac_cv_path_ac_pt_CONFIG_SDL if test -n "$ac_pt_CONFIG_SDL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_CONFIG_SDL" >&5 -$as_echo "$ac_pt_CONFIG_SDL" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_pt_CONFIG_SDL" >&5 +printf "%s\n" "$ac_pt_CONFIG_SDL" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi if test "x$ac_pt_CONFIG_SDL" = x; then @@ -34214,8 +36241,8 @@ else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CONFIG_SDL=$ac_pt_CONFIG_SDL @@ -34234,7 +36261,7 @@ PBX_SDL=1 -$as_echo "#define HAVE_SDL 1" >>confdefs.h +printf "%s\n" "#define HAVE_SDL 1" >>confdefs.h fi @@ -34254,11 +36281,12 @@ ast_ext_lib_check_save_CFLAGS="${CFLAGS}" CFLAGS="${CFLAGS} ${SDL_INCLUDE}" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for IMG_Load in -lSDL_image" >&5 -$as_echo_n "checking for IMG_Load in -lSDL_image... " >&6; } -if ${ac_cv_lib_SDL_image_IMG_Load+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for IMG_Load in -lSDL_image" >&5 +printf %s "checking for IMG_Load in -lSDL_image... " >&6; } +if test ${ac_cv_lib_SDL_image_IMG_Load+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lSDL_image ${pbxlibdir} ${SDL_LIB} $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -34267,32 +36295,31 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char IMG_Load (); int -main () +main (void) { return IMG_Load (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_SDL_image_IMG_Load=yes -else +else $as_nop ac_cv_lib_SDL_image_IMG_Load=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_SDL_image_IMG_Load" >&5 -$as_echo "$ac_cv_lib_SDL_image_IMG_Load" >&6; } -if test "x$ac_cv_lib_SDL_image_IMG_Load" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_SDL_image_IMG_Load" >&5 +printf "%s\n" "$ac_cv_lib_SDL_image_IMG_Load" >&6; } +if test "x$ac_cv_lib_SDL_image_IMG_Load" = xyes +then : AST_SDL_IMAGE_FOUND=yes -else +else $as_nop AST_SDL_IMAGE_FOUND=no fi @@ -34311,14 +36338,14 @@ # check for the header ast_ext_lib_check_saved_CPPFLAGS="${CPPFLAGS}" CPPFLAGS="${CPPFLAGS} ${SDL_IMAGE_INCLUDE}" - ac_fn_c_check_header_mongrel "$LINENO" "SDL_image.h" "ac_cv_header_SDL_image_h" "$ac_includes_default" -if test "x$ac_cv_header_SDL_image_h" = xyes; then : + ac_fn_c_check_header_compile "$LINENO" "SDL_image.h" "ac_cv_header_SDL_image_h" "$ac_includes_default" +if test "x$ac_cv_header_SDL_image_h" = xyes +then : SDL_IMAGE_HEADER_FOUND=1 -else +else $as_nop SDL_IMAGE_HEADER_FOUND=0 fi - CPPFLAGS="${ast_ext_lib_check_saved_CPPFLAGS}" if test "x${SDL_IMAGE_HEADER_FOUND}" = "x0" ; then @@ -34350,11 +36377,12 @@ ast_ext_lib_check_save_CFLAGS="${CFLAGS}" CFLAGS="${CFLAGS} ${PTHREAD_CFLAGS}" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sws_getContext in -lavcodec" >&5 -$as_echo_n "checking for sws_getContext in -lavcodec... " >&6; } -if ${ac_cv_lib_avcodec_sws_getContext+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for sws_getContext in -lavcodec" >&5 +printf %s "checking for sws_getContext in -lavcodec... " >&6; } +if test ${ac_cv_lib_avcodec_sws_getContext+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lavcodec ${pbxlibdir} ${PTHREAD_LIBS} -lz -lm $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -34363,32 +36391,31 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char sws_getContext (); int -main () +main (void) { return sws_getContext (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_avcodec_sws_getContext=yes -else +else $as_nop ac_cv_lib_avcodec_sws_getContext=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_avcodec_sws_getContext" >&5 -$as_echo "$ac_cv_lib_avcodec_sws_getContext" >&6; } -if test "x$ac_cv_lib_avcodec_sws_getContext" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_avcodec_sws_getContext" >&5 +printf "%s\n" "$ac_cv_lib_avcodec_sws_getContext" >&6; } +if test "x$ac_cv_lib_avcodec_sws_getContext" = xyes +then : AST_FFMPEG_FOUND=yes -else +else $as_nop AST_FFMPEG_FOUND=no fi @@ -34407,14 +36434,14 @@ # check for the header ast_ext_lib_check_saved_CPPFLAGS="${CPPFLAGS}" CPPFLAGS="${CPPFLAGS} ${FFMPEG_INCLUDE}" - ac_fn_c_check_header_mongrel "$LINENO" "ffmpeg/avcodec.h" "ac_cv_header_ffmpeg_avcodec_h" "$ac_includes_default" -if test "x$ac_cv_header_ffmpeg_avcodec_h" = xyes; then : + ac_fn_c_check_header_compile "$LINENO" "ffmpeg/avcodec.h" "ac_cv_header_ffmpeg_avcodec_h" "$ac_includes_default" +if test "x$ac_cv_header_ffmpeg_avcodec_h" = xyes +then : FFMPEG_HEADER_FOUND=1 -else +else $as_nop FFMPEG_HEADER_FOUND=0 fi - CPPFLAGS="${ast_ext_lib_check_saved_CPPFLAGS}" if test "x${FFMPEG_HEADER_FOUND}" = "x0" ; then @@ -34434,17 +36461,15 @@ # possible places for video4linux version 1 -ac_fn_c_check_header_mongrel "$LINENO" "linux/videodev.h" "ac_cv_header_linux_videodev_h" "$ac_includes_default" -if test "x$ac_cv_header_linux_videodev_h" = xyes; then : +ac_fn_c_check_header_compile "$LINENO" "linux/videodev.h" "ac_cv_header_linux_videodev_h" "$ac_includes_default" +if test "x$ac_cv_header_linux_videodev_h" = xyes +then : -cat >>confdefs.h <<_ACEOF -#define HAVE_VIDEODEV_H 1 -_ACEOF +printf "%s\n" "#define HAVE_VIDEODEV_H 1" >>confdefs.h fi - # possible places for X11 if test "x${PBX_X11}" != "x1" -a "${USE_X11}" != "no"; then @@ -34460,11 +36485,12 @@ ast_ext_lib_check_save_CFLAGS="${CFLAGS}" CFLAGS="${CFLAGS} " - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XOpenDisplay in -lX11" >&5 -$as_echo_n "checking for XOpenDisplay in -lX11... " >&6; } -if ${ac_cv_lib_X11_XOpenDisplay+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for XOpenDisplay in -lX11" >&5 +printf %s "checking for XOpenDisplay in -lX11... " >&6; } +if test ${ac_cv_lib_X11_XOpenDisplay+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lX11 ${pbxlibdir} $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -34473,32 +36499,31 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char XOpenDisplay (); int -main () +main (void) { return XOpenDisplay (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_X11_XOpenDisplay=yes -else +else $as_nop ac_cv_lib_X11_XOpenDisplay=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_X11_XOpenDisplay" >&5 -$as_echo "$ac_cv_lib_X11_XOpenDisplay" >&6; } -if test "x$ac_cv_lib_X11_XOpenDisplay" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_X11_XOpenDisplay" >&5 +printf "%s\n" "$ac_cv_lib_X11_XOpenDisplay" >&6; } +if test "x$ac_cv_lib_X11_XOpenDisplay" = xyes +then : AST_X11_FOUND=yes -else +else $as_nop AST_X11_FOUND=no fi @@ -34517,14 +36542,14 @@ # check for the header ast_ext_lib_check_saved_CPPFLAGS="${CPPFLAGS}" CPPFLAGS="${CPPFLAGS} ${X11_INCLUDE}" - ac_fn_c_check_header_mongrel "$LINENO" "X11/Xlib.h" "ac_cv_header_X11_Xlib_h" "$ac_includes_default" -if test "x$ac_cv_header_X11_Xlib_h" = xyes; then : + ac_fn_c_check_header_compile "$LINENO" "X11/Xlib.h" "ac_cv_header_X11_Xlib_h" "$ac_includes_default" +if test "x$ac_cv_header_X11_Xlib_h" = xyes +then : X11_HEADER_FOUND=1 -else +else $as_nop X11_HEADER_FOUND=0 fi - CPPFLAGS="${ast_ext_lib_check_saved_CPPFLAGS}" if test "x${X11_HEADER_FOUND}" = "x0" ; then @@ -34560,11 +36585,12 @@ ast_ext_lib_check_save_CFLAGS="${CFLAGS}" CFLAGS="${CFLAGS} -I/usr/X11R6/include" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XOpenDisplay in -lX11" >&5 -$as_echo_n "checking for XOpenDisplay in -lX11... " >&6; } -if ${ac_cv_lib_X11_XOpenDisplay+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for XOpenDisplay in -lX11" >&5 +printf %s "checking for XOpenDisplay in -lX11... " >&6; } +if test ${ac_cv_lib_X11_XOpenDisplay+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lX11 ${pbxlibdir} $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -34573,32 +36599,31 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char XOpenDisplay (); int -main () +main (void) { return XOpenDisplay (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_X11_XOpenDisplay=yes -else +else $as_nop ac_cv_lib_X11_XOpenDisplay=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_X11_XOpenDisplay" >&5 -$as_echo "$ac_cv_lib_X11_XOpenDisplay" >&6; } -if test "x$ac_cv_lib_X11_XOpenDisplay" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_X11_XOpenDisplay" >&5 +printf "%s\n" "$ac_cv_lib_X11_XOpenDisplay" >&6; } +if test "x$ac_cv_lib_X11_XOpenDisplay" = xyes +then : AST_X11_FOUND=yes -else +else $as_nop AST_X11_FOUND=no fi @@ -34617,14 +36642,14 @@ # check for the header ast_ext_lib_check_saved_CPPFLAGS="${CPPFLAGS}" CPPFLAGS="${CPPFLAGS} ${X11_INCLUDE}" - ac_fn_c_check_header_mongrel "$LINENO" "X11/Xlib.h" "ac_cv_header_X11_Xlib_h" "$ac_includes_default" -if test "x$ac_cv_header_X11_Xlib_h" = xyes; then : + ac_fn_c_check_header_compile "$LINENO" "X11/Xlib.h" "ac_cv_header_X11_Xlib_h" "$ac_includes_default" +if test "x$ac_cv_header_X11_Xlib_h" = xyes +then : X11_HEADER_FOUND=1 -else +else $as_nop X11_HEADER_FOUND=0 fi - CPPFLAGS="${ast_ext_lib_check_saved_CPPFLAGS}" if test "x${X11_HEADER_FOUND}" = "x0" ; then @@ -34650,11 +36675,12 @@ PBX_LAUNCHD=0 if test "${cross_compiling}" = "no"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for /sbin/launchd" >&5 -$as_echo_n "checking for /sbin/launchd... " >&6; } -if ${ac_cv_file__sbin_launchd+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for /sbin/launchd" >&5 +printf %s "checking for /sbin/launchd... " >&6; } +if test ${ac_cv_file__sbin_launchd+y} +then : + printf %s "(cached) " >&6 +else $as_nop test "$cross_compiling" = yes && as_fn_error $? "cannot check for file existence when cross compiling" "$LINENO" 5 if test -r "/sbin/launchd"; then @@ -34663,12 +36689,13 @@ ac_cv_file__sbin_launchd=no fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_file__sbin_launchd" >&5 -$as_echo "$ac_cv_file__sbin_launchd" >&6; } -if test "x$ac_cv_file__sbin_launchd" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_file__sbin_launchd" >&5 +printf "%s\n" "$ac_cv_file__sbin_launchd" >&6; } +if test "x$ac_cv_file__sbin_launchd" = xyes +then : PBX_LAUNCHD=1 -$as_echo "#define HAVE_SBIN_LAUNCHD 1" >>confdefs.h +printf "%s\n" "#define HAVE_SBIN_LAUNCHD 1" >>confdefs.h fi @@ -34679,17 +36706,17 @@ if test "x${PBX_GTK2}" != "x1" -a "${USE_GTK2}" != "no"; then pkg_failed=no -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for GTK2" >&5 -$as_echo_n "checking for GTK2... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for gtk+-2.0" >&5 +printf %s "checking for gtk+-2.0... " >&6; } if test -n "$GTK2_CFLAGS"; then pkg_cv_GTK2_CFLAGS="$GTK2_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gtk+-2.0\""; } >&5 + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gtk+-2.0\""; } >&5 ($PKG_CONFIG --exists --print-errors "gtk+-2.0") 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_GTK2_CFLAGS=`$PKG_CONFIG --cflags "gtk+-2.0" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes @@ -34703,10 +36730,10 @@ pkg_cv_GTK2_LIBS="$GTK2_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gtk+-2.0\""; } >&5 + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gtk+-2.0\""; } >&5 ($PKG_CONFIG --exists --print-errors "gtk+-2.0") 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_GTK2_LIBS=`$PKG_CONFIG --libs "gtk+-2.0" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes @@ -34720,8 +36747,8 @@ if test $pkg_failed = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes @@ -34741,8 +36768,8 @@ elif test $pkg_failed = untried; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } PBX_GTK2=0 @@ -34750,14 +36777,14 @@ else GTK2_CFLAGS=$pkg_cv_GTK2_CFLAGS GTK2_LIBS=$pkg_cv_GTK2_LIBS - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } PBX_GTK2=1 GTK2_INCLUDE=$(echo ${GTK2_CFLAGS} | $SED -e "s|-std=c99||g") GTK2_LIB="$GTK2_LIBS" -$as_echo "#define HAVE_GTK2 1" >>confdefs.h +printf "%s\n" "#define HAVE_GTK2 1" >>confdefs.h fi @@ -34790,17 +36817,17 @@ if test "x${PBX_SYSTEMD}" != "x1" -a "${USE_SYSTEMD}" != "no"; then pkg_failed=no -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for SYSTEMD" >&5 -$as_echo_n "checking for SYSTEMD... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libsystemd" >&5 +printf %s "checking for libsystemd... " >&6; } if test -n "$SYSTEMD_CFLAGS"; then pkg_cv_SYSTEMD_CFLAGS="$SYSTEMD_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libsystemd\""; } >&5 + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libsystemd\""; } >&5 ($PKG_CONFIG --exists --print-errors "libsystemd") 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_SYSTEMD_CFLAGS=`$PKG_CONFIG --cflags "libsystemd" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes @@ -34814,10 +36841,10 @@ pkg_cv_SYSTEMD_LIBS="$SYSTEMD_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libsystemd\""; } >&5 + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libsystemd\""; } >&5 ($PKG_CONFIG --exists --print-errors "libsystemd") 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_SYSTEMD_LIBS=`$PKG_CONFIG --libs "libsystemd" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes @@ -34831,8 +36858,8 @@ if test $pkg_failed = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes @@ -34852,8 +36879,8 @@ elif test $pkg_failed = untried; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } PBX_SYSTEMD=0 @@ -34861,14 +36888,14 @@ else SYSTEMD_CFLAGS=$pkg_cv_SYSTEMD_CFLAGS SYSTEMD_LIBS=$pkg_cv_SYSTEMD_LIBS - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } PBX_SYSTEMD=1 SYSTEMD_INCLUDE=$(echo ${SYSTEMD_CFLAGS} | $SED -e "s|-std=c99||g") SYSTEMD_LIB="$SYSTEMD_LIBS" -$as_echo "#define HAVE_SYSTEMD 1" >>confdefs.h +printf "%s\n" "#define HAVE_SYSTEMD 1" >>confdefs.h fi @@ -34881,8 +36908,8 @@ # syslog facilities if test "x${PBX_SYSLOG_FACILITY_LOG_AUTH}" != "x1"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for LOG_AUTH in syslog.h" >&5 -$as_echo_n "checking for LOG_AUTH in syslog.h... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for LOG_AUTH in syslog.h" >&5 +printf %s "checking for LOG_AUTH in syslog.h... " >&6; } saved_cppflags="${CPPFLAGS}" if test "x${SYSLOG_FACILITY_LOG_AUTH_DIR}" != "x"; then SYSLOG_FACILITY_LOG_AUTH_INCLUDE="-I${SYSLOG_FACILITY_LOG_AUTH_DIR}/include" @@ -34893,7 +36920,7 @@ /* end confdefs.h. */ #include int -main () +main (void) { #if defined(LOG_AUTH) int foo = 0; @@ -34906,29 +36933,30 @@ return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } +if ac_fn_c_try_compile "$LINENO" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } PBX_SYSLOG_FACILITY_LOG_AUTH=1 -$as_echo "#define HAVE_SYSLOG_FACILITY_LOG_AUTH 1" >>confdefs.h +printf "%s\n" "#define HAVE_SYSLOG_FACILITY_LOG_AUTH 1" >>confdefs.h -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext CPPFLAGS="${saved_cppflags}" fi if test "x${PBX_SYSLOG_FACILITY_LOG_AUTHPRIV}" != "x1"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for LOG_AUTHPRIV in syslog.h" >&5 -$as_echo_n "checking for LOG_AUTHPRIV in syslog.h... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for LOG_AUTHPRIV in syslog.h" >&5 +printf %s "checking for LOG_AUTHPRIV in syslog.h... " >&6; } saved_cppflags="${CPPFLAGS}" if test "x${SYSLOG_FACILITY_LOG_AUTHPRIV_DIR}" != "x"; then SYSLOG_FACILITY_LOG_AUTHPRIV_INCLUDE="-I${SYSLOG_FACILITY_LOG_AUTHPRIV_DIR}/include" @@ -34939,7 +36967,7 @@ /* end confdefs.h. */ #include int -main () +main (void) { #if defined(LOG_AUTHPRIV) int foo = 0; @@ -34952,29 +36980,30 @@ return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } +if ac_fn_c_try_compile "$LINENO" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } PBX_SYSLOG_FACILITY_LOG_AUTHPRIV=1 -$as_echo "#define HAVE_SYSLOG_FACILITY_LOG_AUTHPRIV 1" >>confdefs.h +printf "%s\n" "#define HAVE_SYSLOG_FACILITY_LOG_AUTHPRIV 1" >>confdefs.h -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext CPPFLAGS="${saved_cppflags}" fi if test "x${PBX_SYSLOG_FACILITY_LOG_CRON}" != "x1"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for LOG_CRON in syslog.h" >&5 -$as_echo_n "checking for LOG_CRON in syslog.h... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for LOG_CRON in syslog.h" >&5 +printf %s "checking for LOG_CRON in syslog.h... " >&6; } saved_cppflags="${CPPFLAGS}" if test "x${SYSLOG_FACILITY_LOG_CRON_DIR}" != "x"; then SYSLOG_FACILITY_LOG_CRON_INCLUDE="-I${SYSLOG_FACILITY_LOG_CRON_DIR}/include" @@ -34985,7 +37014,7 @@ /* end confdefs.h. */ #include int -main () +main (void) { #if defined(LOG_CRON) int foo = 0; @@ -34998,29 +37027,30 @@ return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } +if ac_fn_c_try_compile "$LINENO" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } PBX_SYSLOG_FACILITY_LOG_CRON=1 -$as_echo "#define HAVE_SYSLOG_FACILITY_LOG_CRON 1" >>confdefs.h +printf "%s\n" "#define HAVE_SYSLOG_FACILITY_LOG_CRON 1" >>confdefs.h -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext CPPFLAGS="${saved_cppflags}" fi if test "x${PBX_SYSLOG_FACILITY_LOG_DAEMON}" != "x1"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for LOG_DAEMON in syslog.h" >&5 -$as_echo_n "checking for LOG_DAEMON in syslog.h... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for LOG_DAEMON in syslog.h" >&5 +printf %s "checking for LOG_DAEMON in syslog.h... " >&6; } saved_cppflags="${CPPFLAGS}" if test "x${SYSLOG_FACILITY_LOG_DAEMON_DIR}" != "x"; then SYSLOG_FACILITY_LOG_DAEMON_INCLUDE="-I${SYSLOG_FACILITY_LOG_DAEMON_DIR}/include" @@ -35031,7 +37061,7 @@ /* end confdefs.h. */ #include int -main () +main (void) { #if defined(LOG_DAEMON) int foo = 0; @@ -35044,29 +37074,30 @@ return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } +if ac_fn_c_try_compile "$LINENO" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } PBX_SYSLOG_FACILITY_LOG_DAEMON=1 -$as_echo "#define HAVE_SYSLOG_FACILITY_LOG_DAEMON 1" >>confdefs.h +printf "%s\n" "#define HAVE_SYSLOG_FACILITY_LOG_DAEMON 1" >>confdefs.h -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext CPPFLAGS="${saved_cppflags}" fi if test "x${PBX_SYSLOG_FACILITY_LOG_FTP}" != "x1"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for LOG_FTP in syslog.h" >&5 -$as_echo_n "checking for LOG_FTP in syslog.h... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for LOG_FTP in syslog.h" >&5 +printf %s "checking for LOG_FTP in syslog.h... " >&6; } saved_cppflags="${CPPFLAGS}" if test "x${SYSLOG_FACILITY_LOG_FTP_DIR}" != "x"; then SYSLOG_FACILITY_LOG_FTP_INCLUDE="-I${SYSLOG_FACILITY_LOG_FTP_DIR}/include" @@ -35077,7 +37108,7 @@ /* end confdefs.h. */ #include int -main () +main (void) { #if defined(LOG_FTP) int foo = 0; @@ -35090,29 +37121,30 @@ return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } +if ac_fn_c_try_compile "$LINENO" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } PBX_SYSLOG_FACILITY_LOG_FTP=1 -$as_echo "#define HAVE_SYSLOG_FACILITY_LOG_FTP 1" >>confdefs.h +printf "%s\n" "#define HAVE_SYSLOG_FACILITY_LOG_FTP 1" >>confdefs.h -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext CPPFLAGS="${saved_cppflags}" fi if test "x${PBX_SYSLOG_FACILITY_LOG_KERN}" != "x1"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for LOG_KERN in syslog.h" >&5 -$as_echo_n "checking for LOG_KERN in syslog.h... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for LOG_KERN in syslog.h" >&5 +printf %s "checking for LOG_KERN in syslog.h... " >&6; } saved_cppflags="${CPPFLAGS}" if test "x${SYSLOG_FACILITY_LOG_KERN_DIR}" != "x"; then SYSLOG_FACILITY_LOG_KERN_INCLUDE="-I${SYSLOG_FACILITY_LOG_KERN_DIR}/include" @@ -35123,7 +37155,7 @@ /* end confdefs.h. */ #include int -main () +main (void) { #if defined(LOG_KERN) int foo = 0; @@ -35136,29 +37168,30 @@ return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } +if ac_fn_c_try_compile "$LINENO" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } PBX_SYSLOG_FACILITY_LOG_KERN=1 -$as_echo "#define HAVE_SYSLOG_FACILITY_LOG_KERN 1" >>confdefs.h +printf "%s\n" "#define HAVE_SYSLOG_FACILITY_LOG_KERN 1" >>confdefs.h -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext CPPFLAGS="${saved_cppflags}" fi if test "x${PBX_SYSLOG_FACILITY_LOG_LPR}" != "x1"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for LOG_LPR in syslog.h" >&5 -$as_echo_n "checking for LOG_LPR in syslog.h... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for LOG_LPR in syslog.h" >&5 +printf %s "checking for LOG_LPR in syslog.h... " >&6; } saved_cppflags="${CPPFLAGS}" if test "x${SYSLOG_FACILITY_LOG_LPR_DIR}" != "x"; then SYSLOG_FACILITY_LOG_LPR_INCLUDE="-I${SYSLOG_FACILITY_LOG_LPR_DIR}/include" @@ -35169,7 +37202,7 @@ /* end confdefs.h. */ #include int -main () +main (void) { #if defined(LOG_LPR) int foo = 0; @@ -35182,29 +37215,30 @@ return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } +if ac_fn_c_try_compile "$LINENO" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } PBX_SYSLOG_FACILITY_LOG_LPR=1 -$as_echo "#define HAVE_SYSLOG_FACILITY_LOG_LPR 1" >>confdefs.h +printf "%s\n" "#define HAVE_SYSLOG_FACILITY_LOG_LPR 1" >>confdefs.h -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext CPPFLAGS="${saved_cppflags}" fi if test "x${PBX_SYSLOG_FACILITY_LOG_MAIL}" != "x1"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for LOG_MAIL in syslog.h" >&5 -$as_echo_n "checking for LOG_MAIL in syslog.h... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for LOG_MAIL in syslog.h" >&5 +printf %s "checking for LOG_MAIL in syslog.h... " >&6; } saved_cppflags="${CPPFLAGS}" if test "x${SYSLOG_FACILITY_LOG_MAIL_DIR}" != "x"; then SYSLOG_FACILITY_LOG_MAIL_INCLUDE="-I${SYSLOG_FACILITY_LOG_MAIL_DIR}/include" @@ -35215,7 +37249,7 @@ /* end confdefs.h. */ #include int -main () +main (void) { #if defined(LOG_MAIL) int foo = 0; @@ -35228,29 +37262,30 @@ return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } +if ac_fn_c_try_compile "$LINENO" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } PBX_SYSLOG_FACILITY_LOG_MAIL=1 -$as_echo "#define HAVE_SYSLOG_FACILITY_LOG_MAIL 1" >>confdefs.h +printf "%s\n" "#define HAVE_SYSLOG_FACILITY_LOG_MAIL 1" >>confdefs.h -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext CPPFLAGS="${saved_cppflags}" fi if test "x${PBX_SYSLOG_FACILITY_LOG_NEWS}" != "x1"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for LOG_NEWS in syslog.h" >&5 -$as_echo_n "checking for LOG_NEWS in syslog.h... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for LOG_NEWS in syslog.h" >&5 +printf %s "checking for LOG_NEWS in syslog.h... " >&6; } saved_cppflags="${CPPFLAGS}" if test "x${SYSLOG_FACILITY_LOG_NEWS_DIR}" != "x"; then SYSLOG_FACILITY_LOG_NEWS_INCLUDE="-I${SYSLOG_FACILITY_LOG_NEWS_DIR}/include" @@ -35261,7 +37296,7 @@ /* end confdefs.h. */ #include int -main () +main (void) { #if defined(LOG_NEWS) int foo = 0; @@ -35274,29 +37309,30 @@ return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } +if ac_fn_c_try_compile "$LINENO" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } PBX_SYSLOG_FACILITY_LOG_NEWS=1 -$as_echo "#define HAVE_SYSLOG_FACILITY_LOG_NEWS 1" >>confdefs.h +printf "%s\n" "#define HAVE_SYSLOG_FACILITY_LOG_NEWS 1" >>confdefs.h -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext CPPFLAGS="${saved_cppflags}" fi if test "x${PBX_SYSLOG_FACILITY_LOG_SYSLOG}" != "x1"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for LOG_SYSLOG in syslog.h" >&5 -$as_echo_n "checking for LOG_SYSLOG in syslog.h... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for LOG_SYSLOG in syslog.h" >&5 +printf %s "checking for LOG_SYSLOG in syslog.h... " >&6; } saved_cppflags="${CPPFLAGS}" if test "x${SYSLOG_FACILITY_LOG_SYSLOG_DIR}" != "x"; then SYSLOG_FACILITY_LOG_SYSLOG_INCLUDE="-I${SYSLOG_FACILITY_LOG_SYSLOG_DIR}/include" @@ -35307,7 +37343,7 @@ /* end confdefs.h. */ #include int -main () +main (void) { #if defined(LOG_SYSLOG) int foo = 0; @@ -35320,29 +37356,30 @@ return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } +if ac_fn_c_try_compile "$LINENO" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } PBX_SYSLOG_FACILITY_LOG_SYSLOG=1 -$as_echo "#define HAVE_SYSLOG_FACILITY_LOG_SYSLOG 1" >>confdefs.h +printf "%s\n" "#define HAVE_SYSLOG_FACILITY_LOG_SYSLOG 1" >>confdefs.h -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext CPPFLAGS="${saved_cppflags}" fi if test "x${PBX_SYSLOG_FACILITY_LOG_UUCP}" != "x1"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for LOG_UUCP in syslog.h" >&5 -$as_echo_n "checking for LOG_UUCP in syslog.h... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for LOG_UUCP in syslog.h" >&5 +printf %s "checking for LOG_UUCP in syslog.h... " >&6; } saved_cppflags="${CPPFLAGS}" if test "x${SYSLOG_FACILITY_LOG_UUCP_DIR}" != "x"; then SYSLOG_FACILITY_LOG_UUCP_INCLUDE="-I${SYSLOG_FACILITY_LOG_UUCP_DIR}/include" @@ -35353,7 +37390,7 @@ /* end confdefs.h. */ #include int -main () +main (void) { #if defined(LOG_UUCP) int foo = 0; @@ -35366,21 +37403,22 @@ return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } +if ac_fn_c_try_compile "$LINENO" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } PBX_SYSLOG_FACILITY_LOG_UUCP=1 -$as_echo "#define HAVE_SYSLOG_FACILITY_LOG_UUCP 1" >>confdefs.h +printf "%s\n" "#define HAVE_SYSLOG_FACILITY_LOG_UUCP 1" >>confdefs.h -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext CPPFLAGS="${saved_cppflags}" fi @@ -35399,11 +37437,12 @@ # conf_bridge (binaural rendering): check if HRIRs are available # this check does not work when cross-compiling if test "${cross_compiling}" = "no"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for bridges/bridge_softmix/include/hrirs.h" >&5 -$as_echo_n "checking for bridges/bridge_softmix/include/hrirs.h... " >&6; } -if ${ac_cv_file_bridges_bridge_softmix_include_hrirs_h+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for bridges/bridge_softmix/include/hrirs.h" >&5 +printf %s "checking for bridges/bridge_softmix/include/hrirs.h... " >&6; } +if test ${ac_cv_file_bridges_bridge_softmix_include_hrirs_h+y} +then : + printf %s "(cached) " >&6 +else $as_nop test "$cross_compiling" = yes && as_fn_error $? "cannot check for file existence when cross compiling" "$LINENO" 5 if test -r "bridges/bridge_softmix/include/hrirs.h"; then @@ -35412,13 +37451,12 @@ ac_cv_file_bridges_bridge_softmix_include_hrirs_h=no fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_file_bridges_bridge_softmix_include_hrirs_h" >&5 -$as_echo "$ac_cv_file_bridges_bridge_softmix_include_hrirs_h" >&6; } -if test "x$ac_cv_file_bridges_bridge_softmix_include_hrirs_h" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_file_bridges_bridge_softmix_include_hrirs_h" >&5 +printf "%s\n" "$ac_cv_file_bridges_bridge_softmix_include_hrirs_h" >&6; } +if test "x$ac_cv_file_bridges_bridge_softmix_include_hrirs_h" = xyes +then : -cat >>confdefs.h <<_ACEOF -#define HAVE_BRIDGES_BRIDGE_SOFTMIX_INCLUDE_HRIRS_H 1 -_ACEOF +printf "%s\n" "#define HAVE_BRIDGES_BRIDGE_SOFTMIX_INCLUDE_HRIRS_H 1" >>confdefs.h fi @@ -35427,30 +37465,30 @@ ac_config_files="$ac_config_files build_tools/menuselect-deps makeopts" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for mandatory modules: ${ac_mandatory_list}" >&5 -$as_echo_n "checking for mandatory modules: ${ac_mandatory_list}... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for mandatory modules: ${ac_mandatory_list}" >&5 +printf %s "checking for mandatory modules: ${ac_mandatory_list}... " >&6; } err=0; for i in ${ac_mandatory_list}; do eval "a=\${PBX_$i}" if test "x${a}" = "x1" ; then continue; fi - if test ${err} = "0" ; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: fail" >&5 -$as_echo "fail" >&6; } ; fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: " >&5 -$as_echo "" >&6; } + if test ${err} = "0" ; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: fail" >&5 +printf "%s\n" "fail" >&6; } ; fi + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: " >&5 +printf "%s\n" "" >&6; } eval "a=\${${i}_OPTION}" - { $as_echo "$as_me:${as_lineno-$LINENO}: ***" >&5 -$as_echo "$as_me: ***" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: *** The $i installation appears to be missing or broken." >&5 -$as_echo "$as_me: *** The $i installation appears to be missing or broken." >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: *** Either correct the installation, or run configure" >&5 -$as_echo "$as_me: *** Either correct the installation, or run configure" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: *** including --without-${a}." >&5 -$as_echo "$as_me: *** including --without-${a}." >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: ***" >&5 +printf "%s\n" "$as_me: ***" >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: *** The $i installation appears to be missing or broken." >&5 +printf "%s\n" "$as_me: *** The $i installation appears to be missing or broken." >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: *** Either correct the installation, or run configure" >&5 +printf "%s\n" "$as_me: *** Either correct the installation, or run configure" >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: *** including --without-${a}." >&5 +printf "%s\n" "$as_me: *** including --without-${a}." >&6;} err=1 done if test $err = 1 ; then exit 1; fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 -$as_echo "ok" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: ok" >&5 +printf "%s\n" "ok" >&6; } if test -f build_tools/menuselect-deps; then @@ -35490,8 +37528,8 @@ case $ac_val in #( *${as_nl}*) case $ac_var in #( - *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 -$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + *_cv_*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 +printf "%s\n" "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( @@ -35521,15 +37559,15 @@ /^ac_cv_env_/b end t clear :clear - s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ + s/^\([^=]*\)=\(.*[{}].*\)$/test ${\1+y} || &/ t end s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then if test "x$cache_file" != "x/dev/null"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 -$as_echo "$as_me: updating cache $cache_file" >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 +printf "%s\n" "$as_me: updating cache $cache_file" >&6;} if test ! -f "$cache_file" || test -h "$cache_file"; then cat confcache >"$cache_file" else @@ -35543,8 +37581,8 @@ fi fi else - { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 -$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 +printf "%s\n" "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache @@ -35561,7 +37599,7 @@ for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' - ac_i=`$as_echo "$ac_i" | sed "$ac_script"` + ac_i=`printf "%s\n" "$ac_i" | sed "$ac_script"` # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR # will be set to the directory where LIBOBJS objects are built. as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" @@ -35577,8 +37615,8 @@ ac_write_fail=0 ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" -{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 -$as_echo "$as_me: creating $CONFIG_STATUS" >&6;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 +printf "%s\n" "$as_me: creating $CONFIG_STATUS" >&6;} as_write_fail=0 cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 #! $SHELL @@ -35601,14 +37639,16 @@ # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : +as_nop=: +if test ${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1 +then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST -else +else $as_nop case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( @@ -35618,46 +37658,46 @@ fi + +# Reset variables that may have inherited troublesome values from +# the environment. + +# IFS needs to be set, to space, tab, and newline, in precisely that order. +# (If _AS_PATH_WALK were called with IFS unset, it would have the +# side effect of setting IFS to empty, thus disabling word splitting.) +# Quoting is to prevent editors from complaining about space-tab. as_nl=' ' export as_nl -# Printing a long string crashes Solaris 7 /usr/bin/printf. -as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' -as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo -as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo -# Prefer a ksh shell builtin over an external printf program on Solaris, -# but without wasting forks for bash or zsh. -if test -z "$BASH_VERSION$ZSH_VERSION" \ - && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then - as_echo='print -r --' - as_echo_n='print -rn --' -elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then - as_echo='printf %s\n' - as_echo_n='printf %s' -else - if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then - as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' - as_echo_n='/usr/ucb/echo -n' - else - as_echo_body='eval expr "X$1" : "X\\(.*\\)"' - as_echo_n_body='eval - arg=$1; - case $arg in #( - *"$as_nl"*) - expr "X$arg" : "X\\(.*\\)$as_nl"; - arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; - esac; - expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" - ' - export as_echo_n_body - as_echo_n='sh -c $as_echo_n_body as_echo' - fi - export as_echo_body - as_echo='sh -c $as_echo_body as_echo' -fi +IFS=" "" $as_nl" + +PS1='$ ' +PS2='> ' +PS4='+ ' + +# Ensure predictable behavior from utilities with locale-dependent output. +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# We cannot yet rely on "unset" to work, but we need these variables +# to be unset--not just set to an empty or harmless value--now, to +# avoid bugs in old shells (e.g. pre-3.0 UWIN ksh). This construct +# also avoids known problems related to "unset" and subshell syntax +# in other old shells (e.g. bash 2.01 and pdksh 5.2.14). +for as_var in BASH_ENV ENV MAIL MAILPATH CDPATH +do eval test \${$as_var+y} \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : +done + +# Ensure that fds 0, 1, and 2 are open. +if (exec 3>&0) 2>/dev/null; then :; else exec 0&1) 2>/dev/null; then :; else exec 1>/dev/null; fi +if (exec 3>&2) ; then :; else exec 2>/dev/null; fi # The user is always right. -if test "${PATH_SEPARATOR+set}" != set; then +if ${PATH_SEPARATOR+false} :; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || @@ -35666,13 +37706,6 @@ fi -# IFS -# We need space, tab and new line, in precisely that order. Quoting is -# there to prevent editors from complaining about space-tab. -# (If _AS_PATH_WALK were called with IFS unset, it would disable word -# splitting by setting IFS to empty value.) -IFS=" "" $as_nl" - # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( @@ -35681,8 +37714,12 @@ for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + test -r "$as_dir$0" && as_myself=$as_dir$0 && break done IFS=$as_save_IFS @@ -35694,30 +37731,10 @@ as_myself=$0 fi if test ! -f "$as_myself"; then - $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + printf "%s\n" "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi -# Unset variables that we do not need and which cause bugs (e.g. in -# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" -# suppresses any "Segmentation fault" message there. '((' could -# trigger a bug in pdksh 5.2.14. -for as_var in BASH_ENV ENV MAIL MAILPATH -do eval test x\${$as_var+set} = xset \ - && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : -done -PS1='$ ' -PS2='> ' -PS4='+ ' - -# NLS nuisances. -LC_ALL=C -export LC_ALL -LANGUAGE=C -export LANGUAGE - -# CDPATH. -(unset CDPATH) >/dev/null 2>&1 && unset CDPATH # as_fn_error STATUS ERROR [LINENO LOG_FD] @@ -35730,13 +37747,14 @@ as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi - $as_echo "$as_me: error: $2" >&2 + printf "%s\n" "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error + # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. @@ -35763,18 +37781,20 @@ { eval $1=; unset $1;} } as_unset=as_fn_unset + # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. -if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null +then : eval 'as_fn_append () { eval $1+=\$2 }' -else +else $as_nop as_fn_append () { eval $1=\$$1\$2 @@ -35786,12 +37806,13 @@ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. -if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null +then : eval 'as_fn_arith () { as_val=$(( $* )) }' -else +else $as_nop as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` @@ -35822,7 +37843,7 @@ $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X/"$0" | +printf "%s\n" X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q @@ -35844,6 +37865,10 @@ as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits + +# Determine whether it's possible to make 'echo' print without a newline. +# These variables are no longer used directly by Autoconf, but are AC_SUBSTed +# for compatibility with existing Makefiles. ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) @@ -35857,6 +37882,12 @@ ECHO_N='-n';; esac +# For backward compatibility with old third-party macros, we provide +# the shell variables $as_echo and $as_echo_n. New code should use +# AS_ECHO(["message"]) and AS_ECHO_N(["message"]), respectively. +as_echo='printf %s\n' +as_echo_n='printf %s' + rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file @@ -35898,7 +37929,7 @@ as_dirs= while :; do case $as_dir in #( - *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *\'*) as_qdir=`printf "%s\n" "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" @@ -35907,7 +37938,7 @@ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$as_dir" | +printf "%s\n" X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q @@ -35970,7 +38001,7 @@ # values after options handling. ac_log=" This file was extended by asterisk $as_me trunk, which was -generated by GNU Autoconf 2.69. Invocation command line was +generated by GNU Autoconf 2.71. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS @@ -36028,14 +38059,16 @@ Report bugs to ." _ACEOF +ac_cs_config=`printf "%s\n" "$ac_configure_args" | sed "$ac_safe_unquote"` +ac_cs_config_escaped=`printf "%s\n" "$ac_cs_config" | sed "s/^ //; s/'/'\\\\\\\\''/g"` cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" +ac_cs_config='$ac_cs_config_escaped' ac_cs_version="\\ asterisk config.status trunk -configured by $0, generated by GNU Autoconf 2.69, +configured by $0, generated by GNU Autoconf 2.71, with options \\"\$ac_cs_config\\" -Copyright (C) 2012 Free Software Foundation, Inc. +Copyright (C) 2021 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." @@ -36074,15 +38107,15 @@ -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) - $as_echo "$ac_cs_version"; exit ;; + printf "%s\n" "$ac_cs_version"; exit ;; --config | --confi | --conf | --con | --co | --c ) - $as_echo "$ac_cs_config"; exit ;; + printf "%s\n" "$ac_cs_config"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift case $ac_optarg in - *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + *\'*) ac_optarg=`printf "%s\n" "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; '') as_fn_error $? "missing file argument" ;; esac as_fn_append CONFIG_FILES " '$ac_optarg'" @@ -36090,7 +38123,7 @@ --header | --heade | --head | --hea ) $ac_shift case $ac_optarg in - *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + *\'*) ac_optarg=`printf "%s\n" "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; esac as_fn_append CONFIG_HEADERS " '$ac_optarg'" ac_need_defaults=false;; @@ -36099,7 +38132,7 @@ as_fn_error $? "ambiguous option: \`$1' Try \`$0 --help' for more information.";; --help | --hel | -h ) - $as_echo "$ac_cs_usage"; exit ;; + printf "%s\n" "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; @@ -36127,7 +38160,7 @@ if \$ac_cs_recheck; then set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion shift - \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 + \printf "%s\n" "running CONFIG_SHELL=$SHELL \$*" >&6 CONFIG_SHELL='$SHELL' export CONFIG_SHELL exec "\$@" @@ -36141,7 +38174,7 @@ sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX - $as_echo "$ac_log" + printf "%s\n" "$ac_log" } >&5 _ACEOF @@ -36168,8 +38201,8 @@ # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then - test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files - test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers + test ${CONFIG_FILES+y} || CONFIG_FILES=$config_files + test ${CONFIG_HEADERS+y} || CONFIG_HEADERS=$config_headers fi # Have a temporary directory for convenience. Make it in the build tree @@ -36505,7 +38538,7 @@ esac || as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; esac - case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac + case $ac_f in *\'*) ac_f=`printf "%s\n" "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac as_fn_append ac_file_inputs " '$ac_f'" done @@ -36513,17 +38546,17 @@ # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ configure_input='Generated from '` - $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' + printf "%s\n" "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' `' by configure.' if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" - { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 -$as_echo "$as_me: creating $ac_file" >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 +printf "%s\n" "$as_me: creating $ac_file" >&6;} fi # Neutralize special characters interpreted by sed in replacement strings. case $configure_input in #( *\&* | *\|* | *\\* ) - ac_sed_conf_input=`$as_echo "$configure_input" | + ac_sed_conf_input=`printf "%s\n" "$configure_input" | sed 's/[\\\\&|]/\\\\&/g'`;; #( *) ac_sed_conf_input=$configure_input;; esac @@ -36540,7 +38573,7 @@ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$ac_file" | +printf "%s\n" X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q @@ -36564,9 +38597,9 @@ case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) - ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` + ac_dir_suffix=/`printf "%s\n" "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. - ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + ac_top_builddir_sub=`printf "%s\n" "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; @@ -36623,8 +38656,8 @@ case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 -$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 +printf "%s\n" "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_datarootdir_hack=' @@ -36667,9 +38700,9 @@ { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ "$ac_tmp/out"`; test -z "$ac_out"; } && - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&5 -$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' +printf "%s\n" "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&2;} rm -f "$ac_tmp/stdin" @@ -36685,20 +38718,20 @@ # if test x"$ac_file" != x-; then { - $as_echo "/* $configure_input */" \ + printf "%s\n" "/* $configure_input */" >&1 \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" } >"$ac_tmp/config.h" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then - { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 -$as_echo "$as_me: $ac_file is unchanged" >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 +printf "%s\n" "$as_me: $ac_file is unchanged" >&6;} else rm -f "$ac_file" mv "$ac_tmp/config.h" "$ac_file" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 fi else - $as_echo "/* $configure_input */" \ + printf "%s\n" "/* $configure_input */" >&1 \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \ || as_fn_error $? "could not create -" "$LINENO" 5 fi @@ -36739,8 +38772,8 @@ $ac_cs_success || as_fn_exit 1 fi if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 -$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 +printf "%s\n" "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} fi @@ -36789,17 +38822,18 @@ echo fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: Package configured for: " >&5 -$as_echo "$as_me: Package configured for: " >&6;} -{ $as_echo "$as_me:${as_lineno-$LINENO}: OS type : $host_os" >&5 -$as_echo "$as_me: OS type : $host_os" >&6;} -{ $as_echo "$as_me:${as_lineno-$LINENO}: Host CPU : $host_cpu" >&5 -$as_echo "$as_me: Host CPU : $host_cpu" >&6;} -{ $as_echo "$as_me:${as_lineno-$LINENO}: build-cpu:vendor:os: $build_cpu : $build_vendor : $build_os :" >&5 -$as_echo "$as_me: build-cpu:vendor:os: $build_cpu : $build_vendor : $build_os :" >&6;} -{ $as_echo "$as_me:${as_lineno-$LINENO}: host-cpu:vendor:os: $host_cpu : $host_vendor : $host_os :" >&5 -$as_echo "$as_me: host-cpu:vendor:os: $host_cpu : $host_vendor : $host_os :" >&6;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: Package configured for: " >&5 +printf "%s\n" "$as_me: Package configured for: " >&6;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: OS type : $host_os" >&5 +printf "%s\n" "$as_me: OS type : $host_os" >&6;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: Host CPU : $host_cpu" >&5 +printf "%s\n" "$as_me: Host CPU : $host_cpu" >&6;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: build-cpu:vendor:os: $build_cpu : $build_vendor : $build_os :" >&5 +printf "%s\n" "$as_me: build-cpu:vendor:os: $build_cpu : $build_vendor : $build_os :" >&6;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: host-cpu:vendor:os: $host_cpu : $host_vendor : $host_os :" >&5 +printf "%s\n" "$as_me: host-cpu:vendor:os: $host_cpu : $host_vendor : $host_os :" >&6;} if test "${cross_compiling}" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Cross Compilation = YES" >&5 -$as_echo "$as_me: Cross Compilation = YES" >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: Cross Compilation = YES" >&5 +printf "%s\n" "$as_me: Cross Compilation = YES" >&6;} fi + diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/configure.ac asterisk-18.12.0~dfsg+~cs6.12.40431413/configure.ac --- asterisk-18.11.2~dfsg+~cs6.10.40431413/configure.ac 2022-04-14 21:53:34.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/configure.ac 2022-05-12 11:50:59.000000000 +0000 @@ -744,6 +744,7 @@ # See if clock_gettime is in librt AST_EXT_LIB_CHECK([RT], [rt], [clock_gettime], []) +AST_PKG_CONFIG_CHECK([LIBXML2], [libxml-2.0]) AST_EXT_TOOL_CHECK([LIBXML2], [xml2-config], , , [#include #include ], diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/contrib/ast-db-manage/config/versions/0bee61aa9425_allow_180_ringing_with_sdp.py asterisk-18.12.0~dfsg+~cs6.12.40431413/contrib/ast-db-manage/config/versions/0bee61aa9425_allow_180_ringing_with_sdp.py --- asterisk-18.11.2~dfsg+~cs6.10.40431413/contrib/ast-db-manage/config/versions/0bee61aa9425_allow_180_ringing_with_sdp.py 1970-01-01 00:00:00.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/contrib/ast-db-manage/config/versions/0bee61aa9425_allow_180_ringing_with_sdp.py 2022-05-12 11:50:59.000000000 +0000 @@ -0,0 +1,36 @@ +"""allow_sending_180_after_183 + +Revision ID: 0bee61aa9425 +Revises: 8f72185e437f +Create Date: 2022-04-07 13:51:33.400664 + +""" +from alembic import op +import sqlalchemy as sa +from sqlalchemy.dialects.postgresql import ENUM + +# revision identifiers, used by Alembic. +revision = '0bee61aa9425' +down_revision = '8f72185e437f' +AST_BOOL_NAME = 'ast_bool_values' +# We'll just ignore the n/y and f/t abbreviations as Asterisk does not write +# those aliases. +AST_BOOL_VALUES = [ '0', '1', + 'off', 'on', + 'false', 'true', + 'no', 'yes' ] + +def upgrade(): + ############################# Enums ############################## + + # ast_bool_values has already been created, so use postgres enum object + # type to get around "already created" issue - works okay with mysql + ast_bool_values = ENUM(*AST_BOOL_VALUES, name=AST_BOOL_NAME, create_type=False) + + op.add_column('ps_globals', sa.Column('allow_sending_180_after_183', ast_bool_values)) + + +def downgrade(): + if op.get_context().bind.dialect.name == 'mssql': + op.drop_constraint('ck_ps_globals_allow_sending_180_after_183_ast_bool_values', 'ps_globals') + op.drop_column('ps_globals', 'allow_sending_180_after_183') diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/contrib/realtime/mysql/mysql_config.sql asterisk-18.12.0~dfsg+~cs6.12.40431413/contrib/realtime/mysql/mysql_config.sql --- asterisk-18.11.2~dfsg+~cs6.10.40431413/contrib/realtime/mysql/mysql_config.sql 2022-04-14 21:53:34.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/contrib/realtime/mysql/mysql_config.sql 2022-05-12 11:50:59.000000000 +0000 @@ -1334,3 +1334,9 @@ UPDATE alembic_version SET version_num='8f72185e437f' WHERE alembic_version.version_num = 'a06d8f8462d9'; +-- Running upgrade 8f72185e437f -> 0bee61aa9425 + +ALTER TABLE ps_globals ADD COLUMN allow_sending_180_after_183 ENUM('0','1','off','on','false','true','no','yes'); + +UPDATE alembic_version SET version_num='0bee61aa9425' WHERE alembic_version.version_num = '8f72185e437f'; + diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/contrib/realtime/postgresql/postgresql_config.sql asterisk-18.12.0~dfsg+~cs6.12.40431413/contrib/realtime/postgresql/postgresql_config.sql --- asterisk-18.11.2~dfsg+~cs6.10.40431413/contrib/realtime/postgresql/postgresql_config.sql 2022-04-14 21:53:34.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/contrib/realtime/postgresql/postgresql_config.sql 2022-05-12 11:50:59.000000000 +0000 @@ -1444,5 +1444,11 @@ UPDATE alembic_version SET version_num='8f72185e437f' WHERE alembic_version.version_num = 'a06d8f8462d9'; +-- Running upgrade 8f72185e437f -> 0bee61aa9425 + +ALTER TABLE ps_globals ADD COLUMN allow_sending_180_after_183 ast_bool_values; + +UPDATE alembic_version SET version_num='0bee61aa9425' WHERE alembic_version.version_num = '8f72185e437f'; + COMMIT; diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/debian/changelog asterisk-18.12.0~dfsg+~cs6.12.40431413/debian/changelog --- asterisk-18.11.2~dfsg+~cs6.10.40431413/debian/changelog 2022-04-17 13:59:40.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/debian/changelog 2022-05-12 20:37:38.000000000 +0000 @@ -1,3 +1,18 @@ +asterisk (1:18.12.0~dfsg+~cs6.12.40431413-1) unstable; urgency=medium + + [ upstream ] + * new release + + [ Jonas Smedegaard ] + * update watch file: + + fixate component pjproject at upstream release 2.12 + (not asterisk fork of 2.10) + * update copyright info: update coverage + * update and unfuzz patches + * declare compliance with Debian Policy 4.6.1 + + -- Jonas Smedegaard Thu, 12 May 2022 22:37:38 +0200 + asterisk (1:18.11.2~dfsg+~cs6.10.40431413-1) unstable; urgency=medium [ upstream ] diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/debian/control asterisk-18.12.0~dfsg+~cs6.12.40431413/debian/control --- asterisk-18.11.2~dfsg+~cs6.10.40431413/debian/control 2022-04-06 13:18:45.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/debian/control 2022-05-12 20:37:12.000000000 +0000 @@ -73,7 +73,7 @@ unixodbc-dev, uuid-dev, zlib1g-dev, -Standards-Version: 4.1.1 +Standards-Version: 4.6.1 Homepage: https://www.asterisk.org/ Vcs-Git: https://salsa.debian.org/pkg-voip-team/asterisk.git Vcs-Browser: https://salsa.debian.org/pkg-voip-team/asterisk diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/debian/copyright asterisk-18.12.0~dfsg+~cs6.12.40431413/debian/copyright --- asterisk-18.11.2~dfsg+~cs6.10.40431413/debian/copyright 2022-04-17 13:57:32.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/debian/copyright 2022-05-12 20:20:26.000000000 +0000 @@ -144,7 +144,7 @@ 2007-2009 Konftel AB 2010-2012 Regis Montoya (r3gis) 2014-2017 Savoir-faire Linux - 2008-2019 Teluu Inc. + 2008-2021 Teluu Inc. 2012-2015 Zaark Technology AB License-Grant: This program is free software; @@ -159,6 +159,77 @@ for our redistribution. Files: + Xpjproject/third_party/webrtc_aec3/* +Copyright: + 1996-2001 Takuya OOURA + 2004-2006, 2011-2021 The WebRTC project authors +License-Grant: + Use of this source code is governed by a BSD-style license + that can be found in the file + in the root of the source tree. +License: BSD-3-clause~Google + +Files: + Xpjproject/third_party/webrtc_aec3/src/absl/* +Copyright: + 2017-2019 The Abseil Authors +License-Grant: + Licensed under the Apache License, + Version 2.0 (the "License"); + you may not use this file + except in compliance with the License. + You may obtain a copy of the License + at +License: Apache-2.0 + +Files: + Xpjproject/third_party/webrtc_aec3/src/third_party/pffft/* +Copyright: + 2013 Julien Pommier + 2004 the University Corporation for Atmospheric Research ("UCAR") +License: BSD-3-clause~NCAR + +Files: + Xpjproject/third_party/webrtc_aec3/src/third_party/rnnoise/* +Copyright: + 2012-2017 Jean-Marc Valin + 2008-2011 Octasic Inc. +License: BSD-2-clause +License: BSD-2-clause + Redistribution and use in source and binary forms, + with or without modification, + are permitted + provided that the following conditions are met: + - Redistributions of source code must retain + the above copyright notice, this list of conditions + and the following disclaimer. + - Redistributions in binary form must reproduce + the above copyright notice, this list of conditions + and the following disclaimer + in the documentation and/or other materials + provided with the distribution. + . + THIS SOFTWARE IS PROVIDED + BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, + INCLUDING, BUT NOT LIMITED TO, + THE IMPLIED WARRANTIES OF MERCHANTABILITY + AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. + IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + OR CONSEQUENTIAL DAMAGES + (INCLUDING, BUT NOT LIMITED TO, + PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + LOSS OF USE, DATA, OR PROFITS; + OR BUSINESS INTERRUPTION) + HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +Files: Xamr/* Copyright: none (Public Domain) License: public-domain @@ -246,7 +317,7 @@ */configure Xpjproject/aconfigure Copyright: - 1992-1996, 1998-2012 Free Software Foundation, Inc. + 1992-1996, 1998-2017, 2020-2021 Free Software Foundation, Inc. License: FSFUL Files: @@ -1054,6 +1125,42 @@ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +License: BSD-3-clause~Google + Redistribution and use in source and binary forms, + with or without modification, are permitted + provided that the following conditions are met: + 1) Redistributions of source code must retain + the above copyright notice, this list of conditions + and the following disclaimer. + 2) Redistributions in binary form must reproduce + the above copyright notice, this list of conditions + and the following disclaimer + in the documentation and/or other materials + provided with the distribution. + 3) Neither the name of Google nor the names of its contributors + may be used to endorse or promote products + derived from this software + without specific prior written permission. + . + THIS SOFTWARE IS PROVIDED + BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, + INCLUDING, BUT NOT LIMITED TO, + THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + OR CONSEQUENTIAL DAMAGES + (INCLUDING, BUT NOT LIMITED TO, + PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + LOSS OF USE, DATA, OR PROFITS; + OR BUSINESS INTERRUPTION) + HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + License: BSD-3-Clause~IETF Redistribution and use in source and binary forms, with or without modification, @@ -1093,6 +1200,39 @@ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +License: BSD-3-clause~NCAR + Redistribution and use of the Software in source and binary forms, + with or without modification, is permitted provided that the + following conditions are met: + - Neither the names + of NCAR's Computational and Information Systems Laboratory, + the University Corporation for Atmospheric Research, + nor the names of its sponsors or contributors + may be used to endorse or promote + products derived from this Software + without specific prior written permission. + - Redistributions of source code must retain + the above copyright notices, this list of conditions, + and the disclaimer below. + - Redistributions in binary form must reproduce + the above copyright notice, this list of conditions, + and the disclaimer below + in the documentation and/or other materials + provided with the distribution. + . + THIS SOFTWARE IS PROVIDED "AS IS", + WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + INCLUDING, BUT NOT LIMITED TO + THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE + AND NONINFRINGEMENT. + IN NO EVENT SHALL THE CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE + FOR ANY CLAIM, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + OR CONSEQUENTIAL DAMAGES OR OTHER LIABILITY, + WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE + OR THE USE OR OTHER DEALINGS WITH THE SOFTWARE. + License: BSD-3-Clause~Xiph Redistribution and use in source and binary forms, with or without modification, are permitted diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/debian/copyright_hints asterisk-18.12.0~dfsg+~cs6.12.40431413/debian/copyright_hints --- asterisk-18.11.2~dfsg+~cs6.10.40431413/debian/copyright_hints 2022-04-17 13:56:51.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/debian/copyright_hints 2022-05-12 17:19:36.000000000 +0000 @@ -34,6 +34,7 @@ Xpjproject/INSTALL.txt Xpjproject/Makefile Xpjproject/README-RTEMS + Xpjproject/SECURITY.md Xpjproject/aconfigure.ac Xpjproject/bb10-config.mak Xpjproject/build.mak.in @@ -103,6 +104,8 @@ Xpjproject/build/vs/pjproject-vs14-api-def.props Xpjproject/build/vs/pjproject-vs14-arm-common-defaults.props Xpjproject/build/vs/pjproject-vs14-arm-release-defaults.props + Xpjproject/build/vs/pjproject-vs14-arm64-common-defaults.props + Xpjproject/build/vs/pjproject-vs14-arm64-release-defaults.props Xpjproject/build/vs/pjproject-vs14-build-targets.targets Xpjproject/build/vs/pjproject-vs14-common-config.props Xpjproject/build/vs/pjproject-vs14-common-defaults.props @@ -205,6 +208,7 @@ Xpjproject/pjlib/docs/doxygen.css Xpjproject/pjlib/docs/header.html Xpjproject/pjlib/include/pj/config_site_sample.h + Xpjproject/pjlib/include/pj/config_site_test.h Xpjproject/pjlib/src/pjlib-test/main_symbian.cpp Xpjproject/pjlib/src/pjlib-test/pjlib_test_reg.rss Xpjproject/pjmedia/build/Jbtest.dat @@ -336,6 +340,16 @@ Xpjproject/pjsip-apps/src/pjsua/bb10/translations/Makefile Xpjproject/pjsip-apps/src/pjsua/bb10/translations/PjsuaBB.pro Xpjproject/pjsip-apps/src/pjsua/bb10/translations/PjsuaBB.ts + Xpjproject/pjsip-apps/src/pjsua/ios-swift/ipjsua-swift.xcodeproj/project.pbxproj + Xpjproject/pjsip-apps/src/pjsua/ios-swift/ipjsua-swift.xcodeproj/project.xcworkspace/contents.xcworkspacedata + Xpjproject/pjsip-apps/src/pjsua/ios-swift/ipjsua-swift.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist + Xpjproject/pjsip-apps/src/pjsua/ios-swift/ipjsua-swift/Assets.xcassets/AccentColor.colorset/Contents.json + Xpjproject/pjsip-apps/src/pjsua/ios-swift/ipjsua-swift/Assets.xcassets/AppIcon.appiconset/Contents.json + Xpjproject/pjsip-apps/src/pjsua/ios-swift/ipjsua-swift/Assets.xcassets/Contents.json + Xpjproject/pjsip-apps/src/pjsua/ios-swift/ipjsua-swift/Info.plist + Xpjproject/pjsip-apps/src/pjsua/ios-swift/ipjsua-swift/Preview Content/Preview Assets.xcassets/Contents.json + Xpjproject/pjsip-apps/src/pjsua/ios-swift/ipjsua-swift/ipjsua-swift-Bridging-Header.h + Xpjproject/pjsip-apps/src/pjsua/ios-swift/ipjsua-swift/pjsip.m Xpjproject/pjsip-apps/src/pjsua/ios/ipjsua.xcodeproj/project.pbxproj Xpjproject/pjsip-apps/src/pjsua/ios/ipjsua.xcodeproj/xcshareddata/xcschemes/ipjsua.xcscheme Xpjproject/pjsip-apps/src/pjsua/ios/ipjsua.xcworkspace/contents.xcworkspacedata @@ -408,6 +422,17 @@ Xpjproject/pjsip-apps/src/pjsua/winrt/gui/uwp/VoipTasks/project.json Xpjproject/pjsip-apps/src/pjsua/winrt/gui/uwp/VoipTasks/project.lock.json Xpjproject/pjsip-apps/src/pjsua/wm/pjsua.bmp + Xpjproject/pjsip-apps/src/pjsua2/ios-swift-pjsua2/ios-swift-pjsua2.xcodeproj/project.pbxproj + Xpjproject/pjsip-apps/src/pjsua2/ios-swift-pjsua2/ios-swift-pjsua2.xcodeproj/project.xcworkspace/contents.xcworkspacedata + Xpjproject/pjsip-apps/src/pjsua2/ios-swift-pjsua2/ios-swift-pjsua2.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist + Xpjproject/pjsip-apps/src/pjsua2/ios-swift-pjsua2/ios-swift-pjsua2.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings + Xpjproject/pjsip-apps/src/pjsua2/ios-swift-pjsua2/ios-swift-pjsua2.xcodeproj/xcshareddata/xcschemes/ios-swift-pjsua2.xcscheme + Xpjproject/pjsip-apps/src/pjsua2/ios-swift-pjsua2/ios-swift-pjsua2/Assets.xcassets/AccentColor.colorset/Contents.json + Xpjproject/pjsip-apps/src/pjsua2/ios-swift-pjsua2/ios-swift-pjsua2/Assets.xcassets/AppIcon.appiconset/Contents.json + Xpjproject/pjsip-apps/src/pjsua2/ios-swift-pjsua2/ios-swift-pjsua2/Assets.xcassets/Contents.json + Xpjproject/pjsip-apps/src/pjsua2/ios-swift-pjsua2/ios-swift-pjsua2/Info.plist + Xpjproject/pjsip-apps/src/pjsua2/ios-swift-pjsua2/ios-swift-pjsua2/View/Base.lproj/LaunchScreen.storyboard + Xpjproject/pjsip-apps/src/pjsua2/ios-swift-pjsua2/ios-swift-pjsua2/View/Base.lproj/Main.storyboard Xpjproject/pjsip-apps/src/pjsystest/pjsystest_wince.rc Xpjproject/pjsip-apps/src/pjsystest/pjsystest_wince.rc2 Xpjproject/pjsip-apps/src/pjsystest/resource.h @@ -427,6 +452,21 @@ Xpjproject/pjsip-apps/src/swig/Makefile Xpjproject/pjsip-apps/src/swig/csharp/Makefile Xpjproject/pjsip-apps/src/swig/java/Makefile + Xpjproject/pjsip-apps/src/swig/java/android/android.iml + Xpjproject/pjsip-apps/src/swig/java/android/app-kotlin/build.gradle + Xpjproject/pjsip-apps/src/swig/java/android/app-kotlin/proguard-rules.pro + Xpjproject/pjsip-apps/src/swig/java/android/app-kotlin/src/main/AndroidManifest.xml + Xpjproject/pjsip-apps/src/swig/java/android/app-kotlin/src/main/java/org/pjsip/pjsua2/app_kotlin/MainActivity.kt + Xpjproject/pjsip-apps/src/swig/java/android/app-kotlin/src/main/res/drawable-v24/ic_launcher_foreground.xml + Xpjproject/pjsip-apps/src/swig/java/android/app-kotlin/src/main/res/drawable/ic_launcher_background.xml + Xpjproject/pjsip-apps/src/swig/java/android/app-kotlin/src/main/res/layout/activity_main.xml + Xpjproject/pjsip-apps/src/swig/java/android/app-kotlin/src/main/res/mipmap-anydpi-v26/ic_launcher.xml + Xpjproject/pjsip-apps/src/swig/java/android/app-kotlin/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml + Xpjproject/pjsip-apps/src/swig/java/android/app-kotlin/src/main/res/values-night/themes.xml + Xpjproject/pjsip-apps/src/swig/java/android/app-kotlin/src/main/res/values/colors.xml + Xpjproject/pjsip-apps/src/swig/java/android/app-kotlin/src/main/res/values/strings.xml + Xpjproject/pjsip-apps/src/swig/java/android/app-kotlin/src/main/res/values/themes.xml + Xpjproject/pjsip-apps/src/swig/java/android/app/app.iml Xpjproject/pjsip-apps/src/swig/java/android/app/build.gradle Xpjproject/pjsip-apps/src/swig/java/android/app/src/main/AndroidManifest.xml Xpjproject/pjsip-apps/src/swig/java/android/app/src/main/res/drawable/bkg.xml @@ -448,6 +488,9 @@ Xpjproject/pjsip-apps/src/swig/java/android/gradle/wrapper/gradle-wrapper.properties Xpjproject/pjsip-apps/src/swig/java/android/gradlew Xpjproject/pjsip-apps/src/swig/java/android/gradlew.bat + Xpjproject/pjsip-apps/src/swig/java/android/pjsua2/build.gradle + Xpjproject/pjsip-apps/src/swig/java/android/pjsua2/proguard-rules.pro + Xpjproject/pjsip-apps/src/swig/java/android/pjsua2/src/main/AndroidManifest.xml Xpjproject/pjsip-apps/src/swig/java/android/settings.gradle Xpjproject/pjsip-apps/src/swig/java/test.java Xpjproject/pjsip-apps/src/swig/pjsua2.i @@ -552,6 +595,7 @@ Xpjproject/tests/pjsua/scripts-call/150_srtp_3_1.py Xpjproject/tests/pjsua/scripts-call/150_srtp_3_2.py Xpjproject/tests/pjsua/scripts-call/150_srtp_3_3.py + Xpjproject/tests/pjsua/scripts-call/160_srtp_dtls.py Xpjproject/tests/pjsua/scripts-call/200_tcp.py Xpjproject/tests/pjsua/scripts-call/300_ice_0_1.py Xpjproject/tests/pjsua/scripts-call/300_ice_1_0.py @@ -560,6 +604,14 @@ Xpjproject/tests/pjsua/scripts-call/301_ice_public_b.py Xpjproject/tests/pjsua/scripts-call/305_ice_comp_1_2.py Xpjproject/tests/pjsua/scripts-call/305_ice_comp_2_1.py + Xpjproject/tests/pjsua/scripts-call/320_ice_dtls_srtp.py + Xpjproject/tests/pjsua/scripts-call/330_ice_no_ice_vs_trickle_full.py + Xpjproject/tests/pjsua/scripts-call/330_ice_reg_vs_trickle_full.py + Xpjproject/tests/pjsua/scripts-call/330_ice_trickle_full.py + Xpjproject/tests/pjsua/scripts-call/330_ice_trickle_full_vs_no_ice.py + Xpjproject/tests/pjsua/scripts-call/330_ice_trickle_full_vs_reg.py + Xpjproject/tests/pjsua/scripts-call/330_ice_trickle_half.py + Xpjproject/tests/pjsua/scripts-call/330_ice_trickle_half_vs_reg.py Xpjproject/tests/pjsua/scripts-call/350_prack_a.py Xpjproject/tests/pjsua/scripts-call/350_prack_b.py Xpjproject/tests/pjsua/scripts-call/400_tel_uri.py @@ -739,6 +791,8 @@ Xpjproject/tests/pjsua/scripts-sipp/uas-answer-183-without-to-tag.py Xpjproject/tests/pjsua/scripts-sipp/uas-answer-200-reinvite-without-sdp.py Xpjproject/tests/pjsua/scripts-sipp/uas-answer-200-update-without-sdp.py + Xpjproject/tests/pjsua/scripts-sipp/uas-auth-two-algo.py + Xpjproject/tests/pjsua/scripts-sipp/uas-auth-two-algo.xml Xpjproject/tests/pjsua/scripts-sipp/uas-auth.py Xpjproject/tests/pjsua/scripts-sipp/uas-cancel-no-final.py Xpjproject/tests/pjsua/scripts-sipp/uas-cancel-no-final.xml @@ -747,6 +801,7 @@ Xpjproject/tests/pjsua/scripts-sipp/uas-mwi.py Xpjproject/tests/pjsua/scripts-sipp/uas-register-ip-change-port-only.xml Xpjproject/tests/pjsua/scripts-sipp/uas-register-ip-change.xml + Xpjproject/tests/pjsua/scripts-sipp/uas-reinv-after-failed-nego.py Xpjproject/tests/pjsua/scripts-sipp/uas-reinv-glare.py Xpjproject/tests/pjsua/scripts-sipp/uas-reinv-with-less-media.py Xpjproject/tests/pjsua/scripts-sipp/uas-subscribe-late-notify.py @@ -755,6 +810,7 @@ Xpjproject/tests/pjsua/scripts-sipp/uas-subscribe-refresh-481.py Xpjproject/tests/pjsua/scripts-sipp/uas-subscribe-terminated-retry.py Xpjproject/tests/pjsua/tools/Makefile + Xpjproject/tests/pjsua/tools/cmp_wav.vcxproj Xpjproject/tests/pjsua/wavs/input.11.wav Xpjproject/tests/pjsua/wavs/input.16.wav Xpjproject/tests/pjsua/wavs/input.2.16.wav @@ -767,6 +823,7 @@ Xpjproject/tests/pjsua/wavs/tock8.wav Xpjproject/third_party/README.txt Xpjproject/third_party/build/Makefile + Xpjproject/third_party/build/baseclasses/Makefile Xpjproject/third_party/build/baseclasses/libbaseclasses.vcproj Xpjproject/third_party/build/baseclasses/libbaseclasses.vcxproj Xpjproject/third_party/build/baseclasses/libbaseclasses.vcxproj.filters @@ -802,7 +859,6 @@ Xpjproject/third_party/build/resample/libresample.vcxproj Xpjproject/third_party/build/resample/libresample.vcxproj.filters Xpjproject/third_party/build/resample/libresample_dll.vcproj - Xpjproject/third_party/build/samplerate/README.txt Xpjproject/third_party/build/samplerate/Static.msvc Xpjproject/third_party/build/samplerate/libsamplerate_static.dsp Xpjproject/third_party/build/speex/Makefile @@ -822,11 +878,31 @@ Xpjproject/third_party/build/webrtc/libwebrtc.vcxproj Xpjproject/third_party/build/webrtc/libwebrtc.vcxproj.filters Xpjproject/third_party/build/webrtc/notes.txt + Xpjproject/third_party/build/webrtc_aec3/Makefile + Xpjproject/third_party/build/webrtc_aec3/libwebrtc_aec3.vcxproj + Xpjproject/third_party/build/webrtc_aec3/libwebrtc_aec3.vcxproj.filters Xpjproject/third_party/build/yuv/Makefile Xpjproject/third_party/build/yuv/Notes.txt Xpjproject/third_party/build/yuv/libyuv.vcproj Xpjproject/third_party/build/yuv/libyuv.vcxproj Xpjproject/third_party/build/yuv/libyuv.vcxproj.filters + Xpjproject/third_party/webrtc_aec3/OWNERS + Xpjproject/third_party/webrtc_aec3/PATENTS + Xpjproject/third_party/webrtc_aec3/PJSIP_NOTES + Xpjproject/third_party/webrtc_aec3/README.md + Xpjproject/third_party/webrtc_aec3/src/absl/AUTHORS + Xpjproject/third_party/webrtc_aec3/src/api/audio/OWNERS + Xpjproject/third_party/webrtc_aec3/src/common_audio/third_party/ooura/README.chromium + Xpjproject/third_party/webrtc_aec3/src/common_audio/third_party/spl_sqrt_floor/LICENSE + Xpjproject/third_party/webrtc_aec3/src/common_audio/third_party/spl_sqrt_floor/README.chromium + Xpjproject/third_party/webrtc_aec3/src/common_audio/third_party/spl_sqrt_floor/spl_sqrt_floor.c + Xpjproject/third_party/webrtc_aec3/src/common_audio/third_party/spl_sqrt_floor/spl_sqrt_floor_arm.S + Xpjproject/third_party/webrtc_aec3/src/common_audio/third_party/spl_sqrt_floor/spl_sqrt_floor_mips.c + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/agc2/rnn_vad/DEPS + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/utility/DEPS + Xpjproject/third_party/webrtc_aec3/src/third_party/rnnoise/OWNERS + Xpjproject/third_party/webrtc_aec3/src/third_party/rnnoise/src/rnn_vad_weights.cc + Xpjproject/third_party/webrtc_aec3/src/third_party/rnnoise/src/rnn_vad_weights.h Xpjproject/user.mak.sample Xpjproject/version.mak Zaptel-to-DAHDI.txt @@ -838,8 +914,8 @@ agi/fastagi-test agi/numeralize apps/app_voicemail.exports.in - asterisk-18.11.2-summary.html - asterisk-18.11.2-summary.txt + asterisk-18.12.0-summary.html + asterisk-18.12.0-summary.txt autoconf/ast_c_compile_check.m4 autoconf/ast_c_declare_check.m4 autoconf/ast_c_define_check.m4 @@ -943,6 +1019,7 @@ configs/basic-pbx/voicemail.conf configs/samples/acl.conf.sample configs/samples/adsi.conf.sample + configs/samples/aeap.conf.sample configs/samples/agents.conf.sample configs/samples/alarmreceiver.conf.sample configs/samples/alsa.conf.sample @@ -1067,6 +1144,7 @@ contrib/ast-db-manage/config/versions/041c0d3d1857_add_dtls_auto_gen_cert.py contrib/ast-db-manage/config/versions/0838f8db6a61_pjsip_add_send_contact_status_on_update_.py contrib/ast-db-manage/config/versions/0be05c3a8225_add_early_media_options.py + contrib/ast-db-manage/config/versions/0bee61aa9425_allow_180_ringing_with_sdp.py contrib/ast-db-manage/config/versions/136885b81223_add_regcontext_to_pj.py contrib/ast-db-manage/config/versions/154177371065_add_default_from_user.py contrib/ast-db-manage/config/versions/15b1430ad6f1_add_moh_passthrough_option_to_pjsip.py @@ -1463,6 +1541,7 @@ phoneprov/polycom_line.xml phoneprov/snom-mac.xml res/res.xml + res/res_aeap.exports.in res/res_ael_share.exports.in res/res_agi.exports.in res/res_ari.exports.in @@ -1548,30 +1627,11 @@ third-party/pjproject/dependency_utils third-party/pjproject/patches/0000-configure-ssl-library-path.patch third-party/pjproject/patches/0000-remove-third-party.patch - third-party/pjproject/patches/0000-set_apps_initial_log_level.patch - third-party/pjproject/patches/0000-solaris.patch - third-party/pjproject/patches/0011-sip_inv_patch.patch - third-party/pjproject/patches/0020-pjlib_cancel_timer_0.patch - third-party/pjproject/patches/0050-fix-race-parallel-build.patch - third-party/pjproject/patches/0060-clone-sdp-for-sip-timer-refresh-invite.patch - third-party/pjproject/patches/0070-fix-incorrect-copying-when-creating-cancel.patch - third-party/pjproject/patches/0080-fix-sdp-neg-modify-local-offer.patch - third-party/pjproject/patches/0090-Skip-unsupported-digest-algorithm-2408.patch - third-party/pjproject/patches/0100-fix-double-stun-free.patch - third-party/pjproject/patches/0110-tls-parent-listener-destroyed.patch - third-party/pjproject/patches/0111-ssl-premature-destroy.patch - third-party/pjproject/patches/0120-pjmedia_sdp_attr_get_rtpmap-Strip-param-trailing-whi.patch - third-party/pjproject/patches/0130-sip_inv-Additional-multipart-support-2919-2920.patch - third-party/pjproject/patches/0140-Fix-incorrect-unescaping-of-tokens-during-parsing-29.patch - third-party/pjproject/patches/0150-Create-generic-pjsip_hdr_find-functions.patch - third-party/pjproject/patches/0160-Additional-multipart-improvements.patch - third-party/pjproject/patches/0170-stun-integer-underflow.patch - third-party/pjproject/patches/0171-dialog-set-free.patch - third-party/pjproject/patches/0172-prevent-multipart-oob.patch + third-party/pjproject/patches/0100-allow_multiple_auth_headers.patch third-party/pjproject/patches/README third-party/pjproject/patches/config_site.h third-party/pjproject/patches/user.mak - third-party/pjproject/pjproject-2.10.tar.bz2.md5 + third-party/pjproject/pjproject-2.12.tar.bz2.md5 third-party/versions.mak utils/ael_main.c utils/clicompat.c @@ -3041,6 +3101,452 @@ License: GPL-2+ FIXME +Files: Xpjproject/third_party/webrtc_aec3/src/api/audio/BUILD.gn + Xpjproject/third_party/webrtc_aec3/src/api/audio/audio_frame.cc + Xpjproject/third_party/webrtc_aec3/src/api/audio/audio_frame.h + Xpjproject/third_party/webrtc_aec3/src/api/audio/audio_frame_processor.h + Xpjproject/third_party/webrtc_aec3/src/api/audio/audio_mixer.h + Xpjproject/third_party/webrtc_aec3/src/api/audio/channel_layout.cc + Xpjproject/third_party/webrtc_aec3/src/api/audio/channel_layout.h + Xpjproject/third_party/webrtc_aec3/src/api/audio/echo_canceller3_config.cc + Xpjproject/third_party/webrtc_aec3/src/api/audio/echo_canceller3_config.h + Xpjproject/third_party/webrtc_aec3/src/api/audio/echo_canceller3_config_json.cc + Xpjproject/third_party/webrtc_aec3/src/api/audio/echo_canceller3_config_json.h + Xpjproject/third_party/webrtc_aec3/src/api/audio/echo_canceller3_factory.cc + Xpjproject/third_party/webrtc_aec3/src/api/audio/echo_canceller3_factory.h + Xpjproject/third_party/webrtc_aec3/src/api/audio/echo_control.h + Xpjproject/third_party/webrtc_aec3/src/api/audio/echo_detector_creator.cc + Xpjproject/third_party/webrtc_aec3/src/api/audio/echo_detector_creator.h + Xpjproject/third_party/webrtc_aec3/src/api/audio/test/BUILD.gn + Xpjproject/third_party/webrtc_aec3/src/api/rtp_headers.cc + Xpjproject/third_party/webrtc_aec3/src/api/rtp_headers.h + Xpjproject/third_party/webrtc_aec3/src/api/rtp_packet_info.cc + Xpjproject/third_party/webrtc_aec3/src/api/rtp_packet_info.h + Xpjproject/third_party/webrtc_aec3/src/api/units/time_delta.cc + Xpjproject/third_party/webrtc_aec3/src/api/units/time_delta.h + Xpjproject/third_party/webrtc_aec3/src/api/units/timestamp.cc + Xpjproject/third_party/webrtc_aec3/src/api/units/timestamp.h + Xpjproject/third_party/webrtc_aec3/src/common_audio/audio_util.cc + Xpjproject/third_party/webrtc_aec3/src/common_audio/channel_buffer.cc + Xpjproject/third_party/webrtc_aec3/src/common_audio/channel_buffer.h + Xpjproject/third_party/webrtc_aec3/src/common_audio/include/audio_util.h + Xpjproject/third_party/webrtc_aec3/src/common_audio/resampler/include/push_resampler.h + Xpjproject/third_party/webrtc_aec3/src/common_audio/resampler/include/resampler.h + Xpjproject/third_party/webrtc_aec3/src/common_audio/resampler/push_resampler.cc + Xpjproject/third_party/webrtc_aec3/src/common_audio/resampler/push_sinc_resampler.cc + Xpjproject/third_party/webrtc_aec3/src/common_audio/resampler/push_sinc_resampler.h + Xpjproject/third_party/webrtc_aec3/src/common_audio/resampler/sinc_resampler.cc + Xpjproject/third_party/webrtc_aec3/src/common_audio/resampler/sinc_resampler.h + Xpjproject/third_party/webrtc_aec3/src/common_audio/resampler/sinc_resampler_avx2.cc + Xpjproject/third_party/webrtc_aec3/src/common_audio/resampler/sinc_resampler_neon.cc + Xpjproject/third_party/webrtc_aec3/src/common_audio/resampler/sinc_resampler_sse.cc + Xpjproject/third_party/webrtc_aec3/src/common_audio/resampler/sinc_resampler_unittest.cc + Xpjproject/third_party/webrtc_aec3/src/common_audio/signal_processing/dot_product_with_scale.cc + Xpjproject/third_party/webrtc_aec3/src/common_audio/signal_processing/dot_product_with_scale.h + Xpjproject/third_party/webrtc_aec3/src/common_audio/signal_processing/include/signal_processing_library.h + Xpjproject/third_party/webrtc_aec3/src/common_audio/signal_processing/include/spl_inl.h + Xpjproject/third_party/webrtc_aec3/src/common_audio/signal_processing/include/spl_inl_armv7.h + Xpjproject/third_party/webrtc_aec3/src/common_audio/signal_processing/include/spl_inl_mips.h + Xpjproject/third_party/webrtc_aec3/src/common_audio/signal_processing/splitting_filter2.c + Xpjproject/third_party/webrtc_aec3/src/common_audio/third_party/ooura/BUILD.gn + Xpjproject/third_party/webrtc_aec3/src/common_audio/third_party/ooura/fft_size_128/ooura_fft.h + Xpjproject/third_party/webrtc_aec3/src/common_audio/third_party/ooura/fft_size_128/ooura_fft_mips.cc + Xpjproject/third_party/webrtc_aec3/src/common_audio/third_party/ooura/fft_size_128/ooura_fft_neon.cc + Xpjproject/third_party/webrtc_aec3/src/common_audio/third_party/ooura/fft_size_128/ooura_fft_sse2.cc + Xpjproject/third_party/webrtc_aec3/src/common_audio/third_party/ooura/fft_size_128/ooura_fft_tables_common.h + Xpjproject/third_party/webrtc_aec3/src/common_audio/third_party/ooura/fft_size_128/ooura_fft_tables_neon_sse2.h + Xpjproject/third_party/webrtc_aec3/src/common_audio/third_party/ooura/fft_size_256/fft4g.h + Xpjproject/third_party/webrtc_aec3/src/common_audio/third_party/spl_sqrt_floor/BUILD.gn + Xpjproject/third_party/webrtc_aec3/src/common_audio/third_party/spl_sqrt_floor/spl_sqrt_floor.h + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/aec3/BUILD.gn + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/aec3/adaptive_fir_filter.cc + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/aec3/adaptive_fir_filter.h + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/aec3/adaptive_fir_filter_avx2.cc + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/aec3/adaptive_fir_filter_erl.cc + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/aec3/adaptive_fir_filter_erl.h + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/aec3/adaptive_fir_filter_erl_avx2.cc + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/aec3/adaptive_fir_filter_erl_unittest.cc + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/aec3/adaptive_fir_filter_unittest.cc + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/aec3/aec3_common.cc + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/aec3/aec3_common.h + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/aec3/aec3_fft.cc + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/aec3/aec3_fft.h + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/aec3/aec3_fft_unittest.cc + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/aec3/aec_state.cc + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/aec3/aec_state.h + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/aec3/aec_state_unittest.cc + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/aec3/alignment_mixer.cc + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/aec3/alignment_mixer.h + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/aec3/alignment_mixer_unittest.cc + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/aec3/api_call_jitter_metrics.cc + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/aec3/api_call_jitter_metrics.h + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/aec3/api_call_jitter_metrics_unittest.cc + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/aec3/block_buffer.cc + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/aec3/block_buffer.h + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/aec3/block_delay_buffer.cc + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/aec3/block_delay_buffer.h + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/aec3/block_delay_buffer_unittest.cc + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/aec3/block_framer.cc + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/aec3/block_framer.h + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/aec3/block_framer_unittest.cc + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/aec3/block_processor.cc + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/aec3/block_processor.h + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/aec3/block_processor_metrics.cc + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/aec3/block_processor_metrics.h + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/aec3/block_processor_metrics_unittest.cc + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/aec3/block_processor_unittest.cc + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/aec3/clockdrift_detector.cc + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/aec3/clockdrift_detector.h + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/aec3/clockdrift_detector_unittest.cc + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/aec3/coarse_filter_update_gain.cc + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/aec3/coarse_filter_update_gain.h + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/aec3/coarse_filter_update_gain_unittest.cc + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/aec3/comfort_noise_generator.cc + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/aec3/comfort_noise_generator.h + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/aec3/comfort_noise_generator_unittest.cc + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/aec3/decimator.cc + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/aec3/decimator.h + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/aec3/decimator_unittest.cc + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/aec3/delay_estimate.h + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/aec3/dominant_nearend_detector.cc + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/aec3/dominant_nearend_detector.h + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/aec3/downsampled_render_buffer.cc + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/aec3/downsampled_render_buffer.h + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/aec3/echo_audibility.cc + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/aec3/echo_audibility.h + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/aec3/echo_canceller3.cc + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/aec3/echo_canceller3.h + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/aec3/echo_canceller3_unittest.cc + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/aec3/echo_path_delay_estimator.cc + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/aec3/echo_path_delay_estimator.h + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/aec3/echo_path_delay_estimator_unittest.cc + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/aec3/echo_path_variability.cc + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/aec3/echo_path_variability.h + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/aec3/echo_path_variability_unittest.cc + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/aec3/echo_remover.cc + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/aec3/echo_remover.h + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/aec3/echo_remover_metrics.cc + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/aec3/echo_remover_metrics.h + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/aec3/echo_remover_metrics_unittest.cc + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/aec3/echo_remover_unittest.cc + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/aec3/erl_estimator.cc + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/aec3/erl_estimator.h + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/aec3/erl_estimator_unittest.cc + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/aec3/erle_estimator.cc + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/aec3/erle_estimator.h + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/aec3/erle_estimator_unittest.cc + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/aec3/fft_buffer.cc + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/aec3/fft_buffer.h + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/aec3/fft_data.h + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/aec3/fft_data_avx2.cc + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/aec3/fft_data_unittest.cc + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/aec3/filter_analyzer.cc + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/aec3/filter_analyzer.h + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/aec3/filter_analyzer_unittest.cc + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/aec3/frame_blocker.cc + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/aec3/frame_blocker.h + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/aec3/frame_blocker_unittest.cc + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/aec3/fullband_erle_estimator.cc + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/aec3/fullband_erle_estimator.h + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/aec3/matched_filter.cc + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/aec3/matched_filter.h + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/aec3/matched_filter_avx2.cc + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/aec3/matched_filter_lag_aggregator.cc + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/aec3/matched_filter_lag_aggregator.h + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/aec3/matched_filter_lag_aggregator_unittest.cc + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/aec3/matched_filter_unittest.cc + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/aec3/mock/mock_block_processor.cc + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/aec3/mock/mock_block_processor.h + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/aec3/mock/mock_echo_remover.cc + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/aec3/mock/mock_echo_remover.h + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/aec3/mock/mock_render_delay_buffer.cc + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/aec3/mock/mock_render_delay_buffer.h + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/aec3/mock/mock_render_delay_controller.cc + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/aec3/mock/mock_render_delay_controller.h + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/aec3/moving_average.cc + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/aec3/moving_average.h + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/aec3/moving_average_unittest.cc + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/aec3/nearend_detector.h + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/aec3/refined_filter_update_gain.cc + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/aec3/refined_filter_update_gain.h + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/aec3/refined_filter_update_gain_unittest.cc + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/aec3/render_buffer.cc + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/aec3/render_buffer.h + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/aec3/render_buffer_unittest.cc + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/aec3/render_delay_buffer.cc + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/aec3/render_delay_buffer.h + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/aec3/render_delay_buffer_unittest.cc + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/aec3/render_delay_controller.cc + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/aec3/render_delay_controller.h + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/aec3/render_delay_controller_metrics.cc + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/aec3/render_delay_controller_metrics.h + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/aec3/render_delay_controller_metrics_unittest.cc + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/aec3/render_delay_controller_unittest.cc + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/aec3/render_signal_analyzer.cc + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/aec3/render_signal_analyzer.h + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/aec3/render_signal_analyzer_unittest.cc + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/aec3/residual_echo_estimator.cc + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/aec3/residual_echo_estimator.h + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/aec3/residual_echo_estimator_unittest.cc + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/aec3/reverb_decay_estimator.cc + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/aec3/reverb_decay_estimator.h + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/aec3/reverb_frequency_response.cc + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/aec3/reverb_frequency_response.h + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/aec3/reverb_model.cc + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/aec3/reverb_model.h + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/aec3/reverb_model_estimator.cc + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/aec3/reverb_model_estimator.h + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/aec3/reverb_model_estimator_unittest.cc + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/aec3/signal_dependent_erle_estimator.cc + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/aec3/signal_dependent_erle_estimator.h + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/aec3/signal_dependent_erle_estimator_unittest.cc + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/aec3/spectrum_buffer.cc + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/aec3/spectrum_buffer.h + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/aec3/stationarity_estimator.cc + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/aec3/stationarity_estimator.h + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/aec3/subband_erle_estimator.cc + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/aec3/subband_erle_estimator.h + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/aec3/subband_nearend_detector.cc + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/aec3/subband_nearend_detector.h + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/aec3/subtractor.cc + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/aec3/subtractor.h + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/aec3/subtractor_output.cc + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/aec3/subtractor_output.h + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/aec3/subtractor_output_analyzer.cc + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/aec3/subtractor_output_analyzer.h + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/aec3/subtractor_unittest.cc + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/aec3/suppression_filter.cc + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/aec3/suppression_filter.h + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/aec3/suppression_filter_unittest.cc + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/aec3/suppression_gain.cc + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/aec3/suppression_gain.h + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/aec3/suppression_gain_unittest.cc + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/aec3/transparent_mode.cc + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/aec3/transparent_mode.h + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/aec3/vector_math.h + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/aec3/vector_math_avx2.cc + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/aec3/vector_math_unittest.cc + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/agc2/BUILD.gn + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/agc2/adaptive_agc.cc + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/agc2/adaptive_agc.h + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/agc2/adaptive_digital_gain_applier.cc + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/agc2/adaptive_digital_gain_applier.h + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/agc2/adaptive_digital_gain_applier_unittest.cc + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/agc2/adaptive_mode_level_estimator.cc + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/agc2/adaptive_mode_level_estimator.h + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/agc2/adaptive_mode_level_estimator_unittest.cc + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/agc2/agc2_common.h + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/agc2/agc2_testing_common.cc + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/agc2/agc2_testing_common.h + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/agc2/agc2_testing_common_unittest.cc + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/agc2/biquad_filter.cc + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/agc2/biquad_filter.h + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/agc2/biquad_filter_unittest.cc + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/agc2/compute_interpolated_gain_curve.cc + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/agc2/compute_interpolated_gain_curve.h + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/agc2/cpu_features.cc + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/agc2/cpu_features.h + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/agc2/down_sampler.cc + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/agc2/down_sampler.h + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/agc2/fixed_digital_level_estimator.cc + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/agc2/fixed_digital_level_estimator.h + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/agc2/fixed_digital_level_estimator_unittest.cc + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/agc2/gain_applier.cc + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/agc2/gain_applier.h + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/agc2/gain_applier_unittest.cc + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/agc2/interpolated_gain_curve.cc + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/agc2/interpolated_gain_curve.h + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/agc2/interpolated_gain_curve_unittest.cc + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/agc2/limiter.cc + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/agc2/limiter.h + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/agc2/limiter_db_gain_curve.cc + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/agc2/limiter_db_gain_curve.h + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/agc2/limiter_db_gain_curve_unittest.cc + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/agc2/limiter_unittest.cc + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/agc2/noise_level_estimator.cc + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/agc2/noise_level_estimator.h + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/agc2/noise_level_estimator_unittest.cc + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/agc2/noise_spectrum_estimator.cc + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/agc2/noise_spectrum_estimator.h + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/agc2/rnn_vad/BUILD.gn + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/agc2/rnn_vad/auto_correlation.cc + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/agc2/rnn_vad/auto_correlation.h + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/agc2/rnn_vad/auto_correlation_unittest.cc + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/agc2/rnn_vad/common.h + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/agc2/rnn_vad/features_extraction.cc + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/agc2/rnn_vad/features_extraction.h + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/agc2/rnn_vad/features_extraction_unittest.cc + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/agc2/rnn_vad/lp_residual.cc + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/agc2/rnn_vad/lp_residual.h + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/agc2/rnn_vad/lp_residual_unittest.cc + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/agc2/rnn_vad/pitch_search.cc + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/agc2/rnn_vad/pitch_search.h + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/agc2/rnn_vad/pitch_search_internal.cc + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/agc2/rnn_vad/pitch_search_internal.h + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/agc2/rnn_vad/pitch_search_internal_unittest.cc + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/agc2/rnn_vad/pitch_search_unittest.cc + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/agc2/rnn_vad/ring_buffer.h + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/agc2/rnn_vad/ring_buffer_unittest.cc + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/agc2/rnn_vad/rnn.cc + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/agc2/rnn_vad/rnn.h + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/agc2/rnn_vad/rnn_fc.cc + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/agc2/rnn_vad/rnn_fc.h + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/agc2/rnn_vad/rnn_fc_unittest.cc + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/agc2/rnn_vad/rnn_gru.cc + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/agc2/rnn_vad/rnn_gru.h + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/agc2/rnn_vad/rnn_gru_unittest.cc + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/agc2/rnn_vad/rnn_unittest.cc + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/agc2/rnn_vad/rnn_vad_tool.cc + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/agc2/rnn_vad/rnn_vad_unittest.cc + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/agc2/rnn_vad/rnn_vector_math_avx2.cc + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/agc2/rnn_vad/sequence_buffer.h + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/agc2/rnn_vad/sequence_buffer_unittest.cc + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/agc2/rnn_vad/spectral_features.cc + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/agc2/rnn_vad/spectral_features.h + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/agc2/rnn_vad/spectral_features_internal.cc + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/agc2/rnn_vad/spectral_features_internal.h + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/agc2/rnn_vad/spectral_features_internal_unittest.cc + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/agc2/rnn_vad/spectral_features_unittest.cc + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/agc2/rnn_vad/symmetric_matrix_buffer.h + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/agc2/rnn_vad/symmetric_matrix_buffer_unittest.cc + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/agc2/rnn_vad/test_utils.cc + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/agc2/rnn_vad/test_utils.h + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/agc2/rnn_vad/vector_math.h + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/agc2/rnn_vad/vector_math_unittest.cc + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/agc2/saturation_protector.cc + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/agc2/saturation_protector.h + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/agc2/saturation_protector_buffer.cc + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/agc2/saturation_protector_buffer.h + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/agc2/saturation_protector_buffer_unittest.cc + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/agc2/saturation_protector_unittest.cc + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/agc2/signal_classifier.cc + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/agc2/signal_classifier.h + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/agc2/signal_classifier_unittest.cc + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/agc2/vad_with_level.cc + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/agc2/vad_with_level.h + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/agc2/vad_with_level_unittest.cc + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/agc2/vector_float_frame.cc + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/agc2/vector_float_frame.h + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/audio_buffer.cc + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/audio_buffer.h + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/echo_detector/circular_buffer.cc + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/echo_detector/circular_buffer.h + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/echo_detector/circular_buffer_unittest.cc + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/echo_detector/mean_variance_estimator.cc + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/echo_detector/mean_variance_estimator.h + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/echo_detector/mean_variance_estimator_unittest.cc + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/echo_detector/moving_max.cc + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/echo_detector/moving_max.h + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/echo_detector/moving_max_unittest.cc + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/echo_detector/normalized_covariance_estimator.cc + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/echo_detector/normalized_covariance_estimator.h + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/echo_detector/normalized_covariance_estimator_unittest.cc + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/gain_controller2.cc + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/gain_controller2.h + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/high_pass_filter.cc + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/high_pass_filter.h + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/include/audio_frame_view.h + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/include/audio_processing.cc + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/include/audio_processing.h + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/include/audio_processing_statistics.cc + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/include/audio_processing_statistics.h + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/include/config.cc + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/include/config.h + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/logging/apm_data_dumper.cc + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/logging/apm_data_dumper.h + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/ns/BUILD.gn + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/ns/fast_math.cc + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/ns/fast_math.h + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/ns/histograms.cc + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/ns/histograms.h + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/ns/noise_estimator.cc + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/ns/noise_estimator.h + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/ns/noise_suppressor.cc + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/ns/noise_suppressor.h + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/ns/noise_suppressor_unittest.cc + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/ns/ns_common.h + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/ns/ns_config.h + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/ns/ns_fft.cc + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/ns/ns_fft.h + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/ns/prior_signal_model.cc + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/ns/prior_signal_model.h + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/ns/prior_signal_model_estimator.cc + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/ns/prior_signal_model_estimator.h + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/ns/quantile_noise_estimator.cc + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/ns/quantile_noise_estimator.h + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/ns/signal_model.cc + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/ns/signal_model.h + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/ns/signal_model_estimator.cc + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/ns/signal_model_estimator.h + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/ns/speech_probability_estimator.cc + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/ns/speech_probability_estimator.h + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/ns/suppression_params.cc + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/ns/suppression_params.h + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/ns/wiener_filter.cc + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/ns/wiener_filter.h + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/residual_echo_detector.cc + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/residual_echo_detector.h + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/splitting_filter.cc + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/splitting_filter.h + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/three_band_filter_bank.cc + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/three_band_filter_bank.h + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/utility/BUILD.gn + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/utility/cascaded_biquad_filter.cc + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/utility/cascaded_biquad_filter.h + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/utility/cascaded_biquad_filter_unittest.cc + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/utility/delay_estimator.cc + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/utility/delay_estimator.h + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/utility/delay_estimator_internal.h + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/utility/delay_estimator_unittest.cc + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/utility/delay_estimator_wrapper.cc + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/utility/delay_estimator_wrapper.h + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/utility/pffft_wrapper.cc + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/utility/pffft_wrapper.h + Xpjproject/third_party/webrtc_aec3/src/modules/audio_processing/utility/pffft_wrapper_unittest.cc + Xpjproject/third_party/webrtc_aec3/src/rtc_base/arraysize.h + Xpjproject/third_party/webrtc_aec3/src/rtc_base/compile_assert_c.h + Xpjproject/third_party/webrtc_aec3/src/rtc_base/experiments/field_trial_parser.cc + Xpjproject/third_party/webrtc_aec3/src/rtc_base/experiments/field_trial_parser.h + Xpjproject/third_party/webrtc_aec3/src/rtc_base/gtest_prod_util.h + Xpjproject/third_party/webrtc_aec3/src/rtc_base/memory/aligned_malloc.cc + Xpjproject/third_party/webrtc_aec3/src/rtc_base/memory/aligned_malloc.h + Xpjproject/third_party/webrtc_aec3/src/rtc_base/platform_thread_types.cc + Xpjproject/third_party/webrtc_aec3/src/rtc_base/platform_thread_types.h + Xpjproject/third_party/webrtc_aec3/src/rtc_base/race_checker.cc + Xpjproject/third_party/webrtc_aec3/src/rtc_base/race_checker.h + Xpjproject/third_party/webrtc_aec3/src/rtc_base/random.cc + Xpjproject/third_party/webrtc_aec3/src/rtc_base/random.h + Xpjproject/third_party/webrtc_aec3/src/rtc_base/swap_queue.h + Xpjproject/third_party/webrtc_aec3/src/rtc_base/synchronization/yield.h + Xpjproject/third_party/webrtc_aec3/src/rtc_base/system/arch.h + Xpjproject/third_party/webrtc_aec3/src/rtc_base/system/file_wrapper.cc + Xpjproject/third_party/webrtc_aec3/src/rtc_base/system/file_wrapper.h + Xpjproject/third_party/webrtc_aec3/src/rtc_base/system/inline.h + Xpjproject/third_party/webrtc_aec3/src/rtc_base/system/rtc_export.h + Xpjproject/third_party/webrtc_aec3/src/rtc_base/thread_annotations.h + Xpjproject/third_party/webrtc_aec3/src/rtc_base/units/unit_base.h + Xpjproject/third_party/webrtc_aec3/src/system_wrappers/include/cpu_features_wrapper.h + Xpjproject/third_party/webrtc_aec3/src/system_wrappers/include/field_trial.h + Xpjproject/third_party/webrtc_aec3/src/system_wrappers/include/metrics.h + Xpjproject/third_party/webrtc_aec3/src/system_wrappers/source/cpu_features2.cc + Xpjproject/third_party/webrtc_aec3/src/system_wrappers/source/cpu_features_android.cc + Xpjproject/third_party/webrtc_aec3/src/system_wrappers/source/cpu_features_linux.cc + Xpjproject/third_party/webrtc_aec3/src/system_wrappers/source/field_trial.cc + Xpjproject/third_party/webrtc_aec3/src/system_wrappers/source/metrics.cc +Copyright: 2011, The WebRTC project authors. + 2012, The WebRTC project authors. + 2013, The WebRTC project authors. + 2014, The WebRTC project authors. + 2015, The WebRTC project authors. + 2016, The WebRTC project authors. + 2017, The WebRTC project authors. + 2018, The WebRTC project authors. + 2019, The WebRTC project authors. + 2020, The WebRTC project authors. + 2021, The WebRTC project authors. +License: UNKNOWN + FIXME + Files: Xpjproject/pjlib-util/include/pjlib-util/cli.h Xpjproject/pjlib-util/include/pjlib-util/cli_console.h Xpjproject/pjlib-util/include/pjlib-util/cli_imp.h @@ -3058,6 +3564,8 @@ Xpjproject/pjlib-util/src/pjlib-util/xml_wrap.cpp Xpjproject/pjlib/include/pj/ssl_sock.h Xpjproject/pjlib/src/pj/guid_android.c + Xpjproject/pjlib/src/pj/guid_bsd.c + Xpjproject/pjlib/src/pj/guid_darwin.c Xpjproject/pjlib/src/pj/ioqueue_uwp.cpp Xpjproject/pjlib/src/pj/ip_helper_winphone8.c Xpjproject/pjlib/src/pj/os_core_darwin.m @@ -3070,6 +3578,7 @@ Xpjproject/pjlib/src/pj/sock_qos_wm.c Xpjproject/pjlib/src/pj/sock_uwp.cpp Xpjproject/pjlib/src/pj/sock_uwp.h + Xpjproject/pjlib/src/pj/ssl_sock_apple.m Xpjproject/pjlib/src/pj/ssl_sock_common.c Xpjproject/pjlib/src/pj/ssl_sock_darwin.c Xpjproject/pjlib/src/pj/ssl_sock_dump.c @@ -3081,6 +3590,8 @@ Xpjproject/pjlib/src/pjlib-test/pool_wrap.cpp Xpjproject/pjlib/src/pjlib-test/test_wrap.cpp Xpjproject/pjmedia/include/pjmedia-audiodev/errno.h + Xpjproject/pjmedia/include/pjmedia-codec/and_aud_mediacodec.h + Xpjproject/pjmedia/include/pjmedia-codec/and_vid_mediacodec.h Xpjproject/pjmedia/include/pjmedia-codec/audio_codecs.h Xpjproject/pjmedia/include/pjmedia-codec/bcg729.h Xpjproject/pjmedia/include/pjmedia-codec/h263_packetizer.h @@ -3089,6 +3600,7 @@ Xpjproject/pjmedia/include/pjmedia-codec/silk.h Xpjproject/pjmedia/include/pjmedia-codec/vid_toolbox.h Xpjproject/pjmedia/include/pjmedia-codec/vpx.h + Xpjproject/pjmedia/include/pjmedia-codec/vpx_packetizer.h Xpjproject/pjmedia/include/pjmedia-videodev/avi_dev.h Xpjproject/pjmedia/include/pjmedia-videodev/config.h Xpjproject/pjmedia/include/pjmedia-videodev/errno.h @@ -3108,13 +3620,17 @@ Xpjproject/pjmedia/include/pjmedia/vid_tee.h Xpjproject/pjmedia/include/pjmedia/videodev.h Xpjproject/pjmedia/include/pjmedia_videodev.h + Xpjproject/pjmedia/src/pjmedia-audiodev/android/PjAudioDevInfo.java Xpjproject/pjmedia/src/pjmedia-audiodev/bb10_dev.c Xpjproject/pjmedia/src/pjmedia-audiodev/coreaudio_dev.m Xpjproject/pjmedia/src/pjmedia-audiodev/errno.c Xpjproject/pjmedia/src/pjmedia-audiodev/legacy_dev.c Xpjproject/pjmedia/src/pjmedia-audiodev/null_dev.c + Xpjproject/pjmedia/src/pjmedia-audiodev/oboe_dev.cpp Xpjproject/pjmedia/src/pjmedia-audiodev/symb_vas_dev.cpp Xpjproject/pjmedia/src/pjmedia-audiodev/wasapi_dev.cpp + Xpjproject/pjmedia/src/pjmedia-codec/and_aud_mediacodec.cpp + Xpjproject/pjmedia/src/pjmedia-codec/and_vid_mediacodec.cpp Xpjproject/pjmedia/src/pjmedia-codec/audio_codecs.c Xpjproject/pjmedia/src/pjmedia-codec/bcg729.c Xpjproject/pjmedia/src/pjmedia-codec/ffmpeg_vid_codecs.c @@ -3124,8 +3640,11 @@ Xpjproject/pjmedia/src/pjmedia-codec/silk.c Xpjproject/pjmedia/src/pjmedia-codec/vid_toolbox.m Xpjproject/pjmedia/src/pjmedia-codec/vpx.c + Xpjproject/pjmedia/src/pjmedia-codec/vpx_packetizer.c Xpjproject/pjmedia/src/pjmedia-videodev/android/PjCamera.java + Xpjproject/pjmedia/src/pjmedia-videodev/android/PjCamera2.java Xpjproject/pjmedia/src/pjmedia-videodev/android/PjCameraInfo.java + Xpjproject/pjmedia/src/pjmedia-videodev/android/PjCameraInfo2.java Xpjproject/pjmedia/src/pjmedia-videodev/android_dev.c Xpjproject/pjmedia/src/pjmedia-videodev/android_opengl.c Xpjproject/pjmedia/src/pjmedia-videodev/avi_dev.c @@ -3149,6 +3668,7 @@ Xpjproject/pjmedia/src/pjmedia/converter_libswscale.c Xpjproject/pjmedia/src/pjmedia/converter_libyuv.c Xpjproject/pjmedia/src/pjmedia/echo_webrtc.c + Xpjproject/pjmedia/src/pjmedia/echo_webrtc_aec3.cpp Xpjproject/pjmedia/src/pjmedia/event.c Xpjproject/pjmedia/src/pjmedia/ffmpeg_util.c Xpjproject/pjmedia/src/pjmedia/ffmpeg_util.h @@ -3186,6 +3706,8 @@ Xpjproject/pjsip-apps/src/pjsua/android/jni/pjsua_app_callback.cpp Xpjproject/pjsip-apps/src/pjsua/android/jni/pjsua_app_callback.h Xpjproject/pjsip-apps/src/pjsua/gui.h + Xpjproject/pjsip-apps/src/pjsua/ios-swift/ipjsua-swift/ContentView.swift + Xpjproject/pjsip-apps/src/pjsua/ios-swift/ipjsua-swift/ipjsua_swiftApp.swift Xpjproject/pjsip-apps/src/pjsua/ios/ipjsua/ipjsuaAppDelegate.h Xpjproject/pjsip-apps/src/pjsua/ios/ipjsua/ipjsuaAppDelegate.m Xpjproject/pjsip-apps/src/pjsua/ios/ipjsua/ipjsuaViewController.h @@ -3202,6 +3724,18 @@ Xpjproject/pjsip-apps/src/pjsua/winrt/gui/uwp/VoipBackEnd/MyApp.h Xpjproject/pjsip-apps/src/pjsua/winrt/gui/uwp/VoipTasks/Helpers/EndpointHelper.cs Xpjproject/pjsip-apps/src/pjsua/wm/main_wm.c + Xpjproject/pjsip-apps/src/pjsua2/ios-swift-pjsua2/ios-swift-pjsua2/AppDelegate.swift + Xpjproject/pjsip-apps/src/pjsua2/ios-swift-pjsua2/ios-swift-pjsua2/Controller/ActiveViewController.swift + Xpjproject/pjsip-apps/src/pjsua2/ios-swift-pjsua2/ios-swift-pjsua2/Controller/IncomingViewController.swift + Xpjproject/pjsip-apps/src/pjsua2/ios-swift-pjsua2/ios-swift-pjsua2/Controller/OutgoingViewController.swift + Xpjproject/pjsip-apps/src/pjsua2/ios-swift-pjsua2/ios-swift-pjsua2/Controller/ViewController.swift + Xpjproject/pjsip-apps/src/pjsua2/ios-swift-pjsua2/ios-swift-pjsua2/Model/Model.swift + Xpjproject/pjsip-apps/src/pjsua2/ios-swift-pjsua2/ios-swift-pjsua2/PJSua2/CustomPJSUA2.cpp + Xpjproject/pjsip-apps/src/pjsua2/ios-swift-pjsua2/ios-swift-pjsua2/PJSua2/CustomPJSUA2.hpp + Xpjproject/pjsip-apps/src/pjsua2/ios-swift-pjsua2/ios-swift-pjsua2/PJSua2/wrapper.h + Xpjproject/pjsip-apps/src/pjsua2/ios-swift-pjsua2/ios-swift-pjsua2/PJSua2/wrapper.mm + Xpjproject/pjsip-apps/src/pjsua2/ios-swift-pjsua2/ios-swift-pjsua2/SceneDelegate.swift + Xpjproject/pjsip-apps/src/pjsua2/ios-swift-pjsua2/ios-swift-pjsua2/ios-swift-pjsua2-Bridging-Header.h Xpjproject/pjsip-apps/src/pjsystest/gui.h Xpjproject/pjsip-apps/src/pjsystest/main_console.c Xpjproject/pjsip-apps/src/pjsystest/main_wm.c @@ -3292,6 +3826,7 @@ 2010-2011, Teluu Inc. (http://www.teluu.com) 2011, Teluu Inc. (http://www.teluu.com) 2011-2015, Teluu Inc. (http://www.teluu.com) + 2011-2021, Teluu Inc. (http://www.teluu.com) 2012, Teluu Inc. (http://www.teluu.com) 2012-2013, Teluu Inc. (http://www.teluu.com) 2013, Teluu Inc. (http://www.teluu.com) @@ -3304,6 +3839,9 @@ 2017, Teluu Inc. (http://www.teluu.com) 2018, Teluu Inc. (http://www.teluu.com) 2019, Teluu Inc. (http://www.teluu.com) + 2019-2020, Teluu Inc. (http://www.teluu.com) + 2020, Teluu Inc. (http://www.teluu.com) + 2021, Teluu Inc. (http://www.teluu.com) 2032, Teluu Inc. (http://www.teluu.com) License: GPL-2+ FIXME @@ -3415,6 +3953,7 @@ Xpjproject/tests/pjsua/scripts-sipp/uas-mwi-0.xml Xpjproject/tests/pjsua/scripts-sipp/uas-mwi.xml Xpjproject/tests/pjsua/scripts-sipp/uas-prack_fork.xml + Xpjproject/tests/pjsua/scripts-sipp/uas-reinv-after-failed-nego.xml Xpjproject/tests/pjsua/scripts-sipp/uas-reinv-and-ack-same-branch-without-sdp.xml Xpjproject/tests/pjsua/scripts-sipp/uas-reinv-and-ack-without-sdp.xml Xpjproject/tests/pjsua/scripts-sipp/uas-reinv-glare.xml @@ -3428,12 +3967,70 @@ Xpjproject/tests/pjsua/scripts-sipp/uas-template.xml Xpjproject/tests/pjsua/scripts-sipp/uas-timer-reinvite.xml Xpjproject/tests/pjsua/scripts-sipp/uas-timer-update.xml + Xpjproject/third_party/webrtc_aec3/src/third_party/pffft/README.txt apps/app_fax.c contrib/scripts/astcli Copyright: NONE License: GPL FIXME +Files: include/asterisk/logger_category.h + include/asterisk/mwi.h + include/asterisk/res_aeap.h + include/asterisk/res_aeap_message.h + include/asterisk/res_pjsip_session_caps.h + include/asterisk/res_stir_shaken.h + include/asterisk/serializer.h + include/asterisk/stasis_state.h + main/logger_category.c + main/mwi.c + main/serializer.c + main/stasis_state.c + main/time.c + res/res_aeap.c + res/res_aeap/aeap.c + res/res_aeap/general.c + res/res_aeap/general.h + res/res_aeap/logger.h + res/res_aeap/message.c + res/res_aeap/message_json.c + res/res_aeap/transaction.c + res/res_aeap/transaction.h + res/res_aeap/transport.c + res/res_aeap/transport.h + res/res_aeap/transport_websocket.c + res/res_aeap/transport_websocket.h + res/res_pjsip_session/pjsip_session_caps.c + res/res_pjsip_stir_shaken.c + res/res_speech_aeap.c + res/res_stir_shaken.c + res/res_stir_shaken/certificate.c + res/res_stir_shaken/certificate.h + res/res_stir_shaken/curl.c + res/res_stir_shaken/curl.h + res/res_stir_shaken/general.c + res/res_stir_shaken/general.h + res/res_stir_shaken/profile.c + res/res_stir_shaken/profile.h + res/res_stir_shaken/profile_private.h + res/res_stir_shaken/stir_shaken.c + res/res_stir_shaken/stir_shaken.h + res/res_stir_shaken/store.c + res/res_stir_shaken/store.h + tests/test_aeap.c + tests/test_aeap_speech.c + tests/test_aeap_transaction.c + tests/test_aeap_transport.c + tests/test_mwi.c + tests/test_res_pjsip_session_caps.c + tests/test_stasis_state.c +Copyright: 2019, Sangoma Technologies Corporation + 2020, Sangoma Technologies Corporation + 2021, Sangoma Technologies Corporation + 2022, Sangoma Technologies Corporation +License: GPL-2 + FIXME + Files: include/solaris-compat/sys/queue.h utils/db1-ast/btree/bt_close.c utils/db1-ast/btree/bt_conv.c @@ -3485,6 +4082,60 @@ License: BSD-4-Clause-UC FIXME +Files: Xpjproject/third_party/webrtc_aec3/src/api/array_view.h + Xpjproject/third_party/webrtc_aec3/src/api/audio/test/audio_frame_unittest.cc + Xpjproject/third_party/webrtc_aec3/src/api/audio/test/echo_canceller3_config_json_unittest.cc + Xpjproject/third_party/webrtc_aec3/src/api/audio/test/echo_canceller3_config_unittest.cc + Xpjproject/third_party/webrtc_aec3/src/api/function_view.h + Xpjproject/third_party/webrtc_aec3/src/api/scoped_refptr.h + Xpjproject/third_party/webrtc_aec3/src/rtc_base/atomic_ops.h + Xpjproject/third_party/webrtc_aec3/src/rtc_base/checks.cc + Xpjproject/third_party/webrtc_aec3/src/rtc_base/checks.h + Xpjproject/third_party/webrtc_aec3/src/rtc_base/constructor_magic.h + Xpjproject/third_party/webrtc_aec3/src/rtc_base/logging.cc + Xpjproject/third_party/webrtc_aec3/src/rtc_base/logging.h + Xpjproject/third_party/webrtc_aec3/src/rtc_base/numerics/safe_compare.h + Xpjproject/third_party/webrtc_aec3/src/rtc_base/numerics/safe_conversions.h + Xpjproject/third_party/webrtc_aec3/src/rtc_base/numerics/safe_conversions_impl.h + Xpjproject/third_party/webrtc_aec3/src/rtc_base/numerics/safe_minmax.h + Xpjproject/third_party/webrtc_aec3/src/rtc_base/ref_count.h + Xpjproject/third_party/webrtc_aec3/src/rtc_base/ref_counted_object.h + Xpjproject/third_party/webrtc_aec3/src/rtc_base/ref_counter.h + Xpjproject/third_party/webrtc_aec3/src/rtc_base/string_encode.cc + Xpjproject/third_party/webrtc_aec3/src/rtc_base/string_encode.h + Xpjproject/third_party/webrtc_aec3/src/rtc_base/string_to_number.cc + Xpjproject/third_party/webrtc_aec3/src/rtc_base/string_to_number.h + Xpjproject/third_party/webrtc_aec3/src/rtc_base/string_utils.cc + Xpjproject/third_party/webrtc_aec3/src/rtc_base/string_utils.h + Xpjproject/third_party/webrtc_aec3/src/rtc_base/strings/string_builder.cc + Xpjproject/third_party/webrtc_aec3/src/rtc_base/strings/string_builder.h + Xpjproject/third_party/webrtc_aec3/src/rtc_base/synchronization/mutex.cc + Xpjproject/third_party/webrtc_aec3/src/rtc_base/synchronization/mutex.h + Xpjproject/third_party/webrtc_aec3/src/rtc_base/synchronization/mutex_abseil.h + Xpjproject/third_party/webrtc_aec3/src/rtc_base/synchronization/mutex_benchmark.cc + Xpjproject/third_party/webrtc_aec3/src/rtc_base/synchronization/mutex_critical_section.h + Xpjproject/third_party/webrtc_aec3/src/rtc_base/synchronization/mutex_pthread.h + Xpjproject/third_party/webrtc_aec3/src/rtc_base/synchronization/mutex_race_check.h + Xpjproject/third_party/webrtc_aec3/src/rtc_base/synchronization/yield.cc + Xpjproject/third_party/webrtc_aec3/src/rtc_base/system_time.cc + Xpjproject/third_party/webrtc_aec3/src/rtc_base/system_time.h + Xpjproject/third_party/webrtc_aec3/src/rtc_base/time_utils.cc + Xpjproject/third_party/webrtc_aec3/src/rtc_base/time_utils.h + Xpjproject/third_party/webrtc_aec3/src/rtc_base/type_traits.h +Copyright: 2004, The WebRTC Project Authors. + 2005, The WebRTC Project Authors. + 2006, The WebRTC Project Authors. + 2011, The WebRTC Project Authors. + 2014, The WebRTC Project Authors. + 2015, The WebRTC Project Authors. + 2016, The WebRTC Project Authors. + 2017, The WebRTC Project Authors. + 2018, The WebRTC Project Authors. + 2020, The WebRTC Project Authors. + 2021, The WebRTC Project Authors. +License: UNKNOWN + FIXME + Files: Makefile Makefile.moddir_rules Makefile.rules @@ -3535,41 +4186,37 @@ License: GPL FIXME -Files: include/asterisk/logger_category.h - include/asterisk/mwi.h - include/asterisk/res_pjsip_session_caps.h - include/asterisk/res_stir_shaken.h - include/asterisk/serializer.h - include/asterisk/stasis_state.h - main/logger_category.c - main/mwi.c - main/serializer.c - main/stasis_state.c - main/time.c - res/res_pjsip_session/pjsip_session_caps.c - res/res_pjsip_stir_shaken.c - res/res_stir_shaken.c - res/res_stir_shaken/certificate.c - res/res_stir_shaken/certificate.h - res/res_stir_shaken/curl.c - res/res_stir_shaken/curl.h - res/res_stir_shaken/general.c - res/res_stir_shaken/general.h - res/res_stir_shaken/profile.c - res/res_stir_shaken/profile.h - res/res_stir_shaken/profile_private.h - res/res_stir_shaken/stir_shaken.c - res/res_stir_shaken/stir_shaken.h - res/res_stir_shaken/store.c - res/res_stir_shaken/store.h - tests/test_mwi.c - tests/test_res_pjsip_session_caps.c - tests/test_stasis_state.c -Copyright: 2019, Sangoma Technologies Corporation - 2020, Sangoma Technologies Corporation - 2021, Sangoma Technologies Corporation - 2022, Sangoma Technologies Corporation -License: GPL-2 +Files: Xpjproject/third_party/webrtc_aec3/src/absl/base/attributes.h + Xpjproject/third_party/webrtc_aec3/src/absl/base/config.h + Xpjproject/third_party/webrtc_aec3/src/absl/base/const_init.h + Xpjproject/third_party/webrtc_aec3/src/absl/base/internal/atomic_hook.h + Xpjproject/third_party/webrtc_aec3/src/absl/base/internal/identity.h + Xpjproject/third_party/webrtc_aec3/src/absl/base/internal/inline_variable.h + Xpjproject/third_party/webrtc_aec3/src/absl/base/internal/invoke.h + Xpjproject/third_party/webrtc_aec3/src/absl/base/internal/raw_logging.cc + Xpjproject/third_party/webrtc_aec3/src/absl/base/internal/raw_logging.h + Xpjproject/third_party/webrtc_aec3/src/absl/base/internal/throw_delegate.cc + Xpjproject/third_party/webrtc_aec3/src/absl/base/internal/throw_delegate.h + Xpjproject/third_party/webrtc_aec3/src/absl/base/log_severity.cc + Xpjproject/third_party/webrtc_aec3/src/absl/base/log_severity.h + Xpjproject/third_party/webrtc_aec3/src/absl/base/macros.h + Xpjproject/third_party/webrtc_aec3/src/absl/base/optimization.h + Xpjproject/third_party/webrtc_aec3/src/absl/base/options.h + Xpjproject/third_party/webrtc_aec3/src/absl/base/policy_checks.h + Xpjproject/third_party/webrtc_aec3/src/absl/base/port.h + Xpjproject/third_party/webrtc_aec3/src/absl/memory/memory.h + Xpjproject/third_party/webrtc_aec3/src/absl/meta/type_traits.h + Xpjproject/third_party/webrtc_aec3/src/absl/strings/string_view.cc + Xpjproject/third_party/webrtc_aec3/src/absl/strings/string_view.h + Xpjproject/third_party/webrtc_aec3/src/absl/types/bad_optional_access.cc + Xpjproject/third_party/webrtc_aec3/src/absl/types/bad_optional_access.h + Xpjproject/third_party/webrtc_aec3/src/absl/types/internal/optional.h + Xpjproject/third_party/webrtc_aec3/src/absl/types/optional.h + Xpjproject/third_party/webrtc_aec3/src/absl/utility/utility.h +Copyright: 2017, The Abseil Authors. + 2018, The Abseil Authors. + 2019, The Abseil Authors. +License: Apache-2.0 FIXME Files: Xpjproject/pjmedia/README.txt @@ -3737,6 +4384,20 @@ License: GPL-2+ FIXME +Files: apps/app_dtmfstore.c + apps/app_mf.c + apps/app_reload.c + apps/app_sf.c + apps/app_waitforcond.c + funcs/func_evalexten.c + funcs/func_frame_drop.c + funcs/func_json.c + funcs/func_scramble.c + res/res_tonedetect.c +Copyright: 2021, Naveen Albert +License: GPL-2 + FIXME + Files: include/asterisk/res_prometheus.h res/prometheus/bridges.c res/prometheus/channels.c @@ -3766,19 +4427,6 @@ License: GPL-2 FIXME -Files: apps/app_dtmfstore.c - apps/app_mf.c - apps/app_reload.c - apps/app_sf.c - apps/app_waitforcond.c - funcs/func_frame_drop.c - funcs/func_json.c - funcs/func_scramble.c - res/res_tonedetect.c -Copyright: 2021, Naveen Albert -License: GPL-2 - FIXME - Files: include/asterisk/astobj2.h main/astobj2.c main/astobj2_container.c @@ -3990,8 +4638,8 @@ Files: Xpjproject/aconfigure configure menuselect/configure -Copyright: 1992-1996, 1998-2012, Free Software Foundation, Inc. - 2012, Free Software Foundation, Inc. +Copyright: 1992-1996, 1998-2017, 2020-2021, Free Software Foundation, + 2021, Free Software Foundation, Inc. License: FSFUL FIXME @@ -4287,6 +4935,13 @@ License: UNKNOWN FIXME +Files: Xpjproject/third_party/webrtc_aec3/src/third_party/pffft/src/pffft.c + Xpjproject/third_party/webrtc_aec3/src/third_party/pffft/src/pffft.h +Copyright: 2004, the University Corporation for Atmospheric + 2013, Julien Pommier ( pommier@modartt.com ) +License: UNKNOWN + FIXME + Files: Xmp3/decode_i386.c Xmp3/decode_ntom.c Copyright: 1995-1997, Michael Hipp @@ -4312,6 +4967,12 @@ License: UNKNOWN FIXME +Files: Xpjproject/third_party/webrtc_aec3/src/common_audio/third_party/ooura/LICENSE + Xpjproject/third_party/webrtc_aec3/src/common_audio/third_party/ooura/fft_size_256/fft4g.cc +Copyright: Takuya OOURA, 1996-2001 +License: UNKNOWN + FIXME + Files: install-sh menuselect/install-sh Copyright: 1994, X Consortium @@ -4329,11 +4990,49 @@ License: (GPL-3+ and/or public-domain) with Bison-2.2 exception FIXME +Files: Xpjproject/third_party/webrtc_aec3/src/absl/README.md +Copyright: NONE +License: Apache + FIXME + +Files: Xpjproject/third_party/webrtc_aec3/src/absl/LICENSE +Copyright: NONE +License: Apache-2.0 + FIXME + Files: Xpjproject/pjsip-apps/src/pjsua/bb10/bar-descriptor.xml Copyright: 2011-2013, Research In Motion Limited. License: Apache-2.0 FIXME +Files: Xpjproject/third_party/build/samplerate/README.txt +Copyright: NONE +License: BSD-2-clause + FIXME + +Files: Xpjproject/third_party/webrtc_aec3/src/third_party/rnnoise/src/rnn_activations.h +Copyright: 2008-2011, Octasic Inc. +License: BSD-2-clause + FIXME + +Files: Xpjproject/third_party/webrtc_aec3/src/third_party/rnnoise/README.chromium +Copyright: NONE +License: BSD-3-clause + FIXME + +Files: Xpjproject/third_party/webrtc_aec3/src/third_party/rnnoise/COPYING +Copyright: 2003-2004, Mark Borgerding + 2005-2017, Xiph.Org Foundation + 2007-2017, Jean-Marc Valin + 2017, Mozilla +License: BSD-3-clause + FIXME + +Files: Xpjproject/third_party/webrtc_aec3/LICENSE +Copyright: 2011, The WebRTC project authors. +License: BSD-3-clause + FIXME + Files: main/dns.c Copyright: 1983, 1989, 1993, The Regents of the University of California. 1993, Digital Equipment Corporation. @@ -4976,6 +5675,12 @@ License: UNKNOWN FIXME +Files: Xpjproject/third_party/webrtc_aec3/src/common_audio/third_party/ooura/fft_size_128/ooura_fft.cc +Copyright: Do a mix of floats and 64 bit integer to maximize register + Takuya OOURA, 1996-2001 +License: UNKNOWN + FIXME + Files: addons/ooh323c/src/Makefile.in Copyright: 1994-2002, Free Software Foundation, Inc. License: UNKNOWN diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/debian/patches/020210816~20b2741.patch asterisk-18.12.0~dfsg+~cs6.12.40431413/debian/patches/020210816~20b2741.patch --- asterisk-18.11.2~dfsg+~cs6.10.40431413/debian/patches/020210816~20b2741.patch 2022-04-06 13:18:41.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/debian/patches/020210816~20b2741.patch 2022-05-12 20:34:27.000000000 +0000 @@ -3151,207 +3151,6 @@ -;channel=1 -;channel=2 -;channel=3 ---- a/configure -+++ b/configure -@@ -722,10 +722,6 @@ - X11_DIR - X11_INCLUDE - X11_LIB --PBX_VPB --VPB_DIR --VPB_INCLUDE --VPB_LIB - PBX_VORBIS - VORBIS_DIR - VORBIS_INCLUDE -@@ -1456,7 +1452,6 @@ - with_unbound - with_unixodbc - with_vorbis --with_vpb - with_x11 - with_z - enable_xmldoc -@@ -2235,7 +2230,6 @@ - --with-unbound=PATH use unbound files in PATH - --with-unixodbc=PATH use unixODBC files in PATH - --with-vorbis=PATH use Vorbis files in PATH -- --with-vpb=PATH use Voicetronix API files in PATH - --with-x11=PATH use X11 files in PATH - --with-z=PATH use zlib compression files in PATH - -@@ -3150,52 +3144,6 @@ - as_fn_set_status $ac_retval - - } # ac_fn_c_compute_int -- --# ac_fn_cxx_try_link LINENO --# ------------------------- --# Try to link conftest.$ac_ext, and return whether this succeeded. --ac_fn_cxx_try_link () --{ -- as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack -- rm -f conftest.$ac_objext conftest$ac_exeext -- if { { ac_try="$ac_link" --case "(($ac_try" in -- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; -- *) ac_try_echo=$ac_try;; --esac --eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" --$as_echo "$ac_try_echo"; } >&5 -- (eval "$ac_link") 2>conftest.err -- ac_status=$? -- if test -s conftest.err; then -- grep -v '^ *+' conftest.err >conftest.er1 -- cat conftest.er1 >&5 -- mv -f conftest.er1 conftest.err -- fi -- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 -- test $ac_status = 0; } && { -- test -z "$ac_cxx_werror_flag" || -- test ! -s conftest.err -- } && test -s conftest$ac_exeext && { -- test "$cross_compiling" = yes || -- test -x conftest$ac_exeext -- }; then : -- ac_retval=0 --else -- $as_echo "$as_me: failed program was:" >&5 --sed 's/^/| /' conftest.$ac_ext >&5 -- -- ac_retval=1 --fi -- # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information -- # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would -- # interfere with the next link command; also delete a directory that is -- # left behind by Apple's compiler. We do this before executing the actions. -- rm -rf conftest.dSYM conftest_ipa8_conftest.oo -- eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno -- as_fn_set_status $ac_retval -- --} # ac_fn_cxx_try_link - cat >config.log <<_ACEOF - This file contains any messages produced by compilers while - running configure, to aid debugging if configure makes a mistake. -@@ -13516,38 +13464,6 @@ - - - -- VPB_DESCRIP="Voicetronix API" -- VPB_OPTION="vpb" -- PBX_VPB=0 -- --# Check whether --with-vpb was given. --if test "${with_vpb+set}" = set; then : -- withval=$with_vpb; -- case ${withval} in -- n|no) -- USE_VPB=no -- # -1 is a magic value used by menuselect to know that the package -- # was disabled, other than 'not found' -- PBX_VPB=-1 -- ;; -- y|ye|yes) -- ac_mandatory_list="${ac_mandatory_list} VPB" -- ;; -- *) -- VPB_DIR="${withval}" -- ac_mandatory_list="${ac_mandatory_list} VPB" -- ;; -- esac -- --fi -- -- -- -- -- -- -- -- - X11_DESCRIP="X11" - X11_OPTION="x11" - PBX_X11=0 -@@ -33799,79 +33715,6 @@ - fi - - --ac_ext=cpp --ac_cpp='$CXXCPP $CPPFLAGS' --ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' --ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' --ac_compiler_gnu=$ac_cv_cxx_compiler_gnu -- -- --if test "${USE_VPB}" != "no"; then -- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for vpb_open in -lvpb" >&5 --$as_echo_n "checking for vpb_open in -lvpb... " >&6; } -- saved_libs="${LIBS}" -- saved_cppflags="${CPPFLAGS}" -- if test "x${VPB_DIR}" != "x"; then -- if test -d ${VPB_DIR}/lib; then -- vpblibdir=${VPB_DIR}/lib -- else -- vpblibdir=${VPB_DIR} -- fi -- LIBS="${LIBS} -L${vpblibdir}" -- CPPFLAGS="${CPPFLAGS} -I${VPB_DIR}/include" -- fi -- LIBS="${PTHREAD_LIBS} ${LIBS} -lvpb" -- CPPFLAGS="${CPPFLAGS} ${PTHREAD_CFLAGS}" -- --cat confdefs.h - <<_ACEOF >conftest.$ac_ext --/* end confdefs.h. */ -- -- #include --int --main () --{ --int q = vpb_open(0,0); -- ; -- return 0; --} -- --_ACEOF --if ac_fn_cxx_try_link "$LINENO"; then : -- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 --$as_echo "yes" >&6; } -- ac_cv_lib_vpb_vpb_open="yes" -- --else -- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 --$as_echo "no" >&6; } -- ac_cv_lib_vpb_vpb_open="no" -- -- --fi --rm -f core conftest.err conftest.$ac_objext \ -- conftest$ac_exeext conftest.$ac_ext -- LIBS="${saved_libs}" -- CPPFLAGS="${saved_cppflags}" -- if test "${ac_cv_lib_vpb_vpb_open}" = "yes"; then -- VPB_LIB="-lvpb" -- if test "${VPB_DIR}" != ""; then -- VPB_LIB="-L${vpblibdir} ${VPB_LIB}" -- VPB_INCLUDE="-I${VPB_DIR}/include" -- fi -- PBX_VPB=1 -- --$as_echo "#define HAVE_VPB 1" >>confdefs.h -- -- fi --fi -- --ac_ext=c --ac_cpp='$CPP $CPPFLAGS' --ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' --ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' --ac_compiler_gnu=$ac_cv_c_compiler_gnu -- -- - - if test "x${PBX_ZLIB}" != "x1" -a "${USE_ZLIB}" != "no"; then - pbxlibdir="" --- a/configure.ac +++ b/configure.ac @@ -650,7 +650,6 @@ @@ -3362,7 +3161,7 @@ AST_EXT_LIB_SETUP([X11], [X11], [x11]) AST_EXT_LIB_SETUP([ZLIB], [zlib compression], [z]) -@@ -2788,51 +2787,6 @@ +@@ -2789,51 +2788,6 @@ AST_EXT_LIB_CHECK([VORBIS], [vorbis], [vorbis_info_init], [vorbis/codec.h], [-lm -lvorbisenc -lvorbisfile]) AST_C_DECLARE_CHECK([VORBIS_OPEN_CALLBACKS], [OV_CALLBACKS_NOCLOSE], [vorbis/vorbisfile.h]) diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/debian/patches/1007_ffmpeg_detect.patch asterisk-18.12.0~dfsg+~cs6.12.40431413/debian/patches/1007_ffmpeg_detect.patch --- asterisk-18.11.2~dfsg+~cs6.10.40431413/debian/patches/1007_ffmpeg_detect.patch 2022-04-06 13:21:30.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/debian/patches/1007_ffmpeg_detect.patch 2022-05-12 20:34:36.000000000 +0000 @@ -23,7 +23,7 @@ AST_EXT_LIB_SETUP([GSM], [External GSM], [gsm], [, use 'internal' GSM otherwise]) AST_EXT_LIB_SETUP([ILBC], [System iLBC], [ilbc], [, use 'internal' iLBC otherwise]) AST_EXT_LIB_SETUP([GTK2], [gtk2], [gtk2]) -@@ -2820,7 +2820,18 @@ +@@ -2821,7 +2821,18 @@ AST_EXT_TOOL_CHECK([SDL], [sdl-config]) AST_EXT_LIB_CHECK([SDL_IMAGE], [SDL_image], [IMG_Load], [SDL_image.h], [${SDL_LIB}], [${SDL_INCLUDE}]) diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/debian/patches/2011_amr_build_tools.patch asterisk-18.12.0~dfsg+~cs6.12.40431413/debian/patches/2011_amr_build_tools.patch --- asterisk-18.11.2~dfsg+~cs6.10.40431413/debian/patches/2011_amr_build_tools.patch 2022-04-06 13:21:30.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/debian/patches/2011_amr_build_tools.patch 2022-05-12 20:34:43.000000000 +0000 @@ -29,7 +29,7 @@ AST_EXT_LIB_SETUP([BFD], [Debug symbol decoding], [bfd]) # BKTR is used for backtrace support on platforms that do not -@@ -1607,6 +1610,10 @@ +@@ -1608,6 +1611,10 @@ AST_EXT_LIB_CHECK([ALSA], [asound], [snd_pcm_open], [alsa/asoundlib.h]) diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/debian/patches/2014_pjproject_unbreak.patch asterisk-18.12.0~dfsg+~cs6.12.40431413/debian/patches/2014_pjproject_unbreak.patch --- asterisk-18.11.2~dfsg+~cs6.10.40431413/debian/patches/2014_pjproject_unbreak.patch 2022-04-06 12:26:39.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/debian/patches/2014_pjproject_unbreak.patch 2022-05-12 20:36:07.000000000 +0000 @@ -11,6 +11,6 @@ legacy_dev.o null_dev.o pa_dev.o wmme_dev.o \ - alsa_dev.o bb10_dev.o bdimad_dev.o \ + alsa_dev.o bb10_dev.o \ - android_jni_dev.o opensl_dev.o + android_jni_dev.o opensl_dev.o oboe_dev.o export PJMEDIA_AUDIODEV_CFLAGS += $(_CFLAGS) export PJMEDIA_AUDIODEV_CXXFLAGS += $(_CXXFLAGS) diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/debian/patches/2015_opus.patch asterisk-18.12.0~dfsg+~cs6.12.40431413/debian/patches/2015_opus.patch --- asterisk-18.11.2~dfsg+~cs6.10.40431413/debian/patches/2015_opus.patch 2022-04-06 13:21:30.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/debian/patches/2015_opus.patch 2022-05-12 20:36:10.000000000 +0000 @@ -28,7 +28,7 @@ AST_EXT_LIB_SETUP([OPUSFILE], [Opusfile], [opusfile]) AST_EXT_LIB_SETUP([OSPTK], [OSP Toolkit], [osptk]) AST_EXT_LIB_SETUP([OSS], [Open Sound System], [oss]) -@@ -2616,6 +2617,7 @@ +@@ -2617,6 +2618,7 @@ if test -z "$__opus_include" -o x"$__opus_include" = x" " ; then __opus_include=-I/usr/include/opus fi diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/debian/watch asterisk-18.12.0~dfsg+~cs6.12.40431413/debian/watch --- asterisk-18.11.2~dfsg+~cs6.10.40431413/debian/watch 2022-04-06 12:17:04.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/debian/watch 2022-05-12 17:14:24.000000000 +0000 @@ -35,5 +35,5 @@ component=Xpjproject,\ filenamemangle=s/.*?(@ANY_VERSION@@ARCHIVE_EXT@)/@PACKAGE@-Xpjproject-$1/,\ dversionmangle=auto \ -https://github.com/asterisk/pjproject/tags \ -.*?(2\.10)@ARCHIVE_EXT@ checksum +https://github.com/pjsip/pjproject/tags \ +.*?(2\.12)@ARCHIVE_EXT@ checksum diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/doc/asterisk.8 asterisk-18.12.0~dfsg+~cs6.12.40431413/doc/asterisk.8 --- asterisk-18.11.2~dfsg+~cs6.10.40431413/doc/asterisk.8 2022-04-14 21:53:34.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/doc/asterisk.8 2022-05-12 11:50:59.000000000 +0000 @@ -158,6 +158,7 @@ .TP \-n Disable ANSI colors even on terminals capable of displaying them. +This option can be used only at startup (e.g. not with remote console). .TP \-p If supported by the operating system (and executing as root), @@ -195,7 +196,8 @@ .TP \-T Add timestamp to all non-command related output going to the console -when running with verbose and/or logging to the console. +when running with verbose and/or logging to the console. Can only be +used at startup (e.g. not with remote console mode). .TP \-U \fIuser\fR Run as user \fIuser\fR instead of the diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/funcs/func_channel.c asterisk-18.12.0~dfsg+~cs6.12.40431413/funcs/func_channel.c --- asterisk-18.11.2~dfsg+~cs6.10.40431413/funcs/func_channel.c 2022-04-14 21:53:34.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/funcs/func_channel.c 2022-05-12 11:50:59.000000000 +0000 @@ -64,6 +64,11 @@ + + 16.22.0 + 18.8.0 + 19.0.0 + Checks if the specified channel exists. diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/funcs/func_db.c asterisk-18.12.0~dfsg+~cs6.12.40431413/funcs/func_db.c --- asterisk-18.11.2~dfsg+~cs6.10.40431413/funcs/func_db.c 2022-04-14 21:53:34.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/funcs/func_db.c 2022-05-12 11:50:59.000000000 +0000 @@ -95,6 +95,25 @@ at the prefix specified within the Asterisk database. If no argument is provided, then a list of key families will be returned. + + DB_KEYCOUNT + + + + + Obtain the number of keys at a prefix within the Asterisk database. + + + + + + This function will return the number of keys that exist + at the prefix specified within the Asterisk database. If no argument is + provided, then the number of all key families will be returned. + + + DB_KEYS + @@ -286,6 +305,57 @@ .read2 = function_db_keys, }; +static int function_db_keycount(struct ast_channel *chan, const char *cmd, char *parse, char *buf, size_t len) +{ + size_t parselen = strlen(parse); + struct ast_db_entry *dbe, *orig_dbe; + const char *last = ""; + int keycount = 0; + + /* Remove leading and trailing slashes */ + while (parse[0] == '/') { + parse++; + parselen--; + } + while (parse[parselen - 1] == '/') { + parse[--parselen] = '\0'; + } + + /* Nothing within the database at that prefix? */ + if (!(orig_dbe = dbe = ast_db_gettree(parse, NULL))) { + snprintf(buf, len, "%d", keycount); + return 0; + } + + for (; dbe; dbe = dbe->next) { + /* Find the current component */ + char *curkey = &dbe->key[parselen + 1], *slash; + if (*curkey == '/') { + curkey++; + } + /* Remove everything after the current component */ + if ((slash = strchr(curkey, '/'))) { + *slash = '\0'; + } + + /* Skip duplicates */ + if (!strcasecmp(last, curkey)) { + continue; + } + last = curkey; + + keycount++; + } + ast_db_freetree(orig_dbe); + snprintf(buf, len, "%d", keycount); + return 0; +} + +static struct ast_custom_function db_keycount_function = { + .name = "DB_KEYCOUNT", + .read = function_db_keycount, +}; + static int function_db_delete(struct ast_channel *chan, const char *cmd, char *parse, char *buf, size_t len) { @@ -347,6 +417,7 @@ res |= ast_custom_function_unregister(&db_exists_function); res |= ast_custom_function_unregister(&db_delete_function); res |= ast_custom_function_unregister(&db_keys_function); + res |= ast_custom_function_unregister(&db_keycount_function); return res; } @@ -359,6 +430,7 @@ res |= ast_custom_function_register(&db_exists_function); res |= ast_custom_function_register_escalating(&db_delete_function, AST_CFE_READ); res |= ast_custom_function_register(&db_keys_function); + res |= ast_custom_function_register(&db_keycount_function); return res; } diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/funcs/func_env.c asterisk-18.12.0~dfsg+~cs6.12.40431413/funcs/func_env.c --- asterisk-18.11.2~dfsg+~cs6.10.40431413/funcs/func_env.c 2022-04-14 21:53:34.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/funcs/func_env.c 2022-05-12 11:50:59.000000000 +0000 @@ -291,6 +291,11 @@ + + 16.21.0 + 18.7.0 + 19.0.0 + Return the name of a file. @@ -309,6 +314,11 @@ + + 16.21.0 + 18.7.0 + 19.0.0 + Return the directory of a file. diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/funcs/func_evalexten.c asterisk-18.12.0~dfsg+~cs6.12.40431413/funcs/func_evalexten.c --- asterisk-18.11.2~dfsg+~cs6.10.40431413/funcs/func_evalexten.c 1970-01-01 00:00:00.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/funcs/func_evalexten.c 2022-05-12 11:50:59.000000000 +0000 @@ -0,0 +1,147 @@ +/* + * Asterisk -- An open source telephony toolkit. + * + * Copyright (C) 2021, Naveen Albert + * + * See http://www.asterisk.org for more information about + * the Asterisk project. Please do not directly contact + * any of the maintainers of this project for assistance; + * the project provides a web site, mailing lists and IRC + * channels for your use. + * + * This program is free software, distributed under the terms of + * the GNU General Public License Version 2. See the LICENSE file + * at the top of the source tree. + */ + +/*! \file + * + * \brief Dialplan extension evaluation function + * + * \author Naveen Albert + * + * \ingroup functions + */ + +/*** MODULEINFO + extended + ***/ + +#include "asterisk.h" + +#include "asterisk/module.h" +#include "asterisk/channel.h" +#include "asterisk/pbx.h" +#include "asterisk/utils.h" +#include "asterisk/app.h" + +/*** DOCUMENTATION + + + Evaluates the contents of a dialplan extension and returns it as a string. + + + + + + + + The EVAL_EXTEN function looks up a dialplan entry by context,extension,priority, + evaluates the contents of a Return statement to resolve any variable or function + references, and returns the result as a string. + You can use this function to create simple user-defined lookup tables or + user-defined functions. + + [call-types] + exten => _1NNN,1,Return(internal) + exten => _NXXNXXXXXX,1,Return(external) + + [udf] + exten => calleridlen,1,Return(${LEN(${CALLERID(num)})}) + + [default] + exten => _X!,1,Verbose(Call type ${EVAL_EXTEN(call-types,${EXTEN},1)} - ${EVAL_EXTEN(udf,calleridlen,1)}) + + Any variables in the evaluated data will be resolved in the context of + that extension. For example, ${EXTEN} would refer to the + EVAL_EXTEN extension, not the extension in the context invoking the function. + This behavior is similar to other applications, e.g. Gosub. + + same => n,Read(input,${EVAL_EXTEN(prompts,${CALLERID(num)},1)}) + + [prompts] + exten => _X!,1,Return(default) + exten => _20X,1,Return(welcome) + exten => _2XX,1,Return(${DB(promptsettings/${EXTEN})}) + exten => _3XX,1,Return(${ODBC_MYFUNC(${EXTEN})}) + + Extensions on which EVAL_EXTEN is invoked are not different from other + extensions. However, the application at that extension is not executed. + Only the application data is parsed and evaluated. + A limitation of this function is that the application at the specified + extension isn't actually executed, and thus unlike a Gosub, you can't pass + arguments in the EVAL_EXTEN function. + + + EVAL + + + ***/ + +static int eval_exten_read(struct ast_channel *chan, const char *cmd, char *data, char *buf, size_t len) +{ + char *exten, *pri, *context, *parse; + int ipri; + char tmpbuf[len]; + + if (ast_strlen_zero(data)) { + ast_log(LOG_WARNING, "The EVAL_EXTEN function requires an extension\n"); + return -1; + } + + parse = ast_strdupa(data); + /* Split context,exten,pri */ + context = strsep(&parse, ","); + exten = strsep(&parse, ","); + pri = strsep(&parse, ","); + + if (pbx_parse_location(chan, &context, &exten, &pri, &ipri, NULL, NULL)) { + return -1; + } + + if (ast_strlen_zero(exten) || ast_strlen_zero(context)) { /* only lock if we really need to */ + ast_channel_lock(chan); + if (ast_strlen_zero(exten)) { + exten = ast_strdupa(ast_channel_exten(chan)); + } + if (ast_strlen_zero(context)) { + context = ast_strdupa(ast_channel_context(chan)); + } + ast_channel_unlock(chan); + } + + if (ast_get_extension_data(tmpbuf, len, chan, context, exten, ipri)) { + return -1; /* EVAL_EXTEN failed */ + } + + pbx_substitute_variables_helper_full_location(chan, (chan) ? ast_channel_varshead(chan) : NULL, tmpbuf, buf, len, NULL, context, exten, ipri); + + return 0; +} + +static struct ast_custom_function eval_exten_function = { + .name = "EVAL_EXTEN", + .read = eval_exten_read, +}; + +static int unload_module(void) +{ + return ast_custom_function_unregister(&eval_exten_function); +} + +static int load_module(void) +{ + return ast_custom_function_register(&eval_exten_function); +} + +AST_MODULE_INFO_STANDARD_EXTENDED(ASTERISK_GPL_KEY, "Extension evaluation function"); diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/funcs/func_frame_drop.c asterisk-18.12.0~dfsg+~cs6.12.40431413/funcs/func_frame_drop.c --- asterisk-18.11.2~dfsg+~cs6.10.40431413/funcs/func_frame_drop.c 2022-04-14 21:53:34.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/funcs/func_frame_drop.c 2022-05-12 11:50:59.000000000 +0000 @@ -38,6 +38,11 @@ /*** DOCUMENTATION + + 16.21.0 + 18.7.0 + 19.0.0 + Drops specific frame types in the TX or RX direction on a channel. diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/funcs/func_json.c asterisk-18.12.0~dfsg+~cs6.12.40431413/funcs/func_json.c --- asterisk-18.11.2~dfsg+~cs6.10.40431413/funcs/func_json.c 2022-04-14 21:53:34.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/funcs/func_json.c 2022-05-12 11:50:59.000000000 +0000 @@ -39,6 +39,11 @@ /*** DOCUMENTATION + + 16.24.0 + 18.10.0 + 19.2.0 + Returns the string value of a JSON object key from a string containing a JSON array. diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/funcs/func_math.c asterisk-18.12.0~dfsg+~cs6.12.40431413/funcs/func_math.c --- asterisk-18.11.2~dfsg+~cs6.10.40431413/funcs/func_math.c 2022-04-14 21:53:34.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/funcs/func_math.c 2022-05-12 11:50:59.000000000 +0000 @@ -109,6 +109,11 @@ + + 16.19.0 + 18.5.0 + 19.0.0 + Returns the minimum of two numbers. @@ -123,6 +128,11 @@ + + 16.19.0 + 18.5.0 + 19.0.0 + Returns the maximum of two numbers. @@ -137,6 +147,11 @@ + + 16.19.0 + 18.5.0 + 19.0.0 + Returns absolute value of a number. diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/funcs/func_sayfiles.c asterisk-18.12.0~dfsg+~cs6.12.40431413/funcs/func_sayfiles.c --- asterisk-18.11.2~dfsg+~cs6.10.40431413/funcs/func_sayfiles.c 2022-04-14 21:53:34.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/funcs/func_sayfiles.c 2022-05-12 11:50:59.000000000 +0000 @@ -42,6 +42,11 @@ /*** DOCUMENTATION + + 16.21.0 + 18.7.0 + 19.0.0 + Returns the ampersand-delimited file names that would be played by the Say applications (e.g. SayAlpha, SayDigits). diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/funcs/func_scramble.c asterisk-18.12.0~dfsg+~cs6.12.40431413/funcs/func_scramble.c --- asterisk-18.11.2~dfsg+~cs6.10.40431413/funcs/func_scramble.c 2022-04-14 21:53:34.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/funcs/func_scramble.c 2022-05-12 11:50:59.000000000 +0000 @@ -32,6 +32,11 @@ /*** DOCUMENTATION + + 16.21.0 + 18.7.0 + 19.0.0 + Scrambles audio on a channel. diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/funcs/func_strings.c asterisk-18.12.0~dfsg+~cs6.12.40431413/funcs/func_strings.c --- asterisk-18.11.2~dfsg+~cs6.10.40431413/funcs/func_strings.c 2022-04-14 21:53:34.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/funcs/func_strings.c 2022-05-12 11:50:59.000000000 +0000 @@ -155,6 +155,11 @@ + + 16.21.0 + 18.7.0 + 19.0.0 + Inserts a substring between each character in a string. diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/funcs/func_talkdetect.c asterisk-18.12.0~dfsg+~cs6.12.40431413/funcs/func_talkdetect.c --- asterisk-18.11.2~dfsg+~cs6.10.40431413/funcs/func_talkdetect.c 2022-04-14 21:53:34.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/funcs/func_talkdetect.c 2022-05-12 11:50:59.000000000 +0000 @@ -42,6 +42,9 @@ /*** DOCUMENTATION + + 12.4.0 + Raises notifications when Asterisk detects silence or talking on a channel. diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/include/asterisk/config.h asterisk-18.12.0~dfsg+~cs6.12.40431413/include/asterisk/config.h --- asterisk-18.11.2~dfsg+~cs6.10.40431413/include/asterisk/config.h 2022-04-14 21:53:34.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/include/asterisk/config.h 2022-05-12 11:50:59.000000000 +0000 @@ -970,10 +970,10 @@ /*! * \brief Replace a variable in the given list with a new variable * - * \param head A pointer to the current variable list head. Since the variable to be - * replaced, this pointer may be updated with the new head. - * \param old A pointer to the existing variable to be replaced. - * \param new A pointer to the new variable that will replace the old one. + * \param head A pointer to the current variable list head. Since the variable to be + * replaced, this pointer may be updated with the new head. + * \param oldvar A pointer to the existing variable to be replaced. + * \param newvar A pointer to the new variable that will replace the old one. * * \retval 0 if a variable was replaced in the list * \retval -1 if no replacement occured @@ -981,8 +981,9 @@ * \note The search for the old variable is done simply on the pointer. * \note If a variable is replaced, its memory is freed. */ -int ast_variable_list_replace_variable(struct ast_variable **head, struct ast_variable *old, - struct ast_variable *new); +int ast_variable_list_replace_variable(struct ast_variable **head, + struct ast_variable *oldvar, + struct ast_variable *newvar); /*! * \brief Join an ast_variable list with specified separators and quoted values diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/include/asterisk/pbx.h asterisk-18.12.0~dfsg+~cs6.12.40431413/include/asterisk/pbx.h --- asterisk-18.11.2~dfsg+~cs6.10.40431413/include/asterisk/pbx.h 2022-04-14 21:53:34.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/include/asterisk/pbx.h 2022-05-12 11:50:59.000000000 +0000 @@ -1501,6 +1501,25 @@ */ int ast_async_goto_if_exists(struct ast_channel *chan, const char *context, const char *exten, int priority); +/*! + * \brief Parses a dialplan location into context, extension, priority + * + * \param chan Channel to execute on + * \param context Pointer to initial value for context. + * \param exten Pointer to initial value for exten. + * \param pri Pointer to initial value for pri + * \param ipri Pointer to integer value of priority + * \param mode Pointer to mode (or NULL if mode is not used) + * \param rest Pointer to buffer to capture rest of parsing (or NULL if not used) + * + * strsep should be used to initially populate context, exten, and pri prior + * to calling this function. All arguments are modified in place. + * + * \retval 0 success + * \retval non-zero failure + */ +int pbx_parse_location(struct ast_channel *chan, char **context, char **exten, char **pri, int *ipri, int *mode, char *rest); + struct ast_custom_function* ast_custom_function_find(const char *name); /*! diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/include/asterisk/res_aeap.h asterisk-18.12.0~dfsg+~cs6.12.40431413/include/asterisk/res_aeap.h --- asterisk-18.11.2~dfsg+~cs6.10.40431413/include/asterisk/res_aeap.h 1970-01-01 00:00:00.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/include/asterisk/res_aeap.h 2022-05-12 11:50:59.000000000 +0000 @@ -0,0 +1,370 @@ +/* + * Asterisk -- An open source telephony toolkit. + * + * Copyright (C) 2021, Sangoma Technologies Corporation + * + * Kevin Harwell + * + * See http://www.asterisk.org for more information about + * the Asterisk project. Please do not directly contact + * any of the maintainers of this project for assistance; + * the project provides a web site, mailing lists and IRC + * channels for your use. + * + * This program is free software, distributed under the terms of + * the GNU General Public License Version 2. See the LICENSE file + * at the top of the source tree. + */ + +/*! \file + * \brief Asterisk External Application Protocol API + */ + +#ifndef AST_RES_AEAP_H +#define AST_RES_AEAP_H + +#include + +struct ao2_container; +struct ast_sorcery; +struct ast_variable; + +struct ast_aeap_client_config; +struct ast_aeap_message; + +#define AEAP_CONFIG_CLIENT "client" + +/*! + * \brief Retrieve the AEAP sorcery object + * + * \returns the AEAP sorcery object + */ +struct ast_sorcery *ast_aeap_sorcery(void); + +/*! + * \brief Retrieve a listing of all client configuration objects by protocol. + * + * \note Caller is responsible for the returned container's reference. + * + * \param protocol An optional protocol to filter on (if NULL returns all client configs) + * + * \returns A container of client configuration objects + */ +struct ao2_container *ast_aeap_client_configs_get(const char *protocol); + +/*! + * \brief Retrieve codec capabilities from the configuration + * + * \param config A configuration object + * + * \returns The configuration's codec capabilities + */ +const struct ast_format_cap *ast_aeap_client_config_codecs(const struct ast_aeap_client_config *cfg); + +/*! + * \brief Check a given protocol against that in an Asterisk external application configuration + * + * \param config A configuration object + * \param protocol The protocol to check + * + * \returns True if the configuration's protocol matches, false otherwise + */ +int ast_aeap_client_config_has_protocol(const struct ast_aeap_client_config *cfg, + const char *protocol); + +/*! + * \brief Retrieve a list of custom configuration fields + * + * \param id configuration id/sorcery lookup key + * + * \returns variables, or NULL on error + */ +struct ast_variable *ast_aeap_custom_fields_get(const char *id); + +/*! + * \brief An Asterisk external application object + * + * Connects to an external application, sending and receiving data, and + * dispatches received data to registered handlers. + */ +struct ast_aeap; + +/*! + * \brief Event raised when a message is received + * + * \param aeap An Asterisk external application object + * \param message The received message + * \param obj Associated user object + * + * \returns 0 on if message handled, otherwise non-zero + */ +typedef int (*ast_aeap_on_message)(struct ast_aeap *aeap, struct ast_aeap_message *message, void *obj); + +/*! + * \brief An Asterisk external application message handler + * + * Used to register message handlers with an AEAP object. + */ +struct ast_aeap_message_handler { + /*! The handler name */ + const char *name; + /*! Callback triggered when on a name match */ + ast_aeap_on_message on_message; +}; + +/*! + * \brief Event raised when a sent message does not receive a reply within + * a specified time interval + * + * \param aeap An Asterisk external application object + * \param message The message sent that received no response + * \param obj Associated user object + */ +typedef void (*ast_aeap_on_timeout)(struct ast_aeap *aeap, struct ast_aeap_message *message, void *obj); + +/*! + * \brief Callback to cleanup a user object + * + * \param obj The user object + */ +typedef void (*ast_aeap_user_obj_cleanup)(void *obj); + +/*! + * \brief Supported Asterisk external application data types + */ +enum AST_AEAP_DATA_TYPE { + AST_AEAP_DATA_TYPE_NONE, + AST_AEAP_DATA_TYPE_BINARY, + AST_AEAP_DATA_TYPE_STRING, +}; + +/*! + * \brief Callbacks and other parameters used by an Asterisk external application object + */ +struct ast_aeap_params { + /*! + * If true pass along error messages to the implementation. + * Otherwise log it only, and consider it handled. + */ + unsigned int emit_error; + + /*! The message type used for communication */ + const struct ast_aeap_message_type *msg_type; + + /*! Response handlers array */ + const struct ast_aeap_message_handler *response_handlers; + /*! The number of response handlers */ + uintmax_t response_handlers_size; + + /*! Request handlers array */ + const struct ast_aeap_message_handler *request_handlers; + /*! The number of request handlers */ + uintmax_t request_handlers_size; + + /*! + * \brief Raised when binary data is received + * + * \param aeap An Asterisk external application object + * \param buf The buffer containing binary data + * \param size The size of the buffer + */ + void (*on_binary)(struct ast_aeap *aeap, const void *buf, intmax_t size); + + /*! + * \brief Raised when string data is received + * + * \param aeap An Asterisk external application object + * \param buf The buffer containing string data + * \param size The size/length of the string + */ + void (*on_string)(struct ast_aeap *aeap, const char *buf, intmax_t size); + + /*! + * \brief Raised when an error occurs during reading + * + * \note This is an AEAP transport level read error event + * + * \note When this event is triggered the client has also + * been disconnected. + * + * \param aeap An Asterisk external application object + */ + void (*on_error)(struct ast_aeap *aeap); +}; + +/*! + * \brief Create an Asterisk external application object + * + * \param type The type of underlying transport + * \param params Callbacks and other parameters to use + * + * \returns A new ao2 reference counted aeap object, or NULL on error + */ +struct ast_aeap *ast_aeap_create(const char *type, const struct ast_aeap_params *params); + +/*! + * \brief Create an Asterisk external application object by sorcery id + * + * \param id The sorcery id to lookup + * \param params Callbacks and other parameters to use + * + * \returns A new ao2 reference counted aeap object, or NULL on error + */ +struct ast_aeap *ast_aeap_create_by_id(const char *id, const struct ast_aeap_params *params); + +/*! + * \brief Connect to an external application + * + * \param aeap An Asterisk external application object + * \param url The url to connect to + * \param protocol A protocol to use + * \param timeout How long (in milliseconds) to attempt to connect (-1 equals infinite) + * + * \returns 0 if able to connect, -1 on error + */ +int ast_aeap_connect(struct ast_aeap *aeap, const char *url, const char *protocol, int timeout); + +/*! + * \brief Create and connect to an Asterisk external application by sorcery id + * + * \param id The sorcery id to lookup + * \param params Callbacks and other parameters to use + * \param timeout How long (in milliseconds) to attempt to connect (-1 equals infinite) + * + * \returns A new ao2 reference counted aeap object, or NULL on error + */ +struct ast_aeap *ast_aeap_create_and_connect_by_id(const char *id, + const struct ast_aeap_params *params, int timeout); + +/*! + * \brief Create and connect to an Asterisk external application + * + * \param type The type of client connection to make + * \param params Callbacks and other parameters to use + * \param url The url to connect to + * \param protocol A protocol to use + * \param timeout How long (in milliseconds) to attempt to connect (-1 equals infinite) + * + * \returns A new ao2 reference counted aeap object, or NULL on error + */ +struct ast_aeap *ast_aeap_create_and_connect(const char *type, + const struct ast_aeap_params *params, const char *url, const char *protocol, int timeout); + +/*! + * \brief Disconnect an Asterisk external application object + * + * \note Depending on the underlying transport this call may block + * + * \param aeap An Asterisk external application object + * + * \returns 0 on success, -1 on error + */ +int ast_aeap_disconnect(struct ast_aeap *aeap); + +/*! + * \brief Register a user data object + * + * \note The "cleanup" is called on un-register, if one is specified + * + * \param aeap An Asterisk external application object + * \param id The look up id for the object + * \param obj The user object to register + * \param cleanup Optional user object clean up callback + * + * \returns 0 on success, -1 on error + */ +int ast_aeap_user_data_register(struct ast_aeap *aeap, const char *id, void *obj, + ast_aeap_user_obj_cleanup cleanup); + +/*! + * \brief Un-register a user data object + * + * \note If specified on register, the "cleanup" callback is called during unregister. + * + * \param aeap An Asterisk external application object + * \param id The look up id for the object + */ +void ast_aeap_user_data_unregister(struct ast_aeap *aeap, const char *id); + +/*! + * \brief Retrieve a registered user data object by its id + * + * \note Depending on how it was registered the returned user data object's lifetime + * may be managed by the given "aeap" object. If it was registered with a cleanup + * handler that [potentially] frees it the caller of this function must ensure + * it's done using the returned object before it's unregistered. + * + * \param data A user data object + * + * \returns A user data object + */ +void *ast_aeap_user_data_object_by_id(struct ast_aeap *aeap, const char *id); + +/*! + * \brief Send a binary data to an external application + * + * \param aeap An Asterisk external application object + * \param buf Binary data to send + * \param size The size of the binary data + * + * \returns 0 on success, -1 on error + */ +int ast_aeap_send_binary(struct ast_aeap *aeap, const void *buf, uintmax_t size); + +/*! + * \brief Send a message to an external application + * + * \note "Steals" the given message reference, thus callers are not required to un-ref + * the message object after calling this function. + * + * \param aeap An Asterisk external application object + * \param msg The message to send + * + * \returns 0 on success, -1 on error + */ +int ast_aeap_send_msg(struct ast_aeap *aeap, struct ast_aeap_message *msg); + +/*! + * \brief Parameters to be used when sending a transaction based message + */ +struct ast_aeap_tsx_params { + /*! The message to send */ + struct ast_aeap_message *msg; + /*! The amount of time (in milliseconds) to wait for a received message */ + int timeout; + /*! Optional callback raised when no message is received in an allotted time */ + ast_aeap_on_timeout on_timeout; + /*! Whether or not to block the current thread, and wait for a received message */ + int wait; + /*! + * Optional user object to pass to handlers. User is responsible for object's lifetime + * unless an obj_cleanup callback is specified that handles its cleanup (e.g. freeing + * of memory). + */ + void *obj; + /*! + * Optional user object cleanup callback. If specified, called upon "this" param's + * destruction (including on error). + */ + ast_aeap_user_obj_cleanup obj_cleanup; +}; + +/*! + * \brief Send a transaction based message to an external application using the given parameters + * + * \note "Steals" the given message reference, thus callers are not required to un-ref + * the message object after calling this function. + * + * \note Also handles cleaning up the user object if the obj_cleanup callback + * is specified in "params". + * + * \param aeap An Asterisk external application object + * \param msg The message to send + * \param params (optional) Additional parameters to consider when sending. Heap allocation + * not required. + * + * \returns 0 on success, -1 on error + */ +int ast_aeap_send_msg_tsx(struct ast_aeap *aeap, struct ast_aeap_tsx_params *params); + +#endif /* AST_RES_AEAP_H */ diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/include/asterisk/res_aeap_message.h asterisk-18.12.0~dfsg+~cs6.12.40431413/include/asterisk/res_aeap_message.h --- asterisk-18.11.2~dfsg+~cs6.10.40431413/include/asterisk/res_aeap_message.h 1970-01-01 00:00:00.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/include/asterisk/res_aeap_message.h 2022-05-12 11:50:59.000000000 +0000 @@ -0,0 +1,374 @@ +/* + * Asterisk -- An open source telephony toolkit. + * + * Copyright (C) 2021, Sangoma Technologies Corporation + * + * Kevin Harwell + * + * See http://www.asterisk.org for more information about + * the Asterisk project. Please do not directly contact + * any of the maintainers of this project for assistance; + * the project provides a web site, mailing lists and IRC + * channels for your use. + * + * This program is free software, distributed under the terms of + * the GNU General Public License Version 2. See the LICENSE file + * at the top of the source tree. + */ + +/*! \file + * \brief Asterisk External Application Protocol Message API + */ + +#ifndef AST_AEAP_MESSAGE_H +#define AST_AEAP_MESSAGE_H + +#include + +#include "asterisk/res_aeap.h" + +struct ast_aeap_message; + +/*! + * \brief Message type virtual method table + */ +struct ast_aeap_message_type { + /*! The size of the message implementation type. Used for allocations. */ + size_t type_size; + /*! The name of this type */ + const char *type_name; + /*! The type to serialize to, and de-serialize from */ + enum AST_AEAP_DATA_TYPE serial_type; + + /*! + * \brief Construct/Initialize a message object + * + * \param self The message object to initialize + * \param params Other optional parameter(s) to possibly use + * + * \returns 0 on success, -1 on error + */ + int (*construct1)(struct ast_aeap_message *self, const void *params); + + /*! + * \brief Construct/Initialize a message object + * + * \param self The message object to initialize + * \param msg_type The type of message (e.g. request or response) + * \param name The name of the message + * \param id The message id + * \param params Other optional parameter(s) to possibly use + * + * \returns 0 on success, -1 on error + */ + int (*construct2)(struct ast_aeap_message *self, const char *msg_type, const char *name, + const char *id, const void *params); + + /*! + * \brief Destruct/Cleanup object resources + * + * \param self The message object being destructed + */ + void (*destruct)(struct ast_aeap_message *self); + + /*! + * \brief Deserialize the given buffer into a message object + * + * \param self The message object to deserialize into + * \param buf The buffer to deserialize + * \param size The size/length of the buffer + * + * \returns 0 on success, -1 on error + */ + int (*deserialize)(struct ast_aeap_message *self, const void *buf, intmax_t size); + + /*! + * \brief Serialize the message object into byte/char buffer + * + * \param self The message object to serialize + * \param buf [out] The buffer to hold the "packed" data + * \param size [out] The size of the data written to the buffer + * + * \returns 0 on success, -1 on error + */ + int (*serialize)(const struct ast_aeap_message *self, void **buf, intmax_t *size); + + /*! + * \brief Retrieve a message id + * + * \param self The message object + * + * \returns The message id + */ + const char *(*id)(const struct ast_aeap_message *self); + + /*! + * \brief Set a message id. + * + * \param self The message object + * \param id The id to set + * + * \returns 0 on success, -1 on error + */ + int (*id_set)(struct ast_aeap_message *self, const char *id); + + /*! + * \brief Retrieve a message name + * + * \param self The message object + * + * \returns The message name + */ + const char *(*name)(const struct ast_aeap_message *self); + + /*! + * \brief Retrieve the core message data/body + * + * \param self This message object + */ + void *(*data)(struct ast_aeap_message *self); + + /*! + * \brief Retrieve whether or not this is a request message + * + * \param self The message object + * + * \returns True if message is a request, false otherwise + */ + int (*is_request)(const struct ast_aeap_message *self); + + /*! + * \brief Retrieve whether or not this is a response message + * + * \param self The message object + * + * \returns True if message is a response, false otherwise + */ + int (*is_response)(const struct ast_aeap_message *self); + + /*! + * \brief Retrieve the error message if it has one + * + * \param self The message object + * + * \returns The error message if available, or NULL + */ + const char *(*error_msg)(const struct ast_aeap_message *self); + + /*! + * \brief Set an error message + * + * \param self The message object + * \param error_msg The error message string to set + * + * \returns 0 on success, -1 on error + */ + int (*error_msg_set)(struct ast_aeap_message *self, const char *error_msg); +}; + +/*! + * \brief Asterisk external application base message + */ +struct ast_aeap_message { + /*! The type virtual table */ + const struct ast_aeap_message_type *type; +}; + +/*! + * \brief Retrieve the serial type a message type + * + * \param type A message type + * + * \returns The type's serial type + */ +enum AST_AEAP_DATA_TYPE ast_aeap_message_serial_type(const struct ast_aeap_message_type *type); + +/*! + * \brief Create an Asterisk external application message object + * + * \param type The type of message object to create + * \param params Any parameter(s) to pass to the type's constructor + * + * \returns An ao2 reference counted AEAP message object, or NULL on error + */ +struct ast_aeap_message *ast_aeap_message_create1(const struct ast_aeap_message_type *type, + const void *params); + +/*! + * \brief Create an Asterisk external application message object + * + * \param type The type of message object to create + * \param msg_type The type of message (e.g. request or response) + * \param name The name of the message + * \param id The message id + * \param params Other optional parameter(s) to possibly use + * + * \returns An ao2 reference counted AEAP message object, or NULL on error + */ +struct ast_aeap_message *ast_aeap_message_create2(const struct ast_aeap_message_type *type, + const char *msg_type, const char *name, const char *id, const void *params); + +/*! + * \brief Create an Asterisk external application request object + * + * \param type The type of message object to create + * \param name The name of the message + * \param id Optional id (if NULL an id is generated) + * \param params Other optional parameter(s) to possibly use + * + * \returns An ao2 reference counted AEAP request object, or NULL on error + */ +struct ast_aeap_message *ast_aeap_message_create_request(const struct ast_aeap_message_type *type, + const char *name, const char *id, const void *params); + +/*! + * \brief Create an Asterisk external application response object + * + * \param type The type of message object to create + * \param name The name of the message + * \param id Optional id + * \param params Other optional parameter(s) to possibly use + * + * \returns An ao2 reference counted AEAP response object, or NULL on error + */ +struct ast_aeap_message *ast_aeap_message_create_response(const struct ast_aeap_message_type *type, + const char *name, const char *id, const void *params); + +/*! + * \brief Create an Asterisk external application error response object + * + * \param type The type of message object to create + * \param name The name of the message + * \param id Optional id + * \param error_msg Error message to set + * \param params Other optional parameter(s) to possibly use + * + * \returns An ao2 reference counted AEAP response object, or NULL on error + */ +struct ast_aeap_message *ast_aeap_message_create_error(const struct ast_aeap_message_type *type, + const char *name, const char *id, const char *error_msg); + +/*! + * \brief Deserialize the given buffer into an Asterisk external application message object + * + * \param type The message type to create, and deserialize to + * \param buf The buffer to deserialize + * \param size The size/length of the buffer + * + * \returns An ao2 reference counted AEAP message object, or NULL on error + */ +struct ast_aeap_message *ast_aeap_message_deserialize(const struct ast_aeap_message_type *type, + const void *buf, intmax_t size); + +/*! + * \brief Serialize the given message object into a byte/char buffer + * + * \param message The message object to serialize + * \param buf [out] The buffer to hold the "packed" data + * \param size [out] The size of the data written to the buffer + * + * \returns 0 on success, -1 on error + */ +int ast_aeap_message_serialize(const struct ast_aeap_message *message, + void **buf, intmax_t *size); + +/*! + * \brief Retrieve a message id + * + * \param message A message object + * + * \returns The message id, or an empty string + */ +const char *ast_aeap_message_id(const struct ast_aeap_message *message); + +/*! + * \brief Set a message id. + * + * \param message A message object + * \param id The id to set + * + * \returns 0 on success, -1 on error + */ +int ast_aeap_message_id_set(struct ast_aeap_message *message, const char *id); + +/*! + * \brief Generate an id, and set it for the message + * + * \param message A message object + * + * \returns the generated id on success, or NULL on error + */ +const char *ast_aeap_message_id_generate(struct ast_aeap_message *message); + +/*! + * \brief Retrieve a message name + * + * \param message A message object + * + * \returns The message name, or an empty string + */ +const char *ast_aeap_message_name(const struct ast_aeap_message *message); + +/*! + * \brief Check whether or not a message's name matches the given one + * + * \note Case insensitive + * + * \param message A message object + * \param message name The name to check against + * + * \returns True if matched, false otherwise + */ +int ast_aeap_message_is_named(const struct ast_aeap_message *message, const char *name); + +/*! + * \brief Retrieve the core message data/body + * + * \param message A message object + */ +void *ast_aeap_message_data(struct ast_aeap_message *message); + +/*! + * \brief Retrieve whether or not this is a request message + * + * \param message A message object + * + * \returns True if the message is a request, false otherwise + */ +int ast_aeap_message_is_request(const struct ast_aeap_message *message); + +/*! + * \brief Retrieve whether or not this is a response message + * + * \param message A message object + * + * \returns True if the message is a response, false otherwise + */ +int ast_aeap_message_is_response(const struct ast_aeap_message *message); + +/*! + * \brief Retrieve the error message if it has one + * + * \param message A message object + * + * \returns The error message if available, or NULL + */ +const char *ast_aeap_message_error_msg(const struct ast_aeap_message *message); + +/*! + * \brief Set an error message. + * + * \param message A message object + * \param error_msg The error string to set + * + * \returns 0 on success, -1 on error + */ +int ast_aeap_message_error_msg_set(struct ast_aeap_message *message, + const char *error_msg); + +/*! + * \brief Asterisk external application JSON message type + */ +extern const struct ast_aeap_message_type *ast_aeap_message_type_json; + +#endif /* AST_AEAP_MESSAGE_H */ diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/include/asterisk/res_pjsip.h asterisk-18.12.0~dfsg+~cs6.12.40431413/include/asterisk/res_pjsip.h --- asterisk-18.11.2~dfsg+~cs6.10.40431413/include/asterisk/res_pjsip.h 2022-04-14 21:53:34.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/include/asterisk/res_pjsip.h 2022-05-12 11:50:59.000000000 +0000 @@ -3066,6 +3066,13 @@ unsigned int ast_sip_get_mwi_disable_initial_unsolicited(void); /*! + * \brief Retrieve the global setting 'allow_sending_180_after_183'. + * + * \retval non zero if disable. + */ +unsigned int ast_sip_get_allow_sending_180_after_183(void); + +/*! * \brief Retrieve the global setting 'use_callerid_contact'. * \since 13.24.0 * diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/include/asterisk/speech.h asterisk-18.12.0~dfsg+~cs6.12.40431413/include/asterisk/speech.h --- asterisk-18.11.2~dfsg+~cs6.10.40431413/include/asterisk/speech.h 2022-04-14 21:53:34.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/include/asterisk/speech.h 2022-05-12 11:50:59.000000000 +0000 @@ -158,6 +158,12 @@ /*! \brief Unregister a speech recognition engine */ struct ast_speech_engine *ast_speech_unregister2(const char *engine_name); +/*! \brief Retrieve a speech recognition engine */ +struct ast_speech_engine *ast_speech_find_engine(const char *engine_name); +/*! \brief Unregister all speech recognition engines told to by callback */ +void ast_speech_unregister_engines( + int (*should_unregister)(const struct ast_speech_engine *engine, void *data), void *data, + void (*on_unregistered)(void *obj)); #if defined(__cplusplus) || defined(c_plusplus) } diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/include/asterisk/time.h asterisk-18.12.0~dfsg+~cs6.12.40431413/include/asterisk/time.h --- asterisk-18.11.2~dfsg+~cs6.10.40431413/include/asterisk/time.h 2022-04-14 21:53:34.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/include/asterisk/time.h 2022-05-12 11:50:59.000000000 +0000 @@ -35,6 +35,13 @@ #include "asterisk/inline_api.h" +/* A time_t can be represented as an unsigned long long (or uint64_t). + * Formatted in base 10, UINT64_MAX is 20 digits long, plus one for NUL. + * This should be the size of the receiving char buffer for calls to + * ast_time_t_to_string(). + */ +#define AST_TIME_T_LEN 21 + /* We have to let the compiler learn what types to use for the elements of a struct timeval since on linux, it's time_t and suseconds_t, but on *BSD, they are just a long. @@ -316,4 +323,17 @@ */ struct timeval ast_time_create_by_unit_str(unsigned long val, const char *unit); +/*! + * \brief Converts to a string representation of a time_t as decimal + * seconds since the epoch. Returns -1 on failure, zero otherwise. + * + * The buffer should be at least 22 bytes long. + */ +int ast_time_t_to_string(time_t time, char *buf, size_t length); + +/*! + * \brief Returns a time_t from a string containing seconds since the epoch. + */ +time_t ast_string_to_time_t(const char *str); + #endif /* _ASTERISK_TIME_H */ diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/main/asterisk.c asterisk-18.12.0~dfsg+~cs6.12.40431413/main/asterisk.c --- asterisk-18.11.2~dfsg+~cs6.10.40431413/main/asterisk.c 2022-04-14 21:53:34.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/main/asterisk.c 2022-05-12 11:50:59.000000000 +0000 @@ -3351,7 +3351,7 @@ printf(" -L Limit the maximum load average before rejecting new calls\n"); printf(" -M Limit the maximum number of calls to the specified value\n"); printf(" -m Mute debugging and console output on the console\n"); - printf(" -n Disable console colorization\n"); + printf(" -n Disable console colorization. Can be used only at startup.\n"); printf(" -p Run as pseudo-realtime thread\n"); printf(" -q Quiet mode (suppress output)\n"); printf(" -r Connect to Asterisk on this machine\n"); @@ -3360,7 +3360,7 @@ printf(" -t Record soundfiles in /var/tmp and move them where they\n"); printf(" belong after they are done\n"); printf(" -T Display the time in [Mmm dd hh:mm:ss] format for each line\n"); - printf(" of output to the CLI\n"); + printf(" of output to the CLI. Cannot be used with remote console mode.\n\n"); printf(" -v Increase verbosity (multiple v's = more verbose)\n"); printf(" -x Execute command (implies -r)\n"); printf(" -X Enable use of #exec in asterisk.conf\n"); @@ -3716,6 +3716,55 @@ } } + if (ast_opt_remote) { + int didwarn = 0; + optind = 1; + + /* Not all options can be used with remote console. Warn if they're used. */ + while ((c = getopt(argc, argv, getopt_settings)) != -1) { + switch (c) { + /* okay to run with remote console */ + case 'B': /* force black background */ + case 'd': /* debug */ + case 'h': /* help */ + case 'I': /* obsolete timing option: warning already thrown if used */ + case 'L': /* max load */ + case 'M': /* max calls */ + case 'R': /* reconnect */ + case 'r': /* remote */ + case 's': /* set socket path */ + case 'V': /* version */ + case 'v': /* verbose */ + case 'W': /* white background */ + case 'x': /* remote execute */ + case '?': /* ? */ + break; + /* can only be run when Asterisk is starting */ + case 'X': /* enables #exec for asterisk.conf only. */ + case 'C': /* set config path */ + case 'c': /* foreground console */ + case 'e': /* minimum memory free */ + case 'F': /* always fork */ + case 'f': /* no fork */ + case 'G': /* run group */ + case 'g': /* dump core */ + case 'i': /* init keys */ + case 'm': /* mute */ + case 'n': /* no color */ + case 'p': /* high priority */ + case 'q': /* quiet */ + case 'T': /* timestamp */ + case 't': /* cache record files */ + case 'U': /* run user */ + fprintf(stderr, "'%c' option is not compatible with remote console mode and has no effect.\n", c); + didwarn = 1; + } + } + if (didwarn) { + fprintf(stderr, "\n"); /* if any warnings print out, make them stand out */ + } + } + /* For remote connections, change the name of the remote connection. * We do this for the benefit of init scripts (which need to know if/when * the main asterisk process has died yet). */ diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/main/conversions.c asterisk-18.12.0~dfsg+~cs6.12.40431413/main/conversions.c --- asterisk-18.11.2~dfsg+~cs6.10.40431413/main/conversions.c 2022-04-14 21:53:34.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/main/conversions.c 2022-05-12 11:50:59.000000000 +0000 @@ -99,7 +99,7 @@ } errno = 0; - val = strtoimax(str, &end, 0); + val = strtoimax(str, &end, 10); /* * If str equals end then no digits were found. If end is not pointing to @@ -126,7 +126,7 @@ } errno = 0; - val = strtoumax(str, &end, 0); + val = strtoumax(str, &end, 10); /* * If str equals end then no digits were found. If end is not pointing to diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/main/core_unreal.c asterisk-18.12.0~dfsg+~cs6.12.40431413/main/core_unreal.c --- asterisk-18.11.2~dfsg+~cs6.10.40431413/main/core_unreal.c 2022-04-14 21:53:34.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/main/core_unreal.c 2022-05-12 11:50:59.000000000 +0000 @@ -1168,7 +1168,9 @@ struct ast_assigned_ids id1 = {NULL, NULL}; struct ast_assigned_ids id2 = {NULL, NULL}; int generated_seqno = ast_atomic_fetchadd_int((int *) &name_sequence, +1); - struct ast_stream_topology *topology; + int i; + struct ast_stream_topology *chan_topology; + struct ast_stream *stream; /* set unique ids for the two channels */ if (assignedids && !ast_strlen_zero(assignedids->uniqueid)) { @@ -1186,14 +1188,27 @@ id2.uniqueid = uniqueid2; } - /* We need to create a topology to place on the first channel, as we can't + /* We need to create a topology to place on the second channel, as we can't * share a single one between both. */ - topology = ast_stream_topology_clone(p->reqtopology); - if (!topology) { + chan_topology = ast_stream_topology_clone(p->reqtopology); + if (!chan_topology) { return NULL; } + for (i = 0; i < ast_stream_topology_get_count(chan_topology); ++i) { + stream = ast_stream_topology_get_stream(chan_topology, i); + /* We need to make sure that the ;2 channel has the opposite stream topology + * of the first channel if the stream is one-way. I.e. if the first channel + * is recvonly, the second channel has to be sendonly and vice versa. + */ + if (ast_stream_get_state(stream) == AST_STREAM_STATE_RECVONLY) { + ast_stream_set_state(stream, AST_STREAM_STATE_SENDONLY); + } else if (ast_stream_get_state(stream) == AST_STREAM_STATE_SENDONLY) { + ast_stream_set_state(stream, AST_STREAM_STATE_RECVONLY); + } + } + /* * Allocate two new Asterisk channels * @@ -1206,7 +1221,7 @@ "%s/%s-%08x;1", tech->type, p->name, (unsigned)generated_seqno); if (!owner) { ast_log(LOG_WARNING, "Unable to allocate owner channel structure\n"); - ast_stream_topology_free(topology); + ast_stream_topology_free(chan_topology); return NULL; } @@ -1221,7 +1236,8 @@ ast_channel_nativeformats_set(owner, p->reqcap); if (ast_channel_is_multistream(owner)) { - ast_channel_set_stream_topology(owner, topology); + ast_channel_set_stream_topology(owner, p->reqtopology); + p->reqtopology = NULL; } /* Determine our read/write format and set it on each channel */ @@ -1279,8 +1295,7 @@ ast_channel_nativeformats_set(chan, p->reqcap); if (ast_channel_is_multistream(chan)) { - ast_channel_set_stream_topology(chan, p->reqtopology); - p->reqtopology = NULL; + ast_channel_set_stream_topology(chan, chan_topology); } /* Format was already determined when setting up owner */ diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/main/file.c asterisk-18.12.0~dfsg+~cs6.12.40431413/main/file.c --- asterisk-18.11.2~dfsg+~cs6.10.40431413/main/file.c 2022-04-14 21:53:34.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/main/file.c 2022-05-12 11:50:59.000000000 +0000 @@ -1097,6 +1097,12 @@ int ast_stream_rewind(struct ast_filestream *fs, off_t ms) { + off_t offset = ast_tellstream(fs); + if (ms * DEFAULT_SAMPLES_PER_MS > offset) { + /* Don't even bother asking the file format to seek to a negative offset... */ + ast_debug(1, "Restarting, rather than seeking to negative offset %ld\n", (long) (offset - (ms * DEFAULT_SAMPLES_PER_MS))); + return ast_seekstream(fs, 0, SEEK_SET); + } return ast_seekstream(fs, -ms * DEFAULT_SAMPLES_PER_MS, SEEK_CUR); } diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/main/logger.c asterisk-18.12.0~dfsg+~cs6.12.40431413/main/logger.c --- asterisk-18.11.2~dfsg+~cs6.10.40431413/main/logger.c 2022-04-14 21:53:34.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/main/logger.c 2022-05-12 11:50:59.000000000 +0000 @@ -97,6 +97,11 @@ static int logger_messages_discarded; static unsigned int high_water_alert; +/* On some platforms, like those with MUSL as the runtime, BUFSIZ is + * unreasonably small (1024). Use a larger value in those environments. + */ +#define LOGMSG_SIZE MAX(BUFSIZ, 8192) + static enum rotatestrategy { NONE = 0, /* Do not rotate log files at all, instead rely on external mechanisms */ SEQUENTIAL = 1 << 0, /* Original method - create a new file, in order */ @@ -1665,7 +1670,7 @@ static void logger_print_normal(struct logmsg *logmsg) { struct logchannel *chan = NULL; - char buf[BUFSIZ]; + char buf[LOGMSG_SIZE]; int level = 0; AST_RWLIST_RDLOCK(&logchannels); @@ -1698,13 +1703,13 @@ /* Don't use LOG_MAKEPRI because it's broken in glibc<2.17 */ syslog_level = chan->facility | syslog_level; /* LOG_MAKEPRI(chan->facility, syslog_level); */ - if (!chan->formatter.format_log(chan, logmsg, buf, BUFSIZ)) { + if (!chan->formatter.format_log(chan, logmsg, buf, sizeof(buf))) { syslog(syslog_level, "%s", buf); } } break; case LOGTYPE_CONSOLE: - if (!chan->formatter.format_log(chan, logmsg, buf, BUFSIZ)) { + if (!chan->formatter.format_log(chan, logmsg, buf, sizeof(buf))) { ast_console_puts_mutable_full(buf, logmsg->level, logmsg->sublevel); } break; @@ -1716,7 +1721,7 @@ continue; } - if (chan->formatter.format_log(chan, logmsg, buf, BUFSIZ)) { + if (chan->formatter.format_log(chan, logmsg, buf, sizeof(buf))) { continue; } @@ -1780,7 +1785,7 @@ } /* Build string */ - res = ast_str_set_va(&buf, BUFSIZ, fmt, ap); + res = ast_str_set_va(&buf, LOGMSG_SIZE, fmt, ap); /* If the build failed, then abort and free this structure */ if (res == AST_DYNSTR_BUILD_FAILED) { diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/main/Makefile asterisk-18.12.0~dfsg+~cs6.12.40431413/main/Makefile --- asterisk-18.11.2~dfsg+~cs6.10.40431413/main/Makefile 2022-04-14 21:53:34.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/main/Makefile 2022-05-12 11:50:59.000000000 +0000 @@ -169,6 +169,7 @@ tcptls.o: _ASTCFLAGS+=$(OPENSSL_INCLUDE) -Wno-deprecated-declarations uuid.o: _ASTCFLAGS+=$(UUID_INCLUDE) stasis.o: _ASTCFLAGS+=$(call get_menuselect_cflags,AO2_DEBUG) +time.o: _ASTCFLAGS+=-D_XOPEN_SOURCE=700 OBJS:=$(sort $(OBJS)) diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/main/manager.c asterisk-18.12.0~dfsg+~cs6.12.40431413/main/manager.c --- asterisk-18.11.2~dfsg+~cs6.10.40431413/main/manager.c 2022-04-14 21:53:34.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/main/manager.c 2022-05-12 11:50:59.000000000 +0000 @@ -633,6 +633,12 @@ + + 13.18.0 + 14.7.0 + 15.1.0 + 16.0.0 + Cancel an attended transfer. @@ -6242,7 +6248,7 @@ (s->session->readperm & eqe->category) == eqe->category && (s->session->send_events & eqe->category) == eqe->category) { if (match_filter(s, eqe->eventdata)) { - if (send_string(s, eqe->eventdata) < 0) + if (send_string(s, eqe->eventdata) < 0 || s->write_error) ret = -1; /* don't send more */ } } diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/main/pbx_builtins.c asterisk-18.12.0~dfsg+~cs6.12.40431413/main/pbx_builtins.c --- asterisk-18.11.2~dfsg+~cs6.10.40431413/main/pbx_builtins.c 2022-04-14 21:53:34.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/main/pbx_builtins.c 2022-05-12 11:50:59.000000000 +0000 @@ -83,6 +83,9 @@ Only break if a digit hit matches a one digit extension in the destination context. +
@@ -698,6 +701,10 @@ be used instead if set + diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/main/pbx.c asterisk-18.12.0~dfsg+~cs6.12.40431413/main/pbx.c --- asterisk-18.11.2~dfsg+~cs6.10.40431413/main/pbx.c 2022-04-14 21:53:34.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/main/pbx.c 2022-05-12 11:50:59.000000000 +0000 @@ -2506,7 +2506,7 @@ q->data = NULL; q->foundcontext = NULL; } else if (q->stacklen >= AST_PBX_MAX_STACK) { - ast_log(LOG_WARNING, "Maximum PBX stack exceeded\n"); + ast_log(LOG_WARNING, "Maximum PBX stack (%d) exceeded. Too many includes?\n", AST_PBX_MAX_STACK); return NULL; } @@ -8771,8 +8771,14 @@ { int idx; int res = 0; + int includecount = ast_context_includes_count(con); - for (idx = 0; idx < ast_context_includes_count(con); idx++) { + if (includecount >= AST_PBX_MAX_STACK) { + ast_log(LOG_WARNING, "Context %s contains too many includes (%d). Maximum is %d.\n", + ast_get_context_name(con), includecount, AST_PBX_MAX_STACK); + } + + for (idx = 0; idx < includecount; idx++) { const struct ast_include *inc = ast_context_includes_get(con, idx); if (ast_context_find(include_rname(inc))) { @@ -8820,6 +8826,47 @@ return __ast_goto_if_exists(chan, context, exten, priority, 1); } +int pbx_parse_location(struct ast_channel *chan, char **contextp, char **extenp, char **prip, int *ipri, int *mode, char *rest) +{ + char *context, *exten, *pri; + /* do the strsep before here, so we don't have to alloc and free */ + if (!*extenp) { + /* Only a priority in this one */ + *prip = *contextp; + *extenp = NULL; + *contextp = NULL; + } else if (!*prip) { + /* Only an extension and priority in this one */ + *prip = *extenp; + *extenp = *contextp; + *contextp = NULL; + } + context = *contextp; + exten = *extenp; + pri = *prip; + if (mode) { + if (*pri == '+') { + *mode = 1; + pri++; + } else if (*pri == '-') { + *mode = -1; + pri++; + } + } + if ((rest && sscanf(pri, "%30d%1s", ipri, rest) != 1) || sscanf(pri, "%30d", ipri) != 1) { + *ipri = ast_findlabel_extension(chan, context ? context : ast_channel_context(chan), + exten ? exten : ast_channel_exten(chan), pri, + S_COR(ast_channel_caller(chan)->id.number.valid, ast_channel_caller(chan)->id.number.str, NULL)); + if (*ipri < 1) { + ast_log(LOG_WARNING, "Priority '%s' must be a number > 0, or valid label\n", pri); + return -1; + } else if (mode) { + *mode = 0; + } + } + return 0; +} + static int pbx_parseable_goto(struct ast_channel *chan, const char *goto_string, int async) { char *exten, *pri, *context; @@ -8836,31 +8883,9 @@ context = strsep(&stringp, ","); /* guaranteed non-null */ exten = strsep(&stringp, ","); pri = strsep(&stringp, ","); - if (!exten) { /* Only a priority in this one */ - pri = context; - exten = NULL; - context = NULL; - } else if (!pri) { /* Only an extension and priority in this one */ - pri = exten; - exten = context; - context = NULL; - } - if (*pri == '+') { - mode = 1; - pri++; - } else if (*pri == '-') { - mode = -1; - pri++; - } - if (sscanf(pri, "%30d%1s", &ipri, rest) != 1) { - ipri = ast_findlabel_extension(chan, context ? context : ast_channel_context(chan), - exten ? exten : ast_channel_exten(chan), pri, - S_COR(ast_channel_caller(chan)->id.number.valid, ast_channel_caller(chan)->id.number.str, NULL)); - if (ipri < 1) { - ast_log(LOG_WARNING, "Priority '%s' must be a number > 0, or valid label\n", pri); - return -1; - } else - mode = 0; + + if (pbx_parse_location(chan, &context, &exten, &pri, &ipri, &mode, rest)) { + return -1; } /* At this point we have a priority and maybe an extension and a context */ diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/main/pbx_variables.c asterisk-18.12.0~dfsg+~cs6.12.40431413/main/pbx_variables.c --- asterisk-18.11.2~dfsg+~cs6.10.40431413/main/pbx_variables.c 2022-04-14 21:53:34.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/main/pbx_variables.c 2022-05-12 11:50:59.000000000 +0000 @@ -736,7 +736,7 @@ /* Substitute if necessary */ if (needsub) { - pbx_substitute_variables_helper_full(c, headp, var, ltmp, VAR_BUF_SIZE - 1, NULL); + pbx_substitute_variables_helper_full_location(c, headp, var, ltmp, VAR_BUF_SIZE - 1, NULL, context, exten, pri); vars = ltmp; } else { vars = var; @@ -770,10 +770,13 @@ /* For dialplan location, if we were told what to substitute explicitly, use that instead */ if (exten && !strcmp(vars, "EXTEN")) { ast_copy_string(workspace, exten, VAR_BUF_SIZE); + cp4 = workspace; } else if (context && !strcmp(vars, "CONTEXT")) { ast_copy_string(workspace, context, VAR_BUF_SIZE); + cp4 = workspace; } else if (pri && !strcmp(vars, "PRIORITY")) { snprintf(workspace, VAR_BUF_SIZE, "%d", pri); + cp4 = workspace; } else { pbx_retrieve_variable(c, vars, &cp4, workspace, VAR_BUF_SIZE, headp); } @@ -829,7 +832,7 @@ /* Substitute if necessary */ if (needsub) { - pbx_substitute_variables_helper_full(c, headp, var, ltmp, VAR_BUF_SIZE - 1, NULL); + pbx_substitute_variables_helper_full_location(c, headp, var, ltmp, VAR_BUF_SIZE - 1, NULL, context, exten, pri); vars = ltmp; } else { vars = var; @@ -924,6 +927,52 @@ return CLI_SUCCESS; } +/*! \brief CLI support for executing function */ +static char *handle_eval_function(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a) +{ + struct ast_channel *c = NULL; + char *fn, *substituted; + int ret; + char workspace[1024]; + + switch (cmd) { + case CLI_INIT: + e->command = "dialplan eval function"; + e->usage = + "Usage: dialplan eval function \n" + " Evaluate a dialplan function call\n" + " A dummy channel is used to evaluate\n" + " the function call, so only global\n" + " variables should be used.\n"; + return NULL; + case CLI_GENERATE: + return NULL; + } + + if (a->argc != e->args + 1) { + return CLI_SHOWUSAGE; + } + + c = ast_dummy_channel_alloc(); + if (!c) { + ast_cli(a->fd, "Unable to allocate bogus channel for function evaluation.\n"); + return CLI_FAILURE; + } + + fn = (char *) a->argv[3]; + pbx_substitute_variables_helper(c, fn, workspace, sizeof(workspace)); + substituted = ast_strdupa(workspace); + workspace[0] = '\0'; + ret = ast_func_read(c, substituted, workspace, sizeof(workspace)); + + c = ast_channel_unref(c); + + ast_cli(a->fd, "Return Value: %s (%d)\n", ret ? "Failure" : "Success", ret); + ast_cli(a->fd, "Result: %s\n", workspace); + + return CLI_SUCCESS; +} + static char *handle_set_global(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a) { switch (cmd) { @@ -1218,6 +1267,7 @@ static struct ast_cli_entry vars_cli[] = { AST_CLI_DEFINE(handle_show_globals, "Show global dialplan variables"), AST_CLI_DEFINE(handle_show_chanvar, "Show channel variables"), + AST_CLI_DEFINE(handle_eval_function, "Evaluate dialplan function"), AST_CLI_DEFINE(handle_set_global, "Set global dialplan variable"), AST_CLI_DEFINE(handle_set_chanvar, "Set a channel variable"), }; diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/main/time.c asterisk-18.12.0~dfsg+~cs6.12.40431413/main/time.c --- asterisk-18.11.2~dfsg+~cs6.10.40431413/main/time.c 2022-04-14 21:53:34.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/main/time.c 2022-05-12 11:50:59.000000000 +0000 @@ -25,6 +25,7 @@ #include #include +#include #include #include "asterisk/time.h" @@ -143,3 +144,31 @@ { return ast_time_create_by_unit(val, ast_time_str_to_unit(unit)); } + +/*! + * \brief Returns a string representation of a time_t as decimal seconds + * since the epoch. + */ +int ast_time_t_to_string(time_t time, char *buf, size_t length) +{ + struct tm tm; + + localtime_r(&time, &tm); + return (strftime(buf, length, "%s", &tm) == 0) ? -1 : 0; +} + +/*! + * \brief Returns a time_t from a string containing seconds since the epoch. + */ +time_t ast_string_to_time_t(const char *str) +{ + struct tm tm = { 0, }; + + /* handle leading spaces */ + if (strptime(str, " %s", &tm) == NULL) { + return (time_t)-1; + } + tm.tm_isdst = -1; + return mktime(&tm); +} + diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/menuselect/configure asterisk-18.12.0~dfsg+~cs6.12.40431413/menuselect/configure --- asterisk-18.11.2~dfsg+~cs6.10.40431413/menuselect/configure 2022-04-14 21:53:34.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/menuselect/configure 2022-05-12 11:50:59.000000000 +0000 @@ -1,9 +1,10 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69. +# Generated by GNU Autoconf 2.71. # # -# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. +# Copyright (C) 1992-1996, 1998-2017, 2020-2021 Free Software Foundation, +# Inc. # # # This configure script is free software; the Free Software Foundation @@ -16,14 +17,16 @@ # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : +as_nop=: +if test ${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1 +then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST -else +else $as_nop case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( @@ -33,46 +36,46 @@ fi + +# Reset variables that may have inherited troublesome values from +# the environment. + +# IFS needs to be set, to space, tab, and newline, in precisely that order. +# (If _AS_PATH_WALK were called with IFS unset, it would have the +# side effect of setting IFS to empty, thus disabling word splitting.) +# Quoting is to prevent editors from complaining about space-tab. as_nl=' ' export as_nl -# Printing a long string crashes Solaris 7 /usr/bin/printf. -as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' -as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo -as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo -# Prefer a ksh shell builtin over an external printf program on Solaris, -# but without wasting forks for bash or zsh. -if test -z "$BASH_VERSION$ZSH_VERSION" \ - && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then - as_echo='print -r --' - as_echo_n='print -rn --' -elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then - as_echo='printf %s\n' - as_echo_n='printf %s' -else - if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then - as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' - as_echo_n='/usr/ucb/echo -n' - else - as_echo_body='eval expr "X$1" : "X\\(.*\\)"' - as_echo_n_body='eval - arg=$1; - case $arg in #( - *"$as_nl"*) - expr "X$arg" : "X\\(.*\\)$as_nl"; - arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; - esac; - expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" - ' - export as_echo_n_body - as_echo_n='sh -c $as_echo_n_body as_echo' - fi - export as_echo_body - as_echo='sh -c $as_echo_body as_echo' -fi +IFS=" "" $as_nl" + +PS1='$ ' +PS2='> ' +PS4='+ ' + +# Ensure predictable behavior from utilities with locale-dependent output. +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# We cannot yet rely on "unset" to work, but we need these variables +# to be unset--not just set to an empty or harmless value--now, to +# avoid bugs in old shells (e.g. pre-3.0 UWIN ksh). This construct +# also avoids known problems related to "unset" and subshell syntax +# in other old shells (e.g. bash 2.01 and pdksh 5.2.14). +for as_var in BASH_ENV ENV MAIL MAILPATH CDPATH +do eval test \${$as_var+y} \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : +done + +# Ensure that fds 0, 1, and 2 are open. +if (exec 3>&0) 2>/dev/null; then :; else exec 0&1) 2>/dev/null; then :; else exec 1>/dev/null; fi +if (exec 3>&2) ; then :; else exec 2>/dev/null; fi # The user is always right. -if test "${PATH_SEPARATOR+set}" != set; then +if ${PATH_SEPARATOR+false} :; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || @@ -81,13 +84,6 @@ fi -# IFS -# We need space, tab and new line, in precisely that order. Quoting is -# there to prevent editors from complaining about space-tab. -# (If _AS_PATH_WALK were called with IFS unset, it would disable word -# splitting by setting IFS to empty value.) -IFS=" "" $as_nl" - # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( @@ -96,8 +92,12 @@ for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + test -r "$as_dir$0" && as_myself=$as_dir$0 && break done IFS=$as_save_IFS @@ -109,30 +109,10 @@ as_myself=$0 fi if test ! -f "$as_myself"; then - $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + printf "%s\n" "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi -# Unset variables that we do not need and which cause bugs (e.g. in -# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" -# suppresses any "Segmentation fault" message there. '((' could -# trigger a bug in pdksh 5.2.14. -for as_var in BASH_ENV ENV MAIL MAILPATH -do eval test x\${$as_var+set} = xset \ - && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : -done -PS1='$ ' -PS2='> ' -PS4='+ ' - -# NLS nuisances. -LC_ALL=C -export LC_ALL -LANGUAGE=C -export LANGUAGE - -# CDPATH. -(unset CDPATH) >/dev/null 2>&1 && unset CDPATH # Use a proper internal environment variable to ensure we don't fall # into an infinite loop, continuously re-executing ourselves. @@ -154,20 +134,22 @@ exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. -$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 -as_fn_exit 255 +printf "%s\n" "$0: could not re-execute with $CONFIG_SHELL" >&2 +exit 255 fi # We don't want this to propagate to other subprocesses. { _as_can_reexec=; unset _as_can_reexec;} if test "x$CONFIG_SHELL" = x; then - as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : + as_bourne_compatible="as_nop=: +if test \${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1 +then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST -else +else \$as_nop case \`(set -o) 2>/dev/null\` in #( *posix*) : set -o posix ;; #( @@ -187,42 +169,53 @@ as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } -if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : +if ( set x; as_fn_ret_success y && test x = \"\$1\" ) +then : -else +else \$as_nop exitcode=1; echo positional parameters were not saved. fi test x\$exitcode = x0 || exit 1 +blah=\$(echo \$(echo blah)) +test x\"\$blah\" = xblah || exit 1 test -x / || exit 1" as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 test \$(( 1 + 1 )) = 2 || exit 1" - if (eval "$as_required") 2>/dev/null; then : + if (eval "$as_required") 2>/dev/null +then : as_have_required=yes -else +else $as_nop as_have_required=no fi - if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : + if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null +then : -else +else $as_nop as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_found=false for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac as_found=: case $as_dir in #( /*) for as_base in sh bash ksh sh5; do # Try only shells that exist, to save several forks. - as_shell=$as_dir/$as_base + as_shell=$as_dir$as_base if { test -f "$as_shell" || test -f "$as_shell.exe"; } && - { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : + as_run=a "$as_shell" -c "$as_bourne_compatible""$as_required" 2>/dev/null +then : CONFIG_SHELL=$as_shell as_have_required=yes - if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : + if as_run=a "$as_shell" -c "$as_bourne_compatible""$as_suggested" 2>/dev/null +then : break 2 fi fi @@ -230,14 +223,21 @@ esac as_found=false done -$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && - { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : - CONFIG_SHELL=$SHELL as_have_required=yes -fi; } IFS=$as_save_IFS +if $as_found +then : + +else $as_nop + if { test -f "$SHELL" || test -f "$SHELL.exe"; } && + as_run=a "$SHELL" -c "$as_bourne_compatible""$as_required" 2>/dev/null +then : + CONFIG_SHELL=$SHELL as_have_required=yes +fi +fi - if test "x$CONFIG_SHELL" != x; then : + if test "x$CONFIG_SHELL" != x +then : export CONFIG_SHELL # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also @@ -255,18 +255,19 @@ exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. -$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 +printf "%s\n" "$0: could not re-execute with $CONFIG_SHELL" >&2 exit 255 fi - if test x$as_have_required = xno; then : - $as_echo "$0: This script requires a shell more modern than all" - $as_echo "$0: the shells that I found on your system." - if test x${ZSH_VERSION+set} = xset ; then - $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" - $as_echo "$0: be upgraded to zsh 4.3.4 or later." + if test x$as_have_required = xno +then : + printf "%s\n" "$0: This script requires a shell more modern than all" + printf "%s\n" "$0: the shells that I found on your system." + if test ${ZSH_VERSION+y} ; then + printf "%s\n" "$0: In particular, zsh $ZSH_VERSION has bugs and should" + printf "%s\n" "$0: be upgraded to zsh 4.3.4 or later." else - $as_echo "$0: Please tell bug-autoconf@gnu.org about your system, + printf "%s\n" "$0: Please tell bug-autoconf@gnu.org about your system, $0: including any error possibly output before this $0: message. Then install a modern shell, or manually run $0: the script under such a shell if you do have one." @@ -293,6 +294,7 @@ } as_unset=as_fn_unset + # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. @@ -310,6 +312,14 @@ as_fn_set_status $1 exit $1 } # as_fn_exit +# as_fn_nop +# --------- +# Do nothing but, unlike ":", preserve the value of $?. +as_fn_nop () +{ + return $? +} +as_nop=as_fn_nop # as_fn_mkdir_p # ------------- @@ -324,7 +334,7 @@ as_dirs= while :; do case $as_dir in #( - *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *\'*) as_qdir=`printf "%s\n" "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" @@ -333,7 +343,7 @@ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$as_dir" | +printf "%s\n" X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q @@ -372,12 +382,13 @@ # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. -if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null +then : eval 'as_fn_append () { eval $1+=\$2 }' -else +else $as_nop as_fn_append () { eval $1=\$$1\$2 @@ -389,18 +400,27 @@ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. -if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null +then : eval 'as_fn_arith () { as_val=$(( $* )) }' -else +else $as_nop as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith +# as_fn_nop +# --------- +# Do nothing but, unlike ":", preserve the value of $?. +as_fn_nop () +{ + return $? +} +as_nop=as_fn_nop # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- @@ -412,9 +432,9 @@ as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi - $as_echo "$as_me: error: $2" >&2 + printf "%s\n" "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error @@ -441,7 +461,7 @@ $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X/"$0" | +printf "%s\n" X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q @@ -485,7 +505,7 @@ s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || - { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } + { printf "%s\n" "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } # If we had to re-execute with $CONFIG_SHELL, we're ensured to have # already done that, so ensure we don't try to do so again and fall @@ -499,6 +519,10 @@ exit } + +# Determine whether it's possible to make 'echo' print without a newline. +# These variables are no longer used directly by Autoconf, but are AC_SUBSTed +# for compatibility with existing Makefiles. ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) @@ -512,6 +536,13 @@ ECHO_N='-n';; esac +# For backward compatibility with old third-party macros, we provide +# the shell variables $as_echo and $as_echo_n. New code should use +# AS_ECHO(["message"]) and AS_ECHO_N(["message"]), respectively. +as_echo='printf %s\n' +as_echo_n='printf %s' + + rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file @@ -577,51 +608,47 @@ MAKEFLAGS= # Identity of this package. -PACKAGE_NAME= -PACKAGE_TARNAME= -PACKAGE_VERSION= -PACKAGE_STRING= -PACKAGE_BUGREPORT= -PACKAGE_URL= +PACKAGE_NAME='' +PACKAGE_TARNAME='' +PACKAGE_VERSION='' +PACKAGE_STRING='' +PACKAGE_BUGREPORT='' +PACKAGE_URL='' ac_unique_file="menuselect" ac_unique_file="menuselect.c" # Factoring default headers for most tests. ac_includes_default="\ -#include -#ifdef HAVE_SYS_TYPES_H -# include -#endif -#ifdef HAVE_SYS_STAT_H -# include +#include +#ifdef HAVE_STDIO_H +# include #endif -#ifdef STDC_HEADERS +#ifdef HAVE_STDLIB_H # include -# include -#else -# ifdef HAVE_STDLIB_H -# include -# endif #endif #ifdef HAVE_STRING_H -# if !defined STDC_HEADERS && defined HAVE_MEMORY_H -# include -# endif # include #endif -#ifdef HAVE_STRINGS_H -# include -#endif #ifdef HAVE_INTTYPES_H # include #endif #ifdef HAVE_STDINT_H # include #endif +#ifdef HAVE_STRINGS_H +# include +#endif +#ifdef HAVE_SYS_TYPES_H +# include +#endif +#ifdef HAVE_SYS_STAT_H +# include +#endif #ifdef HAVE_UNISTD_H # include #endif" +ac_header_c_list= ac_subst_vars='LTLIBOBJS LIBOBJS GTK2_LIB @@ -629,11 +656,10 @@ PBX_GTK2 GTK2_LIBS GTK2_CFLAGS -PKG_CONFIG_LIBDIR -PKG_CONFIG_PATH -PKG_CONFIG CONFIG_LIBXML2 SED +LIBXML2_LIBS +LIBXML2_CFLAGS HAVE_NCURSES_SUBDIR PBX_TINFO TINFO_DIR @@ -656,10 +682,10 @@ NEWT_INCLUDE NEWT_LIB ALLOCA -EGREP -GREP -CPP MENUSELECT_DEBUG +PKG_CONFIG_LIBDIR +PKG_CONFIG_PATH +PKG_CONFIG GNU_MAKE OBJEXT EXEEXT @@ -734,10 +760,11 @@ LDFLAGS LIBS CPPFLAGS -CPP PKG_CONFIG PKG_CONFIG_PATH PKG_CONFIG_LIBDIR +LIBXML2_CFLAGS +LIBXML2_LIBS GTK2_CFLAGS GTK2_LIBS' @@ -808,8 +835,6 @@ *) ac_optarg=yes ;; esac - # Accept the important Cygnus configure options, so we can diagnose typos. - case $ac_dashdash$ac_option in --) ac_dashdash=yes ;; @@ -850,9 +875,9 @@ ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error $? "invalid feature name: $ac_useropt" + as_fn_error $? "invalid feature name: \`$ac_useropt'" ac_useropt_orig=$ac_useropt - ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" @@ -876,9 +901,9 @@ ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error $? "invalid feature name: $ac_useropt" + as_fn_error $? "invalid feature name: \`$ac_useropt'" ac_useropt_orig=$ac_useropt - ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" @@ -1089,9 +1114,9 @@ ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error $? "invalid package name: $ac_useropt" + as_fn_error $? "invalid package name: \`$ac_useropt'" ac_useropt_orig=$ac_useropt - ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" @@ -1105,9 +1130,9 @@ ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error $? "invalid package name: $ac_useropt" + as_fn_error $? "invalid package name: \`$ac_useropt'" ac_useropt_orig=$ac_useropt - ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" @@ -1151,9 +1176,9 @@ *) # FIXME: should be removed in autoconf 3.0. - $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 + printf "%s\n" "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && - $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 + printf "%s\n" "$as_me: WARNING: invalid host type: $ac_option" >&2 : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" ;; @@ -1169,7 +1194,7 @@ case $enable_option_checking in no) ;; fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; - *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; + *) printf "%s\n" "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; esac fi @@ -1233,7 +1258,7 @@ X"$as_myself" : 'X\(//\)[^/]' \| \ X"$as_myself" : 'X\(//\)$' \| \ X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$as_myself" | +printf "%s\n" X"$as_myself" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q @@ -1381,12 +1406,15 @@ LIBS libraries to pass to the linker, e.g. -l CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I if you have headers in a nonstandard directory - CPP C preprocessor PKG_CONFIG path to pkg-config utility PKG_CONFIG_PATH directories to add to pkg-config's search path PKG_CONFIG_LIBDIR path overriding pkg-config's built-in search path + LIBXML2_CFLAGS + C compiler flags for LIBXML2, overriding pkg-config + LIBXML2_LIBS + linker flags for LIBXML2, overriding pkg-config GTK2_CFLAGS C compiler flags for GTK2, overriding pkg-config GTK2_LIBS linker flags for GTK2, overriding pkg-config @@ -1409,9 +1437,9 @@ case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) - ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` + ac_dir_suffix=/`printf "%s\n" "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. - ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + ac_top_builddir_sub=`printf "%s\n" "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; @@ -1439,7 +1467,8 @@ ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix cd "$ac_dir" || { ac_status=$?; continue; } - # Check for guested configure. + # Check for configure.gnu first; this name is used for a wrapper for + # Metaconfig's "Configure" on case-insensitive file systems. if test -f "$ac_srcdir/configure.gnu"; then echo && $SHELL "$ac_srcdir/configure.gnu" --help=recursive @@ -1447,7 +1476,7 @@ echo && $SHELL "$ac_srcdir/configure" --help=recursive else - $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 + printf "%s\n" "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done @@ -1457,9 +1486,9 @@ if $ac_init_version; then cat <<\_ACEOF configure -generated by GNU Autoconf 2.69 +generated by GNU Autoconf 2.71 -Copyright (C) 2012 Free Software Foundation, Inc. +Copyright (C) 2021 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. @@ -1478,14 +1507,14 @@ ac_fn_c_try_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - rm -f conftest.$ac_objext + rm -f conftest.$ac_objext conftest.beam if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 +printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>conftest.err ac_status=$? if test -s conftest.err; then @@ -1493,14 +1522,15 @@ cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest.$ac_objext; then : + } && test -s conftest.$ac_objext +then : ac_retval=0 -else - $as_echo "$as_me: failed program was:" >&5 +else $as_nop + printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 @@ -1517,17 +1547,18 @@ ac_fn_c_check_type () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -$as_echo_n "checking for $2... " >&6; } -if eval \${$3+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +printf %s "checking for $2... " >&6; } +if eval test \${$3+y} +then : + printf %s "(cached) " >&6 +else $as_nop eval "$3=no" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int -main () +main (void) { if (sizeof ($2)) return 0; @@ -1535,12 +1566,13 @@ return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int -main () +main (void) { if (sizeof (($2))) return 0; @@ -1548,101 +1580,23 @@ return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : -else +else $as_nop eval "$3=yes" fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_type -# ac_fn_c_try_cpp LINENO -# ---------------------- -# Try to preprocess conftest.$ac_ext, and return whether this succeeded. -ac_fn_c_try_cpp () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - if { { ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err - ac_status=$? - if test -s conftest.err; then - grep -v '^ *+' conftest.err >conftest.er1 - cat conftest.er1 >&5 - mv -f conftest.er1 conftest.err - fi - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } > conftest.i && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then : - ac_retval=0 -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_retval=1 -fi - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - as_fn_set_status $ac_retval - -} # ac_fn_c_try_cpp - -# ac_fn_c_try_run LINENO -# ---------------------- -# Try to link conftest.$ac_ext, and return whether this succeeded. Assumes -# that executables *can* be run. -ac_fn_c_try_run () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - if { { ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' - { { case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; }; then : - ac_retval=0 -else - $as_echo "$as_me: program exited with status $ac_status" >&5 - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_retval=$ac_status -fi - rm -rf conftest.dSYM conftest_ipa8_conftest.oo - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - as_fn_set_status $ac_retval - -} # ac_fn_c_try_run - # ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES # ------------------------------------------------------- # Tests whether HEADER exists and can be compiled using the include files in @@ -1650,26 +1604,28 @@ ac_fn_c_check_header_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -$as_echo_n "checking for $2... " >&6; } -if eval \${$3+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +printf %s "checking for $2... " >&6; } +if eval test \${$3+y} +then : + printf %s "(cached) " >&6 +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : eval "$3=yes" -else +else $as_nop eval "$3=no" fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_header_compile @@ -1680,14 +1636,14 @@ ac_fn_c_try_link () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - rm -f conftest.$ac_objext conftest$ac_exeext + rm -f conftest.$ac_objext conftest.beam conftest$ac_exeext if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 +printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_link") 2>conftest.err ac_status=$? if test -s conftest.err; then @@ -1695,17 +1651,18 @@ cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || test -x conftest$ac_exeext - }; then : + } +then : ac_retval=0 -else - $as_echo "$as_me: failed program was:" >&5 +else $as_nop + printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 @@ -1720,17 +1677,61 @@ } # ac_fn_c_try_link +# ac_fn_c_try_run LINENO +# ---------------------- +# Try to run conftest.$ac_ext, and return whether this succeeded. Assumes that +# executables *can* be run. +ac_fn_c_try_run () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +printf "%s\n" "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' + { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +printf "%s\n" "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; } +then : + ac_retval=0 +else $as_nop + printf "%s\n" "$as_me: program exited with status $ac_status" >&5 + printf "%s\n" "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=$ac_status +fi + rm -rf conftest.dSYM conftest_ipa8_conftest.oo + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_c_try_run + # ac_fn_c_check_func LINENO FUNC VAR # ---------------------------------- # Tests whether FUNC exists, setting the cache variable VAR accordingly ac_fn_c_check_func () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -$as_echo_n "checking for $2... " >&6; } -if eval \${$3+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +printf %s "checking for $2... " >&6; } +if eval test \${$3+y} +then : + printf %s "(cached) " >&6 +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Define $2 to an innocuous variant, in case declares $2. @@ -1738,16 +1739,9 @@ #define $2 innocuous_$2 /* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $2 (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif + which can conflict with char $2 (); below. */ +#include #undef $2 /* Override any GCC internal prototype to avoid an error. @@ -1765,122 +1759,56 @@ #endif int -main () +main (void) { return $2 (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : eval "$3=yes" -else +else $as_nop eval "$3=no" fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext fi eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_func +ac_configure_args_raw= +for ac_arg +do + case $ac_arg in + *\'*) + ac_arg=`printf "%s\n" "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + as_fn_append ac_configure_args_raw " '$ac_arg'" +done -# ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES -# ------------------------------------------------------- -# Tests whether HEADER exists, giving a warning if it cannot be compiled using -# the include files in INCLUDES and setting the cache variable VAR -# accordingly. -ac_fn_c_check_header_mongrel () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - if eval \${$3+:} false; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -$as_echo_n "checking for $2... " >&6; } -if eval \${$3+:} false; then : - $as_echo_n "(cached) " >&6 -fi -eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -else - # Is the header compilable? -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5 -$as_echo_n "checking $2 usability... " >&6; } -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$4 -#include <$2> -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_header_compiler=yes -else - ac_header_compiler=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5 -$as_echo "$ac_header_compiler" >&6; } - -# Is the header present? -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5 -$as_echo_n "checking $2 presence... " >&6; } -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include <$2> -_ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : - ac_header_preproc=yes -else - ac_header_preproc=no -fi -rm -f conftest.err conftest.i conftest.$ac_ext -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 -$as_echo "$ac_header_preproc" >&6; } - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #(( - yes:no: ) - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5 -$as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 -$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} - ;; - no:yes:* ) - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5 -$as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5 -$as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5 -$as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5 -$as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 -$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} - ;; +case $ac_configure_args_raw in + *$as_nl*) + ac_safe_unquote= ;; + *) + ac_unsafe_z='|&;<>()$`\\"*?[ '' ' # This string ends in space, tab. + ac_unsafe_a="$ac_unsafe_z#~" + ac_safe_unquote="s/ '\\([^$ac_unsafe_a][^$ac_unsafe_z]*\\)'/ \\1/g" + ac_configure_args_raw=` printf "%s\n" "$ac_configure_args_raw" | sed "$ac_safe_unquote"`;; esac - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -$as_echo_n "checking for $2... " >&6; } -if eval \${$3+:} false; then : - $as_echo_n "(cached) " >&6 -else - eval "$3=\$ac_header_compiler" -fi -eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -fi - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno -} # ac_fn_c_check_header_mongrel cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by $as_me, which was -generated by GNU Autoconf 2.69. Invocation command line was +generated by GNU Autoconf 2.71. Invocation command line was - $ $0 $@ + $ $0$ac_configure_args_raw _ACEOF exec 5>>config.log @@ -1913,8 +1841,12 @@ for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - $as_echo "PATH: $as_dir" + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + printf "%s\n" "PATH: $as_dir" done IFS=$as_save_IFS @@ -1949,7 +1881,7 @@ | -silent | --silent | --silen | --sile | --sil) continue ;; *\'*) - ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + ac_arg=`printf "%s\n" "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; @@ -1984,11 +1916,13 @@ # WARNING: Use '\'' to represent an apostrophe within the trap. # WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. trap 'exit_status=$? + # Sanitize IFS. + IFS=" "" $as_nl" # Save into config.log some information that might help in debugging. { echo - $as_echo "## ---------------- ## + printf "%s\n" "## ---------------- ## ## Cache variables. ## ## ---------------- ##" echo @@ -1999,8 +1933,8 @@ case $ac_val in #( *${as_nl}*) case $ac_var in #( - *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 -$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + *_cv_*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 +printf "%s\n" "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( @@ -2024,7 +1958,7 @@ ) echo - $as_echo "## ----------------- ## + printf "%s\n" "## ----------------- ## ## Output variables. ## ## ----------------- ##" echo @@ -2032,14 +1966,14 @@ do eval ac_val=\$$ac_var case $ac_val in - *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + *\'\''*) ac_val=`printf "%s\n" "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac - $as_echo "$ac_var='\''$ac_val'\''" + printf "%s\n" "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then - $as_echo "## ------------------- ## + printf "%s\n" "## ------------------- ## ## File substitutions. ## ## ------------------- ##" echo @@ -2047,15 +1981,15 @@ do eval ac_val=\$$ac_var case $ac_val in - *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + *\'\''*) ac_val=`printf "%s\n" "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac - $as_echo "$ac_var='\''$ac_val'\''" + printf "%s\n" "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then - $as_echo "## ----------- ## + printf "%s\n" "## ----------- ## ## confdefs.h. ## ## ----------- ##" echo @@ -2063,8 +1997,8 @@ echo fi test "$ac_signal" != 0 && - $as_echo "$as_me: caught signal $ac_signal" - $as_echo "$as_me: exit $exit_status" + printf "%s\n" "$as_me: caught signal $ac_signal" + printf "%s\n" "$as_me: exit $exit_status" } >&5 rm -f core *.core core.conftest.* && rm -f -r conftest* confdefs* conf$$* $ac_clean_files && @@ -2078,63 +2012,48 @@ # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -f -r conftest* confdefs.h -$as_echo "/* confdefs.h */" > confdefs.h +printf "%s\n" "/* confdefs.h */" > confdefs.h # Predefined preprocessor variables. -cat >>confdefs.h <<_ACEOF -#define PACKAGE_NAME "$PACKAGE_NAME" -_ACEOF +printf "%s\n" "#define PACKAGE_NAME \"$PACKAGE_NAME\"" >>confdefs.h -cat >>confdefs.h <<_ACEOF -#define PACKAGE_TARNAME "$PACKAGE_TARNAME" -_ACEOF +printf "%s\n" "#define PACKAGE_TARNAME \"$PACKAGE_TARNAME\"" >>confdefs.h -cat >>confdefs.h <<_ACEOF -#define PACKAGE_VERSION "$PACKAGE_VERSION" -_ACEOF +printf "%s\n" "#define PACKAGE_VERSION \"$PACKAGE_VERSION\"" >>confdefs.h -cat >>confdefs.h <<_ACEOF -#define PACKAGE_STRING "$PACKAGE_STRING" -_ACEOF +printf "%s\n" "#define PACKAGE_STRING \"$PACKAGE_STRING\"" >>confdefs.h -cat >>confdefs.h <<_ACEOF -#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" -_ACEOF +printf "%s\n" "#define PACKAGE_BUGREPORT \"$PACKAGE_BUGREPORT\"" >>confdefs.h -cat >>confdefs.h <<_ACEOF -#define PACKAGE_URL "$PACKAGE_URL" -_ACEOF +printf "%s\n" "#define PACKAGE_URL \"$PACKAGE_URL\"" >>confdefs.h # Let the site file select an alternate cache file if it wants to. # Prefer an explicitly selected file to automatically selected ones. -ac_site_file1=NONE -ac_site_file2=NONE if test -n "$CONFIG_SITE"; then - # We do not want a PATH search for config.site. - case $CONFIG_SITE in #(( - -*) ac_site_file1=./$CONFIG_SITE;; - */*) ac_site_file1=$CONFIG_SITE;; - *) ac_site_file1=./$CONFIG_SITE;; - esac + ac_site_files="$CONFIG_SITE" elif test "x$prefix" != xNONE; then - ac_site_file1=$prefix/share/config.site - ac_site_file2=$prefix/etc/config.site + ac_site_files="$prefix/share/config.site $prefix/etc/config.site" else - ac_site_file1=$ac_default_prefix/share/config.site - ac_site_file2=$ac_default_prefix/etc/config.site + ac_site_files="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" fi -for ac_site_file in "$ac_site_file1" "$ac_site_file2" + +for ac_site_file in $ac_site_files do - test "x$ac_site_file" = xNONE && continue - if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 -$as_echo "$as_me: loading site script $ac_site_file" >&6;} + case $ac_site_file in #( + */*) : + ;; #( + *) : + ac_site_file=./$ac_site_file ;; +esac + if test -f "$ac_site_file" && test -r "$ac_site_file"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 +printf "%s\n" "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" \ - || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + || { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "failed to load site script $ac_site_file See \`config.log' for more details" "$LINENO" 5; } fi @@ -2144,63 +2063,478 @@ # Some versions of bash will fail to source /dev/null (special files # actually), so we avoid doing that. DJGPP emulates it as a regular file. if test /dev/null != "$cache_file" && test -f "$cache_file"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 -$as_echo "$as_me: loading cache $cache_file" >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 +printf "%s\n" "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else - { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 -$as_echo "$as_me: creating cache $cache_file" >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 +printf "%s\n" "$as_me: creating cache $cache_file" >&6;} >$cache_file fi -# Check that the precious variables saved in the cache have kept the same -# value. -ac_cache_corrupted=false -for ac_var in $ac_precious_vars; do - eval ac_old_set=\$ac_cv_env_${ac_var}_set - eval ac_new_set=\$ac_env_${ac_var}_set - eval ac_old_val=\$ac_cv_env_${ac_var}_value - eval ac_new_val=\$ac_env_${ac_var}_value - case $ac_old_set,$ac_new_set in - set,) - { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 -$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} - ac_cache_corrupted=: ;; - ,set) - { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 -$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} - ac_cache_corrupted=: ;; - ,);; - *) - if test "x$ac_old_val" != "x$ac_new_val"; then - # differences in whitespace do not lead to failure. - ac_old_val_w=`echo x $ac_old_val` - ac_new_val_w=`echo x $ac_new_val` - if test "$ac_old_val_w" != "$ac_new_val_w"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 -$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} - ac_cache_corrupted=: - else - { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 -$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} - eval $ac_var=\$ac_old_val - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 -$as_echo "$as_me: former value: \`$ac_old_val'" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 -$as_echo "$as_me: current value: \`$ac_new_val'" >&2;} - fi;; - esac - # Pass precious variables to config.status. - if test "$ac_new_set" = set; then - case $ac_new_val in - *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; - *) ac_arg=$ac_var=$ac_new_val ;; - esac +# Test code for whether the C compiler supports C89 (global declarations) +ac_c_conftest_c89_globals=' +/* Does the compiler advertise C89 conformance? + Do not test the value of __STDC__, because some compilers set it to 0 + while being otherwise adequately conformant. */ +#if !defined __STDC__ +# error "Compiler does not advertise C89 conformance" +#endif + +#include +#include +struct stat; +/* Most of the following tests are stolen from RCS 5.7 src/conf.sh. */ +struct buf { int x; }; +struct buf * (*rcsopen) (struct buf *, struct stat *, int); +static char *e (p, i) + char **p; + int i; +{ + return p[i]; +} +static char *f (char * (*g) (char **, int), char **p, ...) +{ + char *s; + va_list v; + va_start (v,p); + s = g (p, va_arg (v,int)); + va_end (v); + return s; +} + +/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has + function prototypes and stuff, but not \xHH hex character constants. + These do not provoke an error unfortunately, instead are silently treated + as an "x". The following induces an error, until -std is added to get + proper ANSI mode. Curiously \x00 != x always comes out true, for an + array size at least. It is necessary to write \x00 == 0 to get something + that is true only with -std. */ +int osf4_cc_array ['\''\x00'\'' == 0 ? 1 : -1]; + +/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters + inside strings and character constants. */ +#define FOO(x) '\''x'\'' +int xlc6_cc_array[FOO(a) == '\''x'\'' ? 1 : -1]; + +int test (int i, double x); +struct s1 {int (*f) (int a);}; +struct s2 {int (*f) (double a);}; +int pairnames (int, char **, int *(*)(struct buf *, struct stat *, int), + int, int);' + +# Test code for whether the C compiler supports C89 (body of main). +ac_c_conftest_c89_main=' +ok |= (argc == 0 || f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]); +' + +# Test code for whether the C compiler supports C99 (global declarations) +ac_c_conftest_c99_globals=' +// Does the compiler advertise C99 conformance? +#if !defined __STDC_VERSION__ || __STDC_VERSION__ < 199901L +# error "Compiler does not advertise C99 conformance" +#endif + +#include +extern int puts (const char *); +extern int printf (const char *, ...); +extern int dprintf (int, const char *, ...); +extern void *malloc (size_t); + +// Check varargs macros. These examples are taken from C99 6.10.3.5. +// dprintf is used instead of fprintf to avoid needing to declare +// FILE and stderr. +#define debug(...) dprintf (2, __VA_ARGS__) +#define showlist(...) puts (#__VA_ARGS__) +#define report(test,...) ((test) ? puts (#test) : printf (__VA_ARGS__)) +static void +test_varargs_macros (void) +{ + int x = 1234; + int y = 5678; + debug ("Flag"); + debug ("X = %d\n", x); + showlist (The first, second, and third items.); + report (x>y, "x is %d but y is %d", x, y); +} + +// Check long long types. +#define BIG64 18446744073709551615ull +#define BIG32 4294967295ul +#define BIG_OK (BIG64 / BIG32 == 4294967297ull && BIG64 % BIG32 == 0) +#if !BIG_OK + #error "your preprocessor is broken" +#endif +#if BIG_OK +#else + #error "your preprocessor is broken" +#endif +static long long int bignum = -9223372036854775807LL; +static unsigned long long int ubignum = BIG64; + +struct incomplete_array +{ + int datasize; + double data[]; +}; + +struct named_init { + int number; + const wchar_t *name; + double average; +}; + +typedef const char *ccp; + +static inline int +test_restrict (ccp restrict text) +{ + // See if C++-style comments work. + // Iterate through items via the restricted pointer. + // Also check for declarations in for loops. + for (unsigned int i = 0; *(text+i) != '\''\0'\''; ++i) + continue; + return 0; +} + +// Check varargs and va_copy. +static bool +test_varargs (const char *format, ...) +{ + va_list args; + va_start (args, format); + va_list args_copy; + va_copy (args_copy, args); + + const char *str = ""; + int number = 0; + float fnumber = 0; + + while (*format) + { + switch (*format++) + { + case '\''s'\'': // string + str = va_arg (args_copy, const char *); + break; + case '\''d'\'': // int + number = va_arg (args_copy, int); + break; + case '\''f'\'': // float + fnumber = va_arg (args_copy, double); + break; + default: + break; + } + } + va_end (args_copy); + va_end (args); + + return *str && number && fnumber; +} +' + +# Test code for whether the C compiler supports C99 (body of main). +ac_c_conftest_c99_main=' + // Check bool. + _Bool success = false; + success |= (argc != 0); + + // Check restrict. + if (test_restrict ("String literal") == 0) + success = true; + char *restrict newvar = "Another string"; + + // Check varargs. + success &= test_varargs ("s, d'\'' f .", "string", 65, 34.234); + test_varargs_macros (); + + // Check flexible array members. + struct incomplete_array *ia = + malloc (sizeof (struct incomplete_array) + (sizeof (double) * 10)); + ia->datasize = 10; + for (int i = 0; i < ia->datasize; ++i) + ia->data[i] = i * 1.234; + + // Check named initializers. + struct named_init ni = { + .number = 34, + .name = L"Test wide string", + .average = 543.34343, + }; + + ni.number = 58; + + int dynamic_array[ni.number]; + dynamic_array[0] = argv[0][0]; + dynamic_array[ni.number - 1] = 543; + + // work around unused variable warnings + ok |= (!success || bignum == 0LL || ubignum == 0uLL || newvar[0] == '\''x'\'' + || dynamic_array[ni.number - 1] != 543); +' + +# Test code for whether the C compiler supports C11 (global declarations) +ac_c_conftest_c11_globals=' +// Does the compiler advertise C11 conformance? +#if !defined __STDC_VERSION__ || __STDC_VERSION__ < 201112L +# error "Compiler does not advertise C11 conformance" +#endif + +// Check _Alignas. +char _Alignas (double) aligned_as_double; +char _Alignas (0) no_special_alignment; +extern char aligned_as_int; +char _Alignas (0) _Alignas (int) aligned_as_int; + +// Check _Alignof. +enum +{ + int_alignment = _Alignof (int), + int_array_alignment = _Alignof (int[100]), + char_alignment = _Alignof (char) +}; +_Static_assert (0 < -_Alignof (int), "_Alignof is signed"); + +// Check _Noreturn. +int _Noreturn does_not_return (void) { for (;;) continue; } + +// Check _Static_assert. +struct test_static_assert +{ + int x; + _Static_assert (sizeof (int) <= sizeof (long int), + "_Static_assert does not work in struct"); + long int y; +}; + +// Check UTF-8 literals. +#define u8 syntax error! +char const utf8_literal[] = u8"happens to be ASCII" "another string"; + +// Check duplicate typedefs. +typedef long *long_ptr; +typedef long int *long_ptr; +typedef long_ptr long_ptr; + +// Anonymous structures and unions -- taken from C11 6.7.2.1 Example 1. +struct anonymous +{ + union { + struct { int i; int j; }; + struct { int k; long int l; } w; + }; + int m; +} v1; +' + +# Test code for whether the C compiler supports C11 (body of main). +ac_c_conftest_c11_main=' + _Static_assert ((offsetof (struct anonymous, i) + == offsetof (struct anonymous, w.k)), + "Anonymous union alignment botch"); + v1.i = 2; + v1.w.k = 5; + ok |= v1.i != 5; +' + +# Test code for whether the C compiler supports C11 (complete). +ac_c_conftest_c11_program="${ac_c_conftest_c89_globals} +${ac_c_conftest_c99_globals} +${ac_c_conftest_c11_globals} + +int +main (int argc, char **argv) +{ + int ok = 0; + ${ac_c_conftest_c89_main} + ${ac_c_conftest_c99_main} + ${ac_c_conftest_c11_main} + return ok; +} +" + +# Test code for whether the C compiler supports C99 (complete). +ac_c_conftest_c99_program="${ac_c_conftest_c89_globals} +${ac_c_conftest_c99_globals} + +int +main (int argc, char **argv) +{ + int ok = 0; + ${ac_c_conftest_c89_main} + ${ac_c_conftest_c99_main} + return ok; +} +" + +# Test code for whether the C compiler supports C89 (complete). +ac_c_conftest_c89_program="${ac_c_conftest_c89_globals} + +int +main (int argc, char **argv) +{ + int ok = 0; + ${ac_c_conftest_c89_main} + return ok; +} +" + +as_fn_append ac_header_c_list " stdio.h stdio_h HAVE_STDIO_H" +as_fn_append ac_header_c_list " stdlib.h stdlib_h HAVE_STDLIB_H" +as_fn_append ac_header_c_list " string.h string_h HAVE_STRING_H" +as_fn_append ac_header_c_list " inttypes.h inttypes_h HAVE_INTTYPES_H" +as_fn_append ac_header_c_list " stdint.h stdint_h HAVE_STDINT_H" +as_fn_append ac_header_c_list " strings.h strings_h HAVE_STRINGS_H" +as_fn_append ac_header_c_list " sys/stat.h sys_stat_h HAVE_SYS_STAT_H" +as_fn_append ac_header_c_list " sys/types.h sys_types_h HAVE_SYS_TYPES_H" +as_fn_append ac_header_c_list " unistd.h unistd_h HAVE_UNISTD_H" + +# Auxiliary files required by this configure script. +ac_aux_files="config.guess config.sub" + +# Locations in which to look for auxiliary files. +ac_aux_dir_candidates="${srcdir}${PATH_SEPARATOR}${srcdir}/..${PATH_SEPARATOR}${srcdir}/../.." + +# Search for a directory containing all of the required auxiliary files, +# $ac_aux_files, from the $PATH-style list $ac_aux_dir_candidates. +# If we don't find one directory that contains all the files we need, +# we report the set of missing files from the *first* directory in +# $ac_aux_dir_candidates and give up. +ac_missing_aux_files="" +ac_first_candidate=: +printf "%s\n" "$as_me:${as_lineno-$LINENO}: looking for aux files: $ac_aux_files" >&5 +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +as_found=false +for as_dir in $ac_aux_dir_candidates +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + as_found=: + + printf "%s\n" "$as_me:${as_lineno-$LINENO}: trying $as_dir" >&5 + ac_aux_dir_found=yes + ac_install_sh= + for ac_aux in $ac_aux_files + do + # As a special case, if "install-sh" is required, that requirement + # can be satisfied by any of "install-sh", "install.sh", or "shtool", + # and $ac_install_sh is set appropriately for whichever one is found. + if test x"$ac_aux" = x"install-sh" + then + if test -f "${as_dir}install-sh"; then + printf "%s\n" "$as_me:${as_lineno-$LINENO}: ${as_dir}install-sh found" >&5 + ac_install_sh="${as_dir}install-sh -c" + elif test -f "${as_dir}install.sh"; then + printf "%s\n" "$as_me:${as_lineno-$LINENO}: ${as_dir}install.sh found" >&5 + ac_install_sh="${as_dir}install.sh -c" + elif test -f "${as_dir}shtool"; then + printf "%s\n" "$as_me:${as_lineno-$LINENO}: ${as_dir}shtool found" >&5 + ac_install_sh="${as_dir}shtool install -c" + else + ac_aux_dir_found=no + if $ac_first_candidate; then + ac_missing_aux_files="${ac_missing_aux_files} install-sh" + else + break + fi + fi + else + if test -f "${as_dir}${ac_aux}"; then + printf "%s\n" "$as_me:${as_lineno-$LINENO}: ${as_dir}${ac_aux} found" >&5 + else + ac_aux_dir_found=no + if $ac_first_candidate; then + ac_missing_aux_files="${ac_missing_aux_files} ${ac_aux}" + else + break + fi + fi + fi + done + if test "$ac_aux_dir_found" = yes; then + ac_aux_dir="$as_dir" + break + fi + ac_first_candidate=false + + as_found=false +done +IFS=$as_save_IFS +if $as_found +then : + +else $as_nop + as_fn_error $? "cannot find required auxiliary files:$ac_missing_aux_files" "$LINENO" 5 +fi + + +# These three variables are undocumented and unsupported, +# and are intended to be withdrawn in a future Autoconf release. +# They can cause serious problems if a builder's source tree is in a directory +# whose full name contains unusual characters. +if test -f "${ac_aux_dir}config.guess"; then + ac_config_guess="$SHELL ${ac_aux_dir}config.guess" +fi +if test -f "${ac_aux_dir}config.sub"; then + ac_config_sub="$SHELL ${ac_aux_dir}config.sub" +fi +if test -f "$ac_aux_dir/configure"; then + ac_configure="$SHELL ${ac_aux_dir}configure" +fi + +# Check that the precious variables saved in the cache have kept the same +# value. +ac_cache_corrupted=false +for ac_var in $ac_precious_vars; do + eval ac_old_set=\$ac_cv_env_${ac_var}_set + eval ac_new_set=\$ac_env_${ac_var}_set + eval ac_old_val=\$ac_cv_env_${ac_var}_value + eval ac_new_val=\$ac_env_${ac_var}_value + case $ac_old_set,$ac_new_set in + set,) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 +printf "%s\n" "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,set) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 +printf "%s\n" "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,);; + *) + if test "x$ac_old_val" != "x$ac_new_val"; then + # differences in whitespace do not lead to failure. + ac_old_val_w=`echo x $ac_old_val` + ac_new_val_w=`echo x $ac_new_val` + if test "$ac_old_val_w" != "$ac_new_val_w"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 +printf "%s\n" "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} + ac_cache_corrupted=: + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 +printf "%s\n" "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} + eval $ac_var=\$ac_old_val + fi + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 +printf "%s\n" "$as_me: former value: \`$ac_old_val'" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 +printf "%s\n" "$as_me: current value: \`$ac_new_val'" >&2;} + fi;; + esac + # Pass precious variables to config.status. + if test "$ac_new_set" = set; then + case $ac_new_val in + *\'*) ac_arg=$ac_var=`printf "%s\n" "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; + *) ac_arg=$ac_var=$ac_new_val ;; + esac case " $ac_configure_args " in *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. *) as_fn_append ac_configure_args " '$ac_arg'" ;; @@ -2208,11 +2542,12 @@ fi done if $ac_cache_corrupted; then - { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 -$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} - as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 +printf "%s\n" "$as_me: error: changes in the environment can compromise the build" >&2;} + as_fn_error $? "run \`${MAKE-make} distclean' and/or \`rm $cache_file' + and start over" "$LINENO" 5 fi ## -------------------- ## ## Main body of script. ## @@ -2235,55 +2570,30 @@ -ac_aux_dir= -for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do - if test -f "$ac_dir/install-sh"; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/install-sh -c" - break - elif test -f "$ac_dir/install.sh"; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/install.sh -c" - break - elif test -f "$ac_dir/shtool"; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/shtool install -c" - break - fi -done -if test -z "$ac_aux_dir"; then - as_fn_error $? "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5 -fi -# These three variables are undocumented and unsupported, -# and are intended to be withdrawn in a future Autoconf release. -# They can cause serious problems if a builder's source tree is in a directory -# whose full name contains unusual characters. -ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. -ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. -ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. -# Make sure we can run config.sub. -$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || - as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5 - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 -$as_echo_n "checking build system type... " >&6; } -if ${ac_cv_build+:} false; then : - $as_echo_n "(cached) " >&6 -else + # Make sure we can run config.sub. +$SHELL "${ac_aux_dir}config.sub" sun4 >/dev/null 2>&1 || + as_fn_error $? "cannot run $SHELL ${ac_aux_dir}config.sub" "$LINENO" 5 + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 +printf %s "checking build system type... " >&6; } +if test ${ac_cv_build+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_build_alias=$build_alias test "x$ac_build_alias" = x && - ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` + ac_build_alias=`$SHELL "${ac_aux_dir}config.guess"` test "x$ac_build_alias" = x && as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5 -ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || - as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5 +ac_cv_build=`$SHELL "${ac_aux_dir}config.sub" $ac_build_alias` || + as_fn_error $? "$SHELL ${ac_aux_dir}config.sub $ac_build_alias failed" "$LINENO" 5 fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 -$as_echo "$ac_cv_build" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 +printf "%s\n" "$ac_cv_build" >&6; } case $ac_cv_build in *-*-*) ;; *) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;; @@ -2302,21 +2612,22 @@ case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 -$as_echo_n "checking host system type... " >&6; } -if ${ac_cv_host+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 +printf %s "checking host system type... " >&6; } +if test ${ac_cv_host+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test "x$host_alias" = x; then ac_cv_host=$ac_cv_build else - ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || - as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5 + ac_cv_host=`$SHELL "${ac_aux_dir}config.sub" $host_alias` || + as_fn_error $? "$SHELL ${ac_aux_dir}config.sub $host_alias failed" "$LINENO" 5 fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 -$as_echo "$ac_cv_host" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 +printf "%s\n" "$ac_cv_host" >&6; } case $ac_cv_host in *-*-*) ;; *) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;; @@ -2359,6 +2670,15 @@ # Checks for programs. + + + + + + + + + ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -2367,11 +2687,12 @@ if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else @@ -2379,11 +2700,15 @@ for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}gcc" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -2394,11 +2719,11 @@ fi CC=$ac_cv_prog_CC if test -n "$CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -$as_echo "$CC" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +printf "%s\n" "$CC" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -2407,11 +2732,12 @@ ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else @@ -2419,11 +2745,15 @@ for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="gcc" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -2434,11 +2764,11 @@ fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 -$as_echo "$ac_ct_CC" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +printf "%s\n" "$ac_ct_CC" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi if test "x$ac_ct_CC" = x; then @@ -2446,8 +2776,8 @@ else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC @@ -2460,11 +2790,12 @@ if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else @@ -2472,11 +2803,15 @@ for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}cc" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -2487,11 +2822,11 @@ fi CC=$ac_cv_prog_CC if test -n "$CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -$as_echo "$CC" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +printf "%s\n" "$CC" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -2500,11 +2835,12 @@ if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else @@ -2513,15 +2849,19 @@ for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + if test "$as_dir$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -2537,18 +2877,18 @@ # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift - ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" + ac_cv_prog_CC="$as_dir$ac_word${1+' '}$@" fi fi fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -$as_echo "$CC" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +printf "%s\n" "$CC" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -2559,11 +2899,12 @@ do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else @@ -2571,11 +2912,15 @@ for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -2586,11 +2931,11 @@ fi CC=$ac_cv_prog_CC if test -n "$CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -$as_echo "$CC" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +printf "%s\n" "$CC" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -2603,11 +2948,12 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else @@ -2615,11 +2961,15 @@ for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -2630,11 +2980,11 @@ fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 -$as_echo "$ac_ct_CC" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +printf "%s\n" "$ac_ct_CC" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -2646,34 +2996,138 @@ else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +fi + +fi +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}clang", so it can be a program name with args. +set dummy ${ac_tool_prefix}clang; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="${ac_tool_prefix}clang" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +printf "%s\n" "$CC" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_CC"; then + ac_ct_CC=$CC + # Extract the first word of "clang", so it can be a program name with args. +set dummy clang; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="clang" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +printf "%s\n" "$ac_ct_CC" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi +else + CC="$ac_cv_prog_CC" fi fi -test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +test -z "$CC" && { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "no acceptable C compiler found in \$PATH See \`config.log' for more details" "$LINENO" 5; } # Provide some information about the compiler. -$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 +printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 set X $ac_compile ac_compiler=$2 -for ac_option in --version -v -V -qversion; do +for ac_option in --version -v -V -qversion -version; do { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 +printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then @@ -2683,7 +3137,7 @@ cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done @@ -2691,7 +3145,7 @@ /* end confdefs.h. */ int -main () +main (void) { ; @@ -2703,9 +3157,9 @@ # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 -$as_echo_n "checking whether the C compiler works... " >&6; } -ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 +printf %s "checking whether the C compiler works... " >&6; } +ac_link_default=`printf "%s\n" "$ac_link" | sed 's/ -o *conftest[^ ]*//'` # The possible output files: ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" @@ -2726,11 +3180,12 @@ *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 +printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_link_default") 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then : + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +then : # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. # So ignore a value of `no', otherwise this would lead to `EXEEXT = no' # in a Makefile. We should not override ac_cv_exeext if it was cached, @@ -2747,7 +3202,7 @@ # certainly right. break;; *.* ) - if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; + if test ${ac_cv_exeext+y} && test "$ac_cv_exeext" != no; then :; else ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` fi @@ -2763,44 +3218,46 @@ done test "$ac_cv_exeext" = no && ac_cv_exeext= -else +else $as_nop ac_file='' fi -if test -z "$ac_file"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -$as_echo "$as_me: failed program was:" >&5 +if test -z "$ac_file" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "C compiler cannot create executables See \`config.log' for more details" "$LINENO" 5; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 -$as_echo_n "checking for C compiler default output file name... " >&6; } -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 -$as_echo "$ac_file" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 +printf %s "checking for C compiler default output file name... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 +printf "%s\n" "$ac_file" >&6; } ac_exeext=$ac_cv_exeext rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 -$as_echo_n "checking for suffix of executables... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 +printf %s "checking for suffix of executables... " >&6; } if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 +printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then : + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +then : # If both `conftest.exe' and `conftest' are `present' (well, observable) # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will # work properly (i.e., refer to `conftest.exe'), while it won't with @@ -2814,15 +3271,15 @@ * ) break;; esac done -else - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +else $as_nop + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of executables: cannot compile and link See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest conftest$ac_cv_exeext -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 -$as_echo "$ac_cv_exeext" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 +printf "%s\n" "$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext @@ -2831,7 +3288,7 @@ /* end confdefs.h. */ #include int -main () +main (void) { FILE *f = fopen ("conftest.out", "w"); return ferror (f) || fclose (f) != 0; @@ -2843,8 +3300,8 @@ ac_clean_files="$ac_clean_files conftest.out" # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 -$as_echo_n "checking whether we are cross compiling... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 +printf %s "checking whether we are cross compiling... " >&6; } if test "$cross_compiling" != yes; then { { ac_try="$ac_link" case "(($ac_try" in @@ -2852,10 +3309,10 @@ *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 +printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if { ac_try='./conftest$ac_cv_exeext' { { case "(($ac_try" in @@ -2863,39 +3320,40 @@ *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 +printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "cannot run C compiled programs. + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details" "$LINENO" 5; } fi fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 -$as_echo "$cross_compiling" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 +printf "%s\n" "$cross_compiling" >&6; } rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out ac_clean_files=$ac_clean_files_save -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 -$as_echo_n "checking for suffix of object files... " >&6; } -if ${ac_cv_objext+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 +printf %s "checking for suffix of object files... " >&6; } +if test ${ac_cv_objext+y} +then : + printf %s "(cached) " >&6 +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int -main () +main (void) { ; @@ -2909,11 +3367,12 @@ *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 +printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then : + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +then : for ac_file in conftest.o conftest.obj conftest.*; do test -f "$ac_file" || continue; case $ac_file in @@ -2922,31 +3381,32 @@ break;; esac done -else - $as_echo "$as_me: failed program was:" >&5 +else $as_nop + printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of object files: cannot compile See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 -$as_echo "$ac_cv_objext" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 +printf "%s\n" "$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 -$as_echo_n "checking whether we are using the GNU C compiler... " >&6; } -if ${ac_cv_c_compiler_gnu+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports GNU C" >&5 +printf %s "checking whether the compiler supports GNU C... " >&6; } +if test ${ac_cv_c_compiler_gnu+y} +then : + printf %s "(cached) " >&6 +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int -main () +main (void) { #ifndef __GNUC__ choke me @@ -2956,29 +3416,33 @@ return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : ac_compiler_gnu=yes -else +else $as_nop ac_compiler_gnu=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 -$as_echo "$ac_cv_c_compiler_gnu" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 +printf "%s\n" "$ac_cv_c_compiler_gnu" >&6; } +ac_compiler_gnu=$ac_cv_c_compiler_gnu + if test $ac_compiler_gnu = yes; then GCC=yes else GCC= fi -ac_test_CFLAGS=${CFLAGS+set} +ac_test_CFLAGS=${CFLAGS+y} ac_save_CFLAGS=$CFLAGS -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 -$as_echo_n "checking whether $CC accepts -g... " >&6; } -if ${ac_cv_prog_cc_g+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 +printf %s "checking whether $CC accepts -g... " >&6; } +if test ${ac_cv_prog_cc_g+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no @@ -2987,57 +3451,60 @@ /* end confdefs.h. */ int -main () +main (void) { ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : ac_cv_prog_cc_g=yes -else +else $as_nop CFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int -main () +main (void) { ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : -else +else $as_nop ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int -main () +main (void) { ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : ac_cv_prog_cc_g=yes fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 -$as_echo "$ac_cv_prog_cc_g" >&6; } -if test "$ac_test_CFLAGS" = set; then +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 +printf "%s\n" "$ac_cv_prog_cc_g" >&6; } +if test $ac_test_CFLAGS; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then @@ -3052,94 +3519,144 @@ CFLAGS= fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 -$as_echo_n "checking for $CC option to accept ISO C89... " >&6; } -if ${ac_cv_prog_cc_c89+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_cv_prog_cc_c89=no +ac_prog_cc_stdc=no +if test x$ac_prog_cc_stdc = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C11 features" >&5 +printf %s "checking for $CC option to enable C11 features... " >&6; } +if test ${ac_cv_prog_cc_c11+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_cv_prog_cc_c11=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#include -#include -struct stat; -/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ -struct buf { int x; }; -FILE * (*rcsopen) (struct buf *, struct stat *, int); -static char *e (p, i) - char **p; - int i; -{ - return p[i]; -} -static char *f (char * (*g) (char **, int), char **p, ...) -{ - char *s; - va_list v; - va_start (v,p); - s = g (p, va_arg (v,int)); - va_end (v); - return s; -} - -/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has - function prototypes and stuff, but not '\xHH' hex character constants. - These don't provoke an error unfortunately, instead are silently treated - as 'x'. The following induces an error, until -std is added to get - proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an - array size at least. It's necessary to write '\x00'==0 to get something - that's true only with -std. */ -int osf4_cc_array ['\x00' == 0 ? 1 : -1]; +$ac_c_conftest_c11_program +_ACEOF +for ac_arg in '' -std=gnu11 +do + CC="$ac_save_CC $ac_arg" + if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_prog_cc_c11=$ac_arg +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam + test "x$ac_cv_prog_cc_c11" != "xno" && break +done +rm -f conftest.$ac_ext +CC=$ac_save_CC +fi -/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters - inside strings and character constants. */ -#define FOO(x) 'x' -int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; +if test "x$ac_cv_prog_cc_c11" = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +printf "%s\n" "unsupported" >&6; } +else $as_nop + if test "x$ac_cv_prog_cc_c11" = x +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +printf "%s\n" "none needed" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c11" >&5 +printf "%s\n" "$ac_cv_prog_cc_c11" >&6; } + CC="$CC $ac_cv_prog_cc_c11" +fi + ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c11 + ac_prog_cc_stdc=c11 +fi +fi +if test x$ac_prog_cc_stdc = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C99 features" >&5 +printf %s "checking for $CC option to enable C99 features... " >&6; } +if test ${ac_cv_prog_cc_c99+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_cv_prog_cc_c99=no +ac_save_CC=$CC +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_c_conftest_c99_program +_ACEOF +for ac_arg in '' -std=gnu99 -std=c99 -c99 -qlanglvl=extc1x -qlanglvl=extc99 -AC99 -D_STDC_C99= +do + CC="$ac_save_CC $ac_arg" + if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_prog_cc_c99=$ac_arg +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam + test "x$ac_cv_prog_cc_c99" != "xno" && break +done +rm -f conftest.$ac_ext +CC=$ac_save_CC +fi -int test (int i, double x); -struct s1 {int (*f) (int a);}; -struct s2 {int (*f) (double a);}; -int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); -int argc; -char **argv; -int -main () -{ -return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; - ; - return 0; -} +if test "x$ac_cv_prog_cc_c99" = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +printf "%s\n" "unsupported" >&6; } +else $as_nop + if test "x$ac_cv_prog_cc_c99" = x +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +printf "%s\n" "none needed" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c99" >&5 +printf "%s\n" "$ac_cv_prog_cc_c99" >&6; } + CC="$CC $ac_cv_prog_cc_c99" +fi + ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c99 + ac_prog_cc_stdc=c99 +fi +fi +if test x$ac_prog_cc_stdc = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C89 features" >&5 +printf %s "checking for $CC option to enable C89 features... " >&6; } +if test ${ac_cv_prog_cc_c89+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_cv_prog_cc_c89=no +ac_save_CC=$CC +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_c_conftest_c89_program _ACEOF -for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ - -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" +for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" - if ac_fn_c_try_compile "$LINENO"; then : + if ac_fn_c_try_compile "$LINENO" +then : ac_cv_prog_cc_c89=$ac_arg fi -rm -f core conftest.err conftest.$ac_objext +rm -f core conftest.err conftest.$ac_objext conftest.beam test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC - fi -# AC_CACHE_VAL -case "x$ac_cv_prog_cc_c89" in - x) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 -$as_echo "none needed" >&6; } ;; - xno) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 -$as_echo "unsupported" >&6; } ;; - *) - CC="$CC $ac_cv_prog_cc_c89" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 -$as_echo "$ac_cv_prog_cc_c89" >&6; } ;; -esac -if test "x$ac_cv_prog_cc_c89" != xno; then : +if test "x$ac_cv_prog_cc_c89" = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +printf "%s\n" "unsupported" >&6; } +else $as_nop + if test "x$ac_cv_prog_cc_c89" = x +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +printf "%s\n" "none needed" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 +printf "%s\n" "$ac_cv_prog_cc_c89" >&6; } + CC="$CC $ac_cv_prog_cc_c89" +fi + ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c89 + ac_prog_cc_stdc=c89 +fi fi ac_ext=c @@ -3148,11 +3665,12 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU make" >&5 -$as_echo_n "checking for GNU make... " >&6; } -if ${ac_cv_GNU_MAKE+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for GNU make" >&5 +printf %s "checking for GNU make... " >&6; } +if test ${ac_cv_GNU_MAKE+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_cv_GNU_MAKE='Not Found' ; ac_cv_GNU_MAKE_VERSION_MAJOR=0 ; ac_cv_GNU_MAKE_VERSION_MINOR=0 ; @@ -3167,8 +3685,8 @@ done ; fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_GNU_MAKE" >&5 -$as_echo "$ac_cv_GNU_MAKE" >&6; } ; +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_GNU_MAKE" >&5 +printf "%s\n" "$ac_cv_GNU_MAKE" >&6; } ; if test "x$ac_cv_GNU_MAKE" = "xNot Found" ; then as_fn_error $? "*** Please install GNU make. It is required to build Asterisk!" "$LINENO" 5 exit 1 @@ -3178,444 +3696,207 @@ -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - -# Check whether --enable-debug was given. -if test "${enable_debug+set}" = set; then : - enableval=$enable_debug; case "${enableval}" in - y|ye|yes) MENUSELECT_DEBUG=yes ;; - n|no) MENUSELECT_DEBUG=no ;; - *) as_fn_error $? "bad value ${enableval} for --enable-debug" "$LINENO" 5 ;; - esac -fi - - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 -$as_echo_n "checking how to run the C preprocessor... " >&6; } -# On Suns, sometimes $CPP names a directory. -if test -n "$CPP" && test -d "$CPP"; then - CPP= -fi -if test -z "$CPP"; then - if ${ac_cv_prog_CPP+:} false; then : - $as_echo_n "(cached) " >&6 -else - # Double quotes because CPP needs to be expanded - for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" - do - ac_preproc_ok=false -for ac_c_preproc_warn_flag in '' yes -do - # Use a header file that comes with gcc, so configuring glibc - # with a fresh cross-compiler works. - # Prefer to if __STDC__ is defined, since - # exists even on freestanding compilers. - # On the NeXT, cc -E runs the code through the compiler's parser, - # not just through cpp. "Syntax error" is here to catch this case. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#ifdef __STDC__ -# include -#else -# include -#endif - Syntax error -_ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : - -else - # Broken: fails on valid input. -continue -fi -rm -f conftest.err conftest.i conftest.$ac_ext - # OK, works on sane cases. Now check whether nonexistent headers - # can be detected and how. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -_ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : - # Broken: success on invalid input. -continue -else - # Passes both tests. -ac_preproc_ok=: -break -fi -rm -f conftest.err conftest.i conftest.$ac_ext -done -# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.i conftest.err conftest.$ac_ext -if $ac_preproc_ok; then : - break -fi - done - ac_cv_prog_CPP=$CPP -fi - CPP=$ac_cv_prog_CPP -else - ac_cv_prog_CPP=$CPP -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 -$as_echo "$CPP" >&6; } -ac_preproc_ok=false -for ac_c_preproc_warn_flag in '' yes +if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args. +set dummy ${ac_tool_prefix}pkg-config; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_PKG_CONFIG+y} +then : + printf %s "(cached) " >&6 +else $as_nop + case $PKG_CONFIG in + [\\/]* | ?:[\\/]*) + ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH do - # Use a header file that comes with gcc, so configuring glibc - # with a fresh cross-compiler works. - # Prefer to if __STDC__ is defined, since - # exists even on freestanding compilers. - # On the NeXT, cc -E runs the code through the compiler's parser, - # not just through cpp. "Syntax error" is here to catch this case. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#ifdef __STDC__ -# include -#else -# include -#endif - Syntax error -_ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_PKG_CONFIG="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS -else - # Broken: fails on valid input. -continue + ;; +esac fi -rm -f conftest.err conftest.i conftest.$ac_ext - - # OK, works on sane cases. Now check whether nonexistent headers - # can be detected and how. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -_ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : - # Broken: success on invalid input. -continue +PKG_CONFIG=$ac_cv_path_PKG_CONFIG +if test -n "$PKG_CONFIG"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5 +printf "%s\n" "$PKG_CONFIG" >&6; } else - # Passes both tests. -ac_preproc_ok=: -break + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi -rm -f conftest.err conftest.i conftest.$ac_ext -done -# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.i conftest.err conftest.$ac_ext -if $ac_preproc_ok; then : -else - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "C preprocessor \"$CPP\" fails sanity check -See \`config.log' for more details" "$LINENO" 5; } fi - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 -$as_echo_n "checking for grep that handles long lines and -e... " >&6; } -if ${ac_cv_path_GREP+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -z "$GREP"; then - ac_path_GREP_found=false - # Loop through the user's path and test for each of PROGNAME-LIST +if test -z "$ac_cv_path_PKG_CONFIG"; then + ac_pt_PKG_CONFIG=$PKG_CONFIG + # Extract the first word of "pkg-config", so it can be a program name with args. +set dummy pkg-config; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_ac_pt_PKG_CONFIG+y} +then : + printf %s "(cached) " >&6 +else $as_nop + case $ac_pt_PKG_CONFIG in + [\\/]* | ?:[\\/]*) + ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path. + ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_prog in grep ggrep; do + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" - as_fn_executable_p "$ac_path_GREP" || continue -# Check for GNU ac_path_GREP and select it if it is found. - # Check for GNU $ac_path_GREP -case `"$ac_path_GREP" --version 2>&1` in -*GNU*) - ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; -*) - ac_count=0 - $as_echo_n 0123456789 >"conftest.in" - while : - do - cat "conftest.in" "conftest.in" >"conftest.tmp" - mv "conftest.tmp" "conftest.in" - cp "conftest.in" "conftest.nl" - $as_echo 'GREP' >> "conftest.nl" - "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break - diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break - as_fn_arith $ac_count + 1 && ac_count=$as_val - if test $ac_count -gt ${ac_path_GREP_max-0}; then - # Best one so far, save it but keep looking for a better one - ac_cv_path_GREP="$ac_path_GREP" - ac_path_GREP_max=$ac_count - fi - # 10*(2^10) chars as input seems more than enough - test $ac_count -gt 10 && break - done - rm -f conftest.in conftest.tmp conftest.nl conftest.out;; -esac - - $ac_path_GREP_found && break 3 - done - done + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_ac_pt_PKG_CONFIG="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done done IFS=$as_save_IFS - if test -z "$ac_cv_path_GREP"; then - as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 - fi -else - ac_cv_path_GREP=$GREP -fi + ;; +esac fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 -$as_echo "$ac_cv_path_GREP" >&6; } - GREP="$ac_cv_path_GREP" - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 -$as_echo_n "checking for egrep... " >&6; } -if ${ac_cv_path_EGREP+:} false; then : - $as_echo_n "(cached) " >&6 +ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG +if test -n "$ac_pt_PKG_CONFIG"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5 +printf "%s\n" "$ac_pt_PKG_CONFIG" >&6; } else - if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 - then ac_cv_path_EGREP="$GREP -E" - else - if test -z "$EGREP"; then - ac_path_EGREP_found=false - # Loop through the user's path and test for each of PROGNAME-LIST - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_prog in egrep; do - for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" - as_fn_executable_p "$ac_path_EGREP" || continue -# Check for GNU ac_path_EGREP and select it if it is found. - # Check for GNU $ac_path_EGREP -case `"$ac_path_EGREP" --version 2>&1` in -*GNU*) - ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; -*) - ac_count=0 - $as_echo_n 0123456789 >"conftest.in" - while : - do - cat "conftest.in" "conftest.in" >"conftest.tmp" - mv "conftest.tmp" "conftest.in" - cp "conftest.in" "conftest.nl" - $as_echo 'EGREP' >> "conftest.nl" - "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break - diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break - as_fn_arith $ac_count + 1 && ac_count=$as_val - if test $ac_count -gt ${ac_path_EGREP_max-0}; then - # Best one so far, save it but keep looking for a better one - ac_cv_path_EGREP="$ac_path_EGREP" - ac_path_EGREP_max=$ac_count - fi - # 10*(2^10) chars as input seems more than enough - test $ac_count -gt 10 && break - done - rm -f conftest.in conftest.tmp conftest.nl conftest.out;; -esac + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi - $ac_path_EGREP_found && break 3 - done - done - done -IFS=$as_save_IFS - if test -z "$ac_cv_path_EGREP"; then - as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + if test "x$ac_pt_PKG_CONFIG" = x; then + PKG_CONFIG="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + PKG_CONFIG=$ac_pt_PKG_CONFIG fi else - ac_cv_path_EGREP=$EGREP + PKG_CONFIG="$ac_cv_path_PKG_CONFIG" fi - fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 -$as_echo "$ac_cv_path_EGREP" >&6; } - EGREP="$ac_cv_path_EGREP" - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 -$as_echo_n "checking for ANSI C header files... " >&6; } -if ${ac_cv_header_stdc+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -#include -#include -#include - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_header_stdc=yes -else - ac_cv_header_stdc=no +if test -n "$PKG_CONFIG"; then + _pkg_min_version=0.9.0 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking pkg-config is at least version $_pkg_min_version" >&5 +printf %s "checking pkg-config is at least version $_pkg_min_version... " >&6; } + if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + PKG_CONFIG="" + fi fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - -if test $ac_cv_header_stdc = yes; then - # SunOS 4.x string.h does not declare mem*, contrary to ANSI. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "memchr" >/dev/null 2>&1; then : -else - ac_cv_header_stdc=no -fi -rm -f conftest* +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +# Check whether --enable-debug was given. +if test ${enable_debug+y} +then : + enableval=$enable_debug; case "${enableval}" in + y|ye|yes) MENUSELECT_DEBUG=yes ;; + n|no) MENUSELECT_DEBUG=no ;; + *) as_fn_error $? "bad value ${enableval} for --enable-debug" "$LINENO" 5 ;; + esac fi -if test $ac_cv_header_stdc = yes; then - # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "free" >/dev/null 2>&1; then : -else - ac_cv_header_stdc=no -fi -rm -f conftest* -fi - -if test $ac_cv_header_stdc = yes; then - # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. - if test "$cross_compiling" = yes; then : - : -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -#include -#if ((' ' & 0x0FF) == 0x020) -# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') -# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) -#else -# define ISLOWER(c) \ - (('a' <= (c) && (c) <= 'i') \ - || ('j' <= (c) && (c) <= 'r') \ - || ('s' <= (c) && (c) <= 'z')) -# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) -#endif +ac_header= ac_cache= +for ac_item in $ac_header_c_list +do + if test $ac_cache; then + ac_fn_c_check_header_compile "$LINENO" $ac_header ac_cv_header_$ac_cache "$ac_includes_default" + if eval test \"x\$ac_cv_header_$ac_cache\" = xyes; then + printf "%s\n" "#define $ac_item 1" >> confdefs.h + fi + ac_header= ac_cache= + elif test $ac_header; then + ac_cache=$ac_item + else + ac_header=$ac_item + fi +done -#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) -int -main () -{ - int i; - for (i = 0; i < 256; i++) - if (XOR (islower (i), ISLOWER (i)) - || toupper (i) != TOUPPER (i)) - return 2; - return 0; -} -_ACEOF -if ac_fn_c_try_run "$LINENO"; then : -else - ac_cv_header_stdc=no -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext -fi -fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 -$as_echo "$ac_cv_header_stdc" >&6; } -if test $ac_cv_header_stdc = yes; then -$as_echo "#define STDC_HEADERS 1" >>confdefs.h -fi -# On IRIX 5.3, sys/types and inttypes.h are conflicting. -for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ - inttypes.h stdint.h unistd.h -do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default -" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF -fi -done +if test $ac_cv_header_stdlib_h = yes && test $ac_cv_header_string_h = yes +then : +printf "%s\n" "#define STDC_HEADERS 1" >>confdefs.h +fi ac_fn_c_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default" -if test "x$ac_cv_type_size_t" = xyes; then : +if test "x$ac_cv_type_size_t" = xyes +then : -else +else $as_nop -cat >>confdefs.h <<_ACEOF -#define size_t unsigned int -_ACEOF +printf "%s\n" "#define size_t unsigned int" >>confdefs.h fi # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works # for constant arguments. Useless! -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for working alloca.h" >&5 -$as_echo_n "checking for working alloca.h... " >&6; } -if ${ac_cv_working_alloca_h+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for working alloca.h" >&5 +printf %s "checking for working alloca.h... " >&6; } +if test ${ac_cv_working_alloca_h+y} +then : + printf %s "(cached) " >&6 +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int -main () +main (void) { char *p = (char *) alloca (2 * sizeof (int)); if (p) return 0; @@ -3623,52 +3904,52 @@ return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_working_alloca_h=yes -else +else $as_nop ac_cv_working_alloca_h=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_working_alloca_h" >&5 -$as_echo "$ac_cv_working_alloca_h" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_working_alloca_h" >&5 +printf "%s\n" "$ac_cv_working_alloca_h" >&6; } if test $ac_cv_working_alloca_h = yes; then -$as_echo "#define HAVE_ALLOCA_H 1" >>confdefs.h +printf "%s\n" "#define HAVE_ALLOCA_H 1" >>confdefs.h fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for alloca" >&5 -$as_echo_n "checking for alloca... " >&6; } -if ${ac_cv_func_alloca_works+:} false; then : - $as_echo_n "(cached) " >&6 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for alloca" >&5 +printf %s "checking for alloca... " >&6; } +if test ${ac_cv_func_alloca_works+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test $ac_cv_working_alloca_h = yes; then + ac_cv_func_alloca_works=yes else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#ifdef __GNUC__ -# define alloca __builtin_alloca -#else -# ifdef _MSC_VER +#include +#include +#ifndef alloca +# ifdef __GNUC__ +# define alloca __builtin_alloca +# elif defined _MSC_VER # include # define alloca _alloca # else -# ifdef HAVE_ALLOCA_H -# include -# else -# ifdef _AIX - #pragma alloca -# else -# ifndef alloca /* predefined by HP cc +Olibcalls */ -void *alloca (size_t); -# endif -# endif +# ifdef __cplusplus +extern "C" # endif +void *alloca (size_t); # endif #endif int -main () +main (void) { char *p = (char *) alloca (1); if (p) return 0; @@ -3676,20 +3957,22 @@ return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_func_alloca_works=yes -else +else $as_nop ac_cv_func_alloca_works=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_alloca_works" >&5 -$as_echo "$ac_cv_func_alloca_works" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_alloca_works" >&5 +printf "%s\n" "$ac_cv_func_alloca_works" >&6; } +fi if test $ac_cv_func_alloca_works = yes; then -$as_echo "#define HAVE_ALLOCA 1" >>confdefs.h +printf "%s\n" "#define HAVE_ALLOCA 1" >>confdefs.h else # The SVR3 libPW and SVR4 libucb both contain incompatible functions @@ -3699,58 +3982,19 @@ ALLOCA=\${LIBOBJDIR}alloca.$ac_objext -$as_echo "#define C_ALLOCA 1" >>confdefs.h - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether \`alloca.c' needs Cray hooks" >&5 -$as_echo_n "checking whether \`alloca.c' needs Cray hooks... " >&6; } -if ${ac_cv_os_cray+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#if defined CRAY && ! defined CRAY2 -webecray -#else -wenotbecray -#endif - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "webecray" >/dev/null 2>&1; then : - ac_cv_os_cray=yes -else - ac_cv_os_cray=no -fi -rm -f conftest* - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_os_cray" >&5 -$as_echo "$ac_cv_os_cray" >&6; } -if test $ac_cv_os_cray = yes; then - for ac_func in _getb67 GETB67 getb67; do - as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" -if eval test \"x\$"$as_ac_var"\" = x"yes"; then : - -cat >>confdefs.h <<_ACEOF -#define CRAY_STACKSEG_END $ac_func -_ACEOF +printf "%s\n" "#define C_ALLOCA 1" >>confdefs.h - break -fi - done -fi - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking stack direction for C alloca" >&5 -$as_echo_n "checking stack direction for C alloca... " >&6; } -if ${ac_cv_c_stack_direction+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test "$cross_compiling" = yes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking stack direction for C alloca" >&5 +printf %s "checking stack direction for C alloca... " >&6; } +if test ${ac_cv_c_stack_direction+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test "$cross_compiling" = yes +then : ac_cv_c_stack_direction=0 -else +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default @@ -3771,36 +4015,78 @@ return find_stack_direction (0, argc + !argv + 20) < 0; } _ACEOF -if ac_fn_c_try_run "$LINENO"; then : +if ac_fn_c_try_run "$LINENO" +then : ac_cv_c_stack_direction=1 -else +else $as_nop ac_cv_c_stack_direction=-1 fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_stack_direction" >&5 +printf "%s\n" "$ac_cv_c_stack_direction" >&6; } +printf "%s\n" "#define STACK_DIRECTION $ac_cv_c_stack_direction" >>confdefs.h + + +fi + +ac_fn_c_check_func "$LINENO" "asprintf" "ac_cv_func_asprintf" +if test "x$ac_cv_func_asprintf" = xyes +then : + printf "%s\n" "#define HAVE_ASPRINTF 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "getloadavg" "ac_cv_func_getloadavg" +if test "x$ac_cv_func_getloadavg" = xyes +then : + printf "%s\n" "#define HAVE_GETLOADAVG 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "setenv" "ac_cv_func_setenv" +if test "x$ac_cv_func_setenv" = xyes +then : + printf "%s\n" "#define HAVE_SETENV 1" >>confdefs.h + fi +ac_fn_c_check_func "$LINENO" "strcasestr" "ac_cv_func_strcasestr" +if test "x$ac_cv_func_strcasestr" = xyes +then : + printf "%s\n" "#define HAVE_STRCASESTR 1" >>confdefs.h fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_stack_direction" >&5 -$as_echo "$ac_cv_c_stack_direction" >&6; } -cat >>confdefs.h <<_ACEOF -#define STACK_DIRECTION $ac_cv_c_stack_direction -_ACEOF +ac_fn_c_check_func "$LINENO" "strndup" "ac_cv_func_strndup" +if test "x$ac_cv_func_strndup" = xyes +then : + printf "%s\n" "#define HAVE_STRNDUP 1" >>confdefs.h +fi +ac_fn_c_check_func "$LINENO" "strnlen" "ac_cv_func_strnlen" +if test "x$ac_cv_func_strnlen" = xyes +then : + printf "%s\n" "#define HAVE_STRNLEN 1" >>confdefs.h fi +ac_fn_c_check_func "$LINENO" "strsep" "ac_cv_func_strsep" +if test "x$ac_cv_func_strsep" = xyes +then : + printf "%s\n" "#define HAVE_STRSEP 1" >>confdefs.h -for ac_func in asprintf getloadavg setenv strcasestr strndup strnlen strsep unsetenv vasprintf -do : - as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" -if eval test \"x\$"$as_ac_var"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF +fi +ac_fn_c_check_func "$LINENO" "unsetenv" "ac_cv_func_unsetenv" +if test "x$ac_cv_func_unsetenv" = xyes +then : + printf "%s\n" "#define HAVE_UNSETENV 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "vasprintf" "ac_cv_func_vasprintf" +if test "x$ac_cv_func_vasprintf" = xyes +then : + printf "%s\n" "#define HAVE_VASPRINTF 1" >>confdefs.h fi -done # The frontend can use curses, ncurses, newt or GTK2 so check for all of them @@ -3811,7 +4097,8 @@ PBX_NEWT=0 # Check whether --with-newt was given. -if test "${with_newt+set}" = set; then : +if test ${with_newt+y} +then : withval=$with_newt; case ${withval} in n|no) @@ -3843,7 +4130,8 @@ PBX_CURSES=0 # Check whether --with-curses was given. -if test "${with_curses+set}" = set; then : +if test ${with_curses+y} +then : withval=$with_curses; case ${withval} in n|no) @@ -3875,7 +4163,8 @@ PBX_NCURSES=0 # Check whether --with-ncurses was given. -if test "${with_ncurses+set}" = set; then : +if test ${with_ncurses+y} +then : withval=$with_ncurses; case ${withval} in n|no) @@ -3907,7 +4196,8 @@ PBX_LIBXML2=0 # Check whether --with-libxml2 was given. -if test "${with_libxml2+set}" = set; then : +if test ${with_libxml2+y} +then : withval=$with_libxml2; case ${withval} in n|no) @@ -3939,7 +4229,8 @@ PBX_TINFO=0 # Check whether --with-libtinfo was given. -if test "${with_libtinfo+set}" = set; then : +if test ${with_libtinfo+y} +then : withval=$with_libtinfo; case ${withval} in n|no) @@ -3980,11 +4271,12 @@ ast_ext_lib_check_save_CFLAGS="${CFLAGS}" CFLAGS="${CFLAGS} " - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for newtBell in -lnewt" >&5 -$as_echo_n "checking for newtBell in -lnewt... " >&6; } -if ${ac_cv_lib_newt_newtBell+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for newtBell in -lnewt" >&5 +printf %s "checking for newtBell in -lnewt... " >&6; } +if test ${ac_cv_lib_newt_newtBell+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lnewt ${pbxlibdir} $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -3993,32 +4285,31 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char newtBell (); int -main () +main (void) { return newtBell (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_newt_newtBell=yes -else +else $as_nop ac_cv_lib_newt_newtBell=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_newt_newtBell" >&5 -$as_echo "$ac_cv_lib_newt_newtBell" >&6; } -if test "x$ac_cv_lib_newt_newtBell" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_newt_newtBell" >&5 +printf "%s\n" "$ac_cv_lib_newt_newtBell" >&6; } +if test "x$ac_cv_lib_newt_newtBell" = xyes +then : AST_NEWT_FOUND=yes -else +else $as_nop AST_NEWT_FOUND=no fi @@ -4037,14 +4328,14 @@ # check for the header ast_ext_lib_check_saved_CPPFLAGS="${CPPFLAGS}" CPPFLAGS="${CPPFLAGS} ${NEWT_INCLUDE}" - ac_fn_c_check_header_mongrel "$LINENO" "newt.h" "ac_cv_header_newt_h" "$ac_includes_default" -if test "x$ac_cv_header_newt_h" = xyes; then : + ac_fn_c_check_header_compile "$LINENO" "newt.h" "ac_cv_header_newt_h" "$ac_includes_default" +if test "x$ac_cv_header_newt_h" = xyes +then : NEWT_HEADER_FOUND=1 -else +else $as_nop NEWT_HEADER_FOUND=0 fi - CPPFLAGS="${ast_ext_lib_check_saved_CPPFLAGS}" if test "x${NEWT_HEADER_FOUND}" = "x0" ; then @@ -4076,11 +4367,12 @@ ast_ext_lib_check_save_CFLAGS="${CFLAGS}" CFLAGS="${CFLAGS} " - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for initscr in -lncurses" >&5 -$as_echo_n "checking for initscr in -lncurses... " >&6; } -if ${ac_cv_lib_ncurses_initscr+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for initscr in -lncurses" >&5 +printf %s "checking for initscr in -lncurses... " >&6; } +if test ${ac_cv_lib_ncurses_initscr+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lncurses ${pbxlibdir} $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -4089,32 +4381,31 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char initscr (); int -main () +main (void) { return initscr (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_ncurses_initscr=yes -else +else $as_nop ac_cv_lib_ncurses_initscr=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ncurses_initscr" >&5 -$as_echo "$ac_cv_lib_ncurses_initscr" >&6; } -if test "x$ac_cv_lib_ncurses_initscr" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ncurses_initscr" >&5 +printf "%s\n" "$ac_cv_lib_ncurses_initscr" >&6; } +if test "x$ac_cv_lib_ncurses_initscr" = xyes +then : AST_NCURSES_FOUND=yes -else +else $as_nop AST_NCURSES_FOUND=no fi @@ -4133,14 +4424,14 @@ # check for the header ast_ext_lib_check_saved_CPPFLAGS="${CPPFLAGS}" CPPFLAGS="${CPPFLAGS} ${NCURSES_INCLUDE}" - ac_fn_c_check_header_mongrel "$LINENO" "ncurses.h" "ac_cv_header_ncurses_h" "$ac_includes_default" -if test "x$ac_cv_header_ncurses_h" = xyes; then : + ac_fn_c_check_header_compile "$LINENO" "ncurses.h" "ac_cv_header_ncurses_h" "$ac_includes_default" +if test "x$ac_cv_header_ncurses_h" = xyes +then : NCURSES_HEADER_FOUND=1 -else +else $as_nop NCURSES_HEADER_FOUND=0 fi - CPPFLAGS="${ast_ext_lib_check_saved_CPPFLAGS}" if test "x${NCURSES_HEADER_FOUND}" = "x0" ; then @@ -4174,11 +4465,12 @@ ast_ext_lib_check_save_CFLAGS="${CFLAGS}" CFLAGS="${CFLAGS} " - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for initscr in -lncurses" >&5 -$as_echo_n "checking for initscr in -lncurses... " >&6; } -if ${ac_cv_lib_ncurses_initscr+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for initscr in -lncurses" >&5 +printf %s "checking for initscr in -lncurses... " >&6; } +if test ${ac_cv_lib_ncurses_initscr+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lncurses ${pbxlibdir} $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -4187,32 +4479,31 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char initscr (); int -main () +main (void) { return initscr (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_ncurses_initscr=yes -else +else $as_nop ac_cv_lib_ncurses_initscr=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ncurses_initscr" >&5 -$as_echo "$ac_cv_lib_ncurses_initscr" >&6; } -if test "x$ac_cv_lib_ncurses_initscr" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ncurses_initscr" >&5 +printf "%s\n" "$ac_cv_lib_ncurses_initscr" >&6; } +if test "x$ac_cv_lib_ncurses_initscr" = xyes +then : AST_NCURSES_FOUND=yes -else +else $as_nop AST_NCURSES_FOUND=no fi @@ -4231,14 +4522,14 @@ # check for the header ast_ext_lib_check_saved_CPPFLAGS="${CPPFLAGS}" CPPFLAGS="${CPPFLAGS} ${NCURSES_INCLUDE}" - ac_fn_c_check_header_mongrel "$LINENO" "ncurses/ncurses.h" "ac_cv_header_ncurses_ncurses_h" "$ac_includes_default" -if test "x$ac_cv_header_ncurses_ncurses_h" = xyes; then : + ac_fn_c_check_header_compile "$LINENO" "ncurses/ncurses.h" "ac_cv_header_ncurses_ncurses_h" "$ac_includes_default" +if test "x$ac_cv_header_ncurses_ncurses_h" = xyes +then : NCURSES_HEADER_FOUND=1 -else +else $as_nop NCURSES_HEADER_FOUND=0 fi - CPPFLAGS="${ast_ext_lib_check_saved_CPPFLAGS}" if test "x${NCURSES_HEADER_FOUND}" = "x0" ; then @@ -4271,11 +4562,12 @@ ast_ext_lib_check_save_CFLAGS="${CFLAGS}" CFLAGS="${CFLAGS} " - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for initscr in -lcurses" >&5 -$as_echo_n "checking for initscr in -lcurses... " >&6; } -if ${ac_cv_lib_curses_initscr+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for initscr in -lcurses" >&5 +printf %s "checking for initscr in -lcurses... " >&6; } +if test ${ac_cv_lib_curses_initscr+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcurses ${pbxlibdir} $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -4284,32 +4576,31 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char initscr (); int -main () +main (void) { return initscr (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_curses_initscr=yes -else +else $as_nop ac_cv_lib_curses_initscr=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_curses_initscr" >&5 -$as_echo "$ac_cv_lib_curses_initscr" >&6; } -if test "x$ac_cv_lib_curses_initscr" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_curses_initscr" >&5 +printf "%s\n" "$ac_cv_lib_curses_initscr" >&6; } +if test "x$ac_cv_lib_curses_initscr" = xyes +then : AST_CURSES_FOUND=yes -else +else $as_nop AST_CURSES_FOUND=no fi @@ -4328,14 +4619,14 @@ # check for the header ast_ext_lib_check_saved_CPPFLAGS="${CPPFLAGS}" CPPFLAGS="${CPPFLAGS} ${CURSES_INCLUDE}" - ac_fn_c_check_header_mongrel "$LINENO" "curses.h" "ac_cv_header_curses_h" "$ac_includes_default" -if test "x$ac_cv_header_curses_h" = xyes; then : + ac_fn_c_check_header_compile "$LINENO" "curses.h" "ac_cv_header_curses_h" "$ac_includes_default" +if test "x$ac_cv_header_curses_h" = xyes +then : CURSES_HEADER_FOUND=1 -else +else $as_nop CURSES_HEADER_FOUND=0 fi - CPPFLAGS="${ast_ext_lib_check_saved_CPPFLAGS}" if test "x${CURSES_HEADER_FOUND}" = "x0" ; then @@ -4375,11 +4666,12 @@ ast_ext_lib_check_save_CFLAGS="${CFLAGS}" CFLAGS="${CFLAGS} " - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for keypad in -ltinfo" >&5 -$as_echo_n "checking for keypad in -ltinfo... " >&6; } -if ${ac_cv_lib_tinfo_keypad+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for keypad in -ltinfo" >&5 +printf %s "checking for keypad in -ltinfo... " >&6; } +if test ${ac_cv_lib_tinfo_keypad+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-ltinfo ${pbxlibdir} $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -4388,32 +4680,31 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char keypad (); int -main () +main (void) { return keypad (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_tinfo_keypad=yes -else +else $as_nop ac_cv_lib_tinfo_keypad=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_tinfo_keypad" >&5 -$as_echo "$ac_cv_lib_tinfo_keypad" >&6; } -if test "x$ac_cv_lib_tinfo_keypad" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_tinfo_keypad" >&5 +printf "%s\n" "$ac_cv_lib_tinfo_keypad" >&6; } +if test "x$ac_cv_lib_tinfo_keypad" = xyes +then : AST_TINFO_FOUND=yes -else +else $as_nop AST_TINFO_FOUND=no fi @@ -4432,14 +4723,14 @@ # check for the header ast_ext_lib_check_saved_CPPFLAGS="${CPPFLAGS}" CPPFLAGS="${CPPFLAGS} ${TINFO_INCLUDE}" - ac_fn_c_check_header_mongrel "$LINENO" "ncurses/ncurses.h" "ac_cv_header_ncurses_ncurses_h" "$ac_includes_default" -if test "x$ac_cv_header_ncurses_ncurses_h" = xyes; then : + ac_fn_c_check_header_compile "$LINENO" "ncurses/ncurses.h" "ac_cv_header_ncurses_ncurses_h" "$ac_includes_default" +if test "x$ac_cv_header_ncurses_ncurses_h" = xyes +then : TINFO_HEADER_FOUND=1 -else +else $as_nop TINFO_HEADER_FOUND=0 fi - CPPFLAGS="${ast_ext_lib_check_saved_CPPFLAGS}" if test "x${TINFO_HEADER_FOUND}" = "x0" ; then @@ -4472,11 +4763,12 @@ ast_ext_lib_check_save_CFLAGS="${CFLAGS}" CFLAGS="${CFLAGS} " - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for keypad in -ltinfo" >&5 -$as_echo_n "checking for keypad in -ltinfo... " >&6; } -if ${ac_cv_lib_tinfo_keypad+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for keypad in -ltinfo" >&5 +printf %s "checking for keypad in -ltinfo... " >&6; } +if test ${ac_cv_lib_tinfo_keypad+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-ltinfo ${pbxlibdir} $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -4485,32 +4777,31 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char keypad (); int -main () +main (void) { return keypad (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_tinfo_keypad=yes -else +else $as_nop ac_cv_lib_tinfo_keypad=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_tinfo_keypad" >&5 -$as_echo "$ac_cv_lib_tinfo_keypad" >&6; } -if test "x$ac_cv_lib_tinfo_keypad" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_tinfo_keypad" >&5 +printf "%s\n" "$ac_cv_lib_tinfo_keypad" >&6; } +if test "x$ac_cv_lib_tinfo_keypad" = xyes +then : AST_TINFO_FOUND=yes -else +else $as_nop AST_TINFO_FOUND=no fi @@ -4529,14 +4820,14 @@ # check for the header ast_ext_lib_check_saved_CPPFLAGS="${CPPFLAGS}" CPPFLAGS="${CPPFLAGS} ${TINFO_INCLUDE}" - ac_fn_c_check_header_mongrel "$LINENO" "ncurses.h" "ac_cv_header_ncurses_h" "$ac_includes_default" -if test "x$ac_cv_header_ncurses_h" = xyes; then : + ac_fn_c_check_header_compile "$LINENO" "ncurses.h" "ac_cv_header_ncurses_h" "$ac_includes_default" +if test "x$ac_cv_header_ncurses_h" = xyes +then : TINFO_HEADER_FOUND=1 -else +else $as_nop TINFO_HEADER_FOUND=0 fi - CPPFLAGS="${ast_ext_lib_check_saved_CPPFLAGS}" if test "x${TINFO_HEADER_FOUND}" = "x0" ; then @@ -4570,11 +4861,12 @@ ast_ext_lib_check_save_CFLAGS="${CFLAGS}" CFLAGS="${CFLAGS} " - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for keypad in -ltinfo" >&5 -$as_echo_n "checking for keypad in -ltinfo... " >&6; } -if ${ac_cv_lib_tinfo_keypad+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for keypad in -ltinfo" >&5 +printf %s "checking for keypad in -ltinfo... " >&6; } +if test ${ac_cv_lib_tinfo_keypad+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-ltinfo ${pbxlibdir} $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -4583,32 +4875,31 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char keypad (); int -main () +main (void) { return keypad (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_tinfo_keypad=yes -else +else $as_nop ac_cv_lib_tinfo_keypad=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_tinfo_keypad" >&5 -$as_echo "$ac_cv_lib_tinfo_keypad" >&6; } -if test "x$ac_cv_lib_tinfo_keypad" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_tinfo_keypad" >&5 +printf "%s\n" "$ac_cv_lib_tinfo_keypad" >&6; } +if test "x$ac_cv_lib_tinfo_keypad" = xyes +then : AST_TINFO_FOUND=yes -else +else $as_nop AST_TINFO_FOUND=no fi @@ -4627,14 +4918,14 @@ # check for the header ast_ext_lib_check_saved_CPPFLAGS="${CPPFLAGS}" CPPFLAGS="${CPPFLAGS} ${TINFO_INCLUDE}" - ac_fn_c_check_header_mongrel "$LINENO" "curses.h" "ac_cv_header_curses_h" "$ac_includes_default" -if test "x$ac_cv_header_curses_h" = xyes; then : + ac_fn_c_check_header_compile "$LINENO" "curses.h" "ac_cv_header_curses_h" "$ac_includes_default" +if test "x$ac_cv_header_curses_h" = xyes +then : TINFO_HEADER_FOUND=1 -else +else $as_nop TINFO_HEADER_FOUND=0 fi - CPPFLAGS="${ast_ext_lib_check_saved_CPPFLAGS}" if test "x${TINFO_HEADER_FOUND}" = "x0" ; then @@ -4654,11 +4945,100 @@ fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5 -$as_echo_n "checking for a sed that does not truncate output... " >&6; } -if ${ac_cv_path_SED+:} false; then : - $as_echo_n "(cached) " >&6 + + if test "x${PBX_LIBXML2}" != "x1" -a "${USE_LIBXML2}" != "no"; then + +pkg_failed=no +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libxml-2.0" >&5 +printf %s "checking for libxml-2.0... " >&6; } + +if test -n "$LIBXML2_CFLAGS"; then + pkg_cv_LIBXML2_CFLAGS="$LIBXML2_CFLAGS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libxml-2.0\""; } >&5 + ($PKG_CONFIG --exists --print-errors "libxml-2.0") 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_LIBXML2_CFLAGS=`$PKG_CONFIG --cflags "libxml-2.0" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi +if test -n "$LIBXML2_LIBS"; then + pkg_cv_LIBXML2_LIBS="$LIBXML2_LIBS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libxml-2.0\""; } >&5 + ($PKG_CONFIG --exists --print-errors "libxml-2.0") 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_LIBXML2_LIBS=`$PKG_CONFIG --libs "libxml-2.0" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi + + + +if test $pkg_failed = yes; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then + _pkg_short_errors_supported=yes +else + _pkg_short_errors_supported=no +fi + if test $_pkg_short_errors_supported = yes; then + LIBXML2_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libxml-2.0" 2>&1` + else + LIBXML2_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libxml-2.0" 2>&1` + fi + # Put the nasty error message in config.log where it belongs + echo "$LIBXML2_PKG_ERRORS" >&5 + + + PBX_LIBXML2=0 + + +elif test $pkg_failed = untried; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + + PBX_LIBXML2=0 + + else + LIBXML2_CFLAGS=$pkg_cv_LIBXML2_CFLAGS + LIBXML2_LIBS=$pkg_cv_LIBXML2_LIBS + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + + PBX_LIBXML2=1 + LIBXML2_INCLUDE=$(echo ${LIBXML2_CFLAGS} | $SED -e "s|-std=c99||g") + LIBXML2_LIB="$LIBXML2_LIBS" + +printf "%s\n" "#define HAVE_LIBXML2 1" >>confdefs.h + + +fi + fi + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5 +printf %s "checking for a sed that does not truncate output... " >&6; } +if test ${ac_cv_path_SED+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ for ac_i in 1 2 3 4 5 6 7; do ac_script="$ac_script$as_nl$ac_script" @@ -4672,10 +5052,15 @@ for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_prog in sed gsed; do + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_prog in sed gsed + do for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_SED="$as_dir/$ac_prog$ac_exec_ext" + ac_path_SED="$as_dir$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_SED" || continue # Check for GNU ac_path_SED and select it if it is found. # Check for GNU $ac_path_SED @@ -4684,13 +5069,13 @@ ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;; *) ac_count=0 - $as_echo_n 0123456789 >"conftest.in" + printf %s 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" - $as_echo '' >> "conftest.nl" + printf "%s\n" '' >> "conftest.nl" "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val @@ -4718,8 +5103,8 @@ fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5 -$as_echo "$ac_cv_path_SED" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5 +printf "%s\n" "$ac_cv_path_SED" >&6; } SED="$ac_cv_path_SED" rm -f conftest.sed @@ -4729,11 +5114,12 @@ if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}xml2-config", so it can be a program name with args. set dummy ${ac_tool_prefix}xml2-config; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_CONFIG_LIBXML2+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_CONFIG_LIBXML2+y} +then : + printf %s "(cached) " >&6 +else $as_nop case $CONFIG_LIBXML2 in [\\/]* | ?:[\\/]*) ac_cv_path_CONFIG_LIBXML2="$CONFIG_LIBXML2" # Let the user override the test with a path. @@ -4744,11 +5130,15 @@ for as_dir in $as_dummy do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_CONFIG_LIBXML2="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_CONFIG_LIBXML2="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -4760,11 +5150,11 @@ fi CONFIG_LIBXML2=$ac_cv_path_CONFIG_LIBXML2 if test -n "$CONFIG_LIBXML2"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CONFIG_LIBXML2" >&5 -$as_echo "$CONFIG_LIBXML2" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CONFIG_LIBXML2" >&5 +printf "%s\n" "$CONFIG_LIBXML2" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -4773,11 +5163,12 @@ ac_pt_CONFIG_LIBXML2=$CONFIG_LIBXML2 # Extract the first word of "xml2-config", so it can be a program name with args. set dummy xml2-config; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_ac_pt_CONFIG_LIBXML2+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_ac_pt_CONFIG_LIBXML2+y} +then : + printf %s "(cached) " >&6 +else $as_nop case $ac_pt_CONFIG_LIBXML2 in [\\/]* | ?:[\\/]*) ac_cv_path_ac_pt_CONFIG_LIBXML2="$ac_pt_CONFIG_LIBXML2" # Let the user override the test with a path. @@ -4788,11 +5179,15 @@ for as_dir in $as_dummy do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_ac_pt_CONFIG_LIBXML2="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_ac_pt_CONFIG_LIBXML2="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -4804,11 +5199,11 @@ fi ac_pt_CONFIG_LIBXML2=$ac_cv_path_ac_pt_CONFIG_LIBXML2 if test -n "$ac_pt_CONFIG_LIBXML2"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_CONFIG_LIBXML2" >&5 -$as_echo "$ac_pt_CONFIG_LIBXML2" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_pt_CONFIG_LIBXML2" >&5 +printf "%s\n" "$ac_pt_CONFIG_LIBXML2" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi if test "x$ac_pt_CONFIG_LIBXML2" = x; then @@ -4816,8 +5211,8 @@ else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CONFIG_LIBXML2=$ac_pt_CONFIG_LIBXML2 @@ -4845,19 +5240,20 @@ #include #include int -main () +main (void) { LIBXML_TEST_VERSION; ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : PBX_LIBXML2=1 -$as_echo "#define HAVE_LIBXML2 1" >>confdefs.h +printf "%s\n" "#define HAVE_LIBXML2 1" >>confdefs.h fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext CPPFLAGS="${saved_cppflags}" LIBS="${saved_libs}" @@ -4871,140 +5267,20 @@ fi - - - - - - -if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args. -set dummy ${ac_tool_prefix}pkg-config; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_PKG_CONFIG+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $PKG_CONFIG in - [\\/]* | ?:[\\/]*) - ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -PKG_CONFIG=$ac_cv_path_PKG_CONFIG -if test -n "$PKG_CONFIG"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5 -$as_echo "$PKG_CONFIG" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -fi -if test -z "$ac_cv_path_PKG_CONFIG"; then - ac_pt_PKG_CONFIG=$PKG_CONFIG - # Extract the first word of "pkg-config", so it can be a program name with args. -set dummy pkg-config; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_ac_pt_PKG_CONFIG+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $ac_pt_PKG_CONFIG in - [\\/]* | ?:[\\/]*) - ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG -if test -n "$ac_pt_PKG_CONFIG"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5 -$as_echo "$ac_pt_PKG_CONFIG" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - if test "x$ac_pt_PKG_CONFIG" = x; then - PKG_CONFIG="" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - PKG_CONFIG=$ac_pt_PKG_CONFIG - fi -else - PKG_CONFIG="$ac_cv_path_PKG_CONFIG" -fi - -fi -if test -n "$PKG_CONFIG"; then - _pkg_min_version=0.9.0 - { $as_echo "$as_me:${as_lineno-$LINENO}: checking pkg-config is at least version $_pkg_min_version" >&5 -$as_echo_n "checking pkg-config is at least version $_pkg_min_version... " >&6; } - if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - PKG_CONFIG="" - fi -fi - if test "x${PBX_GTK2}" != "x1" -a "${USE_GTK2}" != "no"; then pkg_failed=no -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for GTK2" >&5 -$as_echo_n "checking for GTK2... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for gtk+-2.0" >&5 +printf %s "checking for gtk+-2.0... " >&6; } if test -n "$GTK2_CFLAGS"; then pkg_cv_GTK2_CFLAGS="$GTK2_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gtk+-2.0\""; } >&5 + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gtk+-2.0\""; } >&5 ($PKG_CONFIG --exists --print-errors "gtk+-2.0") 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_GTK2_CFLAGS=`$PKG_CONFIG --cflags "gtk+-2.0" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes @@ -5018,10 +5294,10 @@ pkg_cv_GTK2_LIBS="$GTK2_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gtk+-2.0\""; } >&5 + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gtk+-2.0\""; } >&5 ($PKG_CONFIG --exists --print-errors "gtk+-2.0") 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_GTK2_LIBS=`$PKG_CONFIG --libs "gtk+-2.0" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes @@ -5035,8 +5311,8 @@ if test $pkg_failed = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes @@ -5056,8 +5332,8 @@ elif test $pkg_failed = untried; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } PBX_GTK2=0 @@ -5065,14 +5341,14 @@ else GTK2_CFLAGS=$pkg_cv_GTK2_CFLAGS GTK2_LIBS=$pkg_cv_GTK2_LIBS - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } PBX_GTK2=1 GTK2_INCLUDE=$(echo ${GTK2_CFLAGS} | $SED -e "s|-std=c99||g") GTK2_LIB="$GTK2_LIBS" -$as_echo "#define HAVE_GTK2 1" >>confdefs.h +printf "%s\n" "#define HAVE_GTK2 1" >>confdefs.h fi @@ -5113,8 +5389,8 @@ case $ac_val in #( *${as_nl}*) case $ac_var in #( - *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 -$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + *_cv_*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 +printf "%s\n" "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( @@ -5144,15 +5420,15 @@ /^ac_cv_env_/b end t clear :clear - s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ + s/^\([^=]*\)=\(.*[{}].*\)$/test ${\1+y} || &/ t end s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then if test "x$cache_file" != "x/dev/null"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 -$as_echo "$as_me: updating cache $cache_file" >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 +printf "%s\n" "$as_me: updating cache $cache_file" >&6;} if test ! -f "$cache_file" || test -h "$cache_file"; then cat confcache >"$cache_file" else @@ -5166,8 +5442,8 @@ fi fi else - { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 -$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 +printf "%s\n" "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache @@ -5184,7 +5460,7 @@ for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' - ac_i=`$as_echo "$ac_i" | sed "$ac_script"` + ac_i=`printf "%s\n" "$ac_i" | sed "$ac_script"` # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR # will be set to the directory where LIBOBJS objects are built. as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" @@ -5200,8 +5476,8 @@ ac_write_fail=0 ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" -{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 -$as_echo "$as_me: creating $CONFIG_STATUS" >&6;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 +printf "%s\n" "$as_me: creating $CONFIG_STATUS" >&6;} as_write_fail=0 cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 #! $SHELL @@ -5224,14 +5500,16 @@ # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : +as_nop=: +if test ${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1 +then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST -else +else $as_nop case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( @@ -5241,46 +5519,46 @@ fi + +# Reset variables that may have inherited troublesome values from +# the environment. + +# IFS needs to be set, to space, tab, and newline, in precisely that order. +# (If _AS_PATH_WALK were called with IFS unset, it would have the +# side effect of setting IFS to empty, thus disabling word splitting.) +# Quoting is to prevent editors from complaining about space-tab. as_nl=' ' export as_nl -# Printing a long string crashes Solaris 7 /usr/bin/printf. -as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' -as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo -as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo -# Prefer a ksh shell builtin over an external printf program on Solaris, -# but without wasting forks for bash or zsh. -if test -z "$BASH_VERSION$ZSH_VERSION" \ - && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then - as_echo='print -r --' - as_echo_n='print -rn --' -elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then - as_echo='printf %s\n' - as_echo_n='printf %s' -else - if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then - as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' - as_echo_n='/usr/ucb/echo -n' - else - as_echo_body='eval expr "X$1" : "X\\(.*\\)"' - as_echo_n_body='eval - arg=$1; - case $arg in #( - *"$as_nl"*) - expr "X$arg" : "X\\(.*\\)$as_nl"; - arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; - esac; - expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" - ' - export as_echo_n_body - as_echo_n='sh -c $as_echo_n_body as_echo' - fi - export as_echo_body - as_echo='sh -c $as_echo_body as_echo' -fi +IFS=" "" $as_nl" + +PS1='$ ' +PS2='> ' +PS4='+ ' + +# Ensure predictable behavior from utilities with locale-dependent output. +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# We cannot yet rely on "unset" to work, but we need these variables +# to be unset--not just set to an empty or harmless value--now, to +# avoid bugs in old shells (e.g. pre-3.0 UWIN ksh). This construct +# also avoids known problems related to "unset" and subshell syntax +# in other old shells (e.g. bash 2.01 and pdksh 5.2.14). +for as_var in BASH_ENV ENV MAIL MAILPATH CDPATH +do eval test \${$as_var+y} \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : +done + +# Ensure that fds 0, 1, and 2 are open. +if (exec 3>&0) 2>/dev/null; then :; else exec 0&1) 2>/dev/null; then :; else exec 1>/dev/null; fi +if (exec 3>&2) ; then :; else exec 2>/dev/null; fi # The user is always right. -if test "${PATH_SEPARATOR+set}" != set; then +if ${PATH_SEPARATOR+false} :; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || @@ -5289,13 +5567,6 @@ fi -# IFS -# We need space, tab and new line, in precisely that order. Quoting is -# there to prevent editors from complaining about space-tab. -# (If _AS_PATH_WALK were called with IFS unset, it would disable word -# splitting by setting IFS to empty value.) -IFS=" "" $as_nl" - # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( @@ -5304,8 +5575,12 @@ for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + test -r "$as_dir$0" && as_myself=$as_dir$0 && break done IFS=$as_save_IFS @@ -5317,30 +5592,10 @@ as_myself=$0 fi if test ! -f "$as_myself"; then - $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + printf "%s\n" "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi -# Unset variables that we do not need and which cause bugs (e.g. in -# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" -# suppresses any "Segmentation fault" message there. '((' could -# trigger a bug in pdksh 5.2.14. -for as_var in BASH_ENV ENV MAIL MAILPATH -do eval test x\${$as_var+set} = xset \ - && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : -done -PS1='$ ' -PS2='> ' -PS4='+ ' - -# NLS nuisances. -LC_ALL=C -export LC_ALL -LANGUAGE=C -export LANGUAGE - -# CDPATH. -(unset CDPATH) >/dev/null 2>&1 && unset CDPATH # as_fn_error STATUS ERROR [LINENO LOG_FD] @@ -5353,13 +5608,14 @@ as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi - $as_echo "$as_me: error: $2" >&2 + printf "%s\n" "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error + # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. @@ -5386,18 +5642,20 @@ { eval $1=; unset $1;} } as_unset=as_fn_unset + # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. -if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null +then : eval 'as_fn_append () { eval $1+=\$2 }' -else +else $as_nop as_fn_append () { eval $1=\$$1\$2 @@ -5409,12 +5667,13 @@ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. -if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null +then : eval 'as_fn_arith () { as_val=$(( $* )) }' -else +else $as_nop as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` @@ -5445,7 +5704,7 @@ $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X/"$0" | +printf "%s\n" X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q @@ -5467,6 +5726,10 @@ as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits + +# Determine whether it's possible to make 'echo' print without a newline. +# These variables are no longer used directly by Autoconf, but are AC_SUBSTed +# for compatibility with existing Makefiles. ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) @@ -5480,6 +5743,12 @@ ECHO_N='-n';; esac +# For backward compatibility with old third-party macros, we provide +# the shell variables $as_echo and $as_echo_n. New code should use +# AS_ECHO(["message"]) and AS_ECHO_N(["message"]), respectively. +as_echo='printf %s\n' +as_echo_n='printf %s' + rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file @@ -5521,7 +5790,7 @@ as_dirs= while :; do case $as_dir in #( - *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *\'*) as_qdir=`printf "%s\n" "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" @@ -5530,7 +5799,7 @@ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$as_dir" | +printf "%s\n" X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q @@ -5593,7 +5862,7 @@ # values after options handling. ac_log=" This file was extended by $as_me, which was -generated by GNU Autoconf 2.69. Invocation command line was +generated by GNU Autoconf 2.71. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS @@ -5651,14 +5920,16 @@ Report bugs to the package provider." _ACEOF +ac_cs_config=`printf "%s\n" "$ac_configure_args" | sed "$ac_safe_unquote"` +ac_cs_config_escaped=`printf "%s\n" "$ac_cs_config" | sed "s/^ //; s/'/'\\\\\\\\''/g"` cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" +ac_cs_config='$ac_cs_config_escaped' ac_cs_version="\\ config.status -configured by $0, generated by GNU Autoconf 2.69, +configured by $0, generated by GNU Autoconf 2.71, with options \\"\$ac_cs_config\\" -Copyright (C) 2012 Free Software Foundation, Inc. +Copyright (C) 2021 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." @@ -5695,15 +5966,15 @@ -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) - $as_echo "$ac_cs_version"; exit ;; + printf "%s\n" "$ac_cs_version"; exit ;; --config | --confi | --conf | --con | --co | --c ) - $as_echo "$ac_cs_config"; exit ;; + printf "%s\n" "$ac_cs_config"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift case $ac_optarg in - *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + *\'*) ac_optarg=`printf "%s\n" "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; '') as_fn_error $? "missing file argument" ;; esac as_fn_append CONFIG_FILES " '$ac_optarg'" @@ -5711,7 +5982,7 @@ --header | --heade | --head | --hea ) $ac_shift case $ac_optarg in - *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + *\'*) ac_optarg=`printf "%s\n" "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; esac as_fn_append CONFIG_HEADERS " '$ac_optarg'" ac_need_defaults=false;; @@ -5720,7 +5991,7 @@ as_fn_error $? "ambiguous option: \`$1' Try \`$0 --help' for more information.";; --help | --hel | -h ) - $as_echo "$ac_cs_usage"; exit ;; + printf "%s\n" "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; @@ -5748,7 +6019,7 @@ if \$ac_cs_recheck; then set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion shift - \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 + \printf "%s\n" "running CONFIG_SHELL=$SHELL \$*" >&6 CONFIG_SHELL='$SHELL' export CONFIG_SHELL exec "\$@" @@ -5762,7 +6033,7 @@ sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX - $as_echo "$ac_log" + printf "%s\n" "$ac_log" } >&5 _ACEOF @@ -5788,8 +6059,8 @@ # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then - test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files - test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers + test ${CONFIG_FILES+y} || CONFIG_FILES=$config_files + test ${CONFIG_HEADERS+y} || CONFIG_HEADERS=$config_headers fi # Have a temporary directory for convenience. Make it in the build tree @@ -6125,7 +6396,7 @@ esac || as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; esac - case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac + case $ac_f in *\'*) ac_f=`printf "%s\n" "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac as_fn_append ac_file_inputs " '$ac_f'" done @@ -6133,17 +6404,17 @@ # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ configure_input='Generated from '` - $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' + printf "%s\n" "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' `' by configure.' if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" - { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 -$as_echo "$as_me: creating $ac_file" >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 +printf "%s\n" "$as_me: creating $ac_file" >&6;} fi # Neutralize special characters interpreted by sed in replacement strings. case $configure_input in #( *\&* | *\|* | *\\* ) - ac_sed_conf_input=`$as_echo "$configure_input" | + ac_sed_conf_input=`printf "%s\n" "$configure_input" | sed 's/[\\\\&|]/\\\\&/g'`;; #( *) ac_sed_conf_input=$configure_input;; esac @@ -6160,7 +6431,7 @@ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$ac_file" | +printf "%s\n" X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q @@ -6184,9 +6455,9 @@ case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) - ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` + ac_dir_suffix=/`printf "%s\n" "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. - ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + ac_top_builddir_sub=`printf "%s\n" "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; @@ -6239,8 +6510,8 @@ case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 -$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 +printf "%s\n" "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_datarootdir_hack=' @@ -6282,9 +6553,9 @@ { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ "$ac_tmp/out"`; test -z "$ac_out"; } && - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&5 -$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' +printf "%s\n" "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&2;} rm -f "$ac_tmp/stdin" @@ -6300,20 +6571,20 @@ # if test x"$ac_file" != x-; then { - $as_echo "/* $configure_input */" \ + printf "%s\n" "/* $configure_input */" >&1 \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" } >"$ac_tmp/config.h" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then - { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 -$as_echo "$as_me: $ac_file is unchanged" >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 +printf "%s\n" "$as_me: $ac_file is unchanged" >&6;} else rm -f "$ac_file" mv "$ac_tmp/config.h" "$ac_file" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 fi else - $as_echo "/* $configure_input */" \ + printf "%s\n" "/* $configure_input */" >&1 \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \ || as_fn_error $? "could not create -" "$LINENO" 5 fi @@ -6354,10 +6625,11 @@ $ac_cs_success || as_fn_exit 1 fi if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 -$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 +printf "%s\n" "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: Menuselect build configuration successfully completed" >&5 -$as_echo "$as_me: Menuselect build configuration successfully completed" >&6;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: Menuselect build configuration successfully completed" >&5 +printf "%s\n" "$as_me: Menuselect build configuration successfully completed" >&6;} + diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/menuselect/configure.ac asterisk-18.12.0~dfsg+~cs6.12.40431413/menuselect/configure.ac --- asterisk-18.11.2~dfsg+~cs6.10.40431413/menuselect/configure.ac 2022-04-14 21:53:34.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/menuselect/configure.ac 2022-05-12 11:50:59.000000000 +0000 @@ -45,6 +45,7 @@ AC_PROG_CC AST_CHECK_GNU_MAKE +PKG_PROG_PKG_CONFIG AC_LANG(C) AC_ARG_ENABLE([debug], @@ -90,6 +91,7 @@ AST_EXT_LIB_CHECK([TINFO], [tinfo], [keypad], [curses.h]) fi +AST_PKG_CONFIG_CHECK([LIBXML2], [libxml-2.0]) AST_EXT_TOOL_CHECK([LIBXML2], [xml2-config], , , [#include #include ], diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/menuselect/menuselect.c asterisk-18.12.0~dfsg+~cs6.12.40431413/menuselect/menuselect.c --- asterisk-18.11.2~dfsg+~cs6.10.40431413/menuselect/menuselect.c 2022-04-14 21:53:34.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/menuselect/menuselect.c 2022-05-12 11:50:59.000000000 +0000 @@ -1130,8 +1130,7 @@ return res; } -/*! \brief Given the string representation of a member and category, mark it as present in a given input file */ -static void mark_as_present(const char *member, const char *category) +static void mark_as_present_helper(const char *member, const char *category, int present) { struct category *cat; struct member *mem; @@ -1142,31 +1141,44 @@ negate = 1; } - print_debug("Marking %s of %s as present\n", member, category); + print_debug("Marking %s of %s as %s\n", member, category, present ? "present" : "not present"); AST_LIST_TRAVERSE(&categories, cat, list) { - if (strcmp(category, cat->name)) + if (strcmp(category, cat->name)) { continue; + } AST_LIST_TRAVERSE(&cat->members, mem, list) { if (mem->is_separator) { continue; } if (!strcmp(member, mem->name)) { - mem->was_enabled = mem->enabled = (negate ? !cat->positive_output : cat->positive_output); + if (present) { + mem->was_enabled = mem->enabled = (negate ? !cat->positive_output : cat->positive_output); + } else { + mem->was_enabled = mem->enabled = 0; + } print_debug("Just set %s enabled to %d\n", mem->name, mem->enabled); break; } } - if (!mem) + if (!mem) { fprintf(stderr, "member '%s' in category '%s' not found, ignoring.\n", member, category); + } break; } - if (!cat) + if (!cat) { fprintf(stderr, "category '%s' not found! Can't mark '%s' as disabled.\n", category, member); + } } +/*! \brief Given the string representation of a member and category, mark it as present in a given input file */ +#define mark_as_present(member, category) mark_as_present_helper(member, category, 1) + +/*! \brief Given the string representation of a member and category, mark it as not present in a given input file */ +#define mark_as_not_present(member, category) mark_as_present_helper(member, category, 0) + unsigned int enable_member(struct member *mem) { struct reference *dep; @@ -1380,6 +1392,9 @@ } while (fgets(buf, PARSE_BUF_SIZE, f)) { + struct category *cat; + struct member *mem; + lineno++; if (strlen_zero(buf)) @@ -1414,11 +1429,44 @@ continue; } - while ((member = strsep(&parse, " \n"))) { - member = skip_blanks(member); - if (strlen_zero(member)) + AST_LIST_TRAVERSE(&categories, cat, list) { + if (strcmp(category, cat->name)) { continue; - mark_as_present(member, category); + } + if (!cat->positive_output) { + print_debug("Category %s is NOT positive output\n", cat->name); + /* if NOT positive_output, then if listed in makeopts, it's disabled! */ + /* this means that what's listed in menuselect.makeopts is a list of modules + * that are NOT selected, so we can't use that to mark things as present. + * In fact, we need to mark everything as present, UNLESS it's listed + * in menuselect.makeopts */ + AST_LIST_TRAVERSE(&cat->members, mem, list) { + if (mem->is_separator) { + continue; + } + mem->was_enabled = 1; + print_debug("Just set %s enabled to %d\n", mem->name, mem->enabled); + } + /* okay, now go ahead, and mark anything listed in makeopts as NOT present */ + while ((member = strsep(&parse, " \n"))) { + member = skip_blanks(member); + if (strlen_zero(member)) { + continue; + } + mark_as_not_present(member, category); + } + } else { + print_debug("Category %s is positive output\n", cat->name); + /* if present, it was enabled (e.g. MENUSELECT_CFLAGS, MENUSELECT_UTILS, MENUSELECT_MOH, etc. */ + while ((member = strsep(&parse, " \n"))) { + member = skip_blanks(member); + if (strlen_zero(member)) { + continue; + } + mark_as_present(member, category); + } + } + break; } } diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/README.md asterisk-18.12.0~dfsg+~cs6.12.40431413/README.md --- asterisk-18.11.2~dfsg+~cs6.10.40431413/README.md 2022-04-14 21:53:34.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/README.md 2022-05-12 11:50:59.000000000 +0000 @@ -91,7 +91,10 @@ 2. Run `./configure` Execute the configure script to guess values for system-dependent -variables used during compilation. +variables used during compilation. If the script indicates that some required +components are missing, you can run `./contrib/scripts/install_prereq install` +to install the necessary components. Note that this will install all dependencies for every functionality of Asterisk. After running the script, you will need +to rerun `./configure`. 3. Run `make menuselect` _\[optional]_ diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/res/Makefile asterisk-18.12.0~dfsg+~cs6.12.40431413/res/Makefile --- asterisk-18.11.2~dfsg+~cs6.10.40431413/res/Makefile 2022-04-14 21:53:34.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/res/Makefile 2022-05-12 11:50:59.000000000 +0000 @@ -69,6 +69,7 @@ $(call MOD_ADD_C,res_ari_model,ari/ari_model_validators.c) $(call MOD_ADD_C,res_stasis_recording,stasis_recording/stored.c) $(call MOD_ADD_C,res_stir_shaken,$(wildcard res_stir_shaken/*.c)) +$(call MOD_ADD_C,res_aeap,$(wildcard res_aeap/*.c)) res_parking.o: _ASTCFLAGS+=$(AST_NO_FORMAT_TRUNCATION) snmp/agent.o: _ASTCFLAGS+=-fPIC diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/res/res_aeap/aeap.c asterisk-18.12.0~dfsg+~cs6.12.40431413/res/res_aeap/aeap.c --- asterisk-18.11.2~dfsg+~cs6.10.40431413/res/res_aeap/aeap.c 1970-01-01 00:00:00.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/res/res_aeap/aeap.c 2022-05-12 11:50:59.000000000 +0000 @@ -0,0 +1,501 @@ +/* + * Asterisk -- An open source telephony toolkit. + * + * Copyright (C) 2021, Sangoma Technologies Corporation + * + * Kevin Harwell + * + * See http://www.asterisk.org for more information about + * the Asterisk project. Please do not directly contact + * any of the maintainers of this project for assistance; + * the project provides a web site, mailing lists and IRC + * channels for your use. + * + * This program is free software, distributed under the terms of + * the GNU General Public License Version 2. See the LICENSE file + * at the top of the source tree. + */ + +#include "asterisk.h" + +#include + +#include "asterisk/astobj2.h" +#include "asterisk/strings.h" + +#include "asterisk/res_aeap.h" +#include "asterisk/res_aeap_message.h" + +#include "logger.h" +#include "transaction.h" +#include "transport.h" + +#define AEAP_RECV_SIZE 32768 + +struct aeap_user_data { + /*! The user data object */ + void *obj; + /*! A user data identifier */ + char id[0]; +}; + +AO2_STRING_FIELD_HASH_FN(aeap_user_data, id); +AO2_STRING_FIELD_CMP_FN(aeap_user_data, id); + +#define USER_DATA_BUCKETS 11 + +struct ast_aeap { + /*! This object's configuration parameters */ + const struct ast_aeap_params *params; + /*! Container for registered user data objects */ + struct ao2_container *user_data; + /*! Transactions container */ + struct ao2_container *transactions; + /*! Transport layer communicator */ + struct aeap_transport *transport; + /*! Id of thread that reads data from the transport */ + pthread_t read_thread_id; +}; + +static int tsx_end(void *obj, void *arg, int flags) +{ + aeap_transaction_end(obj, -1); + + return 0; +} + +static void aeap_destructor(void *obj) +{ + struct ast_aeap *aeap = obj; + + /* Disconnect things first, which keeps transactions from further executing */ + ast_aeap_disconnect(aeap); + + aeap_transport_destroy(aeap->transport); + + /* + * Each contained transaction holds a pointer back to this transactions container, + * which is removed upon transaction end. Thus by explicitly ending each transaction + * here we can ensure all references to the transactions container are removed. + */ + ao2_callback(aeap->transactions, OBJ_UNLINK | OBJ_NODATA | OBJ_MULTIPLE, + tsx_end, NULL); + ao2_cleanup(aeap->transactions); + + ao2_cleanup(aeap->user_data); +} + +struct ast_aeap *ast_aeap_create(const char *transport_type, + const struct ast_aeap_params *params) +{ + struct ast_aeap *aeap; + + aeap = ao2_alloc(sizeof(*aeap), aeap_destructor); + if (!aeap) { + ast_log(LOG_ERROR, "AEAP: unable to create"); + return NULL; + } + + aeap->params = params; + aeap->read_thread_id = AST_PTHREADT_NULL; + + aeap->user_data = ao2_container_alloc_hash(AO2_ALLOC_OPT_LOCK_MUTEX, 0, USER_DATA_BUCKETS, + aeap_user_data_hash_fn, NULL, aeap_user_data_cmp_fn); + if (!aeap->user_data) { + aeap_error(aeap, NULL, "unable to create user data container"); + ao2_ref(aeap, -1); + return NULL; + } + + aeap->transactions = aeap_transactions_create(); + if (!aeap->transactions) { + aeap_error(aeap, NULL, "unable to create transactions container"); + ao2_ref(aeap, -1); + return NULL; + } + + aeap->transport = aeap_transport_create(transport_type); + if (!aeap->transport) { + aeap_error(aeap, NULL, "unable to create transport"); + ao2_ref(aeap, -1); + return NULL; + } + + return aeap; +} + +static struct aeap_user_data *aeap_user_data_create(const char *id, void *obj, + ast_aeap_user_obj_cleanup cleanup) +{ + struct aeap_user_data *data; + + ast_assert(id != NULL); + + data = ao2_t_alloc_options(sizeof(*data) + strlen(id) + 1, cleanup, + AO2_ALLOC_OPT_LOCK_NOLOCK, ""); + if (!data) { + if (cleanup) { + cleanup(obj); + } + + return NULL; + } + + strcpy(data->id, id); /* safe */ + data->obj = obj; + + return data; +} + +int ast_aeap_user_data_register(struct ast_aeap *aeap, const char *id, void *obj, + ast_aeap_user_obj_cleanup cleanup) +{ + struct aeap_user_data *data; + + data = aeap_user_data_create(id, obj, cleanup); + if (!data) { + return -1; + } + + if (!ao2_link(aeap->user_data, data)) { + ao2_ref(data, -1); + return -1; + } + + ao2_ref(data, -1); + return 0; +} + +void ast_aeap_user_data_unregister(struct ast_aeap *aeap, const char *id) +{ + ao2_find(aeap->user_data, id, OBJ_SEARCH_KEY | OBJ_UNLINK | OBJ_NODATA); +} + +void *ast_aeap_user_data_object_by_id(struct ast_aeap *aeap, const char *id) +{ + struct aeap_user_data *data; + void *obj; + + data = ao2_find(aeap->user_data, id, OBJ_SEARCH_KEY); + if (!data) { + return NULL; + } + + obj = data->obj; + ao2_ref(data, -1); + + /* + * Returned object's lifetime is based on how it was registered. + * See public function docs for more info + */ + return obj; +} + +static int raise_msg_handler(struct ast_aeap *aeap, const struct ast_aeap_message_handler *handlers, + size_t size, struct ast_aeap_message *msg, void *data) +{ + ast_aeap_on_message on_message = NULL; + size_t i; + + if (!aeap->params->emit_error) { + const char *error_msg = ast_aeap_message_error_msg(msg); + + if (error_msg) { + aeap_error(aeap, NULL, "%s", error_msg); + return -1; + } + + /* If no error_msg then it's assumed this is not an error message */ + } + + for (i = 0; i < size; ++i) { + if (ast_strlen_zero(handlers[i].name)) { + /* A default handler is specified. Use it if no other match is found */ + on_message = handlers[i].on_message; + continue; + } + + if (ast_aeap_message_is_named(msg, handlers[i].name)) { + on_message = handlers[i].on_message; + break; + } + } + + if (on_message) { + return on_message(aeap, msg, data); + } + + /* Respond with un-handled error */ + ast_aeap_send_msg(aeap, ast_aeap_message_create_error(aeap->params->msg_type, + ast_aeap_message_name(msg), ast_aeap_message_id(msg), + "Unsupported and/or un-handled message")); + + return 0; +} + +static void raise_msg(struct ast_aeap *aeap, const void *buf, intmax_t size, + enum AST_AEAP_DATA_TYPE serial_type) +{ + struct ast_aeap_message *msg; + struct aeap_transaction *tsx; + int res = 0; + + if (!aeap->params || !aeap->params->msg_type || + ast_aeap_message_serial_type(aeap->params->msg_type) != serial_type || + !(msg = ast_aeap_message_deserialize(aeap->params->msg_type, buf, size))) { + return; + } + + /* See if this msg is involved in a transaction */ + tsx = aeap_transaction_get(aeap->transactions, ast_aeap_message_id(msg)); + + /* If so go ahead and cancel the timeout timer */ + aeap_transaction_cancel_timer(tsx); + + if (aeap->params->request_handlers && ast_aeap_message_is_request(msg)) { + res = raise_msg_handler(aeap, aeap->params->request_handlers, aeap->params->request_handlers_size, + msg, tsx ? aeap_transaction_user_obj(tsx) : NULL); + } else if (aeap->params->response_handlers && ast_aeap_message_is_response(msg)) { + res = raise_msg_handler(aeap, aeap->params->response_handlers, aeap->params->response_handlers_size, + msg, tsx ? aeap_transaction_user_obj(tsx) : NULL); + } + + /* Complete transaction (Note, removes tsx ref) */ + aeap_transaction_end(tsx, res); + + ao2_ref(msg, -1); +} + +static void *aeap_receive(void *data) +{ + struct ast_aeap *aeap = data; + void *buf; + + buf = ast_calloc(1, AEAP_RECV_SIZE); + if (!buf) { + aeap_error(aeap, NULL, "unable to create read buffer"); + goto aeap_receive_error; + } + + while (aeap_transport_is_connected(aeap->transport)) { + enum AST_AEAP_DATA_TYPE rtype; + intmax_t size; + + size = aeap_transport_read(aeap->transport, buf, AEAP_RECV_SIZE, &rtype); + if (size < 0) { + goto aeap_receive_error; + } + + if (!size) { + continue; + } + + switch (rtype) { + case AST_AEAP_DATA_TYPE_BINARY: + if (aeap->params && aeap->params->on_binary) { + aeap->params->on_binary(aeap, buf, size); + } + break; + case AST_AEAP_DATA_TYPE_STRING: + ast_debug(3, "AEAP: received message: %s\n", (char *)buf); + if (aeap->params && aeap->params->on_string) { + aeap->params->on_string(aeap, (const char *)buf, size - 1); + } + break; + default: + break; + } + + raise_msg(aeap, buf, size, rtype); + }; + + ast_free(buf); + return NULL; + +aeap_receive_error: + /* + * An unrecoverable error occurred so ensure the aeap and transport reset + * to a disconnected state. We don't want this thread to "join" itself so set + * its id to NULL prior to disconnecting. + */ + aeap_error(aeap, NULL, "unrecoverable read error, disconnecting"); + + ao2_lock(aeap); + aeap->read_thread_id = AST_PTHREADT_NULL; + ao2_unlock(aeap); + + ast_aeap_disconnect(aeap); + + ast_free(buf); + + if (aeap->params && aeap->params->on_error) { + aeap->params->on_error(aeap); + } + + return NULL; +} + +int ast_aeap_connect(struct ast_aeap *aeap, const char *url, const char *protocol, int timeout) +{ + SCOPED_AO2LOCK(lock, aeap); + + if (aeap_transport_is_connected(aeap->transport)) { + /* Should already be connected, so nothing to do */ + return 0; + } + + if (aeap_transport_connect(aeap->transport, url, protocol, timeout)) { + aeap_error(aeap, NULL, "unable to connect transport"); + return -1; + } + + if (ast_pthread_create_background(&aeap->read_thread_id, NULL, + aeap_receive, aeap)) { + aeap_error(aeap, NULL, "unable to start read thread: %s", + strerror(errno)); + ast_aeap_disconnect(aeap); + return -1; + } + + return 0; +} + +struct ast_aeap *ast_aeap_create_and_connect(const char *type, + const struct ast_aeap_params *params, const char *url, const char *protocol, int timeout) +{ + struct ast_aeap *aeap; + + aeap = ast_aeap_create(type, params); + if (!aeap) { + return NULL; + } + + if (ast_aeap_connect(aeap, url, protocol, timeout)) { + ao2_ref(aeap, -1); + return NULL; + } + + return aeap; +} + +int ast_aeap_disconnect(struct ast_aeap *aeap) +{ + ao2_lock(aeap); + + aeap_transport_disconnect(aeap->transport); + + if (aeap->read_thread_id != AST_PTHREADT_NULL) { + /* + * The read thread calls disconnect if an error occurs, so + * unlock the aeap before "joining" to avoid a deadlock. + */ + ao2_unlock(aeap); + pthread_join(aeap->read_thread_id, NULL); + ao2_lock(aeap); + + aeap->read_thread_id = AST_PTHREADT_NULL; + } + + ao2_unlock(aeap); + + return 0; +} + +static int aeap_send(struct ast_aeap *aeap, const void *buf, uintmax_t size, + enum AST_AEAP_DATA_TYPE type) +{ + intmax_t num; + + num = aeap_transport_write(aeap->transport, buf, size, type); + + if (num == 0) { + /* Nothing written, could be disconnected */ + return 0; + } + + if (num < 0) { + aeap_error(aeap, NULL, "error sending data"); + return -1; + } + + if (num < size) { + aeap_error(aeap, NULL, "not all data sent"); + return -1; + } + + if (num > size) { + aeap_error(aeap, NULL, "sent data truncated"); + return -1; + } + + return 0; +} + +int ast_aeap_send_binary(struct ast_aeap *aeap, const void *buf, uintmax_t size) +{ + return aeap_send(aeap, buf, size, AST_AEAP_DATA_TYPE_BINARY); +} + +int ast_aeap_send_msg(struct ast_aeap *aeap, struct ast_aeap_message *msg) +{ + void *buf; + intmax_t size; + int res; + + if (!msg) { + aeap_error(aeap, NULL, "no message to send"); + return -1; + } + + if (ast_aeap_message_serialize(msg, &buf, &size)) { + aeap_error(aeap, NULL, "unable to serialize outgoing message"); + ao2_ref(msg, -1); + return -1; + } + + res = aeap_send(aeap, buf, size, msg->type->serial_type); + + ast_free(buf); + ao2_ref(msg, -1); + + return res; +} + +int ast_aeap_send_msg_tsx(struct ast_aeap *aeap, struct ast_aeap_tsx_params *params) +{ + struct aeap_transaction *tsx = NULL; + int res = 0; + + if (!params) { + return -1; + } + + if (!params->msg) { + aeap_transaction_params_cleanup(params); + aeap_error(aeap, NULL, "no message to send"); + return -1; + } + + /* The transaction will take over params cleanup, which includes the msg reference */ + tsx = aeap_transaction_create_and_add(aeap->transactions, + ast_aeap_message_id(params->msg), params, aeap); + if (!tsx) { + return -1; + } + + if (ast_aeap_send_msg(aeap, ao2_bump(params->msg))) { + aeap_transaction_end(tsx, -1); /* Removes container, and tsx ref */ + return -1; + } + + if (aeap_transaction_start(tsx)) { + aeap_transaction_end(tsx, -1); /* Removes container, and tsx ref */ + return -1; + } + + res = aeap_transaction_result(tsx); + + ao2_ref(tsx, -1); + + return res; +} diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/res/res_aeap/general.c asterisk-18.12.0~dfsg+~cs6.12.40431413/res/res_aeap/general.c --- asterisk-18.11.2~dfsg+~cs6.10.40431413/res/res_aeap/general.c 1970-01-01 00:00:00.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/res/res_aeap/general.c 2022-05-12 11:50:59.000000000 +0000 @@ -0,0 +1,58 @@ +/* + * Asterisk -- An open source telephony toolkit. + * + * Copyright (C) 2021, Sangoma Technologies Corporation + * + * Kevin Harwell + * + * See http://www.asterisk.org for more information about + * the Asterisk project. Please do not directly contact + * any of the maintainers of this project for assistance; + * the project provides a web site, mailing lists and IRC + * channels for your use. + * + * This program is free software, distributed under the terms of + * the GNU General Public License Version 2. See the LICENSE file + * at the top of the source tree. + */ + +#include "asterisk.h" + +#include "asterisk/astobj2.h" +#include "asterisk/sched.h" + +#include "general.h" + +/*! \brief Scheduler for transaction timeouts */ +static struct ast_sched_context *sched = NULL; + +struct ast_sched_context *aeap_sched_context(void) +{ + return sched; +} + +void aeap_general_finalize(void) +{ + if (sched) { + ast_sched_context_destroy(sched); + sched = NULL; + } +} + +int aeap_general_initialize(void) +{ + sched = ast_sched_context_create(); + if (!sched) { + ast_log(LOG_ERROR, "AEAP scheduler: unable to create context"); + return -1; + } + + if (ast_sched_start_thread(sched)) { + ast_log(LOG_ERROR, "AEAP scheduler: unable to start thread"); + aeap_general_finalize(); + return -1; + } + + return 0; +} + diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/res/res_aeap/general.h asterisk-18.12.0~dfsg+~cs6.12.40431413/res/res_aeap/general.h --- asterisk-18.11.2~dfsg+~cs6.10.40431413/res/res_aeap/general.h 1970-01-01 00:00:00.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/res/res_aeap/general.h 2022-05-12 11:50:59.000000000 +0000 @@ -0,0 +1,41 @@ +/* + * Asterisk -- An open source telephony toolkit. + * + * Copyright (C) 2021, Sangoma Technologies Corporation + * + * Kevin Harwell + * + * See http://www.asterisk.org for more information about + * the Asterisk project. Please do not directly contact + * any of the maintainers of this project for assistance; + * the project provides a web site, mailing lists and IRC + * channels for your use. + * + * This program is free software, distributed under the terms of + * the GNU General Public License Version 2. See the LICENSE file + * at the top of the source tree. + */ + +#ifndef RES_AEAP_GENERAL_H +#define RES_AEAP_GENERAL_H + +/*! + * \brief Retrieve the scheduling context + * + * \returns The scheduling context + */ +struct ast_sched_context *aeap_sched_context(void); + +/*! + * \brief Initialize general/common AEAP facilities + * + * \returns 0 on success, -1 on error + */ +int aeap_general_initialize(void); + +/*! + * \brief Finalize/cleanup general AEAP facilities + */ +void aeap_general_finalize(void); + +#endif /* RES_AEAP_GENERAL_H */ diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/res/res_aeap/logger.h asterisk-18.12.0~dfsg+~cs6.12.40431413/res/res_aeap/logger.h --- asterisk-18.11.2~dfsg+~cs6.10.40431413/res/res_aeap/logger.h 1970-01-01 00:00:00.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/res/res_aeap/logger.h 2022-05-12 11:50:59.000000000 +0000 @@ -0,0 +1,60 @@ +/* + * Asterisk -- An open source telephony toolkit. + * + * Copyright (C) 2021, Sangoma Technologies Corporation + * + * Kevin Harwell + * + * See http://www.asterisk.org for more information about + * the Asterisk project. Please do not directly contact + * any of the maintainers of this project for assistance; + * the project provides a web site, mailing lists and IRC + * channels for your use. + * + * This program is free software, distributed under the terms of + * the GNU General Public License Version 2. See the LICENSE file + * at the top of the source tree. + */ + +#ifndef RES_AEAP_LOGGER_H +#define RES_AEAP_LOGGER_H + +#include "asterisk.h" + +#include "asterisk/logger.h" +#include "asterisk/strings.h" + +/*! + * \brief Log an Asterisk external application message + * + * \param level The logging level + * \param obj The object being logged + * \param name Optional subsystem name + * \param fmt Format string + * \param ... Parameters for the format string + */ +#define aeap_log(level, obj, name, fmt, ...) \ + ast_log(level, "AEAP%s%s (%p): " fmt "\n", ast_strlen_zero(name) ? "" : " ", \ + ast_strlen_zero(name) ? "" : name, obj, ##__VA_ARGS__) + +/*! + * \brief Log an Asterisk external application error + * + * \param obj The object being logged + * \param name Optional subsystem name + * \param fmt Format string + * \param ... Parameters for the format string + */ +#define aeap_error(obj, name, fmt, ...) aeap_log(LOG_ERROR, obj, name, fmt, ##__VA_ARGS__) + +/*! + * \brief Log an Asterisk external application warning + * + * \param obj The object being logged + * \param name Optional subsystem name + * \param fmt Format string + * \param ... Parameters for the format string + */ +#define aeap_warn(obj, name, fmt, ...) aeap_log(LOG_WARNING, obj, name, fmt, ##__VA_ARGS__) + +#endif /* RES_AEAP_LOGGER_H */ diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/res/res_aeap/message.c asterisk-18.12.0~dfsg+~cs6.12.40431413/res/res_aeap/message.c --- asterisk-18.11.2~dfsg+~cs6.10.40431413/res/res_aeap/message.c 1970-01-01 00:00:00.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/res/res_aeap/message.c 2022-05-12 11:50:59.000000000 +0000 @@ -0,0 +1,270 @@ +/* + * Asterisk -- An open source telephony toolkit. + * + * Copyright (C) 2021, Sangoma Technologies Corporation + * + * Kevin Harwell + * + * See http://www.asterisk.org for more information about + * the Asterisk project. Please do not directly contact + * any of the maintainers of this project for assistance; + * the project provides a web site, mailing lists and IRC + * channels for your use. + * + * This program is free software, distributed under the terms of + * the GNU General Public License Version 2. See the LICENSE file + * at the top of the source tree. + */ + +#include "asterisk.h" + +#include "asterisk/astobj2.h" +#include "asterisk/utils.h" +#include "asterisk/uuid.h" +#include "asterisk/res_aeap.h" +#include "asterisk/res_aeap_message.h" + +enum AST_AEAP_DATA_TYPE ast_aeap_message_serial_type(const struct ast_aeap_message_type *type) +{ + ast_assert(type != NULL); + + return type->serial_type; +} + +static void message_destructor(void *obj) +{ + struct ast_aeap_message *msg = obj; + + if (msg->type->destruct) { + msg->type->destruct(msg); + } +} + +static struct ast_aeap_message *message_create(const struct ast_aeap_message_type *type) +{ + struct ast_aeap_message *msg; + + msg = ao2_t_alloc_options(type->type_size, message_destructor, + AO2_ALLOC_OPT_LOCK_NOLOCK, type->type_name); + if (!msg) { + ast_log(LOG_ERROR, "AEAP message %s: unable to create\n", type->type_name); + return NULL; + } + + msg->type = type; + + return msg; +} + +struct ast_aeap_message *ast_aeap_message_create1(const struct ast_aeap_message_type *type, + const void *params) +{ + struct ast_aeap_message *msg; + + ast_assert(type != NULL); + ast_assert(type->construct1 != NULL); + + msg = message_create(type); + if (!msg) { + return NULL; + } + + if (type->construct1(msg, params)) { + ast_log(LOG_ERROR, "AEAP message %s: unable to construct1\n", type->type_name); + ao2_ref(msg, -1); + return NULL; + } + + return msg; +} + +struct ast_aeap_message *ast_aeap_message_create2(const struct ast_aeap_message_type *type, + const char *msg_type, const char *name, const char *id, const void *params) +{ + struct ast_aeap_message *msg; + + ast_assert(type != NULL); + ast_assert(type->construct2 != NULL); + ast_assert(msg_type != NULL); + ast_assert(name != NULL); + + msg = message_create(type); + if (!msg) { + return NULL; + } + + if (type->construct2(msg, msg_type, name, id, params)) { + ast_log(LOG_ERROR, "AEAP message %s: unable to construct2\n", type->type_name); + ao2_ref(msg, -1); + return NULL; + } + + return msg; +} + +struct ast_aeap_message *ast_aeap_message_create_request(const struct ast_aeap_message_type *type, + const char *name, const char *id, const void *params) +{ + struct ast_aeap_message *msg; + + msg = ast_aeap_message_create2(type, "request", name, id, params); + if (!msg) { + return NULL; + } + + if (!id && !ast_aeap_message_id_generate(msg)) { + ao2_ref(msg, -1); + return NULL; + } + + return msg; +} + +struct ast_aeap_message *ast_aeap_message_create_response(const struct ast_aeap_message_type *type, + const char *name, const char *id, const void *params) +{ + return ast_aeap_message_create2(type, "response", name, id, params); +} + +struct ast_aeap_message *ast_aeap_message_create_error(const struct ast_aeap_message_type *type, + const char *name, const char *id, const char *error_msg) +{ + struct ast_aeap_message *msg; + + msg = ast_aeap_message_create_response(type, name, id, NULL); + if (!msg) { + return NULL; + } + + if (ast_aeap_message_error_msg_set(msg, error_msg)) { + ao2_ref(msg, -1); + return NULL; + } + + return msg; +} + +struct ast_aeap_message *ast_aeap_message_deserialize(const struct ast_aeap_message_type *type, + const void *buf, intmax_t size) +{ + struct ast_aeap_message *msg; + + ast_assert(type != NULL); + ast_assert(type->deserialize != NULL); + + msg = ast_aeap_message_create1(type, NULL); + if (!msg) { + return NULL; + } + + if (type->deserialize(msg, buf, size)) { + ao2_ref(msg, -1); + return NULL; + } + + return msg; +} + +int ast_aeap_message_serialize(const struct ast_aeap_message *message, + void **buf, intmax_t *size) +{ + ast_assert(message != NULL); + ast_assert(message->type != NULL); + + return message->type->serialize ? message->type->serialize(message, buf, size) : 0; +} + +const char *ast_aeap_message_id(const struct ast_aeap_message *message) +{ + const char *id = NULL; + + ast_assert(message != NULL); + ast_assert(message->type != NULL); + + if (message->type->id) { + id = message->type->id(message); + } + + return id ? id : ""; +} + +int ast_aeap_message_id_set(struct ast_aeap_message *message, const char *id) +{ + ast_assert(message != NULL); + ast_assert(message->type != NULL); + + return message->type->id_set ? message->type->id_set(message, id) : 0; +} + +const char *ast_aeap_message_id_generate(struct ast_aeap_message *message) +{ + char uuid_str[AST_UUID_STR_LEN]; + + ast_uuid_generate_str(uuid_str, sizeof(uuid_str)); + if (strlen(uuid_str) != (AST_UUID_STR_LEN - 1)) { + ast_log(LOG_ERROR, "AEAP message %s failed to generate UUID for message '%s'", + message->type->type_name, ast_aeap_message_name(message)); + return NULL; + } + + return ast_aeap_message_id_set(message, uuid_str) ? NULL : ast_aeap_message_id(message); +} + +const char *ast_aeap_message_name(const struct ast_aeap_message *message) +{ + const char *name = NULL; + + ast_assert(message != NULL); + ast_assert(message->type != NULL); + + if (message->type->name) { + name = message->type->name(message); + } + + return name ? name : ""; +} + +int ast_aeap_message_is_named(const struct ast_aeap_message *message, const char *name) +{ + return name ? !strcasecmp(ast_aeap_message_name(message), name) : 0; +} + +void *ast_aeap_message_data(struct ast_aeap_message *message) +{ + ast_assert(message != NULL); + ast_assert(message->type != NULL); + + return message->type->data ? message->type->data(message) : NULL; +} + +int ast_aeap_message_is_request(const struct ast_aeap_message *message) +{ + ast_assert(message != NULL); + ast_assert(message->type != NULL); + + return message->type->is_request ? message->type->is_request(message) : 0; +} + +int ast_aeap_message_is_response(const struct ast_aeap_message *message) +{ + ast_assert(message != NULL); + ast_assert(message->type != NULL); + + return message->type->is_response ? message->type->is_response(message) : 0; +} + +const char *ast_aeap_message_error_msg(const struct ast_aeap_message *message) +{ + ast_assert(message != NULL); + ast_assert(message->type != NULL); + + return message->type->error_msg ? message->type->error_msg(message) : NULL; +} + +int ast_aeap_message_error_msg_set(struct ast_aeap_message *message, const char *error_msg) +{ + ast_assert(message != NULL); + ast_assert(message->type != NULL); + + return message->type->error_msg_set ? message->type->error_msg_set(message, error_msg) : 0; +} diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/res/res_aeap/message_json.c asterisk-18.12.0~dfsg+~cs6.12.40431413/res/res_aeap/message_json.c --- asterisk-18.11.2~dfsg+~cs6.10.40431413/res/res_aeap/message_json.c 1970-01-01 00:00:00.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/res/res_aeap/message_json.c 2022-05-12 11:50:59.000000000 +0000 @@ -0,0 +1,191 @@ +/* + * Asterisk -- An open source telephony toolkit. + * + * Copyright (C) 2021, Sangoma Technologies Corporation + * + * Kevin Harwell + * + * See http://www.asterisk.org for more information about + * the Asterisk project. Please do not directly contact + * any of the maintainers of this project for assistance; + * the project provides a web site, mailing lists and IRC + * channels for your use. + * + * This program is free software, distributed under the terms of + * the GNU General Public License Version 2. See the LICENSE file + * at the top of the source tree. + */ + +#include "asterisk.h" + +#include "asterisk/json.h" + +#include "asterisk/res_aeap_message.h" + +#define JSON_MSG(lvalue, rvalue) struct message_json *lvalue = \ + ((struct message_json *)rvalue) + +/*! + * \brief Asterisk external application JSON message type + */ +struct message_json { + /*! The base message type (must be first) */ + struct ast_aeap_message base; + /*! Underlying JSON data structure */ + struct ast_json *json; +}; + +static int message_json_construct1(struct ast_aeap_message *self, const void *params) +{ + JSON_MSG(msg, self); + + msg->json = ast_json_ref((struct ast_json *)params) ?: ast_json_object_create(); + + return msg->json ? 0 : -1; +} + +static int message_json_construct2(struct ast_aeap_message *self, const char *msg_type, + const char *name, const char *id, const void *params) +{ + struct ast_json *msg_data; + int res; + + msg_data = ast_json_pack("{s:s,s:s*}", msg_type, name, "id", id); + + if (!msg_data) { + ast_log(LOG_ERROR, "AEAP message json: failed to create data for '%s: %s'", msg_type, name); + return -1; + } + + if (params && ast_json_object_update(msg_data, (struct ast_json *)params)) { + ast_log(LOG_ERROR, "AEAP message json: failed to update data for '%s: %s'", msg_type, name); + ast_json_unref(msg_data); + return -1; + } + + res = message_json_construct1(self, msg_data); + ast_json_unref(msg_data); + return res; +} + +static void message_json_destruct(struct ast_aeap_message *self) +{ + JSON_MSG(msg, self); + + ast_json_unref(msg->json); +} + +static int message_json_deserialize(struct ast_aeap_message *self, const void *buf, intmax_t size) +{ + JSON_MSG(msg, self); + + msg->json = ast_json_load_buf(buf, size, NULL); + + return msg->json ? 0 : -1; +} + +static int message_json_serialize(const struct ast_aeap_message *self, void **buf, intmax_t *size) +{ + const JSON_MSG(msg, self); + + *buf = ast_json_dump_string(msg->json); + if (!*buf) { + *size = 0; + return -1; + } + + *size = strlen(*buf); + + return 0; +} + +static const char *message_json_id(const struct ast_aeap_message *self) +{ + const JSON_MSG(msg, self); + + return ast_json_object_string_get(msg->json, "id"); +} + +static int message_json_id_set(struct ast_aeap_message *self, const char *id) +{ + JSON_MSG(msg, self); + + if (ast_json_object_set(msg->json, "id", ast_json_string_create(id))) { + return -1; + } + + return 0; +} + +static const char *message_json_name(const struct ast_aeap_message *self) +{ + const JSON_MSG(msg, self); + struct ast_json_iter *iter; + + iter = ast_json_object_iter_at(msg->json, "response"); + if (!iter) { + iter = ast_json_object_iter_at(msg->json, "request"); + } + + return iter ? ast_json_string_get(ast_json_object_iter_value(iter)) : ""; +} + +static void *message_json_data(struct ast_aeap_message *self) +{ + JSON_MSG(msg, self); + + return msg->json; +} + +static int message_json_is_request(const struct ast_aeap_message *self) +{ + const JSON_MSG(msg, self); + + return ast_json_object_iter_at(msg->json, "request") != NULL; +} + +static int message_json_is_response(const struct ast_aeap_message *self) +{ + const JSON_MSG(msg, self); + + return ast_json_object_iter_at(msg->json, "response") != NULL; +} + +static const char *message_json_error_msg(const struct ast_aeap_message *self) +{ + const JSON_MSG(msg, self); + + return ast_json_object_string_get(msg->json, "error_msg"); +} + +static int message_json_error_msg_set(struct ast_aeap_message *self, const char *error_msg) +{ + JSON_MSG(msg, self); + + if (ast_json_object_set(msg->json, "error_msg", ast_json_string_create(error_msg))) { + return -1; + } + + return 0; +} + +static const struct ast_aeap_message_type message_type_json = { + .type_size = sizeof(struct message_json), + .type_name = "json", + .serial_type = AST_AEAP_DATA_TYPE_STRING, + .construct1 = message_json_construct1, + .construct2 = message_json_construct2, + .destruct = message_json_destruct, + .deserialize = message_json_deserialize, + .serialize = message_json_serialize, + .id = message_json_id, + .id_set = message_json_id_set, + .name = message_json_name, + .data = message_json_data, + .is_request = message_json_is_request, + .is_response = message_json_is_response, + .error_msg = message_json_error_msg, + .error_msg_set = message_json_error_msg_set, +}; + +const struct ast_aeap_message_type *ast_aeap_message_type_json = &message_type_json; diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/res/res_aeap/transaction.c asterisk-18.12.0~dfsg+~cs6.12.40431413/res/res_aeap/transaction.c --- asterisk-18.11.2~dfsg+~cs6.10.40431413/res/res_aeap/transaction.c 1970-01-01 00:00:00.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/res/res_aeap/transaction.c 2022-05-12 11:50:59.000000000 +0000 @@ -0,0 +1,284 @@ +/* + * Asterisk -- An open source telephony toolkit. + * + * Copyright (C) 2021, Sangoma Technologies Corporation + * + * Kevin Harwell + * + * See http://www.asterisk.org for more information about + * the Asterisk project. Please do not directly contact + * any of the maintainers of this project for assistance; + * the project provides a web site, mailing lists and IRC + * channels for your use. + * + * This program is free software, distributed under the terms of + * the GNU General Public License Version 2. See the LICENSE file + * at the top of the source tree. + */ + +#include "asterisk.h" + +#include "asterisk/astobj2.h" +#include "asterisk/sched.h" +#include "asterisk/utils.h" + +#include "asterisk/res_aeap.h" +#include "asterisk/res_aeap_message.h" + +#include "general.h" +#include "logger.h" +#include "transaction.h" + +struct aeap_transaction { + /*! Pointer back to owner object */ + struct ast_aeap *aeap; + /*! The container this transaction is in */ + struct ao2_container *container; + /*! Scheduler ID message timeout */ + int sched_id; + /*! Whether or not the handler has been executed */ + int handled; + /*! Used to sync matching received messages */ + ast_cond_t handled_cond; + /*! The result of this transaction */ + int result; + /*! The timeout data */ + struct ast_aeap_tsx_params params; + /*! The transaction identifier */ + char id[0]; +}; + +/*! \brief Number of transaction buckets */ +#define AEAP_TRANSACTION_BUCKETS 11 + +AO2_STRING_FIELD_HASH_FN(aeap_transaction, id); +AO2_STRING_FIELD_CMP_FN(aeap_transaction, id); + +int aeap_transaction_cancel_timer(struct aeap_transaction *tsx) +{ + if (tsx && tsx->sched_id != -1) { + AST_SCHED_DEL_UNREF(aeap_sched_context(), tsx->sched_id, ao2_ref(tsx, -1)); + return tsx->sched_id != -1; + } + + return 0; +} + +void aeap_transaction_params_cleanup(struct ast_aeap_tsx_params *params) +{ + ao2_cleanup(params->msg); + + if (params->obj_cleanup) { + params->obj_cleanup(params->obj); + } +} + +static void transaction_destructor(void *obj) +{ + struct aeap_transaction *tsx = obj; + + /* Ensure timer is canceled */ + aeap_transaction_cancel_timer(tsx); + + aeap_transaction_params_cleanup(&tsx->params); + + ast_cond_destroy(&tsx->handled_cond); +} + +static struct aeap_transaction *transaction_create(const char *id, + struct ast_aeap_tsx_params *params, struct ast_aeap *aeap) +{ + struct aeap_transaction *tsx; + + if (!id) { + aeap_error(aeap, "transaction", "missing transaction id"); + aeap_transaction_params_cleanup(params); + return NULL; + } + + tsx = ao2_alloc(sizeof(*tsx) + strlen(id) + 1, transaction_destructor); + if (!tsx) { + aeap_error(aeap, "transaction", "unable to create for '%s'", id); + aeap_transaction_params_cleanup(params); + return NULL; + } + + strcpy(tsx->id, id); /* safe */ + tsx->sched_id = -1; + + ast_cond_init(&tsx->handled_cond, NULL); + + /* + * Currently, transactions, and their lifetimes are fully managed by the given 'aeap' + * object, so do not bump its reference here as we want the 'aeap' object to stop + * transactions and not transactions potentially stopping the 'aeap' object. + */ + tsx->aeap = aeap; + tsx->params = *params; + + return tsx; +} + +static void transaction_end(struct aeap_transaction *tsx, int timed_out, int result) +{ + if (!tsx) { + return; + } + + ao2_lock(tsx); + + tsx->result = result; + + if (tsx->container) { + ao2_unlink(tsx->container, tsx); + tsx->container = NULL; + } + + if (!timed_out) { + aeap_transaction_cancel_timer(tsx); + } else if (tsx->sched_id != -1) { + tsx->sched_id = -1; + } + + if (!tsx->handled) { + if (timed_out) { + if (tsx->params.on_timeout) { + tsx->params.on_timeout(tsx->aeap, tsx->params.msg, tsx->params.obj); + } else { + aeap_error(tsx->aeap, "transaction", "message '%s' timed out", + ast_aeap_message_name(tsx->params.msg)); + } + } + + tsx->handled = 1; + ast_cond_signal(&tsx->handled_cond); + } + + ao2_unlock(tsx); + + ao2_ref(tsx, -1); +} + +static int transaction_raise_timeout(const void *data) +{ + /* Ref added added at timer creation removed in end call */ + transaction_end((struct aeap_transaction *)data, 1, -1); + + return 0; +} + +static int transaction_sched_timer(struct aeap_transaction *tsx) +{ + if (tsx->params.timeout <= 0 || tsx->sched_id != -1) { + return 0; + } + + tsx->sched_id = ast_sched_add(aeap_sched_context(), tsx->params.timeout, + transaction_raise_timeout, ao2_bump(tsx)); + if (tsx->sched_id == -1) { + aeap_error(tsx->aeap, "transaction", "unable to schedule timeout for '%s'", tsx->id); + ao2_ref(tsx, -1); + return -1; + } + + return 0; +} + +static void transaction_wait(struct aeap_transaction *tsx) +{ + ao2_lock(tsx); + + while (!tsx->handled) { + ast_cond_wait(&tsx->handled_cond, ao2_object_get_lockaddr(tsx)); + } + + ao2_unlock(tsx); +} + +int aeap_transaction_start(struct aeap_transaction *tsx) +{ + if (transaction_sched_timer(tsx)) { + return -1; + } + + if (tsx->params.wait) { + /* Wait until transaction completes, or times out */ + transaction_wait(tsx); + } + + return 0; +} + +struct aeap_transaction *aeap_transaction_get(struct ao2_container *transactions, const char *id) +{ + return ao2_find(transactions, id, OBJ_SEARCH_KEY); +} + +void aeap_transaction_end(struct aeap_transaction *tsx, int result) +{ + transaction_end(tsx, 0, result); +} + +int aeap_transaction_result(struct aeap_transaction *tsx) +{ + return tsx->result; +} + +void *aeap_transaction_user_obj(struct aeap_transaction *tsx) +{ + return tsx->params.obj; +} + +struct aeap_transaction *aeap_transaction_create_and_add(struct ao2_container *transactions, + const char *id, struct ast_aeap_tsx_params *params, struct ast_aeap *aeap) +{ + struct aeap_transaction *tsx; + + tsx = transaction_create(id, params, aeap); + if (!tsx) { + return NULL; + } + + if (!ao2_link(transactions, tsx)) { + aeap_error(tsx->aeap, "transaction", "unable to add '%s' to container", id); + ao2_ref(tsx, -1); + return NULL; + } + + /* + * Yes, this creates a circular reference. This reference is removed though + * upon transaction end. It's assumed here that the given transactions container + * takes "ownership", and ultimate responsibility of its contained transactions. + * Thus when the given container needs to be unref'ed/freed it must call + * aeap_transaction_end for each transaction prior to doing so. + */ + /* tsx->container = ao2_bump(transactions); */ + + /* + * The transaction needs to know what container manages it, so it can remove + * itself from the given container under certain conditions (e.g. transaction + * timeout). + * + * It's expected that the given container will out live any contained transaction + * (i.e. the container will not itself be destroyed before ensuring all contained + * transactions are ended, and removed). Thus there is no reason to bump the given + * container's reference here. + */ + tsx->container = transactions; + + return tsx; +} + +struct ao2_container *aeap_transactions_create(void) +{ + struct ao2_container *transactions; + + transactions = ao2_container_alloc_hash(AO2_ALLOC_OPT_LOCK_MUTEX, 0, AEAP_TRANSACTION_BUCKETS, + aeap_transaction_hash_fn, NULL, aeap_transaction_cmp_fn); + if (!transactions) { + ast_log(LOG_ERROR, "AEAP transaction: unable to create container\n"); + return NULL; + } + + return transactions; +} diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/res/res_aeap/transaction.h asterisk-18.12.0~dfsg+~cs6.12.40431413/res/res_aeap/transaction.h --- asterisk-18.11.2~dfsg+~cs6.10.40431413/res/res_aeap/transaction.h 1970-01-01 00:00:00.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/res/res_aeap/transaction.h 2022-05-12 11:50:59.000000000 +0000 @@ -0,0 +1,123 @@ +/* + * Asterisk -- An open source telephony toolkit. + * + * Copyright (C) 2021, Sangoma Technologies Corporation + * + * Kevin Harwell + * + * See http://www.asterisk.org for more information about + * the Asterisk project. Please do not directly contact + * any of the maintainers of this project for assistance; + * the project provides a web site, mailing lists and IRC + * channels for your use. + * + * This program is free software, distributed under the terms of + * the GNU General Public License Version 2. See the LICENSE file + * at the top of the source tree. + */ + +#ifndef RES_AEAP_TRANSACTION_H +#define RES_AEAP_TRANSACTION_H + +#include "asterisk/res_aeap.h" + +struct ao2_container; +struct ast_aeap_tsx_params; +struct aeap_transaction; + +/*! + * \brief Create an Asterisk external application transactions container + * + * \returns A transaction object, or NULL on error + */ +struct ao2_container *aeap_transactions_create(void); + +/*! + * \brief Create a transaction object, and add it to the given container + * + * \param transactions A transactions container + * \param id An id to use for the transaction + * \param params Transaction parameters + * \param aeap The aeap object that "owns" this transaction + * + * \returns 0 if successfully create and added, -1 on error + */ +struct aeap_transaction *aeap_transaction_create_and_add(struct ao2_container *transactions, + const char *id, struct ast_aeap_tsx_params *params, struct ast_aeap *aeap); + +/*! + * \brief Clean up parameter references, and possibly call optional user object cleanup + * + * \param params Transaction parameters + */ +void aeap_transaction_params_cleanup(struct ast_aeap_tsx_params *params); + +/*! + * \brief Retrieve a transaction for the id from the container + * + * \param transactions A transactions container + * \param id A transaction id + * + * \returns an AEAP transaction object, NULL if no transaction is found + */ +struct aeap_transaction *aeap_transaction_get(struct ao2_container *transactions, + const char *id); + +/*! + * \brief Start the transaction + * + * \param tsx The transaction to initiate + * + * \returns 0 if successfully raised, and handled. Otherwise non zero. + */ +int aeap_transaction_start(struct aeap_transaction *tsx); + +/*! + * \brief End a transaction, and remove it from the given container + * + * The "result" parameter is a value representing the state (success/failure, + * perhaps even something else) of transactional processing upon ending. + * + * \param tsx A transaction to end + * \param result A result to give to the transaction + */ +void aeap_transaction_end(struct aeap_transaction *tsx, int result); + +/*! + * \brief Get a transaction's result + * + * A transaction's result is a value that represents the relative success (0), or + * failure (-1) of a transaction. For example, a timeout is considered a failure + * and will elicit a -1. + * + * This value though is also dependent upon the result of the message handler + * associated with the transaction. Meaning if an associated message is handled, + * then its result is stored as the transaction result and returned here. + * + * \param tsx A transaction object + * + * \returns The transaction result + */ +int aeap_transaction_result(struct aeap_transaction *tsx); + +/*! + * \brief Cancel the transaction timer + * + * Stops the transaction timer, but does not end/stop the transaction itself + * + * \param transaction A transaction to cancel the timer on + * + * \returns 0 if canceled, non zero otherwise + */ +int aeap_transaction_cancel_timer(struct aeap_transaction *tsx); + +/*! + * \brief Retrieve the user object associated with the transaction + * + * \param transaction A transaction object + * + * \returns A user object, or NULL if non associated + */ +void *aeap_transaction_user_obj(struct aeap_transaction *tsx); + +#endif /* RES_AEAP_TRANSACTION_H */ diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/res/res_aeap/transport.c asterisk-18.12.0~dfsg+~cs6.12.40431413/res/res_aeap/transport.c --- asterisk-18.11.2~dfsg+~cs6.10.40431413/res/res_aeap/transport.c 1970-01-01 00:00:00.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/res/res_aeap/transport.c 2022-05-12 11:50:59.000000000 +0000 @@ -0,0 +1,156 @@ +/* + * Asterisk -- An open source telephony toolkit. + * + * Copyright (C) 2021, Sangoma Technologies Corporation + * + * Kevin Harwell + * + * See http://www.asterisk.org for more information about + * the Asterisk project. Please do not directly contact + * any of the maintainers of this project for assistance; + * the project provides a web site, mailing lists and IRC + * channels for your use. + * + * This program is free software, distributed under the terms of + * the GNU General Public License Version 2. See the LICENSE file + * at the top of the source tree. + */ + +#include "asterisk.h" + +#include "asterisk/utils.h" + +#include "logger.h" +#include "transport.h" +#include "transport_websocket.h" + +struct aeap_transport *aeap_transport_create(const char *type) +{ + struct aeap_transport *transport = NULL; + + if (!strncasecmp(type, "ws", 2)) { + transport = (struct aeap_transport *)aeap_transport_websocket_create(); + } + + if (!transport) { + ast_log(LOG_ERROR, "AEAP transport: failed to create for type '%s'\n", type); + return NULL; + } + + ast_mutex_init(&transport->read_lock); + ast_mutex_init(&transport->write_lock); + + transport->connected = 0; + + return transport; +} + +int aeap_transport_connect(struct aeap_transport *transport, const char *url, + const char *protocol, int timeout) +{ + int res; + + SCOPED_MUTEX(rlock, &transport->read_lock); + SCOPED_MUTEX(wlock, &transport->write_lock); + + if (aeap_transport_is_connected(transport)) { + return 0; + } + + res = transport->vtable->connect(transport, url, protocol, timeout); + if (!res) { + transport->connected = 1; + } + + return res; +} + +struct aeap_transport *aeap_transport_create_and_connect(const char *type, + const char *url, const char *protocol, int timeout) +{ + struct aeap_transport *transport = aeap_transport_create(type); + + if (!transport) { + return NULL; + } + + if (aeap_transport_connect(transport, url, protocol, timeout)) { + aeap_transport_destroy(transport); + return NULL; + } + + return transport; +} + +int aeap_transport_is_connected(struct aeap_transport *transport) +{ + /* + * Avoid using a lock to 'read' the 'connected' variable in order to + * keep things slightly more efficient. + */ + return ast_atomic_fetch_add(&transport->connected, 0, __ATOMIC_RELAXED); +} + +int aeap_transport_disconnect(struct aeap_transport *transport) +{ + int res; + + SCOPED_MUTEX(rlock, &transport->read_lock); + SCOPED_MUTEX(wlock, &transport->write_lock); + + if (!aeap_transport_is_connected(transport)) { + return 0; + } + + res = transport->vtable->disconnect(transport); + + /* + * Even though the transport is locked here use atomics to set the value of + * 'connected' since it's possible the variable is being 'read' by another + * thread via the 'is_connected' call. + */ + ast_atomic_fetch_sub(&transport->connected, 1, __ATOMIC_RELAXED); + + return res; +} + +void aeap_transport_destroy(struct aeap_transport *transport) +{ + if (!transport) { + return; + } + + /* Ensure an orderly disconnect occurs before final destruction */ + aeap_transport_disconnect(transport); + + transport->vtable->destroy(transport); + + ast_mutex_destroy(&transport->read_lock); + ast_mutex_destroy(&transport->write_lock); + + ast_free(transport); +} + +intmax_t aeap_transport_read(struct aeap_transport *transport, void *buf, intmax_t size, + enum AST_AEAP_DATA_TYPE *rtype) +{ + SCOPED_MUTEX(lock, &transport->read_lock); + + if (!aeap_transport_is_connected(transport)) { + return 0; + } + + return transport->vtable->read(transport, buf, size, rtype); +} + +intmax_t aeap_transport_write(struct aeap_transport *transport, const void *buf, intmax_t size, + enum AST_AEAP_DATA_TYPE wtype) +{ + SCOPED_MUTEX(lock, &transport->write_lock); + + if (!aeap_transport_is_connected(transport)) { + return 0; + } + + return transport->vtable->write(transport, buf, size, wtype); +} diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/res/res_aeap/transport.h asterisk-18.12.0~dfsg+~cs6.12.40431413/res/res_aeap/transport.h --- asterisk-18.11.2~dfsg+~cs6.10.40431413/res/res_aeap/transport.h 1970-01-01 00:00:00.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/res/res_aeap/transport.h 2022-05-12 11:50:59.000000000 +0000 @@ -0,0 +1,209 @@ +/* + * Asterisk -- An open source telephony toolkit. + * + * Copyright (C) 2021, Sangoma Technologies Corporation + * + * Kevin Harwell + * + * See http://www.asterisk.org for more information about + * the Asterisk project. Please do not directly contact + * any of the maintainers of this project for assistance; + * the project provides a web site, mailing lists and IRC + * channels for your use. + * + * This program is free software, distributed under the terms of + * the GNU General Public License Version 2. See the LICENSE file + * at the top of the source tree. + */ + +#ifndef RES_AEAP_TRANSPORT_H +#define RES_AEAP_TRANSPORT_H + +#include + +#include "asterisk/res_aeap.h" + +struct aeap_transport; + +/*! + * \brief Asterisk external application transport virtual table + * + * Callbacks to be implemented by "derived" transports + */ +struct aeap_transport_vtable { + /*! + * \brief Connect a transport + * + * \param self The transport object + * \param url The URL to connect to + * \param protocol The connection protocol to use if applicable + * \param timeout How long (in milliseconds) to attempt to connect (-1 equals infinite) + * + * \returns 0 on success, or -1 on error + */ + int (*connect)(struct aeap_transport *self, const char *url, const char *protocol, int timeout); + + /*! + * \brief Disconnect a transport + * + * \param self The transport object + * + * \returns 0 on success, or -1 on error + */ + int (*disconnect)(struct aeap_transport *self); + + /*! + * \brief Destroy a transport + * + * \param self The transport object + */ + void (*destroy)(struct aeap_transport *self); + + /*! + * \brief Read data from a transport + * + * \param self The transport object + * \param buf The buffer data is read read into + * \param size The size of the given data buffer + * \param rtype [out] The type of data read + * + * \returns Total number of bytes read, or less than zero on error + */ + intmax_t (*read)(struct aeap_transport *self, void *buf, intmax_t size, + enum AST_AEAP_DATA_TYPE *rtype); + + /*! + * \brief Write data to a transport + * + * \param self The transport object + * \param buf The data to write + * \param size The size of data to write + * \param wtype The type of data to write + * + * \returns Total number of bytes written, or less than zero on error + */ + intmax_t (*write)(struct aeap_transport *self, const void *buf, intmax_t size, + enum AST_AEAP_DATA_TYPE wtype); +}; + +/*! + * \brief Asterisk external application transport structure to be + * "derived" by specific transport implementation types + * + * Transports are assumed to support simultaneous reading and writing, + * thus separate read and write locks. A transport type not supporting + * such can simply apply the opposing lock during a read or write, i.e. + * lock the write lock during a read and vice versa. + */ +struct aeap_transport { + /*! Transport virtual table */ + struct aeap_transport_vtable *vtable; + /*! Whether or not the transport is connected */ + unsigned int connected; + /*! Lock used when reading */ + ast_mutex_t read_lock; + /*! Lock used when writing */ + ast_mutex_t write_lock; +}; + +/*! + * \brief Create an Asterisk external application transport + * + * \param type The type of transport to create + * + * \returns An Asterisk external application transport, or NULL on error + */ +struct aeap_transport *aeap_transport_create(const char *type); + +/*! + * \brief Connect a transport + * + * \param transport The transport to connect + * \param url The URL to connect to + * \param protocol The connection protocol to use if applicable + * \param timeout How long (in milliseconds) to attempt to connect (-1 equals infinite) + * + * \returns 0 on success, or -1 on error + */ +int aeap_transport_connect(struct aeap_transport *transport, const char *url, + const char *protocol, int timeout); + +/*! + * \brief Create an Asterisk external application transport, and connect it + * + * \param type The type of transport to create + * \param url The URL to connect to + * \param protocol The connection protocol to use if applicable + * \param timeout How long (in milliseconds) to attempt to connect (-1 equals infinite) + * + * \returns An Asterisk external application transport, or NULL on error + */ +struct aeap_transport *aeap_transport_create_and_connect(const char* type, + const char *url, const char *protocol, int timeout); + +/*! + * \brief Disconnect a transport + * + * \note Locks both the transport's read and write locks before calling transport + * instance's disconnect, and unlocks both before returning. + * + * \param transport The transport to disconnect + * + * \returns 0 on success, or -1 on error + */ +int aeap_transport_disconnect(struct aeap_transport *transport); + +/*! + * \brief Whether or not the transport is in a connected state + * + * \param transport The transport object + * + * \returns True if connected, false otherwise + */ +int aeap_transport_is_connected(struct aeap_transport *transport); + +/*! + * \brief Destroy a transport + * + * \param transport The transport to destroy + * + * \returns 0 on success, or -1 on error + */ +void aeap_transport_destroy(struct aeap_transport *transport); + +/*! + * \brief Read data from the transport + * + * This is a blocking read, and will not return until the transport + * implementation returns. + * + * \note Locks transport's read lock before calling transport instance's + * read, and unlocks it before returning. + * + * \param transport The transport to read from + * \param buf The buffer data is read into + * \param size The size of data given data buffer + * \param rtype [out] The type of data read + * + * \returns Total number of bytes read, or less than zero on error + */ +intmax_t aeap_transport_read(struct aeap_transport *transport, void *buf, intmax_t size, + enum AST_AEAP_DATA_TYPE *rtype); + +/*! + * \brief Write data to the transport + * + * \note Locks transport's write lock before calling transport instance's + * write, and unlocks it before returning. + * + * \param transport The transport to write to + * \param buf The data to write + * \param size The size of data to write + * \param wtype The type of data to write + * + * \returns Total number of bytes written, or less than zero on error + */ +intmax_t aeap_transport_write(struct aeap_transport *transport, const void *buf, intmax_t size, + enum AST_AEAP_DATA_TYPE wtype); + +#endif /* RES_AEAP_TRANSPORT_H */ diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/res/res_aeap/transport_websocket.c asterisk-18.12.0~dfsg+~cs6.12.40431413/res/res_aeap/transport_websocket.c --- asterisk-18.11.2~dfsg+~cs6.10.40431413/res/res_aeap/transport_websocket.c 1970-01-01 00:00:00.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/res/res_aeap/transport_websocket.c 2022-05-12 11:50:59.000000000 +0000 @@ -0,0 +1,249 @@ +/* + * Asterisk -- An open source telephony toolkit. + * + * Copyright (C) 2021, Sangoma Technologies Corporation + * + * Kevin Harwell + * + * See http://www.asterisk.org for more information about + * the Asterisk project. Please do not directly contact + * any of the maintainers of this project for assistance; + * the project provides a web site, mailing lists and IRC + * channels for your use. + * + * This program is free software, distributed under the terms of + * the GNU General Public License Version 2. See the LICENSE file + * at the top of the source tree. + */ + +#include "asterisk.h" + +#include "asterisk/http_websocket.h" +#include "asterisk/utils.h" + +#include "logger.h" +#include "transport.h" +#include "transport_websocket.h" + +#define log_error(obj, fmt, ...) aeap_error(obj, "websocket", fmt, ##__VA_ARGS__) + +struct aeap_transport_websocket { + /*! Derive from base transport (must be first attribute) */ + struct aeap_transport base; + /*! The underlying websocket */ + struct ast_websocket *ws; +}; + +static int websocket_connect(struct aeap_transport *self, const char *url, + const char *protocol, int timeout) +{ + struct aeap_transport_websocket *transport = (struct aeap_transport_websocket *)self; + enum ast_websocket_result ws_result; + struct ast_websocket_client_options ws_options = { + .uri = url, + .protocols = protocol, + .timeout = timeout, + .tls_cfg = NULL, + }; + + transport->ws = ast_websocket_client_create_with_options(&ws_options, &ws_result); + if (ws_result != WS_OK) { + log_error(self, "connect failure (%d)", (int)ws_result); + return -1; + } + + return 0; +} + +static int websocket_disconnect(struct aeap_transport *self) +{ + struct aeap_transport_websocket *transport = (struct aeap_transport_websocket *)self; + + if (transport->ws) { + ast_websocket_unref(transport->ws); + transport->ws = NULL; + } + + return 0; +} + +static void websocket_destroy(struct aeap_transport *self) +{ + /* + * Disconnect takes care of cleaning up the websocket. Note, disconnect + * was called by the base/dispatch interface prior to calling this + * function so nothing to do here. + */ +} + +static intmax_t websocket_read(struct aeap_transport *self, void *buf, intmax_t size, + enum AST_AEAP_DATA_TYPE *rtype) +{ + struct aeap_transport_websocket *transport = (struct aeap_transport_websocket *)self; + + char *payload; + uint64_t bytes_read = 0; + uint64_t total_bytes_read = 0; + enum ast_websocket_opcode opcode; + int fragmented = 0; + + *rtype = AST_AEAP_DATA_TYPE_NONE; + + if (ast_websocket_fd(transport->ws) < 0) { + log_error(self, "unavailable for reading"); + /* Ensure this transport is in a disconnected state */ + aeap_transport_disconnect(self); + return -1; + } + + /* + * This function is called with the read_lock locked. However, the lock needs to be + * unlocked while waiting for input otherwise a deadlock can occur during disconnect + * (disconnect attempts to grab the lock but can't because read holds it here). So + * unlock it prior to waiting. + */ + ast_mutex_unlock(&transport->base.read_lock); + if (ast_websocket_wait_for_input(transport->ws, -1) <= 0) { + ast_mutex_lock(&transport->base.read_lock); + log_error(self, "poll failure: %s", strerror(errno)); + /* Ensure this transport is in a disconnected state */ + aeap_transport_disconnect(self); + return -1; + } + ast_mutex_lock(&transport->base.read_lock); + + if (!transport->ws) { + /* + * It's possible the transport was told to disconnect while waiting for input. + * If so then the websocket will be NULL, so we don't want to continue. + */ + return 0; + } + + do { + if (ast_websocket_read(transport->ws, &payload, &bytes_read, &opcode, + &fragmented) != 0) { + log_error(self, "read failure (%d): %s", opcode, strerror(errno)); + return -1; + } + + if (!bytes_read) { + continue; + } + + if (total_bytes_read + bytes_read > size) { + log_error(self, "attempted to read too many bytes into (%jd) sized buffer", size); + return -1; + } + + memcpy(buf + total_bytes_read, payload, bytes_read); + total_bytes_read += bytes_read; + + } while (opcode == AST_WEBSOCKET_OPCODE_CONTINUATION); + + switch (opcode) { + case AST_WEBSOCKET_OPCODE_CLOSE: + log_error(self, "closed"); + return -1; + case AST_WEBSOCKET_OPCODE_BINARY: + *rtype = AST_AEAP_DATA_TYPE_BINARY; + break; + case AST_WEBSOCKET_OPCODE_TEXT: + *rtype = AST_AEAP_DATA_TYPE_STRING; + + /* Append terminator, but check for overflow first */ + if (total_bytes_read == size) { + log_error(self, "unable to write string terminator"); + return -1; + } + + *((char *)(buf + total_bytes_read)) = '\0'; + break; + default: + /* Ignore all other message types */ + return 0; + } + + return total_bytes_read; +} + +static intmax_t websocket_write(struct aeap_transport *self, const void *buf, intmax_t size, + enum AST_AEAP_DATA_TYPE wtype) +{ + struct aeap_transport_websocket *transport = (struct aeap_transport_websocket *)self; + intmax_t res = 0; + + switch (wtype) { + case AST_AEAP_DATA_TYPE_BINARY: + res = ast_websocket_write(transport->ws, AST_WEBSOCKET_OPCODE_BINARY, + (char *)buf, size); + break; + case AST_AEAP_DATA_TYPE_STRING: + res = ast_websocket_write(transport->ws, AST_WEBSOCKET_OPCODE_TEXT, + (char *)buf, size); + break; + default: + break; + } + + if (res < 0) { + log_error(self, "problem writing to websocket (closed)"); + + /* + * If the underlying socket is closed then ensure the + * transport is in a disconnected state as well. + */ + aeap_transport_disconnect(self); + + return res; + } + + return size; +} + +static struct aeap_transport_vtable *transport_websocket_vtable(void) +{ + static struct aeap_transport_vtable websocket_vtable = { + .connect = websocket_connect, + .disconnect = websocket_disconnect, + .destroy = websocket_destroy, + .read = websocket_read, + .write = websocket_write, + }; + + return &websocket_vtable; +} + +/*! + * \brief Initialize a transport websocket object, and set its virtual table + * + * \param transport The transport to initialize + * + * \returns 0 on success, -1 on error + */ +static int transport_websocket_init(struct aeap_transport_websocket *transport) +{ + transport->ws = NULL; + + ((struct aeap_transport *)transport)->vtable = transport_websocket_vtable(); + + return 0; +} + +struct aeap_transport_websocket *aeap_transport_websocket_create(void) +{ + struct aeap_transport_websocket *transport; + + transport = ast_calloc(1, sizeof(*transport)); + if (!transport) { + ast_log(LOG_ERROR, "AEAP websocket: unable to create transport websocket"); + return NULL; + } + + if (transport_websocket_init(transport)) { + ast_free(transport); + return NULL; + } + + return transport; +} diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/res/res_aeap/transport_websocket.h asterisk-18.12.0~dfsg+~cs6.12.40431413/res/res_aeap/transport_websocket.h --- asterisk-18.11.2~dfsg+~cs6.10.40431413/res/res_aeap/transport_websocket.h 1970-01-01 00:00:00.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/res/res_aeap/transport_websocket.h 2022-05-12 11:50:59.000000000 +0000 @@ -0,0 +1,34 @@ +/* + * Asterisk -- An open source telephony toolkit. + * + * Copyright (C) 2021, Sangoma Technologies Corporation + * + * Kevin Harwell + * + * See http://www.asterisk.org for more information about + * the Asterisk project. Please do not directly contact + * any of the maintainers of this project for assistance; + * the project provides a web site, mailing lists and IRC + * channels for your use. + * + * This program is free software, distributed under the terms of + * the GNU General Public License Version 2. See the LICENSE file + * at the top of the source tree. + */ + +#ifndef RES_AEAP_TRANSPORT_WEBSOCKET_H +#define RES_AEAP_TRANSPORT_WEBSOCKET_H + +/*! + * \brief Asterisk external application protocol websocket transport + */ +struct aeap_transport_websocket; + +/*! + * \brief Creates (heap allocated), and initializes a transport websocket + * + * \returns A transport websocket object, or NULL on error + */ +struct aeap_transport_websocket *aeap_transport_websocket_create(void); + +#endif /* RES_AEAP_TRANSPORT_WEBSOCKET_H */ diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/res/res_aeap.c asterisk-18.12.0~dfsg+~cs6.12.40431413/res/res_aeap.c --- asterisk-18.11.2~dfsg+~cs6.10.40431413/res/res_aeap.c 1970-01-01 00:00:00.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/res/res_aeap.c 2022-05-12 11:50:59.000000000 +0000 @@ -0,0 +1,404 @@ +/* + * Asterisk -- An open source telephony toolkit. + * + * Copyright (C) 2021, Sangoma Technologies Corporation + * + * Ben Ford + * + * See http://www.asterisk.org for more information about + * the Asterisk project. Please do not directly contact + * any of the maintainers of this project for assistance; + * the project provides a web site, mailing lists and IRC + * channels for your use. + * + * This program is free software, distributed under the terms of + * the GNU General Public License Version 2. See the LICENSE file + * at the top of the source tree. + */ + +/*** MODULEINFO + res_http_websocket + core + ***/ + +#include "asterisk.h" + +#include "asterisk/astobj2.h" +#include "asterisk/module.h" +#include "asterisk/sorcery.h" +#include "asterisk/cli.h" +#include "asterisk/format.h" +#include "asterisk/format_cap.h" +#include "asterisk/res_aeap.h" + +#include "res_aeap/general.h" + +/*** DOCUMENTATION + + Asterisk External Application Protocol (AEAP) module for Asterisk + + + AEAP client options + + Must be of type 'client'. + + + The URL of the server to connect to. + + + The application protocol. + + + Optional media codec(s) + + If this is specified, Asterisk will use this for codec related negotiations + with the external application. Otherwise, Asterisk will default to using the + codecs configured on the endpoint. + + + + + + ***/ + +/* Asterisk External Application Protocol sorcery object */ +static struct ast_sorcery *aeap_sorcery; + +struct ast_sorcery *ast_aeap_sorcery(void) { + return aeap_sorcery; +} + +struct ast_aeap_client_config +{ + SORCERY_OBJECT(details); + AST_DECLARE_STRING_FIELDS( + /*! The URL of the server to connect to */ + AST_STRING_FIELD(url); + /*! The application protocol */ + AST_STRING_FIELD(protocol); + ); + /*! An optional list of codecs that will be used if provided */ + struct ast_format_cap *codecs; +}; + +static void client_config_destructor(void *obj) +{ + struct ast_aeap_client_config *cfg = obj; + + ast_string_field_free_memory(cfg); + ao2_cleanup(cfg->codecs); +} + +static void *client_config_alloc(const char *name) +{ + struct ast_aeap_client_config *cfg; + + cfg = ast_sorcery_generic_alloc(sizeof(*cfg), client_config_destructor); + if (!cfg) { + return NULL; + } + + if (ast_string_field_init(cfg, 512)) { + ao2_ref(cfg, -1); + return NULL; + } + + if (!(cfg->codecs = ast_format_cap_alloc(AST_FORMAT_CAP_FLAG_DEFAULT))) { + ao2_ref(cfg, -1); + return NULL; + } + + return cfg; +} + +static int client_config_apply(const struct ast_sorcery *sorcery, void *obj) +{ + struct ast_aeap_client_config *cfg = obj; + + if (ast_strlen_zero(cfg->url)) { + ast_log(LOG_ERROR, "AEAP - URL must be present for '%s'\n", ast_sorcery_object_get_id(cfg)); + return -1; + } + + if (!ast_begins_with(cfg->url, "ws")) { + ast_log(LOG_ERROR, "AEAP - URL must be ws or wss for '%s'\n", ast_sorcery_object_get_id(cfg)); + return -1; + } + + return 0; +} + +const struct ast_format_cap *ast_aeap_client_config_codecs(const struct ast_aeap_client_config *cfg) +{ + return cfg->codecs; +} + +int ast_aeap_client_config_has_protocol(const struct ast_aeap_client_config *cfg, + const char *protocol) +{ + return !strcmp(protocol, cfg->protocol); +} + +struct ao2_container *ast_aeap_client_configs_get(const char *protocol) +{ + struct ao2_container *container; + struct ast_variable *var; + + var = protocol ? ast_variable_new("protocol ==", protocol, "") : NULL; + + container = ast_sorcery_retrieve_by_fields(aeap_sorcery, + AEAP_CONFIG_CLIENT, AST_RETRIEVE_FLAG_MULTIPLE | AST_RETRIEVE_FLAG_ALL, var); + + ast_variables_destroy(var); + + return container; +} + +static struct ast_aeap_client_config *client_config_get(const char *id) +{ + return ast_sorcery_retrieve_by_id(aeap_sorcery, AEAP_CONFIG_CLIENT, id); +} + +static char *aeap_tab_complete_name(const char *word, struct ao2_container *container) +{ + void *obj; + struct ao2_iterator it; + int wordlen = strlen(word); + int ret; + + it = ao2_iterator_init(container, 0); + while ((obj = ao2_iterator_next(&it))) { + if (!strncasecmp(word, ast_sorcery_object_get_id(obj), wordlen)) { + ret = ast_cli_completion_add(ast_strdup(ast_sorcery_object_get_id(obj))); + if (ret) { + ao2_ref(obj, -1); + break; + } + } + ao2_ref(obj, -1); + } + ao2_iterator_destroy(&it); + + ao2_ref(container, -1); + + return NULL; +} + +static int aeap_cli_show(void *obj, void *arg, int flags) +{ + struct ast_cli_args *a = arg; + struct ast_variable *options; + struct ast_variable *i; + + if (!obj) { + ast_cli(a->fd, "No AEAP configuration found\n"); + return 0; + } + + options = ast_variable_list_sort(ast_sorcery_objectset_create(aeap_sorcery, obj)); + if (!options) { + return 0; + } + + ast_cli(a->fd, "%s: %s\n", ast_sorcery_object_get_type(obj), + ast_sorcery_object_get_id(obj)); + + for (i = options; i; i = i->next) { + ast_cli(a->fd, "\t%s: %s\n", i->name, i->value); + } + + ast_cli(a->fd, "\n"); + + ast_variables_destroy(options); + + return 0; +} + +static char *client_config_show(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a) +{ + struct ast_aeap_client_config *cfg; + + switch(cmd) { + case CLI_INIT: + e->command = "aeap show client"; + e->usage = + "Usage: aeap show client \n" + " Show the AEAP settings for a given client\n"; + return NULL; + case CLI_GENERATE: + if (a->pos == 3) { + return aeap_tab_complete_name(a->word, ast_aeap_client_configs_get(NULL)); + } else { + return NULL; + } + } + + if (a->argc != 4) { + return CLI_SHOWUSAGE; + } + + cfg = client_config_get(a->argv[3]); + aeap_cli_show(cfg, a, 0); + ao2_cleanup(cfg); + + return CLI_SUCCESS; +} + +static char *client_config_show_all(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a) +{ + struct ao2_container *container; + + switch(cmd) { + case CLI_INIT: + e->command = "aeap show clients"; + e->usage = + "Usage: aeap show clients\n" + " Show all configured AEAP clients\n"; + return NULL; + case CLI_GENERATE: + return NULL; + } + + if (a->argc != 3) { + return CLI_SHOWUSAGE; + } + + container = ast_aeap_client_configs_get(NULL); + if (!container || ao2_container_count(container) == 0) { + ast_cli(a->fd, "No AEAP clients found\n"); + ao2_cleanup(container); + return CLI_SUCCESS; + } + + ao2_callback(container, OBJ_NODATA, aeap_cli_show, a); + ao2_ref(container, -1); + + return CLI_SUCCESS; +} + +static struct ast_cli_entry aeap_cli[] = { + AST_CLI_DEFINE(client_config_show, "Show AEAP client configuration by id"), + AST_CLI_DEFINE(client_config_show_all, "Show all AEAP client configurations"), +}; + +static struct ast_aeap *aeap_create(const char *id, const struct ast_aeap_params *params, + int connect, int timeout) +{ + struct ast_aeap_client_config *cfg; + struct ast_aeap *aeap; + const char *url = NULL; + const char *protocol = NULL; + + cfg = client_config_get(id); + if (cfg) { + url = cfg->url; + protocol = cfg->protocol; + } + +#ifdef TEST_FRAMEWORK + else if (ast_begins_with(id, "_aeap_test_")) { + url = "ws://127.0.0.1:8088/ws"; + protocol = id; + } +#endif + + if (!url && !protocol) { + ast_log(LOG_ERROR, "AEAP: unable to get configuration for '%s'\n", id); + return NULL; + } + + aeap = connect ? ast_aeap_create_and_connect(url, params, url, protocol, timeout) : + ast_aeap_create(url, params); + + ao2_cleanup(cfg); + return aeap; +} + +struct ast_aeap *ast_aeap_create_by_id(const char *id, const struct ast_aeap_params *params) +{ + return aeap_create(id, params, 0, 0); +} + +struct ast_aeap *ast_aeap_create_and_connect_by_id(const char *id, + const struct ast_aeap_params *params, int timeout) +{ + return aeap_create(id, params, 1, timeout); +} + +struct ast_variable *ast_aeap_custom_fields_get(const char *id) +{ + struct ast_aeap_client_config *cfg; + struct ast_variable *vars; + + cfg = client_config_get(id); + if (!cfg) { + ast_log(LOG_WARNING, "AEAP: no client configuration '%s' to get fields\n", id); + return NULL; + } + + vars = ast_sorcery_objectset_create(aeap_sorcery, cfg); + + ao2_ref(cfg, -1); + return vars; +} + +static int reload_module(void) +{ + ast_sorcery_reload(aeap_sorcery); + + return 0; +} + +static int unload_module(void) +{ + ast_sorcery_unref(aeap_sorcery); + aeap_sorcery = NULL; + + ast_cli_unregister_multiple(aeap_cli, ARRAY_LEN(aeap_cli)); + + aeap_general_finalize(); + + return 0; +} + +static int load_module(void) +{ + if (aeap_general_initialize()) { + return AST_MODULE_LOAD_DECLINE; + } + + if (!(aeap_sorcery = ast_sorcery_open())) + { + ast_log(LOG_ERROR, "AEAP - failed to open sorcery\n"); + return AST_MODULE_LOAD_DECLINE; + } + + ast_sorcery_apply_default(aeap_sorcery, AEAP_CONFIG_CLIENT, "config", "aeap.conf,criteria=type=client"); + + if (ast_sorcery_object_register(aeap_sorcery, "client", client_config_alloc, + NULL, client_config_apply)) { + ast_log(LOG_ERROR, "AEAP - failed to register client sorcery object\n"); + return AST_MODULE_LOAD_DECLINE; + } + + ast_sorcery_object_field_register(aeap_sorcery, AEAP_CONFIG_CLIENT, "type", "", OPT_NOOP_T, 0, 0); + ast_sorcery_object_field_register(aeap_sorcery, AEAP_CONFIG_CLIENT, "url", "", OPT_STRINGFIELD_T, 0, STRFLDSET(struct ast_aeap_client_config, url)); + ast_sorcery_object_field_register(aeap_sorcery, AEAP_CONFIG_CLIENT, "protocol", "", OPT_STRINGFIELD_T, 0, STRFLDSET(struct ast_aeap_client_config, protocol)); + ast_sorcery_object_field_register(aeap_sorcery, AEAP_CONFIG_CLIENT, "codecs", "", OPT_CODEC_T, 1, FLDSET(struct ast_aeap_client_config, codecs)); + + ast_sorcery_load(aeap_sorcery); + + ast_cli_register_multiple(aeap_cli, ARRAY_LEN(aeap_cli)); + + return 0; +} + +AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_GLOBAL_SYMBOLS | AST_MODFLAG_LOAD_ORDER, + "Asterisk External Application Protocol Module for Asterisk", + .support_level = AST_MODULE_SUPPORT_CORE, + .load = load_module, + .unload = unload_module, + .reload = reload_module, + .load_pri = AST_MODPRI_CHANNEL_DEPEND, + .requires = "res_http_websocket", +); diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/res/res_aeap.exports.in asterisk-18.12.0~dfsg+~cs6.12.40431413/res/res_aeap.exports.in --- asterisk-18.11.2~dfsg+~cs6.10.40431413/res/res_aeap.exports.in 1970-01-01 00:00:00.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/res/res_aeap.exports.in 2022-05-12 11:50:59.000000000 +0000 @@ -0,0 +1,7 @@ +{ + global: + LINKER_SYMBOL_PREFIXaeap_*; + LINKER_SYMBOL_PREFIXast_aeap_*; + local: + *; +}; diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/res/res_agi.c asterisk-18.12.0~dfsg+~cs6.12.40431413/res/res_agi.c --- asterisk-18.11.2~dfsg+~cs6.10.40431413/res/res_agi.c 2022-04-14 21:53:34.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/res/res_agi.c 2022-05-12 11:50:59.000000000 +0000 @@ -794,14 +794,10 @@ Enable/Disable Music on hold generator - + - - - - - - + + diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/res/res_calendar_caldav.c asterisk-18.12.0~dfsg+~cs6.12.40431413/res/res_calendar_caldav.c --- asterisk-18.11.2~dfsg+~cs6.10.40431413/res/res_calendar_caldav.c 2022-04-14 21:53:34.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/res/res_calendar_caldav.c 2022-05-12 11:50:59.000000000 +0000 @@ -404,8 +404,8 @@ if (!ast_strlen_zero(event->summary)) { ast_string_field_set(event, uid, event->summary); } else { - char tmp[100]; - snprintf(tmp, sizeof(tmp), "%ld", event->start); + char tmp[AST_TIME_T_LEN]; + ast_time_t_to_string(event->start, tmp, sizeof(tmp)); ast_string_field_set(event, uid, tmp); } } diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/res/res_calendar_icalendar.c asterisk-18.12.0~dfsg+~cs6.12.40431413/res/res_calendar_icalendar.c --- asterisk-18.11.2~dfsg+~cs6.10.40431413/res/res_calendar_icalendar.c 2022-04-14 21:53:34.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/res/res_calendar_icalendar.c 2022-05-12 11:50:59.000000000 +0000 @@ -245,8 +245,8 @@ if (!ast_strlen_zero(event->summary)) { ast_string_field_set(event, uid, event->summary); } else { - char tmp[100]; - snprintf(tmp, sizeof(tmp), "%ld", event->start); + char tmp[AST_TIME_T_LEN]; + ast_time_t_to_string(event->start, tmp, sizeof(tmp)); ast_string_field_set(event, uid, tmp); } } diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/res/res_crypto.c asterisk-18.12.0~dfsg+~cs6.12.40431413/res/res_crypto.c --- asterisk-18.11.2~dfsg+~cs6.10.40431413/res/res_crypto.c 2022-04-14 21:53:34.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/res/res_crypto.c 2022-05-12 11:50:59.000000000 +0000 @@ -35,6 +35,8 @@ #include /* for closedir, opendir, readdir, DIR */ +#define OPENSSL_SUPPRESS_DEPRECATED 1 + #include /* for AES_decrypt, AES_encrypt, AES_set... */ #include /* for ERR_print_errors_fp */ #include /* for NID_sha1, RSA */ diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/res/res_http_media_cache.c asterisk-18.12.0~dfsg+~cs6.12.40431413/res/res_http_media_cache.c --- asterisk-18.11.2~dfsg+~cs6.10.40431413/res/res_http_media_cache.c 2022-04-14 21:53:34.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/res/res_http_media_cache.c 2022-05-12 11:50:59.000000000 +0000 @@ -116,7 +116,7 @@ static void bucket_file_set_expiration(struct ast_bucket_file *bucket_file) { struct ast_bucket_metadata *metadata; - char time_buf[32]; + char time_buf[32], secs[AST_TIME_T_LEN]; struct timeval actual_expires = ast_tvnow(); metadata = ast_bucket_file_metadata_get(bucket_file, "cache-control"); @@ -150,7 +150,8 @@ } /* Use 'now' if we didn't get an expiration time */ - snprintf(time_buf, sizeof(time_buf), "%30lu", actual_expires.tv_sec); + ast_time_t_to_string(actual_expires.tv_sec, secs, sizeof(secs)); + snprintf(time_buf, sizeof(time_buf), "%30s", secs); ast_bucket_file_metadata_set(bucket_file, "__actual_expires", time_buf); } @@ -314,7 +315,7 @@ return 1; } - if (sscanf(metadata->value, "%lu", &expires.tv_sec) != 1) { + if ((expires.tv_sec = ast_string_to_time_t(metadata->value)) == -1) { return 1; } diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/res/res_odbc.c asterisk-18.12.0~dfsg+~cs6.12.40431413/res/res_odbc.c --- asterisk-18.11.2~dfsg+~cs6.10.40431413/res/res_odbc.c 2022-04-14 21:53:34.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/res/res_odbc.c 2022-05-12 11:50:59.000000000 +0000 @@ -1029,7 +1029,9 @@ /* Dont connect while server is marked as unreachable via negative_connection_cache */ negative_cache_expiration = obj->parent->last_negative_connect.tv_sec + obj->parent->negative_connection_cache.tv_sec; if (time(NULL) < negative_cache_expiration) { - ast_log(LOG_WARNING, "Not connecting to %s. Negative connection cache for %ld seconds\n", obj->parent->name, negative_cache_expiration - time(NULL)); + char secs[AST_TIME_T_LEN]; + ast_time_t_to_string(negative_cache_expiration - time(NULL), secs, sizeof(secs)); + ast_log(LOG_WARNING, "Not connecting to %s. Negative connection cache for %s seconds\n", obj->parent->name, secs); return ODBC_FAIL; } diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/res/res_pjsip/config_global.c asterisk-18.12.0~dfsg+~cs6.12.40431413/res/res_pjsip/config_global.c --- asterisk-18.11.2~dfsg+~cs6.10.40431413/res/res_pjsip/config_global.c 2022-04-14 21:53:34.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/res/res_pjsip/config_global.c 2022-05-12 11:50:59.000000000 +0000 @@ -48,6 +48,7 @@ #define DEFAULT_MWI_TPS_QUEUE_HIGH AST_TASKPROCESSOR_HIGH_WATER_LEVEL #define DEFAULT_MWI_TPS_QUEUE_LOW -1 #define DEFAULT_MWI_DISABLE_INITIAL_UNSOLICITED 0 +#define DEFAULT_ALLOW_SENDING_180_AFTER_183 0 #define DEFAULT_IGNORE_URI_USER_OPTIONS 0 #define DEFAULT_USE_CALLERID_CONTACT 0 #define DEFAULT_SEND_CONTACT_STATUS_ON_UPDATE_REGISTRATION 0 @@ -92,6 +93,8 @@ unsigned int contact_expiration_check_interval; /*! Nonzero to disable multi domain support */ unsigned int disable_multi_domain; + /*! Nonzero to disable changing 180/SDP to 183/SDP */ + unsigned int allow_sending_180_after_183; /*! The maximum number of unidentified requests per source IP address before a security event is logged */ unsigned int unidentified_request_count; /*! The period during which unidentified requests are accumulated */ @@ -444,6 +447,21 @@ return disable_initial_unsolicited; } +unsigned int ast_sip_get_allow_sending_180_after_183(void) +{ + unsigned int allow_sending_180_after_183; + struct global_config *cfg; + + cfg = get_global_cfg(); + if (!cfg) { + return DEFAULT_ALLOW_SENDING_180_AFTER_183; + } + + allow_sending_180_after_183 = cfg->allow_sending_180_after_183; + ao2_ref(cfg, -1); + return allow_sending_180_after_183; +} + unsigned int ast_sip_get_ignore_uri_user_options(void) { unsigned int ignore_uri_user_options; @@ -708,6 +726,9 @@ ast_sorcery_object_field_register(sorcery, "global", "mwi_disable_initial_unsolicited", DEFAULT_MWI_DISABLE_INITIAL_UNSOLICITED ? "yes" : "no", OPT_BOOL_T, 1, FLDSET(struct global_config, mwi.disable_initial_unsolicited)); + ast_sorcery_object_field_register(sorcery, "global", "allow_sending_180_after_183", + DEFAULT_ALLOW_SENDING_180_AFTER_183 ? "yes" : "no", + OPT_BOOL_T, 1, FLDSET(struct global_config, allow_sending_180_after_183)); ast_sorcery_object_field_register(sorcery, "global", "ignore_uri_user_options", DEFAULT_IGNORE_URI_USER_OPTIONS ? "yes" : "no", OPT_BOOL_T, 1, FLDSET(struct global_config, ignore_uri_user_options)); diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/res/res_pjsip/config_transport.c asterisk-18.12.0~dfsg+~cs6.12.40431413/res/res_pjsip/config_transport.c --- asterisk-18.11.2~dfsg+~cs6.10.40431413/res/res_pjsip/config_transport.c 2022-04-14 21:53:34.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/res/res_pjsip/config_transport.c 2022-05-12 11:50:59.000000000 +0000 @@ -659,6 +659,12 @@ return -1; } + if (transport->async_operations != 1) { + ast_log(LOG_WARNING, "The async_operations setting on transport '%s' has been set to '%d'. The setting can no longer be set and is always 1.\n", + transport_id, transport->async_operations); + transport->async_operations = 1; + } + perm_state = find_internal_state_by_transport(transport); if (perm_state) { ast_sorcery_diff(sorcery, perm_state->transport, transport, &changes); diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/res/res_pjsip/location.c asterisk-18.12.0~dfsg+~cs6.12.40431413/res/res_pjsip/location.c --- asterisk-18.11.2~dfsg+~cs6.10.40431413/res/res_pjsip/location.c 2022-04-14 21:53:34.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/res/res_pjsip/location.c 2022-05-12 11:50:59.000000000 +0000 @@ -489,7 +489,10 @@ static int expiration_struct2str(const void *obj, const intptr_t *args, char **buf) { const struct ast_sip_contact *contact = obj; - return (ast_asprintf(buf, "%ld", contact->expiration_time.tv_sec) < 0) ? -1 : 0; + char secs[AST_TIME_T_LEN]; + + ast_time_t_to_string(contact->expiration_time.tv_sec, secs, sizeof(secs)); + return (ast_asprintf(buf, "%s", secs) < 0) ? -1 : 0; } static int permanent_uri_sort_fn(const void *obj_left, const void *obj_right, int flags) diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/res/res_pjsip/pjsip_config.xml asterisk-18.12.0~dfsg+~cs6.12.40431413/res/res_pjsip/pjsip_config.xml --- asterisk-18.11.2~dfsg+~cs6.10.40431413/res/res_pjsip/pjsip_config.xml 2022-04-14 21:53:34.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/res/res_pjsip/pjsip_config.xml 2022-05-12 11:50:59.000000000 +0000 @@ -1622,7 +1622,7 @@ will not suffice. - Number of simultaneous Asynchronous Operations + Number of simultaneous Asynchronous Operations, can no longer be set, always set to 1 IP Address and optional port to bind to for this transport @@ -2348,6 +2348,17 @@ Advertise support for RFC4488 REFER subscription suppression + + Allow 180 after 183 + + Allow Asterisk to send 180 Ringing to an endpoint + after 183 Session Progress has been send. + If disabled Asterisk will instead send only a + 183 Session Progress to the endpoint. + (default: "no") + + + diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/res/res_pjsip/pjsip_options.c asterisk-18.12.0~dfsg+~cs6.12.40431413/res/res_pjsip/pjsip_options.c --- asterisk-18.11.2~dfsg+~cs6.10.40431413/res/res_pjsip/pjsip_options.c 2022-04-14 21:53:34.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/res/res_pjsip/pjsip_options.c 2022-05-12 11:50:59.000000000 +0000 @@ -2722,6 +2722,7 @@ struct ast_sip_contact_status *status; struct ast_str *buf; const struct ast_sip_endpoint *endpoint = ami->arg; + char secs[AST_TIME_T_LEN]; buf = ast_sip_create_ami_event("ContactStatusDetail", ami); if (!buf) { @@ -2733,7 +2734,8 @@ ast_str_append(&buf, 0, "AOR: %s\r\n", wrapper->aor_id); ast_str_append(&buf, 0, "URI: %s\r\n", contact->uri); ast_str_append(&buf, 0, "UserAgent: %s\r\n", contact->user_agent); - ast_str_append(&buf, 0, "RegExpire: %ld\r\n", contact->expiration_time.tv_sec); + ast_time_t_to_string(contact->expiration_time.tv_sec, secs, sizeof(secs)); + ast_str_append(&buf, 0, "RegExpire: %s\r\n", secs); if (!ast_strlen_zero(contact->via_addr)) { ast_str_append(&buf, 0, "ViaAddress: %s", contact->via_addr); if (contact->via_port) { diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/res/res_pjsip_header_funcs.c asterisk-18.12.0~dfsg+~cs6.12.40431413/res/res_pjsip_header_funcs.c --- asterisk-18.11.2~dfsg+~cs6.10.40431413/res/res_pjsip_header_funcs.c 2022-04-14 21:53:34.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/res/res_pjsip_header_funcs.c 2022-05-12 11:50:59.000000000 +0000 @@ -146,6 +146,11 @@ + + 16.20.0 + 18.6.0 + 19.0.0 + Gets the list of SIP header names from an INVITE message. @@ -747,7 +752,6 @@ */ static void outgoing_request(struct ast_sip_session *session, pjsip_tx_data * tdata) { - pj_pool_t *pool = session->inv_session->dlg->pool; struct hdr_list *list; struct hdr_list_entry *le; RAII_VAR(struct ast_datastore *, datastore, @@ -760,7 +764,7 @@ list = datastore->data; AST_LIST_TRAVERSE(list, le, nextptr) { - pjsip_msg_add_hdr(tdata->msg, (pjsip_hdr *) pjsip_hdr_clone(pool, le->hdr)); + pjsip_msg_add_hdr(tdata->msg, (pjsip_hdr *) pjsip_hdr_clone(tdata->pool, le->hdr)); } ast_sip_session_remove_datastore(session, datastore->uid); } diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/res/res_pjsip_history.c asterisk-18.12.0~dfsg+~cs6.12.40431413/res/res_pjsip_history.c --- asterisk-18.11.2~dfsg+~cs6.10.40431413/res/res_pjsip_history.c 2022-04-14 21:53:34.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/res/res_pjsip_history.c 2022-05-12 11:50:59.000000000 +0000 @@ -199,7 +199,7 @@ { struct timeval right = { 0, }; - if (sscanf(op_right->field, "%ld", &right.tv_sec) != 1) { + if ((right.tv_sec = ast_string_to_time_t(op_right->field)) == -1) { ast_log(LOG_WARNING, "Unable to extract field '%s': not a timestamp\n", op_right->field); return -1; } @@ -270,7 +270,7 @@ { struct timeval right = { 0, }; - if (sscanf(op_right->field, "%ld", &right.tv_sec) != 1) { + if ((right.tv_sec = ast_string_to_time_t(op_right->field)) == -1) { ast_log(LOG_WARNING, "Unable to extract field '%s': not a timestamp\n", op_right->field); return -1; } @@ -319,7 +319,7 @@ { struct timeval right = { 0, }; - if (sscanf(op_right->field, "%ld", &right.tv_sec) != 1) { + if ((right.tv_sec = ast_string_to_time_t(op_right->field)) == -1) { ast_log(LOG_WARNING, "Unable to extract field '%s': not a timestamp\n", op_right->field); return -1; } @@ -656,7 +656,7 @@ /*! \brief Format single line history entry */ static void sprint_list_entry(struct pjsip_history_entry *entry, char *line, int len) { - char addr[64]; + char addr[64], secs[AST_TIME_T_LEN]; if (entry->transmitted) { pj_sockaddr_print(&entry->dst, addr, sizeof(addr), 3); @@ -664,22 +664,24 @@ pj_sockaddr_print(&entry->src, addr, sizeof(addr), 3); } + ast_time_t_to_string(entry->timestamp.tv_sec, secs, sizeof(secs)); + if (entry->msg->type == PJSIP_REQUEST_MSG) { char uri[128]; pjsip_uri_print(PJSIP_URI_IN_REQ_URI, entry->msg->line.req.uri, uri, sizeof(uri)); - snprintf(line, len, "%-5.5d %-10.10ld %-5.5s %-24.24s %.*s %s SIP/2.0", + snprintf(line, len, "%-5.5d %-10.10s %-5.5s %-24.24s %.*s %s SIP/2.0", entry->number, - entry->timestamp.tv_sec, + secs, entry->transmitted ? "* ==>" : "* <==", addr, (int)pj_strlen(&entry->msg->line.req.method.name), pj_strbuf(&entry->msg->line.req.method.name), uri); } else { - snprintf(line, len, "%-5.5d %-10.10ld %-5.5s %-24.24s SIP/2.0 %u %.*s", + snprintf(line, len, "%-5.5d %-10.10s %-5.5s %-24.24s SIP/2.0 %u %.*s", entry->number, - entry->timestamp.tv_sec, + secs, entry->transmitted ? "* ==>" : "* <==", addr, entry->msg->line.status.code, @@ -1149,7 +1151,7 @@ /*! \brief Print a detailed view of a single entry in the history to the CLI */ static void display_single_entry(struct ast_cli_args *a, struct pjsip_history_entry *entry) { - char addr[64]; + char addr[64], secs[AST_TIME_T_LEN]; char *buf; buf = ast_calloc(1, PJSIP_MAX_PKT_LEN * sizeof(char)); @@ -1169,11 +1171,12 @@ pj_sockaddr_print(&entry->src, addr, sizeof(addr), 3); } - ast_cli(a->fd, "<--- History Entry %d %s %s at %-10.10ld --->\n", + ast_time_t_to_string(entry->timestamp.tv_sec, secs, sizeof(secs)); + ast_cli(a->fd, "<--- History Entry %d %s %s at %-10.10s --->\n", entry->number, entry->transmitted ? "Sent to" : "Received from", addr, - entry->timestamp.tv_sec); + secs); ast_cli(a->fd, "%s\n", buf); ast_free(buf); diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/res/res_pjsip_pubsub.c asterisk-18.12.0~dfsg+~cs6.12.40431413/res/res_pjsip_pubsub.c --- asterisk-18.11.2~dfsg+~cs6.10.40431413/res/res_pjsip_pubsub.c 2022-04-14 21:53:34.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/res/res_pjsip_pubsub.c 2022-05-12 11:50:59.000000000 +0000 @@ -1257,7 +1257,14 @@ const char *resource, const char *display_name, struct sip_subscription_tree *tree) { struct ast_sip_subscription *sub; - pjsip_sip_uri *contact_uri; + pjsip_msg *msg; + pjsip_sip_uri *request_uri; + + msg = ast_sip_mod_data_get(tree->dlg->mod_data, pubsub_module.id, MOD_DATA_MSG); + if (!msg) { + ast_log(LOG_ERROR, "No dialog message saved for SIP subscription. Cannot allocate subscription for resource %s\n", resource); + return NULL; + } sub = ast_calloc(1, sizeof(*sub) + strlen(resource) + 1); if (!sub) { @@ -1280,8 +1287,8 @@ } sub->uri = pjsip_sip_uri_create(tree->dlg->pool, PJ_FALSE); - contact_uri = pjsip_uri_get_uri(tree->dlg->local.contact->uri); - pjsip_sip_uri_assign(tree->dlg->pool, sub->uri, contact_uri); + request_uri = pjsip_uri_get_uri(msg->line.req.uri); + pjsip_sip_uri_assign(tree->dlg->pool, sub->uri, request_uri); pj_strdup2(tree->dlg->pool, &sub->uri->user, resource); /* If there is any persistence information available for this subscription that was persisted @@ -4872,7 +4879,11 @@ static int persistence_expires_struct2str(const void *obj, const intptr_t *args, char **buf) { const struct subscription_persistence *persistence = obj; - return (ast_asprintf(buf, "%ld", persistence->expires.tv_sec) < 0) ? -1 : 0; + char secs[AST_TIME_T_LEN]; + + ast_time_t_to_string(persistence->expires.tv_sec, secs, sizeof(secs)); + + return (ast_asprintf(buf, "%s", secs) < 0) ? -1 : 0; } #define RESOURCE_LIST_INIT_SIZE 4 diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/res/res_pjsip_registrar.c asterisk-18.12.0~dfsg+~cs6.12.40431413/res/res_pjsip_registrar.c --- asterisk-18.11.2~dfsg+~cs6.10.40431413/res/res_pjsip_registrar.c 2022-04-14 21:53:34.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/res/res_pjsip_registrar.c 2022-05-12 11:50:59.000000000 +0000 @@ -1365,12 +1365,13 @@ { struct ao2_container *contacts; struct ast_variable *var; - char *time = alloca(64); + char time[AST_TIME_T_LEN]; while (check_interval) { sleep(check_interval); - sprintf(time, "%ld", ast_tvnow().tv_sec); + ast_time_t_to_string(ast_tvnow().tv_sec, time, sizeof(time)); + var = ast_variable_new("expiration_time <=", time, ""); ast_debug(4, "Woke up at %s Interval: %d\n", time, check_interval); diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/res/res_pjsip_sdp_rtp.c asterisk-18.12.0~dfsg+~cs6.12.40431413/res/res_pjsip_sdp_rtp.c --- asterisk-18.11.2~dfsg+~cs6.10.40431413/res/res_pjsip_sdp_rtp.c 2022-04-14 21:53:34.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/res/res_pjsip_sdp_rtp.c 2022-05-12 11:50:59.000000000 +0000 @@ -106,9 +106,10 @@ { struct ast_sip_session_media *session_media = (struct ast_sip_session_media *)data; struct ast_rtp_instance *rtp = session_media->rtp; + struct ast_channel *chan; int elapsed; + int now; int timeout; - struct ast_channel *chan; if (!rtp) { return 0; @@ -119,41 +120,37 @@ return 0; } - /* Get channel lock to make sure that we access a consistent set of values - * (last_rx and direct_media_addr) - the lock is held when values are modified - * (see send_direct_media_request()/check_for_rtp_changes() in chan_pjsip.c). We - * are trying to avoid a situation where direct_media_addr has been reset but the - * last-rx time was not set yet. - */ - ast_channel_lock(chan); - - elapsed = time(NULL) - ast_rtp_instance_get_last_rx(rtp); + /* Store these values locally to avoid multiple function calls */ + now = time(NULL); timeout = ast_rtp_instance_get_timeout(rtp); - if (elapsed < timeout) { - ast_channel_unlock(chan); + + /* If the channel is not in UP state or call is redirected + * outside Asterisk return for later check. + */ + if (ast_channel_state(chan) != AST_STATE_UP || !ast_sockaddr_isnull(&session_media->direct_media_addr)) { + /* Avoiding immediately disconnect after channel up or direct media has been stopped */ + ast_rtp_instance_set_last_rx(rtp, now); ast_channel_unref(chan); - return (timeout - elapsed) * 1000; + /* Recheck after half timeout for avoiding possible races + * and faster reacting to cases while there is no an RTP at all. + */ + return timeout * 500; } - /* Last RTP packet was received too long ago - * - disconnect channel unless direct media is in use. - */ - if (!ast_sockaddr_isnull(&session_media->direct_media_addr)) { - ast_debug_rtp(3, "(%p) RTP not disconnecting channel '%s' for lack of %s RTP activity in %d seconds " - "since direct media is in use\n", rtp, ast_channel_name(chan), - ast_codec_media_type2str(session_media->type), elapsed); - ast_channel_unlock(chan); + elapsed = now - ast_rtp_instance_get_last_rx(rtp); + if (elapsed < timeout) { ast_channel_unref(chan); - return timeout * 1000; /* recheck later, direct media may have ended then */ + return (timeout - elapsed) * 1000; } ast_log(LOG_NOTICE, "Disconnecting channel '%s' for lack of %s RTP activity in %d seconds\n", ast_channel_name(chan), ast_codec_media_type2str(session_media->type), elapsed); + ast_channel_lock(chan); ast_channel_hangupcause_set(chan, AST_CAUSE_REQUESTED_CHAN_UNAVAIL); - ast_softhangup(chan, AST_SOFTHANGUP_DEV); - ast_channel_unlock(chan); + + ast_softhangup(chan, AST_SOFTHANGUP_DEV); ast_channel_unref(chan); return 0; @@ -2234,8 +2231,7 @@ } if (ast_rtp_instance_get_timeout(session_media->rtp)) { - session_media->timeout_sched_id = ast_sched_add_variable(sched, - ast_rtp_instance_get_timeout(session_media->rtp) * 1000, rtp_check_timeout, + session_media->timeout_sched_id = ast_sched_add_variable(sched, 500, rtp_check_timeout, session_media, 1); } diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/res/res_pjsip_stir_shaken.c asterisk-18.12.0~dfsg+~cs6.12.40431413/res/res_pjsip_stir_shaken.c --- asterisk-18.11.2~dfsg+~cs6.10.40431413/res/res_pjsip_stir_shaken.c 2022-04-14 21:53:34.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/res/res_pjsip_stir_shaken.c 2022-05-12 11:50:59.000000000 +0000 @@ -225,8 +225,13 @@ } profile = ast_stir_shaken_get_profile(session->endpoint->stir_shaken_profile); + /* Profile should be checked first as it takes priority over anything else. + * If there is a profile and it doesn't have verification enabled, do nothing. + * If there is no profile and the stir_shaken option is either not set or does + * not support verification, do nothing. + */ if ((profile && !ast_stir_shaken_profile_supports_verification(profile)) - && ((session->endpoint->stir_shaken & AST_SIP_STIR_SHAKEN_VERIFY) == 0)) { + || (!profile && (session->endpoint->stir_shaken & AST_SIP_STIR_SHAKEN_VERIFY) == 0)) { return 0; } @@ -478,8 +483,13 @@ RAII_VAR(struct stir_shaken_profile *, profile, NULL, ao2_cleanup); profile = ast_stir_shaken_get_profile(session->endpoint->stir_shaken_profile); + /* Profile should be checked first as it takes priority over anything else. + * If there is a profile and it doesn't have attestation enabled, do nothing. + * If there is no profile and the stir_shaken option is either not set or does + * not support attestation, do nothing. + */ if ((profile && !ast_stir_shaken_profile_supports_attestation(profile)) - && ((session->endpoint->stir_shaken & AST_SIP_STIR_SHAKEN_ATTEST) == 0)) { + || (!profile && (session->endpoint->stir_shaken & AST_SIP_STIR_SHAKEN_ATTEST) == 0)) { return; } diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/res/res_rtp_asterisk.c asterisk-18.12.0~dfsg+~cs6.12.40431413/res/res_rtp_asterisk.c --- asterisk-18.11.2~dfsg+~cs6.10.40431413/res/res_rtp_asterisk.c 2022-04-14 21:53:34.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/res/res_rtp_asterisk.c 2022-05-12 11:50:59.000000000 +0000 @@ -47,6 +47,7 @@ #include #ifdef HAVE_OPENSSL +#define OPENSSL_SUPPRESS_DEPRECATED 1 #include #include #if !defined(OPENSSL_NO_SRTP) && (OPENSSL_VERSION_NUMBER >= 0x10001000L) diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/res/res_speech_aeap.c asterisk-18.12.0~dfsg+~cs6.12.40431413/res/res_speech_aeap.c --- asterisk-18.11.2~dfsg+~cs6.10.40431413/res/res_speech_aeap.c 1970-01-01 00:00:00.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/res/res_speech_aeap.c 2022-05-12 11:50:59.000000000 +0000 @@ -0,0 +1,731 @@ +/* + * Asterisk -- An open source telephony toolkit. + * + * Copyright (C) 2021, Sangoma Technologies Corporation + * + * Kevin Harwell + * + * See http://www.asterisk.org for more information about + * the Asterisk project. Please do not directly contact + * any of the maintainers of this project for assistance; + * the project provides a web site, mailing lists and IRC + * channels for your use. + * + * This program is free software, distributed under the terms of + * the GNU General Public License Version 2. See the LICENSE file + * at the top of the source tree. + */ + +/*! \file + * + * \brief Asterisk External Application Speech Engine + * + */ + +/*** MODULEINFO + core + ***/ + +#include "asterisk.h" + +#include "asterisk/astobj2.h" +#include "asterisk/config.h" +#include "asterisk/format.h" +#include "asterisk/format_cap.h" +#include "asterisk/json.h" +#include "asterisk/module.h" +#include "asterisk/speech.h" +#include "asterisk/sorcery.h" + +#include "asterisk/res_aeap.h" +#include "asterisk/res_aeap_message.h" + +#define SPEECH_AEAP_VERSION "0.1.0" +#define SPEECH_PROTOCOL "speech_to_text" + +#define CONNECTION_TIMEOUT 2000 + +#define log_error(obj, fmt, ...) \ + ast_log(LOG_ERROR, "AEAP speech (%p): " fmt "\n", obj, ##__VA_ARGS__) + +static struct ast_json *custom_fields_to_params(const struct ast_variable *variables) +{ + const struct ast_variable *i; + struct ast_json *obj; + + if (!variables) { + return NULL; + } + + obj = ast_json_object_create(); + if (!obj) { + return NULL; + } + + for (i = variables; i; i = i->next) { + if (i->name[0] == '@' && i->name[1]) { + ast_json_object_set(obj, i->name + 1, ast_json_string_create(i->value)); + } + } + + return obj; +} + +/*! + * \internal + * \brief Create, and send a request to the external application + * + * Create, then sends a request to an Asterisk external application, and then blocks + * until a response is received or a time out occurs. Since this method waits until + * receiving a response the returned result is guaranteed to be pass/fail based upon + * a response handler's result. + * + * \param name The name of the request to send + * \param json The core json request data + * \param data Optional user data to associate with request/response + * + * \returns 0 on success, -1 on error + */ +static int speech_aeap_send_request(struct ast_aeap *aeap, const char *name, + struct ast_json *json, void *obj) +{ + /* + * Wait for a response. Also since we're blocking, + * data is expected to be on the stack so no cleanup required. + */ + struct ast_aeap_tsx_params tsx_params = { + .timeout = 1000, + .wait = 1, + .obj = obj, + }; + + /* "steals" the json ref */ + tsx_params.msg = ast_aeap_message_create_request( + ast_aeap_message_type_json, name, NULL, json); + if (!tsx_params.msg) { + return -1; + } + + /* Send "steals" the json msg ref */ + return ast_aeap_send_msg_tsx(aeap, &tsx_params); +} + +/*! + * \internal + * \brief Create, and send a "get" request to an external application + * + * Basic structure of the JSON message to send: + * + * { param: [, ...] } + * + * \param speech The speech engine + * \param param The name of the parameter to retrieve + * \param data User data passed to the response handler + * + * \returns 0 on success, -1 on error + */ +static int speech_aeap_get(struct ast_speech *speech, const char *param, void *data) +{ + if (!param) { + return -1; + } + + /* send_request handles json ref */ + return speech_aeap_send_request(speech->data, + "get", ast_json_pack("{s:[s]}", "params", param), data); +} + +struct speech_param { + const char *name; + const char *value; +}; + +/*! + * \internal + * \brief Create, and send a "set" request to an external application + * + * Basic structure of the JSON message to send: + * + * { params: { : } } + * + * \param speech The speech engine + * \param name The name of the parameter to set + * \param value The value of the parameter to set + * + * \returns 0 on success, -1 on error + */ +static int speech_aeap_set(struct ast_speech *speech, const char *name, const char *value) +{ + if (!name) { + return -1; + } + + /* send_request handles json ref */ + return speech_aeap_send_request(speech->data, + "set", ast_json_pack("{s:{s:s}}", "params", name, value), NULL); +} + +static int handle_response_set(struct ast_aeap *aeap, struct ast_aeap_message *message, void *data) +{ + return 0; +} + +struct speech_setting { + const char *param; + size_t len; + char *buf; +}; + +static int handle_setting(struct ast_aeap *aeap, struct ast_json_iter *iter, + struct speech_setting *setting) +{ + const char *value; + + if (strcmp(ast_json_object_iter_key(iter), setting->param)) { + log_error(aeap, "Unable to 'get' speech setting for '%s'", setting->param); + return -1; + } + + value = ast_json_string_get(ast_json_object_iter_value(iter)); + if (!value) { + log_error(aeap, "No value for speech setting '%s'", setting->param); + return -1; + } + + ast_copy_string(setting->buf, value, setting->len); + return 0; +} + +static int handle_results(struct ast_aeap *aeap, struct ast_json_iter *iter, + struct ast_speech_result **speech_results) +{ + struct ast_speech_result *result = NULL; + struct ast_json *json_results; + struct ast_json *json_result; + size_t i; + + json_results = ast_json_object_iter_value(iter); + if (!json_results || !speech_results) { + log_error(aeap, "Unable to 'get' speech results"); + return -1; + } + + for (i = 0; i < ast_json_array_size(json_results); ++i) { + if (!(result = ast_calloc(1, sizeof(*result)))) { + continue; + } + + json_result = ast_json_array_get(json_results, i); + + result->text = ast_strdup(ast_json_object_string_get(json_result, "text")); + result->score = ast_json_object_integer_get(json_result, "score"); + result->grammar = ast_strdup(ast_json_object_string_get(json_result, "grammar")); + result->nbest_num = ast_json_object_integer_get(json_result, "best"); + if (*speech_results) { + AST_LIST_NEXT(result, list) = *speech_results; + *speech_results = result; + } else { + *speech_results = result; + } + } + + return 0; +} + +/*! + * \internal + * \brief Handle a "get" response from an external application + * + * Basic structure of the expected JSON message to received: + * + * { + * response: "get" + * "params" : { : | [ ] } + * } + * + * \param speech The speech engine + * \param param The name of the parameter to retrieve + * \param data User data passed to the response handler + * + * \returns 0 on success, -1 on error + */ +static int handle_response_get(struct ast_aeap *aeap, struct ast_aeap_message *message, void *data) +{ + struct ast_json_iter *iter; + + iter = ast_json_object_iter(ast_json_object_get(ast_aeap_message_data(message), "params")); + if (!iter) { + log_error(aeap, "no 'get' parameters returned"); + return -1; + } + + if (!strcmp(ast_json_object_iter_key(iter), "results")) { + return handle_results(aeap, iter, data); + } + + return handle_setting(aeap, iter, data); +} + +static int handle_response_setup(struct ast_aeap *aeap, struct ast_aeap_message *message, void *data) +{ + struct ast_format *format = data; + struct ast_json *json = ast_aeap_message_data(message); + const char *codec_name; + + if (!json) { + log_error(aeap, "no 'setup' object returned"); + return -1; + } + + json = ast_json_object_get(json, "codecs"); + if (!json || ast_json_array_size(json) == 0) { + log_error(aeap, "no 'setup' codecs available"); + return -1; + } + + codec_name = ast_json_object_string_get(ast_json_array_get(json, 0), "name"); + if (!codec_name || strcmp(codec_name, ast_format_get_codec_name(format))) { + log_error(aeap, "setup codec '%s' unsupported", ast_format_get_codec_name(format)); + return -1; + } + + return 0; +} + +static const struct ast_aeap_message_handler response_handlers[] = { + { "setup", handle_response_setup }, + { "get", handle_response_get }, + { "set", handle_response_set }, +}; + +static int handle_request_set(struct ast_aeap *aeap, struct ast_aeap_message *message, void *data) +{ + struct ast_json_iter *iter; + const char *error_msg = NULL; + + iter = ast_json_object_iter(ast_json_object_get(ast_aeap_message_data(message), "params")); + if (!iter) { + error_msg = "no parameter(s) requested"; + } else if (!strcmp(ast_json_object_iter_key(iter), "results")) { + struct ast_speech *speech = ast_aeap_user_data_object_by_id(aeap, "speech"); + + if (!speech) { + error_msg = "no associated speech object"; + } else if (handle_results(aeap, iter, &speech->results)) { + error_msg = "unable to handle results"; + } else { + ast_speech_change_state(speech, AST_SPEECH_STATE_DONE); + } + } else { + error_msg = "can only set 'results'"; + } + + if (error_msg) { + log_error(aeap, "set - %s", error_msg); + message = ast_aeap_message_create_error(ast_aeap_message_type_json, + ast_aeap_message_name(message), ast_aeap_message_id(message), error_msg); + } else { + message = ast_aeap_message_create_response(ast_aeap_message_type_json, + ast_aeap_message_name(message), ast_aeap_message_id(message), NULL); + } + + ast_aeap_send_msg(aeap, message); + + return 0; +} + +static const struct ast_aeap_message_handler request_handlers[] = { + { "set", handle_request_set }, +}; + +static struct ast_aeap_params speech_aeap_params = { + .response_handlers = response_handlers, + .response_handlers_size = ARRAY_LEN(response_handlers), + .request_handlers = request_handlers, + .request_handlers_size = ARRAY_LEN(request_handlers), +}; + +/*! + * \internal + * \brief Create, and connect to an external application and send initial setup + * + * Basic structure of the JSON message to send: + * + * { + * "request": "setup" + * "codecs": [ + * { + * "name": , + * "attributes": { : , ..., } + * }, + * ..., + * ], + * "params": { : , ..., } + * } + * + * \param speech The speech engine + * \param format The format codec to use + * + * \returns 0 on success, -1 on error + */ +static int speech_aeap_engine_create(struct ast_speech *speech, struct ast_format *format) +{ + struct ast_aeap *aeap; + struct ast_variable *vars; + struct ast_json *json; + + aeap = ast_aeap_create_and_connect_by_id( + speech->engine->name, &speech_aeap_params, CONNECTION_TIMEOUT); + if (!aeap) { + return -1; + } + + speech->data = aeap; + + /* Don't allow unloading of this module while an external application is in use */ + ast_module_ref(ast_module_info->self); + + vars = ast_aeap_custom_fields_get(speech->engine->name); + + /* While the protocol allows sending of codec attributes, for now don't */ + json = ast_json_pack("{s:s,s:[{s:s}],s:o*}", "version", SPEECH_AEAP_VERSION, "codecs", + "name", ast_format_get_codec_name(format), "params", custom_fields_to_params(vars)); + + ast_variables_destroy(vars); + + if (ast_aeap_user_data_register(aeap, "speech", speech, NULL)) { + ast_module_unref(ast_module_info->self); + return -1; + } + + /* send_request handles json ref */ + if (speech_aeap_send_request(speech->data, "setup", json, format)) { + ast_module_unref(ast_module_info->self); + return -1; + } + + /* + * Add a reference to the engine here, so if it happens to get unregistered + * while executing it won't disappear. + */ + ao2_ref(speech->engine, 1); + + return 0; +} + +static int speech_aeap_engine_destroy(struct ast_speech *speech) +{ + ao2_ref(speech->engine, -1); + ao2_cleanup(speech->data); + + ast_module_unref(ast_module_info->self); + + return 0; +} + +static int speech_aeap_engine_write(struct ast_speech *speech, void *data, int len) +{ + return ast_aeap_send_binary(speech->data, data, len); +} + +static int speech_aeap_engine_dtmf(struct ast_speech *speech, const char *dtmf) +{ + return speech_aeap_set(speech, "dtmf", dtmf); +} + +static int speech_aeap_engine_start(struct ast_speech *speech) +{ + ast_speech_change_state(speech, AST_SPEECH_STATE_READY); + + return 0; +} + +static int speech_aeap_engine_change(struct ast_speech *speech, const char *name, const char *value) +{ + return speech_aeap_set(speech, name, value); +} + +static int speech_aeap_engine_get_setting(struct ast_speech *speech, const char *name, + char *buf, size_t len) +{ + struct speech_setting setting = { + .param = name, + .len = len, + .buf = buf, + }; + + return speech_aeap_get(speech, name, &setting); +} + +static int speech_aeap_engine_change_results_type(struct ast_speech *speech, + enum ast_speech_results_type results_type) +{ + return speech_aeap_set(speech, "results_type", + ast_speech_results_type_to_string(results_type)); +} + +static struct ast_speech_result *speech_aeap_engine_get(struct ast_speech *speech) +{ + struct ast_speech_result *results = NULL; + + if (speech->results) { + return speech->results; + } + + if (speech_aeap_get(speech, "results", &results)) { + return NULL; + } + + return results; +} + +static void speech_engine_destroy(void *obj) +{ + struct ast_speech_engine *engine = obj; + + ao2_cleanup(engine->formats); + ast_free(engine->name); +} + +static struct ast_speech_engine *speech_engine_alloc(const char *name) +{ + struct ast_speech_engine *engine; + + engine = ao2_t_alloc_options(sizeof(*engine), speech_engine_destroy, + AO2_ALLOC_OPT_LOCK_NOLOCK, name); + if (!engine) { + ast_log(LOG_ERROR, "AEAP speech: unable create engine '%s'\n", name); + return NULL; + } + + engine->name = ast_strdup(name); + if (!engine->name) { + ao2_ref(engine, -1); + return NULL; + } + + engine->create = speech_aeap_engine_create; + engine->destroy = speech_aeap_engine_destroy; + engine->write = speech_aeap_engine_write; + engine->dtmf = speech_aeap_engine_dtmf; + engine->start = speech_aeap_engine_start; + engine->change = speech_aeap_engine_change; + engine->get_setting = speech_aeap_engine_get_setting; + engine->change_results_type = speech_aeap_engine_change_results_type; + engine->get = speech_aeap_engine_get; + + engine->formats = ast_format_cap_alloc(AST_FORMAT_CAP_FLAG_DEFAULT); + + return engine; +} + +static void speech_engine_alloc_and_register(const char *name, const struct ast_format_cap *formats) +{ + struct ast_speech_engine *engine; + + engine = speech_engine_alloc(name); + if (!engine) { + return; + } + + if (formats && ast_format_cap_append_from_cap(engine->formats, + formats, AST_MEDIA_TYPE_AUDIO)) { + ast_log(LOG_WARNING, "AEAP speech: Unable to add engine '%s' formats\n", name); + ao2_ref(engine, -1); + return; + } + + if (ast_speech_register(engine)) { + ast_log(LOG_WARNING, "AEAP speech: Unable to register engine '%s'\n", name); + ao2_ref(engine, -1); + } +} + +#ifdef TEST_FRAMEWORK + +static void speech_engine_alloc_and_register2(const char *name, const char *codec_names) +{ + struct ast_speech_engine *engine; + + engine = speech_engine_alloc(name); + if (!engine) { + return; + } + + if (codec_names && ast_format_cap_update_by_allow_disallow(engine->formats, codec_names, 1)) { + ast_log(LOG_WARNING, "AEAP speech: Unable to add engine '%s' codecs\n", name); + ao2_ref(engine, -1); + return; + } + + if (ast_speech_register(engine)) { + ast_log(LOG_WARNING, "AEAP speech: Unable to register engine '%s'\n", name); + ao2_ref(engine, -1); + } +} + +#endif + +static int unload_engine(void *obj, void *arg, int flags) +{ + if (ast_aeap_client_config_has_protocol(obj, SPEECH_PROTOCOL)) { + ao2_cleanup(ast_speech_unregister2(ast_sorcery_object_get_id(obj))); + } + + return 0; +} + +static int load_engine(void *obj, void *arg, int flags) +{ + const char *id; + const struct ast_format_cap *formats; + const struct ast_speech_engine *engine; + + if (!ast_aeap_client_config_has_protocol(obj, SPEECH_PROTOCOL)) { + return 0; + } + + id = ast_sorcery_object_get_id(obj); + formats = ast_aeap_client_config_codecs(obj); + if (!formats) { + formats = ast_format_cap_alloc(AST_FORMAT_CAP_FLAG_DEFAULT); + if (!formats) { + ast_log(LOG_ERROR, "AEAP speech: unable to allocate default engine format for '%s'\n", id); + return 0; + } + } + + engine = ast_speech_find_engine(id); + if (!engine) { + speech_engine_alloc_and_register(id, formats); + return 0; + } + + if (ast_format_cap_identical(formats, engine->formats)) { + /* Same name, same formats then nothing changed */ + return 0; + } + + ao2_ref(ast_speech_unregister2(engine->name), -1); + speech_engine_alloc_and_register(id, formats); + + return 0; +} + +static int matches_engine(void *obj, void *arg, int flags) +{ + const struct ast_speech_engine *engine = arg; + + return strcmp(ast_sorcery_object_get_id(obj), engine->name) ? 0 : CMP_MATCH; +} + +static int should_unregister(const struct ast_speech_engine *engine, void *data) +{ + void *obj; + + if (engine->create != speech_aeap_engine_create) { + /* Only want to potentially unregister AEAP speech engines */ + return 0; + } + +#ifdef TEST_FRAMEWORK + if (!strcmp("_aeap_test_speech_", engine->name)) { + /* Don't remove the test engine */ + return 0; + } +#endif + + obj = ao2_callback(data, 0, matches_engine, (void*)engine); + + if (obj) { + ao2_ref(obj, -1); + return 0; + } + + /* If no match in given container then unregister engine */ + return 1; +} + +static void speech_observer_loaded(const char *object_type) +{ + struct ao2_container *container; + + if (strcmp(object_type, AEAP_CONFIG_CLIENT)) { + return; + } + + container = ast_aeap_client_configs_get(SPEECH_PROTOCOL); + if (!container) { + return; + } + + /* + * An AEAP module reload has occurred. First + * remove all engines that no longer exist. + */ + ast_speech_unregister_engines(should_unregister, container, __ao2_cleanup); + + /* Now add or update engines */ + ao2_callback(container, 0, load_engine, NULL); + ao2_ref(container, -1); +} + +/*! \brief Observer for AEAP reloads */ +static const struct ast_sorcery_observer speech_observer = { + .loaded = speech_observer_loaded, +}; + +static int unload_module(void) +{ + struct ao2_container *container; + +#ifdef TEST_FRAMEWORK + ao2_cleanup(ast_speech_unregister2("_aeap_test_speech_")); +#endif + + ast_sorcery_observer_remove(ast_aeap_sorcery(), AEAP_CONFIG_CLIENT, &speech_observer); + + container = ast_aeap_client_configs_get(SPEECH_PROTOCOL); + if (container) { + ao2_callback(container, 0, unload_engine, NULL); + ao2_ref(container, -1); + } + + return 0; +} + +static int load_module(void) +{ + struct ao2_container *container; + + speech_aeap_params.msg_type = ast_aeap_message_type_json; + + container = ast_aeap_client_configs_get(SPEECH_PROTOCOL); + if (container) { + ao2_callback(container, 0, load_engine, NULL); + ao2_ref(container, -1); + } + + /* + * Add an observer since a named speech server must be created, + * registered, and eventually removed for all AEAP client + * configuration matching the "speech_to_text" protocol. + */ + if (ast_sorcery_observer_add(ast_aeap_sorcery(), AEAP_CONFIG_CLIENT, &speech_observer)) { + return AST_MODULE_LOAD_DECLINE; + } + +#ifdef TEST_FRAMEWORK + speech_engine_alloc_and_register2("_aeap_test_speech_", "ulaw"); +#endif + + return AST_MODULE_LOAD_SUCCESS; +} + +AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_LOAD_ORDER, "Asterisk External Application Speech Engine", + .support_level = AST_MODULE_SUPPORT_CORE, + .load = load_module, + .unload = unload_module, + .load_pri = AST_MODPRI_CHANNEL_DEPEND, + .requires = "res_speech,res_aeap", +); diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/res/res_speech.c asterisk-18.12.0~dfsg+~cs6.12.40431413/res/res_speech.c --- asterisk-18.11.2~dfsg+~cs6.10.40431413/res/res_speech.c 2022-04-14 21:53:34.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/res/res_speech.c 2022-05-12 11:50:59.000000000 +0000 @@ -42,7 +42,7 @@ static struct ast_speech_engine *default_engine = NULL; /*! \brief Find a speech recognition engine of specified name, if NULL then use the default one */ -static struct ast_speech_engine *find_engine(const char *engine_name) +struct ast_speech_engine *ast_speech_find_engine(const char *engine_name) { struct ast_speech_engine *engine = NULL; @@ -185,7 +185,7 @@ RAII_VAR(struct ast_format *, best, NULL, ao2_cleanup); /* Try to find the speech recognition engine that was requested */ - if (!(engine = find_engine(engine_name))) + if (!(engine = ast_speech_find_engine(engine_name))) return NULL; joint = ast_format_cap_alloc(AST_FORMAT_CAP_FLAG_DEFAULT); @@ -313,7 +313,7 @@ } /* If an engine is already loaded with this name, error out */ - if (find_engine(engine->name)) { + if (ast_speech_find_engine(engine->name)) { ast_log(LOG_WARNING, "Speech recognition engine '%s' already exists.\n", engine->name); return -1; } @@ -366,6 +366,36 @@ return engine; } +void ast_speech_unregister_engines( + int (*should_unregister)(const struct ast_speech_engine *engine, void *data), void *data, + void (*on_unregistered)(void *obj)) +{ + struct ast_speech_engine *engine = NULL; + + if (!should_unregister) { + return; + } + + AST_RWLIST_WRLOCK(&engines); + AST_RWLIST_TRAVERSE_SAFE_BEGIN(&engines, engine, list) { + if (should_unregister(engine, data)) { + /* We have our engine... removed it */ + AST_RWLIST_REMOVE_CURRENT(list); + /* If this was the default engine, we need to pick a new one */ + if (engine == default_engine) { + default_engine = AST_RWLIST_FIRST(&engines); + } + ast_verb(2, "Unregistered speech recognition engine '%s'\n", engine->name); + /* All went well */ + if (on_unregistered) { + on_unregistered(engine); + } + } + } + AST_RWLIST_TRAVERSE_SAFE_END; + AST_RWLIST_UNLOCK(&engines); +} + static int unload_module(void) { /* We can not be unloaded */ diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/res/res_stir_shaken.c asterisk-18.12.0~dfsg+~cs6.12.40431413/res/res_stir_shaken.c --- asterisk-18.11.2~dfsg+~cs6.10.40431413/res/res_stir_shaken.c 2022-04-14 21:53:34.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/res/res_stir_shaken.c 2022-05-12 11:50:59.000000000 +0000 @@ -403,7 +403,7 @@ */ static void set_public_key_expiration(const char *public_cert_url, const struct curl_cb_data *data) { - char time_buf[32]; + char time_buf[32], secs[AST_TIME_T_LEN]; char *value; struct timeval actual_expires = ast_tvnow(); char hash[41]; @@ -441,7 +441,9 @@ actual_expires.tv_sec += EXPIRATION_BUFFER; } - snprintf(time_buf, sizeof(time_buf), "%30lu", actual_expires.tv_sec); + ast_time_t_to_string(actual_expires.tv_sec, secs, sizeof(secs)); + + snprintf(time_buf, sizeof(time_buf), "%30s", secs); ast_db_put(hash, "expiration", time_buf); } diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/res/res_tonedetect.c asterisk-18.12.0~dfsg+~cs6.12.40431413/res/res_tonedetect.c --- asterisk-18.11.2~dfsg+~cs6.10.40431413/res/res_tonedetect.c 2022-04-14 21:53:34.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/res/res_tonedetect.c 2022-05-12 11:50:59.000000000 +0000 @@ -46,6 +46,11 @@ /*** DOCUMENTATION + + 16.21.0 + 18.7.0 + 19.0.0 + Wait for tone @@ -94,6 +99,11 @@ + + 16.23.0 + 18.9.0 + 19.1.0 + Wait for period of time while scanning for call progress tones @@ -169,6 +179,11 @@ + + 16.21.0 + 18.7.0 + 19.0.0 + Asynchronously detects a tone diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/res/res.xml asterisk-18.12.0~dfsg+~cs6.12.40431413/res/res.xml --- asterisk-18.11.2~dfsg+~cs6.10.40431413/res/res.xml 2022-04-14 21:53:34.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/res/res.xml 2022-05-12 11:50:59.000000000 +0000 @@ -1,4 +1,4 @@ - + external no_binary_modules xmlstarlet diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/res/stasis_recording/stored.c asterisk-18.12.0~dfsg+~cs6.12.40431413/res/stasis_recording/stored.c --- asterisk-18.11.2~dfsg+~cs6.10.40431413/res/stasis_recording/stored.c 2022-04-14 21:53:34.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/res/stasis_recording/stored.c 2022-05-12 11:50:59.000000000 +0000 @@ -130,6 +130,7 @@ struct match_recording_data { const char *file; + size_t length; char *file_with_ext; }; @@ -160,7 +161,9 @@ int num; /* If not a recording or the names do not match the keep searching */ - if (!(num = is_recording(filename)) || strncmp(data->file, filename, num)) { + if (!(num = is_recording(filename)) + || data->length != num + || strncmp(data->file, filename, num)) { return 0; } @@ -186,6 +189,7 @@ { struct match_recording_data data = { .file = file, + .length = strlen(file), .file_with_ext = NULL }; diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/tests/test_aeap.c asterisk-18.12.0~dfsg+~cs6.12.40431413/tests/test_aeap.c --- asterisk-18.11.2~dfsg+~cs6.10.40431413/tests/test_aeap.c 1970-01-01 00:00:00.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/tests/test_aeap.c 2022-05-12 11:50:59.000000000 +0000 @@ -0,0 +1,252 @@ +/* + * Asterisk -- An open source telephony toolkit. + * + * Copyright (C) 2021, Sangoma Technologies Corporation + * + * Kevin Harwell + * + * See http://www.asterisk.org for more information about + * the Asterisk project. Please do not directly contact + * any of the maintainers of this project for assistance; + * the project provides a web site, mailing lists and IRC + * channels for your use. + * + * This program is free software, distributed under the terms of + * the GNU General Public License Version 2. See the LICENSE file + * at the top of the source tree. + */ + +/*** MODULEINFO + TEST_FRAMEWORK + res_aeap + core + ***/ + +#include "asterisk.h" + +#include "asterisk/test.h" +#include "asterisk/module.h" +#include "asterisk/file.h" +#include "asterisk/http_websocket.h" +#include "asterisk/json.h" + +#include "asterisk/res_aeap.h" +#include "asterisk/res_aeap_message.h" + +#define CATEGORY "/res/aeap/" + +#define ADDR "127.0.0.1:8088" +#define AEAP_TRANSPORT_TYPE "ws" +#define AEAP_REMOTE_URL "ws://" ADDR "/ws" +#define AEAP_REMOTE_PROTOCOL "echo" +#define AEAP_MESSAGE_ID "foo" +#define AEAP_CONNECTION_TIMEOUT 2000 + +AST_TEST_DEFINE(create_and_connect) +{ + RAII_VAR(struct ast_aeap *, aeap, NULL, ao2_cleanup); + + switch (cmd) { + case TEST_INIT: + info->name = __func__; + info->explicit_only = 0; + info->category = CATEGORY; + info->summary = "test creating and connecting to an AEAP application"; + info->description = info->summary; + return AST_TEST_NOT_RUN; + case TEST_EXECUTE: + break; + } + + ast_test_validate(test, (aeap = ast_aeap_create_and_connect(AEAP_TRANSPORT_TYPE, + NULL, AEAP_REMOTE_URL, AEAP_REMOTE_PROTOCOL, AEAP_CONNECTION_TIMEOUT))); + + return AST_TEST_PASS; +} + +static void handle_string(struct ast_aeap *aeap, const char *buf, intmax_t size) +{ + int *passed = ast_aeap_user_data_object_by_id(aeap, AEAP_MESSAGE_ID); + + if (strstr(buf, AEAP_MESSAGE_ID)) { + ++*passed; + } +} + +static void handle_timeout(struct ast_aeap *aeap, struct ast_aeap_message *message, void *data) +{ + int *passed = ast_aeap_user_data_object_by_id(aeap, AEAP_MESSAGE_ID); + + ++*passed; +} + +AST_TEST_DEFINE(send_msg_handle_string) +{ + int passed = 0; + RAII_VAR(struct ast_aeap *, aeap, NULL, ao2_cleanup); + struct ast_aeap_tsx_params tsx_params = {0}; + struct ast_aeap_params aeap_params = { + .on_string = handle_string, + }; + + switch (cmd) { + case TEST_INIT: + info->name = __func__; + info->explicit_only = 0; + info->category = CATEGORY; + info->summary = "test an AEAP application string handler"; + info->description = info->summary; + return AST_TEST_NOT_RUN; + case TEST_EXECUTE: + break; + } + + tsx_params.timeout = 2000; /* Test will end by timing out */ + tsx_params.on_timeout = handle_timeout; + tsx_params.wait = 1; + + ast_test_validate(test, (aeap = ast_aeap_create_and_connect(AEAP_TRANSPORT_TYPE, + &aeap_params, AEAP_REMOTE_URL, AEAP_REMOTE_PROTOCOL, AEAP_CONNECTION_TIMEOUT))); + + ast_test_validate(test, (!ast_aeap_user_data_register(aeap, AEAP_MESSAGE_ID, &passed, NULL))); + ast_test_validate(test, (tsx_params.msg = ast_aeap_message_create_request( + ast_aeap_message_type_json, "foo", AEAP_MESSAGE_ID, NULL))); + ast_test_validate(test, ast_aeap_send_msg_tsx(aeap, &tsx_params)); /* Returns fail on timeout */ + ast_aeap_user_data_unregister(aeap, AEAP_MESSAGE_ID); + + return passed == 2 ? AST_TEST_PASS : AST_TEST_FAIL; +} + +static int handle_msg(struct ast_aeap *aeap, struct ast_aeap_message *message, void *data) +{ + int *passed = ast_aeap_user_data_object_by_id(aeap, AEAP_MESSAGE_ID); + + *passed = !strcmp(ast_aeap_message_id(message), AEAP_MESSAGE_ID) && + ast_aeap_message_is_named(message, data); + + if (!*passed) { + ast_log(LOG_ERROR, "Name '%s' did not equal '%s' for message '%s'", + ast_aeap_message_name(message), (char *)data, ast_aeap_message_id(message)); + } + + return 0; +} + +static const struct ast_aeap_message_handler handlers[] = { + { "foo", handle_msg }, +}; + +AST_TEST_DEFINE(send_msg_handle_response) +{ + int passed = 0; + RAII_VAR(struct ast_aeap *, aeap, NULL, ao2_cleanup); + char *name = "foo"; + struct ast_aeap_params aeap_params = { + .response_handlers = handlers, + .response_handlers_size = ARRAY_LEN(handlers), + }; + struct ast_aeap_tsx_params tsx_params = {0}; + + switch (cmd) { + case TEST_INIT: + info->name = __func__; + info->explicit_only = 0; + info->category = CATEGORY; + info->summary = "test an AEAP application response handler"; + info->description = info->summary; + return AST_TEST_NOT_RUN; + case TEST_EXECUTE: + break; + } + + aeap_params.msg_type = ast_aeap_message_type_json; + + tsx_params.timeout = 2000; + tsx_params.wait = 1; + tsx_params.obj = name; + + ast_test_validate(test, (aeap = ast_aeap_create_and_connect(AEAP_TRANSPORT_TYPE, + &aeap_params, AEAP_REMOTE_URL, AEAP_REMOTE_PROTOCOL, AEAP_CONNECTION_TIMEOUT))); + ast_test_validate(test, (!ast_aeap_user_data_register(aeap, AEAP_MESSAGE_ID, &passed, NULL))); + ast_test_validate(test, (tsx_params.msg = ast_aeap_message_create_response( + ast_aeap_message_type_json, name, AEAP_MESSAGE_ID, NULL))); + ast_test_validate(test, !ast_aeap_send_msg_tsx(aeap, &tsx_params)); + ast_aeap_user_data_unregister(aeap, AEAP_MESSAGE_ID); + + return passed ? AST_TEST_PASS : AST_TEST_FAIL; +} + +AST_TEST_DEFINE(send_msg_handle_request) +{ + int passed = 0; + RAII_VAR(struct ast_aeap *, aeap, NULL, ao2_cleanup); + char *name = "foo"; + struct ast_aeap_params aeap_params = { + .request_handlers = handlers, + .request_handlers_size = ARRAY_LEN(handlers), + }; + struct ast_aeap_tsx_params tsx_params = {0}; + + switch (cmd) { + case TEST_INIT: + info->name = __func__; + info->explicit_only = 0; + info->category = CATEGORY; + info->summary = "test an AEAP application request handler"; + info->description = info->summary; + return AST_TEST_NOT_RUN; + case TEST_EXECUTE: + break; + } + + aeap_params.msg_type = ast_aeap_message_type_json; + + tsx_params.timeout = 2000; + tsx_params.wait = 1; + tsx_params.obj = name; + + ast_test_validate(test, (aeap = ast_aeap_create_and_connect(AEAP_TRANSPORT_TYPE, + &aeap_params, AEAP_REMOTE_URL, AEAP_REMOTE_PROTOCOL, AEAP_CONNECTION_TIMEOUT))); + ast_test_validate(test, (!ast_aeap_user_data_register(aeap, AEAP_MESSAGE_ID, &passed, NULL))); + ast_test_validate(test, (tsx_params.msg = ast_aeap_message_create_request( + ast_aeap_message_type_json, name, AEAP_MESSAGE_ID, NULL))); + ast_test_validate(test, !ast_aeap_send_msg_tsx(aeap, &tsx_params)); + ast_aeap_user_data_unregister(aeap, AEAP_MESSAGE_ID); + + return passed ? AST_TEST_PASS : AST_TEST_FAIL; +} + +static struct ast_http_server *http_server; + +static int load_module(void) +{ + if (!(http_server = ast_http_test_server_get("aeap transport http server", NULL))) { + return AST_MODULE_LOAD_DECLINE; + } + + AST_TEST_REGISTER(create_and_connect); + AST_TEST_REGISTER(send_msg_handle_string); + AST_TEST_REGISTER(send_msg_handle_response); + AST_TEST_REGISTER(send_msg_handle_request); + + return AST_MODULE_LOAD_SUCCESS; +} + +static int unload_module(void) +{ + AST_TEST_UNREGISTER(send_msg_handle_request); + AST_TEST_UNREGISTER(send_msg_handle_response); + AST_TEST_UNREGISTER(send_msg_handle_string); + AST_TEST_UNREGISTER(create_and_connect); + + ast_http_test_server_discard(http_server); + + return 0; +} + +AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_DEFAULT, "Asterisk External Application Protocol Object Tests", + .support_level = AST_MODULE_SUPPORT_CORE, + .load = load_module, + .unload = unload_module, + .requires = "res_aeap", +); diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/tests/test_aeap_speech.c asterisk-18.12.0~dfsg+~cs6.12.40431413/tests/test_aeap_speech.c --- asterisk-18.11.2~dfsg+~cs6.10.40431413/tests/test_aeap_speech.c 1970-01-01 00:00:00.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/tests/test_aeap_speech.c 2022-05-12 11:50:59.000000000 +0000 @@ -0,0 +1,287 @@ +/* + * Asterisk -- An open source telephony toolkit. + * + * Copyright (C) 2021, Sangoma Technologies Corporation + * + * Kevin Harwell + * + * See http://www.asterisk.org for more information about + * the Asterisk project. Please do not directly contact + * any of the maintainers of this project for assistance; + * the project provides a web site, mailing lists and IRC + * channels for your use. + * + * This program is free software, distributed under the terms of + * the GNU General Public License Version 2. See the LICENSE file + * at the top of the source tree. + */ + +/*** MODULEINFO + TEST_FRAMEWORK + res_aeap + core + ***/ + +#include "asterisk.h" + +#include "asterisk/test.h" +#include "asterisk/module.h" +#include "asterisk/file.h" +#include "asterisk/format_cap.h" +#include "asterisk/http.h" +#include "asterisk/http_websocket.h" +#include "asterisk/json.h" +#include "asterisk/speech.h" + +#include "asterisk/res_aeap.h" +#include "asterisk/res_aeap_message.h" + +#define ADDR "127.0.0.1:8088" + +static int speech_test_server_setup(struct ast_json *req, struct ast_json *resp) +{ + struct ast_json *params; + + if (ast_json_object_set(resp, "codecs", ast_json_ref(ast_json_object_get(req, "codecs")))) { + return -1; + } + + params = ast_json_object_get(req, "params"); /* Optional */ + if (params && ast_json_object_set(resp, "params", ast_json_ref(params))) { + return -1; + } + + return 0; +} + +#define TEST_SPEECH_RESULTS_TEXT "foo" +#define TEST_SPEECH_RESULTS_SCORE 7 +#define TEST_SPEECH_RESULTS_GRAMMAR "bar" +#define TEST_SPEECH_RESULTS_BEST 1 + +static int speech_test_server_get(struct ast_json *req, struct ast_json *resp) +{ + const char *param; + struct ast_json *json = NULL; + + param = ast_json_string_get(ast_json_array_get(ast_json_object_get(req, "params"), 0)); + if (!param) { + return -1; + } + + if (!strcmp(param, "results")) { + json = ast_json_pack("{s:[{s:s,s:i,s:s,s:i}]}", + param, + "text", TEST_SPEECH_RESULTS_TEXT, + "score", TEST_SPEECH_RESULTS_SCORE, + "grammar", TEST_SPEECH_RESULTS_GRAMMAR, + "best", TEST_SPEECH_RESULTS_BEST); + } else { + /* Assume setting */ + json = ast_json_pack("{s:s}", param, "bar"); + } + + if (!json || ast_json_object_set(resp, "params", json)) { + return -1; + } + + return 0; +} + +static int speech_test_server_set(struct ast_json *req, struct ast_json *resp) +{ + if (ast_json_object_set(resp, "params", ast_json_ref(ast_json_object_get(req, "params")))) { + return -1; + } + + return 0; +} + +static int speech_test_server_handle_request(struct ast_websocket *ws, const void *buf, uint64_t size) +{ + struct ast_json *req; + struct ast_json *resp; + const char *name; + char *resp_buf; + int res = 0; + + req = ast_json_load_buf(buf, size, NULL); + if (!req) { + ast_log(LOG_ERROR, "speech test handle request: unable to load json\n"); + return -1; + } + + name = ast_json_object_string_get(req, "request"); + if (!name) { + ast_log(LOG_ERROR, "speech test handle request: no name\n"); + ast_json_unref(req); + return -1; + } + + resp = ast_json_pack("{s:s, s:s}", "response", name, + "id", ast_json_object_string_get(req, "id")); + if (!resp) { + ast_log(LOG_ERROR, "speech test handle request: unable to create response '%s'\n", name); + ast_json_unref(req); + return -1; + } + + if (!strcmp(name, "setup")) { + res = speech_test_server_setup(req, resp); + } else if (!strcmp(name, "get")) { + res = speech_test_server_get(req, resp); + } else if (!strcmp(name, "set")) { + res = speech_test_server_set(req, resp); + } else { + ast_log(LOG_ERROR, "speech test handle request: unsupported request '%s'\n", name); + return -1; + } + + if (res) { + ast_log(LOG_ERROR, "speech test handle request: unable to build response '%s'\n", name); + ast_json_unref(resp); + ast_json_unref(req); + return -1; + } + + resp_buf = ast_json_dump_string(resp); + ast_json_unref(resp); + + if (!resp_buf) { + ast_log(LOG_ERROR, "speech test handle request: unable to dump response '%s'\n", name); + ast_json_unref(req); + return -1; + } + + res = ast_websocket_write_string(ws, resp_buf); + if (res) { + ast_log(LOG_ERROR, "speech test handle request: unable to write response '%s'\n", name); + } + + ast_json_unref(req); + ast_free(resp_buf); + + return res; +} + +static void speech_test_server_cb(struct ast_websocket *ws, struct ast_variable *parameters, + struct ast_variable *headers) +{ + int res; + + if (ast_fd_set_flags(ast_websocket_fd(ws), O_NONBLOCK)) { + ast_websocket_unref(ws); + return; + } + + while ((res = ast_websocket_wait_for_input(ws, -1)) > 0) { + char *payload; + uint64_t payload_len; + enum ast_websocket_opcode opcode; + int fragmented; + + if (ast_websocket_read(ws, &payload, &payload_len, &opcode, &fragmented)) { + ast_log(LOG_ERROR, "speech test: Read failure in server loop\n"); + break; + } + + switch (opcode) { + case AST_WEBSOCKET_OPCODE_CLOSE: + ast_websocket_unref(ws); + return; + case AST_WEBSOCKET_OPCODE_BINARY: + ast_websocket_write(ws, opcode, payload, payload_len); + break; + case AST_WEBSOCKET_OPCODE_TEXT: + ast_debug(3, "payload=%.*s\n", (int)payload_len, payload); + if (speech_test_server_handle_request(ws, payload, payload_len)) { + ast_websocket_unref(ws); + return; + } + break; + default: + break; + } + } + ast_websocket_unref(ws); +} + +AST_TEST_DEFINE(res_speech_aeap_test) +{ + RAII_VAR(struct ast_format_cap *, cap, NULL, ao2_cleanup); + RAII_VAR(struct ast_speech_result *, results, NULL, ast_speech_results_free); + struct ast_speech *speech = NULL; + enum ast_test_result_state res = AST_TEST_PASS; + char buf[8] = ""; + + switch (cmd) { + case TEST_INIT: + info->name = __func__; + info->explicit_only = 0; + info->category = "/res/aeap/speech/"; + info->summary = "test the speech AEAP interface"; + info->description = info->summary; + return AST_TEST_NOT_RUN; + case TEST_EXECUTE: + break; + } + + ast_test_validate(test, !ast_websocket_add_protocol("_aeap_test_speech_", speech_test_server_cb)); + + ast_test_validate(test, (cap = ast_format_cap_alloc(AST_FORMAT_CAP_FLAG_DEFAULT))); + ast_test_validate(test, !ast_format_cap_update_by_allow_disallow(cap, "ulaw", 1)); + + ast_test_validate_cleanup(test, (speech = ast_speech_new("_aeap_test_speech_", cap)), res, cleanup); + ast_speech_start(speech); + ast_test_validate_cleanup(test, !ast_speech_dtmf(speech, "1"), res, cleanup); + ast_test_validate_cleanup(test, !ast_speech_change(speech, "foo", "bar"), res, cleanup); + ast_test_validate_cleanup(test, !ast_speech_change_results_type( + speech, AST_SPEECH_RESULTS_TYPE_NBEST), res, cleanup); + + ast_test_validate_cleanup(test, !ast_speech_get_setting( + speech, "foo", buf, sizeof(buf)), res, cleanup); + ast_test_validate_cleanup(test, !strcmp(buf, "bar"), res, cleanup); + + ast_test_validate_cleanup(test, (results = ast_speech_results_get(speech)), res, cleanup); + ast_test_validate_cleanup(test, !strcmp(results->text, TEST_SPEECH_RESULTS_TEXT), res, cleanup); + ast_test_validate_cleanup(test, results->score == TEST_SPEECH_RESULTS_SCORE, res, cleanup); + ast_test_validate_cleanup(test, !strcmp(results->grammar, TEST_SPEECH_RESULTS_GRAMMAR), res, cleanup); + ast_test_validate_cleanup(test, results->nbest_num == TEST_SPEECH_RESULTS_BEST, res, cleanup); + +cleanup: + if (speech) { + ast_speech_destroy(speech); + } + ast_websocket_remove_protocol("_aeap_test_speech_", speech_test_server_cb); + + return res; +} + +static struct ast_http_server *http_server; + +static int load_module(void) +{ + if (!(http_server = ast_http_test_server_get("aeap transport http server", NULL))) { + return AST_MODULE_LOAD_DECLINE; + } + + AST_TEST_REGISTER(res_speech_aeap_test); + + return AST_MODULE_LOAD_SUCCESS; +} + +static int unload_module(void) +{ + AST_TEST_UNREGISTER(res_speech_aeap_test); + + ast_http_test_server_discard(http_server); + + return 0; +} + +AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_DEFAULT, "Asterisk External Application Protocol Speech test(s)", + .support_level = AST_MODULE_SUPPORT_CORE, + .load = load_module, + .unload = unload_module, + .requires = "res_speech_aeap", +); diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/tests/test_aeap_transaction.c asterisk-18.12.0~dfsg+~cs6.12.40431413/tests/test_aeap_transaction.c --- asterisk-18.11.2~dfsg+~cs6.10.40431413/tests/test_aeap_transaction.c 1970-01-01 00:00:00.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/tests/test_aeap_transaction.c 2022-05-12 11:50:59.000000000 +0000 @@ -0,0 +1,179 @@ +/* + * Asterisk -- An open source telephony toolkit. + * + * Copyright (C) 2021, Sangoma Technologies Corporation + * + * Kevin Harwell + * + * See http://www.asterisk.org for more information about + * the Asterisk project. Please do not directly contact + * any of the maintainers of this project for assistance; + * the project provides a web site, mailing lists and IRC + * channels for your use. + * + * This program is free software, distributed under the terms of + * the GNU General Public License Version 2. See the LICENSE file + * at the top of the source tree. + */ + +/*** MODULEINFO + TEST_FRAMEWORK + res_aeap + core + ***/ + +#include "asterisk.h" + +#include + +#include "asterisk/lock.h" +#include "asterisk/test.h" +#include "asterisk/module.h" +#include "asterisk/res_aeap.h" +#include "asterisk/res_aeap_message.h" + +#include "../res/res_aeap/general.h" +#include "../res/res_aeap/transaction.h" + +#define CATEGORY "/res/aeap/transaction/" + +#define AEAP_TRANSACTION_ID "foo" + +static void handle_timeout(struct ast_aeap *aeap, struct ast_aeap_message *msg, void *obj) +{ + int *passed = obj; + + ++*passed; +} + +static void *end_transaction(void *data) +{ + /* Delay a second before ending transaction */ + struct timespec delay = { 1, 0 }; + int *passed = aeap_transaction_user_obj(data); + + while (nanosleep(&delay, &delay)); + + ++*passed; + aeap_transaction_end(data, 0); + + return NULL; +} + +static enum ast_test_result_state exec(struct ast_test *test, + struct ast_aeap_tsx_params *params) +{ + pthread_t thread_id = AST_PTHREADT_NULL; + struct ao2_container *tsxs = NULL; + struct aeap_transaction *tsx = NULL; + enum ast_test_result_state res = AST_TEST_FAIL; + int passed = 0; + + tsxs = aeap_transactions_create(); + if (!tsxs) { + ast_test_status_update(test, "Failed to create transactions object\n"); + goto exec_cleanup; + } + + params->wait = 1; + params->obj = &passed; + + tsx = aeap_transaction_create_and_add(tsxs, AEAP_TRANSACTION_ID, params, NULL); + if (!tsx) { + ast_test_status_update(test, "Failed to create transaction object\n"); + goto exec_cleanup; + } + + if (ast_pthread_create(&thread_id, NULL, end_transaction, ao2_bump(tsx))) { + ast_test_status_update(test, "Failed to create response thread\n"); + ao2_ref(tsx, -1); + goto exec_cleanup; + } + + if (aeap_transaction_start(tsx)) { + ast_test_status_update(test, "Failed to start transaction request\n"); + goto exec_cleanup; + } + + if (passed == 1) { + res = AST_TEST_PASS; + } + +exec_cleanup: + + if (thread_id != AST_PTHREADT_NULL) { + pthread_cancel(thread_id); + pthread_join(thread_id, NULL); + } + + aeap_transaction_end(tsx, 0); + ao2_cleanup(tsxs); + + return res; +} + +AST_TEST_DEFINE(transaction_exec) +{ + struct ast_aeap_tsx_params params = { + .timeout = 5000, /* Give plenty of time for test thread to end */ + }; + + switch (cmd) { + case TEST_INIT: + info->name = __func__; + info->explicit_only = 0; + info->category = CATEGORY; + info->summary = "test creating a basic AEAP transaction request"; + info->description = info->summary; + return AST_TEST_NOT_RUN; + case TEST_EXECUTE: + break; + } + + return exec(test, ¶ms); +} + +AST_TEST_DEFINE(transaction_exec_timeout) +{ + struct ast_aeap_tsx_params params = { + .timeout = 100, /* Ensure timeout occurs before test thread ends */ + .on_timeout = handle_timeout, + }; + + switch (cmd) { + case TEST_INIT: + info->name = __func__; + info->explicit_only = 0; + info->category = CATEGORY; + info->summary = "test creating a AEAP transaction request that times out"; + info->description = info->summary; + return AST_TEST_NOT_RUN; + case TEST_EXECUTE: + break; + } + + return exec(test, ¶ms); +} + +static int load_module(void) +{ + AST_TEST_REGISTER(transaction_exec); + AST_TEST_REGISTER(transaction_exec_timeout); + + return AST_MODULE_LOAD_SUCCESS; +} + +static int unload_module(void) +{ + AST_TEST_UNREGISTER(transaction_exec_timeout); + AST_TEST_UNREGISTER(transaction_exec); + + return 0; +} + +AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_DEFAULT, "Asterisk External Application Protocol Transaction Tests", + .support_level = AST_MODULE_SUPPORT_CORE, + .load = load_module, + .unload = unload_module, + .requires = "res_aeap", +); diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/tests/test_aeap_transport.c asterisk-18.12.0~dfsg+~cs6.12.40431413/tests/test_aeap_transport.c --- asterisk-18.11.2~dfsg+~cs6.10.40431413/tests/test_aeap_transport.c 1970-01-01 00:00:00.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/tests/test_aeap_transport.c 2022-05-12 11:50:59.000000000 +0000 @@ -0,0 +1,249 @@ +/* + * Asterisk -- An open source telephony toolkit. + * + * Copyright (C) 2021, Sangoma Technologies Corporation + * + * Kevin Harwell + * + * See http://www.asterisk.org for more information about + * the Asterisk project. Please do not directly contact + * any of the maintainers of this project for assistance; + * the project provides a web site, mailing lists and IRC + * channels for your use. + * + * This program is free software, distributed under the terms of + * the GNU General Public License Version 2. See the LICENSE file + * at the top of the source tree. + */ + +/*** MODULEINFO + TEST_FRAMEWORK + res_aeap + core + ***/ + +#include "asterisk.h" + +#include "asterisk/http.h" +#include "asterisk/test.h" +#include "asterisk/module.h" + +#include "../res/res_aeap/transport.h" + +#define CATEGORY "/res/aeap/transport/" + +#define ADDR "127.0.0.1:8088" +#define TRANSPORT_URL "ws://" ADDR "/ws" +#define TRANSPORT_URL_INVALID "ws://" ADDR "/invalid" +#define TRANSPORT_PROTOCOL "echo" +#define TRANSPORT_PROTOCOL_INVALID "invalid" +#define TRANSPORT_TIMEOUT 2000 + +AST_TEST_DEFINE(transport_create_invalid) +{ + RAII_VAR(struct aeap_transport *, transport, NULL, aeap_transport_destroy); + + switch (cmd) { + case TEST_INIT: + info->name = __func__; + info->explicit_only = 0; + info->category = CATEGORY; + info->summary = "test creating an AEAP invalid transport type"; + info->description = info->summary; + return AST_TEST_NOT_RUN; + case TEST_EXECUTE: + break; + } + + /* Transport is expected to be NULL here */ + ast_test_validate(test, !(transport = aeap_transport_create("invalid"))); + + return AST_TEST_PASS; +} + +AST_TEST_DEFINE(transport_create) +{ + RAII_VAR(struct aeap_transport *, transport, NULL, aeap_transport_destroy); + + switch (cmd) { + case TEST_INIT: + info->name = __func__; + info->explicit_only = 0; + info->category = CATEGORY; + info->summary = "test creating an AEAP transport"; + info->description = info->summary; + return AST_TEST_NOT_RUN; + case TEST_EXECUTE: + break; + } + + /* Type is based off the scheme, so just pass in the URL here */ + ast_test_validate(test, (transport = aeap_transport_create(TRANSPORT_URL))); + + return AST_TEST_PASS; +} + +AST_TEST_DEFINE(transport_connect) +{ + RAII_VAR(struct aeap_transport *, transport, NULL, aeap_transport_destroy); + + switch (cmd) { + case TEST_INIT: + info->name = __func__; + info->explicit_only = 0; + info->category = CATEGORY; + info->summary = "test connecting to an AEAP transport"; + info->description = info->summary; + return AST_TEST_NOT_RUN; + case TEST_EXECUTE: + break; + } + + /* Type is based off the scheme, so just pass in the URL for the type */ + ast_test_validate(test, (transport = aeap_transport_create_and_connect( + TRANSPORT_URL, TRANSPORT_URL, TRANSPORT_PROTOCOL, TRANSPORT_TIMEOUT))); + + ast_test_validate(test, aeap_transport_is_connected(transport)); + ast_test_validate(test, !aeap_transport_disconnect(transport)); + ast_test_validate(test, !aeap_transport_is_connected(transport)); + + return AST_TEST_PASS; +} + +AST_TEST_DEFINE(transport_connect_fail) +{ + RAII_VAR(struct aeap_transport *, transport, NULL, aeap_transport_destroy); + + switch (cmd) { + case TEST_INIT: + info->name = __func__; + info->explicit_only = 0; + info->category = CATEGORY; + info->summary = "test connecting failure for an AEAP transport"; + info->description = info->summary; + return AST_TEST_NOT_RUN; + case TEST_EXECUTE: + break; + } + + /* Test invalid address */ + ast_test_validate(test, (transport = aeap_transport_create(TRANSPORT_URL))); + + ast_test_validate(test, aeap_transport_connect(transport, + TRANSPORT_URL_INVALID, TRANSPORT_PROTOCOL, TRANSPORT_TIMEOUT)); + + ast_test_validate(test, !aeap_transport_is_connected(transport)); + + aeap_transport_destroy(transport); + + /* Test invalid protocol */ + ast_test_validate(test, (transport = aeap_transport_create(TRANSPORT_URL))); + + ast_test_validate(test, aeap_transport_connect(transport, + TRANSPORT_URL, TRANSPORT_PROTOCOL_INVALID, TRANSPORT_TIMEOUT)); + + ast_test_validate(test, !aeap_transport_is_connected(transport)); + + return AST_TEST_PASS; +} + +AST_TEST_DEFINE(transport_binary) +{ + RAII_VAR(struct aeap_transport *, transport, NULL, aeap_transport_destroy); + int num = 38; + enum AST_AEAP_DATA_TYPE rtype; + + switch (cmd) { + case TEST_INIT: + info->name = __func__; + info->explicit_only = 0; + info->category = CATEGORY; + info->summary = "test binary I/O from an AEAP transport"; + info->description = info->summary; + return AST_TEST_NOT_RUN; + case TEST_EXECUTE: + break; + } + + ast_test_validate(test, (transport = aeap_transport_create_and_connect( + TRANSPORT_URL, TRANSPORT_URL, TRANSPORT_PROTOCOL, TRANSPORT_TIMEOUT))); + + ast_test_validate(test, aeap_transport_write(transport, &num, sizeof(num), + AST_AEAP_DATA_TYPE_BINARY) == sizeof(num)); + ast_test_validate(test, aeap_transport_read(transport, &num, + sizeof(num), &rtype) == sizeof(num)); + ast_test_validate(test, rtype == AST_AEAP_DATA_TYPE_BINARY); + ast_test_validate(test, num == 38); + + return AST_TEST_PASS; +} + +AST_TEST_DEFINE(transport_string) +{ + RAII_VAR(struct aeap_transport *, transport, NULL, aeap_transport_destroy); + char buf[16]; + enum AST_AEAP_DATA_TYPE rtype; + + switch (cmd) { + case TEST_INIT: + info->name = __func__; + info->explicit_only = 0; + info->category = CATEGORY; + info->summary = "test string I/O from an AEAP transport"; + info->description = info->summary; + return AST_TEST_NOT_RUN; + case TEST_EXECUTE: + break; + } + + ast_test_validate(test, (transport = aeap_transport_create_and_connect( + TRANSPORT_URL, TRANSPORT_URL, TRANSPORT_PROTOCOL, TRANSPORT_TIMEOUT))); + + ast_test_validate(test, aeap_transport_write(transport, "foo bar baz", 11, + AST_AEAP_DATA_TYPE_STRING) == 11); + ast_test_validate(test, aeap_transport_read(transport, buf, + sizeof(buf) / sizeof(char), &rtype) == 11); + ast_test_validate(test, rtype == AST_AEAP_DATA_TYPE_STRING); + ast_test_validate(test, !strcmp(buf, "foo bar baz")); + + return AST_TEST_PASS; +} + +static struct ast_http_server *http_server; + +static int load_module(void) +{ + if (!(http_server = ast_http_test_server_get("aeap transport http server", NULL))) { + return AST_MODULE_LOAD_DECLINE; + } + + AST_TEST_REGISTER(transport_string); + AST_TEST_REGISTER(transport_binary); + AST_TEST_REGISTER(transport_connect_fail); + AST_TEST_REGISTER(transport_connect); + AST_TEST_REGISTER(transport_create); + AST_TEST_REGISTER(transport_create_invalid); + + return AST_MODULE_LOAD_SUCCESS; +} + +static int unload_module(void) +{ + AST_TEST_UNREGISTER(transport_string); + AST_TEST_UNREGISTER(transport_binary); + AST_TEST_UNREGISTER(transport_connect_fail); + AST_TEST_UNREGISTER(transport_connect); + AST_TEST_UNREGISTER(transport_create); + AST_TEST_UNREGISTER(transport_create_invalid); + + ast_http_test_server_discard(http_server); + + return 0; +} + +AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_DEFAULT, "Asterisk External Application Protocol Transport Tests", + .support_level = AST_MODULE_SUPPORT_CORE, + .load = load_module, + .unload = unload_module, + .requires = "res_aeap", +); diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/tests/test_conversions.c asterisk-18.12.0~dfsg+~cs6.12.40431413/tests/test_conversions.c --- asterisk-18.11.2~dfsg+~cs6.10.40431413/tests/test_conversions.c 2022-04-14 21:53:34.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/tests/test_conversions.c 2022-05-12 11:50:59.000000000 +0000 @@ -48,6 +48,7 @@ const char *spaces = " "; const char *valid = "7"; const char *valid_spaces = " 7"; + const char *valid_decimal = "08"; int val; char str[64]; @@ -73,6 +74,7 @@ ast_test_validate(test, ast_str_to_int(spaces, &val)); ast_test_validate(test, !ast_str_to_int(valid, &val)); ast_test_validate(test, !ast_str_to_int(valid_spaces, &val)); + ast_test_validate(test, !ast_str_to_int(valid_decimal, &val)); ast_test_validate(test, snprintf(str, sizeof(str), "%d", INT_MAX) > 0); ast_test_validate(test, !ast_str_to_int(str, &val)); @@ -95,6 +97,7 @@ const char *spaces = " "; const char *valid = "7"; const char *valid_spaces = " 7"; + const char *valid_decimal = "08"; unsigned int val; char str[64]; @@ -119,6 +122,7 @@ ast_test_validate(test, ast_str_to_uint(spaces, &val)); ast_test_validate(test, !ast_str_to_uint(valid, &val)); ast_test_validate(test, !ast_str_to_uint(valid_spaces, &val)); + ast_test_validate(test, !ast_str_to_uint(valid_decimal, &val)); ast_test_validate(test, snprintf(str, sizeof(str), "%u", UINT_MAX) > 0); ast_test_validate(test, !ast_str_to_uint(str, &val)); @@ -138,6 +142,7 @@ const char *spaces = " "; const char *valid = "7"; const char *valid_spaces = " 7"; + const char *valid_decimal = "08"; long val; char str[64]; @@ -163,6 +168,7 @@ ast_test_validate(test, ast_str_to_long(spaces, &val)); ast_test_validate(test, !ast_str_to_long(valid, &val)); ast_test_validate(test, !ast_str_to_long(valid_spaces, &val)); + ast_test_validate(test, !ast_str_to_long(valid_decimal, &val)); ast_test_validate(test, snprintf(str, sizeof(str), "%ld", LONG_MAX) > 0); ast_test_validate(test, !ast_str_to_long(str, &val)); @@ -185,6 +191,7 @@ const char *spaces = " "; const char *valid = "7"; const char *valid_spaces = " 7"; + const char *valid_decimal = "08"; unsigned long val; char str[64]; @@ -209,6 +216,7 @@ ast_test_validate(test, ast_str_to_ulong(spaces, &val)); ast_test_validate(test, !ast_str_to_ulong(valid, &val)); ast_test_validate(test, !ast_str_to_ulong(valid_spaces, &val)); + ast_test_validate(test, !ast_str_to_ulong(valid_decimal, &val)); ast_test_validate(test, snprintf(str, sizeof(str), "%lu", ULONG_MAX) > 0); ast_test_validate(test, !ast_str_to_ulong(str, &val)); @@ -228,6 +236,7 @@ const char *spaces = " "; const char *valid = "7"; const char *valid_spaces = " 7"; + const char *valid_decimal = "08"; intmax_t val; char str[64]; @@ -253,6 +262,7 @@ ast_test_validate(test, ast_str_to_imax(spaces, &val)); ast_test_validate(test, !ast_str_to_imax(valid, &val)); ast_test_validate(test, !ast_str_to_imax(valid_spaces, &val)); + ast_test_validate(test, !ast_str_to_imax(valid_decimal, &val)); ast_test_validate(test, snprintf(str, sizeof(str), "%jd", INTMAX_MAX) > 0); ast_test_validate(test, !ast_str_to_imax(str, &val)); @@ -276,6 +286,7 @@ const char *spaces = " "; const char *valid = "7"; const char *valid_spaces = " 7"; + const char *valid_decimal = "08"; uintmax_t val; char str[64]; @@ -300,6 +311,7 @@ ast_test_validate(test, ast_str_to_umax(spaces, &val)); ast_test_validate(test, !ast_str_to_umax(valid, &val)); ast_test_validate(test, !ast_str_to_umax(valid_spaces, &val)); + ast_test_validate(test, !ast_str_to_umax(valid_decimal, &val)); ast_test_validate(test, snprintf(str, sizeof(str), "%ju", UINTMAX_MAX) > 0); ast_test_validate(test, !ast_str_to_umax(str, &val)); diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/third-party/pjproject/patches/0000-configure-ssl-library-path.patch asterisk-18.12.0~dfsg+~cs6.12.40431413/third-party/pjproject/patches/0000-configure-ssl-library-path.patch --- asterisk-18.11.2~dfsg+~cs6.10.40431413/third-party/pjproject/patches/0000-configure-ssl-library-path.patch 2022-04-14 21:53:34.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/third-party/pjproject/patches/0000-configure-ssl-library-path.patch 2022-05-12 11:50:59.000000000 +0000 @@ -1,19 +1,9 @@ -From e8000cc80e5f8ba02cc52852edc02cdb0e949525 Mon Sep 17 00:00:00 2001 -From: Richard Mudgett -Date: Mon, 6 Aug 2018 11:24:25 -0500 -Subject: [PATCH 1/5] 0000-configure-ssl-library-path.patch - ---- - aconfigure | 6 +++++- - aconfigure.ac | 6 +++++- - 2 files changed, 10 insertions(+), 2 deletions(-) - diff --git a/aconfigure b/aconfigure -index 1c449b8..c4c6060 100755 +index d6f0e8809..9dcd46398 100755 --- a/aconfigure +++ b/aconfigure -@@ -7954,7 +7954,11 @@ else - if test "x$with_ssl" != "xno" -a "x$with_ssl" != "x"; then +@@ -8986,7 +8986,11 @@ else $as_nop + if test "x$with_ssl" != "xno" -a "x$with_ssl" != "x"; then CFLAGS="$CFLAGS -I$with_ssl/include" CPPFLAGS="$CPPFLAGS -I$with_ssl/include" - LDFLAGS="$LDFLAGS -L$with_ssl/lib" @@ -22,15 +12,15 @@ + else + LDFLAGS="$LDFLAGS -L$with_ssl" + fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: Using SSL prefix... $with_ssl" >&5 - $as_echo "Using SSL prefix... $with_ssl" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: Using SSL prefix... $with_ssl" >&5 + printf "%s\n" "Using SSL prefix... $with_ssl" >&6; } fi diff --git a/aconfigure.ac b/aconfigure.ac -index 2c272cd..a5d6d97 100644 +index 16b311045..849da81ab 100644 --- a/aconfigure.ac +++ b/aconfigure.ac -@@ -1580,7 +1580,11 @@ AC_ARG_ENABLE(ssl, - if test "x$with_ssl" != "xno" -a "x$with_ssl" != "x"; then +@@ -1838,7 +1838,11 @@ AC_ARG_ENABLE(ssl, + if test "x$with_ssl" != "xno" -a "x$with_ssl" != "x"; then CFLAGS="$CFLAGS -I$with_ssl/include" CPPFLAGS="$CPPFLAGS -I$with_ssl/include" - LDFLAGS="$LDFLAGS -L$with_ssl/lib" @@ -42,6 +32,3 @@ AC_MSG_RESULT([Using SSL prefix... $with_ssl]) fi --- -2.7.4 - diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/third-party/pjproject/patches/0000-remove-third-party.patch asterisk-18.12.0~dfsg+~cs6.12.40431413/third-party/pjproject/patches/0000-remove-third-party.patch --- asterisk-18.11.2~dfsg+~cs6.10.40431413/third-party/pjproject/patches/0000-remove-third-party.patch 2022-04-14 21:53:34.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/third-party/pjproject/patches/0000-remove-third-party.patch 2022-05-12 11:50:59.000000000 +0000 @@ -1,14 +1,5 @@ -From 665a2fbc3a09a71cd77988ae2deb3f5d3e205f63 Mon Sep 17 00:00:00 2001 -From: Richard Mudgett -Date: Thu, 23 Feb 2017 17:10:07 -0600 -Subject: [PATCH 2/5] 0000-remove-third-party.patch - ---- - build.mak.in | 97 ------------------------------------------------------------ - 1 file changed, 97 deletions(-) - diff --git a/build.mak.in b/build.mak.in -index 80ccad1..41ec64e 100644 +index 4bc464f8c..80681d961 100644 --- a/build.mak.in +++ b/build.mak.in @@ -1,4 +1,3 @@ @@ -16,7 +7,7 @@ include $(PJDIR)/version.mak export PJ_DIR := $(PJDIR) -@@ -37,19 +36,6 @@ export APP_THIRD_PARTY_EXT := +@@ -41,19 +40,6 @@ export APP_THIRD_PARTY_EXT := export APP_THIRD_PARTY_LIBS := export APP_THIRD_PARTY_LIB_FILES := @@ -36,7 +27,7 @@ ifeq (@ac_pjmedia_resample@,libresample) APP_THIRD_PARTY_LIB_FILES += $(PJ_DIR)/third_party/lib/libresample-$(LIB_SUFFIX) ifeq ($(PJ_SHARED_LIBRARIES),) -@@ -66,89 +52,6 @@ APP_THIRD_PARTY_LIB_FILES += $(PJ_DIR)/third_party/lib/libresample.$(SHLIB_SUFFI +@@ -70,102 +56,6 @@ APP_THIRD_PARTY_LIB_FILES += $(PJ_DIR)/third_party/lib/libresample.$(SHLIB_SUFFI endif endif @@ -122,10 +113,20 @@ -endif -endif - +-ifneq (@ac_no_webrtc_aec3@,1) +-ifeq (@ac_external_webrtc_aec3@,1) +-APP_THIRD_PARTY_EXT += -lwebrtc-aec3 +-else +-APP_THIRD_PARTY_LIB_FILES += $(PJ_DIR)/third_party/lib/libwebrtc-aec3-$(LIB_SUFFIX) +-ifeq ($(PJ_SHARED_LIBRARIES),) +-APP_THIRD_PARTY_LIBS += -lwebrtc-aec3-$(TARGET_NAME) +-else +-APP_THIRD_PARTY_LIBS += -lwebrtc-aec3 +-APP_THIRD_PARTY_LIB_FILES += $(PJ_DIR)/third_party/lib/libwebrtc-aec3.$(SHLIB_SUFFIX).$(PJ_VERSION_MAJOR) $(PJ_DIR)/third_party/lib/libwebrtc.$(SHLIB_SUFFIX) +-endif +-endif +-endif - + # Additional flags @ac_build_mak_vars@ - --- -2.7.4 - diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/third-party/pjproject/patches/0000-set_apps_initial_log_level.patch asterisk-18.12.0~dfsg+~cs6.12.40431413/third-party/pjproject/patches/0000-set_apps_initial_log_level.patch --- asterisk-18.11.2~dfsg+~cs6.10.40431413/third-party/pjproject/patches/0000-set_apps_initial_log_level.patch 2022-04-14 21:53:34.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/third-party/pjproject/patches/0000-set_apps_initial_log_level.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,53 +0,0 @@ -From c40ad6ba454fdf6456d8ffa92faa4cd49f2c807d Mon Sep 17 00:00:00 2001 -From: Richard Mudgett -Date: Thu, 23 Feb 2017 17:11:00 -0600 -Subject: [PATCH 3/5] 0000-set_apps_initial_log_level.patch - ---- - pjsip-apps/src/pjsua/main.c | 2 ++ - pjsip-apps/src/pjsystest/main_console.c | 2 ++ - pjsip-apps/src/python/_pjsua.c | 3 ++- - 3 files changed, 6 insertions(+), 1 deletion(-) - -diff --git a/pjsip-apps/src/pjsua/main.c b/pjsip-apps/src/pjsua/main.c -index 2baaf82..11831f2 100644 ---- a/pjsip-apps/src/pjsua/main.c -+++ b/pjsip-apps/src/pjsua/main.c -@@ -126,5 +126,7 @@ int main_func(int argc, char *argv[]) - - int main(int argc, char *argv[]) - { -+ pj_log_set_level(1); -+ - return pj_run_app(&main_func, argc, argv, 0); - } -diff --git a/pjsip-apps/src/pjsystest/main_console.c b/pjsip-apps/src/pjsystest/main_console.c -index 122cdc7..dc79eab 100644 ---- a/pjsip-apps/src/pjsystest/main_console.c -+++ b/pjsip-apps/src/pjsystest/main_console.c -@@ -133,6 +133,8 @@ void gui_sleep(unsigned sec) - - int main() - { -+ pj_log_set_level(1); -+ - if (systest_init() != PJ_SUCCESS) - return 1; - -diff --git a/pjsip-apps/src/python/_pjsua.c b/pjsip-apps/src/python/_pjsua.c -index 31b835e..3e15030 100644 ---- a/pjsip-apps/src/python/_pjsua.c -+++ b/pjsip-apps/src/python/_pjsua.c -@@ -4434,7 +4434,8 @@ init_pjsua(void) - PyObject* m = NULL; - #define ADD_CONSTANT(mod,name) PyModule_AddIntConstant(mod,#name,name) - -- -+ pj_log_set_level(1); -+ - PyEval_InitThreads(); - - if (PyType_Ready(&PyTyp_pjsua_callback) < 0) --- -2.7.4 - diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/third-party/pjproject/patches/0000-solaris.patch asterisk-18.12.0~dfsg+~cs6.12.40431413/third-party/pjproject/patches/0000-solaris.patch --- asterisk-18.11.2~dfsg+~cs6.10.40431413/third-party/pjproject/patches/0000-solaris.patch 2022-04-14 21:53:34.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/third-party/pjproject/patches/0000-solaris.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,135 +0,0 @@ -From 1ac599a0f29500a15faf0dbbdc2565cc7dce2420 Mon Sep 17 00:00:00 2001 -From: Shaun Ruffell -Date: Fri, 7 Sep 2012 14:31:19 -0500 -Subject: [PATCH 4/5] pjproject: Fix for Solaris builds. Do not undef s_addr. - -pjproject, in order to solve build problems on Windows [1], undefines s_addr in -one of it's headers that is included in res_rtp_asterisk.c. On Solaris s_addr is -not a structure member, but defined to map to the real strucuture member, -therefore when building on Solaris it's possible to get build errors like: - - [CC] res_rtp_asterisk.c -> res_rtp_asterisk.o - In file included from /export/home/admin/asterisk-11-svn/include/asterisk/stun.h:29, - from res_rtp_asterisk.c:51: - /export/home/admin/asterisk-11-svn/include/asterisk/network.h: In function `inaddrcmp': - /export/home/admin/asterisk-11-svn/include/asterisk/network.h:92: error: structure has no member named `s_addr' - /export/home/admin/asterisk-11-svn/include/asterisk/network.h:92: error: structure has no member named `s_addr' - res_rtp_asterisk.c: In function `ast_rtp_on_ice_tx_pkt': - res_rtp_asterisk.c:706: warning: dereferencing type-punned pointer will break strict-aliasing rules - res_rtp_asterisk.c:710: warning: dereferencing type-punned pointer will break strict-aliasing rules - res_rtp_asterisk.c: In function `rtp_add_candidates_to_ice': - res_rtp_asterisk.c:1085: error: structure has no member named `s_addr' - make[2]: *** [res_rtp_asterisk.o] Error 1 - make[1]: *** [res] Error 2 - make[1]: Leaving directory `/export/home/admin/asterisk-11-svn' - gmake: *** [_cleantest_all] Error 2 - -Unfortunately, in order to make this work, I also had to make sure pjproject -only used the typdef pj_in_addr and not the struct pj_in_addr so that when -building Asterisk I could "typedef struct in_addr pj_in_addr". It's possible -then that the library and users of those interfaces in Asterisk have a different -idea about the type of the argument. While on the surface it looks like they are -all 32 bit big endian values. - -[1] http://trac.pjsip.org/repos/changeset/484 - -Reported-by: Ben Klang -(issues ASTERISK-20366) - -Updated by ASTERISK-27997 ---- - pjlib/include/pj/sock.h | 8 +++++++- - pjlib/src/pj/sock_bsd.c | 2 +- - pjlib/src/pj/sock_symbian.cpp | 2 +- - pjlib/src/pj/sock_uwp.cpp | 2 +- - pjsip/src/test/transport_test.c | 2 +- - 5 files changed, 11 insertions(+), 5 deletions(-) - -diff --git a/pjlib/include/pj/sock.h b/pjlib/include/pj/sock.h -index 4daf298..c35833c 100644 ---- a/pjlib/include/pj/sock.h -+++ b/pjlib/include/pj/sock.h -@@ -484,6 +484,7 @@ typedef enum pj_socket_sd_type - */ - #define PJ_INVALID_SOCKET (-1) - -+#ifndef _ASTERISK_H - /* Must undefine s_addr because of pj_in_addr below */ - #undef s_addr - -@@ -495,6 +496,11 @@ typedef struct pj_in_addr - pj_uint32_t s_addr; /**< The 32bit IP address. */ - } pj_in_addr; - -+#else -+#include -+#include -+typedef struct in_addr pj_in_addr; -+#endif - - /** - * Maximum length of text representation of an IPv4 address. -@@ -712,7 +718,7 @@ PJ_DECL(char*) pj_inet_ntoa(pj_in_addr inaddr); - * - * @return nonzero if the address is valid, zero if not. - */ --PJ_DECL(int) pj_inet_aton(const pj_str_t *cp, struct pj_in_addr *inp); -+PJ_DECL(int) pj_inet_aton(const pj_str_t *cp, pj_in_addr *inp); - - /** - * This function converts an address in its standard text presentation form -diff --git a/pjlib/src/pj/sock_bsd.c b/pjlib/src/pj/sock_bsd.c -index e416991..940fce1 100644 ---- a/pjlib/src/pj/sock_bsd.c -+++ b/pjlib/src/pj/sock_bsd.c -@@ -244,7 +244,7 @@ PJ_DEF(char*) pj_inet_ntoa(pj_in_addr inaddr) - * numbers-and-dots notation into binary data and stores it in the structure - * that inp points to. - */ --PJ_DEF(int) pj_inet_aton(const pj_str_t *cp, struct pj_in_addr *inp) -+PJ_DEF(int) pj_inet_aton(const pj_str_t *cp, pj_in_addr *inp) - { - char tempaddr[PJ_INET_ADDRSTRLEN]; - -diff --git a/pjlib/src/pj/sock_symbian.cpp b/pjlib/src/pj/sock_symbian.cpp -index 09239b0..e72bbda 100644 ---- a/pjlib/src/pj/sock_symbian.cpp -+++ b/pjlib/src/pj/sock_symbian.cpp -@@ -299,7 +299,7 @@ PJ_DEF(char*) pj_inet_ntoa(pj_in_addr inaddr) - * numbers-and-dots notation into binary data and stores it in the structure - * that inp points to. - */ --PJ_DEF(int) pj_inet_aton(const pj_str_t *cp, struct pj_in_addr *inp) -+PJ_DEF(int) pj_inet_aton(const pj_str_t *cp, pj_in_addr *inp) - { - enum { MAXIPLEN = PJ_INET_ADDRSTRLEN }; - -diff --git a/pjlib/src/pj/sock_uwp.cpp b/pjlib/src/pj/sock_uwp.cpp -index 876c328..40250bf 100644 ---- a/pjlib/src/pj/sock_uwp.cpp -+++ b/pjlib/src/pj/sock_uwp.cpp -@@ -933,7 +933,7 @@ PJ_DEF(char*) pj_inet_ntoa(pj_in_addr inaddr) - * numbers-and-dots notation into binary data and stores it in the structure - * that inp points to. - */ --PJ_DEF(int) pj_inet_aton(const pj_str_t *cp, struct pj_in_addr *inp) -+PJ_DEF(int) pj_inet_aton(const pj_str_t *cp, pj_in_addr *inp) - { - char tempaddr[PJ_INET_ADDRSTRLEN]; - -diff --git a/pjsip/src/test/transport_test.c b/pjsip/src/test/transport_test.c -index e5083d1..c429cc7 100644 ---- a/pjsip/src/test/transport_test.c -+++ b/pjsip/src/test/transport_test.c -@@ -35,7 +35,7 @@ int generic_transport_test(pjsip_transport *tp) - - /* Check that local address name is valid. */ - { -- struct pj_in_addr addr; -+ pj_in_addr addr; - - if (pj_inet_pton(pj_AF_INET(), &tp->local_name.host, - &addr) == PJ_SUCCESS) --- -2.7.4 - diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/third-party/pjproject/patches/0011-sip_inv_patch.patch asterisk-18.12.0~dfsg+~cs6.12.40431413/third-party/pjproject/patches/0011-sip_inv_patch.patch --- asterisk-18.11.2~dfsg+~cs6.10.40431413/third-party/pjproject/patches/0011-sip_inv_patch.patch 2022-04-14 21:53:34.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/third-party/pjproject/patches/0011-sip_inv_patch.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,39 +0,0 @@ -commit c3c1bf45cae2a35003aa16c267d59f97027f9c5e -Author: Kevin Harwell -Date: Thu Jun 11 11:11:13 2020 -0500 - - sip_inv - fix invite session ref count crash - - Ensure the session's ref count is only decremented under proper conditons. - - For more details see the following issue report: - https://github.com/pjsip/pjproject/issues/2443 - - Patch supplied by sauwming - -diff --git a/pjsip/src/pjsip-ua/sip_inv.c b/pjsip/src/pjsip-ua/sip_inv.c -index ca225015b..7c11b1c8e 100644 ---- a/pjsip/src/pjsip-ua/sip_inv.c -+++ b/pjsip/src/pjsip-ua/sip_inv.c -@@ -323,9 +323,19 @@ static void inv_set_state(pjsip_inv_session *inv, pjsip_inv_state state, - (*mod_inv.cb.on_state_changed)(inv, e); - pjsip_inv_dec_ref(inv); - -- /* Only decrement when previous state is not already DISCONNECTED */ -+ /* The above callback may change the state, so we need to be careful here -+ * and only decrement inv under the following conditions: -+ * 1. If the state parameter is DISCONNECTED, and previous state is not -+ * already DISCONNECTED. -+ * This is to make sure that dec_ref() is not called more than once. -+ * 2. If current state is PJSIP_INV_STATE_DISCONNECTED. -+ * This is to make sure that dec_ref() is not called if user restarts -+ * inv within the callback. Note that this check must be last since -+ * inv may have already been destroyed. -+ */ - if (state == PJSIP_INV_STATE_DISCONNECTED && -- prev_state != PJSIP_INV_STATE_DISCONNECTED) -+ prev_state != PJSIP_INV_STATE_DISCONNECTED && -+ inv->state == PJSIP_INV_STATE_DISCONNECTED) - { - pjsip_inv_dec_ref(inv); - } diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/third-party/pjproject/patches/0020-pjlib_cancel_timer_0.patch asterisk-18.12.0~dfsg+~cs6.12.40431413/third-party/pjproject/patches/0020-pjlib_cancel_timer_0.patch --- asterisk-18.11.2~dfsg+~cs6.10.40431413/third-party/pjproject/patches/0020-pjlib_cancel_timer_0.patch 2022-04-14 21:53:34.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/third-party/pjproject/patches/0020-pjlib_cancel_timer_0.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,39 +0,0 @@ -commit 40dd48d10911f4ff9b8dfbf16428fbc9acc434ba -Author: Riza Sulistyo -Date: Thu Jul 9 17:47:24 2020 +0700 - - Modify timer_id check on cancel() (#2463) - - * modify timer_id check on cancel(). - - * modification based on comments. - -diff --git a/pjlib/include/pj/timer.h b/pjlib/include/pj/timer.h -index b738a6e76..4b76ab65d 100644 ---- a/pjlib/include/pj/timer.h -+++ b/pjlib/include/pj/timer.h -@@ -120,7 +120,10 @@ typedef struct pj_timer_entry - - /** - * Internal unique timer ID, which is assigned by the timer heap. -- * Application should not touch this ID. -+ * Positive values indicate that the timer entry is running, -+ * while -1 means that it's not. Any other value may indicate that it -+ * hasn't been properly initialised or is in a bad state. -+ * Application should not touch this ID. - */ - pj_timer_id_t _timer_id; - -diff --git a/pjlib/src/pj/timer.c b/pjlib/src/pj/timer.c -index 66516fce8..34966c481 100644 ---- a/pjlib/src/pj/timer.c -+++ b/pjlib/src/pj/timer.c -@@ -535,7 +535,7 @@ static int cancel( pj_timer_heap_t *ht, - PJ_CHECK_STACK(); - - // Check to see if the timer_id is out of range -- if (entry->_timer_id < 0 || (pj_size_t)entry->_timer_id > ht->max_size) { -+ if (entry->_timer_id < 1 || (pj_size_t)entry->_timer_id >= ht->max_size) { - entry->_timer_id = -1; - return 0; - } diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/third-party/pjproject/patches/0050-fix-race-parallel-build.patch asterisk-18.12.0~dfsg+~cs6.12.40431413/third-party/pjproject/patches/0050-fix-race-parallel-build.patch --- asterisk-18.11.2~dfsg+~cs6.10.40431413/third-party/pjproject/patches/0050-fix-race-parallel-build.patch 2022-04-14 21:53:34.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/third-party/pjproject/patches/0050-fix-race-parallel-build.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,72 +0,0 @@ -From 78683646c8bc670ec730a42494e075f671a08e28 Mon Sep 17 00:00:00 2001 -From: Guido Falsi -Date: Mon, 11 May 2020 08:50:39 +0200 -Subject: [PATCH] Fix race condition in parallel builds (#2426) - -* Some targets residing in `OBJDIRS` are missing a dependency on that directory, which results in a race condition, causing build to fail sometimes due to the directory not existing when running parallel builds. - -* The `PJSUA_LIB` variable is not defined anywhere, resulting in an empty value, and no correct dependency on the pjsua shared library for `pjsua2`. The correct variable seems to be `PJSUA_LIB_LIB`, defined at the start of this same `Makefile`. ---- - build/rules.mak | 12 ++++++------ - pjsip/build/Makefile | 2 +- - 2 files changed, 7 insertions(+), 7 deletions(-) - -diff --git a/build/rules.mak b/build/rules.mak -index 8fa98655e..912199c41 100644 ---- a/build/rules.mak -+++ b/build/rules.mak -@@ -129,7 +129,7 @@ endif - $(OBJDIR)/$(app).o: $(OBJDIRS) $(OBJS) - $(CROSS_COMPILE)ld -r -o $@ $(OBJS) - --$(OBJDIR)/$(app).ko: $(OBJDIR)/$(app).o -+$(OBJDIR)/$(app).ko: $(OBJDIR)/$(app).o | $(OBJDIRS) - @echo Creating kbuild Makefile... - @echo "# Our module name:" > $(OBJDIR)/Makefile - @echo 'obj-m += $(app).o' >> $(OBJDIR)/Makefile -@@ -154,27 +154,27 @@ $(OBJDIR)/$(app).ko: $(OBJDIR)/$(app).o - ../lib/$(app).ko: $(LIB) $(OBJDIR)/$(app).ko - cp $(OBJDIR)/$(app).ko ../lib - --$(OBJDIR)/%$(OBJEXT): $(SRCDIR)/%.m -+$(OBJDIR)/%$(OBJEXT): $(SRCDIR)/%.m | $(OBJDIRS) - $(CC) $($(APP)_CFLAGS) \ - $(CC_OUT)$(subst /,$(HOST_PSEP),$@) \ - $(subst /,$(HOST_PSEP),$<) - --$(OBJDIR)/%$(OBJEXT): $(SRCDIR)/%.c -+$(OBJDIR)/%$(OBJEXT): $(SRCDIR)/%.c | $(OBJDIRS) - $(CC) $($(APP)_CFLAGS) \ - $(CC_OUT)$(subst /,$(HOST_PSEP),$@) \ - $(subst /,$(HOST_PSEP),$<) - --$(OBJDIR)/%$(OBJEXT): $(SRCDIR)/%.S -+$(OBJDIR)/%$(OBJEXT): $(SRCDIR)/%.S | $(OBJDIRS) - $(CC) $($(APP)_CFLAGS) \ - $(CC_OUT)$(subst /,$(HOST_PSEP),$@) \ - $(subst /,$(HOST_PSEP),$<) - --$(OBJDIR)/%$(OBJEXT): $(SRCDIR)/%.cpp -+$(OBJDIR)/%$(OBJEXT): $(SRCDIR)/%.cpp | $(OBJDIRS) - $(CXX) $($(APP)_CXXFLAGS) \ - $(CC_OUT)$(subst /,$(HOST_PSEP),$@) \ - $(subst /,$(HOST_PSEP),$<) - --$(OBJDIR)/%$(OBJEXT): $(SRCDIR)/%.cc -+$(OBJDIR)/%$(OBJEXT): $(SRCDIR)/%.cc | $(OBJDIRS) - $(CXX) $($(APP)_CXXFLAGS) \ - $(CC_OUT)$(subst /,$(HOST_PSEP),$@) \ - $(subst /,$(HOST_PSEP),$<) -diff --git a/pjsip/build/Makefile b/pjsip/build/Makefile -index b85c7817a..20777909f 100644 ---- a/pjsip/build/Makefile -+++ b/pjsip/build/Makefile -@@ -262,7 +262,7 @@ $(PJSUA_LIB_LIB) $(PJSUA_LIB_SONAME): $(PJSIP_LIB) $(PJSIP_SONAME) $(PJSIP_SIMPL - - pjsua2-lib: $(PJSUA2_LIB_LIB) - $(PJSUA2_LIB_SONAME): $(PJSUA2_LIB_LIB) --$(PJSUA2_LIB_LIB) $(PJSUA2_LIB_SONAME): $(PJSUA_LIB) $(PSJUA_LIB_SONAME) $(PJSIP_LIB) $(PJSIP_SONAME) $(PJSIP_SIMPLE_LIB) $(PJSIP_SIMPLE_SONAME) $(PJSIP_UA_LIB) $(PJSIP_UA_SONAME) -+$(PJSUA2_LIB_LIB) $(PJSUA2_LIB_SONAME): $(PJSUA_LIB_LIB) $(PJSUA_LIB_SONAME) $(PJSIP_LIB) $(PJSIP_SONAME) $(PJSIP_SIMPLE_LIB) $(PJSIP_SIMPLE_SONAME) $(PJSIP_UA_LIB) $(PJSIP_UA_SONAME) - $(MAKE) -f $(RULES_MAK) APP=PJSUA2_LIB app=pjsua2-lib $(subst /,$(HOST_PSEP),$(LIBDIR)/$@) - - pjsip-test: $(TEST_EXE) diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/third-party/pjproject/patches/0060-clone-sdp-for-sip-timer-refresh-invite.patch asterisk-18.12.0~dfsg+~cs6.12.40431413/third-party/pjproject/patches/0060-clone-sdp-for-sip-timer-refresh-invite.patch --- asterisk-18.11.2~dfsg+~cs6.10.40431413/third-party/pjproject/patches/0060-clone-sdp-for-sip-timer-refresh-invite.patch 2022-04-14 21:53:34.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/third-party/pjproject/patches/0060-clone-sdp-for-sip-timer-refresh-invite.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,28 +0,0 @@ -diff -ur source.orig/pjmedia/src/pjmedia/sdp_neg.c source/pjmedia/src/pjmedia/sdp_neg.c ---- source.orig/pjmedia/src/pjmedia/sdp_neg.c 2020-07-02 10:35:42.022459904 +0200 -+++ source/pjmedia/src/pjmedia/sdp_neg.c 2020-07-02 10:33:24.996316867 +0200 -@@ -906,7 +906,7 @@ - * after receiving remote answer. - */ - static pj_status_t process_answer(pj_pool_t *pool, -- pjmedia_sdp_session *offer, -+ pjmedia_sdp_session *local_offer, - pjmedia_sdp_session *answer, - pj_bool_t allow_asym, - pjmedia_sdp_session **p_active) -@@ -914,10 +914,14 @@ - unsigned omi = 0; /* Offer media index */ - unsigned ami = 0; /* Answer media index */ - pj_bool_t has_active = PJ_FALSE; -+ pjmedia_sdp_session *offer; - pj_status_t status; - - /* Check arguments. */ -- PJ_ASSERT_RETURN(pool && offer && answer && p_active, PJ_EINVAL); -+ PJ_ASSERT_RETURN(pool && local_offer && answer && p_active, PJ_EINVAL); -+ -+ /* Duplicate local offer SDP. */ -+ offer = pjmedia_sdp_session_clone(pool, local_offer); - - /* Check that media count match between offer and answer */ - // Ticket #527, different media count is allowed for more interoperability, diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/third-party/pjproject/patches/0070-fix-incorrect-copying-when-creating-cancel.patch asterisk-18.12.0~dfsg+~cs6.12.40431413/third-party/pjproject/patches/0070-fix-incorrect-copying-when-creating-cancel.patch --- asterisk-18.11.2~dfsg+~cs6.10.40431413/third-party/pjproject/patches/0070-fix-incorrect-copying-when-creating-cancel.patch 2022-04-14 21:53:34.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/third-party/pjproject/patches/0070-fix-incorrect-copying-when-creating-cancel.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,37 +0,0 @@ -From ce18018cc17bef8f80c08686e3a7b28384ef3ba5 Mon Sep 17 00:00:00 2001 -From: sauwming -Date: Mon, 12 Oct 2020 13:31:25 +0800 -Subject: [PATCH] Fix incorrect copying of destination info when creating - CANCEL (#2546) - ---- - pjsip/src/pjsip/sip_util.c | 10 +++++----- - 1 file changed, 5 insertions(+), 5 deletions(-) - -diff --git a/pjsip/src/pjsip/sip_util.c b/pjsip/src/pjsip/sip_util.c -index d10a6fa30..a1bf878ea 100644 ---- a/pjsip/src/pjsip/sip_util.c -+++ b/pjsip/src/pjsip/sip_util.c -@@ -779,14 +779,14 @@ PJ_DEF(pj_status_t) pjsip_endpt_create_cancel( pjsip_endpoint *endpt, - pjsip_hdr_clone(cancel_tdata->pool, req_tdata->saved_strict_route); - } - -- /* Copy the destination host name from the original request */ -- pj_strdup(cancel_tdata->pool, &cancel_tdata->dest_info.name, -- &req_tdata->dest_info.name); -- -- /* Finally copy the destination info from the original request */ -+ /* Copy the destination info from the original request */ - pj_memcpy(&cancel_tdata->dest_info, &req_tdata->dest_info, - sizeof(req_tdata->dest_info)); - -+ /* Finally, copy the destination host name from the original request */ -+ pj_strdup(cancel_tdata->pool, &cancel_tdata->dest_info.name, -+ &req_tdata->dest_info.name); -+ - /* Done. - * Return the transmit buffer containing the CANCEL request. - */ --- -2.25.1 - diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/third-party/pjproject/patches/0080-fix-sdp-neg-modify-local-offer.patch asterisk-18.12.0~dfsg+~cs6.12.40431413/third-party/pjproject/patches/0080-fix-sdp-neg-modify-local-offer.patch --- asterisk-18.11.2~dfsg+~cs6.10.40431413/third-party/pjproject/patches/0080-fix-sdp-neg-modify-local-offer.patch 2022-04-14 21:53:34.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/third-party/pjproject/patches/0080-fix-sdp-neg-modify-local-offer.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,33 +0,0 @@ -diff --git a/pjmedia/src/pjmedia/sdp_neg.c b/pjmedia/src/pjmedia/sdp_neg.c -index 3b85b4273..a14009662 100644 ---- a/pjmedia/src/pjmedia/sdp_neg.c -+++ b/pjmedia/src/pjmedia/sdp_neg.c -@@ -304,7 +304,6 @@ PJ_DEF(pj_status_t) pjmedia_sdp_neg_modify_local_offer2( - { - pjmedia_sdp_session *new_offer; - pjmedia_sdp_session *old_offer; -- char media_used[PJMEDIA_MAX_SDP_MEDIA]; - unsigned oi; /* old offer media index */ - pj_status_t status; - -@@ -323,8 +322,19 @@ PJ_DEF(pj_status_t) pjmedia_sdp_neg_modify_local_offer2( - /* Change state to STATE_LOCAL_OFFER */ - neg->state = PJMEDIA_SDP_NEG_STATE_LOCAL_OFFER; - -+ /* When there is no active local SDP in state PJMEDIA_SDP_NEG_STATE_DONE, -+ * it means that the previous initial SDP nego must have been failed, -+ * so we'll just set the local SDP offer here. -+ */ -+ if (!neg->active_local_sdp) { -+ neg->initial_sdp_tmp = NULL; -+ neg->initial_sdp = pjmedia_sdp_session_clone(pool, local); -+ neg->neg_local_sdp = pjmedia_sdp_session_clone(pool, local); -+ -+ return PJ_SUCCESS; -+ } -+ - /* Init vars */ -- pj_bzero(media_used, sizeof(media_used)); - old_offer = neg->active_local_sdp; - new_offer = pjmedia_sdp_session_clone(pool, local); - diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/third-party/pjproject/patches/0090-Skip-unsupported-digest-algorithm-2408.patch asterisk-18.12.0~dfsg+~cs6.12.40431413/third-party/pjproject/patches/0090-Skip-unsupported-digest-algorithm-2408.patch --- asterisk-18.11.2~dfsg+~cs6.10.40431413/third-party/pjproject/patches/0090-Skip-unsupported-digest-algorithm-2408.patch 2022-04-14 21:53:34.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/third-party/pjproject/patches/0090-Skip-unsupported-digest-algorithm-2408.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,212 +0,0 @@ -From bdbeb7c4b2b11efc2e59f5dee7aa4360a2bc9fff Mon Sep 17 00:00:00 2001 -From: sauwming -Date: Thu, 22 Apr 2021 14:03:28 +0800 -Subject: [PATCH 90/90] Skip unsupported digest algorithm (#2408) - -Co-authored-by: Nanang Izzuddin ---- - pjsip/src/pjsip/sip_auth_client.c | 32 +++++-- - tests/pjsua/scripts-sipp/uas-auth-two-algo.py | 7 ++ - .../pjsua/scripts-sipp/uas-auth-two-algo.xml | 83 +++++++++++++++++++ - 3 files changed, 117 insertions(+), 5 deletions(-) - create mode 100644 tests/pjsua/scripts-sipp/uas-auth-two-algo.py - create mode 100644 tests/pjsua/scripts-sipp/uas-auth-two-algo.xml - -diff --git a/pjsip/src/pjsip/sip_auth_client.c b/pjsip/src/pjsip/sip_auth_client.c -index 828b04db9..7eb2f5cd1 100644 ---- a/pjsip/src/pjsip/sip_auth_client.c -+++ b/pjsip/src/pjsip/sip_auth_client.c -@@ -1042,7 +1042,7 @@ static pj_status_t process_auth( pj_pool_t *req_pool, - pjsip_hdr *hdr; - pj_status_t status; - -- /* See if we have sent authorization header for this realm */ -+ /* See if we have sent authorization header for this realm (and scheme) */ - hdr = tdata->msg->hdr.next; - while (hdr != &tdata->msg->hdr) { - if ((hchal->type == PJSIP_H_WWW_AUTHENTICATE && -@@ -1052,7 +1052,8 @@ static pj_status_t process_auth( pj_pool_t *req_pool, - { - sent_auth = (pjsip_authorization_hdr*) hdr; - if (pj_stricmp(&hchal->challenge.common.realm, -- &sent_auth->credential.common.realm )==0) -+ &sent_auth->credential.common.realm)==0 && -+ pj_stricmp(&hchal->scheme, &sent_auth->scheme)==0) - { - /* If this authorization has empty response, remove it. */ - if (pj_stricmp(&sent_auth->scheme, &pjsip_DIGEST_STR)==0 && -@@ -1062,6 +1063,14 @@ static pj_status_t process_auth( pj_pool_t *req_pool, - hdr = hdr->next; - pj_list_erase(sent_auth); - continue; -+ } else -+ if (pj_stricmp(&sent_auth->scheme, &pjsip_DIGEST_STR)==0 && -+ pj_stricmp(&sent_auth->credential.digest.algorithm, -+ &hchal->challenge.digest.algorithm)!=0) -+ { -+ /* Same 'digest' scheme but different algo */ -+ hdr = hdr->next; -+ continue; - } else { - /* Found previous authorization attempt */ - break; -@@ -1155,9 +1164,10 @@ PJ_DEF(pj_status_t) pjsip_auth_clt_reinit_req( pjsip_auth_clt_sess *sess, - { - pjsip_tx_data *tdata; - const pjsip_hdr *hdr; -- unsigned chal_cnt; -+ unsigned chal_cnt, auth_cnt; - pjsip_via_hdr *via; - pj_status_t status; -+ pj_status_t last_auth_err; - - PJ_ASSERT_RETURN(sess && rdata && old_request && new_request, - PJ_EINVAL); -@@ -1178,6 +1188,8 @@ PJ_DEF(pj_status_t) pjsip_auth_clt_reinit_req( pjsip_auth_clt_sess *sess, - */ - hdr = rdata->msg_info.msg->hdr.next; - chal_cnt = 0; -+ auth_cnt = 0; -+ last_auth_err = PJSIP_EAUTHNOAUTH; - while (hdr != &rdata->msg_info.msg->hdr) { - pjsip_cached_auth *cached_auth; - const pjsip_www_authenticate_hdr *hchal; -@@ -1222,8 +1234,13 @@ PJ_DEF(pj_status_t) pjsip_auth_clt_reinit_req( pjsip_auth_clt_sess *sess, - */ - status = process_auth(tdata->pool, hchal, tdata->msg->line.req.uri, - tdata, sess, cached_auth, &hauth); -- if (status != PJ_SUCCESS) -- return status; -+ if (status != PJ_SUCCESS) { -+ last_auth_err = status; -+ -+ /* Process next header. */ -+ hdr = hdr->next; -+ continue; -+ } - - if (pj_pool_get_used_size(cached_auth->pool) > - PJSIP_AUTH_CACHED_POOL_MAX_SIZE) -@@ -1236,12 +1253,17 @@ PJ_DEF(pj_status_t) pjsip_auth_clt_reinit_req( pjsip_auth_clt_sess *sess, - - /* Process next header. */ - hdr = hdr->next; -+ auth_cnt++; - } - - /* Check if challenge is present */ - if (chal_cnt == 0) - return PJSIP_EAUTHNOCHAL; - -+ /* Check if any authorization header has been created */ -+ if (auth_cnt == 0) -+ return last_auth_err; -+ - /* Remove branch param in Via header. */ - via = (pjsip_via_hdr*) pjsip_msg_find_hdr(tdata->msg, PJSIP_H_VIA, NULL); - via->branch_param.slen = 0; -diff --git a/tests/pjsua/scripts-sipp/uas-auth-two-algo.py b/tests/pjsua/scripts-sipp/uas-auth-two-algo.py -new file mode 100644 -index 000000000..c79c9f6d3 ---- /dev/null -+++ b/tests/pjsua/scripts-sipp/uas-auth-two-algo.py -@@ -0,0 +1,7 @@ -+# $Id$ -+# -+import inc_const as const -+ -+PJSUA = ["--null-audio --max-calls=1 --id=sip:a@localhost --username=a --realm=* --registrar=$SIPP_URI"] -+ -+PJSUA_EXPECTS = [[0, "registration success", ""]] -diff --git a/tests/pjsua/scripts-sipp/uas-auth-two-algo.xml b/tests/pjsua/scripts-sipp/uas-auth-two-algo.xml -new file mode 100644 -index 000000000..bd4871940 ---- /dev/null -+++ b/tests/pjsua/scripts-sipp/uas-auth-two-algo.xml -@@ -0,0 +1,83 @@ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ --- -2.31.1 - diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/third-party/pjproject/patches/0100-allow_multiple_auth_headers.patch asterisk-18.12.0~dfsg+~cs6.12.40431413/third-party/pjproject/patches/0100-allow_multiple_auth_headers.patch --- asterisk-18.11.2~dfsg+~cs6.10.40431413/third-party/pjproject/patches/0100-allow_multiple_auth_headers.patch 1970-01-01 00:00:00.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/third-party/pjproject/patches/0100-allow_multiple_auth_headers.patch 2022-05-12 11:50:59.000000000 +0000 @@ -0,0 +1,413 @@ +commit 8e95490e37938f45d9d812905246036c3185b94f +Author: Riza Sulistyo +Date: Thu Mar 24 12:53:03 2022 +0700 + + Add compile time option to allow multiple Authorization header (#3010) + +diff --git a/pjsip/include/pjsip/sip_config.h b/pjsip/include/pjsip/sip_config.h +index dfd9ce977..ccce6ed01 100644 +--- a/pjsip/include/pjsip/sip_config.h ++++ b/pjsip/include/pjsip/sip_config.h +@@ -1280,6 +1280,18 @@ PJ_INLINE(pjsip_cfg_t*) pjsip_cfg(void) + # define PJSIP_AUTH_CNONCE_USE_DIGITS_ONLY 1 + #endif + ++/** ++ * Allow client to send multiple Authorization header when receiving multiple ++ * WWW-Authenticate header fields. If this is disabled, the stack will send ++ * Authorization header field containing credentials that match the ++ * topmost header field. ++ * ++ * Default is 0 ++ */ ++#ifndef PJSIP_AUTH_ALLOW_MULTIPLE_AUTH_HEADER ++# define PJSIP_AUTH_ALLOW_MULTIPLE_AUTH_HEADER 0 ++#endif ++ + /***************************************************************************** + * SIP Event framework and presence settings. + */ +@@ -1458,6 +1470,11 @@ PJ_INLINE(pjsip_cfg_t*) pjsip_cfg(void) + # define PJSIP_INV_ACCEPT_UNKNOWN_BODY PJ_FALSE + #endif + ++/** ++ * Dump configuration to log with verbosity equal to info(3). ++ */ ++PJ_DECL(void) pjsip_dump_config(void); ++ + PJ_END_DECL + + /** +diff --git a/pjsip/src/pjsip/sip_auth_client.c b/pjsip/src/pjsip/sip_auth_client.c +index 35460d01e..ab1a0cd87 100644 +--- a/pjsip/src/pjsip/sip_auth_client.c ++++ b/pjsip/src/pjsip/sip_auth_client.c +@@ -1367,7 +1367,7 @@ PJ_DEF(pj_status_t) pjsip_auth_clt_reinit_req( pjsip_auth_clt_sess *sess, + chal_cnt = 0; + auth_cnt = 0; + last_auth_err = PJSIP_EAUTHNOAUTH; +- while (hdr != &rdata->msg_info.msg->hdr && auth_cnt == 0) { ++ while (hdr != &rdata->msg_info.msg->hdr) { + pjsip_cached_auth *cached_auth; + const pjsip_www_authenticate_hdr *hchal; + pjsip_authorization_hdr *hauth; +@@ -1431,6 +1431,11 @@ PJ_DEF(pj_status_t) pjsip_auth_clt_reinit_req( pjsip_auth_clt_sess *sess, + /* Process next header. */ + hdr = hdr->next; + auth_cnt++; ++ ++#if defined(PJSIP_AUTH_ALLOW_MULTIPLE_AUTH_HEADER) && \ ++ PJSIP_AUTH_ALLOW_MULTIPLE_AUTH_HEADER==0 ++ break; ++#endif + } + + /* Check if challenge is present */ +diff --git a/pjsip/src/pjsip/sip_config.c b/pjsip/src/pjsip/sip_config.c +index 957f9fad4..6920b3dfe 100644 +--- a/pjsip/src/pjsip/sip_config.c ++++ b/pjsip/src/pjsip/sip_config.c +@@ -19,6 +19,9 @@ + */ + + #include ++#include ++ ++static const char *id = "sip_config.c"; + + /* pjsip configuration instance, initialized with default values */ + pjsip_cfg_t pjsip_sip_cfg_var = +@@ -65,6 +68,195 @@ pjsip_cfg_t pjsip_sip_cfg_var = + } + }; + ++PJ_DEF(void) pjsip_dump_config(void) ++{ ++ PJ_LOG(3, (id, "Dumping PJSIP configurations:")); ++ PJ_LOG(3, (id, " PJSIP_MAX_DIALOG_COUNT : %d", ++ PJSIP_MAX_DIALOG_COUNT)); ++ PJ_LOG(3, (id, " PJSIP_MAX_TRANSPORTS : %d", ++ PJSIP_MAX_TRANSPORTS)); ++ PJ_LOG(3, (id, " PJSIP_TPMGR_HTABLE_SIZE : %d", ++ PJSIP_TPMGR_HTABLE_SIZE)); ++ PJ_LOG(3, (id, " PJSIP_MAX_URL_SIZE : %d", ++ PJSIP_MAX_URL_SIZE)); ++ PJ_LOG(3, (id, " PJSIP_MAX_MODULE : %d", ++ PJSIP_MAX_MODULE)); ++ PJ_LOG(3, (id, " PJSIP_MAX_PKT_LEN : %d", ++ PJSIP_MAX_PKT_LEN)); ++ PJ_LOG(3, (id, " PJSIP_HANDLE_EVENTS_HAS_SLEEP_ON_ERR : %d", ++ PJSIP_HANDLE_EVENTS_HAS_SLEEP_ON_ERR)); ++ PJ_LOG(3, (id, " PJSIP_ACCEPT_MULTIPLE_SDP_ANSWERS : %d", ++ PJSIP_ACCEPT_MULTIPLE_SDP_ANSWERS)); ++ PJ_LOG(3, (id, " PJSIP_UDP_SIZE_THRESHOLD : %d", ++ PJSIP_UDP_SIZE_THRESHOLD)); ++ PJ_LOG(3, (id, " PJSIP_INCLUDE_ALLOW_HDR_IN_DLG : %d", ++ PJSIP_INCLUDE_ALLOW_HDR_IN_DLG)); ++ PJ_LOG(3, (id, " PJSIP_SAFE_MODULE : %d", ++ PJSIP_SAFE_MODULE)); ++ PJ_LOG(3, (id, " PJSIP_CHECK_VIA_SENT_BY : %d", ++ PJSIP_CHECK_VIA_SENT_BY)); ++ PJ_LOG(3, (id, " PJSIP_UNESCAPE_IN_PLACE : %d", ++ PJSIP_UNESCAPE_IN_PLACE)); ++ PJ_LOG(3, (id, " PJSIP_MAX_NET_EVENTS : %d", ++ PJSIP_MAX_NET_EVENTS)); ++ PJ_LOG(3, (id, " PJSIP_MAX_TIMED_OUT_ENTRIES : %d", ++ PJSIP_MAX_TIMED_OUT_ENTRIES)); ++ PJ_LOG(3, (id, " PJSIP_TRANSPORT_IDLE_TIME : %d", ++ PJSIP_TRANSPORT_IDLE_TIME)); ++ PJ_LOG(3, (id, " PJSIP_TRANSPORT_SERVER_IDLE_TIME : %d", ++ PJSIP_TRANSPORT_SERVER_IDLE_TIME)); ++ PJ_LOG(3, (id, " PJSIP_MAX_TRANSPORT_USAGE : %d", ++ PJSIP_MAX_TRANSPORT_USAGE)); ++ PJ_LOG(3, (id, " PJSIP_TCP_TRANSPORT_BACKLOG : %d", ++ PJSIP_TCP_TRANSPORT_BACKLOG)); ++ PJ_LOG(3, (id, " PJSIP_TCP_TRANSPORT_REUSEADDR : %d", ++ PJSIP_TCP_TRANSPORT_REUSEADDR)); ++ PJ_LOG(3, (id, " PJSIP_TCP_TRANSPORT_DONT_CREATE_LISTENER : %d", ++ PJSIP_TCP_TRANSPORT_DONT_CREATE_LISTENER)); ++ PJ_LOG(3, (id, " PJSIP_TLS_TRANSPORT_DONT_CREATE_LISTENER : %d", ++ PJSIP_TLS_TRANSPORT_DONT_CREATE_LISTENER)); ++ PJ_LOG(3, (id, " PJSIP_TCP_KEEP_ALIVE_INTERVAL : %d", ++ PJSIP_TCP_KEEP_ALIVE_INTERVAL)); ++ PJ_LOG(3, (id, " PJSIP_POOL_INC_TRANSPORT : %d", ++ PJSIP_POOL_INC_TRANSPORT)); ++ PJ_LOG(3, (id, " PJSIP_POOL_LEN_TDATA : %d", ++ PJSIP_POOL_LEN_TDATA)); ++ PJ_LOG(3, (id, " PJSIP_POOL_INC_TDATA : %d", ++ PJSIP_POOL_INC_TDATA)); ++ PJ_LOG(3, (id, " PJSIP_POOL_LEN_UA : %d", ++ PJSIP_POOL_LEN_UA)); ++ PJ_LOG(3, (id, " PJSIP_POOL_INC_UA : %d", ++ PJSIP_POOL_INC_UA)); ++ PJ_LOG(3, (id, " PJSIP_POOL_EVSUB_LEN : %d", ++ PJSIP_POOL_EVSUB_LEN)); ++ PJ_LOG(3, (id, " PJSIP_POOL_EVSUB_INC : %d", ++ PJSIP_POOL_EVSUB_INC)); ++ PJ_LOG(3, (id, " PJSIP_MAX_FORWARDS_VALUE : %d", ++ PJSIP_MAX_FORWARDS_VALUE)); ++ PJ_LOG(3, (id, " PJSIP_RFC3261_BRANCH_ID : %s", ++ PJSIP_RFC3261_BRANCH_ID)); ++ PJ_LOG(3, (id, " PJSIP_RFC3261_BRANCH_LEN : %d", ++ PJSIP_RFC3261_BRANCH_LEN)); ++ PJ_LOG(3, (id, " PJSIP_POOL_TSX_LAYER_LEN : %d", ++ PJSIP_POOL_TSX_LAYER_LEN)); ++ PJ_LOG(3, (id, " PJSIP_POOL_TSX_LAYER_INC : %d", ++ PJSIP_POOL_TSX_LAYER_INC)); ++ PJ_LOG(3, (id, " PJSIP_POOL_TSX_LEN : %d", ++ PJSIP_POOL_TSX_LEN)); ++ PJ_LOG(3, (id, " PJSIP_POOL_TSX_INC : %d", ++ PJSIP_POOL_TSX_INC)); ++ PJ_LOG(3, (id, " PJSIP_TSX_1XX_RETRANS_DELAY : %d", ++ PJSIP_TSX_1XX_RETRANS_DELAY)); ++ PJ_LOG(3, (id, " PJSIP_TSX_UAS_CONTINUE_ON_TP_ERROR : %d", ++ PJSIP_TSX_UAS_CONTINUE_ON_TP_ERROR)); ++ PJ_LOG(3, (id, " PJSIP_MAX_TSX_KEY_LEN : %d", ++ PJSIP_MAX_TSX_KEY_LEN)); ++ PJ_LOG(3, (id, " PJSIP_POOL_LEN_USER_AGENT : %d", ++ PJSIP_POOL_LEN_USER_AGENT)); ++ PJ_LOG(3, (id, " PJSIP_POOL_INC_USER_AGENT : %d", ++ PJSIP_POOL_INC_USER_AGENT)); ++ PJ_LOG(3, (id, " PJSIP_MAX_BRANCH_LEN : %d", ++ PJSIP_MAX_HNAME_LEN)); ++ PJ_LOG(3, (id, " PJSIP_POOL_LEN_DIALOG : %d", ++ PJSIP_POOL_LEN_DIALOG)); ++ PJ_LOG(3, (id, " PJSIP_POOL_INC_DIALOG : %d", ++ PJSIP_POOL_INC_DIALOG)); ++ PJ_LOG(3, (id, " PJSIP_MAX_HEADER_TYPES : %d", ++ PJSIP_MAX_HEADER_TYPES)); ++ PJ_LOG(3, (id, " PJSIP_MAX_URI_TYPES : %d", ++ PJSIP_MAX_URI_TYPES)); ++ PJ_LOG(3, (id, " PJSIP_AUTH_HEADER_CACHING : %d", ++ PJSIP_AUTH_HEADER_CACHING)); ++ PJ_LOG(3, (id, " PJSIP_AUTH_AUTO_SEND_NEXT : %d", ++ PJSIP_AUTH_AUTO_SEND_NEXT)); ++ PJ_LOG(3, (id, " PJSIP_AUTH_QOP_SUPPORT : %d", ++ PJSIP_AUTH_QOP_SUPPORT)); ++ PJ_LOG(3, (id, " PJSIP_MAX_STALE_COUNT : %d", ++ PJSIP_MAX_STALE_COUNT)); ++ PJ_LOG(3, (id, " PJSIP_HAS_DIGEST_AKA_AUTH : %d", ++ PJSIP_HAS_DIGEST_AKA_AUTH)); ++ PJ_LOG(3, (id, " PJSIP_REGISTER_CLIENT_DELAY_BEFORE_REFRESH : %d", ++ PJSIP_REGISTER_CLIENT_DELAY_BEFORE_REFRESH)); ++ PJ_LOG(3, (id, " PJSIP_REGISTER_ALLOW_EXP_REFRESH : %d", ++ PJSIP_REGISTER_ALLOW_EXP_REFRESH)); ++ PJ_LOG(3, (id, " PJSIP_AUTH_CACHED_POOL_MAX_SIZE : %d", ++ PJSIP_AUTH_CACHED_POOL_MAX_SIZE)); ++ PJ_LOG(3, (id, " PJSIP_AUTH_CNONCE_USE_DIGITS_ONLY : %d", ++ PJSIP_AUTH_CNONCE_USE_DIGITS_ONLY)); ++ PJ_LOG(3, (id, " PJSIP_AUTH_ALLOW_MULTIPLE_AUTH_HEADER : %d", ++ PJSIP_AUTH_ALLOW_MULTIPLE_AUTH_HEADER)); ++ PJ_LOG(3, (id, " PJSIP_EVSUB_TIME_UAC_REFRESH : %d", ++ PJSIP_EVSUB_TIME_UAC_REFRESH)); ++ PJ_LOG(3, (id, " PJSIP_PUBLISHC_DELAY_BEFORE_REFRESH : %d", ++ PJSIP_PUBLISHC_DELAY_BEFORE_REFRESH)); ++ PJ_LOG(3, (id, " PJSIP_EVSUB_TIME_UAC_TERMINATE : %d", ++ PJSIP_EVSUB_TIME_UAC_TERMINATE)); ++ PJ_LOG(3, (id, " PJSIP_EVSUB_TIME_UAC_WAIT_NOTIFY : %d", ++ PJSIP_EVSUB_TIME_UAC_WAIT_NOTIFY)); ++ PJ_LOG(3, (id, " PJSIP_PRES_DEFAULT_EXPIRES : %d", ++ PJSIP_PRES_DEFAULT_EXPIRES)); ++ PJ_LOG(3, (id, " PJSIP_PRES_BAD_CONTENT_RESPONSE : %d", ++ PJSIP_PRES_BAD_CONTENT_RESPONSE)); ++ PJ_LOG(3, (id, " PJSIP_PRES_PIDF_ADD_TIMESTAMP : %d", ++ PJSIP_PRES_PIDF_ADD_TIMESTAMP)); ++ PJ_LOG(3, (id, " PJSIP_SESS_TIMER_DEF_SE : %d", ++ PJSIP_SESS_TIMER_DEF_SE)); ++ PJ_LOG(3, (id, " PJSIP_SESS_TIMER_RETRY_DELAY : %d", ++ PJSIP_SESS_TIMER_RETRY_DELAY)); ++ PJ_LOG(3, (id, " PJSIP_PUBLISHC_QUEUE_REQUEST : %d", ++ PJSIP_PUBLISHC_QUEUE_REQUEST)); ++ PJ_LOG(3, (id, " PJSIP_MWI_DEFAULT_EXPIRES : %d", ++ PJSIP_MWI_DEFAULT_EXPIRES)); ++ PJ_LOG(3, (id, " PJSIP_HAS_TX_DATA_LIST : %d", ++ PJSIP_HAS_TX_DATA_LIST)); ++ PJ_LOG(3, (id, " PJSIP_INV_ACCEPT_UNKNOWN_BODY : %d", ++ PJSIP_INV_ACCEPT_UNKNOWN_BODY)); ++ PJ_LOG(3, (id, " pjsip_cfg()->endpt.allow_port_in_fromto_hdr : %d", ++ pjsip_cfg()->endpt.allow_port_in_fromto_hdr)); ++ PJ_LOG(3, (id, " pjsip_cfg()->endpt.accept_replace_in_early_state : %d", ++ pjsip_cfg()->endpt.accept_replace_in_early_state)); ++ PJ_LOG(3, (id, " pjsip_cfg()->endpt.allow_tx_hash_in_uri : %d", ++ pjsip_cfg()->endpt.allow_tx_hash_in_uri)); ++ PJ_LOG(3, (id, " pjsip_cfg()->endpt.disable_rport : %d", ++ pjsip_cfg()->endpt.disable_rport)); ++ PJ_LOG(3, (id, " pjsip_cfg()->endpt.disable_tcp_switch : %d", ++ pjsip_cfg()->endpt.disable_tcp_switch)); ++ PJ_LOG(3, (id, " pjsip_cfg()->endpt.disable_tls_switch : %d", ++ pjsip_cfg()->endpt.disable_tls_switch)); ++ PJ_LOG(3, (id, " pjsip_cfg()->endpt.follow_early_media_fork : %d", ++ pjsip_cfg()->endpt.follow_early_media_fork)); ++ PJ_LOG(3, (id, " pjsip_cfg()->endpt.req_has_via_alias : %d", ++ pjsip_cfg()->endpt.req_has_via_alias)); ++ PJ_LOG(3, (id, " pjsip_cfg()->endpt.resolve_hostname_to_get_interface:%d", ++ pjsip_cfg()->endpt.resolve_hostname_to_get_interface)); ++ PJ_LOG(3, (id, " pjsip_cfg()->endpt.disable_secure_dlg_check : %d", ++ pjsip_cfg()->endpt.disable_secure_dlg_check)); ++ PJ_LOG(3, (id, " pjsip_cfg()->endpt.use_compact_form : %d", ++ pjsip_cfg()->endpt.use_compact_form)); ++ PJ_LOG(3, (id, " pjsip_cfg()->endpt.accept_multiple_sdp_answers : %d", ++ pjsip_cfg()->endpt.accept_multiple_sdp_answers)); ++ PJ_LOG(3, (id, " pjsip_cfg()->endpt.keep_inv_after_tsx_timeout : %d", ++ pjsip_cfg()->endpt.keep_inv_after_tsx_timeout)); ++ PJ_LOG(3, (id, " pjsip_cfg()->tsx.max_count : %d", ++ pjsip_cfg()->tsx.max_count)); ++ PJ_LOG(3, (id, " pjsip_cfg()->tsx.t1 : %d", ++ pjsip_cfg()->tsx.t1)); ++ PJ_LOG(3, (id, " pjsip_cfg()->tsx.t2 : %d", ++ pjsip_cfg()->tsx.t2)); ++ PJ_LOG(3, (id, " pjsip_cfg()->tsx.t4 : %d", ++ pjsip_cfg()->tsx.t4)); ++ PJ_LOG(3, (id, " pjsip_cfg()->td : %d", ++ pjsip_cfg()->tsx.td)); ++ PJ_LOG(3, (id, " pjsip_cfg()->regc.check_contact : %d", ++ pjsip_cfg()->regc.check_contact)); ++ PJ_LOG(3, (id, " pjsip_cfg()->regc.add_xuid_param : %d", ++ pjsip_cfg()->regc.add_xuid_param)); ++ PJ_LOG(3, (id, " pjsip_cfg()->tcp.keep_alive_interval : %d", ++ pjsip_cfg()->tcp.keep_alive_interval)); ++ PJ_LOG(3, (id, " pjsip_cfg()->tls.keep_alive_interval : %d", ++ pjsip_cfg()->tls.keep_alive_interval)); ++} ++ + + #ifdef PJ_DLL + PJ_DEF(pjsip_cfg_t*) pjsip_cfg(void) +diff --git a/pjsip/src/pjsua-lib/pjsua_core.c b/pjsip/src/pjsua-lib/pjsua_core.c +index c437011b5..343316b56 100644 +--- a/pjsip/src/pjsua-lib/pjsua_core.c ++++ b/pjsip/src/pjsua-lib/pjsua_core.c +@@ -3443,8 +3443,10 @@ PJ_DEF(void) pjsua_dump(pj_bool_t detail) + old_decor = pj_log_get_decor(); + pj_log_set_decor(old_decor & (PJ_LOG_HAS_NEWLINE | PJ_LOG_HAS_CR)); + +- if (detail) ++ if (detail) { + pj_dump_config(); ++ pjsip_dump_config(); ++ } + + pjsip_endpt_dump(pjsua_get_pjsip_endpt(), detail); + +diff --git a/tests/pjsua/inc_sip.py b/tests/pjsua/inc_sip.py +index f7e64816e..2cc1a17a8 100644 +--- a/tests/pjsua/inc_sip.py ++++ b/tests/pjsua/inc_sip.py +@@ -306,9 +306,11 @@ class RecvfromTransaction: + body = None + # Pattern to be expected on pjsua when receiving the response + expect = "" ++ # Required config ++ pj_config = "" + + def __init__(self, title, resp_code, check_cseq=True, +- include=[], exclude=[], cmds=[], resp_hdr=[], resp_body=None, expect=""): ++ include=[], exclude=[], cmds=[], resp_hdr=[], resp_body=None, expect="", pj_config=""): + self.title = title + self.cmds = cmds + self.include = include +@@ -317,6 +319,7 @@ class RecvfromTransaction: + self.resp_hdr = resp_hdr + self.body = resp_body + self.expect = expect ++ self.pj_config=pj_config + + + class RecvfromCfg: +@@ -328,15 +331,18 @@ class RecvfromCfg: + transaction = None + # Use TCP? + tcp = False ++ # Required config ++ pj_config = "" + + # Note: + # Any "$PORT" string in the pjsua_args will be replaced + # by server port +- def __init__(self, name, pjsua_args, transaction, tcp=False): ++ def __init__(self, name, pjsua_args, transaction, tcp=False, pj_config=""): + self.name = name + self.inst_param = cfg.InstanceParam("pjsua", pjsua_args) + self.transaction = transaction + self.tcp=tcp ++ self.pj_config=pj_config + + + +diff --git a/tests/pjsua/mod_recvfrom.py b/tests/pjsua/mod_recvfrom.py +index 918006aff..4305bfb42 100644 +--- a/tests/pjsua/mod_recvfrom.py ++++ b/tests/pjsua/mod_recvfrom.py +@@ -18,10 +18,20 @@ def test_func(test): + local_port=srv_port, + tcp=cfg_file.recvfrom_cfg.tcp) + ++ config = pjsua.get_config(cfg_file.recvfrom_cfg.pj_config) ++ print "Config : " + config ++ + last_cseq = 0 + last_method = "" + last_call_id = "" + for t in cfg_file.recvfrom_cfg.transaction: ++ # Check if transaction requires configuration ++ if t.pj_config != "": ++ r = re.compile(t.pj_config, re.I) ++ if r.search(config) == None: ++ print "Configuration : " + t.pj_config + " not found, skipping" ++ continue ++ + # Print transaction title + if t.title != "": + dlg.trace(t.title) +diff --git a/tests/pjsua/run.py b/tests/pjsua/run.py +index 35b00dec5..cffc38470 100644 +--- a/tests/pjsua/run.py ++++ b/tests/pjsua/run.py +@@ -249,6 +249,10 @@ class Expect(threading.Thread): + time.sleep(0.01) + return None + ++ def get_config(self, key_config): ++ self.send("dd") ++ line = self.expect(key_config); ++ return line + + def sync_stdout(self): + if not self.use_telnet: +diff --git a/tests/pjsua/scripts-recvfrom/215_reg_good_multi_ok.py b/tests/pjsua/scripts-recvfrom/215_reg_good_multi_ok.py +index a98b8b1d8..909ba229b 100644 +--- a/tests/pjsua/scripts-recvfrom/215_reg_good_multi_ok.py ++++ b/tests/pjsua/scripts-recvfrom/215_reg_good_multi_ok.py +@@ -14,16 +14,27 @@ req1 = sip.RecvfromTransaction("Initial registration", 401, + expect="SIP/2.0 401" + ) + +-req2 = sip.RecvfromTransaction("Registration retry with auth", 200, ++req2 = sip.RecvfromTransaction("Registration retry with auth (not allowed multiple auth)", 200, + include=["REGISTER sip", +- # Must only have 1 Auth hdr since #2887 + "Authorization:", # [\\s\\S]+Authorization:" + "realm=\"python1\"", # "realm=\"python2\"", + "username=\"theuser1\"", # "username=\"theuser2\"", + "nonce=\"1234\"", # "nonce=\"6789\"", + "response="], +- expect="registration success" ++ expect="registration success", ++ pj_config="PJSIP_AUTH_ALLOW_MULTIPLE_AUTH_HEADER.*: 0" + ) + ++req3 = sip.RecvfromTransaction("Registration retry with auth (allowed multiple auth)", 200, ++ include=["REGISTER sip", ++ "Authorization:[\\s\\S]+Authorization:", # Must have 2 Auth hdrs ++ "realm=\"python1\"", "realm=\"python2\"", ++ "username=\"theuser1\"", "username=\"theuser2\"", ++ "nonce=\"1234\"", "nonce=\"6789\"", ++ "response="], ++ expect="registration success", ++ pj_config="PJSIP_AUTH_ALLOW_MULTIPLE_AUTH_HEADER.*: 1" ++ ) ++ + recvfrom_cfg = sip.RecvfromCfg("Multiple authentication challenges", +- pjsua, [req1, req2]) ++ pjsua, [req1, req2, req3], pj_config="PJSIP_AUTH_ALLOW_MULTIPLE_AUTH_HEADER") diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/third-party/pjproject/patches/0100-fix-double-stun-free.patch asterisk-18.12.0~dfsg+~cs6.12.40431413/third-party/pjproject/patches/0100-fix-double-stun-free.patch --- asterisk-18.11.2~dfsg+~cs6.10.40431413/third-party/pjproject/patches/0100-fix-double-stun-free.patch 2022-04-14 21:53:34.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/third-party/pjproject/patches/0100-fix-double-stun-free.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,82 +0,0 @@ -commit f0ff5817d0647bdecd1ec99488db9378e304cf83 -Author: sauwming -Date: Mon May 17 09:56:27 2021 +0800 - - Fix double free of stun session (#2709) - -diff --git a/pjnath/include/pjnath/stun_session.h b/pjnath/include/pjnath/stun_session.h -index bee630ab4..afca06911 100644 ---- a/pjnath/include/pjnath/stun_session.h -+++ b/pjnath/include/pjnath/stun_session.h -@@ -341,6 +341,7 @@ struct pj_stun_tx_data - pj_pool_t *pool; /**< Pool. */ - pj_stun_session *sess; /**< The STUN session. */ - pj_stun_msg *msg; /**< The STUN message. */ -+ pj_bool_t is_destroying; /**< Is destroying? */ - - void *token; /**< The token. */ - -diff --git a/pjnath/src/pjnath/stun_session.c b/pjnath/src/pjnath/stun_session.c -index f2b4f7058..d436b94bf 100644 ---- a/pjnath/src/pjnath/stun_session.c -+++ b/pjnath/src/pjnath/stun_session.c -@@ -167,16 +167,27 @@ static void tdata_on_destroy(void *arg) - { - pj_stun_tx_data *tdata = (pj_stun_tx_data*)arg; - -+ if (tdata->grp_lock) { -+ pj_grp_lock_dec_ref(tdata->sess->grp_lock); -+ } -+ - pj_pool_safe_release(&tdata->pool); - } - - static void destroy_tdata(pj_stun_tx_data *tdata, pj_bool_t force) - { -- TRACE_((THIS_FILE, "tdata %p destroy request, force=%d, tsx=%p", tdata, -- force, tdata->client_tsx)); -+ TRACE_((THIS_FILE, -+ "tdata %p destroy request, force=%d, tsx=%p, destroying=%d", -+ tdata, force, tdata->client_tsx, tdata->is_destroying)); -+ -+ /* Just return if destroy has been requested before */ -+ if (tdata->is_destroying) -+ return; - - /* STUN session may have been destroyed, except when tdata is cached. */ - -+ tdata->is_destroying = PJ_TRUE; -+ - if (tdata->res_timer.id != PJ_FALSE) { - pj_timer_heap_cancel_if_active(tdata->sess->cfg->timer_heap, - &tdata->res_timer, PJ_FALSE); -@@ -189,7 +200,6 @@ static void destroy_tdata(pj_stun_tx_data *tdata, pj_bool_t force) - pj_stun_client_tsx_set_data(tdata->client_tsx, NULL); - } - if (tdata->grp_lock) { -- pj_grp_lock_dec_ref(tdata->sess->grp_lock); - pj_grp_lock_dec_ref(tdata->grp_lock); - } else { - tdata_on_destroy(tdata); -@@ -200,11 +210,11 @@ static void destroy_tdata(pj_stun_tx_data *tdata, pj_bool_t force) - /* "Probably" this is to absorb retransmission */ - pj_time_val delay = {0, 300}; - pj_stun_client_tsx_schedule_destroy(tdata->client_tsx, &delay); -+ tdata->is_destroying = PJ_FALSE; - - } else { - pj_list_erase(tdata); - if (tdata->grp_lock) { -- pj_grp_lock_dec_ref(tdata->sess->grp_lock); - pj_grp_lock_dec_ref(tdata->grp_lock); - } else { - tdata_on_destroy(tdata); -@@ -238,7 +248,7 @@ static void on_cache_timeout(pj_timer_heap_t *timer_heap, - sess = tdata->sess; - - pj_grp_lock_acquire(sess->grp_lock); -- if (sess->is_destroying) { -+ if (sess->is_destroying || tdata->is_destroying) { - pj_grp_lock_release(sess->grp_lock); - return; - } diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/third-party/pjproject/patches/0110-tls-parent-listener-destroyed.patch asterisk-18.12.0~dfsg+~cs6.12.40431413/third-party/pjproject/patches/0110-tls-parent-listener-destroyed.patch --- asterisk-18.11.2~dfsg+~cs6.10.40431413/third-party/pjproject/patches/0110-tls-parent-listener-destroyed.patch 2022-04-14 21:53:34.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/third-party/pjproject/patches/0110-tls-parent-listener-destroyed.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,166 +0,0 @@ -From bb92c97ea512aa0ef316c9b2335c7d57b84dfc9a Mon Sep 17 00:00:00 2001 -From: Nanang Izzuddin -Date: Wed, 16 Jun 2021 12:12:35 +0700 -Subject: [PATCH 1/2] - Avoid SSL socket parent/listener getting destroyed - during handshake by increasing parent's reference count. - Add missing SSL - socket close when the newly accepted SSL socket is discarded in SIP TLS - transport. - ---- - pjlib/src/pj/ssl_sock_imp_common.c | 44 +++++++++++++++++++++-------- - pjsip/src/pjsip/sip_transport_tls.c | 23 ++++++++++++++- - 2 files changed, 55 insertions(+), 12 deletions(-) - -diff --git a/pjlib/src/pj/ssl_sock_imp_common.c b/pjlib/src/pj/ssl_sock_imp_common.c -index bc468bcb3..abec31805 100644 ---- a/pjlib/src/pj/ssl_sock_imp_common.c -+++ b/pjlib/src/pj/ssl_sock_imp_common.c -@@ -224,6 +224,8 @@ static pj_bool_t on_handshake_complete(pj_ssl_sock_t *ssock, - - /* Accepting */ - if (ssock->is_server) { -+ pj_bool_t ret = PJ_TRUE; -+ - if (status != PJ_SUCCESS) { - /* Handshake failed in accepting, destroy our self silently. */ - -@@ -241,6 +243,12 @@ static pj_bool_t on_handshake_complete(pj_ssl_sock_t *ssock, - status); - } - -+ /* Decrement ref count of parent */ -+ if (ssock->parent->param.grp_lock) { -+ pj_grp_lock_dec_ref(ssock->parent->param.grp_lock); -+ ssock->parent = NULL; -+ } -+ - /* Originally, this is a workaround for ticket #985. However, - * a race condition may occur in multiple worker threads - * environment when we are destroying SSL objects while other -@@ -284,23 +292,29 @@ static pj_bool_t on_handshake_complete(pj_ssl_sock_t *ssock, - - return PJ_FALSE; - } -+ - /* Notify application the newly accepted SSL socket */ - if (ssock->param.cb.on_accept_complete2) { -- pj_bool_t ret; - ret = (*ssock->param.cb.on_accept_complete2) - (ssock->parent, ssock, (pj_sockaddr_t*)&ssock->rem_addr, - pj_sockaddr_get_len((pj_sockaddr_t*)&ssock->rem_addr), - status); -- if (ret == PJ_FALSE) -- return PJ_FALSE; - } else if (ssock->param.cb.on_accept_complete) { -- pj_bool_t ret; - ret = (*ssock->param.cb.on_accept_complete) - (ssock->parent, ssock, (pj_sockaddr_t*)&ssock->rem_addr, - pj_sockaddr_get_len((pj_sockaddr_t*)&ssock->rem_addr)); -- if (ret == PJ_FALSE) -- return PJ_FALSE; - } -+ -+ /* Decrement ref count of parent and reset parent (we don't need it -+ * anymore, right?). -+ */ -+ if (ssock->parent->param.grp_lock) { -+ pj_grp_lock_dec_ref(ssock->parent->param.grp_lock); -+ ssock->parent = NULL; -+ } -+ -+ if (ret == PJ_FALSE) -+ return PJ_FALSE; - } - - /* Connecting */ -@@ -864,9 +878,13 @@ static pj_bool_t asock_on_accept_complete (pj_activesock_t *asock, - if (status != PJ_SUCCESS) - goto on_return; - -+ /* Set parent and add ref count (avoid parent destroy during handshake) */ -+ ssock->parent = ssock_parent; -+ if (ssock->parent->param.grp_lock) -+ pj_grp_lock_add_ref(ssock->parent->param.grp_lock); -+ - /* Update new SSL socket attributes */ - ssock->sock = newsock; -- ssock->parent = ssock_parent; - ssock->is_server = PJ_TRUE; - if (ssock_parent->cert) { - status = pj_ssl_sock_set_certificate(ssock, ssock->pool, -@@ -913,16 +931,20 @@ static pj_bool_t asock_on_accept_complete (pj_activesock_t *asock, - ssock->asock_rbuf = (void**)pj_pool_calloc(ssock->pool, - ssock->param.async_cnt, - sizeof(void*)); -- if (!ssock->asock_rbuf) -- return PJ_ENOMEM; -+ if (!ssock->asock_rbuf) { -+ status = PJ_ENOMEM; -+ goto on_return; -+ } - - for (i = 0; iparam.async_cnt; ++i) { -- ssock->asock_rbuf[i] = (void*) pj_pool_alloc( -+ ssock->asock_rbuf[i] = (void*) pj_pool_alloc( - ssock->pool, - ssock->param.read_buffer_size + - sizeof(read_data_t*)); -- if (!ssock->asock_rbuf[i]) -- return PJ_ENOMEM; -+ if (!ssock->asock_rbuf[i]) { -+ status = PJ_ENOMEM; -+ goto on_return; -+ } - } - - /* Create active socket */ -diff --git a/pjsip/src/pjsip/sip_transport_tls.c b/pjsip/src/pjsip/sip_transport_tls.c -index 17b7ae3de..ce524d53f 100644 ---- a/pjsip/src/pjsip/sip_transport_tls.c -+++ b/pjsip/src/pjsip/sip_transport_tls.c -@@ -1325,9 +1325,26 @@ static pj_bool_t on_accept_complete2(pj_ssl_sock_t *ssock, - PJ_UNUSED_ARG(src_addr_len); - - listener = (struct tls_listener*) pj_ssl_sock_get_user_data(ssock); -+ if (!listener) { -+ /* Listener already destroyed, e.g: after TCP accept but before SSL -+ * handshake is completed. -+ */ -+ if (new_ssock && accept_status == PJ_SUCCESS) { -+ /* Close the SSL socket if the accept op is successful */ -+ PJ_LOG(4,(THIS_FILE, -+ "Incoming TLS connection from %s (sock=%d) is discarded " -+ "because listener is already destroyed", -+ pj_sockaddr_print(src_addr, addr, sizeof(addr), 3), -+ new_ssock)); -+ -+ pj_ssl_sock_close(new_ssock); -+ } -+ -+ return PJ_FALSE; -+ } - - if (accept_status != PJ_SUCCESS) { -- if (listener && listener->tls_setting.on_accept_fail_cb) { -+ if (listener->tls_setting.on_accept_fail_cb) { - pjsip_tls_on_accept_fail_param param; - pj_ssl_sock_info ssi; - -@@ -1350,6 +1367,8 @@ static pj_bool_t on_accept_complete2(pj_ssl_sock_t *ssock, - PJ_ASSERT_RETURN(new_ssock, PJ_TRUE); - - if (!listener->is_registered) { -+ pj_ssl_sock_close(new_ssock); -+ - if (listener->tls_setting.on_accept_fail_cb) { - pjsip_tls_on_accept_fail_param param; - pj_bzero(¶m, sizeof(param)); -@@ -1401,6 +1420,8 @@ static pj_bool_t on_accept_complete2(pj_ssl_sock_t *ssock, - ssl_info.grp_lock, &tls); - - if (status != PJ_SUCCESS) { -+ pj_ssl_sock_close(new_ssock); -+ - if (listener->tls_setting.on_accept_fail_cb) { - pjsip_tls_on_accept_fail_param param; - pj_bzero(¶m, sizeof(param)); diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/third-party/pjproject/patches/0111-ssl-premature-destroy.patch asterisk-18.12.0~dfsg+~cs6.12.40431413/third-party/pjproject/patches/0111-ssl-premature-destroy.patch --- asterisk-18.11.2~dfsg+~cs6.10.40431413/third-party/pjproject/patches/0111-ssl-premature-destroy.patch 2022-04-14 21:53:34.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/third-party/pjproject/patches/0111-ssl-premature-destroy.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,136 +0,0 @@ -From 68c69f516f95df1faa42e5647e9ce7cfdc41ac38 Mon Sep 17 00:00:00 2001 -From: Nanang Izzuddin -Date: Wed, 16 Jun 2021 12:15:29 +0700 -Subject: [PATCH 2/2] - Fix silly mistake: accepted active socket created - without group lock in SSL socket. - Replace assertion with normal validation - check of SSL socket instance in OpenSSL verification callback (verify_cb()) - to avoid crash, e.g: if somehow race condition with SSL socket destroy - happens or OpenSSL application data index somehow gets corrupted. - ---- - pjlib/src/pj/ssl_sock_imp_common.c | 3 +- - pjlib/src/pj/ssl_sock_ossl.c | 45 +++++++++++++++++++++++++----- - 2 files changed, 40 insertions(+), 8 deletions(-) - -diff --git a/pjlib/src/pj/ssl_sock_imp_common.c b/pjlib/src/pj/ssl_sock_imp_common.c -index bc468bcb3..c2b8a846b 100644 ---- a/pjlib/src/pj/ssl_sock_imp_common.c -+++ b/pjlib/src/pj/ssl_sock_imp_common.c -@@ -927,6 +927,7 @@ static pj_bool_t asock_on_accept_complete (pj_activesock_t *asock, - - /* Create active socket */ - pj_activesock_cfg_default(&asock_cfg); -+ asock_cfg.grp_lock = ssock->param.grp_lock; - asock_cfg.async_cnt = ssock->param.async_cnt; - asock_cfg.concurrency = ssock->param.concurrency; - asock_cfg.whole_data = PJ_TRUE; -@@ -942,7 +943,7 @@ static pj_bool_t asock_on_accept_complete (pj_activesock_t *asock, - goto on_return; - - pj_grp_lock_add_ref(glock); -- asock_cfg.grp_lock = ssock->param.grp_lock = glock; -+ ssock->param.grp_lock = glock; - pj_grp_lock_add_handler(ssock->param.grp_lock, ssock->pool, ssock, - ssl_on_destroy); - } -diff --git a/pjlib/src/pj/ssl_sock_ossl.c b/pjlib/src/pj/ssl_sock_ossl.c -index a95b339a5..56841f80a 100644 ---- a/pjlib/src/pj/ssl_sock_ossl.c -+++ b/pjlib/src/pj/ssl_sock_ossl.c -@@ -327,7 +327,8 @@ static pj_status_t STATUS_FROM_SSL_ERR(char *action, pj_ssl_sock_t *ssock, - ERROR_LOG("STATUS_FROM_SSL_ERR", err, ssock); - } - -- ssock->last_err = err; -+ if (ssock) -+ ssock->last_err = err; - return GET_STATUS_FROM_SSL_ERR(err); - } - -@@ -344,7 +345,8 @@ static pj_status_t STATUS_FROM_SSL_ERR2(char *action, pj_ssl_sock_t *ssock, - /* Dig for more from OpenSSL error queue */ - SSLLogErrors(action, ret, err, len, ssock); - -- ssock->last_err = ssl_err; -+ if (ssock) -+ ssock->last_err = ssl_err; - return GET_STATUS_FROM_SSL_ERR(ssl_err); - } - -@@ -587,6 +589,13 @@ static pj_status_t init_openssl(void) - - /* Create OpenSSL application data index for SSL socket */ - sslsock_idx = SSL_get_ex_new_index(0, "SSL socket", NULL, NULL, NULL); -+ if (sslsock_idx == -1) { -+ status = STATUS_FROM_SSL_ERR2("Init", NULL, -1, ERR_get_error(), 0); -+ PJ_LOG(1,(THIS_FILE, -+ "Fatal error: failed to get application data index for " -+ "SSL socket")); -+ return status; -+ } - - return status; - } -@@ -614,21 +623,36 @@ static int password_cb(char *buf, int num, int rwflag, void *user_data) - } - - --/* SSL password callback. */ -+/* SSL certificate verification result callback. -+ * Note that this callback seems to be always called from library worker -+ * thread, e.g: active socket on_read_complete callback, which should have -+ * already been equipped with race condition avoidance mechanism (should not -+ * be destroyed while callback is being invoked). -+ */ - static int verify_cb(int preverify_ok, X509_STORE_CTX *x509_ctx) - { -- pj_ssl_sock_t *ssock; -- SSL *ossl_ssl; -+ pj_ssl_sock_t *ssock = NULL; -+ SSL *ossl_ssl = NULL; - int err; - - /* Get SSL instance */ - ossl_ssl = X509_STORE_CTX_get_ex_data(x509_ctx, - SSL_get_ex_data_X509_STORE_CTX_idx()); -- pj_assert(ossl_ssl); -+ if (!ossl_ssl) { -+ PJ_LOG(1,(THIS_FILE, -+ "SSL verification callback failed to get SSL instance")); -+ goto on_return; -+ } - - /* Get SSL socket instance */ - ssock = SSL_get_ex_data(ossl_ssl, sslsock_idx); -- pj_assert(ssock); -+ if (!ssock) { -+ /* SSL socket may have been destroyed */ -+ PJ_LOG(1,(THIS_FILE, -+ "SSL verification callback failed to get SSL socket " -+ "instance (sslsock_idx=%d).", sslsock_idx)); -+ goto on_return; -+ } - - /* Store verification status */ - err = X509_STORE_CTX_get_error(x509_ctx); -@@ -706,6 +730,7 @@ static int verify_cb(int preverify_ok, X509_STORE_CTX *x509_ctx) - if (PJ_FALSE == ssock->param.verify_peer) - preverify_ok = 1; - -+on_return: - return preverify_ok; - } - -@@ -1213,6 +1238,12 @@ static void ssl_destroy(pj_ssl_sock_t *ssock) - static void ssl_reset_sock_state(pj_ssl_sock_t *ssock) - { - ossl_sock_t *ossock = (ossl_sock_t *)ssock; -+ -+ /* Detach from SSL instance */ -+ if (ossock->ossl_ssl) { -+ SSL_set_ex_data(ossock->ossl_ssl, sslsock_idx, NULL); -+ } -+ - /** - * Avoid calling SSL_shutdown() if handshake wasn't completed. - * OpenSSL 1.0.2f complains if SSL_shutdown() is called during an diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/third-party/pjproject/patches/0120-pjmedia_sdp_attr_get_rtpmap-Strip-param-trailing-whi.patch asterisk-18.12.0~dfsg+~cs6.12.40431413/third-party/pjproject/patches/0120-pjmedia_sdp_attr_get_rtpmap-Strip-param-trailing-whi.patch --- asterisk-18.11.2~dfsg+~cs6.10.40431413/third-party/pjproject/patches/0120-pjmedia_sdp_attr_get_rtpmap-Strip-param-trailing-whi.patch 2022-04-14 21:53:34.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/third-party/pjproject/patches/0120-pjmedia_sdp_attr_get_rtpmap-Strip-param-trailing-whi.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,32 +0,0 @@ -From 2ae784030b0d9cf217c3d562af20e4967f19a3dc Mon Sep 17 00:00:00 2001 -From: George Joseph -Date: Tue, 14 Sep 2021 10:47:29 -0600 -Subject: [PATCH] pjmedia_sdp_attr_get_rtpmap: Strip param trailing whitespace - -Use pj_scan_get() to parse the param part of rtpmap so -trailing whitespace is automatically stripped. - -Fixes #2827 ---- - pjmedia/src/pjmedia/sdp.c | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/pjmedia/src/pjmedia/sdp.c b/pjmedia/src/pjmedia/sdp.c -index 5d05a0d9c..3448749c9 100644 ---- a/pjmedia/src/pjmedia/sdp.c -+++ b/pjmedia/src/pjmedia/sdp.c -@@ -313,9 +313,9 @@ PJ_DEF(pj_status_t) pjmedia_sdp_attr_get_rtpmap( const pjmedia_sdp_attr *attr, - - /* Expecting either '/' or EOF */ - if (*scanner.curptr == '/') { -+ /* Skip the '/' */ - pj_scan_get_char(&scanner); -- rtpmap->param.ptr = scanner.curptr; -- rtpmap->param.slen = scanner.end - scanner.curptr; -+ pj_scan_get(&scanner, &cs_token, &rtpmap->param); - } else { - rtpmap->param.slen = 0; - } --- -2.31.1 - diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/third-party/pjproject/patches/0130-sip_inv-Additional-multipart-support-2919-2920.patch asterisk-18.12.0~dfsg+~cs6.12.40431413/third-party/pjproject/patches/0130-sip_inv-Additional-multipart-support-2919-2920.patch --- asterisk-18.11.2~dfsg+~cs6.10.40431413/third-party/pjproject/patches/0130-sip_inv-Additional-multipart-support-2919-2920.patch 2022-04-14 21:53:34.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/third-party/pjproject/patches/0130-sip_inv-Additional-multipart-support-2919-2920.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,661 +0,0 @@ -From 0ed41eb5fd0e4192e1b7dc374f819d17aef3e805 Mon Sep 17 00:00:00 2001 -From: George Joseph -Date: Tue, 21 Dec 2021 19:32:22 -0700 -Subject: [PATCH] sip_inv: Additional multipart support (#2919) (#2920) - ---- - pjsip/include/pjsip-ua/sip_inv.h | 108 ++++++++++- - pjsip/src/pjsip-ua/sip_inv.c | 240 ++++++++++++++++++++----- - pjsip/src/test/inv_offer_answer_test.c | 103 ++++++++++- - 3 files changed, 394 insertions(+), 57 deletions(-) - -diff --git a/pjsip/include/pjsip-ua/sip_inv.h b/pjsip/include/pjsip-ua/sip_inv.h -index 14f2d23fa..c33551786 100644 ---- a/pjsip/include/pjsip-ua/sip_inv.h -+++ b/pjsip/include/pjsip-ua/sip_inv.h -@@ -451,11 +451,11 @@ struct pjsip_inv_session - - - /** -- * This structure represents SDP information in a pjsip_rx_data. Application -- * retrieve this information by calling #pjsip_rdata_get_sdp_info(). This -+ * This structure represents SDP information in a pjsip_(rx|tx)_data. Application -+ * retrieve this information by calling #pjsip_get_sdp_info(). This - * mechanism supports multipart message body. - */ --typedef struct pjsip_rdata_sdp_info -+typedef struct pjsip_sdp_info - { - /** - * Pointer and length of the text body in the incoming message. If -@@ -475,7 +475,15 @@ typedef struct pjsip_rdata_sdp_info - */ - pjmedia_sdp_session *sdp; - --} pjsip_rdata_sdp_info; -+} pjsip_sdp_info; -+ -+/** -+ * For backwards compatibility and completeness, -+ * pjsip_rdata_sdp_info and pjsip_tdata_sdp_info -+ * are typedef'd to pjsip_sdp_info. -+ */ -+typedef pjsip_sdp_info pjsip_rdata_sdp_info; -+typedef pjsip_sdp_info pjsip_tdata_sdp_info; - - - /** -@@ -1045,6 +1053,44 @@ PJ_DECL(pj_status_t) pjsip_create_sdp_body(pj_pool_t *pool, - pjmedia_sdp_session *sdp, - pjsip_msg_body **p_body); - -+/** -+ * This is a utility function to create a multipart body with the -+ * SIP body as the first part. -+ * -+ * @param pool Pool to allocate memory. -+ * @param sdp SDP session to be put in the SIP message body. -+ * @param p_body Pointer to receive SIP message body containing -+ * the SDP session. -+ * -+ * @return PJ_SUCCESS on success. -+ */ -+PJ_DECL(pj_status_t) pjsip_create_multipart_sdp_body( pj_pool_t *pool, -+ pjmedia_sdp_session *sdp, -+ pjsip_msg_body **p_body); -+ -+/** -+ * Retrieve SDP information from a message body. Application should -+ * prefer to use this function rather than parsing the SDP manually since -+ * this function supports multipart message body. -+ * -+ * This function will only parse the SDP once, the first time it is called -+ * on the same message. Subsequent call on the same message will just pick -+ * up the already parsed SDP from the message. -+ * -+ * @param pool Pool to allocate memory. -+ * @param body The message body. -+ * @param msg_media_type From the rdata or tdata Content-Type header, if available. -+ * If NULL, the content_type from the body will be used. -+ * @param search_media_type The media type to search for. -+ * If NULL, "application/sdp" will be used. -+ * -+ * @return The SDP info. -+ */ -+PJ_DECL(pjsip_sdp_info*) pjsip_get_sdp_info(pj_pool_t *pool, -+ pjsip_msg_body *body, -+ pjsip_media_type *msg_media_type, -+ const pjsip_media_type *search_media_type); -+ - /** - * Retrieve SDP information from an incoming message. Application should - * prefer to use this function rather than parsing the SDP manually since -@@ -1061,6 +1107,60 @@ PJ_DECL(pj_status_t) pjsip_create_sdp_body(pj_pool_t *pool, - PJ_DECL(pjsip_rdata_sdp_info*) pjsip_rdata_get_sdp_info(pjsip_rx_data *rdata); - - -+/** -+ * Retrieve SDP information from an incoming message. Application should -+ * prefer to use this function rather than parsing the SDP manually since -+ * this function supports multipart message body. -+ * -+ * This function will only parse the SDP once, the first time it is called -+ * on the same message. Subsequent call on the same message will just pick -+ * up the already parsed SDP from the message. -+ * -+ * @param rdata The incoming message. -+ * @param search_media_type The SDP media type to search for. -+ * If NULL, "application/sdp" will be used. -+ * -+ * @return The SDP info. -+ */ -+PJ_DECL(pjsip_rdata_sdp_info*) pjsip_rdata_get_sdp_info2( -+ pjsip_rx_data *rdata, -+ const pjsip_media_type *search_media_type); -+ -+/** -+ * Retrieve SDP information from an outgoing message. Application should -+ * prefer to use this function rather than parsing the SDP manually since -+ * this function supports multipart message body. -+ * -+ * This function will only parse the SDP once, the first time it is called -+ * on the same message. Subsequent call on the same message will just pick -+ * up the already parsed SDP from the message. -+ * -+ * @param tdata The outgoing message. -+ * -+ * @return The SDP info. -+ */ -+PJ_DECL(pjsip_tdata_sdp_info*) pjsip_tdata_get_sdp_info(pjsip_tx_data *tdata); -+ -+/** -+ * Retrieve SDP information from an outgoing message. Application should -+ * prefer to use this function rather than parsing the SDP manually since -+ * this function supports multipart message body. -+ * -+ * This function will only parse the SDP once, the first time it is called -+ * on the same message. Subsequent call on the same message will just pick -+ * up the already parsed SDP from the message. -+ * -+ * @param tdata The outgoing message. -+ * @param search_media_type The SDP media type to search for. -+ * If NULL, "application/sdp" will be used. -+ * -+ * @return The SDP info. -+ */ -+PJ_DECL(pjsip_tdata_sdp_info*) pjsip_tdata_get_sdp_info2( -+ pjsip_tx_data *tdata, -+ const pjsip_media_type *search_media_type); -+ -+ - PJ_END_DECL - - /** -diff --git a/pjsip/src/pjsip-ua/sip_inv.c b/pjsip/src/pjsip-ua/sip_inv.c -index ca225015b..b68ae0f16 100644 ---- a/pjsip/src/pjsip-ua/sip_inv.c -+++ b/pjsip/src/pjsip-ua/sip_inv.c -@@ -118,6 +118,8 @@ static pj_status_t handle_timer_response(pjsip_inv_session *inv, - static pj_bool_t inv_check_secure_dlg(pjsip_inv_session *inv, - pjsip_event *e); - -+static int print_sdp(pjsip_msg_body *body, char *buf, pj_size_t len); -+ - static void (*inv_state_handler[])( pjsip_inv_session *inv, pjsip_event *e) = - { - &inv_on_state_null, -@@ -946,66 +948,170 @@ PJ_DEF(pj_status_t) pjsip_inv_create_uac( pjsip_dialog *dlg, - return PJ_SUCCESS; - } - --PJ_DEF(pjsip_rdata_sdp_info*) pjsip_rdata_get_sdp_info(pjsip_rx_data *rdata) -+PJ_DEF(pjsip_sdp_info*) pjsip_get_sdp_info(pj_pool_t *pool, -+ pjsip_msg_body *body, -+ pjsip_media_type *msg_media_type, -+ const pjsip_media_type *search_media_type) - { -- pjsip_rdata_sdp_info *sdp_info; -- pjsip_msg_body *body = rdata->msg_info.msg->body; -- pjsip_ctype_hdr *ctype_hdr = rdata->msg_info.ctype; -- pjsip_media_type app_sdp; -+ pjsip_sdp_info *sdp_info; -+ pjsip_media_type search_type; -+ pjsip_media_type multipart_mixed; -+ pjsip_media_type multipart_alternative; -+ pjsip_media_type *msg_type; -+ pj_status_t status; - -- sdp_info = (pjsip_rdata_sdp_info*) -- rdata->endpt_info.mod_data[mod_inv.mod.id]; -- if (sdp_info) -- return sdp_info; -+ sdp_info = PJ_POOL_ZALLOC_T(pool, -+ pjsip_sdp_info); - -- sdp_info = PJ_POOL_ZALLOC_T(rdata->tp_info.pool, -- pjsip_rdata_sdp_info); - PJ_ASSERT_RETURN(mod_inv.mod.id >= 0, sdp_info); -- rdata->endpt_info.mod_data[mod_inv.mod.id] = sdp_info; - -- pjsip_media_type_init2(&app_sdp, "application", "sdp"); -+ if (!body) { -+ return sdp_info; -+ } - -- if (body && ctype_hdr && -- pj_stricmp(&ctype_hdr->media.type, &app_sdp.type)==0 && -- pj_stricmp(&ctype_hdr->media.subtype, &app_sdp.subtype)==0) -+ if (msg_media_type) { -+ msg_type = msg_media_type; -+ } else { -+ if (body->content_type.type.slen == 0) { -+ return sdp_info; -+ } -+ msg_type = &body->content_type; -+ } -+ -+ if (!search_media_type) { -+ pjsip_media_type_init2(&search_type, "application", "sdp"); -+ } else { -+ pj_memcpy(&search_type, search_media_type, sizeof(search_type)); -+ } -+ -+ pjsip_media_type_init2(&multipart_mixed, "multipart", "mixed"); -+ pjsip_media_type_init2(&multipart_alternative, "multipart", "alternative"); -+ -+ if (pjsip_media_type_cmp(msg_type, &search_type, PJ_FALSE) == 0) - { -- sdp_info->body.ptr = (char*)body->data; -- sdp_info->body.slen = body->len; -- } else if (body && ctype_hdr && -- pj_stricmp2(&ctype_hdr->media.type, "multipart")==0 && -- (pj_stricmp2(&ctype_hdr->media.subtype, "mixed")==0 || -- pj_stricmp2(&ctype_hdr->media.subtype, "alternative")==0)) -+ /* -+ * If the print_body function is print_sdp, we know that -+ * body->data is a pjmedia_sdp_session object and came from -+ * a tx_data. If not, it's the text representation of the -+ * sdp from an rx_data. -+ */ -+ if (body->print_body == print_sdp) { -+ sdp_info->sdp = body->data; -+ } else { -+ sdp_info->body.ptr = (char*)body->data; -+ sdp_info->body.slen = body->len; -+ } -+ } else if (pjsip_media_type_cmp(&multipart_mixed, msg_type, PJ_FALSE) == 0 || -+ pjsip_media_type_cmp(&multipart_alternative, msg_type, PJ_FALSE) == 0) - { -- pjsip_multipart_part *part; -+ pjsip_multipart_part *part; -+ part = pjsip_multipart_find_part(body, &search_type, NULL); -+ if (part) { -+ if (part->body->print_body == print_sdp) { -+ sdp_info->sdp = part->body->data; -+ } else { -+ sdp_info->body.ptr = (char*)part->body->data; -+ sdp_info->body.slen = part->body->len; -+ } -+ } -+ } - -- part = pjsip_multipart_find_part(body, &app_sdp, NULL); -- if (part) { -- sdp_info->body.ptr = (char*)part->body->data; -- sdp_info->body.slen = part->body->len; -- } -+ /* -+ * If the body was already a pjmedia_sdp_session, we can just -+ * return it. If not and there wasn't a text representation -+ * of the sdp either, we can also just return. -+ */ -+ if (sdp_info->sdp || !sdp_info->body.ptr) { -+ return sdp_info; - } - -- if (sdp_info->body.ptr) { -- pj_status_t status; -- status = pjmedia_sdp_parse(rdata->tp_info.pool, -- sdp_info->body.ptr, -- sdp_info->body.slen, -- &sdp_info->sdp); -- if (status == PJ_SUCCESS) -- status = pjmedia_sdp_validate2(sdp_info->sdp, PJ_FALSE); -+ /* -+ * If the body was the text representation of teh SDP, we need -+ * to parse it to create a pjmedia_sdp_session object. -+ */ -+ status = pjmedia_sdp_parse(pool, -+ sdp_info->body.ptr, -+ sdp_info->body.slen, -+ &sdp_info->sdp); -+ if (status == PJ_SUCCESS) -+ status = pjmedia_sdp_validate2(sdp_info->sdp, PJ_FALSE); - -- if (status != PJ_SUCCESS) { -- sdp_info->sdp = NULL; -- PJ_PERROR(1,(THIS_FILE, status, -- "Error parsing/validating SDP body")); -- } -+ if (status != PJ_SUCCESS) { -+ sdp_info->sdp = NULL; -+ PJ_PERROR(1, (THIS_FILE, status, -+ "Error parsing/validating SDP body")); -+ } -+ -+ sdp_info->sdp_err = status; -+ -+ return sdp_info; -+} - -- sdp_info->sdp_err = status; -+PJ_DEF(pjsip_rdata_sdp_info*) pjsip_rdata_get_sdp_info2( -+ pjsip_rx_data *rdata, -+ const pjsip_media_type *search_media_type) -+{ -+ pjsip_media_type *msg_media_type = NULL; -+ pjsip_rdata_sdp_info *sdp_info; -+ -+ if (rdata->endpt_info.mod_data[mod_inv.mod.id]) { -+ return (pjsip_rdata_sdp_info *)rdata->endpt_info.mod_data[mod_inv.mod.id]; -+ } -+ -+ /* -+ * rdata should have a Content-Type header at this point but we'll -+ * make sure. -+ */ -+ if (rdata->msg_info.ctype) { -+ msg_media_type = &rdata->msg_info.ctype->media; -+ } -+ sdp_info = pjsip_get_sdp_info(rdata->tp_info.pool, -+ rdata->msg_info.msg->body, -+ msg_media_type, -+ search_media_type); -+ rdata->endpt_info.mod_data[mod_inv.mod.id] = sdp_info; -+ -+ return sdp_info; -+} -+ -+PJ_DEF(pjsip_rdata_sdp_info*) pjsip_rdata_get_sdp_info(pjsip_rx_data *rdata) -+{ -+ return pjsip_rdata_get_sdp_info2(rdata, NULL); -+} -+ -+PJ_DEF(pjsip_tdata_sdp_info*) pjsip_tdata_get_sdp_info2( -+ pjsip_tx_data *tdata, -+ const pjsip_media_type *search_media_type) -+{ -+ pjsip_ctype_hdr *ctype_hdr = NULL; -+ pjsip_media_type *msg_media_type = NULL; -+ pjsip_tdata_sdp_info *sdp_info; -+ -+ if (tdata->mod_data[mod_inv.mod.id]) { -+ return (pjsip_tdata_sdp_info *)tdata->mod_data[mod_inv.mod.id]; -+ } -+ /* -+ * tdata won't usually have a Content-Type header at this point -+ * but we'll check just the same, -+ */ -+ ctype_hdr = pjsip_msg_find_hdr(tdata->msg, PJSIP_H_CONTENT_TYPE, NULL); -+ if (ctype_hdr) { -+ msg_media_type = &ctype_hdr->media; - } - -+ sdp_info = pjsip_get_sdp_info(tdata->pool, -+ tdata->msg->body, -+ msg_media_type, -+ search_media_type); -+ tdata->mod_data[mod_inv.mod.id] = sdp_info; -+ - return sdp_info; - } - -+PJ_DEF(pjsip_tdata_sdp_info*) pjsip_tdata_get_sdp_info(pjsip_tx_data *tdata) -+{ -+ return pjsip_tdata_get_sdp_info2(tdata, NULL); -+} - - /* - * Verify incoming INVITE request. -@@ -1730,13 +1836,55 @@ PJ_DEF(pj_status_t) pjsip_create_sdp_body( pj_pool_t *pool, - return PJ_SUCCESS; - } - -+static pjsip_multipart_part* create_sdp_part(pj_pool_t *pool, pjmedia_sdp_session *sdp) -+{ -+ pjsip_multipart_part *sdp_part; -+ pjsip_media_type media_type; -+ -+ pjsip_media_type_init2(&media_type, "application", "sdp"); -+ -+ sdp_part = pjsip_multipart_create_part(pool); -+ PJ_ASSERT_RETURN(sdp_part != NULL, NULL); -+ -+ sdp_part->body = PJ_POOL_ZALLOC_T(pool, pjsip_msg_body); -+ PJ_ASSERT_RETURN(sdp_part->body != NULL, NULL); -+ -+ pjsip_media_type_cp(pool, &sdp_part->body->content_type, &media_type); -+ -+ sdp_part->body->data = sdp; -+ sdp_part->body->clone_data = clone_sdp; -+ sdp_part->body->print_body = print_sdp; -+ -+ return sdp_part; -+} -+ -+PJ_DEF(pj_status_t) pjsip_create_multipart_sdp_body(pj_pool_t *pool, -+ pjmedia_sdp_session *sdp, -+ pjsip_msg_body **p_body) -+{ -+ pjsip_media_type media_type; -+ pjsip_msg_body *multipart; -+ pjsip_multipart_part *sdp_part; -+ -+ pjsip_media_type_init2(&media_type, "multipart", "mixed"); -+ multipart = pjsip_multipart_create(pool, &media_type, NULL); -+ PJ_ASSERT_RETURN(multipart != NULL, PJ_ENOMEM); -+ -+ sdp_part = create_sdp_part(pool, sdp); -+ PJ_ASSERT_RETURN(sdp_part != NULL, PJ_ENOMEM); -+ pjsip_multipart_add_part(pool, multipart, sdp_part); -+ *p_body = multipart; -+ -+ return PJ_SUCCESS; -+} -+ - static pjsip_msg_body *create_sdp_body(pj_pool_t *pool, - const pjmedia_sdp_session *c_sdp) - { - pjsip_msg_body *body; - pj_status_t status; - -- status = pjsip_create_sdp_body(pool, -+ status = pjsip_create_sdp_body(pool, - pjmedia_sdp_session_clone(pool, c_sdp), - &body); - -@@ -2059,6 +2207,7 @@ static pj_status_t inv_check_sdp_in_incoming_msg( pjsip_inv_session *inv, - ) - ) - { -+ pjsip_sdp_info *tdata_sdp_info; - const pjmedia_sdp_session *reoffer_sdp = NULL; - - PJ_LOG(4,(inv->obj_name, "Received %s response " -@@ -2067,14 +2216,15 @@ static pj_status_t inv_check_sdp_in_incoming_msg( pjsip_inv_session *inv, - (st_code/10==18? "early" : "final" ))); - - /* Retrieve original SDP offer from INVITE request */ -- reoffer_sdp = (const pjmedia_sdp_session*) -- tsx->last_tx->msg->body->data; -+ tdata_sdp_info = pjsip_tdata_get_sdp_info(tsx->last_tx); -+ reoffer_sdp = tdata_sdp_info->sdp; - - /* Feed the original offer to negotiator */ - status = pjmedia_sdp_neg_modify_local_offer2(inv->pool_prov, - inv->neg, - inv->sdp_neg_flags, - reoffer_sdp); -+ - if (status != PJ_SUCCESS) { - PJ_LOG(1,(inv->obj_name, "Error updating local offer for " - "forked 2xx/18x response (err=%d)", status)); -diff --git a/pjsip/src/test/inv_offer_answer_test.c b/pjsip/src/test/inv_offer_answer_test.c -index ad5fcd409..9cdd2654b 100644 ---- a/pjsip/src/test/inv_offer_answer_test.c -+++ b/pjsip/src/test/inv_offer_answer_test.c -@@ -137,6 +137,7 @@ typedef struct inv_test_param_t - pj_bool_t need_established; - unsigned count; - oa_t oa[4]; -+ pj_bool_t multipart_body; - } inv_test_param_t; - - typedef struct inv_test_t -@@ -257,6 +258,17 @@ static void on_media_update(pjsip_inv_session *inv_ses, - } - } - -+ /* Special handling for standard offer/answer */ -+ if (inv_test.param.count == 1 && -+ inv_test.param.oa[0] == OFFERER_UAC && -+ inv_test.param.need_established) -+ { -+ jobs[job_cnt].type = ESTABLISH_CALL; -+ jobs[job_cnt].who = PJSIP_ROLE_UAS; -+ job_cnt++; -+ TRACE_((THIS_FILE, " C+++")); -+ } -+ - pj_assert(job_cnt <= PJ_ARRAY_SIZE(jobs)); - } - } -@@ -333,6 +345,15 @@ static pj_bool_t on_rx_request(pjsip_rx_data *rdata) - NULL, &tdata); - pj_assert(status == PJ_SUCCESS); - -+ /* Use multipart body, if configured */ -+ if (sdp && inv_test.param.multipart_body) { -+ status = pjsip_create_multipart_sdp_body( -+ tdata->pool, -+ pjmedia_sdp_session_clone(tdata->pool, sdp), -+ &tdata->msg->body); -+ } -+ pj_assert(status == PJ_SUCCESS); -+ - status = pjsip_inv_send_msg(inv_test.uas, tdata); - pj_assert(status == PJ_SUCCESS); - -@@ -426,6 +447,7 @@ static int perform_test(inv_test_param_t *param) - sdp = NULL; - - status = pjsip_inv_create_uac(dlg, sdp, inv_test.param.inv_option, &inv_test.uac); -+ //inv_test.uac->create_multipart = param->multipart_body; - PJ_ASSERT_RETURN(status==PJ_SUCCESS, -20); - - TRACE_((THIS_FILE, " Sending INVITE %s offer", (sdp ? "with" : "without"))); -@@ -436,8 +458,17 @@ static int perform_test(inv_test_param_t *param) - status = pjsip_inv_invite(inv_test.uac, &tdata); - PJ_ASSERT_RETURN(status==PJ_SUCCESS, -30); - -+ /* Use multipart body, if configured */ -+ if (sdp && param->multipart_body) { -+ status = pjsip_create_multipart_sdp_body( -+ tdata->pool, -+ pjmedia_sdp_session_clone(tdata->pool, sdp), -+ &tdata->msg->body); -+ } -+ PJ_ASSERT_RETURN(status==PJ_SUCCESS, -40); -+ - status = pjsip_inv_send_msg(inv_test.uac, tdata); -- PJ_ASSERT_RETURN(status==PJ_SUCCESS, -30); -+ PJ_ASSERT_RETURN(status==PJ_SUCCESS, -50); - - /* - * Wait until test completes -@@ -525,13 +556,14 @@ static inv_test_param_t test_params[] = - 200/INVITE (answer) <-- - ACK --> - */ --#if 0 -+#if 1 - { - "Standard INVITE with offer", - 0, - PJ_TRUE, - 1, -- { OFFERER_UAC } -+ { OFFERER_UAC }, -+ PJ_FALSE - }, - - { -@@ -539,7 +571,25 @@ static inv_test_param_t test_params[] = - PJSIP_INV_REQUIRE_100REL, - PJ_TRUE, - 1, -- { OFFERER_UAC } -+ { OFFERER_UAC }, -+ PJ_FALSE -+ }, -+ { -+ "Standard INVITE with offer, with Multipart", -+ 0, -+ PJ_TRUE, -+ 1, -+ { OFFERER_UAC }, -+ PJ_TRUE -+ }, -+ -+ { -+ "Standard INVITE with offer, with 100rel, with Multipart", -+ PJSIP_INV_REQUIRE_100REL, -+ PJ_TRUE, -+ 1, -+ { OFFERER_UAC }, -+ PJ_TRUE - }, - #endif - -@@ -555,7 +605,8 @@ static inv_test_param_t test_params[] = - 0, - PJ_TRUE, - 1, -- { OFFERER_UAS } -+ { OFFERER_UAS }, -+ PJ_FALSE - }, - - { -@@ -563,7 +614,25 @@ static inv_test_param_t test_params[] = - PJSIP_INV_REQUIRE_100REL, - PJ_TRUE, - 1, -- { OFFERER_UAS } -+ { OFFERER_UAS }, -+ PJ_FALSE -+ }, -+ { -+ "INVITE with no offer, with Multipart", -+ 0, -+ PJ_TRUE, -+ 1, -+ { OFFERER_UAS }, -+ PJ_TRUE -+ }, -+ -+ { -+ "INVITE with no offer, with 100rel, with Multipart", -+ PJSIP_INV_REQUIRE_100REL, -+ PJ_TRUE, -+ 1, -+ { OFFERER_UAS }, -+ PJ_TRUE - }, - #endif - -@@ -584,14 +653,24 @@ static inv_test_param_t test_params[] = - 0, - PJ_TRUE, - 2, -- { OFFERER_UAC, OFFERER_UAC } -+ { OFFERER_UAC, OFFERER_UAC }, -+ PJ_FALSE -+ }, -+ { -+ "INVITE and UPDATE by UAC, with Multipart", -+ 0, -+ PJ_TRUE, -+ 2, -+ { OFFERER_UAC, OFFERER_UAC }, -+ PJ_TRUE - }, - { - "INVITE and UPDATE by UAC, with 100rel", - PJSIP_INV_REQUIRE_100REL, - PJ_TRUE, - 2, -- { OFFERER_UAC, OFFERER_UAC } -+ { OFFERER_UAC, OFFERER_UAC }, -+ PJ_FALSE - }, - #endif - -@@ -617,6 +696,14 @@ static inv_test_param_t test_params[] = - 4, - { OFFERER_UAC, OFFERER_UAS, OFFERER_UAC, OFFERER_UAS } - }, -+ { -+ "INVITE and many UPDATE by UAC and UAS, with Multipart", -+ 0, -+ PJ_TRUE, -+ 4, -+ { OFFERER_UAC, OFFERER_UAS, OFFERER_UAC, OFFERER_UAS }, -+ PJ_TRUE -+ }, - - }; - --- -2.33.1 - diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/third-party/pjproject/patches/0140-Fix-incorrect-unescaping-of-tokens-during-parsing-29.patch asterisk-18.12.0~dfsg+~cs6.12.40431413/third-party/pjproject/patches/0140-Fix-incorrect-unescaping-of-tokens-during-parsing-29.patch --- asterisk-18.11.2~dfsg+~cs6.10.40431413/third-party/pjproject/patches/0140-Fix-incorrect-unescaping-of-tokens-during-parsing-29.patch 2022-04-14 21:53:34.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/third-party/pjproject/patches/0140-Fix-incorrect-unescaping-of-tokens-during-parsing-29.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,123 +0,0 @@ -From 3faf1d2b4da553bbaee04f9a13a5d084b381e5fb Mon Sep 17 00:00:00 2001 -From: sauwming -Date: Tue, 4 Jan 2022 15:28:49 +0800 -Subject: [PATCH] Fix incorrect unescaping of tokens during parsing (#2933) - ---- - pjsip/src/pjsip/sip_parser.c | 29 +++++++++++++++++++++++++---- - pjsip/src/test/msg_test.c | 6 +++--- - 2 files changed, 28 insertions(+), 7 deletions(-) - -diff --git a/pjsip/src/pjsip/sip_parser.c b/pjsip/src/pjsip/sip_parser.c -index c2add3299..b9a7c6a5c 100644 ---- a/pjsip/src/pjsip/sip_parser.c -+++ b/pjsip/src/pjsip/sip_parser.c -@@ -378,17 +378,23 @@ static pj_status_t init_parser() - PJ_ASSERT_RETURN(status == PJ_SUCCESS, status); - pj_cis_add_str( &pconst.pjsip_TOKEN_SPEC, TOKEN); - -+ /* Token is allowed to have '%' so we do not need this. */ -+ /* - status = pj_cis_dup(&pconst.pjsip_TOKEN_SPEC_ESC, &pconst.pjsip_TOKEN_SPEC); - PJ_ASSERT_RETURN(status == PJ_SUCCESS, status); - pj_cis_del_str(&pconst.pjsip_TOKEN_SPEC_ESC, "%"); -+ */ - - status = pj_cis_dup(&pconst.pjsip_VIA_PARAM_SPEC, &pconst.pjsip_TOKEN_SPEC); - PJ_ASSERT_RETURN(status == PJ_SUCCESS, status); - pj_cis_add_str(&pconst.pjsip_VIA_PARAM_SPEC, "[:]"); - -+ /* Token is allowed to have '%' */ -+ /* - status = pj_cis_dup(&pconst.pjsip_VIA_PARAM_SPEC_ESC, &pconst.pjsip_TOKEN_SPEC_ESC); - PJ_ASSERT_RETURN(status == PJ_SUCCESS, status); - pj_cis_add_str(&pconst.pjsip_VIA_PARAM_SPEC_ESC, "[:]"); -+ */ - - status = pj_cis_dup(&pconst.pjsip_HOST_SPEC, &pconst.pjsip_ALNUM_SPEC); - PJ_ASSERT_RETURN(status == PJ_SUCCESS, status); -@@ -1210,7 +1216,11 @@ static void parse_param_imp( pj_scanner *scanner, pj_pool_t *pool, - unsigned option) - { - /* pname */ -- parser_get_and_unescape(scanner, pool, spec, esc_spec, pname); -+ if (!esc_spec) { -+ pj_scan_get(scanner, spec, pname); -+ } else { -+ parser_get_and_unescape(scanner, pool, spec, esc_spec, pname); -+ } - - /* init pvalue */ - pvalue->ptr = NULL; -@@ -1240,7 +1250,12 @@ static void parse_param_imp( pj_scanner *scanner, pj_pool_t *pool, - // pj_scan_get_until_ch(scanner, ']', pvalue); - // pj_scan_get_char(scanner); - } else if(pj_cis_match(spec, *scanner->curptr)) { -- parser_get_and_unescape(scanner, pool, spec, esc_spec, pvalue); -+ if (!esc_spec) { -+ pj_scan_get(scanner, spec, pvalue); -+ } else { -+ parser_get_and_unescape(scanner, pool, spec, esc_spec, -+ pvalue); -+ } - } - } - } -@@ -1252,7 +1267,10 @@ PJ_DEF(void) pjsip_parse_param_imp(pj_scanner *scanner, pj_pool_t *pool, - unsigned option) - { - parse_param_imp(scanner, pool, pname, pvalue, &pconst.pjsip_TOKEN_SPEC, -- &pconst.pjsip_TOKEN_SPEC_ESC, option); -+ // Token does not need to be unescaped. -+ // Refer to PR #2933. -+ // &pconst.pjsip_TOKEN_SPEC_ESC, -+ NULL, option); - } - - -@@ -2168,7 +2186,10 @@ static void int_parse_via_param( pjsip_via_hdr *hdr, pj_scanner *scanner, - pj_scan_get_char(scanner); - parse_param_imp(scanner, pool, &pname, &pvalue, - &pconst.pjsip_VIA_PARAM_SPEC, -- &pconst.pjsip_VIA_PARAM_SPEC_ESC, -+ // Token does not need to be unescaped. -+ // Refer to PR #2933. -+ // &pconst.pjsip_VIA_PARAM_SPEC_ESC, -+ NULL, - 0); - - if (!parser_stricmp(pname, pconst.pjsip_BRANCH_STR) && pvalue.slen) { -diff --git a/pjsip/src/test/msg_test.c b/pjsip/src/test/msg_test.c -index c511e1cf6..24e3d405d 100644 ---- a/pjsip/src/test/msg_test.c -+++ b/pjsip/src/test/msg_test.c -@@ -953,7 +953,7 @@ static int hdr_test_subject_utf(pjsip_hdr *h); - - - #define GENERIC_PARAM "p0=a;p1=\"ab:;cd\";p2=ab%3acd;p3" --#define GENERIC_PARAM_PARSED "p0=a;p1=\"ab:;cd\";p2=ab:cd;p3" -+#define GENERIC_PARAM_PARSED "p0=a;p1=\"ab:;cd\";p2=ab%3acd;p3" - #define PARAM_CHAR "][/:&+$" - #define SIMPLE_ADDR_SPEC "sip:host" - #define ADDR_SPEC SIMPLE_ADDR_SPEC ";"PARAM_CHAR"="PARAM_CHAR ";p1=\";\"" -@@ -1401,7 +1401,7 @@ static int generic_param_test(pjsip_param *param_head) - param = param->next; - if (pj_strcmp2(¶m->name, "p2")) - return -956; -- if (pj_strcmp2(¶m->value, "ab:cd")) -+ if (pj_strcmp2(¶m->value, "ab%3acd")) - return -957; - - param = param->next; -@@ -1621,7 +1621,7 @@ static int hdr_test_content_type(pjsip_hdr *h) - prm = prm->next; - if (prm == &hdr->media.param) return -1960; - if (pj_strcmp2(&prm->name, "p2")) return -1961; -- if (pj_strcmp2(&prm->value, "ab:cd")) return -1962; -+ if (pj_strcmp2(&prm->value, "ab%3acd")) return -1962; - - prm = prm->next; - if (prm == &hdr->media.param) return -1970; --- -2.32.0 - diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/third-party/pjproject/patches/0150-Create-generic-pjsip_hdr_find-functions.patch asterisk-18.12.0~dfsg+~cs6.12.40431413/third-party/pjproject/patches/0150-Create-generic-pjsip_hdr_find-functions.patch --- asterisk-18.11.2~dfsg+~cs6.10.40431413/third-party/pjproject/patches/0150-Create-generic-pjsip_hdr_find-functions.patch 2022-04-14 21:53:34.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/third-party/pjproject/patches/0150-Create-generic-pjsip_hdr_find-functions.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,176 +0,0 @@ -From 7e3dfd8a15fd0f98dbf0e04d2d7a5bded90ee401 Mon Sep 17 00:00:00 2001 -From: George Joseph -Date: Tue, 11 Jan 2022 09:27:23 -0700 -Subject: [PATCH] Create generic pjsip_hdr_find functions - -pjsip_msg_find_hdr(), pjsip_msg_find_hdr_by_name(), and -pjsip_msg_find_hdr_by_names() require a pjsip_msg to be passed in -so if you need to search a header list that's not in a pjsip_msg, -you have to do it yourself. This commit adds generic versions of -those 3 functions that take in the actual header list head instead -of a pjsip_msg so if you need to search a list of headers in -something like a pjsip_multipart_part, you can do so easily. ---- - pjsip/include/pjsip/sip_msg.h | 53 +++++++++++++++++++++++++++++++++++ - pjsip/src/pjsip/sip_msg.c | 51 +++++++++++++++++++++++---------- - 2 files changed, 89 insertions(+), 15 deletions(-) - -diff --git a/pjsip/include/pjsip/sip_msg.h b/pjsip/include/pjsip/sip_msg.h -index 4c9100d39..e3502e94e 100644 ---- a/pjsip/include/pjsip/sip_msg.h -+++ b/pjsip/include/pjsip/sip_msg.h -@@ -362,6 +362,59 @@ PJ_DECL(void*) pjsip_hdr_shallow_clone( pj_pool_t *pool, const void *hdr ); - */ - PJ_DECL(int) pjsip_hdr_print_on( void *hdr, char *buf, pj_size_t len); - -+/** -+ * Find a header in a header list by the header type. -+ * -+ * @param hdr_list The "head" of the header list. -+ * @param type The header type to find. -+ * @param start The first header field where the search should begin. -+ * If NULL is specified, then the search will begin from the -+ * first header, otherwise the search will begin at the -+ * specified header. -+ * -+ * @return The header field, or NULL if no header with the specified -+ * type is found. -+ */ -+PJ_DECL(void*) pjsip_hdr_find( const void *hdr_list, -+ pjsip_hdr_e type, -+ const void *start); -+ -+/** -+ * Find a header in a header list by its name. -+ * -+ * @param hdr_list The "head" of the header list. -+ * @param name The header name to find. -+ * @param start The first header field where the search should begin. -+ * If NULL is specified, then the search will begin from the -+ * first header, otherwise the search will begin at the -+ * specified header. -+ * -+ * @return The header field, or NULL if no header with the specified -+ * type is found. -+ */ -+PJ_DECL(void*) pjsip_hdr_find_by_name( const void *hdr_list, -+ const pj_str_t *name, -+ const void *start); -+ -+/** -+ * Find a header in a header list by its name and short name version. -+ * -+ * @param hdr_list The "head" of the header list. -+ * @param name The header name to find. -+ * @param sname The short name version of the header name. -+ * @param start The first header field where the search should begin. -+ * If NULL is specified, then the search will begin from the -+ * first header, otherwise the search will begin at the -+ * specified header. -+ * -+ * @return The header field, or NULL if no header with the specified -+ * type is found. -+ */ -+PJ_DECL(void*) pjsip_hdr_find_by_names( const void *hdr_list, -+ const pj_str_t *name, -+ const pj_str_t *sname, -+ const void *start); -+ - /** - * @} - */ -diff --git a/pjsip/src/pjsip/sip_msg.c b/pjsip/src/pjsip/sip_msg.c -index 6ba3054da..2a6a96af0 100644 ---- a/pjsip/src/pjsip/sip_msg.c -+++ b/pjsip/src/pjsip/sip_msg.c -@@ -356,13 +356,13 @@ PJ_DEF(pjsip_msg*) pjsip_msg_clone( pj_pool_t *pool, const pjsip_msg *src) - return dst; - } - --PJ_DEF(void*) pjsip_msg_find_hdr( const pjsip_msg *msg, -- pjsip_hdr_e hdr_type, const void *start) -+PJ_DEF(void*) pjsip_hdr_find( const void *hdr_list, -+ pjsip_hdr_e hdr_type, const void *start) - { -- const pjsip_hdr *hdr=(const pjsip_hdr*) start, *end=&msg->hdr; -+ const pjsip_hdr *hdr=(const pjsip_hdr*) start, *end=hdr_list; - - if (hdr == NULL) { -- hdr = msg->hdr.next; -+ hdr = end->next; - } - for (; hdr!=end; hdr = hdr->next) { - if (hdr->type == hdr_type) -@@ -371,14 +371,14 @@ PJ_DEF(void*) pjsip_msg_find_hdr( const pjsip_msg *msg, - return NULL; - } - --PJ_DEF(void*) pjsip_msg_find_hdr_by_name( const pjsip_msg *msg, -- const pj_str_t *name, -- const void *start) -+PJ_DEF(void*) pjsip_hdr_find_by_name( const void *hdr_list, -+ const pj_str_t *name, -+ const void *start) - { -- const pjsip_hdr *hdr=(const pjsip_hdr*)start, *end=&msg->hdr; -+ const pjsip_hdr *hdr=(const pjsip_hdr*) start, *end=hdr_list; - - if (hdr == NULL) { -- hdr = msg->hdr.next; -+ hdr = end->next; - } - for (; hdr!=end; hdr = hdr->next) { - if (pj_stricmp(&hdr->name, name) == 0) -@@ -387,15 +387,15 @@ PJ_DEF(void*) pjsip_msg_find_hdr_by_name( const pjsip_msg *msg, - return NULL; - } - --PJ_DEF(void*) pjsip_msg_find_hdr_by_names( const pjsip_msg *msg, -- const pj_str_t *name, -- const pj_str_t *sname, -- const void *start) -+PJ_DEF(void*) pjsip_hdr_find_by_names( const void *hdr_list, -+ const pj_str_t *name, -+ const pj_str_t *sname, -+ const void *start) - { -- const pjsip_hdr *hdr=(const pjsip_hdr*)start, *end=&msg->hdr; -+ const pjsip_hdr *hdr=(const pjsip_hdr*) start, *end=hdr_list; - - if (hdr == NULL) { -- hdr = msg->hdr.next; -+ hdr = end->next; - } - for (; hdr!=end; hdr = hdr->next) { - if (pj_stricmp(&hdr->name, name) == 0) -@@ -406,6 +406,27 @@ PJ_DEF(void*) pjsip_msg_find_hdr_by_names( const pjsip_msg *msg, - return NULL; - } - -+PJ_DEF(void*) pjsip_msg_find_hdr( const pjsip_msg *msg, -+ pjsip_hdr_e hdr_type, const void *start) -+{ -+ return pjsip_hdr_find(&msg->hdr, hdr_type, start); -+} -+ -+PJ_DEF(void*) pjsip_msg_find_hdr_by_name( const pjsip_msg *msg, -+ const pj_str_t *name, -+ const void *start) -+{ -+ return pjsip_hdr_find_by_name(&msg->hdr, name, start); -+} -+ -+PJ_DEF(void*) pjsip_msg_find_hdr_by_names( const pjsip_msg *msg, -+ const pj_str_t *name, -+ const pj_str_t *sname, -+ const void *start) -+{ -+ return pjsip_hdr_find_by_names(&msg->hdr, name, sname, start); -+} -+ - PJ_DEF(void*) pjsip_msg_find_remove_hdr( pjsip_msg *msg, - pjsip_hdr_e hdr_type, void *start) - { --- -2.34.1 - diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/third-party/pjproject/patches/0160-Additional-multipart-improvements.patch asterisk-18.12.0~dfsg+~cs6.12.40431413/third-party/pjproject/patches/0160-Additional-multipart-improvements.patch --- asterisk-18.11.2~dfsg+~cs6.10.40431413/third-party/pjproject/patches/0160-Additional-multipart-improvements.patch 2022-04-14 21:53:34.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/third-party/pjproject/patches/0160-Additional-multipart-improvements.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,644 +0,0 @@ -From b7ecff22e77887626fd8e8608c4dd73bc7b7366f Mon Sep 17 00:00:00 2001 -From: George Joseph -Date: Tue, 18 Jan 2022 06:14:31 -0700 -Subject: [PATCH] Additional multipart improvements - -Added the following APIs: -pjsip_multipart_find_part_by_header() -pjsip_multipart_find_part_by_header_str() -pjsip_multipart_find_part_by_cid_str() -pjsip_multipart_find_part_by_cid_uri() ---- - pjsip/include/pjsip/sip_multipart.h | 83 ++++++++++ - pjsip/src/pjsip/sip_multipart.c | 223 +++++++++++++++++++++++++++ - pjsip/src/test/multipart_test.c | 225 +++++++++++++++++++++++++++- - 3 files changed, 530 insertions(+), 1 deletion(-) - -diff --git a/pjsip/include/pjsip/sip_multipart.h b/pjsip/include/pjsip/sip_multipart.h -index 1c05767c5..c6b82b0b4 100644 ---- a/pjsip/include/pjsip/sip_multipart.h -+++ b/pjsip/include/pjsip/sip_multipart.h -@@ -153,6 +153,89 @@ pjsip_multipart_find_part( const pjsip_msg_body *mp, - const pjsip_media_type *content_type, - const pjsip_multipart_part *start); - -+/** -+ * Find a body inside multipart bodies which has a header matching the -+ * supplied one. Most useful for finding a part with a specific Content-ID. -+ * -+ * @param pool Memory pool to use for temp space. -+ * @param mp The multipart body. -+ * @param search_hdr Header to search for. -+ * @param start If specified, the search will begin at -+ * start->next part. Otherwise it will begin at -+ * the first part in the multipart bodies. -+ * -+ * @return The first part which has a header matching the -+ * specified one, or NULL if not found. -+ */ -+PJ_DECL(pjsip_multipart_part*) -+pjsip_multipart_find_part_by_header(pj_pool_t *pool, -+ const pjsip_msg_body *mp, -+ void *search_hdr, -+ const pjsip_multipart_part *start); -+ -+/** -+ * Find a body inside multipart bodies which has a header matching the -+ * supplied name and value. Most useful for finding a part with a specific -+ * Content-ID. -+ * -+ * @param pool Memory pool to use for temp space. -+ * @param mp The multipart body. -+ * @param hdr_name Header name to search for. -+ * @param hdr_value Header value search for. -+ * @param start If specified, the search will begin at -+ * start->next part. Otherwise it will begin at -+ * the first part in the multipart bodies. -+ * -+ * @return The first part which has a header matching the -+ * specified one, or NULL if not found. -+ */ -+PJ_DECL(pjsip_multipart_part*) -+pjsip_multipart_find_part_by_header_str(pj_pool_t *pool, -+ const pjsip_msg_body *mp, -+ const pj_str_t *hdr_name, -+ const pj_str_t *hdr_value, -+ const pjsip_multipart_part *start); -+ -+ -+ -+/** -+ * Find a body inside multipart bodies which has a Content-ID value matching the -+ * supplied "cid" URI in pj_str form. The "cid:" scheme will be assumed if the -+ * URL doesn't start with it. Enclosing angle brackets will also be handled -+ * correctly if they exist. -+ * -+ * @see RFC2392 Content-ID and Message-ID Uniform Resource Locators -+ * -+ * @param pool Memory pool to use for temp space. -+ * @param mp The multipart body. -+ * @param cid The "cid" URI to search for in pj_str form. -+ * -+ * @return The first part which has a Content-ID header matching the -+ * specified "cid" URI. or NULL if not found. -+ */ -+PJ_DECL(pjsip_multipart_part*) -+pjsip_multipart_find_part_by_cid_str(pj_pool_t *pool, -+ const pjsip_msg_body *mp, -+ pj_str_t *cid); -+ -+/** -+ * Find a body inside multipart bodies which has a Content-ID value matching the -+ * supplied "cid" URI. -+ * -+ * @see RFC2392 Content-ID and Message-ID Uniform Resource Locators -+ * -+ * @param pool Memory pool to use for temp space. -+ * @param mp The multipart body. -+ * @param cid The "cid" URI to search for. -+ * -+ * @return The first part which had a Content-ID header matching the -+ * specified "cid" URI. or NULL if not found. -+ */ -+PJ_DECL(pjsip_multipart_part*) -+pjsip_multipart_find_part_by_cid_uri(pj_pool_t *pool, -+ const pjsip_msg_body *mp, -+ pjsip_other_uri *cid_uri); -+ - /** - * Parse multipart message. - * -diff --git a/pjsip/src/pjsip/sip_multipart.c b/pjsip/src/pjsip/sip_multipart.c -index e7d722d2e..9d8be55b0 100644 ---- a/pjsip/src/pjsip/sip_multipart.c -+++ b/pjsip/src/pjsip/sip_multipart.c -@@ -19,6 +19,7 @@ - #include - #include - #include -+#include - #include - #include - #include -@@ -416,6 +417,220 @@ pjsip_multipart_find_part( const pjsip_msg_body *mp, - return NULL; - } - -+/* -+ * Find a body inside multipart bodies which has the header and value. -+ */ -+PJ_DEF(pjsip_multipart_part*) -+pjsip_multipart_find_part_by_header_str(pj_pool_t *pool, -+ const pjsip_msg_body *mp, -+ const pj_str_t *hdr_name, -+ const pj_str_t *hdr_value, -+ const pjsip_multipart_part *start) -+{ -+ struct multipart_data *m_data; -+ pjsip_multipart_part *part; -+ pjsip_hdr *found_hdr; -+ pj_str_t found_hdr_str; -+ pj_str_t found_hdr_value; -+ pj_size_t expected_hdr_slen; -+ pj_size_t buf_size; -+ int hdr_name_len; -+#define REASONABLE_PADDING 32 -+#define SEPARATOR_LEN 2 -+ /* Must specify mandatory params */ -+ PJ_ASSERT_RETURN(mp && hdr_name && hdr_value, NULL); -+ -+ /* mp must really point to an actual multipart msg body */ -+ PJ_ASSERT_RETURN(mp->print_body==&multipart_print_body, NULL); -+ -+ /* -+ * We'll need to "print" each header we find to test it but -+ * allocating a buffer of PJSIP_MAX_URL_SIZE is overkill. -+ * Instead, we'll allocate one large enough to hold the search -+ * header name, the ": " separator, the search hdr value, and -+ * the NULL terminator. If we can't print the found header -+ * into that buffer then it can't be a match. -+ * -+ * Some header print functions such as generic_int require enough -+ * space to print the maximum possible header length so we'll -+ * add a reasonable amount to the print buffer size. -+ */ -+ expected_hdr_slen = hdr_name->slen + SEPARATOR_LEN + hdr_value->slen; -+ buf_size = expected_hdr_slen + REASONABLE_PADDING; -+ found_hdr_str.ptr = pj_pool_alloc(pool, buf_size); -+ found_hdr_str.slen = 0; -+ hdr_name_len = hdr_name->slen + SEPARATOR_LEN; -+ -+ m_data = (struct multipart_data*)mp->data; -+ -+ if (start) -+ part = start->next; -+ else -+ part = m_data->part_head.next; -+ -+ while (part != &m_data->part_head) { -+ found_hdr = NULL; -+ while ((found_hdr = pjsip_hdr_find_by_name(&part->hdr, hdr_name, -+ (found_hdr ? found_hdr->next : NULL))) != NULL) { -+ -+ found_hdr_str.slen = pjsip_hdr_print_on((void*) found_hdr, found_hdr_str.ptr, buf_size); -+ /* -+ * If the buffer was too small (slen = -1) or the result wasn't -+ * the same length as the search header, it can't be a match. -+ */ -+ if (found_hdr_str.slen != expected_hdr_slen) { -+ continue; -+ } -+ /* -+ * Set the value overlay to start at the found header value... -+ */ -+ found_hdr_value.ptr = found_hdr_str.ptr + hdr_name_len; -+ found_hdr_value.slen = found_hdr_str.slen - hdr_name_len; -+ /* ...and compare it to the supplied header value. */ -+ if (pj_strcmp(hdr_value, &found_hdr_value) == 0) { -+ return part; -+ } -+ } -+ part = part->next; -+ } -+ return NULL; -+#undef SEPARATOR_LEN -+#undef REASONABLE_PADDING -+} -+ -+PJ_DEF(pjsip_multipart_part*) -+pjsip_multipart_find_part_by_header(pj_pool_t *pool, -+ const pjsip_msg_body *mp, -+ void *search_for, -+ const pjsip_multipart_part *start) -+{ -+ struct multipart_data *m_data; -+ pjsip_hdr *search_hdr = search_for; -+ pj_str_t search_buf; -+ -+ /* Must specify mandatory params */ -+ PJ_ASSERT_RETURN(mp && search_hdr, NULL); -+ -+ /* mp must really point to an actual multipart msg body */ -+ PJ_ASSERT_RETURN(mp->print_body==&multipart_print_body, NULL); -+ -+ /* -+ * Unfortunately, there isn't enough information to determine -+ * the maximum printed size of search_hdr at this point so we -+ * have to allocate a reasonable max. -+ */ -+ search_buf.ptr = pj_pool_alloc(pool, PJSIP_MAX_URL_SIZE); -+ search_buf.slen = pjsip_hdr_print_on(search_hdr, search_buf.ptr, PJSIP_MAX_URL_SIZE - 1); -+ if (search_buf.slen <= 0) { -+ return NULL; -+ } -+ /* -+ * Set the header value to start after the header name plus the ":", then -+ * strip leading and trailing whitespace. -+ */ -+ search_buf.ptr += (search_hdr->name.slen + 1); -+ search_buf.slen -= (search_hdr->name.slen + 1); -+ pj_strtrim(&search_buf); -+ -+ return pjsip_multipart_find_part_by_header_str(pool, mp, &search_hdr->name, &search_buf, start); -+} -+ -+/* -+ * Convert a Content-ID URI to it's corresponding header value. -+ * RFC2392 says... -+ * A "cid" URL is converted to the corresponding Content-ID message -+ * header by removing the "cid:" prefix, converting the % encoded -+ * character(s) to their equivalent US-ASCII characters, and enclosing -+ * the remaining parts with an angle bracket pair, "<" and ">". -+ * -+ * This implementation will accept URIs with or without the "cid:" -+ * scheme and optional angle brackets. -+ */ -+static pj_str_t cid_uri_to_hdr_value(pj_pool_t *pool, pj_str_t *cid_uri) -+{ -+ pj_size_t cid_len = pj_strlen(cid_uri); -+ pj_size_t alloc_len = cid_len + 2 /* for the leading and trailing angle brackets */; -+ pj_str_t uri_overlay; -+ pj_str_t cid_hdr; -+ pj_str_t hdr_overlay; -+ -+ pj_strassign(&uri_overlay, cid_uri); -+ /* If the URI is already enclosed in angle brackets, remove them. */ -+ if (uri_overlay.ptr[0] == '<') { -+ uri_overlay.ptr++; -+ uri_overlay.slen -= 2; -+ } -+ /* If the URI starts with the "cid:" scheme, skip over it. */ -+ if (pj_strncmp2(&uri_overlay, "cid:", 4) == 0) { -+ uri_overlay.ptr += 4; -+ uri_overlay.slen -= 4; -+ } -+ /* Start building */ -+ cid_hdr.ptr = pj_pool_alloc(pool, alloc_len); -+ cid_hdr.ptr[0] = '<'; -+ cid_hdr.slen = 1; -+ hdr_overlay.ptr = cid_hdr.ptr + 1; -+ hdr_overlay.slen = 0; -+ pj_strcpy_unescape(&hdr_overlay, &uri_overlay); -+ cid_hdr.slen += hdr_overlay.slen; -+ cid_hdr.ptr[cid_hdr.slen] = '>'; -+ cid_hdr.slen++; -+ -+ return cid_hdr; -+} -+ -+PJ_DEF(pjsip_multipart_part*) -+pjsip_multipart_find_part_by_cid_str(pj_pool_t *pool, -+ const pjsip_msg_body *mp, -+ pj_str_t *cid) -+{ -+ struct multipart_data *m_data; -+ pjsip_multipart_part *part; -+ pjsip_generic_string_hdr *found_hdr; -+ pj_str_t found_hdr_value; -+ static pj_str_t hdr_name = { "Content-ID", 10}; -+ pj_str_t hdr_value; -+ -+ PJ_ASSERT_RETURN(pool && mp && cid && (pj_strlen(cid) > 0), NULL); -+ -+ hdr_value = cid_uri_to_hdr_value(pool, cid); -+ if (pj_strlen(&hdr_value) == 0) { -+ return NULL; -+ } -+ -+ m_data = (struct multipart_data*)mp->data; -+ part = m_data->part_head.next; -+ -+ while (part != &m_data->part_head) { -+ found_hdr = NULL; -+ while ((found_hdr = pjsip_hdr_find_by_name(&part->hdr, &hdr_name, -+ (found_hdr ? found_hdr->next : NULL))) != NULL) { -+ if (pj_strcmp(&hdr_value, &found_hdr->hvalue) == 0) { -+ return part; -+ } -+ } -+ part = part->next; -+ } -+ return NULL; -+} -+ -+PJ_DEF(pjsip_multipart_part*) -+pjsip_multipart_find_part_by_cid_uri(pj_pool_t *pool, -+ const pjsip_msg_body *mp, -+ pjsip_other_uri *cid_uri) -+{ -+ PJ_ASSERT_RETURN(pool && mp && cid_uri, NULL); -+ -+ if (pj_strcmp2(&cid_uri->scheme, "cid") != 0) { -+ return NULL; -+ } -+ /* -+ * We only need to pass the URI content so we -+ * can do that directly. -+ */ -+ return pjsip_multipart_find_part_by_cid_str(pool, mp, &cid_uri->content); -+} -+ - /* Parse a multipart part. "pct" is parent content-type */ - static pjsip_multipart_part *parse_multipart_part(pj_pool_t *pool, - char *start, -@@ -584,6 +799,7 @@ PJ_DEF(pjsip_msg_body*) pjsip_multipart_parse(pj_pool_t *pool, - (int)boundary.slen, boundary.ptr)); - } - -+ - /* Build the delimiter: - * delimiter = "--" boundary - */ -@@ -630,6 +846,8 @@ PJ_DEF(pjsip_msg_body*) pjsip_multipart_parse(pj_pool_t *pool, - if (*curptr=='\r') ++curptr; - if (*curptr!='\n') { - /* Expecting a newline here */ -+ PJ_LOG(2, (THIS_FILE, "Failed to find newline")); -+ - return NULL; - } - ++curptr; -@@ -645,6 +863,7 @@ PJ_DEF(pjsip_msg_body*) pjsip_multipart_parse(pj_pool_t *pool, - curptr = pj_strstr(&subbody, &delim); - if (!curptr) { - /* We're really expecting end delimiter to be found. */ -+ PJ_LOG(2, (THIS_FILE, "Failed to find end-delimiter")); - return NULL; - } - } -@@ -670,9 +889,13 @@ PJ_DEF(pjsip_msg_body*) pjsip_multipart_parse(pj_pool_t *pool, - part = parse_multipart_part(pool, start_body, end_body - start_body, - ctype); - if (part) { -+ TRACE_((THIS_FILE, "Adding part")); - pjsip_multipart_add_part(pool, body, part); -+ } else { -+ PJ_LOG(2, (THIS_FILE, "Failed to add part")); - } - } -+ TRACE_((THIS_FILE, "pjsip_multipart_parse finished: %p", body)); - - return body; - } -diff --git a/pjsip/src/test/multipart_test.c b/pjsip/src/test/multipart_test.c -index 4f16e68bf..97267a290 100644 ---- a/pjsip/src/test/multipart_test.c -+++ b/pjsip/src/test/multipart_test.c -@@ -28,6 +28,7 @@ - typedef pj_status_t (*verify_ptr)(pj_pool_t*,pjsip_msg_body*); - - static pj_status_t verify1(pj_pool_t *pool, pjsip_msg_body *body); -+static pj_status_t verify2(pj_pool_t *pool, pjsip_msg_body *body); - - static struct test_t - { -@@ -68,7 +69,41 @@ static struct test_t - "This is epilogue, which should be ignored too", - - &verify1 -+ }, -+ { -+ /* Content-type */ -+ "multipart", "mixed", "12345", -+ -+ /* Body: */ -+ "This is the prolog, which should be ignored.\r\n" -+ "--12345\r\n" -+ "Content-Type: text/plain\r\n" -+ "Content-ID: \r\n" -+ "Content-ID: <\"header1\"@example.org>\r\n" -+ "Content-Length: 13\r\n" -+ "\r\n" -+ "has header1\r\n" -+ "--12345 \t\r\n" -+ "Content-Type: application/pidf+xml\r\n" -+ "Content-ID: \r\n" -+ "Content-ID: \r\n" -+ "Content-Length: 13\r\n" -+ "\r\n" -+ "has header2\r\n" -+ "--12345\r\n" -+ "Content-Type: text/plain\r\n" -+ "Content-ID: \r\n" -+ "Content-ID: \r\n" -+ "Content-ID: \r\n" -+ "Content-Length: 13\r\n" -+ "\r\n" -+ "has header4\r\n" -+ "--12345--\r\n" -+ "This is epilogue, which should be ignored too", -+ -+ &verify2 - } -+ - }; - - static void init_media_type(pjsip_media_type *mt, -@@ -87,6 +122,192 @@ static void init_media_type(pjsip_media_type *mt, - } - } - -+static int verify_hdr(pj_pool_t *pool, pjsip_msg_body *multipart_body, -+ void *hdr, char *part_body) -+{ -+ pjsip_media_type mt; -+ pjsip_multipart_part *part; -+ pj_str_t the_body; -+ -+ -+ part = pjsip_multipart_find_part_by_header(pool, multipart_body, hdr, NULL); -+ if (!part) { -+ return -1; -+ } -+ -+ the_body.ptr = (char*)part->body->data; -+ the_body.slen = part->body->len; -+ -+ if (pj_strcmp2(&the_body, part_body) != 0) { -+ return -2; -+ } -+ -+ return 0; -+} -+ -+static int verify_cid_str(pj_pool_t *pool, pjsip_msg_body *multipart_body, -+ pj_str_t cid_url, char *part_body) -+{ -+ pjsip_media_type mt; -+ pjsip_multipart_part *part; -+ pj_str_t the_body; -+ -+ part = pjsip_multipart_find_part_by_cid_str(pool, multipart_body, &cid_url); -+ if (!part) { -+ return -3; -+ } -+ -+ the_body.ptr = (char*)part->body->data; -+ the_body.slen = part->body->len; -+ -+ if (pj_strcmp2(&the_body, part_body) != 0) { -+ return -4; -+ } -+ -+ return 0; -+} -+ -+static int verify_cid_uri(pj_pool_t *pool, pjsip_msg_body *multipart_body, -+ pjsip_other_uri *cid_uri, char *part_body) -+{ -+ pjsip_media_type mt; -+ pjsip_multipart_part *part; -+ pj_str_t the_body; -+ -+ part = pjsip_multipart_find_part_by_cid_uri(pool, multipart_body, cid_uri); -+ if (!part) { -+ return -5; -+ } -+ -+ the_body.ptr = (char*)part->body->data; -+ the_body.slen = part->body->len; -+ -+ if (pj_strcmp2(&the_body, part_body) != 0) { -+ return -6; -+ } -+ -+ return 0; -+} -+ -+static pj_status_t verify2(pj_pool_t *pool, pjsip_msg_body *body) -+{ -+ int rc = 0; -+ int rcbase = 300; -+ pjsip_other_uri *cid_uri; -+ pjsip_ctype_hdr *ctype_hdr = pjsip_ctype_hdr_create(pool); -+ -+ ctype_hdr->media.type = pj_str("application"); -+ ctype_hdr->media.subtype = pj_str("pidf+xml"); -+ -+ rc = verify_hdr(pool, body, ctype_hdr, "has header2"); -+ if (rc) { -+ return (rc - rcbase); -+ } -+ -+ rcbase += 10; -+ rc = verify_cid_str(pool, body, pj_str("cid:header1@example.org"), "has header1"); -+ if (rc) { -+ return (rc - rcbase); -+ } -+ -+ rcbase += 10; -+ rc = verify_cid_str(pool, body, pj_str("%22header1%22@example.org"), "has header1"); -+ if (rc) { -+ return (rc - rcbase); -+ } -+ -+ cid_uri = pjsip_uri_get_uri(pjsip_parse_uri(pool, "", -+ strlen(""), 0)); -+ rcbase += 10; -+ rc = verify_cid_uri(pool, body, cid_uri, "has header1"); -+ if (rc) { -+ return (rc - rcbase); -+ } -+ -+ rcbase += 10; -+ rc = verify_cid_str(pool, body, pj_str(""), "has header2"); -+ if (rc) { -+ return (rc - rcbase); -+ } -+ -+ rcbase += 10; -+ rc = verify_cid_str(pool, body, pj_str("cid:my%ffheader2@example.org"), "has header2"); -+ if (rc) { -+ return (rc - rcbase); -+ } -+ -+ cid_uri = pjsip_uri_get_uri(pjsip_parse_uri(pool, "", -+ strlen(""), 0)); -+ rcbase += 10; -+ rc = verify_cid_uri(pool, body, cid_uri, "has header2"); -+ if (rc) { -+ return (rc - rcbase); -+ } -+ -+ rcbase += 10; -+ rc = verify_cid_str(pool, body, pj_str("cid:my%20header3@example.org"), "has header4"); -+ if (rc) { -+ return (rc - rcbase); -+ } -+ -+ rcbase += 10; -+ rc = verify_cid_str(pool, body, pj_str(""), "has header4"); -+ if (rc) { -+ return (rc - rcbase); -+ } -+ -+ cid_uri = pjsip_uri_get_uri(pjsip_parse_uri(pool, "", -+ strlen(""), 0)); -+ rcbase += 10; -+ rc = verify_cid_uri(pool, body, cid_uri, "has header4"); -+ if (rc) { -+ return (rc - rcbase); -+ } -+ -+ rcbase += 10; -+ rc = verify_cid_str(pool, body, pj_str(""), "has header4"); -+ if (rc) { -+ return (rc - rcbase); -+ } -+ -+ /* These should all fail for malformed or missing URI */ -+ rcbase += 10; -+ rc = verify_cid_str(pool, body, pj_str("cid:"), "has header4"); -+ if (!rc) { -+ return (rc - rcbase); -+ } -+ -+ rcbase += 10; -+ rc = verify_cid_str(pool, body, pj_str(""), "has header4"); -+ if (!rc) { -+ return (rc - rcbase); -+ } -+ -+ rcbase += 10; -+ rc = verify_cid_str(pool, body, pj_str("<>"), "has header4"); -+ if (!rc) { -+ return (rc - rcbase); -+ } -+ -+ rcbase += 10; -+ rc = verify_cid_str(pool, body, pj_str(""), "has header4"); -+ if (!rc) { -+ return (rc - rcbase); -+ } -+ -+ /* -+ * This is going to pass but the ' ' in the uri is un-encoded which is invalid -+ * so we should never see it. -+ */ -+ rcbase += 10; -+ rc = verify_cid_str(pool, body, pj_str("cid:my header3@example.org"), "has header4"); -+ if (rc) { -+ return (rc - rcbase); -+ } -+ -+ return 0; -+} -+ - static int verify_part(pjsip_multipart_part *part, - char *h_content_type, - char *h_content_subtype, -@@ -236,8 +457,10 @@ static int parse_test(void) - - pj_strdup2_with_null(pool, &str, p_tests[i].msg); - body = pjsip_multipart_parse(pool, str.ptr, str.slen, &ctype, 0); -- if (!body) -+ if (!body) { -+ pj_pool_release(pool); - return -100; -+ } - - if (p_tests[i].verify) { - rc = p_tests[i].verify(pool, body); --- -2.34.1 - diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/third-party/pjproject/patches/0170-stun-integer-underflow.patch asterisk-18.12.0~dfsg+~cs6.12.40431413/third-party/pjproject/patches/0170-stun-integer-underflow.patch --- asterisk-18.11.2~dfsg+~cs6.10.40431413/third-party/pjproject/patches/0170-stun-integer-underflow.patch 2022-04-14 21:53:34.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/third-party/pjproject/patches/0170-stun-integer-underflow.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,26 +0,0 @@ -From 15663e3f37091069b8c98a7fce680dc04bc8e865 Mon Sep 17 00:00:00 2001 -From: sauwming -Date: Tue, 10 Aug 2021 11:53:25 +0800 -Subject: [PATCH] Merge pull request from GHSA-2qpg-f6wf-w984 - ---- - pjnath/src/pjnath/stun_msg.c | 3 +++ - 1 file changed, 3 insertions(+) - -diff --git a/pjnath/src/pjnath/stun_msg.c b/pjnath/src/pjnath/stun_msg.c -index cd5870f82..bd83351e6 100644 ---- a/pjnath/src/pjnath/stun_msg.c -+++ b/pjnath/src/pjnath/stun_msg.c -@@ -1763,6 +1763,9 @@ static pj_status_t decode_errcode_attr(pj_pool_t *pool, - /* Get pointer to the string in the message */ - value.ptr = ((char*)buf + ATTR_HDR_LEN + 4); - value.slen = attr->hdr.length - 4; -+ /* Make sure the length is never negative */ -+ if (value.slen < 0) -+ value.slen = 0; - - /* Copy the string to the attribute */ - pj_strdup(pool, &attr->reason, &value); --- -2.25.1 - diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/third-party/pjproject/patches/0171-dialog-set-free.patch asterisk-18.12.0~dfsg+~cs6.12.40431413/third-party/pjproject/patches/0171-dialog-set-free.patch --- asterisk-18.11.2~dfsg+~cs6.10.40431413/third-party/pjproject/patches/0171-dialog-set-free.patch 2022-04-14 21:53:34.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/third-party/pjproject/patches/0171-dialog-set-free.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,114 +0,0 @@ -From db3235953baa56d2fb0e276ca510fefca751643f Mon Sep 17 00:00:00 2001 -From: Nanang Izzuddin -Date: Mon, 21 Feb 2022 06:24:52 +0700 -Subject: [PATCH] Merge pull request from GHSA-ffff-m5fm-qm62 - -* Update pjsip_ua_unregister_dlg(): -- update the hash key if the dialog being unregistered is used as hash key. -- add an assertion check to make sure that the dlg_set to be removed is valid (can be found in the hash table). - -* Change hash key string comparison method. ---- - pjsip/src/pjsip/sip_ua_layer.c | 48 +++++++++++++++++++++++++++++----- - 1 file changed, 42 insertions(+), 6 deletions(-) - -diff --git a/pjsip/src/pjsip/sip_ua_layer.c b/pjsip/src/pjsip/sip_ua_layer.c -index 59c2524ba..5d79882a1 100644 ---- a/pjsip/src/pjsip/sip_ua_layer.c -+++ b/pjsip/src/pjsip/sip_ua_layer.c -@@ -65,6 +65,9 @@ struct dlg_set - /* This is the buffer to store this entry in the hash table. */ - pj_hash_entry_buf ht_entry; - -+ /* Entry key in the hash table */ -+ pj_str_t ht_key; -+ - /* List of dialog in this dialog set. */ - struct dlg_set_head dlg_list; - }; -@@ -327,6 +330,7 @@ PJ_DEF(pj_status_t) pjsip_ua_register_dlg( pjsip_user_agent *ua, - * Create the dialog set and add this dialog to it. - */ - dlg_set = alloc_dlgset_node(); -+ dlg_set->ht_key = dlg->local.info->tag; - pj_list_init(&dlg_set->dlg_list); - pj_list_push_back(&dlg_set->dlg_list, dlg); - -@@ -334,8 +338,8 @@ PJ_DEF(pj_status_t) pjsip_ua_register_dlg( pjsip_user_agent *ua, - - /* Register the dialog set in the hash table. */ - pj_hash_set_np_lower(mod_ua.dlg_table, -- dlg->local.info->tag.ptr, -- (unsigned)dlg->local.info->tag.slen, -+ dlg_set->ht_key.ptr, -+ (unsigned)dlg_set->ht_key.slen, - dlg->local.tag_hval, dlg_set->ht_entry, - dlg_set); - } -@@ -345,14 +349,15 @@ PJ_DEF(pj_status_t) pjsip_ua_register_dlg( pjsip_user_agent *ua, - struct dlg_set *dlg_set; - - dlg_set = alloc_dlgset_node(); -+ dlg_set->ht_key = dlg->local.info->tag; - pj_list_init(&dlg_set->dlg_list); - pj_list_push_back(&dlg_set->dlg_list, dlg); - - dlg->dlg_set = dlg_set; - - pj_hash_set_np_lower(mod_ua.dlg_table, -- dlg->local.info->tag.ptr, -- (unsigned)dlg->local.info->tag.slen, -+ dlg_set->ht_key.ptr, -+ (unsigned)dlg_set->ht_key.slen, - dlg->local.tag_hval, dlg_set->ht_entry, dlg_set); - } - -@@ -397,12 +402,43 @@ PJ_DEF(pj_status_t) pjsip_ua_unregister_dlg( pjsip_user_agent *ua, - - /* If dialog list is empty, remove the dialog set from the hash table. */ - if (pj_list_empty(&dlg_set->dlg_list)) { -- pj_hash_set_lower(NULL, mod_ua.dlg_table, dlg->local.info->tag.ptr, -- (unsigned)dlg->local.info->tag.slen, -+ -+ /* Verify that the dialog set is valid */ -+ pj_assert(pj_hash_get_lower(mod_ua.dlg_table, dlg_set->ht_key.ptr, -+ (unsigned)dlg_set->ht_key.slen, -+ &dlg->local.tag_hval) == dlg_set); -+ -+ pj_hash_set_lower(NULL, mod_ua.dlg_table, dlg_set->ht_key.ptr, -+ (unsigned)dlg_set->ht_key.slen, - dlg->local.tag_hval, NULL); - - /* Return dlg_set to free nodes. */ - pj_list_push_back(&mod_ua.free_dlgset_nodes, dlg_set); -+ } else { -+ /* If the just unregistered dialog is being used as hash key, -+ * reset the dlg_set entry with a new key (i.e: from the first dialog -+ * in dlg_set). -+ */ -+ if (dlg_set->ht_key.ptr == dlg->local.info->tag.ptr && -+ dlg_set->ht_key.slen == dlg->local.info->tag.slen) -+ { -+ pjsip_dialog* key_dlg = dlg_set->dlg_list.next; -+ -+ /* Verify that the old & new keys share the hash value */ -+ pj_assert(key_dlg->local.tag_hval == dlg->local.tag_hval); -+ -+ pj_hash_set_lower(NULL, mod_ua.dlg_table, dlg_set->ht_key.ptr, -+ (unsigned)dlg_set->ht_key.slen, -+ dlg->local.tag_hval, NULL); -+ -+ dlg_set->ht_key = key_dlg->local.info->tag; -+ -+ pj_hash_set_np_lower(mod_ua.dlg_table, -+ dlg_set->ht_key.ptr, -+ (unsigned)dlg_set->ht_key.slen, -+ key_dlg->local.tag_hval, dlg_set->ht_entry, -+ dlg_set); -+ } - } - - /* Unlock user agent. */ --- -2.25.1 - diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/third-party/pjproject/patches/0172-prevent-multipart-oob.patch asterisk-18.12.0~dfsg+~cs6.12.40431413/third-party/pjproject/patches/0172-prevent-multipart-oob.patch --- asterisk-18.11.2~dfsg+~cs6.10.40431413/third-party/pjproject/patches/0172-prevent-multipart-oob.patch 2022-04-14 21:53:34.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/third-party/pjproject/patches/0172-prevent-multipart-oob.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,42 +0,0 @@ -From 077b465c33f0aec05a49cd2ca456f9a1b112e896 Mon Sep 17 00:00:00 2001 -From: sauwming -Date: Wed, 26 Jan 2022 13:28:57 +0800 -Subject: [PATCH] Merge pull request from GHSA-7fw8-54cv-r7pm - ---- - pjlib-util/src/pjlib-util/scanner.c | 13 +++++++++---- - 1 file changed, 9 insertions(+), 4 deletions(-) - -diff --git a/pjlib-util/src/pjlib-util/scanner.c b/pjlib-util/src/pjlib-util/scanner.c -index 27a0b8831..a54edf2d8 100644 ---- a/pjlib-util/src/pjlib-util/scanner.c -+++ b/pjlib-util/src/pjlib-util/scanner.c -@@ -444,16 +444,21 @@ PJ_DEF(void) pj_scan_get_n( pj_scanner *scanner, - - PJ_DEF(int) pj_scan_get_char( pj_scanner *scanner ) - { -- int chr = *scanner->curptr; -+ register char *s = scanner->curptr; -+ int chr; - -- if (!chr) { -+ if (s >= scanner->end || !*s) { - pj_scan_syntax_err(scanner); - return 0; - } - -- ++scanner->curptr; -+ chr = *s; - -- if (PJ_SCAN_IS_PROBABLY_SPACE(*scanner->curptr) && scanner->skip_ws) { -+ ++s; -+ scanner->curptr = s; -+ if (PJ_SCAN_CHECK_EOF(s) && PJ_SCAN_IS_PROBABLY_SPACE(*s) && -+ scanner->skip_ws) -+ { - pj_scan_skip_whitespace(scanner); - } - return chr; --- -2.25.1 - diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/third-party/pjproject/patches/config_site.h asterisk-18.12.0~dfsg+~cs6.12.40431413/third-party/pjproject/patches/config_site.h --- asterisk-18.11.2~dfsg+~cs6.10.40431413/third-party/pjproject/patches/config_site.h 2022-04-14 21:53:34.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/third-party/pjproject/patches/config_site.h 2022-05-12 11:50:59.000000000 +0000 @@ -77,7 +77,7 @@ /* Increase limits to allow more formats */ #define PJMEDIA_MAX_SDP_FMT 64 #define PJMEDIA_MAX_SDP_BANDW 4 -#define PJMEDIA_MAX_SDP_ATTR (PJMEDIA_MAX_SDP_FMT*2 + 4) +#define PJMEDIA_MAX_SDP_ATTR (PJMEDIA_MAX_SDP_FMT*3 + 4) #define PJMEDIA_MAX_SDP_MEDIA 16 /* @@ -87,3 +87,7 @@ */ #define PJSIP_TCP_KEEP_ALIVE_INTERVAL 0 #define PJSIP_TLS_KEEP_ALIVE_INTERVAL 0 + +#define PJSIP_TSX_UAS_CONTINUE_ON_TP_ERROR 0 +#define PJ_SSL_SOCK_OSSL_USE_THREAD_CB 0 +#define PJSIP_AUTH_ALLOW_MULTIPLE_AUTH_HEADER 1 diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/third-party/pjproject/pjproject-2.10.tar.bz2.md5 asterisk-18.12.0~dfsg+~cs6.12.40431413/third-party/pjproject/pjproject-2.10.tar.bz2.md5 --- asterisk-18.11.2~dfsg+~cs6.10.40431413/third-party/pjproject/pjproject-2.10.tar.bz2.md5 2022-04-14 21:53:34.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/third-party/pjproject/pjproject-2.10.tar.bz2.md5 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -5d0202f79a7aeb14873c45b0e4c14a70 *pjproject-2.10.zip -4fffc49b461133f0a4143b05a22fb30e pjproject-2.10.tar.bz2 diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/third-party/pjproject/pjproject-2.12.tar.bz2.md5 asterisk-18.12.0~dfsg+~cs6.12.40431413/third-party/pjproject/pjproject-2.12.tar.bz2.md5 --- asterisk-18.11.2~dfsg+~cs6.10.40431413/third-party/pjproject/pjproject-2.12.tar.bz2.md5 1970-01-01 00:00:00.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/third-party/pjproject/pjproject-2.12.tar.bz2.md5 2022-05-12 11:50:59.000000000 +0000 @@ -0,0 +1 @@ +ad796d38f5f0357cb5b2fe1b4460b581 pjproject-2.12.tar.bz2 diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/third-party/versions.mak asterisk-18.12.0~dfsg+~cs6.12.40431413/third-party/versions.mak --- asterisk-18.11.2~dfsg+~cs6.10.40431413/third-party/versions.mak 2022-04-14 21:53:34.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/third-party/versions.mak 2022-05-12 11:50:59.000000000 +0000 @@ -1,2 +1,2 @@ JANSSON_VERSION = 2.14 -PJPROJECT_VERSION = 2.10 +PJPROJECT_VERSION = 2.12 diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/UPGRADE.txt asterisk-18.12.0~dfsg+~cs6.12.40431413/UPGRADE.txt --- asterisk-18.11.2~dfsg+~cs6.10.40431413/UPGRADE.txt 2022-04-14 21:53:34.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/UPGRADE.txt 2022-05-12 11:50:59.000000000 +0000 @@ -19,6 +19,18 @@ =========================================================== ------------------------------------------------------------------------------ +--- Functionality changes from Asterisk 18.11.3 to Asterisk 18.12.0 ---------- +------------------------------------------------------------------------------ + +res_pjsip +------------------ + * The 'async_operations' setting on transports is no longer + obeyed and instead is always set to 1. This is due to the + functionality not being applicable to Asterisk and causing + excess unnecessary memory usage. This setting will now be + ignored but can also be removed from the configuration file. + +------------------------------------------------------------------------------ --- Functionality changes from Asterisk 18.10.0 to Asterisk 18.11.0 ---------- ------------------------------------------------------------------------------ diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/.version asterisk-18.12.0~dfsg+~cs6.12.40431413/.version --- asterisk-18.11.2~dfsg+~cs6.10.40431413/.version 2022-04-14 21:53:34.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/.version 2022-05-12 11:50:59.000000000 +0000 @@ -1 +1 @@ -18.11.2 \ No newline at end of file +18.12.0 \ No newline at end of file diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/aconfigure asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/aconfigure --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/aconfigure 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/aconfigure 2022-02-24 07:54:38.000000000 +0000 @@ -1,9 +1,10 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for pjproject 2.x. +# Generated by GNU Autoconf 2.71 for pjproject 2.x. # # -# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. +# Copyright (C) 1992-1996, 1998-2017, 2020-2021 Free Software Foundation, +# Inc. # # # This configure script is free software; the Free Software Foundation @@ -14,14 +15,16 @@ # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : +as_nop=: +if test ${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1 +then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST -else +else $as_nop case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( @@ -31,46 +34,46 @@ fi + +# Reset variables that may have inherited troublesome values from +# the environment. + +# IFS needs to be set, to space, tab, and newline, in precisely that order. +# (If _AS_PATH_WALK were called with IFS unset, it would have the +# side effect of setting IFS to empty, thus disabling word splitting.) +# Quoting is to prevent editors from complaining about space-tab. as_nl=' ' export as_nl -# Printing a long string crashes Solaris 7 /usr/bin/printf. -as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' -as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo -as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo -# Prefer a ksh shell builtin over an external printf program on Solaris, -# but without wasting forks for bash or zsh. -if test -z "$BASH_VERSION$ZSH_VERSION" \ - && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then - as_echo='print -r --' - as_echo_n='print -rn --' -elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then - as_echo='printf %s\n' - as_echo_n='printf %s' -else - if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then - as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' - as_echo_n='/usr/ucb/echo -n' - else - as_echo_body='eval expr "X$1" : "X\\(.*\\)"' - as_echo_n_body='eval - arg=$1; - case $arg in #( - *"$as_nl"*) - expr "X$arg" : "X\\(.*\\)$as_nl"; - arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; - esac; - expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" - ' - export as_echo_n_body - as_echo_n='sh -c $as_echo_n_body as_echo' - fi - export as_echo_body - as_echo='sh -c $as_echo_body as_echo' -fi +IFS=" "" $as_nl" + +PS1='$ ' +PS2='> ' +PS4='+ ' + +# Ensure predictable behavior from utilities with locale-dependent output. +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# We cannot yet rely on "unset" to work, but we need these variables +# to be unset--not just set to an empty or harmless value--now, to +# avoid bugs in old shells (e.g. pre-3.0 UWIN ksh). This construct +# also avoids known problems related to "unset" and subshell syntax +# in other old shells (e.g. bash 2.01 and pdksh 5.2.14). +for as_var in BASH_ENV ENV MAIL MAILPATH CDPATH +do eval test \${$as_var+y} \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : +done + +# Ensure that fds 0, 1, and 2 are open. +if (exec 3>&0) 2>/dev/null; then :; else exec 0&1) 2>/dev/null; then :; else exec 1>/dev/null; fi +if (exec 3>&2) ; then :; else exec 2>/dev/null; fi # The user is always right. -if test "${PATH_SEPARATOR+set}" != set; then +if ${PATH_SEPARATOR+false} :; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || @@ -79,13 +82,6 @@ fi -# IFS -# We need space, tab and new line, in precisely that order. Quoting is -# there to prevent editors from complaining about space-tab. -# (If _AS_PATH_WALK were called with IFS unset, it would disable word -# splitting by setting IFS to empty value.) -IFS=" "" $as_nl" - # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( @@ -94,8 +90,12 @@ for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + test -r "$as_dir$0" && as_myself=$as_dir$0 && break done IFS=$as_save_IFS @@ -107,30 +107,10 @@ as_myself=$0 fi if test ! -f "$as_myself"; then - $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + printf "%s\n" "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi -# Unset variables that we do not need and which cause bugs (e.g. in -# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" -# suppresses any "Segmentation fault" message there. '((' could -# trigger a bug in pdksh 5.2.14. -for as_var in BASH_ENV ENV MAIL MAILPATH -do eval test x\${$as_var+set} = xset \ - && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : -done -PS1='$ ' -PS2='> ' -PS4='+ ' - -# NLS nuisances. -LC_ALL=C -export LC_ALL -LANGUAGE=C -export LANGUAGE - -# CDPATH. -(unset CDPATH) >/dev/null 2>&1 && unset CDPATH # Use a proper internal environment variable to ensure we don't fall # into an infinite loop, continuously re-executing ourselves. @@ -152,20 +132,22 @@ exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. -$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 -as_fn_exit 255 +printf "%s\n" "$0: could not re-execute with $CONFIG_SHELL" >&2 +exit 255 fi # We don't want this to propagate to other subprocesses. { _as_can_reexec=; unset _as_can_reexec;} if test "x$CONFIG_SHELL" = x; then - as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : + as_bourne_compatible="as_nop=: +if test \${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1 +then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST -else +else \$as_nop case \`(set -o) 2>/dev/null\` in #( *posix*) : set -o posix ;; #( @@ -185,42 +167,52 @@ as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } -if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : +if ( set x; as_fn_ret_success y && test x = \"\$1\" ) +then : -else +else \$as_nop exitcode=1; echo positional parameters were not saved. fi test x\$exitcode = x0 || exit 1 +blah=\$(echo \$(echo blah)) +test x\"\$blah\" = xblah || exit 1 test -x / || exit 1" as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && - test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 -test \$(( 1 + 1 )) = 2 || exit 1" - if (eval "$as_required") 2>/dev/null; then : + test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1" + if (eval "$as_required") 2>/dev/null +then : as_have_required=yes -else +else $as_nop as_have_required=no fi - if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : + if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null +then : -else +else $as_nop as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_found=false for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac as_found=: case $as_dir in #( /*) for as_base in sh bash ksh sh5; do # Try only shells that exist, to save several forks. - as_shell=$as_dir/$as_base + as_shell=$as_dir$as_base if { test -f "$as_shell" || test -f "$as_shell.exe"; } && - { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : + as_run=a "$as_shell" -c "$as_bourne_compatible""$as_required" 2>/dev/null +then : CONFIG_SHELL=$as_shell as_have_required=yes - if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : + if as_run=a "$as_shell" -c "$as_bourne_compatible""$as_suggested" 2>/dev/null +then : break 2 fi fi @@ -228,14 +220,21 @@ esac as_found=false done -$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && - { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : - CONFIG_SHELL=$SHELL as_have_required=yes -fi; } IFS=$as_save_IFS +if $as_found +then : + +else $as_nop + if { test -f "$SHELL" || test -f "$SHELL.exe"; } && + as_run=a "$SHELL" -c "$as_bourne_compatible""$as_required" 2>/dev/null +then : + CONFIG_SHELL=$SHELL as_have_required=yes +fi +fi - if test "x$CONFIG_SHELL" != x; then : + if test "x$CONFIG_SHELL" != x +then : export CONFIG_SHELL # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also @@ -253,18 +252,19 @@ exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. -$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 +printf "%s\n" "$0: could not re-execute with $CONFIG_SHELL" >&2 exit 255 fi - if test x$as_have_required = xno; then : - $as_echo "$0: This script requires a shell more modern than all" - $as_echo "$0: the shells that I found on your system." - if test x${ZSH_VERSION+set} = xset ; then - $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" - $as_echo "$0: be upgraded to zsh 4.3.4 or later." + if test x$as_have_required = xno +then : + printf "%s\n" "$0: This script requires a shell more modern than all" + printf "%s\n" "$0: the shells that I found on your system." + if test ${ZSH_VERSION+y} ; then + printf "%s\n" "$0: In particular, zsh $ZSH_VERSION has bugs and should" + printf "%s\n" "$0: be upgraded to zsh 4.3.4 or later." else - $as_echo "$0: Please tell bug-autoconf@gnu.org about your system, + printf "%s\n" "$0: Please tell bug-autoconf@gnu.org about your system, $0: including any error possibly output before this $0: message. Then install a modern shell, or manually run $0: the script under such a shell if you do have one." @@ -291,6 +291,7 @@ } as_unset=as_fn_unset + # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. @@ -308,6 +309,14 @@ as_fn_set_status $1 exit $1 } # as_fn_exit +# as_fn_nop +# --------- +# Do nothing but, unlike ":", preserve the value of $?. +as_fn_nop () +{ + return $? +} +as_nop=as_fn_nop # as_fn_mkdir_p # ------------- @@ -322,7 +331,7 @@ as_dirs= while :; do case $as_dir in #( - *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *\'*) as_qdir=`printf "%s\n" "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" @@ -331,7 +340,7 @@ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$as_dir" | +printf "%s\n" X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q @@ -370,12 +379,13 @@ # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. -if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null +then : eval 'as_fn_append () { eval $1+=\$2 }' -else +else $as_nop as_fn_append () { eval $1=\$$1\$2 @@ -387,18 +397,27 @@ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. -if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null +then : eval 'as_fn_arith () { as_val=$(( $* )) }' -else +else $as_nop as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith +# as_fn_nop +# --------- +# Do nothing but, unlike ":", preserve the value of $?. +as_fn_nop () +{ + return $? +} +as_nop=as_fn_nop # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- @@ -410,9 +429,9 @@ as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi - $as_echo "$as_me: error: $2" >&2 + printf "%s\n" "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error @@ -439,7 +458,7 @@ $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X/"$0" | +printf "%s\n" X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q @@ -483,7 +502,7 @@ s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || - { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } + { printf "%s\n" "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } # If we had to re-execute with $CONFIG_SHELL, we're ensured to have # already done that, so ensure we don't try to do so again and fall @@ -497,6 +516,10 @@ exit } + +# Determine whether it's possible to make 'echo' print without a newline. +# These variables are no longer used directly by Autoconf, but are AC_SUBSTed +# for compatibility with existing Makefiles. ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) @@ -510,6 +533,13 @@ ECHO_N='-n';; esac +# For backward compatibility with old third-party macros, we provide +# the shell variables $as_echo and $as_echo_n. New code should use +# AS_ECHO(["message"]) and AS_ECHO_N(["message"]), respectively. +as_echo='printf %s\n' +as_echo_n='printf %s' + + rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file @@ -584,44 +614,44 @@ # Factoring default headers for most tests. ac_includes_default="\ -#include -#ifdef HAVE_SYS_TYPES_H -# include -#endif -#ifdef HAVE_SYS_STAT_H -# include +#include +#ifdef HAVE_STDIO_H +# include #endif -#ifdef STDC_HEADERS +#ifdef HAVE_STDLIB_H # include -# include -#else -# ifdef HAVE_STDLIB_H -# include -# endif #endif #ifdef HAVE_STRING_H -# if !defined STDC_HEADERS && defined HAVE_MEMORY_H -# include -# endif # include #endif -#ifdef HAVE_STRINGS_H -# include -#endif #ifdef HAVE_INTTYPES_H # include #endif #ifdef HAVE_STDINT_H # include #endif +#ifdef HAVE_STRINGS_H +# include +#endif +#ifdef HAVE_SYS_TYPES_H +# include +#endif +#ifdef HAVE_SYS_STAT_H +# include +#endif #ifdef HAVE_UNISTD_H # include #endif" +ac_header_c_list= ac_subst_vars='LTLIBOBJS LIBOBJS ac_main_obj ac_host +ac_webrtc_aec3_ldflags +ac_webrtc_aec3_cflags +ac_webrtc_aec3_instset +ac_no_webrtc_aec3 ac_webrtc_ldflags ac_webrtc_cflags ac_webrtc_instset @@ -650,6 +680,7 @@ ac_ssl_backend ac_ssl_has_aes_gcm ac_no_ssl +ac_no_mediacodec ac_vpx_ldflags ac_vpx_cflags ac_openh264_ldflags @@ -681,14 +712,20 @@ ac_pjmedia_video_has_ios_opengl ac_pjmedia_video_has_vtoolbox ac_pjmedia_video_has_darwin +ac_dshow_ldflags +ac_dshow_cflags +ac_pjmedia_video_dev_has_dshow ac_android_cflags ac_pjmedia_video_has_android ac_pjmedia_video ac_pjmedia_audiodev_objs +ac_oboe_ldflags +ac_oboe_cflags ac_pa_cflags ac_external_pa ac_pjmedia_snd ac_pjmedia_resample +ac_external_webrtc_aec3 ac_external_webrtc ac_external_yuv ac_srtp_shutdown_present @@ -697,15 +734,14 @@ ac_external_srtp ac_external_gsm ac_external_speex +ac_no_pjsua2 ac_shared_libraries ac_linux_poll ac_os_objs ac_target_arch -EGREP -GREP -CPP ac_cross_compile ac_shlib_suffix +ac_cflags ac_build_mak_vars ac_pjdir CC_CFLAGS @@ -762,6 +798,7 @@ docdir oldincludedir includedir +runstatedir localstatedir sharedstatedir sysconfdir @@ -787,14 +824,17 @@ enable_floating_point enable_epoll enable_shared +enable_pjsua2 with_external_speex with_external_gsm with_external_srtp with_external_yuv with_external_webrtc +with_external_webrtc_aec3 enable_resample enable_sound with_external_pa +with_oboe enable_video enable_ext_sound enable_small_filter @@ -809,6 +849,7 @@ enable_ilbc_codec enable_libsamplerate enable_resample_dll +enable_speex_resample with_sdl enable_sdl with_ffmpeg @@ -822,6 +863,7 @@ with_ipp with_ipp_samples with_ipp_arch +enable_android_mediacodec with_ssl with_gnutls enable_darwin_ssl @@ -838,6 +880,7 @@ enable_bcg729 enable_libyuv enable_libwebrtc +enable_libwebrtc_aec3 ' ac_precious_vars='build_alias host_alias @@ -849,8 +892,7 @@ CPPFLAGS CXX CXXFLAGS -CCC -CPP' +CCC' # Initialize some variables set by options. @@ -889,6 +931,7 @@ sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' +runstatedir='${localstatedir}/run' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' @@ -918,8 +961,6 @@ *) ac_optarg=yes ;; esac - # Accept the important Cygnus configure options, so we can diagnose typos. - case $ac_dashdash$ac_option in --) ac_dashdash=yes ;; @@ -960,9 +1001,9 @@ ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error $? "invalid feature name: $ac_useropt" + as_fn_error $? "invalid feature name: \`$ac_useropt'" ac_useropt_orig=$ac_useropt - ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" @@ -986,9 +1027,9 @@ ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error $? "invalid feature name: $ac_useropt" + as_fn_error $? "invalid feature name: \`$ac_useropt'" ac_useropt_orig=$ac_useropt - ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" @@ -1141,6 +1182,15 @@ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; + -runstatedir | --runstatedir | --runstatedi | --runstated \ + | --runstate | --runstat | --runsta | --runst | --runs \ + | --run | --ru | --r) + ac_prev=runstatedir ;; + -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \ + | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \ + | --run=* | --ru=* | --r=*) + runstatedir=$ac_optarg ;; + -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ @@ -1190,9 +1240,9 @@ ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error $? "invalid package name: $ac_useropt" + as_fn_error $? "invalid package name: \`$ac_useropt'" ac_useropt_orig=$ac_useropt - ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" @@ -1206,9 +1256,9 @@ ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error $? "invalid package name: $ac_useropt" + as_fn_error $? "invalid package name: \`$ac_useropt'" ac_useropt_orig=$ac_useropt - ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" @@ -1252,9 +1302,9 @@ *) # FIXME: should be removed in autoconf 3.0. - $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 + printf "%s\n" "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && - $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 + printf "%s\n" "$as_me: WARNING: invalid host type: $ac_option" >&2 : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" ;; @@ -1270,7 +1320,7 @@ case $enable_option_checking in no) ;; fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; - *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; + *) printf "%s\n" "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; esac fi @@ -1278,7 +1328,7 @@ for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ - libdir localedir mandir + libdir localedir mandir runstatedir do eval ac_val=\$$ac_var # Remove trailing slashes. @@ -1334,7 +1384,7 @@ X"$as_myself" : 'X\(//\)[^/]' \| \ X"$as_myself" : 'X\(//\)$' \| \ X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$as_myself" | +printf "%s\n" X"$as_myself" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q @@ -1431,6 +1481,7 @@ --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] + --runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] @@ -1469,6 +1520,8 @@ Disable floating point where possible --enable-epoll Use /dev/epoll ioqueue on Linux (experimental) --enable-shared Build shared libraries + --disable-pjsua2 Exclude pjsua2 library and application from the + build --disable-resample Disable resampling implementations --disable-sound Exclude sound (i.e. use null sound) --disable-video Disable video feature @@ -1485,6 +1538,7 @@ --disable-ilbc-codec Exclude iLBC codec in the build --enable-libsamplerate Link with libsamplerate when available. --enable-resample-dll Build libresample as shared library + --enable-speex-resample Enable Speex resample --disable-sdl Disable SDL (default: not disabled) --disable-ffmpeg Disable ffmpeg (default: not disabled) --disable-v4l2 Disable Video4Linux2 (default: not disabled) @@ -1494,6 +1548,8 @@ package and samples location using IPPROOT and IPPSAMPLES env var or with --with-ipp and --with-ipp-samples options + --disable-android-mediacodec + Exclude Android MediaCodec (default: autodetect) --disable-darwin-ssl Exclude Darwin SSL (default: autodetect) --disable-ssl Exclude SSL support the build (default: autodetect) @@ -1509,6 +1565,7 @@ --disable-bcg729 Disable bcg729 (default: not disabled) --disable-libyuv Exclude libyuv in the build --disable-libwebrtc Exclude libwebrtc in the build + --enable-libwebrtc-aec3 Build libwebrtc-aec3 that's included in PJSIP Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] @@ -1538,10 +1595,17 @@ make sure that webrtc is accessible to use (hint: use CFLAGS and LDFLAGS env var to set the include/lib paths) + --with-external-webrtc-aec3 + Use external webrtc AEC3 development files, not the + one in "third_party" directory. When this option is + set, make sure that webrtc is accessible to use + (hint: use CFLAGS and LDFLAGS env var to set the + include/lib paths) --with-external-pa Use external PortAudio development files. When this option is set, make sure that PortAudio is accessible to use (hint: use CFLAGS and LDFLAGS env var to set the include/lib paths) + --with-oboe Enable Android Oboe audio device backend. --with-sdl=DIR Specify alternate libSDL prefix --with-ffmpeg=DIR Specify alternate FFMPEG prefix --with-openh264=DIR Specify alternate OpenH264 prefix @@ -1575,7 +1639,6 @@ you have headers in a nonstandard directory CXX C++ compiler command CXXFLAGS C++ compiler flags - CPP C preprocessor Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. @@ -1596,9 +1659,9 @@ case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) - ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` + ac_dir_suffix=/`printf "%s\n" "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. - ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + ac_top_builddir_sub=`printf "%s\n" "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; @@ -1626,7 +1689,8 @@ ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix cd "$ac_dir" || { ac_status=$?; continue; } - # Check for guested configure. + # Check for configure.gnu first; this name is used for a wrapper for + # Metaconfig's "Configure" on case-insensitive file systems. if test -f "$ac_srcdir/configure.gnu"; then echo && $SHELL "$ac_srcdir/configure.gnu" --help=recursive @@ -1634,7 +1698,7 @@ echo && $SHELL "$ac_srcdir/configure" --help=recursive else - $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 + printf "%s\n" "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done @@ -1644,9 +1708,9 @@ if $ac_init_version; then cat <<\_ACEOF pjproject configure 2.x -generated by GNU Autoconf 2.69 +generated by GNU Autoconf 2.71 -Copyright (C) 2012 Free Software Foundation, Inc. +Copyright (C) 2021 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF @@ -1663,14 +1727,14 @@ ac_fn_c_try_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - rm -f conftest.$ac_objext + rm -f conftest.$ac_objext conftest.beam if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 +printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>conftest.err ac_status=$? if test -s conftest.err; then @@ -1678,14 +1742,15 @@ cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest.$ac_objext; then : + } && test -s conftest.$ac_objext +then : ac_retval=0 -else - $as_echo "$as_me: failed program was:" >&5 +else $as_nop + printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 @@ -1701,14 +1766,14 @@ ac_fn_cxx_try_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - rm -f conftest.$ac_objext + rm -f conftest.$ac_objext conftest.beam if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 +printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>conftest.err ac_status=$? if test -s conftest.err; then @@ -1716,14 +1781,15 @@ cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err - } && test -s conftest.$ac_objext; then : + } && test -s conftest.$ac_objext +then : ac_retval=0 -else - $as_echo "$as_me: failed program was:" >&5 +else $as_nop + printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 @@ -1739,14 +1805,14 @@ ac_fn_cxx_try_link () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - rm -f conftest.$ac_objext conftest$ac_exeext + rm -f conftest.$ac_objext conftest.beam conftest$ac_exeext if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 +printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_link") 2>conftest.err ac_status=$? if test -s conftest.err; then @@ -1754,17 +1820,18 @@ cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || test -x conftest$ac_exeext - }; then : + } +then : ac_retval=0 -else - $as_echo "$as_me: failed program was:" >&5 +else $as_nop + printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 @@ -1785,14 +1852,14 @@ ac_fn_c_try_link () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - rm -f conftest.$ac_objext conftest$ac_exeext + rm -f conftest.$ac_objext conftest.beam conftest$ac_exeext if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 +printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_link") 2>conftest.err ac_status=$? if test -s conftest.err; then @@ -1800,17 +1867,18 @@ cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || test -x conftest$ac_exeext - }; then : + } +then : ac_retval=0 -else - $as_echo "$as_me: failed program was:" >&5 +else $as_nop + printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 @@ -1827,8 +1895,8 @@ # ac_fn_c_try_run LINENO # ---------------------- -# Try to link conftest.$ac_ext, and return whether this succeeded. Assumes -# that executables *can* be run. +# Try to run conftest.$ac_ext, and return whether this succeeded. Assumes that +# executables *can* be run. ac_fn_c_try_run () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack @@ -1838,25 +1906,26 @@ *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 +printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 +printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; }; then : + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; } +then : ac_retval=0 -else - $as_echo "$as_me: program exited with status $ac_status" >&5 - $as_echo "$as_me: failed program was:" >&5 +else $as_nop + printf "%s\n" "$as_me: program exited with status $ac_status" >&5 + printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=$ac_status @@ -1867,43 +1936,6 @@ } # ac_fn_c_try_run -# ac_fn_c_try_cpp LINENO -# ---------------------- -# Try to preprocess conftest.$ac_ext, and return whether this succeeded. -ac_fn_c_try_cpp () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - if { { ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err - ac_status=$? - if test -s conftest.err; then - grep -v '^ *+' conftest.err >conftest.er1 - cat conftest.er1 >&5 - mv -f conftest.er1 conftest.err - fi - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } > conftest.i && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then : - ac_retval=0 -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_retval=1 -fi - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - as_fn_set_status $ac_retval - -} # ac_fn_c_try_cpp - # ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES # ------------------------------------------------------- # Tests whether HEADER exists and can be compiled using the include files in @@ -1911,128 +1943,44 @@ ac_fn_c_check_header_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -$as_echo_n "checking for $2... " >&6; } -if eval \${$3+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +printf %s "checking for $2... " >&6; } +if eval test \${$3+y} +then : + printf %s "(cached) " >&6 +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : eval "$3=yes" -else +else $as_nop eval "$3=no" fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_header_compile -# ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES -# ------------------------------------------------------- -# Tests whether HEADER exists, giving a warning if it cannot be compiled using -# the include files in INCLUDES and setting the cache variable VAR -# accordingly. -ac_fn_c_check_header_mongrel () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - if eval \${$3+:} false; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -$as_echo_n "checking for $2... " >&6; } -if eval \${$3+:} false; then : - $as_echo_n "(cached) " >&6 -fi -eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -else - # Is the header compilable? -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5 -$as_echo_n "checking $2 usability... " >&6; } -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$4 -#include <$2> -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_header_compiler=yes -else - ac_header_compiler=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5 -$as_echo "$ac_header_compiler" >&6; } - -# Is the header present? -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5 -$as_echo_n "checking $2 presence... " >&6; } -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include <$2> -_ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : - ac_header_preproc=yes -else - ac_header_preproc=no -fi -rm -f conftest.err conftest.i conftest.$ac_ext -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 -$as_echo "$ac_header_preproc" >&6; } - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #(( - yes:no: ) - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5 -$as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 -$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} - ;; - no:yes:* ) - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5 -$as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5 -$as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5 -$as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5 -$as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 -$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} - ;; -esac - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -$as_echo_n "checking for $2... " >&6; } -if eval \${$3+:} false; then : - $as_echo_n "(cached) " >&6 -else - eval "$3=\$ac_header_compiler" -fi -eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -fi - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - -} # ac_fn_c_check_header_mongrel - # ac_fn_c_check_func LINENO FUNC VAR # ---------------------------------- # Tests whether FUNC exists, setting the cache variable VAR accordingly ac_fn_c_check_func () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -$as_echo_n "checking for $2... " >&6; } -if eval \${$3+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +printf %s "checking for $2... " >&6; } +if eval test \${$3+y} +then : + printf %s "(cached) " >&6 +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Define $2 to an innocuous variant, in case declares $2. @@ -2040,16 +1988,9 @@ #define $2 innocuous_$2 /* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $2 (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif + which can conflict with char $2 (); below. */ +#include #undef $2 /* Override any GCC internal prototype to avoid an error. @@ -2067,24 +2008,25 @@ #endif int -main () +main (void) { return $2 (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : eval "$3=yes" -else +else $as_nop eval "$3=no" fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext fi eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_func @@ -2096,17 +2038,18 @@ ac_fn_c_check_type () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -$as_echo_n "checking for $2... " >&6; } -if eval \${$3+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +printf %s "checking for $2... " >&6; } +if eval test \${$3+y} +then : + printf %s "(cached) " >&6 +else $as_nop eval "$3=no" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int -main () +main (void) { if (sizeof ($2)) return 0; @@ -2114,12 +2057,13 @@ return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int -main () +main (void) { if (sizeof (($2))) return 0; @@ -2127,29 +2071,50 @@ return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : -else +else $as_nop eval "$3=yes" fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_type +ac_configure_args_raw= +for ac_arg +do + case $ac_arg in + *\'*) + ac_arg=`printf "%s\n" "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + as_fn_append ac_configure_args_raw " '$ac_arg'" +done + +case $ac_configure_args_raw in + *$as_nl*) + ac_safe_unquote= ;; + *) + ac_unsafe_z='|&;<>()$`\\"*?[ '' ' # This string ends in space, tab. + ac_unsafe_a="$ac_unsafe_z#~" + ac_safe_unquote="s/ '\\([^$ac_unsafe_a][^$ac_unsafe_z]*\\)'/ \\1/g" + ac_configure_args_raw=` printf "%s\n" "$ac_configure_args_raw" | sed "$ac_safe_unquote"`;; +esac + cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by pjproject $as_me 2.x, which was -generated by GNU Autoconf 2.69. Invocation command line was +generated by GNU Autoconf 2.71. Invocation command line was - $ $0 $@ + $ $0$ac_configure_args_raw _ACEOF exec 5>>config.log @@ -2182,8 +2147,12 @@ for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - $as_echo "PATH: $as_dir" + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + printf "%s\n" "PATH: $as_dir" done IFS=$as_save_IFS @@ -2218,7 +2187,7 @@ | -silent | --silent | --silen | --sile | --sil) continue ;; *\'*) - ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + ac_arg=`printf "%s\n" "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; @@ -2253,11 +2222,13 @@ # WARNING: Use '\'' to represent an apostrophe within the trap. # WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. trap 'exit_status=$? + # Sanitize IFS. + IFS=" "" $as_nl" # Save into config.log some information that might help in debugging. { echo - $as_echo "## ---------------- ## + printf "%s\n" "## ---------------- ## ## Cache variables. ## ## ---------------- ##" echo @@ -2268,8 +2239,8 @@ case $ac_val in #( *${as_nl}*) case $ac_var in #( - *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 -$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + *_cv_*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 +printf "%s\n" "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( @@ -2293,7 +2264,7 @@ ) echo - $as_echo "## ----------------- ## + printf "%s\n" "## ----------------- ## ## Output variables. ## ## ----------------- ##" echo @@ -2301,14 +2272,14 @@ do eval ac_val=\$$ac_var case $ac_val in - *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + *\'\''*) ac_val=`printf "%s\n" "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac - $as_echo "$ac_var='\''$ac_val'\''" + printf "%s\n" "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then - $as_echo "## ------------------- ## + printf "%s\n" "## ------------------- ## ## File substitutions. ## ## ------------------- ##" echo @@ -2316,15 +2287,15 @@ do eval ac_val=\$$ac_var case $ac_val in - *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + *\'\''*) ac_val=`printf "%s\n" "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac - $as_echo "$ac_var='\''$ac_val'\''" + printf "%s\n" "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then - $as_echo "## ----------- ## + printf "%s\n" "## ----------- ## ## confdefs.h. ## ## ----------- ##" echo @@ -2332,8 +2303,8 @@ echo fi test "$ac_signal" != 0 && - $as_echo "$as_me: caught signal $ac_signal" - $as_echo "$as_me: exit $exit_status" + printf "%s\n" "$as_me: caught signal $ac_signal" + printf "%s\n" "$as_me: exit $exit_status" } >&5 rm -f core *.core core.conftest.* && rm -f -r conftest* confdefs* conf$$* $ac_clean_files && @@ -2347,63 +2318,48 @@ # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -f -r conftest* confdefs.h -$as_echo "/* confdefs.h */" > confdefs.h +printf "%s\n" "/* confdefs.h */" > confdefs.h # Predefined preprocessor variables. -cat >>confdefs.h <<_ACEOF -#define PACKAGE_NAME "$PACKAGE_NAME" -_ACEOF +printf "%s\n" "#define PACKAGE_NAME \"$PACKAGE_NAME\"" >>confdefs.h -cat >>confdefs.h <<_ACEOF -#define PACKAGE_TARNAME "$PACKAGE_TARNAME" -_ACEOF +printf "%s\n" "#define PACKAGE_TARNAME \"$PACKAGE_TARNAME\"" >>confdefs.h -cat >>confdefs.h <<_ACEOF -#define PACKAGE_VERSION "$PACKAGE_VERSION" -_ACEOF +printf "%s\n" "#define PACKAGE_VERSION \"$PACKAGE_VERSION\"" >>confdefs.h -cat >>confdefs.h <<_ACEOF -#define PACKAGE_STRING "$PACKAGE_STRING" -_ACEOF +printf "%s\n" "#define PACKAGE_STRING \"$PACKAGE_STRING\"" >>confdefs.h -cat >>confdefs.h <<_ACEOF -#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" -_ACEOF +printf "%s\n" "#define PACKAGE_BUGREPORT \"$PACKAGE_BUGREPORT\"" >>confdefs.h -cat >>confdefs.h <<_ACEOF -#define PACKAGE_URL "$PACKAGE_URL" -_ACEOF +printf "%s\n" "#define PACKAGE_URL \"$PACKAGE_URL\"" >>confdefs.h # Let the site file select an alternate cache file if it wants to. # Prefer an explicitly selected file to automatically selected ones. -ac_site_file1=NONE -ac_site_file2=NONE if test -n "$CONFIG_SITE"; then - # We do not want a PATH search for config.site. - case $CONFIG_SITE in #(( - -*) ac_site_file1=./$CONFIG_SITE;; - */*) ac_site_file1=$CONFIG_SITE;; - *) ac_site_file1=./$CONFIG_SITE;; - esac + ac_site_files="$CONFIG_SITE" elif test "x$prefix" != xNONE; then - ac_site_file1=$prefix/share/config.site - ac_site_file2=$prefix/etc/config.site + ac_site_files="$prefix/share/config.site $prefix/etc/config.site" else - ac_site_file1=$ac_default_prefix/share/config.site - ac_site_file2=$ac_default_prefix/etc/config.site + ac_site_files="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" fi -for ac_site_file in "$ac_site_file1" "$ac_site_file2" + +for ac_site_file in $ac_site_files do - test "x$ac_site_file" = xNONE && continue - if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 -$as_echo "$as_me: loading site script $ac_site_file" >&6;} + case $ac_site_file in #( + */*) : + ;; #( + *) : + ac_site_file=./$ac_site_file ;; +esac + if test -f "$ac_site_file" && test -r "$ac_site_file"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 +printf "%s\n" "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" \ - || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + || { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "failed to load site script $ac_site_file See \`config.log' for more details" "$LINENO" 5; } fi @@ -2413,139 +2369,746 @@ # Some versions of bash will fail to source /dev/null (special files # actually), so we avoid doing that. DJGPP emulates it as a regular file. if test /dev/null != "$cache_file" && test -f "$cache_file"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 -$as_echo "$as_me: loading cache $cache_file" >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 +printf "%s\n" "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else - { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 -$as_echo "$as_me: creating cache $cache_file" >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 +printf "%s\n" "$as_me: creating cache $cache_file" >&6;} >$cache_file fi -# Check that the precious variables saved in the cache have kept the same -# value. -ac_cache_corrupted=false -for ac_var in $ac_precious_vars; do - eval ac_old_set=\$ac_cv_env_${ac_var}_set - eval ac_new_set=\$ac_env_${ac_var}_set - eval ac_old_val=\$ac_cv_env_${ac_var}_value - eval ac_new_val=\$ac_env_${ac_var}_value - case $ac_old_set,$ac_new_set in - set,) - { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 -$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} - ac_cache_corrupted=: ;; - ,set) - { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 -$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} - ac_cache_corrupted=: ;; - ,);; - *) - if test "x$ac_old_val" != "x$ac_new_val"; then - # differences in whitespace do not lead to failure. - ac_old_val_w=`echo x $ac_old_val` - ac_new_val_w=`echo x $ac_new_val` - if test "$ac_old_val_w" != "$ac_new_val_w"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 -$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} - ac_cache_corrupted=: - else - { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 -$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} - eval $ac_var=\$ac_old_val - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 -$as_echo "$as_me: former value: \`$ac_old_val'" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 -$as_echo "$as_me: current value: \`$ac_new_val'" >&2;} - fi;; - esac - # Pass precious variables to config.status. - if test "$ac_new_set" = set; then - case $ac_new_val in - *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; - *) ac_arg=$ac_var=$ac_new_val ;; - esac - case " $ac_configure_args " in - *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. - *) as_fn_append ac_configure_args " '$ac_arg'" ;; - esac - fi -done -if $ac_cache_corrupted; then - { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 -$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} - as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 -fi -## -------------------- ## -## Main body of script. ## -## -------------------- ## +# Test code for whether the C compiler supports C89 (global declarations) +ac_c_conftest_c89_globals=' +/* Does the compiler advertise C89 conformance? + Do not test the value of __STDC__, because some compilers set it to 0 + while being otherwise adequately conformant. */ +#if !defined __STDC__ +# error "Compiler does not advertise C89 conformance" +#endif -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu +#include +#include +struct stat; +/* Most of the following tests are stolen from RCS 5.7 src/conf.sh. */ +struct buf { int x; }; +struct buf * (*rcsopen) (struct buf *, struct stat *, int); +static char *e (p, i) + char **p; + int i; +{ + return p[i]; +} +static char *f (char * (*g) (char **, int), char **p, ...) +{ + char *s; + va_list v; + va_start (v,p); + s = g (p, va_arg (v,int)); + va_end (v); + return s; +} +/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has + function prototypes and stuff, but not \xHH hex character constants. + These do not provoke an error unfortunately, instead are silently treated + as an "x". The following induces an error, until -std is added to get + proper ANSI mode. Curiously \x00 != x always comes out true, for an + array size at least. It is necessary to write \x00 == 0 to get something + that is true only with -std. */ +int osf4_cc_array ['\''\x00'\'' == 0 ? 1 : -1]; +/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters + inside strings and character constants. */ +#define FOO(x) '\''x'\'' +int xlc6_cc_array[FOO(a) == '\''x'\'' ? 1 : -1]; -host_orig="$host" +int test (int i, double x); +struct s1 {int (*f) (int a);}; +struct s2 {int (*f) (double a);}; +int pairnames (int, char **, int *(*)(struct buf *, struct stat *, int), + int, int);' -ac_aux_dir= -for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do - if test -f "$ac_dir/install-sh"; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/install-sh -c" - break - elif test -f "$ac_dir/install.sh"; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/install.sh -c" - break - elif test -f "$ac_dir/shtool"; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/shtool install -c" - break - fi -done -if test -z "$ac_aux_dir"; then - as_fn_error $? "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5 -fi +# Test code for whether the C compiler supports C89 (body of main). +ac_c_conftest_c89_main=' +ok |= (argc == 0 || f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]); +' -# These three variables are undocumented and unsupported, -# and are intended to be withdrawn in a future Autoconf release. -# They can cause serious problems if a builder's source tree is in a directory -# whose full name contains unusual characters. -ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. -ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. -ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. +# Test code for whether the C compiler supports C99 (global declarations) +ac_c_conftest_c99_globals=' +// Does the compiler advertise C99 conformance? +#if !defined __STDC_VERSION__ || __STDC_VERSION__ < 199901L +# error "Compiler does not advertise C99 conformance" +#endif + +#include +extern int puts (const char *); +extern int printf (const char *, ...); +extern int dprintf (int, const char *, ...); +extern void *malloc (size_t); + +// Check varargs macros. These examples are taken from C99 6.10.3.5. +// dprintf is used instead of fprintf to avoid needing to declare +// FILE and stderr. +#define debug(...) dprintf (2, __VA_ARGS__) +#define showlist(...) puts (#__VA_ARGS__) +#define report(test,...) ((test) ? puts (#test) : printf (__VA_ARGS__)) +static void +test_varargs_macros (void) +{ + int x = 1234; + int y = 5678; + debug ("Flag"); + debug ("X = %d\n", x); + showlist (The first, second, and third items.); + report (x>y, "x is %d but y is %d", x, y); +} + +// Check long long types. +#define BIG64 18446744073709551615ull +#define BIG32 4294967295ul +#define BIG_OK (BIG64 / BIG32 == 4294967297ull && BIG64 % BIG32 == 0) +#if !BIG_OK + #error "your preprocessor is broken" +#endif +#if BIG_OK +#else + #error "your preprocessor is broken" +#endif +static long long int bignum = -9223372036854775807LL; +static unsigned long long int ubignum = BIG64; +struct incomplete_array +{ + int datasize; + double data[]; +}; -# Make sure we can run config.sub. -$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || - as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5 - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 -$as_echo_n "checking build system type... " >&6; } -if ${ac_cv_build+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_build_alias=$build_alias -test "x$ac_build_alias" = x && - ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` +struct named_init { + int number; + const wchar_t *name; + double average; +}; + +typedef const char *ccp; + +static inline int +test_restrict (ccp restrict text) +{ + // See if C++-style comments work. + // Iterate through items via the restricted pointer. + // Also check for declarations in for loops. + for (unsigned int i = 0; *(text+i) != '\''\0'\''; ++i) + continue; + return 0; +} + +// Check varargs and va_copy. +static bool +test_varargs (const char *format, ...) +{ + va_list args; + va_start (args, format); + va_list args_copy; + va_copy (args_copy, args); + + const char *str = ""; + int number = 0; + float fnumber = 0; + + while (*format) + { + switch (*format++) + { + case '\''s'\'': // string + str = va_arg (args_copy, const char *); + break; + case '\''d'\'': // int + number = va_arg (args_copy, int); + break; + case '\''f'\'': // float + fnumber = va_arg (args_copy, double); + break; + default: + break; + } + } + va_end (args_copy); + va_end (args); + + return *str && number && fnumber; +} +' + +# Test code for whether the C compiler supports C99 (body of main). +ac_c_conftest_c99_main=' + // Check bool. + _Bool success = false; + success |= (argc != 0); + + // Check restrict. + if (test_restrict ("String literal") == 0) + success = true; + char *restrict newvar = "Another string"; + + // Check varargs. + success &= test_varargs ("s, d'\'' f .", "string", 65, 34.234); + test_varargs_macros (); + + // Check flexible array members. + struct incomplete_array *ia = + malloc (sizeof (struct incomplete_array) + (sizeof (double) * 10)); + ia->datasize = 10; + for (int i = 0; i < ia->datasize; ++i) + ia->data[i] = i * 1.234; + + // Check named initializers. + struct named_init ni = { + .number = 34, + .name = L"Test wide string", + .average = 543.34343, + }; + + ni.number = 58; + + int dynamic_array[ni.number]; + dynamic_array[0] = argv[0][0]; + dynamic_array[ni.number - 1] = 543; + + // work around unused variable warnings + ok |= (!success || bignum == 0LL || ubignum == 0uLL || newvar[0] == '\''x'\'' + || dynamic_array[ni.number - 1] != 543); +' + +# Test code for whether the C compiler supports C11 (global declarations) +ac_c_conftest_c11_globals=' +// Does the compiler advertise C11 conformance? +#if !defined __STDC_VERSION__ || __STDC_VERSION__ < 201112L +# error "Compiler does not advertise C11 conformance" +#endif + +// Check _Alignas. +char _Alignas (double) aligned_as_double; +char _Alignas (0) no_special_alignment; +extern char aligned_as_int; +char _Alignas (0) _Alignas (int) aligned_as_int; + +// Check _Alignof. +enum +{ + int_alignment = _Alignof (int), + int_array_alignment = _Alignof (int[100]), + char_alignment = _Alignof (char) +}; +_Static_assert (0 < -_Alignof (int), "_Alignof is signed"); + +// Check _Noreturn. +int _Noreturn does_not_return (void) { for (;;) continue; } + +// Check _Static_assert. +struct test_static_assert +{ + int x; + _Static_assert (sizeof (int) <= sizeof (long int), + "_Static_assert does not work in struct"); + long int y; +}; + +// Check UTF-8 literals. +#define u8 syntax error! +char const utf8_literal[] = u8"happens to be ASCII" "another string"; + +// Check duplicate typedefs. +typedef long *long_ptr; +typedef long int *long_ptr; +typedef long_ptr long_ptr; + +// Anonymous structures and unions -- taken from C11 6.7.2.1 Example 1. +struct anonymous +{ + union { + struct { int i; int j; }; + struct { int k; long int l; } w; + }; + int m; +} v1; +' + +# Test code for whether the C compiler supports C11 (body of main). +ac_c_conftest_c11_main=' + _Static_assert ((offsetof (struct anonymous, i) + == offsetof (struct anonymous, w.k)), + "Anonymous union alignment botch"); + v1.i = 2; + v1.w.k = 5; + ok |= v1.i != 5; +' + +# Test code for whether the C compiler supports C11 (complete). +ac_c_conftest_c11_program="${ac_c_conftest_c89_globals} +${ac_c_conftest_c99_globals} +${ac_c_conftest_c11_globals} + +int +main (int argc, char **argv) +{ + int ok = 0; + ${ac_c_conftest_c89_main} + ${ac_c_conftest_c99_main} + ${ac_c_conftest_c11_main} + return ok; +} +" + +# Test code for whether the C compiler supports C99 (complete). +ac_c_conftest_c99_program="${ac_c_conftest_c89_globals} +${ac_c_conftest_c99_globals} + +int +main (int argc, char **argv) +{ + int ok = 0; + ${ac_c_conftest_c89_main} + ${ac_c_conftest_c99_main} + return ok; +} +" + +# Test code for whether the C compiler supports C89 (complete). +ac_c_conftest_c89_program="${ac_c_conftest_c89_globals} + +int +main (int argc, char **argv) +{ + int ok = 0; + ${ac_c_conftest_c89_main} + return ok; +} +" + +# Test code for whether the C++ compiler supports C++98 (global declarations) +ac_cxx_conftest_cxx98_globals=' +// Does the compiler advertise C++98 conformance? +#if !defined __cplusplus || __cplusplus < 199711L +# error "Compiler does not advertise C++98 conformance" +#endif + +// These inclusions are to reject old compilers that +// lack the unsuffixed header files. +#include +#include + +// and are *not* freestanding headers in C++98. +extern void assert (int); +namespace std { + extern int strcmp (const char *, const char *); +} + +// Namespaces, exceptions, and templates were all added after "C++ 2.0". +using std::exception; +using std::strcmp; + +namespace { + +void test_exception_syntax() +{ + try { + throw "test"; + } catch (const char *s) { + // Extra parentheses suppress a warning when building autoconf itself, + // due to lint rules shared with more typical C programs. + assert (!(strcmp) (s, "test")); + } +} + +template struct test_template +{ + T const val; + explicit test_template(T t) : val(t) {} + template T add(U u) { return static_cast(u) + val; } +}; + +} // anonymous namespace +' + +# Test code for whether the C++ compiler supports C++98 (body of main) +ac_cxx_conftest_cxx98_main=' + assert (argc); + assert (! argv[0]); +{ + test_exception_syntax (); + test_template tt (2.0); + assert (tt.add (4) == 6.0); + assert (true && !false); +} +' + +# Test code for whether the C++ compiler supports C++11 (global declarations) +ac_cxx_conftest_cxx11_globals=' +// Does the compiler advertise C++ 2011 conformance? +#if !defined __cplusplus || __cplusplus < 201103L +# error "Compiler does not advertise C++11 conformance" +#endif + +namespace cxx11test +{ + constexpr int get_val() { return 20; } + + struct testinit + { + int i; + double d; + }; + + class delegate + { + public: + delegate(int n) : n(n) {} + delegate(): delegate(2354) {} + + virtual int getval() { return this->n; }; + protected: + int n; + }; + + class overridden : public delegate + { + public: + overridden(int n): delegate(n) {} + virtual int getval() override final { return this->n * 2; } + }; + + class nocopy + { + public: + nocopy(int i): i(i) {} + nocopy() = default; + nocopy(const nocopy&) = delete; + nocopy & operator=(const nocopy&) = delete; + private: + int i; + }; + + // for testing lambda expressions + template Ret eval(Fn f, Ret v) + { + return f(v); + } + + // for testing variadic templates and trailing return types + template auto sum(V first) -> V + { + return first; + } + template auto sum(V first, Args... rest) -> V + { + return first + sum(rest...); + } +} +' + +# Test code for whether the C++ compiler supports C++11 (body of main) +ac_cxx_conftest_cxx11_main=' +{ + // Test auto and decltype + auto a1 = 6538; + auto a2 = 48573953.4; + auto a3 = "String literal"; + + int total = 0; + for (auto i = a3; *i; ++i) { total += *i; } + + decltype(a2) a4 = 34895.034; +} +{ + // Test constexpr + short sa[cxx11test::get_val()] = { 0 }; +} +{ + // Test initializer lists + cxx11test::testinit il = { 4323, 435234.23544 }; +} +{ + // Test range-based for + int array[] = {9, 7, 13, 15, 4, 18, 12, 10, 5, 3, + 14, 19, 17, 8, 6, 20, 16, 2, 11, 1}; + for (auto &x : array) { x += 23; } +} +{ + // Test lambda expressions + using cxx11test::eval; + assert (eval ([](int x) { return x*2; }, 21) == 42); + double d = 2.0; + assert (eval ([&](double x) { return d += x; }, 3.0) == 5.0); + assert (d == 5.0); + assert (eval ([=](double x) mutable { return d += x; }, 4.0) == 9.0); + assert (d == 5.0); +} +{ + // Test use of variadic templates + using cxx11test::sum; + auto a = sum(1); + auto b = sum(1, 2); + auto c = sum(1.0, 2.0, 3.0); +} +{ + // Test constructor delegation + cxx11test::delegate d1; + cxx11test::delegate d2(); + cxx11test::delegate d3(45); +} +{ + // Test override and final + cxx11test::overridden o1(55464); +} +{ + // Test nullptr + char *c = nullptr; +} +{ + // Test template brackets + test_template<::test_template> v(test_template(12)); +} +{ + // Unicode literals + char const *utf8 = u8"UTF-8 string \u2500"; + char16_t const *utf16 = u"UTF-8 string \u2500"; + char32_t const *utf32 = U"UTF-32 string \u2500"; +} +' + +# Test code for whether the C compiler supports C++11 (complete). +ac_cxx_conftest_cxx11_program="${ac_cxx_conftest_cxx98_globals} +${ac_cxx_conftest_cxx11_globals} + +int +main (int argc, char **argv) +{ + int ok = 0; + ${ac_cxx_conftest_cxx98_main} + ${ac_cxx_conftest_cxx11_main} + return ok; +} +" + +# Test code for whether the C compiler supports C++98 (complete). +ac_cxx_conftest_cxx98_program="${ac_cxx_conftest_cxx98_globals} +int +main (int argc, char **argv) +{ + int ok = 0; + ${ac_cxx_conftest_cxx98_main} + return ok; +} +" + +as_fn_append ac_header_c_list " stdio.h stdio_h HAVE_STDIO_H" +as_fn_append ac_header_c_list " stdlib.h stdlib_h HAVE_STDLIB_H" +as_fn_append ac_header_c_list " string.h string_h HAVE_STRING_H" +as_fn_append ac_header_c_list " inttypes.h inttypes_h HAVE_INTTYPES_H" +as_fn_append ac_header_c_list " stdint.h stdint_h HAVE_STDINT_H" +as_fn_append ac_header_c_list " strings.h strings_h HAVE_STRINGS_H" +as_fn_append ac_header_c_list " sys/stat.h sys_stat_h HAVE_SYS_STAT_H" +as_fn_append ac_header_c_list " sys/types.h sys_types_h HAVE_SYS_TYPES_H" +as_fn_append ac_header_c_list " unistd.h unistd_h HAVE_UNISTD_H" + +# Auxiliary files required by this configure script. +ac_aux_files="config.guess config.sub" + +# Locations in which to look for auxiliary files. +ac_aux_dir_candidates="${srcdir}${PATH_SEPARATOR}${srcdir}/..${PATH_SEPARATOR}${srcdir}/../.." + +# Search for a directory containing all of the required auxiliary files, +# $ac_aux_files, from the $PATH-style list $ac_aux_dir_candidates. +# If we don't find one directory that contains all the files we need, +# we report the set of missing files from the *first* directory in +# $ac_aux_dir_candidates and give up. +ac_missing_aux_files="" +ac_first_candidate=: +printf "%s\n" "$as_me:${as_lineno-$LINENO}: looking for aux files: $ac_aux_files" >&5 +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +as_found=false +for as_dir in $ac_aux_dir_candidates +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + as_found=: + + printf "%s\n" "$as_me:${as_lineno-$LINENO}: trying $as_dir" >&5 + ac_aux_dir_found=yes + ac_install_sh= + for ac_aux in $ac_aux_files + do + # As a special case, if "install-sh" is required, that requirement + # can be satisfied by any of "install-sh", "install.sh", or "shtool", + # and $ac_install_sh is set appropriately for whichever one is found. + if test x"$ac_aux" = x"install-sh" + then + if test -f "${as_dir}install-sh"; then + printf "%s\n" "$as_me:${as_lineno-$LINENO}: ${as_dir}install-sh found" >&5 + ac_install_sh="${as_dir}install-sh -c" + elif test -f "${as_dir}install.sh"; then + printf "%s\n" "$as_me:${as_lineno-$LINENO}: ${as_dir}install.sh found" >&5 + ac_install_sh="${as_dir}install.sh -c" + elif test -f "${as_dir}shtool"; then + printf "%s\n" "$as_me:${as_lineno-$LINENO}: ${as_dir}shtool found" >&5 + ac_install_sh="${as_dir}shtool install -c" + else + ac_aux_dir_found=no + if $ac_first_candidate; then + ac_missing_aux_files="${ac_missing_aux_files} install-sh" + else + break + fi + fi + else + if test -f "${as_dir}${ac_aux}"; then + printf "%s\n" "$as_me:${as_lineno-$LINENO}: ${as_dir}${ac_aux} found" >&5 + else + ac_aux_dir_found=no + if $ac_first_candidate; then + ac_missing_aux_files="${ac_missing_aux_files} ${ac_aux}" + else + break + fi + fi + fi + done + if test "$ac_aux_dir_found" = yes; then + ac_aux_dir="$as_dir" + break + fi + ac_first_candidate=false + + as_found=false +done +IFS=$as_save_IFS +if $as_found +then : + +else $as_nop + as_fn_error $? "cannot find required auxiliary files:$ac_missing_aux_files" "$LINENO" 5 +fi + + +# These three variables are undocumented and unsupported, +# and are intended to be withdrawn in a future Autoconf release. +# They can cause serious problems if a builder's source tree is in a directory +# whose full name contains unusual characters. +if test -f "${ac_aux_dir}config.guess"; then + ac_config_guess="$SHELL ${ac_aux_dir}config.guess" +fi +if test -f "${ac_aux_dir}config.sub"; then + ac_config_sub="$SHELL ${ac_aux_dir}config.sub" +fi +if test -f "$ac_aux_dir/configure"; then + ac_configure="$SHELL ${ac_aux_dir}configure" +fi + +# Check that the precious variables saved in the cache have kept the same +# value. +ac_cache_corrupted=false +for ac_var in $ac_precious_vars; do + eval ac_old_set=\$ac_cv_env_${ac_var}_set + eval ac_new_set=\$ac_env_${ac_var}_set + eval ac_old_val=\$ac_cv_env_${ac_var}_value + eval ac_new_val=\$ac_env_${ac_var}_value + case $ac_old_set,$ac_new_set in + set,) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 +printf "%s\n" "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,set) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 +printf "%s\n" "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,);; + *) + if test "x$ac_old_val" != "x$ac_new_val"; then + # differences in whitespace do not lead to failure. + ac_old_val_w=`echo x $ac_old_val` + ac_new_val_w=`echo x $ac_new_val` + if test "$ac_old_val_w" != "$ac_new_val_w"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 +printf "%s\n" "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} + ac_cache_corrupted=: + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 +printf "%s\n" "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} + eval $ac_var=\$ac_old_val + fi + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 +printf "%s\n" "$as_me: former value: \`$ac_old_val'" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 +printf "%s\n" "$as_me: current value: \`$ac_new_val'" >&2;} + fi;; + esac + # Pass precious variables to config.status. + if test "$ac_new_set" = set; then + case $ac_new_val in + *\'*) ac_arg=$ac_var=`printf "%s\n" "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; + *) ac_arg=$ac_var=$ac_new_val ;; + esac + case " $ac_configure_args " in + *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. + *) as_fn_append ac_configure_args " '$ac_arg'" ;; + esac + fi +done +if $ac_cache_corrupted; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 +printf "%s\n" "$as_me: error: changes in the environment can compromise the build" >&2;} + as_fn_error $? "run \`${MAKE-make} distclean' and/or \`rm $cache_file' + and start over" "$LINENO" 5 +fi +## -------------------- ## +## Main body of script. ## +## -------------------- ## + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + + +host_orig="$host" + + + + + # Make sure we can run config.sub. +$SHELL "${ac_aux_dir}config.sub" sun4 >/dev/null 2>&1 || + as_fn_error $? "cannot run $SHELL ${ac_aux_dir}config.sub" "$LINENO" 5 + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 +printf %s "checking build system type... " >&6; } +if test ${ac_cv_build+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_build_alias=$build_alias +test "x$ac_build_alias" = x && + ac_build_alias=`$SHELL "${ac_aux_dir}config.guess"` test "x$ac_build_alias" = x && as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5 -ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || - as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5 +ac_cv_build=`$SHELL "${ac_aux_dir}config.sub" $ac_build_alias` || + as_fn_error $? "$SHELL ${ac_aux_dir}config.sub $ac_build_alias failed" "$LINENO" 5 fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 -$as_echo "$ac_cv_build" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 +printf "%s\n" "$ac_cv_build" >&6; } case $ac_cv_build in *-*-*) ;; *) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;; @@ -2564,21 +3127,22 @@ case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 -$as_echo_n "checking host system type... " >&6; } -if ${ac_cv_host+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 +printf %s "checking host system type... " >&6; } +if test ${ac_cv_host+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test "x$host_alias" = x; then ac_cv_host=$ac_cv_build else - ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || - as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5 + ac_cv_host=`$SHELL "${ac_aux_dir}config.sub" $host_alias` || + as_fn_error $? "$SHELL ${ac_aux_dir}config.sub $host_alias failed" "$LINENO" 5 fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 -$as_echo "$ac_cv_host" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 +printf "%s\n" "$ac_cv_host" >&6; } case $ac_cv_host in *-*-*) ;; *) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;; @@ -2597,21 +3161,22 @@ case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking target system type" >&5 -$as_echo_n "checking target system type... " >&6; } -if ${ac_cv_target+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking target system type" >&5 +printf %s "checking target system type... " >&6; } +if test ${ac_cv_target+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test "x$target_alias" = x; then ac_cv_target=$ac_cv_host else - ac_cv_target=`$SHELL "$ac_aux_dir/config.sub" $target_alias` || - as_fn_error $? "$SHELL $ac_aux_dir/config.sub $target_alias failed" "$LINENO" 5 + ac_cv_target=`$SHELL "${ac_aux_dir}config.sub" $target_alias` || + as_fn_error $? "$SHELL ${ac_aux_dir}config.sub $target_alias failed" "$LINENO" 5 fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_target" >&5 -$as_echo "$ac_cv_target" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_target" >&5 +printf "%s\n" "$ac_cv_target" >&6; } case $ac_cv_target in *-*-*) ;; *) as_fn_error $? "invalid value of canonical target" "$LINENO" 5;; @@ -2646,6 +3211,15 @@ CFLAGS="-O2" fi + + + + + + + + + ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -2654,11 +3228,12 @@ if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else @@ -2666,11 +3241,15 @@ for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}gcc" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -2681,11 +3260,11 @@ fi CC=$ac_cv_prog_CC if test -n "$CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -$as_echo "$CC" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +printf "%s\n" "$CC" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -2694,11 +3273,12 @@ ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else @@ -2706,11 +3286,15 @@ for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="gcc" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -2721,11 +3305,11 @@ fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 -$as_echo "$ac_ct_CC" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +printf "%s\n" "$ac_ct_CC" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi if test "x$ac_ct_CC" = x; then @@ -2733,8 +3317,8 @@ else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC @@ -2747,11 +3331,12 @@ if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else @@ -2759,11 +3344,15 @@ for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}cc" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -2774,11 +3363,11 @@ fi CC=$ac_cv_prog_CC if test -n "$CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -$as_echo "$CC" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +printf "%s\n" "$CC" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -2787,11 +3376,12 @@ if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else @@ -2800,15 +3390,19 @@ for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + if test "$as_dir$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -2824,18 +3418,18 @@ # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift - ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" + ac_cv_prog_CC="$as_dir$ac_word${1+' '}$@" fi fi fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -$as_echo "$CC" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +printf "%s\n" "$CC" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -2846,11 +3440,12 @@ do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else @@ -2858,11 +3453,15 @@ for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -2873,11 +3472,11 @@ fi CC=$ac_cv_prog_CC if test -n "$CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -$as_echo "$CC" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +printf "%s\n" "$CC" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -2890,11 +3489,12 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else @@ -2902,11 +3502,15 @@ for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -2917,11 +3521,11 @@ fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 -$as_echo "$ac_ct_CC" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +printf "%s\n" "$ac_ct_CC" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -2933,34 +3537,138 @@ else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +fi + +fi +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}clang", so it can be a program name with args. +set dummy ${ac_tool_prefix}clang; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="${ac_tool_prefix}clang" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +printf "%s\n" "$CC" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_CC"; then + ac_ct_CC=$CC + # Extract the first word of "clang", so it can be a program name with args. +set dummy clang; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="clang" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +printf "%s\n" "$ac_ct_CC" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi +else + CC="$ac_cv_prog_CC" fi fi -test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +test -z "$CC" && { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "no acceptable C compiler found in \$PATH See \`config.log' for more details" "$LINENO" 5; } # Provide some information about the compiler. -$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 +printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 set X $ac_compile ac_compiler=$2 -for ac_option in --version -v -V -qversion; do +for ac_option in --version -v -V -qversion -version; do { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 +printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then @@ -2970,7 +3678,7 @@ cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done @@ -2978,7 +3686,7 @@ /* end confdefs.h. */ int -main () +main (void) { ; @@ -2990,9 +3698,9 @@ # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 -$as_echo_n "checking whether the C compiler works... " >&6; } -ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 +printf %s "checking whether the C compiler works... " >&6; } +ac_link_default=`printf "%s\n" "$ac_link" | sed 's/ -o *conftest[^ ]*//'` # The possible output files: ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" @@ -3013,11 +3721,12 @@ *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 +printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_link_default") 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then : + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +then : # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. # So ignore a value of `no', otherwise this would lead to `EXEEXT = no' # in a Makefile. We should not override ac_cv_exeext if it was cached, @@ -3034,7 +3743,7 @@ # certainly right. break;; *.* ) - if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; + if test ${ac_cv_exeext+y} && test "$ac_cv_exeext" != no; then :; else ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` fi @@ -3050,44 +3759,46 @@ done test "$ac_cv_exeext" = no && ac_cv_exeext= -else +else $as_nop ac_file='' fi -if test -z "$ac_file"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -$as_echo "$as_me: failed program was:" >&5 +if test -z "$ac_file" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "C compiler cannot create executables See \`config.log' for more details" "$LINENO" 5; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 -$as_echo_n "checking for C compiler default output file name... " >&6; } -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 -$as_echo "$ac_file" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 +printf %s "checking for C compiler default output file name... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 +printf "%s\n" "$ac_file" >&6; } ac_exeext=$ac_cv_exeext rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 -$as_echo_n "checking for suffix of executables... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 +printf %s "checking for suffix of executables... " >&6; } if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 +printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then : + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +then : # If both `conftest.exe' and `conftest' are `present' (well, observable) # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will # work properly (i.e., refer to `conftest.exe'), while it won't with @@ -3101,15 +3812,15 @@ * ) break;; esac done -else - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +else $as_nop + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of executables: cannot compile and link See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest conftest$ac_cv_exeext -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 -$as_echo "$ac_cv_exeext" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 +printf "%s\n" "$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext @@ -3118,7 +3829,7 @@ /* end confdefs.h. */ #include int -main () +main (void) { FILE *f = fopen ("conftest.out", "w"); return ferror (f) || fclose (f) != 0; @@ -3130,8 +3841,8 @@ ac_clean_files="$ac_clean_files conftest.out" # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 -$as_echo_n "checking whether we are cross compiling... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 +printf %s "checking whether we are cross compiling... " >&6; } if test "$cross_compiling" != yes; then { { ac_try="$ac_link" case "(($ac_try" in @@ -3139,10 +3850,10 @@ *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 +printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if { ac_try='./conftest$ac_cv_exeext' { { case "(($ac_try" in @@ -3150,39 +3861,40 @@ *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 +printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "cannot run C compiled programs. + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details" "$LINENO" 5; } fi fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 -$as_echo "$cross_compiling" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 +printf "%s\n" "$cross_compiling" >&6; } rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out ac_clean_files=$ac_clean_files_save -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 -$as_echo_n "checking for suffix of object files... " >&6; } -if ${ac_cv_objext+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 +printf %s "checking for suffix of object files... " >&6; } +if test ${ac_cv_objext+y} +then : + printf %s "(cached) " >&6 +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int -main () +main (void) { ; @@ -3196,11 +3908,12 @@ *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 +printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then : + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +then : for ac_file in conftest.o conftest.obj conftest.*; do test -f "$ac_file" || continue; case $ac_file in @@ -3209,31 +3922,32 @@ break;; esac done -else - $as_echo "$as_me: failed program was:" >&5 +else $as_nop + printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of object files: cannot compile See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 -$as_echo "$ac_cv_objext" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 +printf "%s\n" "$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 -$as_echo_n "checking whether we are using the GNU C compiler... " >&6; } -if ${ac_cv_c_compiler_gnu+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports GNU C" >&5 +printf %s "checking whether the compiler supports GNU C... " >&6; } +if test ${ac_cv_c_compiler_gnu+y} +then : + printf %s "(cached) " >&6 +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int -main () +main (void) { #ifndef __GNUC__ choke me @@ -3243,29 +3957,33 @@ return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : ac_compiler_gnu=yes -else +else $as_nop ac_compiler_gnu=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 -$as_echo "$ac_cv_c_compiler_gnu" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 +printf "%s\n" "$ac_cv_c_compiler_gnu" >&6; } +ac_compiler_gnu=$ac_cv_c_compiler_gnu + if test $ac_compiler_gnu = yes; then GCC=yes else GCC= fi -ac_test_CFLAGS=${CFLAGS+set} +ac_test_CFLAGS=${CFLAGS+y} ac_save_CFLAGS=$CFLAGS -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 -$as_echo_n "checking whether $CC accepts -g... " >&6; } -if ${ac_cv_prog_cc_g+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 +printf %s "checking whether $CC accepts -g... " >&6; } +if test ${ac_cv_prog_cc_g+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no @@ -3274,57 +3992,60 @@ /* end confdefs.h. */ int -main () +main (void) { ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : ac_cv_prog_cc_g=yes -else +else $as_nop CFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int -main () +main (void) { ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : -else +else $as_nop ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int -main () +main (void) { ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : ac_cv_prog_cc_g=yes fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 -$as_echo "$ac_cv_prog_cc_g" >&6; } -if test "$ac_test_CFLAGS" = set; then +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 +printf "%s\n" "$ac_cv_prog_cc_g" >&6; } +if test $ac_test_CFLAGS; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then @@ -3339,94 +4060,144 @@ CFLAGS= fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 -$as_echo_n "checking for $CC option to accept ISO C89... " >&6; } -if ${ac_cv_prog_cc_c89+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_cv_prog_cc_c89=no +ac_prog_cc_stdc=no +if test x$ac_prog_cc_stdc = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C11 features" >&5 +printf %s "checking for $CC option to enable C11 features... " >&6; } +if test ${ac_cv_prog_cc_c11+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_cv_prog_cc_c11=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#include -#include -struct stat; -/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ -struct buf { int x; }; -FILE * (*rcsopen) (struct buf *, struct stat *, int); -static char *e (p, i) - char **p; - int i; -{ - return p[i]; -} -static char *f (char * (*g) (char **, int), char **p, ...) -{ - char *s; - va_list v; - va_start (v,p); - s = g (p, va_arg (v,int)); - va_end (v); - return s; -} - -/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has - function prototypes and stuff, but not '\xHH' hex character constants. - These don't provoke an error unfortunately, instead are silently treated - as 'x'. The following induces an error, until -std is added to get - proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an - array size at least. It's necessary to write '\x00'==0 to get something - that's true only with -std. */ -int osf4_cc_array ['\x00' == 0 ? 1 : -1]; +$ac_c_conftest_c11_program +_ACEOF +for ac_arg in '' -std=gnu11 +do + CC="$ac_save_CC $ac_arg" + if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_prog_cc_c11=$ac_arg +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam + test "x$ac_cv_prog_cc_c11" != "xno" && break +done +rm -f conftest.$ac_ext +CC=$ac_save_CC +fi -/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters - inside strings and character constants. */ -#define FOO(x) 'x' -int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; +if test "x$ac_cv_prog_cc_c11" = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +printf "%s\n" "unsupported" >&6; } +else $as_nop + if test "x$ac_cv_prog_cc_c11" = x +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +printf "%s\n" "none needed" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c11" >&5 +printf "%s\n" "$ac_cv_prog_cc_c11" >&6; } + CC="$CC $ac_cv_prog_cc_c11" +fi + ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c11 + ac_prog_cc_stdc=c11 +fi +fi +if test x$ac_prog_cc_stdc = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C99 features" >&5 +printf %s "checking for $CC option to enable C99 features... " >&6; } +if test ${ac_cv_prog_cc_c99+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_cv_prog_cc_c99=no +ac_save_CC=$CC +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_c_conftest_c99_program +_ACEOF +for ac_arg in '' -std=gnu99 -std=c99 -c99 -qlanglvl=extc1x -qlanglvl=extc99 -AC99 -D_STDC_C99= +do + CC="$ac_save_CC $ac_arg" + if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_prog_cc_c99=$ac_arg +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam + test "x$ac_cv_prog_cc_c99" != "xno" && break +done +rm -f conftest.$ac_ext +CC=$ac_save_CC +fi -int test (int i, double x); -struct s1 {int (*f) (int a);}; -struct s2 {int (*f) (double a);}; -int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); -int argc; -char **argv; -int -main () -{ -return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; - ; - return 0; -} +if test "x$ac_cv_prog_cc_c99" = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +printf "%s\n" "unsupported" >&6; } +else $as_nop + if test "x$ac_cv_prog_cc_c99" = x +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +printf "%s\n" "none needed" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c99" >&5 +printf "%s\n" "$ac_cv_prog_cc_c99" >&6; } + CC="$CC $ac_cv_prog_cc_c99" +fi + ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c99 + ac_prog_cc_stdc=c99 +fi +fi +if test x$ac_prog_cc_stdc = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C89 features" >&5 +printf %s "checking for $CC option to enable C89 features... " >&6; } +if test ${ac_cv_prog_cc_c89+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_cv_prog_cc_c89=no +ac_save_CC=$CC +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_c_conftest_c89_program _ACEOF -for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ - -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" +for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" - if ac_fn_c_try_compile "$LINENO"; then : + if ac_fn_c_try_compile "$LINENO" +then : ac_cv_prog_cc_c89=$ac_arg fi -rm -f core conftest.err conftest.$ac_objext +rm -f core conftest.err conftest.$ac_objext conftest.beam test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC - fi -# AC_CACHE_VAL -case "x$ac_cv_prog_cc_c89" in - x) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 -$as_echo "none needed" >&6; } ;; - xno) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 -$as_echo "unsupported" >&6; } ;; - *) - CC="$CC $ac_cv_prog_cc_c89" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 -$as_echo "$ac_cv_prog_cc_c89" >&6; } ;; -esac -if test "x$ac_cv_prog_cc_c89" != xno; then : +if test "x$ac_cv_prog_cc_c89" = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +printf "%s\n" "unsupported" >&6; } +else $as_nop + if test "x$ac_cv_prog_cc_c89" = x +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +printf "%s\n" "none needed" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 +printf "%s\n" "$ac_cv_prog_cc_c89" >&6; } + CC="$CC $ac_cv_prog_cc_c89" +fi + ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c89 + ac_prog_cc_stdc=c89 +fi fi ac_ext=c @@ -3435,6 +4206,12 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu + + + + + + ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -3445,15 +4222,16 @@ CXX=$CCC else if test -n "$ac_tool_prefix"; then - for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC + for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC clang++ do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CXX+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_CXX+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$CXX"; then ac_cv_prog_CXX="$CXX" # Let the user override the test. else @@ -3461,11 +4239,15 @@ for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_CXX="$ac_tool_prefix$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -3476,11 +4258,11 @@ fi CXX=$ac_cv_prog_CXX if test -n "$CXX"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXX" >&5 -$as_echo "$CXX" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CXX" >&5 +printf "%s\n" "$CXX" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -3489,15 +4271,16 @@ fi if test -z "$CXX"; then ac_ct_CXX=$CXX - for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC + for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC clang++ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_CXX+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_CXX+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$ac_ct_CXX"; then ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test. else @@ -3505,11 +4288,15 @@ for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CXX="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -3520,11 +4307,11 @@ fi ac_ct_CXX=$ac_cv_prog_ac_ct_CXX if test -n "$ac_ct_CXX"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CXX" >&5 -$as_echo "$ac_ct_CXX" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CXX" >&5 +printf "%s\n" "$ac_ct_CXX" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -3536,8 +4323,8 @@ else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CXX=$ac_ct_CXX @@ -3547,7 +4334,7 @@ fi fi # Provide some information about the compiler. -$as_echo "$as_me:${as_lineno-$LINENO}: checking for C++ compiler version" >&5 +printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C++ compiler version" >&5 set X $ac_compile ac_compiler=$2 for ac_option in --version -v -V -qversion; do @@ -3557,7 +4344,7 @@ *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 +printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then @@ -3567,20 +4354,21 @@ cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C++ compiler" >&5 -$as_echo_n "checking whether we are using the GNU C++ compiler... " >&6; } -if ${ac_cv_cxx_compiler_gnu+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports GNU C++" >&5 +printf %s "checking whether the compiler supports GNU C++... " >&6; } +if test ${ac_cv_cxx_compiler_gnu+y} +then : + printf %s "(cached) " >&6 +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int -main () +main (void) { #ifndef __GNUC__ choke me @@ -3590,29 +4378,33 @@ return 0; } _ACEOF -if ac_fn_cxx_try_compile "$LINENO"; then : +if ac_fn_cxx_try_compile "$LINENO" +then : ac_compiler_gnu=yes -else +else $as_nop ac_compiler_gnu=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ac_cv_cxx_compiler_gnu=$ac_compiler_gnu fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cxx_compiler_gnu" >&5 -$as_echo "$ac_cv_cxx_compiler_gnu" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cxx_compiler_gnu" >&5 +printf "%s\n" "$ac_cv_cxx_compiler_gnu" >&6; } +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + if test $ac_compiler_gnu = yes; then GXX=yes else GXX= fi -ac_test_CXXFLAGS=${CXXFLAGS+set} +ac_test_CXXFLAGS=${CXXFLAGS+y} ac_save_CXXFLAGS=$CXXFLAGS -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX accepts -g" >&5 -$as_echo_n "checking whether $CXX accepts -g... " >&6; } -if ${ac_cv_prog_cxx_g+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CXX accepts -g" >&5 +printf %s "checking whether $CXX accepts -g... " >&6; } +if test ${ac_cv_prog_cxx_g+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_save_cxx_werror_flag=$ac_cxx_werror_flag ac_cxx_werror_flag=yes ac_cv_prog_cxx_g=no @@ -3621,57 +4413,60 @@ /* end confdefs.h. */ int -main () +main (void) { ; return 0; } _ACEOF -if ac_fn_cxx_try_compile "$LINENO"; then : +if ac_fn_cxx_try_compile "$LINENO" +then : ac_cv_prog_cxx_g=yes -else +else $as_nop CXXFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int -main () +main (void) { ; return 0; } _ACEOF -if ac_fn_cxx_try_compile "$LINENO"; then : +if ac_fn_cxx_try_compile "$LINENO" +then : -else +else $as_nop ac_cxx_werror_flag=$ac_save_cxx_werror_flag CXXFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int -main () +main (void) { ; return 0; } _ACEOF -if ac_fn_cxx_try_compile "$LINENO"; then : +if ac_fn_cxx_try_compile "$LINENO" +then : ac_cv_prog_cxx_g=yes fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ac_cxx_werror_flag=$ac_save_cxx_werror_flag fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_g" >&5 -$as_echo "$ac_cv_prog_cxx_g" >&6; } -if test "$ac_test_CXXFLAGS" = set; then +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_g" >&5 +printf "%s\n" "$ac_cv_prog_cxx_g" >&6; } +if test $ac_test_CXXFLAGS; then CXXFLAGS=$ac_save_CXXFLAGS elif test $ac_cv_prog_cxx_g = yes; then if test "$GXX" = yes; then @@ -3686,6 +4481,100 @@ CXXFLAGS= fi fi +ac_prog_cxx_stdcxx=no +if test x$ac_prog_cxx_stdcxx = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CXX option to enable C++11 features" >&5 +printf %s "checking for $CXX option to enable C++11 features... " >&6; } +if test ${ac_cv_prog_cxx_11+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_cv_prog_cxx_11=no +ac_save_CXX=$CXX +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_cxx_conftest_cxx11_program +_ACEOF +for ac_arg in '' -std=gnu++11 -std=gnu++0x -std=c++11 -std=c++0x -qlanglvl=extended0x -AA +do + CXX="$ac_save_CXX $ac_arg" + if ac_fn_cxx_try_compile "$LINENO" +then : + ac_cv_prog_cxx_cxx11=$ac_arg +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam + test "x$ac_cv_prog_cxx_cxx11" != "xno" && break +done +rm -f conftest.$ac_ext +CXX=$ac_save_CXX +fi + +if test "x$ac_cv_prog_cxx_cxx11" = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +printf "%s\n" "unsupported" >&6; } +else $as_nop + if test "x$ac_cv_prog_cxx_cxx11" = x +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +printf "%s\n" "none needed" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_cxx11" >&5 +printf "%s\n" "$ac_cv_prog_cxx_cxx11" >&6; } + CXX="$CXX $ac_cv_prog_cxx_cxx11" +fi + ac_cv_prog_cxx_stdcxx=$ac_cv_prog_cxx_cxx11 + ac_prog_cxx_stdcxx=cxx11 +fi +fi +if test x$ac_prog_cxx_stdcxx = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CXX option to enable C++98 features" >&5 +printf %s "checking for $CXX option to enable C++98 features... " >&6; } +if test ${ac_cv_prog_cxx_98+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_cv_prog_cxx_98=no +ac_save_CXX=$CXX +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_cxx_conftest_cxx98_program +_ACEOF +for ac_arg in '' -std=gnu++98 -std=c++98 -qlanglvl=extended -AA +do + CXX="$ac_save_CXX $ac_arg" + if ac_fn_cxx_try_compile "$LINENO" +then : + ac_cv_prog_cxx_cxx98=$ac_arg +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam + test "x$ac_cv_prog_cxx_cxx98" != "xno" && break +done +rm -f conftest.$ac_ext +CXX=$ac_save_CXX +fi + +if test "x$ac_cv_prog_cxx_cxx98" = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +printf "%s\n" "unsupported" >&6; } +else $as_nop + if test "x$ac_cv_prog_cxx_cxx98" = x +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +printf "%s\n" "none needed" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_cxx98" >&5 +printf "%s\n" "$ac_cv_prog_cxx_cxx98" >&6; } + CXX="$CXX $ac_cv_prog_cxx_cxx98" +fi + ac_cv_prog_cxx_stdcxx=$ac_cv_prog_cxx_cxx98 + ac_prog_cxx_stdcxx=cxx98 +fi +fi + ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -3710,19 +4599,20 @@ /* end confdefs.h. */ int -main () +main (void) { ; return 0; } _ACEOF -if ac_fn_cxx_try_link "$LINENO"; then : +if ac_fn_cxx_try_link "$LINENO" +then : -else +else $as_nop as_fn_error $? "C++ compiler does not work" "$LINENO" 5 fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext ac_ext=c ac_cpp='$CPP $CPPFLAGS' @@ -3734,11 +4624,12 @@ if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ac_tool_prefix}ranlib; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_RANLIB+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_RANLIB+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$RANLIB"; then ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. else @@ -3746,11 +4637,15 @@ for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -3761,11 +4656,11 @@ fi RANLIB=$ac_cv_prog_RANLIB if test -n "$RANLIB"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 -$as_echo "$RANLIB" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 +printf "%s\n" "$RANLIB" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -3774,11 +4669,12 @@ ac_ct_RANLIB=$RANLIB # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_RANLIB+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_RANLIB+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$ac_ct_RANLIB"; then ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. else @@ -3786,11 +4682,15 @@ for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_RANLIB="ranlib" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -3801,11 +4701,11 @@ fi ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB if test -n "$ac_ct_RANLIB"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 -$as_echo "$ac_ct_RANLIB" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 +printf "%s\n" "$ac_ct_RANLIB" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi if test "x$ac_ct_RANLIB" = x; then @@ -3813,8 +4713,8 @@ else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac RANLIB=$ac_ct_RANLIB @@ -3828,11 +4728,12 @@ do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_AR+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_AR+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$AR"; then ac_cv_prog_AR="$AR" # Let the user override the test. else @@ -3840,11 +4741,15 @@ for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_AR="$ac_tool_prefix$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -3855,11 +4760,11 @@ fi AR=$ac_cv_prog_AR if test -n "$AR"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 -$as_echo "$AR" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 +printf "%s\n" "$AR" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -3872,11 +4777,12 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_AR+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_AR+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$ac_ct_AR"; then ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. else @@ -3884,11 +4790,15 @@ for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_AR="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -3899,11 +4809,11 @@ fi ac_ct_AR=$ac_cv_prog_ac_ct_AR if test -n "$ac_ct_AR"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 -$as_echo "$ac_ct_AR" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 +printf "%s\n" "$ac_ct_AR" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -3915,8 +4825,8 @@ else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac AR=$ac_ct_AR @@ -3952,6 +4862,7 @@ + case $host in *mingw* | *cygw* | *win32* | *w32* ) if pwd -W 2&> /dev/null; then @@ -3987,11 +4898,12 @@ fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_create in -lpthread" >&5 -$as_echo_n "checking for pthread_create in -lpthread... " >&6; } -if ${ac_cv_lib_pthread_pthread_create+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for pthread_create in -lpthread" >&5 +printf %s "checking for pthread_create in -lpthread... " >&6; } +if test ${ac_cv_lib_pthread_pthread_create+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lpthread $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -4000,43 +4912,41 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char pthread_create (); int -main () +main (void) { return pthread_create (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_pthread_pthread_create=yes -else +else $as_nop ac_cv_lib_pthread_pthread_create=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_pthread_create" >&5 -$as_echo "$ac_cv_lib_pthread_pthread_create" >&6; } -if test "x$ac_cv_lib_pthread_pthread_create" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_LIBPTHREAD 1 -_ACEOF +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_pthread_create" >&5 +printf "%s\n" "$ac_cv_lib_pthread_pthread_create" >&6; } +if test "x$ac_cv_lib_pthread_pthread_create" = xyes +then : + printf "%s\n" "#define HAVE_LIBPTHREAD 1" >>confdefs.h LIBS="-lpthread $LIBS" fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for puts in -lwsock32" >&5 -$as_echo_n "checking for puts in -lwsock32... " >&6; } -if ${ac_cv_lib_wsock32_puts+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for puts in -lwsock32" >&5 +printf %s "checking for puts in -lwsock32... " >&6; } +if test ${ac_cv_lib_wsock32_puts+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lwsock32 $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -4045,43 +4955,41 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char puts (); int -main () +main (void) { return puts (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_wsock32_puts=yes -else +else $as_nop ac_cv_lib_wsock32_puts=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_wsock32_puts" >&5 -$as_echo "$ac_cv_lib_wsock32_puts" >&6; } -if test "x$ac_cv_lib_wsock32_puts" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_LIBWSOCK32 1 -_ACEOF +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_wsock32_puts" >&5 +printf "%s\n" "$ac_cv_lib_wsock32_puts" >&6; } +if test "x$ac_cv_lib_wsock32_puts" = xyes +then : + printf "%s\n" "#define HAVE_LIBWSOCK32 1" >>confdefs.h LIBS="-lwsock32 $LIBS" fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for puts in -lws2_32" >&5 -$as_echo_n "checking for puts in -lws2_32... " >&6; } -if ${ac_cv_lib_ws2_32_puts+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for puts in -lws2_32" >&5 +printf %s "checking for puts in -lws2_32... " >&6; } +if test ${ac_cv_lib_ws2_32_puts+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lws2_32 $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -4090,43 +4998,41 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char puts (); int -main () +main (void) { return puts (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_ws2_32_puts=yes -else +else $as_nop ac_cv_lib_ws2_32_puts=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ws2_32_puts" >&5 -$as_echo "$ac_cv_lib_ws2_32_puts" >&6; } -if test "x$ac_cv_lib_ws2_32_puts" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_LIBWS2_32 1 -_ACEOF +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ws2_32_puts" >&5 +printf "%s\n" "$ac_cv_lib_ws2_32_puts" >&6; } +if test "x$ac_cv_lib_ws2_32_puts" = xyes +then : + printf "%s\n" "#define HAVE_LIBWS2_32 1" >>confdefs.h LIBS="-lws2_32 $LIBS" fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for puts in -lole32" >&5 -$as_echo_n "checking for puts in -lole32... " >&6; } -if ${ac_cv_lib_ole32_puts+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for puts in -lole32" >&5 +printf %s "checking for puts in -lole32... " >&6; } +if test ${ac_cv_lib_ole32_puts+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lole32 $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -4135,43 +5041,41 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char puts (); int -main () +main (void) { return puts (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_ole32_puts=yes -else +else $as_nop ac_cv_lib_ole32_puts=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ole32_puts" >&5 -$as_echo "$ac_cv_lib_ole32_puts" >&6; } -if test "x$ac_cv_lib_ole32_puts" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_LIBOLE32 1 -_ACEOF +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ole32_puts" >&5 +printf "%s\n" "$ac_cv_lib_ole32_puts" >&6; } +if test "x$ac_cv_lib_ole32_puts" = xyes +then : + printf "%s\n" "#define HAVE_LIBOLE32 1" >>confdefs.h LIBS="-lole32 $LIBS" fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for puts in -lwinmm" >&5 -$as_echo_n "checking for puts in -lwinmm... " >&6; } -if ${ac_cv_lib_winmm_puts+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for puts in -lwinmm" >&5 +printf %s "checking for puts in -lwinmm... " >&6; } +if test ${ac_cv_lib_winmm_puts+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lwinmm $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -4180,43 +5084,41 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char puts (); int -main () +main (void) { return puts (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_winmm_puts=yes -else +else $as_nop ac_cv_lib_winmm_puts=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_winmm_puts" >&5 -$as_echo "$ac_cv_lib_winmm_puts" >&6; } -if test "x$ac_cv_lib_winmm_puts" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_LIBWINMM 1 -_ACEOF +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_winmm_puts" >&5 +printf "%s\n" "$ac_cv_lib_winmm_puts" >&6; } +if test "x$ac_cv_lib_winmm_puts" = xyes +then : + printf "%s\n" "#define HAVE_LIBWINMM 1" >>confdefs.h LIBS="-lwinmm $LIBS" fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for puts in -lsocket" >&5 -$as_echo_n "checking for puts in -lsocket... " >&6; } -if ${ac_cv_lib_socket_puts+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for puts in -lsocket" >&5 +printf %s "checking for puts in -lsocket... " >&6; } +if test ${ac_cv_lib_socket_puts+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lsocket $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -4225,43 +5127,41 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char puts (); int -main () +main (void) { return puts (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_socket_puts=yes -else +else $as_nop ac_cv_lib_socket_puts=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_socket_puts" >&5 -$as_echo "$ac_cv_lib_socket_puts" >&6; } -if test "x$ac_cv_lib_socket_puts" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_LIBSOCKET 1 -_ACEOF +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_socket_puts" >&5 +printf "%s\n" "$ac_cv_lib_socket_puts" >&6; } +if test "x$ac_cv_lib_socket_puts" = xyes +then : + printf "%s\n" "#define HAVE_LIBSOCKET 1" >>confdefs.h LIBS="-lsocket $LIBS" fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for puts in -lrt" >&5 -$as_echo_n "checking for puts in -lrt... " >&6; } -if ${ac_cv_lib_rt_puts+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for puts in -lrt" >&5 +printf %s "checking for puts in -lrt... " >&6; } +if test ${ac_cv_lib_rt_puts+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lrt $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -4270,43 +5170,41 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char puts (); int -main () +main (void) { return puts (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_rt_puts=yes -else +else $as_nop ac_cv_lib_rt_puts=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_rt_puts" >&5 -$as_echo "$ac_cv_lib_rt_puts" >&6; } -if test "x$ac_cv_lib_rt_puts" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_LIBRT 1 -_ACEOF +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_rt_puts" >&5 +printf "%s\n" "$ac_cv_lib_rt_puts" >&6; } +if test "x$ac_cv_lib_rt_puts" = xyes +then : + printf "%s\n" "#define HAVE_LIBRT 1" >>confdefs.h LIBS="-lrt $LIBS" fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sin in -lm" >&5 -$as_echo_n "checking for sin in -lm... " >&6; } -if ${ac_cv_lib_m_sin+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for sin in -lm" >&5 +printf %s "checking for sin in -lm... " >&6; } +if test ${ac_cv_lib_m_sin+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lm $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -4315,43 +5213,41 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char sin (); int -main () +main (void) { return sin (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_m_sin=yes -else +else $as_nop ac_cv_lib_m_sin=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_sin" >&5 -$as_echo "$ac_cv_lib_m_sin" >&6; } -if test "x$ac_cv_lib_m_sin" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_LIBM 1 -_ACEOF +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_sin" >&5 +printf "%s\n" "$ac_cv_lib_m_sin" >&6; } +if test "x$ac_cv_lib_m_sin" = xyes +then : + printf "%s\n" "#define HAVE_LIBM 1" >>confdefs.h LIBS="-lm $LIBS" fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for uuid_generate in -luuid" >&5 -$as_echo_n "checking for uuid_generate in -luuid... " >&6; } -if ${ac_cv_lib_uuid_uuid_generate+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for uuid_generate in -luuid" >&5 +printf %s "checking for uuid_generate in -luuid... " >&6; } +if test ${ac_cv_lib_uuid_uuid_generate+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-luuid $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -4360,43 +5256,41 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char uuid_generate (); int -main () +main (void) { return uuid_generate (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_uuid_uuid_generate=yes -else +else $as_nop ac_cv_lib_uuid_uuid_generate=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_uuid_uuid_generate" >&5 -$as_echo "$ac_cv_lib_uuid_uuid_generate" >&6; } -if test "x$ac_cv_lib_uuid_uuid_generate" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_LIBUUID 1 -_ACEOF +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_uuid_uuid_generate" >&5 +printf "%s\n" "$ac_cv_lib_uuid_uuid_generate" >&6; } +if test "x$ac_cv_lib_uuid_uuid_generate" = xyes +then : + printf "%s\n" "#define HAVE_LIBUUID 1" >>confdefs.h LIBS="-luuid $LIBS" fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for uuid_generate in -luuid" >&5 -$as_echo_n "checking for uuid_generate in -luuid... " >&6; } -if ${ac_cv_lib_uuid_uuid_generate+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for uuid_generate in -luuid" >&5 +printf %s "checking for uuid_generate in -luuid... " >&6; } +if test ${ac_cv_lib_uuid_uuid_generate+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-luuid $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -4405,38 +5299,38 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char uuid_generate (); int -main () +main (void) { return uuid_generate (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_uuid_uuid_generate=yes -else +else $as_nop ac_cv_lib_uuid_uuid_generate=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_uuid_uuid_generate" >&5 -$as_echo "$ac_cv_lib_uuid_uuid_generate" >&6; } -if test "x$ac_cv_lib_uuid_uuid_generate" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_uuid_uuid_generate" >&5 +printf "%s\n" "$ac_cv_lib_uuid_uuid_generate" >&6; } +if test "x$ac_cv_lib_uuid_uuid_generate" = xyes +then : ac_has_uuid_lib=1 fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing gethostbyname" >&5 -$as_echo_n "checking for library containing gethostbyname... " >&6; } -if ${ac_cv_search_gethostbyname+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for library containing gethostbyname" >&5 +printf %s "checking for library containing gethostbyname... " >&6; } +if test ${ac_cv_search_gethostbyname+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_func_search_save_LIBS=$LIBS cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -4444,478 +5338,111 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char gethostbyname (); int -main () +main (void) { return gethostbyname (); ; return 0; } _ACEOF -for ac_lib in '' nsl; do +for ac_lib in '' nsl +do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi - if ac_fn_c_try_link "$LINENO"; then : + if ac_fn_c_try_link "$LINENO" +then : ac_cv_search_gethostbyname=$ac_res fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext - if ${ac_cv_search_gethostbyname+:} false; then : + if test ${ac_cv_search_gethostbyname+y} +then : break fi done -if ${ac_cv_search_gethostbyname+:} false; then : +if test ${ac_cv_search_gethostbyname+y} +then : -else +else $as_nop ac_cv_search_gethostbyname=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_gethostbyname" >&5 -$as_echo "$ac_cv_search_gethostbyname" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_gethostbyname" >&5 +printf "%s\n" "$ac_cv_search_gethostbyname" >&6; } ac_res=$ac_cv_search_gethostbyname -if test "$ac_res" != no; then : +if test "$ac_res" != no +then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: Setting PJ_M_NAME to $target_cpu" >&5 -$as_echo "Setting PJ_M_NAME to $target_cpu" >&6; } -cat >>confdefs.h <<_ACEOF -#define PJ_M_NAME "$target_cpu" -_ACEOF +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: Setting PJ_M_NAME to $target_cpu" >&5 +printf "%s\n" "Setting PJ_M_NAME to $target_cpu" >&6; } +printf "%s\n" "#define PJ_M_NAME \"$target_cpu\"" >>confdefs.h -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking memory alignment" >&5 -$as_echo_n "checking memory alignment... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking memory alignment" >&5 +printf %s "checking memory alignment... " >&6; } case $target in sparc64-* | ia64-* | x86_64-* | arm64-* | aarch64-* | mips64* ) - $as_echo "#define PJ_POOL_ALIGNMENT 8" >>confdefs.h + printf "%s\n" "#define PJ_POOL_ALIGNMENT 8" >>confdefs.h - { $as_echo "$as_me:${as_lineno-$LINENO}: result: 8 bytes" >&5 -$as_echo "8 bytes" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: 8 bytes" >&5 +printf "%s\n" "8 bytes" >&6; } ;; * ) - $as_echo "#define PJ_POOL_ALIGNMENT 4" >>confdefs.h + printf "%s\n" "#define PJ_POOL_ALIGNMENT 4" >>confdefs.h - { $as_echo "$as_me:${as_lineno-$LINENO}: result: 4 bytes (default)" >&5 -$as_echo "4 bytes (default)" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: 4 bytes (default)" >&5 +printf "%s\n" "4 bytes (default)" >&6; } ;; esac -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 -$as_echo_n "checking how to run the C preprocessor... " >&6; } -# On Suns, sometimes $CPP names a directory. -if test -n "$CPP" && test -d "$CPP"; then - CPP= -fi -if test -z "$CPP"; then - if ${ac_cv_prog_CPP+:} false; then : - $as_echo_n "(cached) " >&6 -else - # Double quotes because CPP needs to be expanded - for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" - do - ac_preproc_ok=false -for ac_c_preproc_warn_flag in '' yes -do - # Use a header file that comes with gcc, so configuring glibc - # with a fresh cross-compiler works. - # Prefer to if __STDC__ is defined, since - # exists even on freestanding compilers. - # On the NeXT, cc -E runs the code through the compiler's parser, - # not just through cpp. "Syntax error" is here to catch this case. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#ifdef __STDC__ -# include -#else -# include -#endif - Syntax error -_ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : - -else - # Broken: fails on valid input. -continue -fi -rm -f conftest.err conftest.i conftest.$ac_ext - - # OK, works on sane cases. Now check whether nonexistent headers - # can be detected and how. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -_ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : - # Broken: success on invalid input. -continue -else - # Passes both tests. -ac_preproc_ok=: -break -fi -rm -f conftest.err conftest.i conftest.$ac_ext - -done -# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.i conftest.err conftest.$ac_ext -if $ac_preproc_ok; then : - break -fi - - done - ac_cv_prog_CPP=$CPP - -fi - CPP=$ac_cv_prog_CPP -else - ac_cv_prog_CPP=$CPP -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 -$as_echo "$CPP" >&6; } -ac_preproc_ok=false -for ac_c_preproc_warn_flag in '' yes -do - # Use a header file that comes with gcc, so configuring glibc - # with a fresh cross-compiler works. - # Prefer to if __STDC__ is defined, since - # exists even on freestanding compilers. - # On the NeXT, cc -E runs the code through the compiler's parser, - # not just through cpp. "Syntax error" is here to catch this case. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#ifdef __STDC__ -# include -#else -# include -#endif - Syntax error -_ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : - -else - # Broken: fails on valid input. -continue -fi -rm -f conftest.err conftest.i conftest.$ac_ext - - # OK, works on sane cases. Now check whether nonexistent headers - # can be detected and how. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -_ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : - # Broken: success on invalid input. -continue -else - # Passes both tests. -ac_preproc_ok=: -break -fi -rm -f conftest.err conftest.i conftest.$ac_ext - -done -# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.i conftest.err conftest.$ac_ext -if $ac_preproc_ok; then : - -else - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "C preprocessor \"$CPP\" fails sanity check -See \`config.log' for more details" "$LINENO" 5; } -fi - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 -$as_echo_n "checking for grep that handles long lines and -e... " >&6; } -if ${ac_cv_path_GREP+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -z "$GREP"; then - ac_path_GREP_found=false - # Loop through the user's path and test for each of PROGNAME-LIST - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_prog in grep ggrep; do - for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" - as_fn_executable_p "$ac_path_GREP" || continue -# Check for GNU ac_path_GREP and select it if it is found. - # Check for GNU $ac_path_GREP -case `"$ac_path_GREP" --version 2>&1` in -*GNU*) - ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; -*) - ac_count=0 - $as_echo_n 0123456789 >"conftest.in" - while : - do - cat "conftest.in" "conftest.in" >"conftest.tmp" - mv "conftest.tmp" "conftest.in" - cp "conftest.in" "conftest.nl" - $as_echo 'GREP' >> "conftest.nl" - "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break - diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break - as_fn_arith $ac_count + 1 && ac_count=$as_val - if test $ac_count -gt ${ac_path_GREP_max-0}; then - # Best one so far, save it but keep looking for a better one - ac_cv_path_GREP="$ac_path_GREP" - ac_path_GREP_max=$ac_count - fi - # 10*(2^10) chars as input seems more than enough - test $ac_count -gt 10 && break - done - rm -f conftest.in conftest.tmp conftest.nl conftest.out;; -esac - - $ac_path_GREP_found && break 3 - done - done - done -IFS=$as_save_IFS - if test -z "$ac_cv_path_GREP"; then - as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 - fi -else - ac_cv_path_GREP=$GREP -fi - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 -$as_echo "$ac_cv_path_GREP" >&6; } - GREP="$ac_cv_path_GREP" - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 -$as_echo_n "checking for egrep... " >&6; } -if ${ac_cv_path_EGREP+:} false; then : - $as_echo_n "(cached) " >&6 -else - if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 - then ac_cv_path_EGREP="$GREP -E" - else - if test -z "$EGREP"; then - ac_path_EGREP_found=false - # Loop through the user's path and test for each of PROGNAME-LIST - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +ac_header= ac_cache= +for ac_item in $ac_header_c_list do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_prog in egrep; do - for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" - as_fn_executable_p "$ac_path_EGREP" || continue -# Check for GNU ac_path_EGREP and select it if it is found. - # Check for GNU $ac_path_EGREP -case `"$ac_path_EGREP" --version 2>&1` in -*GNU*) - ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; -*) - ac_count=0 - $as_echo_n 0123456789 >"conftest.in" - while : - do - cat "conftest.in" "conftest.in" >"conftest.tmp" - mv "conftest.tmp" "conftest.in" - cp "conftest.in" "conftest.nl" - $as_echo 'EGREP' >> "conftest.nl" - "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break - diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break - as_fn_arith $ac_count + 1 && ac_count=$as_val - if test $ac_count -gt ${ac_path_EGREP_max-0}; then - # Best one so far, save it but keep looking for a better one - ac_cv_path_EGREP="$ac_path_EGREP" - ac_path_EGREP_max=$ac_count - fi - # 10*(2^10) chars as input seems more than enough - test $ac_count -gt 10 && break - done - rm -f conftest.in conftest.tmp conftest.nl conftest.out;; -esac - - $ac_path_EGREP_found && break 3 - done - done - done -IFS=$as_save_IFS - if test -z "$ac_cv_path_EGREP"; then - as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 - fi -else - ac_cv_path_EGREP=$EGREP -fi - - fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 -$as_echo "$ac_cv_path_EGREP" >&6; } - EGREP="$ac_cv_path_EGREP" - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 -$as_echo_n "checking for ANSI C header files... " >&6; } -if ${ac_cv_header_stdc+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -#include -#include -#include - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_header_stdc=yes -else - ac_cv_header_stdc=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - -if test $ac_cv_header_stdc = yes; then - # SunOS 4.x string.h does not declare mem*, contrary to ANSI. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "memchr" >/dev/null 2>&1; then : - -else - ac_cv_header_stdc=no -fi -rm -f conftest* - -fi - -if test $ac_cv_header_stdc = yes; then - # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "free" >/dev/null 2>&1; then : - -else - ac_cv_header_stdc=no -fi -rm -f conftest* - -fi - -if test $ac_cv_header_stdc = yes; then - # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. - if test "$cross_compiling" = yes; then : - : -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -#include -#if ((' ' & 0x0FF) == 0x020) -# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') -# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) -#else -# define ISLOWER(c) \ - (('a' <= (c) && (c) <= 'i') \ - || ('j' <= (c) && (c) <= 'r') \ - || ('s' <= (c) && (c) <= 'z')) -# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) -#endif + if test $ac_cache; then + ac_fn_c_check_header_compile "$LINENO" $ac_header ac_cv_header_$ac_cache "$ac_includes_default" + if eval test \"x\$ac_cv_header_$ac_cache\" = xyes; then + printf "%s\n" "#define $ac_item 1" >> confdefs.h + fi + ac_header= ac_cache= + elif test $ac_header; then + ac_cache=$ac_item + else + ac_header=$ac_item + fi +done -#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) -int -main () -{ - int i; - for (i = 0; i < 256; i++) - if (XOR (islower (i), ISLOWER (i)) - || toupper (i) != TOUPPER (i)) - return 2; - return 0; -} -_ACEOF -if ac_fn_c_try_run "$LINENO"; then : -else - ac_cv_header_stdc=no -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext -fi -fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 -$as_echo "$ac_cv_header_stdc" >&6; } -if test $ac_cv_header_stdc = yes; then -$as_echo "#define STDC_HEADERS 1" >>confdefs.h -fi -# On IRIX 5.3, sys/types and inttypes.h are conflicting. -for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ - inttypes.h stdint.h unistd.h -do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default -" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF -fi -done +if test $ac_cv_header_stdlib_h = yes && test $ac_cv_header_string_h = yes +then : +printf "%s\n" "#define STDC_HEADERS 1" >>confdefs.h - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether byte ordering is bigendian" >&5 -$as_echo_n "checking whether byte ordering is bigendian... " >&6; } -if ${ac_cv_c_bigendian+:} false; then : - $as_echo_n "(cached) " >&6 -else +fi + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether byte ordering is bigendian" >&5 +printf %s "checking whether byte ordering is bigendian... " >&6; } +if test ${ac_cv_c_bigendian+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_cv_c_bigendian=unknown # See if we're dealing with a universal compiler. cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -4926,7 +5453,8 @@ typedef int dummy; _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : # Check for potential -arch flags. It is not universal unless # there are at least two -arch flags with different values. @@ -4950,7 +5478,7 @@ fi done fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext if test $ac_cv_c_bigendian = unknown; then # See if sys/param.h defines the BYTE_ORDER macro. cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -4959,7 +5487,7 @@ #include int -main () +main (void) { #if ! (defined BYTE_ORDER && defined BIG_ENDIAN \ && defined LITTLE_ENDIAN && BYTE_ORDER && BIG_ENDIAN \ @@ -4971,7 +5499,8 @@ return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : # It does; now see whether it defined to BIG_ENDIAN or not. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -4979,7 +5508,7 @@ #include int -main () +main (void) { #if BYTE_ORDER != BIG_ENDIAN not big endian @@ -4989,14 +5518,15 @@ return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : ac_cv_c_bigendian=yes -else +else $as_nop ac_cv_c_bigendian=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi if test $ac_cv_c_bigendian = unknown; then # See if defines _LITTLE_ENDIAN or _BIG_ENDIAN (e.g., Solaris). @@ -5005,7 +5535,7 @@ #include int -main () +main (void) { #if ! (defined _LITTLE_ENDIAN || defined _BIG_ENDIAN) bogus endian macros @@ -5015,14 +5545,15 @@ return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : # It does; now see whether it defined to _BIG_ENDIAN or not. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int -main () +main (void) { #ifndef _BIG_ENDIAN not big endian @@ -5032,31 +5563,33 @@ return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : ac_cv_c_bigendian=yes -else +else $as_nop ac_cv_c_bigendian=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi if test $ac_cv_c_bigendian = unknown; then # Compile a test program. - if test "$cross_compiling" = yes; then : + if test "$cross_compiling" = yes +then : # Try to guess by grepping values from an object file. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -short int ascii_mm[] = +unsigned short int ascii_mm[] = { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 }; - short int ascii_ii[] = + unsigned short int ascii_ii[] = { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 }; int use_ascii (int i) { return ascii_mm[i] + ascii_ii[i]; } - short int ebcdic_ii[] = + unsigned short int ebcdic_ii[] = { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 }; - short int ebcdic_mm[] = + unsigned short int ebcdic_mm[] = { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 }; int use_ebcdic (int i) { return ebcdic_mm[i] + ebcdic_ii[i]; @@ -5064,14 +5597,15 @@ extern int foo; int -main () +main (void) { return use_ascii (foo) == use_ebcdic (foo); ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : if grep BIGenDianSyS conftest.$ac_objext >/dev/null; then ac_cv_c_bigendian=yes fi @@ -5084,13 +5618,13 @@ fi fi fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -else +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default int -main () +main (void) { /* Are we little or big endian? From Harbison&Steele. */ @@ -5106,9 +5640,10 @@ return 0; } _ACEOF -if ac_fn_c_try_run "$LINENO"; then : +if ac_fn_c_try_run "$LINENO" +then : ac_cv_c_bigendian=no -else +else $as_nop ac_cv_c_bigendian=yes fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ @@ -5117,17 +5652,17 @@ fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_bigendian" >&5 -$as_echo "$ac_cv_c_bigendian" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_bigendian" >&5 +printf "%s\n" "$ac_cv_c_bigendian" >&6; } case $ac_cv_c_bigendian in #( yes) - $as_echo "#define WORDS_BIGENDIAN 1" >>confdefs.h + printf "%s\n" "#define WORDS_BIGENDIAN 1" >>confdefs.h ;; #( no) ;; #( universal) -$as_echo "#define AC_APPLE_UNIVERSAL_BUILD 1" >>confdefs.h +printf "%s\n" "#define AC_APPLE_UNIVERSAL_BUILD 1" >>confdefs.h ;; #( *) @@ -5138,40 +5673,48 @@ if test "x$ac_cv_c_bigendian" = "xyes"; then CFLAGS="$CFLAGS -DPJ_IS_BIG_ENDIAN=1 -DPJ_IS_LITTLE_ENDIAN=0" + ac_cflags="$ac_cflags -DPJ_IS_BIG_ENDIAN=1 -DPJ_IS_LITTLE_ENDIAN=0" else CFLAGS="$CFLAGS -DPJ_IS_BIG_ENDIAN=0 -DPJ_IS_LITTLE_ENDIAN=1" + ac_cflags="$ac_cflags -DPJ_IS_BIG_ENDIAN=0 -DPJ_IS_LITTLE_ENDIAN=1" fi case $target in *android*) - $as_echo "#define PJ_ANDROID 1" >>confdefs.h + printf "%s\n" "#define PJ_ANDROID 1" >>confdefs.h ac_target_arch=$TARGET_ABI ;; *mingw* | *cygw* | *win32* | *w32* ) - $as_echo "#define PJ_WIN32 1" >>confdefs.h + printf "%s\n" "#define PJ_WIN32 1" >>confdefs.h + + printf "%s\n" "#define PJ_WIN32_WINNT 0x0400" >>confdefs.h - $as_echo "#define PJ_WIN32_WINNT 0x0400" >>confdefs.h + printf "%s\n" "#define WIN32_LEAN_AND_MEAN 1" >>confdefs.h - $as_echo "#define WIN32_LEAN_AND_MEAN 1" >>confdefs.h + case $target in + *_64-w64-mingw* ) + printf "%s\n" "#define PJ_WIN64 1" >>confdefs.h + ;; + esac ;; *darwin*) - $as_echo "#define PJ_DARWINOS 1" >>confdefs.h + printf "%s\n" "#define PJ_DARWINOS 1" >>confdefs.h ac_target_arch=$ARCH_VAL ;; *linux*) - $as_echo "#define PJ_LINUX 1" >>confdefs.h + printf "%s\n" "#define PJ_LINUX 1" >>confdefs.h ;; *rtems*) - $as_echo "#define PJ_RTEMS 1" >>confdefs.h + printf "%s\n" "#define PJ_RTEMS 1" >>confdefs.h ;; *sunos* | *solaris* ) - $as_echo "#define PJ_SUNOS 1" >>confdefs.h + printf "%s\n" "#define PJ_SUNOS 1" >>confdefs.h ;; *) @@ -5182,111 +5725,112 @@ # Check whether --enable-floating-point was given. -if test "${enable_floating_point+set}" = set; then : +if test ${enable_floating_point+y} +then : enableval=$enable_floating_point; if test "$enable_floating_point" = "no"; then - $as_echo "#define PJ_HAS_FLOATING_POINT 0" >>confdefs.h + printf "%s\n" "#define PJ_HAS_FLOATING_POINT 0" >>confdefs.h - { $as_echo "$as_me:${as_lineno-$LINENO}: result: Checking if floating point is disabled... yes" >&5 -$as_echo "Checking if floating point is disabled... yes" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: Checking if floating point is disabled... yes" >&5 +printf "%s\n" "Checking if floating point is disabled... yes" >&6; } fi -else +else $as_nop - $as_echo "#define PJ_HAS_FLOATING_POINT 1" >>confdefs.h + printf "%s\n" "#define PJ_HAS_FLOATING_POINT 1" >>confdefs.h - { $as_echo "$as_me:${as_lineno-$LINENO}: result: Checking if floating point is disabled... no" >&5 -$as_echo "Checking if floating point is disabled... no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: Checking if floating point is disabled... no" >&5 +printf "%s\n" "Checking if floating point is disabled... no" >&6; } fi -ac_fn_c_check_header_mongrel "$LINENO" "arpa/inet.h" "ac_cv_header_arpa_inet_h" "$ac_includes_default" -if test "x$ac_cv_header_arpa_inet_h" = xyes; then : - $as_echo "#define PJ_HAS_ARPA_INET_H 1" >>confdefs.h +ac_fn_c_check_header_compile "$LINENO" "arpa/inet.h" "ac_cv_header_arpa_inet_h" "$ac_includes_default" +if test "x$ac_cv_header_arpa_inet_h" = xyes +then : + printf "%s\n" "#define PJ_HAS_ARPA_INET_H 1" >>confdefs.h fi - -ac_fn_c_check_header_mongrel "$LINENO" "assert.h" "ac_cv_header_assert_h" "$ac_includes_default" -if test "x$ac_cv_header_assert_h" = xyes; then : - $as_echo "#define PJ_HAS_ASSERT_H 1" >>confdefs.h +ac_fn_c_check_header_compile "$LINENO" "assert.h" "ac_cv_header_assert_h" "$ac_includes_default" +if test "x$ac_cv_header_assert_h" = xyes +then : + printf "%s\n" "#define PJ_HAS_ASSERT_H 1" >>confdefs.h fi - -ac_fn_c_check_header_mongrel "$LINENO" "ctype.h" "ac_cv_header_ctype_h" "$ac_includes_default" -if test "x$ac_cv_header_ctype_h" = xyes; then : - $as_echo "#define PJ_HAS_CTYPE_H 1" >>confdefs.h +ac_fn_c_check_header_compile "$LINENO" "ctype.h" "ac_cv_header_ctype_h" "$ac_includes_default" +if test "x$ac_cv_header_ctype_h" = xyes +then : + printf "%s\n" "#define PJ_HAS_CTYPE_H 1" >>confdefs.h fi - case $target in *mingw* | *cygw* | *win32* | *w32* ) - $as_echo "#define PJ_HAS_ERRNO_H 0" >>confdefs.h + printf "%s\n" "#define PJ_HAS_ERRNO_H 0" >>confdefs.h ;; *) - ac_fn_c_check_header_mongrel "$LINENO" "errno.h" "ac_cv_header_errno_h" "$ac_includes_default" -if test "x$ac_cv_header_errno_h" = xyes; then : - $as_echo "#define PJ_HAS_ERRNO_H 1" >>confdefs.h + ac_fn_c_check_header_compile "$LINENO" "errno.h" "ac_cv_header_errno_h" "$ac_includes_default" +if test "x$ac_cv_header_errno_h" = xyes +then : + printf "%s\n" "#define PJ_HAS_ERRNO_H 1" >>confdefs.h fi - ;; esac -ac_fn_c_check_header_mongrel "$LINENO" "fcntl.h" "ac_cv_header_fcntl_h" "$ac_includes_default" -if test "x$ac_cv_header_fcntl_h" = xyes; then : - $as_echo "#define PJ_HAS_FCNTL_H 1" >>confdefs.h +ac_fn_c_check_header_compile "$LINENO" "fcntl.h" "ac_cv_header_fcntl_h" "$ac_includes_default" +if test "x$ac_cv_header_fcntl_h" = xyes +then : + printf "%s\n" "#define PJ_HAS_FCNTL_H 1" >>confdefs.h fi - -ac_fn_c_check_header_mongrel "$LINENO" "linux/socket.h" "ac_cv_header_linux_socket_h" "$ac_includes_default" -if test "x$ac_cv_header_linux_socket_h" = xyes; then : - $as_echo "#define PJ_HAS_LINUX_SOCKET_H 1" >>confdefs.h +ac_fn_c_check_header_compile "$LINENO" "linux/socket.h" "ac_cv_header_linux_socket_h" "$ac_includes_default" +if test "x$ac_cv_header_linux_socket_h" = xyes +then : + printf "%s\n" "#define PJ_HAS_LINUX_SOCKET_H 1" >>confdefs.h fi - -ac_fn_c_check_header_mongrel "$LINENO" "limits.h" "ac_cv_header_limits_h" "$ac_includes_default" -if test "x$ac_cv_header_limits_h" = xyes; then : - $as_echo "#define PJ_HAS_LIMITS_H 1" >>confdefs.h +ac_fn_c_check_header_compile "$LINENO" "limits.h" "ac_cv_header_limits_h" "$ac_includes_default" +if test "x$ac_cv_header_limits_h" = xyes +then : + printf "%s\n" "#define PJ_HAS_LIMITS_H 1" >>confdefs.h fi - -ac_fn_c_check_header_mongrel "$LINENO" "malloc.h" "ac_cv_header_malloc_h" "$ac_includes_default" -if test "x$ac_cv_header_malloc_h" = xyes; then : - $as_echo "#define PJ_HAS_MALLOC_H 1" >>confdefs.h +ac_fn_c_check_header_compile "$LINENO" "malloc.h" "ac_cv_header_malloc_h" "$ac_includes_default" +if test "x$ac_cv_header_malloc_h" = xyes +then : + printf "%s\n" "#define PJ_HAS_MALLOC_H 1" >>confdefs.h fi - -ac_fn_c_check_header_mongrel "$LINENO" "netdb.h" "ac_cv_header_netdb_h" "$ac_includes_default" -if test "x$ac_cv_header_netdb_h" = xyes; then : - $as_echo "#define PJ_HAS_NETDB_H 1" >>confdefs.h +ac_fn_c_check_header_compile "$LINENO" "netdb.h" "ac_cv_header_netdb_h" "$ac_includes_default" +if test "x$ac_cv_header_netdb_h" = xyes +then : + printf "%s\n" "#define PJ_HAS_NETDB_H 1" >>confdefs.h fi - -ac_fn_c_check_header_mongrel "$LINENO" "netinet/in_systm.h" "ac_cv_header_netinet_in_systm_h" "$ac_includes_default" -if test "x$ac_cv_header_netinet_in_systm_h" = xyes; then : - $as_echo "#define PJ_HAS_NETINET_IN_SYSTM_H 1" >>confdefs.h +ac_fn_c_check_header_compile "$LINENO" "netinet/in_systm.h" "ac_cv_header_netinet_in_systm_h" "$ac_includes_default" +if test "x$ac_cv_header_netinet_in_systm_h" = xyes +then : + printf "%s\n" "#define PJ_HAS_NETINET_IN_SYSTM_H 1" >>confdefs.h fi - -ac_fn_c_check_header_mongrel "$LINENO" "netinet/in.h" "ac_cv_header_netinet_in_h" "$ac_includes_default" -if test "x$ac_cv_header_netinet_in_h" = xyes; then : - $as_echo "#define PJ_HAS_NETINET_IN_H 1" >>confdefs.h +ac_fn_c_check_header_compile "$LINENO" "netinet/in.h" "ac_cv_header_netinet_in_h" "$ac_includes_default" +if test "x$ac_cv_header_netinet_in_h" = xyes +then : + printf "%s\n" "#define PJ_HAS_NETINET_IN_H 1" >>confdefs.h fi - ac_fn_c_check_header_compile "$LINENO" "netinet/ip.h" "ac_cv_header_netinet_ip_h" "#if PJ_HAS_SYS_TYPES_H # include #endif @@ -5298,177 +5842,178 @@ #endif " -if test "x$ac_cv_header_netinet_ip_h" = xyes; then : - $as_echo "#define PJ_HAS_NETINET_IP_H 1" >>confdefs.h +if test "x$ac_cv_header_netinet_ip_h" = xyes +then : + printf "%s\n" "#define PJ_HAS_NETINET_IP_H 1" >>confdefs.h fi - -ac_fn_c_check_header_mongrel "$LINENO" "netinet/tcp.h" "ac_cv_header_netinet_tcp_h" "$ac_includes_default" -if test "x$ac_cv_header_netinet_tcp_h" = xyes; then : - $as_echo "#define PJ_HAS_NETINET_TCP_H 1" >>confdefs.h +ac_fn_c_check_header_compile "$LINENO" "netinet/tcp.h" "ac_cv_header_netinet_tcp_h" "$ac_includes_default" +if test "x$ac_cv_header_netinet_tcp_h" = xyes +then : + printf "%s\n" "#define PJ_HAS_NETINET_TCP_H 1" >>confdefs.h fi - -ac_fn_c_check_header_mongrel "$LINENO" "ifaddrs.h" "ac_cv_header_ifaddrs_h" "$ac_includes_default" -if test "x$ac_cv_header_ifaddrs_h" = xyes; then : +ac_fn_c_check_header_compile "$LINENO" "ifaddrs.h" "ac_cv_header_ifaddrs_h" "$ac_includes_default" +if test "x$ac_cv_header_ifaddrs_h" = xyes +then : ac_fn_c_check_func "$LINENO" "getifaddrs" "ac_cv_func_getifaddrs" -if test "x$ac_cv_func_getifaddrs" = xyes; then : - $as_echo "#define PJ_HAS_IFADDRS_H 1" >>confdefs.h +if test "x$ac_cv_func_getifaddrs" = xyes +then : + printf "%s\n" "#define PJ_HAS_IFADDRS_H 1" >>confdefs.h fi fi - -ac_fn_c_check_header_mongrel "$LINENO" "semaphore.h" "ac_cv_header_semaphore_h" "$ac_includes_default" -if test "x$ac_cv_header_semaphore_h" = xyes; then : - $as_echo "#define PJ_HAS_SEMAPHORE_H 1" >>confdefs.h +ac_fn_c_check_header_compile "$LINENO" "semaphore.h" "ac_cv_header_semaphore_h" "$ac_includes_default" +if test "x$ac_cv_header_semaphore_h" = xyes +then : + printf "%s\n" "#define PJ_HAS_SEMAPHORE_H 1" >>confdefs.h fi - -ac_fn_c_check_header_mongrel "$LINENO" "setjmp.h" "ac_cv_header_setjmp_h" "$ac_includes_default" -if test "x$ac_cv_header_setjmp_h" = xyes; then : - $as_echo "#define PJ_HAS_SETJMP_H 1" >>confdefs.h +ac_fn_c_check_header_compile "$LINENO" "setjmp.h" "ac_cv_header_setjmp_h" "$ac_includes_default" +if test "x$ac_cv_header_setjmp_h" = xyes +then : + printf "%s\n" "#define PJ_HAS_SETJMP_H 1" >>confdefs.h fi - -ac_fn_c_check_header_mongrel "$LINENO" "stdarg.h" "ac_cv_header_stdarg_h" "$ac_includes_default" -if test "x$ac_cv_header_stdarg_h" = xyes; then : - $as_echo "#define PJ_HAS_STDARG_H 1" >>confdefs.h +ac_fn_c_check_header_compile "$LINENO" "stdarg.h" "ac_cv_header_stdarg_h" "$ac_includes_default" +if test "x$ac_cv_header_stdarg_h" = xyes +then : + printf "%s\n" "#define PJ_HAS_STDARG_H 1" >>confdefs.h fi - -ac_fn_c_check_header_mongrel "$LINENO" "stddef.h" "ac_cv_header_stddef_h" "$ac_includes_default" -if test "x$ac_cv_header_stddef_h" = xyes; then : - $as_echo "#define PJ_HAS_STDDEF_H 1" >>confdefs.h +ac_fn_c_check_header_compile "$LINENO" "stddef.h" "ac_cv_header_stddef_h" "$ac_includes_default" +if test "x$ac_cv_header_stddef_h" = xyes +then : + printf "%s\n" "#define PJ_HAS_STDDEF_H 1" >>confdefs.h fi - -ac_fn_c_check_header_mongrel "$LINENO" "stdio.h" "ac_cv_header_stdio_h" "$ac_includes_default" -if test "x$ac_cv_header_stdio_h" = xyes; then : - $as_echo "#define PJ_HAS_STDIO_H 1" >>confdefs.h +ac_fn_c_check_header_compile "$LINENO" "stdio.h" "ac_cv_header_stdio_h" "$ac_includes_default" +if test "x$ac_cv_header_stdio_h" = xyes +then : + printf "%s\n" "#define PJ_HAS_STDIO_H 1" >>confdefs.h fi - -ac_fn_c_check_header_mongrel "$LINENO" "stdint.h" "ac_cv_header_stdint_h" "$ac_includes_default" -if test "x$ac_cv_header_stdint_h" = xyes; then : - $as_echo "#define PJ_HAS_STDINT_H 1" >>confdefs.h +ac_fn_c_check_header_compile "$LINENO" "stdint.h" "ac_cv_header_stdint_h" "$ac_includes_default" +if test "x$ac_cv_header_stdint_h" = xyes +then : + printf "%s\n" "#define PJ_HAS_STDINT_H 1" >>confdefs.h fi - -ac_fn_c_check_header_mongrel "$LINENO" "stdlib.h" "ac_cv_header_stdlib_h" "$ac_includes_default" -if test "x$ac_cv_header_stdlib_h" = xyes; then : - $as_echo "#define PJ_HAS_STDLIB_H 1" >>confdefs.h +ac_fn_c_check_header_compile "$LINENO" "stdlib.h" "ac_cv_header_stdlib_h" "$ac_includes_default" +if test "x$ac_cv_header_stdlib_h" = xyes +then : + printf "%s\n" "#define PJ_HAS_STDLIB_H 1" >>confdefs.h fi - -ac_fn_c_check_header_mongrel "$LINENO" "string.h" "ac_cv_header_string_h" "$ac_includes_default" -if test "x$ac_cv_header_string_h" = xyes; then : - $as_echo "#define PJ_HAS_STRING_H 1" >>confdefs.h +ac_fn_c_check_header_compile "$LINENO" "string.h" "ac_cv_header_string_h" "$ac_includes_default" +if test "x$ac_cv_header_string_h" = xyes +then : + printf "%s\n" "#define PJ_HAS_STRING_H 1" >>confdefs.h fi - -ac_fn_c_check_header_mongrel "$LINENO" "sys/ioctl.h" "ac_cv_header_sys_ioctl_h" "$ac_includes_default" -if test "x$ac_cv_header_sys_ioctl_h" = xyes; then : - $as_echo "#define PJ_HAS_SYS_IOCTL_H 1" >>confdefs.h +ac_fn_c_check_header_compile "$LINENO" "sys/ioctl.h" "ac_cv_header_sys_ioctl_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_ioctl_h" = xyes +then : + printf "%s\n" "#define PJ_HAS_SYS_IOCTL_H 1" >>confdefs.h fi - -ac_fn_c_check_header_mongrel "$LINENO" "sys/select.h" "ac_cv_header_sys_select_h" "$ac_includes_default" -if test "x$ac_cv_header_sys_select_h" = xyes; then : - $as_echo "#define PJ_HAS_SYS_SELECT_H 1" >>confdefs.h +ac_fn_c_check_header_compile "$LINENO" "sys/select.h" "ac_cv_header_sys_select_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_select_h" = xyes +then : + printf "%s\n" "#define PJ_HAS_SYS_SELECT_H 1" >>confdefs.h fi - -ac_fn_c_check_header_mongrel "$LINENO" "sys/socket.h" "ac_cv_header_sys_socket_h" "$ac_includes_default" -if test "x$ac_cv_header_sys_socket_h" = xyes; then : - $as_echo "#define PJ_HAS_SYS_SOCKET_H 1" >>confdefs.h +ac_fn_c_check_header_compile "$LINENO" "sys/socket.h" "ac_cv_header_sys_socket_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_socket_h" = xyes +then : + printf "%s\n" "#define PJ_HAS_SYS_SOCKET_H 1" >>confdefs.h fi - -ac_fn_c_check_header_mongrel "$LINENO" "sys/time.h" "ac_cv_header_sys_time_h" "$ac_includes_default" -if test "x$ac_cv_header_sys_time_h" = xyes; then : - $as_echo "#define PJ_HAS_SYS_TIME_H 1" >>confdefs.h +ac_fn_c_check_header_compile "$LINENO" "sys/time.h" "ac_cv_header_sys_time_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_time_h" = xyes +then : + printf "%s\n" "#define PJ_HAS_SYS_TIME_H 1" >>confdefs.h fi - -ac_fn_c_check_header_mongrel "$LINENO" "sys/timeb.h" "ac_cv_header_sys_timeb_h" "$ac_includes_default" -if test "x$ac_cv_header_sys_timeb_h" = xyes; then : - $as_echo "#define PJ_HAS_SYS_TIMEB_H 1" >>confdefs.h +ac_fn_c_check_header_compile "$LINENO" "sys/timeb.h" "ac_cv_header_sys_timeb_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_timeb_h" = xyes +then : + printf "%s\n" "#define PJ_HAS_SYS_TIMEB_H 1" >>confdefs.h fi - -ac_fn_c_check_header_mongrel "$LINENO" "sys/types.h" "ac_cv_header_sys_types_h" "$ac_includes_default" -if test "x$ac_cv_header_sys_types_h" = xyes; then : - $as_echo "#define PJ_HAS_SYS_TYPES_H 1" >>confdefs.h +ac_fn_c_check_header_compile "$LINENO" "sys/types.h" "ac_cv_header_sys_types_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_types_h" = xyes +then : + printf "%s\n" "#define PJ_HAS_SYS_TYPES_H 1" >>confdefs.h fi - -ac_fn_c_check_header_mongrel "$LINENO" "sys/filio.h" "ac_cv_header_sys_filio_h" "$ac_includes_default" -if test "x$ac_cv_header_sys_filio_h" = xyes; then : - $as_echo "#define PJ_HAS_SYS_FILIO_H 1" >>confdefs.h +ac_fn_c_check_header_compile "$LINENO" "sys/filio.h" "ac_cv_header_sys_filio_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_filio_h" = xyes +then : + printf "%s\n" "#define PJ_HAS_SYS_FILIO_H 1" >>confdefs.h fi - -ac_fn_c_check_header_mongrel "$LINENO" "sys/sockio.h" "ac_cv_header_sys_sockio_h" "$ac_includes_default" -if test "x$ac_cv_header_sys_sockio_h" = xyes; then : - $as_echo "#define PJ_HAS_SYS_SOCKIO_H 1" >>confdefs.h +ac_fn_c_check_header_compile "$LINENO" "sys/sockio.h" "ac_cv_header_sys_sockio_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_sockio_h" = xyes +then : + printf "%s\n" "#define PJ_HAS_SYS_SOCKIO_H 1" >>confdefs.h fi - -ac_fn_c_check_header_mongrel "$LINENO" "sys/utsname.h" "ac_cv_header_sys_utsname_h" "$ac_includes_default" -if test "x$ac_cv_header_sys_utsname_h" = xyes; then : - $as_echo "#define PJ_HAS_SYS_UTSNAME_H 1" >>confdefs.h +ac_fn_c_check_header_compile "$LINENO" "sys/utsname.h" "ac_cv_header_sys_utsname_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_utsname_h" = xyes +then : + printf "%s\n" "#define PJ_HAS_SYS_UTSNAME_H 1" >>confdefs.h fi - -ac_fn_c_check_header_mongrel "$LINENO" "time.h" "ac_cv_header_time_h" "$ac_includes_default" -if test "x$ac_cv_header_time_h" = xyes; then : - $as_echo "#define PJ_HAS_TIME_H 1" >>confdefs.h +ac_fn_c_check_header_compile "$LINENO" "time.h" "ac_cv_header_time_h" "$ac_includes_default" +if test "x$ac_cv_header_time_h" = xyes +then : + printf "%s\n" "#define PJ_HAS_TIME_H 1" >>confdefs.h fi - -ac_fn_c_check_header_mongrel "$LINENO" "unistd.h" "ac_cv_header_unistd_h" "$ac_includes_default" -if test "x$ac_cv_header_unistd_h" = xyes; then : - $as_echo "#define PJ_HAS_UNISTD_H 1" >>confdefs.h +ac_fn_c_check_header_compile "$LINENO" "unistd.h" "ac_cv_header_unistd_h" "$ac_includes_default" +if test "x$ac_cv_header_unistd_h" = xyes +then : + printf "%s\n" "#define PJ_HAS_UNISTD_H 1" >>confdefs.h fi - -ac_fn_c_check_header_mongrel "$LINENO" "winsock.h" "ac_cv_header_winsock_h" "$ac_includes_default" -if test "x$ac_cv_header_winsock_h" = xyes; then : - $as_echo "#define PJ_HAS_WINSOCK_H 1" >>confdefs.h +ac_fn_c_check_header_compile "$LINENO" "winsock.h" "ac_cv_header_winsock_h" "$ac_includes_default" +if test "x$ac_cv_header_winsock_h" = xyes +then : + printf "%s\n" "#define PJ_HAS_WINSOCK_H 1" >>confdefs.h fi - -ac_fn_c_check_header_mongrel "$LINENO" "winsock2.h" "ac_cv_header_winsock2_h" "$ac_includes_default" -if test "x$ac_cv_header_winsock2_h" = xyes; then : - $as_echo "#define PJ_HAS_WINSOCK2_H 1" >>confdefs.h +ac_fn_c_check_header_compile "$LINENO" "winsock2.h" "ac_cv_header_winsock2_h" "$ac_includes_default" +if test "x$ac_cv_header_winsock2_h" = xyes +then : + printf "%s\n" "#define PJ_HAS_WINSOCK2_H 1" >>confdefs.h fi - ac_fn_c_check_header_compile "$LINENO" "mswsock.h" "ac_cv_header_mswsock_h" "#if PJ_HAS_WINSOCK2_H # include #elif PJ_HAS_WINSOCK_H @@ -5476,25 +6021,25 @@ #endif " -if test "x$ac_cv_header_mswsock_h" = xyes; then : - $as_echo "#define PJ_HAS_MSWSOCK_H 1" >>confdefs.h +if test "x$ac_cv_header_mswsock_h" = xyes +then : + printf "%s\n" "#define PJ_HAS_MSWSOCK_H 1" >>confdefs.h fi - -ac_fn_c_check_header_mongrel "$LINENO" "ws2tcpip.h" "ac_cv_header_ws2tcpip_h" "$ac_includes_default" -if test "x$ac_cv_header_ws2tcpip_h" = xyes; then : - $as_echo "#define PJ_HAS_WS2TCPIP_H 1" >>confdefs.h +ac_fn_c_check_header_compile "$LINENO" "ws2tcpip.h" "ac_cv_header_ws2tcpip_h" "$ac_includes_default" +if test "x$ac_cv_header_ws2tcpip_h" = xyes +then : + printf "%s\n" "#define PJ_HAS_WS2TCPIP_H 1" >>confdefs.h fi - -ac_fn_c_check_header_mongrel "$LINENO" "uuid/uuid.h" "ac_cv_header_uuid_uuid_h" "$ac_includes_default" -if test "x$ac_cv_header_uuid_uuid_h" = xyes; then : +ac_fn_c_check_header_compile "$LINENO" "uuid/uuid.h" "ac_cv_header_uuid_uuid_h" "$ac_includes_default" +if test "x$ac_cv_header_uuid_uuid_h" = xyes +then : ac_has_uuid_h=1 fi - ac_fn_c_check_header_compile "$LINENO" "net/if.h" "ac_cv_header_net_if_h" "#if PJ_HAS_SYS_TYPES_H # include #endif @@ -5504,170 +6049,173 @@ #endif " -if test "x$ac_cv_header_net_if_h" = xyes; then : - $as_echo "#define PJ_HAS_NET_IF_H 1" >>confdefs.h +if test "x$ac_cv_header_net_if_h" = xyes +then : + printf "%s\n" "#define PJ_HAS_NET_IF_H 1" >>confdefs.h fi - case $target in *android*) - ac_fn_c_check_header_mongrel "$LINENO" "linux/android_alarm.h" "ac_cv_header_linux_android_alarm_h" "$ac_includes_default" -if test "x$ac_cv_header_linux_android_alarm_h" = xyes; then : - $as_echo "#define PJ_HAS_ANDROID_ALARM_H 1" >>confdefs.h + ac_fn_c_check_header_compile "$LINENO" "linux/android_alarm.h" "ac_cv_header_linux_android_alarm_h" "$ac_includes_default" +if test "x$ac_cv_header_linux_android_alarm_h" = xyes +then : + printf "%s\n" "#define PJ_HAS_ANDROID_ALARM_H 1" >>confdefs.h fi - ;; esac ac_fn_c_check_func "$LINENO" "localtime_r" "ac_cv_func_localtime_r" -if test "x$ac_cv_func_localtime_r" = xyes; then : - $as_echo "#define PJ_HAS_LOCALTIME_R 1" >>confdefs.h +if test "x$ac_cv_func_localtime_r" = xyes +then : + printf "%s\n" "#define PJ_HAS_LOCALTIME_R 1" >>confdefs.h fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: Setting PJ_OS_NAME to $target" >&5 -$as_echo "Setting PJ_OS_NAME to $target" >&6; } -cat >>confdefs.h <<_ACEOF -#define PJ_OS_NAME "$target" -_ACEOF +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: Setting PJ_OS_NAME to $target" >&5 +printf "%s\n" "Setting PJ_OS_NAME to $target" >&6; } +printf "%s\n" "#define PJ_OS_NAME \"$target\"" >>confdefs.h -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: Setting PJ_HAS_ERRNO_VAR to 1" >&5 -$as_echo "Setting PJ_HAS_ERRNO_VAR to 1" >&6; } -$as_echo "#define PJ_HAS_ERRNO_VAR 1" >>confdefs.h +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: Setting PJ_HAS_ERRNO_VAR to 1" >&5 +printf "%s\n" "Setting PJ_HAS_ERRNO_VAR to 1" >&6; } +printf "%s\n" "#define PJ_HAS_ERRNO_VAR 1" >>confdefs.h -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: Setting PJ_HAS_HIGH_RES_TIMER to 1" >&5 -$as_echo "Setting PJ_HAS_HIGH_RES_TIMER to 1" >&6; } -$as_echo "#define PJ_HAS_HIGH_RES_TIMER 1" >>confdefs.h +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: Setting PJ_HAS_HIGH_RES_TIMER to 1" >&5 +printf "%s\n" "Setting PJ_HAS_HIGH_RES_TIMER to 1" >&6; } +printf "%s\n" "#define PJ_HAS_HIGH_RES_TIMER 1" >>confdefs.h -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: Setting PJ_HAS_MALLOC to 1" >&5 -$as_echo "Setting PJ_HAS_MALLOC to 1" >&6; } -$as_echo "#define PJ_HAS_MALLOC 1" >>confdefs.h +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: Setting PJ_HAS_MALLOC to 1" >&5 +printf "%s\n" "Setting PJ_HAS_MALLOC to 1" >&6; } +printf "%s\n" "#define PJ_HAS_MALLOC 1" >>confdefs.h -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: Setting PJ_NATIVE_STRING_IS_UNICODE to 0" >&5 -$as_echo "Setting PJ_NATIVE_STRING_IS_UNICODE to 0" >&6; } -$as_echo "#define PJ_NATIVE_STRING_IS_UNICODE 0" >>confdefs.h +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: Setting PJ_NATIVE_STRING_IS_UNICODE to 0" >&5 +printf "%s\n" "Setting PJ_NATIVE_STRING_IS_UNICODE to 0" >&6; } +printf "%s\n" "#define PJ_NATIVE_STRING_IS_UNICODE 0" >>confdefs.h -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: Setting PJ_ATOMIC_VALUE_TYPE to long" >&5 -$as_echo "Setting PJ_ATOMIC_VALUE_TYPE to long" >&6; } -$as_echo "#define PJ_ATOMIC_VALUE_TYPE long" >>confdefs.h +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: Setting PJ_ATOMIC_VALUE_TYPE to long" >&5 +printf "%s\n" "Setting PJ_ATOMIC_VALUE_TYPE to long" >&6; } +printf "%s\n" "#define PJ_ATOMIC_VALUE_TYPE long" >>confdefs.h -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if inet_aton() is available" >&5 -$as_echo_n "checking if inet_aton() is available... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if inet_aton() is available" >&5 +printf %s "checking if inet_aton() is available... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include int -main () +main (void) { inet_aton(0, 0); ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - $as_echo "#define PJ_SOCK_HAS_INET_ATON 1" >>confdefs.h - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } +if ac_fn_c_try_compile "$LINENO" +then : + printf "%s\n" "#define PJ_SOCK_HAS_INET_ATON 1" >>confdefs.h + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if inet_pton() is available" >&5 -$as_echo_n "checking if inet_pton() is available... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if inet_pton() is available" >&5 +printf %s "checking if inet_pton() is available... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include int -main () +main (void) { inet_pton(0, 0, 0); ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - $as_echo "#define PJ_SOCK_HAS_INET_PTON 1" >>confdefs.h - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } +if ac_fn_c_try_compile "$LINENO" +then : + printf "%s\n" "#define PJ_SOCK_HAS_INET_PTON 1" >>confdefs.h + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if inet_ntop() is available" >&5 -$as_echo_n "checking if inet_ntop() is available... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if inet_ntop() is available" >&5 +printf %s "checking if inet_ntop() is available... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include int -main () +main (void) { inet_ntop(0, 0, 0, 0); ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - $as_echo "#define PJ_SOCK_HAS_INET_NTOP 1" >>confdefs.h - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } +if ac_fn_c_try_compile "$LINENO" +then : + printf "%s\n" "#define PJ_SOCK_HAS_INET_NTOP 1" >>confdefs.h + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if getaddrinfo() is available" >&5 -$as_echo_n "checking if getaddrinfo() is available... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if getaddrinfo() is available" >&5 +printf %s "checking if getaddrinfo() is available... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include int -main () +main (void) { getaddrinfo(0, 0, 0, 0); ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - $as_echo "#define PJ_SOCK_HAS_GETADDRINFO 1" >>confdefs.h - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } +if ac_fn_c_try_compile "$LINENO" +then : + printf "%s\n" "#define PJ_SOCK_HAS_GETADDRINFO 1" >>confdefs.h + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if sockaddr_in has sin_len member" >&5 -$as_echo_n "checking if sockaddr_in has sin_len member... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if sockaddr_in has sin_len member" >&5 +printf %s "checking if sockaddr_in has sin_len member... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include @@ -5675,82 +6223,85 @@ #include #include int -main () +main (void) { struct sockaddr_in a; a.sin_len=0; ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - $as_echo "#define PJ_SOCKADDR_HAS_LEN 1" >>confdefs.h - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } +if ac_fn_c_try_compile "$LINENO" +then : + printf "%s\n" "#define PJ_SOCKADDR_HAS_LEN 1" >>confdefs.h + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if socklen_t is available" >&5 -$as_echo_n "checking if socklen_t is available... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if socklen_t is available" >&5 +printf %s "checking if socklen_t is available... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int -main () +main (void) { socklen_t xxx = 0; ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - $as_echo "#define PJ_HAS_SOCKLEN_T 1" >>confdefs.h - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } +if ac_fn_c_try_compile "$LINENO" +then : + printf "%s\n" "#define PJ_HAS_SOCKLEN_T 1" >>confdefs.h + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if IPV6_V6ONLY is available" >&5 -$as_echo_n "checking if IPV6_V6ONLY is available... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if IPV6_V6ONLY is available" >&5 +printf %s "checking if IPV6_V6ONLY is available... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int -main () +main (void) { int opt = IPV6_V6ONLY; ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - $as_echo "#define PJ_SOCK_HAS_IPV6_V6ONLY 1" >>confdefs.h - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } +if ac_fn_c_try_compile "$LINENO" +then : + printf "%s\n" "#define PJ_SOCK_HAS_IPV6_V6ONLY 1" >>confdefs.h + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if SO_ERROR is available" >&5 -$as_echo_n "checking if SO_ERROR is available... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if SO_ERROR is available" >&5 +printf %s "checking if SO_ERROR is available... " >&6; } case $target in *mingw* | *cygw* | *win32* | *w32* ) - $as_echo "#define PJ_HAS_SO_ERROR 1" >>confdefs.h + printf "%s\n" "#define PJ_HAS_SO_ERROR 1" >>confdefs.h - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } ;; *) cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -5760,116 +6311,120 @@ #include #include int -main () +main (void) { int i=SO_ERROR; ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - $as_echo "#define PJ_HAS_SO_ERROR 1" >>confdefs.h +if ac_fn_c_try_compile "$LINENO" +then : + printf "%s\n" "#define PJ_HAS_SO_ERROR 1" >>confdefs.h - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if pthread_rwlock_t is available" >&5 -$as_echo_n "checking if pthread_rwlock_t is available... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if pthread_rwlock_t is available" >&5 +printf %s "checking if pthread_rwlock_t is available... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int -main () +main (void) { pthread_rwlock_t *x; ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - $as_echo "#define PJ_EMULATE_RWMUTEX 0" >>confdefs.h +if ac_fn_c_try_compile "$LINENO" +then : + printf "%s\n" "#define PJ_EMULATE_RWMUTEX 0" >>confdefs.h ac_rwmutex="yes" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } -else - $as_echo "#define PJ_EMULATE_RWMUTEX 1" >>confdefs.h + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } +else $as_nop + printf "%s\n" "#define PJ_EMULATE_RWMUTEX 1" >>confdefs.h ac_rwmutex="no" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext if test "$ac_rwmutex" = "no"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if pthread_rwlock_t is available with _POSIX_READER_WRITER_LOCKS" >&5 -$as_echo_n "checking if pthread_rwlock_t is available with _POSIX_READER_WRITER_LOCKS... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if pthread_rwlock_t is available with _POSIX_READER_WRITER_LOCKS" >&5 +printf %s "checking if pthread_rwlock_t is available with _POSIX_READER_WRITER_LOCKS... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define _POSIX_READER_WRITER_LOCKS #include int -main () +main (void) { pthread_rwlock_t *x; ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - $as_echo "#define PJ_EMULATE_RWMUTEX 0" >>confdefs.h +if ac_fn_c_try_compile "$LINENO" +then : + printf "%s\n" "#define PJ_EMULATE_RWMUTEX 0" >>confdefs.h CFLAGS="$CFLAGS -D_POSIX_THREADS -D_POSIX_READER_WRITER_LOCKS" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } -else - $as_echo "#define PJ_EMULATE_RWMUTEX 1" >>confdefs.h + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } +else $as_nop + printf "%s\n" "#define PJ_EMULATE_RWMUTEX 1" >>confdefs.h - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if pthread_mutexattr_settype() is available" >&5 -$as_echo_n "checking if pthread_mutexattr_settype() is available... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if pthread_mutexattr_settype() is available" >&5 +printf %s "checking if pthread_mutexattr_settype() is available... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int -main () +main (void) { pthread_mutexattr_settype(0,PTHREAD_MUTEX_FAST_NP); ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - $as_echo "#define PJ_HAS_PTHREAD_MUTEXATTR_SETTYPE 1" >>confdefs.h - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } +if ac_fn_c_try_compile "$LINENO" +then : + printf "%s\n" "#define PJ_HAS_PTHREAD_MUTEXATTR_SETTYPE 1" >>confdefs.h + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if pthread_mutexattr_t has recursive member" >&5 -$as_echo_n "checking if pthread_mutexattr_t has recursive member... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if pthread_mutexattr_t has recursive member" >&5 +printf %s "checking if pthread_mutexattr_t has recursive member... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int -main () +main (void) { pthread_mutexattr_t attr; attr.recursive=1; @@ -5877,36 +6432,38 @@ return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - $as_echo "#define PJ_PTHREAD_MUTEXATTR_T_HAS_RECURSIVE 1" >>confdefs.h +if ac_fn_c_try_compile "$LINENO" +then : + printf "%s\n" "#define PJ_PTHREAD_MUTEXATTR_T_HAS_RECURSIVE 1" >>confdefs.h - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking ioqueue backend" >&5 -$as_echo_n "checking ioqueue backend... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking ioqueue backend" >&5 +printf %s "checking ioqueue backend... " >&6; } # Check whether --enable-epoll was given. -if test "${enable_epoll+set}" = set; then : +if test ${enable_epoll+y} +then : enableval=$enable_epoll; ac_os_objs=ioqueue_epoll.o - { $as_echo "$as_me:${as_lineno-$LINENO}: result: /dev/epoll" >&5 -$as_echo "/dev/epoll" >&6; } - $as_echo "#define PJ_HAS_LINUX_EPOLL 1" >>confdefs.h + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: /dev/epoll" >&5 +printf "%s\n" "/dev/epoll" >&6; } + printf "%s\n" "#define PJ_HAS_LINUX_EPOLL 1" >>confdefs.h ac_linux_poll=epoll -else +else $as_nop ac_os_objs=ioqueue_select.o - { $as_echo "$as_me:${as_lineno-$LINENO}: result: select()" >&5 -$as_echo "select()" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: select()" >&5 +printf "%s\n" "select()" >&6; } ac_linux_poll=select fi @@ -5914,16 +6471,33 @@ # Check whether --enable-shared was given. -if test "${enable_shared+set}" = set; then : +if test ${enable_shared+y} +then : enableval=$enable_shared; if test "$enable_shared" = "yes"; then ac_shared_libraries=1 CFLAGS="$CFLAGS -fPIC" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: Building shared libraries... yes" >&5 -$as_echo "Building shared libraries... yes" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: Building shared libraries... yes" >&5 +printf "%s\n" "Building shared libraries... yes" >&6; } fi -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: Building shared libraries... no" >&5 -$as_echo "Building shared libraries... no" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: Building shared libraries... no" >&5 +printf "%s\n" "Building shared libraries... no" >&6; } + +fi + + + +# Check whether --enable-pjsua2 was given. +if test ${enable_pjsua2+y} +then : + enableval=$enable_pjsua2; if test "$enable_pjsua2" = "no"; then + ac_no_pjsua2=1 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: Building pjsua2 library and application... no" >&5 +printf "%s\n" "Building pjsua2 library and application... no" >&6; } + fi +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: Building pjsua2 library and application... yes" >&5 +printf "%s\n" "Building pjsua2 library and application... yes" >&6; } fi @@ -5952,11 +6526,23 @@ ac_os_objs="$ac_os_objs sock_qos_bsd.o" ;; esac + # SSL + case $target in + *darwin*) + ac_os_objs="$ac_os_objs ssl_sock_apple.o" + ;; + esac # UUID case $target in *android*) ac_os_objs="$ac_os_objs guid_android.o" ;; + *darwin*) + ac_os_objs="$ac_os_objs guid_darwin.o" + ;; + *bsd*) + ac_os_objs="$ac_os_objs guid_bsd.o" + ;; *) if test "$ac_has_uuid_lib" = "1" -a "$ac_has_uuid_h" = "1"; then ac_os_objs="$ac_os_objs guid_uuid.o" @@ -5973,36 +6559,38 @@ # Check whether --with-external-speex was given. -if test "${with_external_speex+set}" = set; then : +if test ${with_external_speex+y} +then : withval=$with_external_speex; if test "x$with_external_speex" != "xno"; then # Test Speex installation - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if external Speex devkit is installed" >&5 -$as_echo_n "checking if external Speex devkit is installed... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if external Speex devkit is installed" >&5 +printf %s "checking if external Speex devkit is installed... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int -main () +main (void) { speex_echo_state_init(0, 0); speex_encoder_init(0); ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes!!" >&5 -$as_echo "yes!!" >&6; } - $as_echo "#define PJMEDIA_EXTERNAL_SPEEX_CODEC 1" >>confdefs.h +if ac_fn_c_try_compile "$LINENO" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes!!" >&5 +printf "%s\n" "yes!!" >&6; } + printf "%s\n" "#define PJMEDIA_EXTERNAL_SPEEX_CODEC 1" >>confdefs.h ac_external_speex="1" -else +else $as_nop as_fn_error $? "Unable to use external Speex library. If Speex development files are not available in the default locations, use CFLAGS and LDFLAGS env var to set the include/lib paths" "$LINENO" 5 fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi @@ -6013,68 +6601,71 @@ # Check whether --with-external-gsm was given. -if test "${with_external_gsm+set}" = set; then : +if test ${with_external_gsm+y} +then : withval=$with_external_gsm; if test "x$with_external_gsm" != "xno"; then # Test GSM library installation - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if external GSM devkit is installed as gsm/gsm.h" >&5 -$as_echo_n "checking if external GSM devkit is installed as gsm/gsm.h... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if external GSM devkit is installed as gsm/gsm.h" >&5 +printf %s "checking if external GSM devkit is installed as gsm/gsm.h... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int -main () +main (void) { gsm_create(); ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes!!" >&5 -$as_echo "yes!!" >&6; } - $as_echo "#define PJMEDIA_EXTERNAL_GSM_CODEC 1" >>confdefs.h +if ac_fn_c_try_compile "$LINENO" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes!!" >&5 +printf "%s\n" "yes!!" >&6; } + printf "%s\n" "#define PJMEDIA_EXTERNAL_GSM_CODEC 1" >>confdefs.h - $as_echo "#define PJMEDIA_EXTERNAL_GSM_GSM_H 1" >>confdefs.h + printf "%s\n" "#define PJMEDIA_EXTERNAL_GSM_GSM_H 1" >>confdefs.h ac_external_gsm="1" -else +else $as_nop - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if external GSM devkit is installed as gsm.h" >&5 -$as_echo_n "checking if external GSM devkit is installed as gsm.h... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if external GSM devkit is installed as gsm.h" >&5 +printf %s "checking if external GSM devkit is installed as gsm.h... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int -main () +main (void) { gsm_create(); ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes!!" >&5 -$as_echo "yes!!" >&6; } - $as_echo "#define PJMEDIA_EXTERNAL_GSM_CODEC 1" >>confdefs.h +if ac_fn_c_try_compile "$LINENO" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes!!" >&5 +printf "%s\n" "yes!!" >&6; } + printf "%s\n" "#define PJMEDIA_EXTERNAL_GSM_CODEC 1" >>confdefs.h - $as_echo "#define PJMEDIA_EXTERNAL_GSM_H 1" >>confdefs.h + printf "%s\n" "#define PJMEDIA_EXTERNAL_GSM_H 1" >>confdefs.h ac_external_gsm="1" -else +else $as_nop as_fn_error $? "Unable to use external GSM library. If GSM development files are not available in the default locations, use CFLAGS and LDFLAGS env var to set the include/lib paths" "$LINENO" 5 fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi @@ -6087,55 +6678,58 @@ # Check whether --with-external-srtp was given. -if test "${with_external_srtp+set}" = set; then : +if test ${with_external_srtp+y} +then : withval=$with_external_srtp; if test "x$with_external_srtp" != "xno"; then # Test SRTP installation - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if external SRTP devkit is installed" >&5 -$as_echo_n "checking if external SRTP devkit is installed... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if external SRTP devkit is installed" >&5 +printf %s "checking if external SRTP devkit is installed... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int -main () +main (void) { srtp_init(); ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes: version 2.x" >&5 -$as_echo "yes: version 2.x" >&6; } +if ac_fn_c_try_compile "$LINENO" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes: version 2.x" >&5 +printf "%s\n" "yes: version 2.x" >&6; } ac_external_srtp="2" ac_external_srtp_lib="srtp2" -else +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int -main () +main (void) { srtp_init(); ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes: version 1.x" >&5 -$as_echo "yes: version 1.x" >&6; } +if ac_fn_c_try_compile "$LINENO" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes: version 1.x" >&5 +printf "%s\n" "yes: version 1.x" >&6; } ac_external_srtp="1" ac_external_srtp_lib="srtp" -else +else $as_nop as_fn_error $? "Unable to use SRTP. If SRTP development files are not available in the default locations, use CFLAGS and LDFLAGS env var to set the include/lib paths" "$LINENO" 5 fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi @@ -6147,12 +6741,13 @@ ac_srtp_shutdown_present=0 - as_ac_Lib=`$as_echo "ac_cv_lib_$ac_external_srtp_lib''_srtp_deinit" | $as_tr_sh` -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for srtp_deinit in -l$ac_external_srtp_lib" >&5 -$as_echo_n "checking for srtp_deinit in -l$ac_external_srtp_lib... " >&6; } -if eval \${$as_ac_Lib+:} false; then : - $as_echo_n "(cached) " >&6 -else + as_ac_Lib=`printf "%s\n" "ac_cv_lib_$ac_external_srtp_lib""_srtp_deinit" | $as_tr_sh` +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for srtp_deinit in -l$ac_external_srtp_lib" >&5 +printf %s "checking for srtp_deinit in -l$ac_external_srtp_lib... " >&6; } +if eval test \${$as_ac_Lib+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-l$ac_external_srtp_lib $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -6161,41 +6756,41 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char srtp_deinit (); int -main () +main (void) { return srtp_deinit (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : eval "$as_ac_Lib=yes" -else +else $as_nop eval "$as_ac_Lib=no" fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi eval ac_res=\$$as_ac_Lib - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if eval test \"x\$"$as_ac_Lib"\" = x"yes"; then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } +if eval test \"x\$"$as_ac_Lib"\" = x"yes" +then : ac_srtp_deinit_present=1 fi if test "x$ac_srtp_deinit_present" != "x1"; then - as_ac_Lib=`$as_echo "ac_cv_lib_$ac_external_srtp_lib''_srtp_shutdown" | $as_tr_sh` -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for srtp_shutdown in -l$ac_external_srtp_lib" >&5 -$as_echo_n "checking for srtp_shutdown in -l$ac_external_srtp_lib... " >&6; } -if eval \${$as_ac_Lib+:} false; then : - $as_echo_n "(cached) " >&6 -else + as_ac_Lib=`printf "%s\n" "ac_cv_lib_$ac_external_srtp_lib""_srtp_shutdown" | $as_tr_sh` +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for srtp_shutdown in -l$ac_external_srtp_lib" >&5 +printf %s "checking for srtp_shutdown in -l$ac_external_srtp_lib... " >&6; } +if eval test \${$as_ac_Lib+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-l$ac_external_srtp_lib $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -6204,31 +6799,30 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char srtp_shutdown (); int -main () +main (void) { return srtp_shutdown (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : eval "$as_ac_Lib=yes" -else +else $as_nop eval "$as_ac_Lib=no" fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi eval ac_res=\$$as_ac_Lib - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if eval test \"x\$"$as_ac_Lib"\" = x"yes"; then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } +if eval test \"x\$"$as_ac_Lib"\" = x"yes" +then : ac_srtp_shutdown_present=1 fi @@ -6240,32 +6834,34 @@ # Check whether --with-external-yuv was given. -if test "${with_external_yuv+set}" = set; then : +if test ${with_external_yuv+y} +then : withval=$with_external_yuv; if test "x$with_external_yuv" != "xno"; then # Test libyuv installation - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if external libyuv devkit is installed" >&5 -$as_echo_n "checking if external libyuv devkit is installed... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if external libyuv devkit is installed" >&5 +printf %s "checking if external libyuv devkit is installed... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int -main () +main (void) { RGB24ToI420(0,0,0,0,0,0,0,0,0,0); ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes!!" >&5 -$as_echo "yes!!" >&6; } +if ac_fn_c_try_compile "$LINENO" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes!!" >&5 +printf "%s\n" "yes!!" >&6; } ac_external_yuv="1" -else +else $as_nop as_fn_error $? "Unable to use external libyuv. If libyuv development files are not available in the default locations, use CFLAGS and LDFLAGS env var to set the include/lib paths" "$LINENO" 5 fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi @@ -6277,34 +6873,76 @@ # Check whether --with-external-webrtc was given. -if test "${with_external_webrtc+set}" = set; then : +if test ${with_external_webrtc+y} +then : withval=$with_external_webrtc; if test "x$with_external_webrtc" != "xno"; then # Test webrtc installation - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if external webrtc devkit is installed" >&5 -$as_echo_n "checking if external webrtc devkit is installed... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if external webrtc devkit is installed" >&5 +printf %s "checking if external webrtc devkit is installed... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int -main () +main (void) { WebRtcAec_Create(); ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes!!" >&5 -$as_echo "yes!!" >&6; } +if ac_fn_c_try_compile "$LINENO" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes!!" >&5 +printf "%s\n" "yes!!" >&6; } ac_external_webrtc="1" -else +else $as_nop as_fn_error $? "Unable to use external webrtc. If webrtc development files are not available in the default locations, use CFLAGS and LDFLAGS env var to set the include/lib paths" "$LINENO" 5 fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + fi + + +fi + + + +ac_external_webrtc_aec3=0 + + +# Check whether --with-external-webrtc-aec3 was given. +if test ${with_external_webrtc_aec3+y} +then : + withval=$with_external_webrtc_aec3; + if test "x$with_external_webrtc_aec3" != "xno"; then + # Test webrtc AEC3 installation + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if external webrtc AEC3 is installed" >&5 +printf %s "checking if external webrtc AEC3 is installed... " >&6; } + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include "modules/audio_processing/aec3/echo_canceller3.h" + +int +main (void) +{ +EchoCanceller3 ec(EchoCanceller3Config(), 16000, 1, 1); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes!!" >&5 +printf "%s\n" "yes!!" >&6; } + ac_external_webrtc_aec3="1" + +else $as_nop + as_fn_error $? "Unable to use external webrtc AEC3. If webrtc development files are not available in the default locations, use CFLAGS and LDFLAGS env var to set the include/lib paths" "$LINENO" 5 +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi @@ -6315,11 +6953,12 @@ ac_pjmedia_resample=libresample # Check whether --enable-resample was given. -if test "${enable_resample+set}" = set; then : +if test ${enable_resample+y} +then : enableval=$enable_resample; if test "$enable_resample" = "no"; then ac_pjmedia_resample=none - { $as_echo "$as_me:${as_lineno-$LINENO}: result: Checking if resampling is disabled...yes" >&5 -$as_echo "Checking if resampling is disabled...yes" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: Checking if resampling is disabled...yes" >&5 +printf "%s\n" "Checking if resampling is disabled...yes" >&6; } fi fi @@ -6327,11 +6966,12 @@ # Check whether --enable-sound was given. -if test "${enable_sound+set}" = set; then : +if test ${enable_sound+y} +then : enableval=$enable_sound; if test "$enable_sound" = "no"; then ac_pjmedia_snd=null - { $as_echo "$as_me:${as_lineno-$LINENO}: result: Checking if sound is disabled... yes" >&5 -$as_echo "Checking if sound is disabled... yes" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: Checking if sound is disabled... yes" >&5 +printf "%s\n" "Checking if sound is disabled... yes" >&6; } fi fi @@ -6341,33 +6981,35 @@ # Check whether --with-external-pa was given. -if test "${with_external_pa+set}" = set; then : +if test ${with_external_pa+y} +then : withval=$with_external_pa; if test "x$with_external_pa" != "xno"; then # Test PortAudio installation - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if external PortAudio devkit is installed" >&5 -$as_echo_n "checking if external PortAudio devkit is installed... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if external PortAudio devkit is installed" >&5 +printf %s "checking if external PortAudio devkit is installed... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int -main () +main (void) { Pa_Initialize(); ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes!!" >&5 -$as_echo "yes!!" >&6; } +if ac_fn_c_try_compile "$LINENO" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes!!" >&5 +printf "%s\n" "yes!!" >&6; } ac_external_pa="1" -else +else $as_nop as_fn_error $? "Unable to use PortAudio. If PortAudio development files are not available in the default locations, use CFLAGS and LDFLAGS env var to set the include/lib paths" "$LINENO" 5 fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi @@ -6375,46 +7017,133 @@ -ac_fn_c_check_header_mongrel "$LINENO" "sys/soundcard.h" "ac_cv_header_sys_soundcard_h" "$ac_includes_default" -if test "x$ac_cv_header_sys_soundcard_h" = xyes; then : +ac_fn_c_check_header_compile "$LINENO" "sys/soundcard.h" "ac_cv_header_sys_soundcard_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_soundcard_h" = xyes +then : ac_pa_cflags="$ac_pa_cflags -DHAVE_SYS_SOUNDCARD_H" fi - -ac_fn_c_check_header_mongrel "$LINENO" "linux/soundcard.h" "ac_cv_header_linux_soundcard_h" "$ac_includes_default" -if test "x$ac_cv_header_linux_soundcard_h" = xyes; then : +ac_fn_c_check_header_compile "$LINENO" "linux/soundcard.h" "ac_cv_header_linux_soundcard_h" "$ac_includes_default" +if test "x$ac_cv_header_linux_soundcard_h" = xyes +then : ac_pa_cflags="$ac_pa_cflags -DHAVE_LINUX_SOUNDCARD_H" fi - -ac_fn_c_check_header_mongrel "$LINENO" "machine/soundcard.h" "ac_cv_header_machine_soundcard_h" "$ac_includes_default" -if test "x$ac_cv_header_machine_soundcard_h" = xyes; then : +ac_fn_c_check_header_compile "$LINENO" "machine/soundcard.h" "ac_cv_header_machine_soundcard_h" "$ac_includes_default" +if test "x$ac_cv_header_machine_soundcard_h" = xyes +then : ac_pa_cflags="$ac_pa_cflags -DHAVE_MACHINE_SOUNDCARD_H" fi - if test "x$ac_cv_c_bigendian" = "xyes"; then ac_pa_cflags="$ac_pa_cflags -DPA_BIG_ENDIAN" else ac_pa_cflags="$ac_pa_cflags -DPA_LITTLE_ENDIAN" fi + + + + +# Check whether --with-oboe was given. +if test ${with_oboe+y} +then : + withval=$with_oboe; + if test "x$with_oboe" != "xno" -a "x$with_oboe" != "x"; then + OBOE_PREFIX=$with_oboe + OBOE_CFLAGS="-I$OBOE_PREFIX/prefab/modules/oboe/include" + OBOE_LDFLAGS="-L$OBOE_PREFIX/prefab/modules/oboe/libs/android.$TARGET_ABI" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: Using Oboe prefix... $with_oboe" >&5 +printf "%s\n" "Using Oboe prefix... $with_oboe" >&6; } + else + OBOE_CFLAGS="" + OBOE_LDFLAGS="" + fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking Oboe usability" >&5 +printf %s "checking Oboe usability... " >&6; } + + OBOE_LIBS="-loboe -lOpenSLES -llog" + + SAVED_LIBS="$LIBS" + SAVED_LDFLAGS="$LDFLAGS" + SAVED_CXXFLAGS="$CXXFLAGS" + + LIBS="$OBOE_LIBS $LIBS" + LDFLAGS="$OBOE_LDFLAGS $LDFLAGS" + CXXFLAGS="$OBOE_CFLAGS $CXXFLAGS" + + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main (void) +{ +oboe::AudioStreamBuilder sb; sb.setDeviceId(0); + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_link "$LINENO" +then : + ac_oboe_cflags="-DPJMEDIA_AUDIO_DEV_HAS_OBOE=1 $OBOE_CFLAGS" + ac_oboe_ldflags="$OBOE_LDFLAGS $OBOE_LIBS" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + +else $as_nop + + LIBS="$SAVED_LIBS" + LDFLAGS="$SAVED_LDFLAGS" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + + # Put back original CXXFLAGS as app won't needed it. + CXXFLAGS="$SAVED_CFLAGS" + + +fi + + + if test "$enable_sound" = "no"; then true; else case $target in *android*) - LIBS="$LIBS -lOpenSLES" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: Checking sound device backend... OpenSL ES" >&5 -$as_echo "Checking sound device backend... OpenSL ES" >&6; } + if test "x$ac_oboe_cflags" != "x"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: Checking sound device backend... Oboe" >&5 +printf "%s\n" "Checking sound device backend... Oboe" >&6; } + else + LIBS="$LIBS -lOpenSLES" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: Checking sound device backend... Android" >&5 +printf "%s\n" "Checking sound device backend... Android" >&6; } + fi ;; *-apple-darwin_ios*) LIBS="$LIBS -framework CoreAudio -framework CoreFoundation -framework AudioToolbox -framework CFNetwork -framework UIKit -framework AVFoundation" ac_pjmedia_audiodev_objs="coreaudio_dev.o" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: Checking sound device backend... AudioUnit" >&5 -$as_echo "Checking sound device backend... AudioUnit" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: Checking sound device backend... AudioUnit" >&5 +printf "%s\n" "Checking sound device backend... AudioUnit" >&6; } ;; *darwin*) LIBS="$LIBS -framework CoreAudio -framework CoreServices -framework AudioUnit -framework AudioToolbox" @@ -6423,40 +7152,40 @@ #ac_pa_cflags="$ac_pa_cflags -DPA_OLD_CORE_AUDIO -DMOSX_USE_NON_ATOMIC_FLAG_BITS" #AC_MSG_RESULT([Setting additional PortAudio CFLAGS.. -DPA_OLD_CORE_AUDIO -DMOSX_USE_NON_ATOMIC_FLAG_BITS]) #ac_pjmedia_snd=pa_old_darwinos - { $as_echo "$as_me:${as_lineno-$LINENO}: result: Checking sound device backend... old coreaudio" >&5 -$as_echo "Checking sound device backend... old coreaudio" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: Checking sound device backend... old coreaudio" >&5 +printf "%s\n" "Checking sound device backend... old coreaudio" >&6; } else ac_pjmedia_snd=coreaudio - { $as_echo "$as_me:${as_lineno-$LINENO}: result: Checking sound device backend... coreaudio" >&5 -$as_echo "Checking sound device backend... coreaudio" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: Checking sound device backend... coreaudio" >&5 +printf "%s\n" "Checking sound device backend... coreaudio" >&6; } fi ;; *cygwin* | *mingw*) ac_pjmedia_snd=win32 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: Checking sound device backend... win32 sound" >&5 -$as_echo "Checking sound device backend... win32 sound" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: Checking sound device backend... win32 sound" >&5 +printf "%s\n" "Checking sound device backend... win32 sound" >&6; } ;; *rtems*) ac_pjmedia_snd=null - { $as_echo "$as_me:${as_lineno-$LINENO}: result: Checking sound device backend... null sound" >&5 -$as_echo "Checking sound device backend... null sound" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: Checking sound device backend... null sound" >&5 +printf "%s\n" "Checking sound device backend... null sound" >&6; } ;; *) if test "x$ac_external_pa" != "x1"; then - ac_fn_c_check_header_mongrel "$LINENO" "alsa/version.h" "ac_cv_header_alsa_version_h" "$ac_includes_default" -if test "x$ac_cv_header_alsa_version_h" = xyes; then : + ac_fn_c_check_header_compile "$LINENO" "alsa/version.h" "ac_cv_header_alsa_version_h" "$ac_includes_default" +if test "x$ac_cv_header_alsa_version_h" = xyes +then : LIBS="$LIBS -lasound" ac_pjmedia_snd=alsa fi - if test "x$ac_pjmedia_snd" = "xalsa"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: Checking sound device backend... alsa" >&5 -$as_echo "Checking sound device backend... alsa" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: Checking sound device backend... alsa" >&5 +printf "%s\n" "Checking sound device backend... alsa" >&6; } else ac_pjmedia_snd=null - { $as_echo "$as_me:${as_lineno-$LINENO}: result: Checking sound device backend... null sound" >&5 -$as_echo "Checking sound device backend... null sound" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: Checking sound device backend... null sound" >&5 +printf "%s\n" "Checking sound device backend... null sound" >&6; } fi fi ;; @@ -6465,24 +7194,28 @@ -# Disable video on mingw +# Disable video on mingw by default (but respect --enable-video=yes) case $target in *mingw*) + if test ! "$enable_video" = "yes"; then enable_video="no" + fi ;; esac # Check whether --enable-video was given. -if test "${enable_video+set}" = set; then : +if test ${enable_video+y} +then : enableval=$enable_video; if test "$enable_video" = "no"; then #AC_DEFINE(PJMEDIA_HAS_VIDEO,0) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: Video is disabled" >&5 -$as_echo "Video is disabled" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: Video is disabled" >&5 +printf "%s\n" "Video is disabled" >&6; } enable_sdl="no" enable_ffmpeg="no" enable_v4l2="no" enable_openh264="no" enable_libyuv="no" + enable_vpx="no" fi fi @@ -6508,37 +7241,50 @@ SAVED_LIBS="$LIBS" - LIBS="-lGLESv2 -lEGL -landroid -lgcc -lc" + LIBS="-lGLESv2 -lEGL -landroid -lc" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int -main () +main (void) { ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_pjmedia_video_has_android=yes -else +else $as_nop ac_pjmedia_video_has_android=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS="$SAVED_LIBS" if test "$ac_pjmedia_video_has_android" = "yes"; then ac_android_cflags="-DPJMEDIA_VIDEO_DEV_HAS_ANDROID_OPENGL=1" LIBS="$LIBS -lGLESv2 -lEGL -landroid" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: Checking if OpenGL ES 2 is available... yes" >&5 -$as_echo "Checking if OpenGL ES 2 is available... yes" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: Checking if OpenGL ES 2 is available... yes" >&5 +printf "%s\n" "Checking if OpenGL ES 2 is available... yes" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: Checking if OpenGL ES 2 is available... no" >&5 -$as_echo "Checking if OpenGL ES 2 is available... no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: Checking if OpenGL ES 2 is available... no" >&5 +printf "%s\n" "Checking if OpenGL ES 2 is available... no" >&6; } fi ac_android_cflags="$ac_android_cflags -DPJMEDIA_VIDEO_DEV_HAS_ANDROID=1" ;; + *mingw*) + if test "$enable_video" = "yes"; then + ac_pjmedia_video=windows_os + + ac_pjmedia_video_dev_has_dshow=yes + + ac_dshow_cflags="-DPJMEDIA_HAS_VIDEO=1 -DPJMEDIA_VIDEO_DEV_HAS_DSHOW=1" + + ac_dshow_ldflags=" -lstdc++ -lquartz -lole32 -loleaut32 -lrpcrt4 -lwinmm -luuid -lmingwex -lstrmiids " + LIBS="$LIBS -lstdc++ -lquartz -lole32 -loleaut32 -lrpcrt4 -lwinmm -luuid -lmingwex -lstrmiids " + fi + ;; *darwin*) ac_pjmedia_video=darwin_os @@ -6551,85 +7297,88 @@ /* end confdefs.h. */ int -main () +main (void) { ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_pjmedia_video_has_darwin=yes -else +else $as_nop ac_pjmedia_video_has_darwin=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS="-framework VideoToolbox" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int -main () +main (void) { ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_pjmedia_video_has_vtoolbox=yes -else +else $as_nop ac_pjmedia_video_has_vtoolbox=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS="-framework OpenGLES" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int -main () +main (void) { ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_pjmedia_video_has_ios_opengl=yes -else +else $as_nop ac_pjmedia_video_has_ios_opengl=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS="$SAVED_LIBS" if test "$ac_pjmedia_video_has_darwin" = "yes"; then ac_darwin_cflags="-DPJMEDIA_VIDEO_DEV_HAS_DARWIN=1" LIBS="$LIBS -framework AVFoundation -framework CoreGraphics -framework QuartzCore -framework CoreVideo -framework CoreMedia" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: Checking if AVFoundation framework is available... yes" >&5 -$as_echo "Checking if AVFoundation framework is available... yes" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: Checking if AVFoundation framework is available... yes" >&5 +printf "%s\n" "Checking if AVFoundation framework is available... yes" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: Checking if AVFoundation framework is available... no" >&5 -$as_echo "Checking if AVFoundation framework is available... no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: Checking if AVFoundation framework is available... no" >&5 +printf "%s\n" "Checking if AVFoundation framework is available... no" >&6; } fi if test "$ac_pjmedia_video_has_vtoolbox" = "yes"; then #ac_darwin_cflags+=" -DPJMEDIA_HAS_VID_TOOLBOX_CODEC=1" LIBS="$LIBS -framework VideoToolbox" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: Checking if VideoToolbox framework is available... yes" >&5 -$as_echo "Checking if VideoToolbox framework is available... yes" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: Checking if VideoToolbox framework is available... yes" >&5 +printf "%s\n" "Checking if VideoToolbox framework is available... yes" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: Checking if VideoToolbox framework is available... no" >&5 -$as_echo "Checking if VideoToolbox framework is available... no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: Checking if VideoToolbox framework is available... no" >&5 +printf "%s\n" "Checking if VideoToolbox framework is available... no" >&6; } fi if test "$ac_pjmedia_video_has_ios_opengl" = "yes"; then ac_darwin_cflags+=" -DPJMEDIA_VIDEO_DEV_HAS_IOS_OPENGL=1" LIBS="$LIBS -framework OpenGLES" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: Checking if OpenGLES framework is available... yes" >&5 -$as_echo "Checking if OpenGLES framework is available... yes" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: Checking if OpenGLES framework is available... yes" >&5 +printf "%s\n" "Checking if OpenGLES framework is available... yes" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: Checking if OpenGLES framework is available... no" >&5 -$as_echo "Checking if OpenGLES framework is available... no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: Checking if OpenGLES framework is available... no" >&5 +printf "%s\n" "Checking if OpenGLES framework is available... no" >&6; } fi if false; then # QTKit is deprecated, see ticket #1931. @@ -6642,29 +7391,30 @@ /* end confdefs.h. */ int -main () +main (void) { ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_pjmedia_video_has_qt=yes -else +else $as_nop ac_pjmedia_video_has_qt=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS="$SAVED_LIBS" if test "$ac_pjmedia_video_has_qt" = "yes"; then ac_qt_cflags="-DPJMEDIA_VIDEO_DEV_HAS_QT=1" LIBS="$LIBS -framework QTKit -framework QuartzCore -framework OpenGL" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: Checking if QTKit framework is available... yes" >&5 -$as_echo "Checking if QTKit framework is available... yes" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: Checking if QTKit framework is available... yes" >&5 +printf "%s\n" "Checking if QTKit framework is available... yes" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: Checking if QTKit framework is available... no" >&5 -$as_echo "Checking if QTKit framework is available... no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: Checking if QTKit framework is available... no" >&5 +printf "%s\n" "Checking if QTKit framework is available... no" >&6; } fi fi ;; @@ -6672,11 +7422,12 @@ fi # Check whether --enable-ext_sound was given. -if test "${enable_ext_sound+set}" = set; then : +if test ${enable_ext_sound+y} +then : enableval=$enable_ext_sound; if test "$enable_ext_sound" = "yes"; then ac_pjmedia_snd=external - { $as_echo "$as_me:${as_lineno-$LINENO}: result: Checking if external sound is set... yes" >&5 -$as_echo "Checking if external sound is set... yes" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: Checking if external sound is set... yes" >&5 +printf "%s\n" "Checking if external sound is set... yes" >&6; } fi fi @@ -6684,171 +7435,183 @@ # Check whether --enable-small-filter was given. -if test "${enable_small_filter+set}" = set; then : +if test ${enable_small_filter+y} +then : enableval=$enable_small_filter; if test "$enable_small_filter" = "no"; then ac_no_small_filter='-DPJMEDIA_HAS_SMALL_FILTER=0' - { $as_echo "$as_me:${as_lineno-$LINENO}: result: Checking if small filter is disabled... yes" >&5 -$as_echo "Checking if small filter is disabled... yes" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: Checking if small filter is disabled... yes" >&5 +printf "%s\n" "Checking if small filter is disabled... yes" >&6; } fi -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: Checking if small filter is disabled... no" >&5 -$as_echo "Checking if small filter is disabled... no" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: Checking if small filter is disabled... no" >&5 +printf "%s\n" "Checking if small filter is disabled... no" >&6; } fi # Check whether --enable-large-filter was given. -if test "${enable_large_filter+set}" = set; then : +if test ${enable_large_filter+y} +then : enableval=$enable_large_filter; if test "$enable_large_filter" = "no"; then ac_no_large_filter='-DPJMEDIA_HAS_LARGE_FILTER=0' - { $as_echo "$as_me:${as_lineno-$LINENO}: result: Checking if large filter is disabled... yes" >&5 -$as_echo "Checking if large filter is disabled... yes" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: Checking if large filter is disabled... yes" >&5 +printf "%s\n" "Checking if large filter is disabled... yes" >&6; } fi -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: Checking if large filter is disabled... no" >&5 -$as_echo "Checking if large filter is disabled... no" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: Checking if large filter is disabled... no" >&5 +printf "%s\n" "Checking if large filter is disabled... no" >&6; } fi # Check whether --enable-speex-aec was given. -if test "${enable_speex_aec+set}" = set; then : +if test ${enable_speex_aec+y} +then : enableval=$enable_speex_aec; if test "$enable_speex_aec" = "no"; then ac_no_speex_aec='-DPJMEDIA_HAS_SPEEX_AEC=0' - { $as_echo "$as_me:${as_lineno-$LINENO}: result: Checking if Speex AEC is disabled...yes" >&5 -$as_echo "Checking if Speex AEC is disabled...yes" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: Checking if Speex AEC is disabled...yes" >&5 +printf "%s\n" "Checking if Speex AEC is disabled...yes" >&6; } fi -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: Checking if Speex AEC is disabled...no" >&5 -$as_echo "Checking if Speex AEC is disabled...no" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: Checking if Speex AEC is disabled...no" >&5 +printf "%s\n" "Checking if Speex AEC is disabled...no" >&6; } fi # Check whether --enable-g711-codec was given. -if test "${enable_g711_codec+set}" = set; then : +if test ${enable_g711_codec+y} +then : enableval=$enable_g711_codec; if test "$enable_g711_codec" = "no"; then ac_no_g711_codec=1 - $as_echo "#define PJMEDIA_HAS_G711_CODEC 0" >>confdefs.h + printf "%s\n" "#define PJMEDIA_HAS_G711_CODEC 0" >>confdefs.h - { $as_echo "$as_me:${as_lineno-$LINENO}: result: Checking if G.711 codec is disabled...yes" >&5 -$as_echo "Checking if G.711 codec is disabled...yes" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: Checking if G.711 codec is disabled...yes" >&5 +printf "%s\n" "Checking if G.711 codec is disabled...yes" >&6; } fi -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: Checking if G.711 codec is disabled...no" >&5 -$as_echo "Checking if G.711 codec is disabled...no" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: Checking if G.711 codec is disabled...no" >&5 +printf "%s\n" "Checking if G.711 codec is disabled...no" >&6; } fi # Check whether --enable-l16-codec was given. -if test "${enable_l16_codec+set}" = set; then : +if test ${enable_l16_codec+y} +then : enableval=$enable_l16_codec; if test "$enable_l16_codec" = "no"; then ac_no_l16_codec=1 - $as_echo "#define PJMEDIA_HAS_L16_CODEC 0" >>confdefs.h + printf "%s\n" "#define PJMEDIA_HAS_L16_CODEC 0" >>confdefs.h - { $as_echo "$as_me:${as_lineno-$LINENO}: result: Checking if L16 codecs are disabled...yes" >&5 -$as_echo "Checking if L16 codecs are disabled...yes" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: Checking if L16 codecs are disabled...yes" >&5 +printf "%s\n" "Checking if L16 codecs are disabled...yes" >&6; } fi -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: Checking if L16 codec is disabled...no" >&5 -$as_echo "Checking if L16 codec is disabled...no" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: Checking if L16 codec is disabled...no" >&5 +printf "%s\n" "Checking if L16 codec is disabled...no" >&6; } fi # Check whether --enable-gsm-codec was given. -if test "${enable_gsm_codec+set}" = set; then : +if test ${enable_gsm_codec+y} +then : enableval=$enable_gsm_codec; if test "$enable_gsm_codec" = "no"; then ac_no_gsm_codec=1 - $as_echo "#define PJMEDIA_HAS_GSM_CODEC 0" >>confdefs.h + printf "%s\n" "#define PJMEDIA_HAS_GSM_CODEC 0" >>confdefs.h - { $as_echo "$as_me:${as_lineno-$LINENO}: result: Checking if GSM codec is disabled...yes" >&5 -$as_echo "Checking if GSM codec is disabled...yes" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: Checking if GSM codec is disabled...yes" >&5 +printf "%s\n" "Checking if GSM codec is disabled...yes" >&6; } fi -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: Checking if GSM codec is disabled...no" >&5 -$as_echo "Checking if GSM codec is disabled...no" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: Checking if GSM codec is disabled...no" >&5 +printf "%s\n" "Checking if GSM codec is disabled...no" >&6; } fi # Check whether --enable-g722-codec was given. -if test "${enable_g722_codec+set}" = set; then : +if test ${enable_g722_codec+y} +then : enableval=$enable_g722_codec; if test "$enable_g722_codec" = "no"; then ac_no_g722_codec=1 - $as_echo "#define PJMEDIA_HAS_G722_CODEC 0" >>confdefs.h + printf "%s\n" "#define PJMEDIA_HAS_G722_CODEC 0" >>confdefs.h - { $as_echo "$as_me:${as_lineno-$LINENO}: result: Checking if G.722 codec is disabled...yes" >&5 -$as_echo "Checking if G.722 codec is disabled...yes" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: Checking if G.722 codec is disabled...yes" >&5 +printf "%s\n" "Checking if G.722 codec is disabled...yes" >&6; } fi -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: Checking if G.722 codec is disabled...no" >&5 -$as_echo "Checking if G.722 codec is disabled...no" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: Checking if G.722 codec is disabled...no" >&5 +printf "%s\n" "Checking if G.722 codec is disabled...no" >&6; } fi # Check whether --enable-g7221-codec was given. -if test "${enable_g7221_codec+set}" = set; then : +if test ${enable_g7221_codec+y} +then : enableval=$enable_g7221_codec; if test "$enable_g7221_codec" = "no"; then ac_no_g7221_codec=1 - $as_echo "#define PJMEDIA_HAS_G7221_CODEC 0" >>confdefs.h + printf "%s\n" "#define PJMEDIA_HAS_G7221_CODEC 0" >>confdefs.h - { $as_echo "$as_me:${as_lineno-$LINENO}: result: Checking if G.722.1 codec is disabled...yes" >&5 -$as_echo "Checking if G.722.1 codec is disabled...yes" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: Checking if G.722.1 codec is disabled...yes" >&5 +printf "%s\n" "Checking if G.722.1 codec is disabled...yes" >&6; } fi -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: Checking if G.722.1 codec is disabled...no" >&5 -$as_echo "Checking if G.722.1 codec is disabled...no" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: Checking if G.722.1 codec is disabled...no" >&5 +printf "%s\n" "Checking if G.722.1 codec is disabled...no" >&6; } fi # Check whether --enable-speex-codec was given. -if test "${enable_speex_codec+set}" = set; then : +if test ${enable_speex_codec+y} +then : enableval=$enable_speex_codec; if test "$enable_speex_codec" = "no"; then ac_no_speex_codec=1 - $as_echo "#define PJMEDIA_HAS_SPEEX_CODEC 0" >>confdefs.h + printf "%s\n" "#define PJMEDIA_HAS_SPEEX_CODEC 0" >>confdefs.h - { $as_echo "$as_me:${as_lineno-$LINENO}: result: Checking if Speex codec is disabled...yes" >&5 -$as_echo "Checking if Speex codec is disabled...yes" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: Checking if Speex codec is disabled...yes" >&5 +printf "%s\n" "Checking if Speex codec is disabled...yes" >&6; } fi -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: Checking if Speex codec is disabled...no" >&5 -$as_echo "Checking if Speex codec is disabled...no" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: Checking if Speex codec is disabled...no" >&5 +printf "%s\n" "Checking if Speex codec is disabled...no" >&6; } fi # Check whether --enable-ilbc-codec was given. -if test "${enable_ilbc_codec+set}" = set; then : +if test ${enable_ilbc_codec+y} +then : enableval=$enable_ilbc_codec; if test "$enable_ilbc_codec" = "no"; then ac_no_ilbc_codec=1 - $as_echo "#define PJMEDIA_HAS_ILBC_CODEC 0" >>confdefs.h + printf "%s\n" "#define PJMEDIA_HAS_ILBC_CODEC 0" >>confdefs.h - { $as_echo "$as_me:${as_lineno-$LINENO}: result: Checking if iLBC codec is disabled...yes" >&5 -$as_echo "Checking if iLBC codec is disabled...yes" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: Checking if iLBC codec is disabled...yes" >&5 +printf "%s\n" "Checking if iLBC codec is disabled...yes" >&6; } fi -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: Checking if iLBC codec is disabled...no" >&5 -$as_echo "Checking if iLBC codec is disabled...no" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: Checking if iLBC codec is disabled...no" >&5 +printf "%s\n" "Checking if iLBC codec is disabled...no" >&6; } fi # Check whether --enable-libsamplerate was given. -if test "${enable_libsamplerate+set}" = set; then : +if test ${enable_libsamplerate+y} +then : enableval=$enable_libsamplerate; if test "$enable_libsamplerate" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: Checking if libsamplerate is enabled...yes" >&5 -$as_echo "Checking if libsamplerate is enabled...yes" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for src_new in -lsamplerate" >&5 -$as_echo_n "checking for src_new in -lsamplerate... " >&6; } -if ${ac_cv_lib_samplerate_src_new+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: Checking if libsamplerate is enabled...yes" >&5 +printf "%s\n" "Checking if libsamplerate is enabled...yes" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for src_new in -lsamplerate" >&5 +printf %s "checking for src_new in -lsamplerate... " >&6; } +if test ${ac_cv_lib_samplerate_src_new+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lsamplerate $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -6857,33 +7620,30 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char src_new (); int -main () +main (void) { return src_new (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_samplerate_src_new=yes -else +else $as_nop ac_cv_lib_samplerate_src_new=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_samplerate_src_new" >&5 -$as_echo "$ac_cv_lib_samplerate_src_new" >&6; } -if test "x$ac_cv_lib_samplerate_src_new" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_LIBSAMPLERATE 1 -_ACEOF +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_samplerate_src_new" >&5 +printf "%s\n" "$ac_cv_lib_samplerate_src_new" >&6; } +if test "x$ac_cv_lib_samplerate_src_new" = xyes +then : + printf "%s\n" "#define HAVE_LIBSAMPLERATE 1" >>confdefs.h LIBS="-lsamplerate $LIBS" @@ -6891,36 +7651,57 @@ ac_pjmedia_resample=libsamplerate else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: Checking if libsamplerate is enabled...no" >&5 -$as_echo "Checking if libsamplerate is enabled...no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: Checking if libsamplerate is enabled...no" >&5 +printf "%s\n" "Checking if libsamplerate is enabled...no" >&6; } fi -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: Checking if libsamplerate is enabled...no" >&5 -$as_echo "Checking if libsamplerate is enabled...no" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: Checking if libsamplerate is enabled...no" >&5 +printf "%s\n" "Checking if libsamplerate is enabled...no" >&6; } fi # Check whether --enable-resample_dll was given. -if test "${enable_resample_dll+set}" = set; then : +if test ${enable_resample_dll+y} +then : enableval=$enable_resample_dll; if test "$enable_resample_dll" = "yes"; then ac_resample_dll=1 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: Building libresample as shared library... yes" >&5 -$as_echo "Building libresample as shared library... yes" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: Building libresample as shared library... yes" >&5 +printf "%s\n" "Building libresample as shared library... yes" >&6; } fi -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: Building libresample as shared library... no" >&5 -$as_echo "Building libresample as shared library... no" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: Building libresample as shared library... no" >&5 +printf "%s\n" "Building libresample as shared library... no" >&6; } + +fi + +# Check whether --enable-speex-resample was given. +if test ${enable_speex_resample+y} +then : + enableval=$enable_speex_resample; + if test "$enable_speex_resample" = "yes"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: Checking if Speex resample is enabled... yes" >&5 +printf "%s\n" "Checking if Speex resample is enabled... yes" >&6; } + ac_pjmedia_resample=speex + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: Checking if Speex resample is enabled... no" >&5 +printf "%s\n" "Checking if Speex resample is enabled... no" >&6; } + fi + +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: Checking if Speex resample is enabled... no" >&5 +printf "%s\n" "Checking if Speex resample is enabled... no" >&6; } fi # Check whether --with-sdl was given. -if test "${with_sdl+set}" = set; then : +if test ${with_sdl+y} +then : withval=$with_sdl; -else +else $as_nop with_sdl=no fi @@ -6931,27 +7712,29 @@ fi # Check whether --enable-sdl was given. -if test "${enable_sdl+set}" = set; then : +if test ${enable_sdl+y} +then : enableval=$enable_sdl; if test "$enable_sdl" = "no"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: Checking if SDL is disabled... yes" >&5 -$as_echo "Checking if SDL is disabled... yes" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: Checking if SDL is disabled... yes" >&5 +printf "%s\n" "Checking if SDL is disabled... yes" >&6; } fi -else +else $as_nop if test "x$with_sdl" != "xno" -a "x$with_sdl" != "x"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: Using SDL prefix... $with_sdl" >&5 -$as_echo "Using SDL prefix... $with_sdl" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: Using SDL prefix... $with_sdl" >&5 +printf "%s\n" "Using SDL prefix... $with_sdl" >&6; } for ac_prog in sdl2-config sdl-config do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_SDL_CONFIG+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_SDL_CONFIG+y} +then : + printf %s "(cached) " >&6 +else $as_nop case $SDL_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_SDL_CONFIG="$SDL_CONFIG" # Let the user override the test with a path. @@ -6961,11 +7744,15 @@ for as_dir in $with_sdl/bin do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_SDL_CONFIG="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_SDL_CONFIG="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -6977,11 +7764,11 @@ fi SDL_CONFIG=$ac_cv_path_SDL_CONFIG if test -n "$SDL_CONFIG"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $SDL_CONFIG" >&5 -$as_echo "$SDL_CONFIG" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $SDL_CONFIG" >&5 +printf "%s\n" "$SDL_CONFIG" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -6993,11 +7780,12 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_SDL_CONFIG+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_SDL_CONFIG+y} +then : + printf %s "(cached) " >&6 +else $as_nop case $SDL_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_SDL_CONFIG="$SDL_CONFIG" # Let the user override the test with a path. @@ -7007,11 +7795,15 @@ for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_SDL_CONFIG="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_SDL_CONFIG="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -7023,11 +7815,11 @@ fi SDL_CONFIG=$ac_cv_path_SDL_CONFIG if test -n "$SDL_CONFIG"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $SDL_CONFIG" >&5 -$as_echo "$SDL_CONFIG" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $SDL_CONFIG" >&5 +printf "%s\n" "$SDL_CONFIG" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -7036,21 +7828,22 @@ fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking SDL availability" >&5 -$as_echo_n "checking SDL availability... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking SDL availability" >&5 +printf %s "checking SDL availability... " >&6; } if test "x$SDL_CONFIG" = "x"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 -$as_echo "not found" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: not found" >&5 +printf "%s\n" "not found" >&6; } elif (sh -c "$SDL_CONFIG --version" | grep -e '^1\.3' -e '^2\.') then ac_sdl_cflags=`$SDL_CONFIG --cflags` ac_sdl_cflags="-DPJMEDIA_VIDEO_DEV_HAS_SDL=1 $ac_sdl_cflags" ac_sdl_ldflags=`$SDL_CONFIG --libs` + ac_sdl_ldflags=${ac_sdl_ldflags//-mwindows/} LIBS="$LIBS $ac_sdl_ldflags" else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: Unsupported SDL version" >&5 -$as_echo "Unsupported SDL version" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: Unsupported SDL version" >&5 +printf "%s\n" "Unsupported SDL version" >&6; } fi fi @@ -7059,9 +7852,10 @@ # Check whether --with-ffmpeg was given. -if test "${with_ffmpeg+set}" = set; then : +if test ${with_ffmpeg+y} +then : withval=$with_ffmpeg; -else +else $as_nop with_ffmpeg=no fi @@ -7072,16 +7866,17 @@ fi # Check whether --enable-ffmpeg was given. -if test "${enable_ffmpeg+set}" = set; then : +if test ${enable_ffmpeg+y} +then : enableval=$enable_ffmpeg; ac_has_ffmpeg=0 if test "$enable_ffmpeg" = "no"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: Checking if ffmpeg is disabled... yes" >&5 -$as_echo "Checking if ffmpeg is disabled... yes" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: Checking if ffmpeg is disabled... yes" >&5 +printf "%s\n" "Checking if ffmpeg is disabled... yes" >&6; } fi -else +else $as_nop @@ -7091,8 +7886,8 @@ SAVED_PKG_CONFIG_PATH=$PKG_CONFIG_PATH if test "x$with_ffmpeg" != "xno" -a "x$with_ffmpeg" != "x"; then FFMPEG_PREFIX=$with_ffmpeg - { $as_echo "$as_me:${as_lineno-$LINENO}: result: Using ffmpeg prefix... $FFMPEG_PREFIX" >&5 -$as_echo "Using ffmpeg prefix... $FFMPEG_PREFIX" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: Using ffmpeg prefix... $FFMPEG_PREFIX" >&5 +printf "%s\n" "Using ffmpeg prefix... $FFMPEG_PREFIX" >&6; } export PKG_CONFIG_PATH=$FFMPEG_PREFIX/lib/pkgconfig fi @@ -7100,11 +7895,12 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_PKG_CONFIG+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_PKG_CONFIG+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$PKG_CONFIG"; then ac_cv_prog_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test. else @@ -7112,11 +7908,15 @@ for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_PKG_CONFIG="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -7127,11 +7927,11 @@ fi PKG_CONFIG=$ac_cv_prog_PKG_CONFIG if test -n "$PKG_CONFIG"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5 -$as_echo "$PKG_CONFIG" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5 +printf "%s\n" "$PKG_CONFIG" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -7141,8 +7941,8 @@ if test "$PKG_CONFIG" != "none"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking ffmpeg packages" >&5 -$as_echo_n "checking ffmpeg packages... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking ffmpeg packages" >&5 +printf %s "checking ffmpeg packages... " >&6; } av_pkg="" if $PKG_CONFIG --exists libavdevice; then ac_ffmpeg_cflags="$ac_ffmpeg_cflags -DPJMEDIA_HAS_LIBAVDEVICE=1" @@ -7166,11 +7966,11 @@ fi if test "x$av_pkg" == "x"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: none detected (check the prefix)! **" >&5 -$as_echo "none detected (check the prefix)! **" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none detected (check the prefix)! **" >&5 +printf "%s\n" "none detected (check the prefix)! **" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $av_pkg" >&5 -$as_echo "$av_pkg" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $av_pkg" >&5 +printf "%s\n" "$av_pkg" >&6; } fi ac_ffmpeg_cflags="$ac_ffmpeg_cflags `$PKG_CONFIG --cflags $av_pkg`" @@ -7178,18 +7978,19 @@ else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: *** Warning: neither pkg-config nor python is available, ffmpeg dependency cannot be calculated. If ffmpeg libraries are not detected, you need to specify the correct CFLAGS and LDFLAGS settings for ffmpeg prior to invoking configure ***" >&5 -$as_echo "*** Warning: neither pkg-config nor python is available, ffmpeg dependency cannot be calculated. If ffmpeg libraries are not detected, you need to specify the correct CFLAGS and LDFLAGS settings for ffmpeg prior to invoking configure ***" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: *** Warning: neither pkg-config nor python is available, ffmpeg dependency cannot be calculated. If ffmpeg libraries are not detected, you need to specify the correct CFLAGS and LDFLAGS settings for ffmpeg prior to invoking configure ***" >&5 +printf "%s\n" "*** Warning: neither pkg-config nor python is available, ffmpeg dependency cannot be calculated. If ffmpeg libraries are not detected, you need to specify the correct CFLAGS and LDFLAGS settings for ffmpeg prior to invoking configure ***" >&6; } LIBS="-L$FFMPEG_PREFIX/lib $LIBS" LDFLAGS="-L$FFMPEG_PREFIX/lib $LDFLAGS" CFLAGS="-I$FFMPEG_PREFIX/include $CFLAGS" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for avdevice_version in -lavdevice" >&5 -$as_echo_n "checking for avdevice_version in -lavdevice... " >&6; } -if ${ac_cv_lib_avdevice_avdevice_version+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for avdevice_version in -lavdevice" >&5 +printf %s "checking for avdevice_version in -lavdevice... " >&6; } +if test ${ac_cv_lib_avdevice_avdevice_version+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lavdevice $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -7198,41 +7999,41 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char avdevice_version (); int -main () +main (void) { return avdevice_version (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_avdevice_avdevice_version=yes -else +else $as_nop ac_cv_lib_avdevice_avdevice_version=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_avdevice_avdevice_version" >&5 -$as_echo "$ac_cv_lib_avdevice_avdevice_version" >&6; } -if test "x$ac_cv_lib_avdevice_avdevice_version" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_avdevice_avdevice_version" >&5 +printf "%s\n" "$ac_cv_lib_avdevice_avdevice_version" >&6; } +if test "x$ac_cv_lib_avdevice_avdevice_version" = xyes +then : ac_ffmpeg_cflags="$ac_ffmpeg_cflags -DPJMEDIA_HAS_LIBAVDEVICE=1" ac_ffmpeg_ldflags="$ac_ffmpeg_ldflags -lavdevice" fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for av_malloc in -lavutil" >&5 -$as_echo_n "checking for av_malloc in -lavutil... " >&6; } -if ${ac_cv_lib_avutil_av_malloc+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for av_malloc in -lavutil" >&5 +printf %s "checking for av_malloc in -lavutil... " >&6; } +if test ${ac_cv_lib_avutil_av_malloc+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lavutil $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -7241,41 +8042,41 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char av_malloc (); int -main () +main (void) { return av_malloc (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_avutil_av_malloc=yes -else +else $as_nop ac_cv_lib_avutil_av_malloc=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_avutil_av_malloc" >&5 -$as_echo "$ac_cv_lib_avutil_av_malloc" >&6; } -if test "x$ac_cv_lib_avutil_av_malloc" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_avutil_av_malloc" >&5 +printf "%s\n" "$ac_cv_lib_avutil_av_malloc" >&6; } +if test "x$ac_cv_lib_avutil_av_malloc" = xyes +then : ac_ffmpeg_cflags="$ac_ffmpeg_cflags -DPJMEDIA_HAS_LIBAVUTIL=1" ac_ffmpeg_ldflags="$ac_ffmpeg_ldflags -lavutil" fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for avcodec_init in -lavcodec" >&5 -$as_echo_n "checking for avcodec_init in -lavcodec... " >&6; } -if ${ac_cv_lib_avcodec_avcodec_init+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for avcodec_init in -lavcodec" >&5 +printf %s "checking for avcodec_init in -lavcodec... " >&6; } +if test ${ac_cv_lib_avcodec_avcodec_init+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lavcodec -lavutil $LIBS" @@ -7284,41 +8085,41 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif + builtin and then its argument prototype would still apply. */ char avcodec_init (); int -main () +main (void) { return avcodec_init (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_avcodec_avcodec_init=yes -else +else $as_nop ac_cv_lib_avcodec_avcodec_init=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_avcodec_avcodec_init" >&5 -$as_echo "$ac_cv_lib_avcodec_avcodec_init" >&6; } -if test "x$ac_cv_lib_avcodec_avcodec_init" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_avcodec_avcodec_init" >&5 +printf "%s\n" "$ac_cv_lib_avcodec_avcodec_init" >&6; } +if test "x$ac_cv_lib_avcodec_avcodec_init" = xyes +then : ac_ffmpeg_cflags="$ac_ffmpeg_cflags -DPJMEDIA_HAS_LIBAVCODEC=1" ac_ffmpeg_ldflags="$ac_ffmpeg_ldflags -lavcodec" fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for av_register_all in -lavformat" >&5 -$as_echo_n "checking for av_register_all in -lavformat... " >&6; } -if ${ac_cv_lib_avformat_av_register_all+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for av_register_all in -lavformat" >&5 +printf %s "checking for av_register_all in -lavformat... " >&6; } +if test ${ac_cv_lib_avformat_av_register_all+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lavformat -lavcodec -lavutil $LIBS" @@ -7328,40 +8129,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char av_register_all (); int -main () +main (void) { return av_register_all (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_avformat_av_register_all=yes -else +else $as_nop ac_cv_lib_avformat_av_register_all=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_avformat_av_register_all" >&5 -$as_echo "$ac_cv_lib_avformat_av_register_all" >&6; } -if test "x$ac_cv_lib_avformat_av_register_all" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_avformat_av_register_all" >&5 +printf "%s\n" "$ac_cv_lib_avformat_av_register_all" >&6; } +if test "x$ac_cv_lib_avformat_av_register_all" = xyes +then : ac_ffmpeg_cflags="$ac_ffmpeg_cflags -DPJMEDIA_HAS_LIBAVFORMAT=1" ac_ffmpeg_ldflags="$ac_ffmpeg_ldflags -lavformat" fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sws_scale in -lswscale" >&5 -$as_echo_n "checking for sws_scale in -lswscale... " >&6; } -if ${ac_cv_lib_swscale_sws_scale+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for sws_scale in -lswscale" >&5 +printf %s "checking for sws_scale in -lswscale... " >&6; } +if test ${ac_cv_lib_swscale_sws_scale+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lswscale -lavutil $LIBS" @@ -7371,40 +8172,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char sws_scale (); int -main () +main (void) { return sws_scale (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_swscale_sws_scale=yes -else +else $as_nop ac_cv_lib_swscale_sws_scale=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_swscale_sws_scale" >&5 -$as_echo "$ac_cv_lib_swscale_sws_scale" >&6; } -if test "x$ac_cv_lib_swscale_sws_scale" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_swscale_sws_scale" >&5 +printf "%s\n" "$ac_cv_lib_swscale_sws_scale" >&6; } +if test "x$ac_cv_lib_swscale_sws_scale" = xyes +then : ac_ffmpeg_cflags="$ac_ffmpeg_cflags -DPJMEDIA_HAS_LIBSWSCALE=1" ac_ffmpeg_ldflags="$ac_ffmpeg_ldflags -lswscale" fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for avcore_version in -lavcore" >&5 -$as_echo_n "checking for avcore_version in -lavcore... " >&6; } -if ${ac_cv_lib_avcore_avcore_version+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for avcore_version in -lavcore" >&5 +printf %s "checking for avcore_version in -lavcore... " >&6; } +if test ${ac_cv_lib_avcore_avcore_version+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lavcore $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -7413,30 +8214,29 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char avcore_version (); int -main () +main (void) { return avcore_version (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_avcore_avcore_version=yes -else +else $as_nop ac_cv_lib_avcore_avcore_version=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_avcore_avcore_version" >&5 -$as_echo "$ac_cv_lib_avcore_avcore_version" >&6; } -if test "x$ac_cv_lib_avcore_avcore_version" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_avcore_avcore_version" >&5 +printf "%s\n" "$ac_cv_lib_avcore_avcore_version" >&6; } +if test "x$ac_cv_lib_avcore_avcore_version" = xyes +then : ac_ffmpeg_cflags="$ac_ffmpeg_cflags -DPJMEDIA_HAS_LIBAVCORE=1" ac_ffmpeg_ldflags="$ac_ffmpeg_ldflags -lavcore" @@ -7449,14 +8249,13 @@ ac_fn_c_check_type "$LINENO" "enum AVPixelFormat" "ac_cv_type_enum_AVPixelFormat" "#include " -if test "x$ac_cv_type_enum_AVPixelFormat" = xyes; then : +if test "x$ac_cv_type_enum_AVPixelFormat" = xyes +then : -cat >>confdefs.h <<_ACEOF -#define HAVE_ENUM_AVPIXELFORMAT 1 -_ACEOF +printf "%s\n" "#define HAVE_ENUM_AVPIXELFORMAT 1" >>confdefs.h -else +else $as_nop ac_ffmpeg_cflags="$ac_ffmpeg_cflags -DPJMEDIA_USE_OLD_FFMPEG=1" fi @@ -7469,22 +8268,24 @@ # Check whether --enable-v4l2 was given. -if test "${enable_v4l2+set}" = set; then : +if test ${enable_v4l2+y} +then : enableval=$enable_v4l2; if test "$enable_v4l2" = "no"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: Checking if V4L2 is disabled... yes" >&5 -$as_echo "Checking if V4L2 is disabled... yes" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: Checking if V4L2 is disabled... yes" >&5 +printf "%s\n" "Checking if V4L2 is disabled... yes" >&6; } fi -else +else $as_nop - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for v4l2_open in -lv4l2" >&5 -$as_echo_n "checking for v4l2_open in -lv4l2... " >&6; } -if ${ac_cv_lib_v4l2_v4l2_open+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for v4l2_open in -lv4l2" >&5 +printf %s "checking for v4l2_open in -lv4l2... " >&6; } +if test ${ac_cv_lib_v4l2_v4l2_open+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lv4l2 $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -7493,30 +8294,29 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char v4l2_open (); int -main () +main (void) { return v4l2_open (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_v4l2_v4l2_open=yes -else +else $as_nop ac_cv_lib_v4l2_v4l2_open=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_v4l2_v4l2_open" >&5 -$as_echo "$ac_cv_lib_v4l2_v4l2_open" >&6; } -if test "x$ac_cv_lib_v4l2_v4l2_open" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_v4l2_v4l2_open" >&5 +printf "%s\n" "$ac_cv_lib_v4l2_v4l2_open" >&6; } +if test "x$ac_cv_lib_v4l2_v4l2_open" = xyes +then : ac_v4l2_cflags="-DPJMEDIA_VIDEO_DEV_HAS_V4L2=1" ac_v4l2_ldflags="-lv4l2" LIBS="$LIBS -lv4l2" @@ -7530,9 +8330,10 @@ # Check whether --with-openh264 was given. -if test "${with_openh264+set}" = set; then : +if test ${with_openh264+y} +then : withval=$with_openh264; -else +else $as_nop with_openh264=no fi @@ -7545,28 +8346,29 @@ # Check whether --enable-openh264 was given. -if test "${enable_openh264+set}" = set; then : +if test ${enable_openh264+y} +then : enableval=$enable_openh264; if test "$enable_openh264" = "no"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: Checking if OpenH264 is disabled... yes" >&5 -$as_echo "Checking if OpenH264 is disabled... yes" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: Checking if OpenH264 is disabled... yes" >&5 +printf "%s\n" "Checking if OpenH264 is disabled... yes" >&6; } fi -else +else $as_nop if test "x$with_openh264" != "xno" -a "x$with_openh264" != "x"; then OPENH264_PREFIX=$with_openh264 OPENH264_CFLAGS="-I$OPENH264_PREFIX/include" OPENH264_LDFLAGS="-L$OPENH264_PREFIX/lib" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: Using OpenH264 prefix... $with_openh264" >&5 -$as_echo "Using OpenH264 prefix... $with_openh264" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: Using OpenH264 prefix... $with_openh264" >&5 +printf "%s\n" "Using OpenH264 prefix... $with_openh264" >&6; } else OPENH264_CFLAGS="" OPENH264_LDFLAGS="" fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking OpenH264 usability" >&5 -$as_echo_n "checking OpenH264 usability... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking OpenH264 usability" >&5 +printf %s "checking OpenH264 usability... " >&6; } OPENH264_LIBS="-lopenh264 -lstdc++" @@ -7584,7 +8386,7 @@ #include int -main () +main (void) { WelsCreateSVCEncoder(0); @@ -7592,22 +8394,23 @@ return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_openh264_cflags="-DPJMEDIA_HAS_OPENH264_CODEC=1 $OPENH264_CFLAGS" ac_openh264_ldflags="$OPENH264_LDFLAGS $OPENH264_LIBS" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 -$as_echo "ok" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } -else +else $as_nop LIBS="$SAVED_LIBS" LDFLAGS="$SAVED_LDFLAGS" CFLAGS="$SAVED_CFLAGS" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext @@ -7616,9 +8419,10 @@ # Check whether --with-vpx was given. -if test "${with_vpx+set}" = set; then : +if test ${with_vpx+y} +then : withval=$with_vpx; -else +else $as_nop with_vpx=no fi @@ -7631,28 +8435,29 @@ # Check whether --enable-vpx was given. -if test "${enable_vpx+set}" = set; then : +if test ${enable_vpx+y} +then : enableval=$enable_vpx; if test "$enable_vpx" = "no"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: Checking if VPX is disabled... yes" >&5 -$as_echo "Checking if VPX is disabled... yes" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: Checking if VPX is disabled... yes" >&5 +printf "%s\n" "Checking if VPX is disabled... yes" >&6; } fi -else +else $as_nop if test "x$with_vpx" != "xno" -a "x$with_vpx" != "x"; then VPX_PREFIX=$with_vpx VPX_CFLAGS="-I$VPX_PREFIX/include" VPX_LDFLAGS="-L$VPX_PREFIX/lib" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: Using VPX prefix... $with_vpx" >&5 -$as_echo "Using VPX prefix... $with_vpx" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: Using VPX prefix... $with_vpx" >&5 +printf "%s\n" "Using VPX prefix... $with_vpx" >&6; } else VPX_CFLAGS="" VPX_LDFLAGS="" fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking VPX usability" >&5 -$as_echo_n "checking VPX usability... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking VPX usability" >&5 +printf %s "checking VPX usability... " >&6; } VPX_LIBS="-lvpx" @@ -7670,7 +8475,7 @@ #include int -main () +main (void) { vpx_codec_iface_t *(*enc_if)() = &vpx_codec_vp8_cx; @@ -7678,22 +8483,23 @@ return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_vpx_cflags="-DPJMEDIA_HAS_VPX_CODEC=1 $VPX_CFLAGS" ac_vpx_ldflags="$VPX_LDFLAGS $VPX_LIBS" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 -$as_echo "ok" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } -else +else $as_nop LIBS="$SAVED_LIBS" LDFLAGS="$SAVED_LDFLAGS" CFLAGS="$SAVED_CFLAGS" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext @@ -7702,9 +8508,10 @@ # Check whether --enable-ipp was given. -if test "${enable_ipp+set}" = set; then : +if test ${enable_ipp+y} +then : enableval=$enable_ipp; -else +else $as_nop enable_ipp=no fi @@ -7712,9 +8519,10 @@ # Check whether --with-ipp was given. -if test "${with_ipp+set}" = set; then : +if test ${with_ipp+y} +then : withval=$with_ipp; -else +else $as_nop with_ipp=no fi @@ -7722,9 +8530,10 @@ # Check whether --with-ipp-samples was given. -if test "${with_ipp_samples+set}" = set; then : +if test ${with_ipp_samples+y} +then : withval=$with_ipp_samples; -else +else $as_nop with_ipp_samples=no fi @@ -7732,41 +8541,42 @@ # Check whether --with-ipp-arch was given. -if test "${with_ipp_arch+set}" = set; then : +if test ${with_ipp_arch+y} +then : withval=$with_ipp_arch; -else +else $as_nop with_ipp_arch=no fi if test "x$enable_ipp" != "xno"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking Intel IPP location" >&5 -$as_echo_n "checking Intel IPP location... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking Intel IPP location" >&5 +printf %s "checking Intel IPP location... " >&6; } if test "x$with_ipp" != "xno" -a "x$with_ipp" != "x"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_ipp" >&5 -$as_echo "$with_ipp" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $with_ipp" >&5 +printf "%s\n" "$with_ipp" >&6; } IPPROOT=$with_ipp elif test "x$IPPROOT" = "x"; then if test -d /opt/intel/ipp; then IPPROOT=`ls -d /opt/intel/ipp/*/* | head -1` - { $as_echo "$as_me:${as_lineno-$LINENO}: result: autodetected in $IPPROOT" >&5 -$as_echo "autodetected in $IPPROOT" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: autodetected in $IPPROOT" >&5 +printf "%s\n" "autodetected in $IPPROOT" >&6; } fi else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $IPPROOT" >&5 -$as_echo "$IPPROOT" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $IPPROOT" >&5 +printf "%s\n" "$IPPROOT" >&6; } fi if test "x$with_ipp_arch" != "xno"; then IPP_SUFFIX=$with_ipp_arch - { $as_echo "$as_me:${as_lineno-$LINENO}: result: IPP arch suffix is set to $IPP_SUFFIX" >&5 -$as_echo "IPP arch suffix is set to $IPP_SUFFIX" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: IPP arch suffix is set to $IPP_SUFFIX" >&5 +printf "%s\n" "IPP arch suffix is set to $IPP_SUFFIX" >&6; } else IPP_SUFFIX="" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: IPP arch suffix is set to empty" >&5 -$as_echo "IPP arch suffix is set to empty" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: IPP arch suffix is set to empty" >&5 +printf "%s\n" "IPP arch suffix is set to empty" >&6; } fi if test x$IPPROOT = x; then @@ -7829,30 +8639,31 @@ LIBS="$IPP_LIBS $LIBS" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking Intel IPP usability" >&5 -$as_echo_n "checking Intel IPP usability... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking Intel IPP usability" >&5 +printf %s "checking Intel IPP usability... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int -main () +main (void) { ippStaticInit(); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 -$as_echo "ok" >&6; } -else - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +if ac_fn_c_try_link "$LINENO" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } +else $as_nop + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "Error: unable to recognize your IPP installation. Make sure the paths and ARCH suffix are set correctly, run with --help for more info See \`config.log' for more details" "$LINENO" 5; } fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext CFLAGS="$SAVED_CFLAGS" @@ -7860,22 +8671,22 @@ LIBS="$SAVED_LIBS" fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking Intel IPP samples location" >&5 -$as_echo_n "checking Intel IPP samples location... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking Intel IPP samples location" >&5 +printf %s "checking Intel IPP samples location... " >&6; } if test "x$with_ipp_samples" != "xno" -a "x$with_ipp_samples" != "x"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_ipp_samples" >&5 -$as_echo "$with_ipp_samples" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $with_ipp_samples" >&5 +printf "%s\n" "$with_ipp_samples" >&6; } IPPSAMPLES=$with_ipp_samples elif test "x$IPPSAMPLES" = "x"; then if test -d /opt/intel/ipp-samples; then IPPSAMPLES=/opt/intel/ipp-samples - { $as_echo "$as_me:${as_lineno-$LINENO}: result: autodetected in $IPPSAMPLES" >&5 -$as_echo "autodetected in $IPPSAMPLES" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: autodetected in $IPPSAMPLES" >&5 +printf "%s\n" "autodetected in $IPPSAMPLES" >&6; } fi else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $IPPSAMPLES" >&5 -$as_echo "$IPPSAMPLES" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $IPPSAMPLES" >&5 +printf "%s\n" "$IPPSAMPLES" >&6; } fi if test x$IPPSAMPLES = x; then @@ -7889,8 +8700,8 @@ IPPSAMPLES=`echo $IPPSAMPLES | sed 's/\/$//'` # Guess the libusc.a/libspeech.a build location - { $as_echo "$as_me:${as_lineno-$LINENO}: checking Intel IPP USC build location" >&5 -$as_echo_n "checking Intel IPP USC build location... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking Intel IPP USC build location" >&5 +printf %s "checking Intel IPP USC build location... " >&6; } if test -d $IPPSAMPLES/speech-codecs/bin; then IPPVER=5 IPPSAMP_DIR=`ls -d $IPPSAMPLES/speech-codecs/bin/*gcc*/lib | head -1` @@ -7903,22 +8714,22 @@ # icc compiler IPPSAMP_DIR=`ls -d $IPPSAMPLES/speech-codecs/_bin/*icc*/lib | head -1` else - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "Unable to find to find built binaries under $IPPSAMPLES/speech-codecs/{bin,_bin}. Have you built the IPP samples? See \`config.log' for more details" "$LINENO" 5; } fi else - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "unable to find $IPPSAMPLES/speech-codecs/bin/*gcc*/lib or $IPPSAMPLES/speech-codecs/_bin/*gcc*/lib directory. Have you built the samples? See \`config.log' for more details" "$LINENO" 5; } fi # Test the directory if test ! -d $IPPSAMP_DIR; then - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "There's something wrong with this script, directory $IPPSAMP_DIR does not exist See \`config.log' for more details" "$LINENO" 5; } exit 1; @@ -7931,21 +8742,21 @@ IPPSAMP_LIBS="libspeech.a" IPPSAMP_LDLIBS="-lspeech" else - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "bug in this script: unsupported IPP version See \`config.log' for more details" "$LINENO" 5; } fi if test ! -f $IPPSAMP_DIR/$IPPSAMP_LIBS; then - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "$IPPSAMP_LIBS doesn't exist in $IPPSAMP_DIR See \`config.log' for more details" "$LINENO" 5; } fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $IPPSAMP_DIR" >&5 -$as_echo "$IPPSAMP_DIR" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $IPPSAMP_DIR" >&5 +printf "%s\n" "$IPPSAMP_DIR" >&6; } SAVED_CFLAGS="$CFLAGS" SAVED_LDFLAGS="$LDFLAGS" @@ -7956,30 +8767,31 @@ LDFLAGS="$LDFLAGS -L$IPPSAMP_DIR" LIBS="$IPPSAMP_LDLIBS $LIBS" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking Intel IPP USC usability" >&5 -$as_echo_n "checking Intel IPP USC usability... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking Intel IPP USC usability" >&5 +printf %s "checking Intel IPP USC usability... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int -main () +main (void) { extern USC_Fxns USC_G729AFP_Fxns; ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 -$as_echo "ok" >&6; } -else - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +if ac_fn_c_try_link "$LINENO" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } +else $as_nop + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "no See \`config.log' for more details" "$LINENO" 5; } fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext CFLAGS="$SAVED_CFLAGS" @@ -8000,17 +8812,86 @@ export IPP_LDFLAGS=$IPP_LDFLAGS\n\ export IPP_LIBS=$IPP_LIBS" else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: Skipping Intel IPP settings (not wanted)" >&5 -$as_echo "Skipping Intel IPP settings (not wanted)" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: Skipping Intel IPP settings (not wanted)" >&5 +printf "%s\n" "Skipping Intel IPP settings (not wanted)" >&6; } +fi + + + +# Check whether --enable-android-mediacodec was given. +if test ${enable_android_mediacodec+y} +then : + enableval=$enable_android_mediacodec; if test "$enable_android_mediacodec" = "no"; then + ac_no_mediacodec=1 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: Checking if Android MediaCodec support is disabled... yes" >&5 +printf "%s\n" "Checking if Android MediaCodec support is disabled... yes" >&6; } + fi +else $as_nop + + case $target in + *android*) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for AMediaCodec_createDecoderByType in -lmediandk" >&5 +printf %s "checking for AMediaCodec_createDecoderByType in -lmediandk... " >&6; } +if test ${ac_cv_lib_mediandk_AMediaCodec_createDecoderByType+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_check_lib_save_LIBS=$LIBS +LIBS="-lmediandk $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +char AMediaCodec_createDecoderByType (); +int +main (void) +{ +return AMediaCodec_createDecoderByType (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_mediandk_AMediaCodec_createDecoderByType=yes +else $as_nop + ac_cv_lib_mediandk_AMediaCodec_createDecoderByType=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_mediandk_AMediaCodec_createDecoderByType" >&5 +printf "%s\n" "$ac_cv_lib_mediandk_AMediaCodec_createDecoderByType" >&6; } +if test "x$ac_cv_lib_mediandk_AMediaCodec_createDecoderByType" = xyes +then : + ac_pjmedia_has_amediacodec=1 && LIBS="-lmediandk $LIBS" +fi + + if test "x$ac_pjmedia_has_amediacodec" = "x1"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: Checking if Android AMediaCodec library is available... yes" >&5 +printf "%s\n" "Checking if Android AMediaCodec library is available... yes" >&6; } + printf "%s\n" "#define PJMEDIA_HAS_ANDROID_MEDIACODEC 1" >>confdefs.h + + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: Checking if Android AMediaCodec library is available... no" >&5 +printf "%s\n" "Checking if Android AMediaCodec library is available... no" >&6; } + fi + ;; + esac + fi # Check whether --with-ssl was given. -if test "${with_ssl+set}" = set; then : +if test ${with_ssl+y} +then : withval=$with_ssl; -else +else $as_nop with_ssl=no fi @@ -8018,9 +8899,10 @@ # Check whether --with-gnutls was given. -if test "${with_gnutls+set}" = set; then : +if test ${with_gnutls+y} +then : withval=$with_gnutls; -else +else $as_nop with_gnutls=no fi @@ -8036,12 +8918,13 @@ # Check whether --enable-darwin-ssl was given. -if test "${enable_darwin_ssl+set}" = set; then : +if test ${enable_darwin_ssl+y} +then : enableval=$enable_darwin_ssl; if test "$enable_darwin_ssl" = "no"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: Checking if Darwin SSL support is disabled... yes" >&5 -$as_echo "Checking if Darwin SSL support is disabled... yes" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: Checking if Darwin SSL support is disabled... yes" >&5 +printf "%s\n" "Checking if Darwin SSL support is disabled... yes" >&6; } fi -else +else $as_nop case $target in *darwin*) @@ -8053,7 +8936,7 @@ /* end confdefs.h. */ #include int -main () +main (void) { if (__builtin_available(macOS 10.12, iOS 10.0, *)) { SSLContextRef ssl_ctx; @@ -8063,23 +8946,24 @@ return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : ac_ssl_backend=darwin fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext CFLAGS="$SAVED_CFLAGS" LIBS="$SAVED_LIBS" if test "x$ac_ssl_backend" = "xdarwin"; then - $as_echo "#define PJ_HAS_SSL_SOCK 1" >>confdefs.h + printf "%s\n" "#define PJ_HAS_SSL_SOCK 1" >>confdefs.h - $as_echo "#define PJ_SSL_SOCK_IMP PJ_SSL_SOCK_IMP_DARWIN" >>confdefs.h + printf "%s\n" "#define PJ_SSL_SOCK_IMP PJ_SSL_SOCK_IMP_DARWIN" >>confdefs.h LIBS="$LIBS -framework Security" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: Checking if Darwin SSL is available... yes" >&5 -$as_echo "Checking if Darwin SSL is available... yes" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: Checking if Darwin SSL is available... yes" >&5 +printf "%s\n" "Checking if Darwin SSL is available... yes" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: Checking if Darwin SSL is available... no" >&5 -$as_echo "Checking if Darwin SSL is available... no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: Checking if Darwin SSL is available... no" >&5 +printf "%s\n" "Checking if Darwin SSL is available... no" >&6; } fi ;; esac @@ -8088,43 +8972,45 @@ # Check whether --enable-ssl was given. -if test "${enable_ssl+set}" = set; then : +if test ${enable_ssl+y} +then : enableval=$enable_ssl; if test "$enable_ssl" = "no"; then ac_no_ssl=1 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: Checking if SSL support is disabled... yes" >&5 -$as_echo "Checking if SSL support is disabled... yes" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: Checking if SSL support is disabled... yes" >&5 +printf "%s\n" "Checking if SSL support is disabled... yes" >&6; } fi -else +else $as_nop if test "x$with_ssl" != "xno" -a "x$with_ssl" != "x"; then CFLAGS="$CFLAGS -I$with_ssl/include" CPPFLAGS="$CPPFLAGS -I$with_ssl/include" LDFLAGS="$LDFLAGS -L$with_ssl/lib" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: Using SSL prefix... $with_ssl" >&5 -$as_echo "Using SSL prefix... $with_ssl" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: Using SSL prefix... $with_ssl" >&5 +printf "%s\n" "Using SSL prefix... $with_ssl" >&6; } fi if test "x$with_gnutls" = "xno"; then # We still need to check for OpenSSL installations even if # we find Darwin SSL above since DTLS requires OpenSSL. - { $as_echo "$as_me:${as_lineno-$LINENO}: result: checking for OpenSSL installations.." >&5 -$as_echo "checking for OpenSSL installations.." >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: checking for OpenSSL installations.." >&5 +printf "%s\n" "checking for OpenSSL installations.." >&6; } - ac_fn_c_check_header_mongrel "$LINENO" "openssl/ssl.h" "ac_cv_header_openssl_ssl_h" "$ac_includes_default" -if test "x$ac_cv_header_openssl_ssl_h" = xyes; then : + ac_fn_c_check_header_compile "$LINENO" "openssl/ssl.h" "ac_cv_header_openssl_ssl_h" "$ac_includes_default" +if test "x$ac_cv_header_openssl_ssl_h" = xyes +then : openssl_h_present=1 fi - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ERR_load_BIO_strings in -lcrypto" >&5 -$as_echo_n "checking for ERR_load_BIO_strings in -lcrypto... " >&6; } -if ${ac_cv_lib_crypto_ERR_load_BIO_strings+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for ERR_load_BIO_strings in -lcrypto" >&5 +printf %s "checking for ERR_load_BIO_strings in -lcrypto... " >&6; } +if test ${ac_cv_lib_crypto_ERR_load_BIO_strings+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcrypto $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -8133,38 +9019,38 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char ERR_load_BIO_strings (); int -main () +main (void) { return ERR_load_BIO_strings (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_crypto_ERR_load_BIO_strings=yes -else +else $as_nop ac_cv_lib_crypto_ERR_load_BIO_strings=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_ERR_load_BIO_strings" >&5 -$as_echo "$ac_cv_lib_crypto_ERR_load_BIO_strings" >&6; } -if test "x$ac_cv_lib_crypto_ERR_load_BIO_strings" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_ERR_load_BIO_strings" >&5 +printf "%s\n" "$ac_cv_lib_crypto_ERR_load_BIO_strings" >&6; } +if test "x$ac_cv_lib_crypto_ERR_load_BIO_strings" = xyes +then : libcrypto_present=1 && LIBS="-lcrypto $LIBS" fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for SSL_CTX_new in -lssl" >&5 -$as_echo_n "checking for SSL_CTX_new in -lssl... " >&6; } -if ${ac_cv_lib_ssl_SSL_CTX_new+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for SSL_CTX_new in -lssl" >&5 +printf %s "checking for SSL_CTX_new in -lssl... " >&6; } +if test ${ac_cv_lib_ssl_SSL_CTX_new+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lssl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -8173,36 +9059,35 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char SSL_CTX_new (); int -main () +main (void) { return SSL_CTX_new (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_ssl_SSL_CTX_new=yes -else +else $as_nop ac_cv_lib_ssl_SSL_CTX_new=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ssl_SSL_CTX_new" >&5 -$as_echo "$ac_cv_lib_ssl_SSL_CTX_new" >&6; } -if test "x$ac_cv_lib_ssl_SSL_CTX_new" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ssl_SSL_CTX_new" >&5 +printf "%s\n" "$ac_cv_lib_ssl_SSL_CTX_new" >&6; } +if test "x$ac_cv_lib_ssl_SSL_CTX_new" = xyes +then : libssl_present=1 && LIBS="-lssl $LIBS" fi if test "x$openssl_h_present" = "x1" -a "x$libssl_present" = "x1" -a "x$libcrypto_present" = "x1"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: OpenSSL library found, SSL support enabled" >&5 -$as_echo "OpenSSL library found, SSL support enabled" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: OpenSSL library found, SSL support enabled" >&5 +printf "%s\n" "OpenSSL library found, SSL support enabled" >&6; } # Check if SRTP should be compiled with OpenSSL # support, to enable cryptos such as AES GCM. @@ -8214,19 +9099,21 @@ /* end confdefs.h. */ #include int -main () +main (void) { EVP_CIPHER_CTX *ctx;EVP_aes_128_gcm(); ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for EVP_aes_128_gcm in -lcrypto" >&5 -$as_echo_n "checking for EVP_aes_128_gcm in -lcrypto... " >&6; } -if ${ac_cv_lib_crypto_EVP_aes_128_gcm+:} false; then : - $as_echo_n "(cached) " >&6 -else +if ac_fn_c_try_compile "$LINENO" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for EVP_aes_128_gcm in -lcrypto" >&5 +printf %s "checking for EVP_aes_128_gcm in -lcrypto... " >&6; } +if test ${ac_cv_lib_crypto_EVP_aes_128_gcm+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcrypto $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -8235,55 +9122,54 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char EVP_aes_128_gcm (); int -main () +main (void) { return EVP_aes_128_gcm (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_crypto_EVP_aes_128_gcm=yes -else +else $as_nop ac_cv_lib_crypto_EVP_aes_128_gcm=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_EVP_aes_128_gcm" >&5 -$as_echo "$ac_cv_lib_crypto_EVP_aes_128_gcm" >&6; } -if test "x$ac_cv_lib_crypto_EVP_aes_128_gcm" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_EVP_aes_128_gcm" >&5 +printf "%s\n" "$ac_cv_lib_crypto_EVP_aes_128_gcm" >&6; } +if test "x$ac_cv_lib_crypto_EVP_aes_128_gcm" = xyes +then : ac_ssl_has_aes_gcm=1 fi fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext if test "x$ac_ssl_has_aes_gcm" = "x1"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: OpenSSL has AES GCM support, SRTP will use OpenSSL" >&5 -$as_echo "OpenSSL has AES GCM support, SRTP will use OpenSSL" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: OpenSSL has AES GCM support, SRTP will use OpenSSL" >&5 +printf "%s\n" "OpenSSL has AES GCM support, SRTP will use OpenSSL" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: OpenSSL AES GCM support not found, SRTP will only support AES CM cryptos" >&5 -$as_echo "OpenSSL AES GCM support not found, SRTP will only support AES CM cryptos" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: OpenSSL AES GCM support not found, SRTP will only support AES CM cryptos" >&5 +printf "%s\n" "OpenSSL AES GCM support not found, SRTP will only support AES CM cryptos" >&6; } fi if test "x$ac_ssl_backend" = "x"; then # PJSIP_HAS_TLS_TRANSPORT setting follows PJ_HAS_SSL_SOCK #AC_DEFINE(PJSIP_HAS_TLS_TRANSPORT, 1) - $as_echo "#define PJ_HAS_SSL_SOCK 1" >>confdefs.h + printf "%s\n" "#define PJ_HAS_SSL_SOCK 1" >>confdefs.h - $as_echo "#define PJ_SSL_SOCK_IMP PJ_SSL_SOCK_IMP_OPENSSL" >>confdefs.h + printf "%s\n" "#define PJ_SSL_SOCK_IMP PJ_SSL_SOCK_IMP_OPENSSL" >>confdefs.h ac_ssl_backend="openssl" fi else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: ** OpenSSL libraries not found **" >&5 -$as_echo "** OpenSSL libraries not found **" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: ** OpenSSL libraries not found **" >&5 +printf "%s\n" "** OpenSSL libraries not found **" >&6; } fi fi @@ -8293,19 +9179,20 @@ if test "x$with_gnutls" != "xno" -a "x$with_gnutls" != "x"; then CFLAGS="$CFLAGS -I$with_gnutls/include" LDFLAGS="$LDFLAGS -L$with_gnutls/lib" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: Using GnuTLS prefix... $with_gnutls" >&5 -$as_echo "Using GnuTLS prefix... $with_gnutls" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: Using GnuTLS prefix... $with_gnutls" >&5 +printf "%s\n" "Using GnuTLS prefix... $with_gnutls" >&6; } fi for ac_prog in $host-pkg-config pkg-config "python pkgconfig.py" do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_PKG_CONFIG+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_PKG_CONFIG+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$PKG_CONFIG"; then ac_cv_prog_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test. else @@ -8313,11 +9200,15 @@ for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_PKG_CONFIG="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -8328,11 +9219,11 @@ fi PKG_CONFIG=$ac_cv_prog_PKG_CONFIG if test -n "$PKG_CONFIG"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5 -$as_echo "$PKG_CONFIG" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5 +printf "%s\n" "$PKG_CONFIG" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -8340,27 +9231,28 @@ done test -n "$PKG_CONFIG" || PKG_CONFIG="none" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: checking for GnuTLS installations.." >&5 -$as_echo "checking for GnuTLS installations.." >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: checking for GnuTLS installations.." >&5 +printf "%s\n" "checking for GnuTLS installations.." >&6; } - ac_fn_c_check_header_mongrel "$LINENO" "gnutls/gnutls.h" "ac_cv_header_gnutls_gnutls_h" "$ac_includes_default" -if test "x$ac_cv_header_gnutls_gnutls_h" = xyes; then : + ac_fn_c_check_header_compile "$LINENO" "gnutls/gnutls.h" "ac_cv_header_gnutls_gnutls_h" "$ac_includes_default" +if test "x$ac_cv_header_gnutls_gnutls_h" = xyes +then : gnutls_h_present=1 fi - if test "$PKG_CONFIG" != "none"; then if $PKG_CONFIG --exists gnutls; then LIBS="$LIBS `$PKG_CONFIG --libs gnutls`" libgnutls_present=1 else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gnutls_certificate_set_x509_system_trust in -lgnutls" >&5 -$as_echo_n "checking for gnutls_certificate_set_x509_system_trust in -lgnutls... " >&6; } -if ${ac_cv_lib_gnutls_gnutls_certificate_set_x509_system_trust+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for gnutls_certificate_set_x509_system_trust in -lgnutls" >&5 +printf %s "checking for gnutls_certificate_set_x509_system_trust in -lgnutls... " >&6; } +if test ${ac_cv_lib_gnutls_gnutls_certificate_set_x509_system_trust+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lgnutls $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -8369,51 +9261,50 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char gnutls_certificate_set_x509_system_trust (); int -main () +main (void) { return gnutls_certificate_set_x509_system_trust (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_gnutls_gnutls_certificate_set_x509_system_trust=yes -else +else $as_nop ac_cv_lib_gnutls_gnutls_certificate_set_x509_system_trust=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_gnutls_gnutls_certificate_set_x509_system_trust" >&5 -$as_echo "$ac_cv_lib_gnutls_gnutls_certificate_set_x509_system_trust" >&6; } -if test "x$ac_cv_lib_gnutls_gnutls_certificate_set_x509_system_trust" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_gnutls_gnutls_certificate_set_x509_system_trust" >&5 +printf "%s\n" "$ac_cv_lib_gnutls_gnutls_certificate_set_x509_system_trust" >&6; } +if test "x$ac_cv_lib_gnutls_gnutls_certificate_set_x509_system_trust" = xyes +then : libgnutls_present=1 && LIBS="$LIBS -lgnutls" fi fi else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: *** Warning: neither pkg-config nor python is available, disabling gnutls. ***" >&5 -$as_echo "*** Warning: neither pkg-config nor python is available, disabling gnutls. ***" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: *** Warning: neither pkg-config nor python is available, disabling gnutls. ***" >&5 +printf "%s\n" "*** Warning: neither pkg-config nor python is available, disabling gnutls. ***" >&6; } fi if test "x$gnutls_h_present" = "x1" -a "x$libgnutls_present" = "x1"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: GnuTLS library found, SSL support enabled" >&5 -$as_echo "GnuTLS library found, SSL support enabled" >&6; } - $as_echo "#define PJ_HAS_SSL_SOCK 1" >>confdefs.h + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: GnuTLS library found, SSL support enabled" >&5 +printf "%s\n" "GnuTLS library found, SSL support enabled" >&6; } + printf "%s\n" "#define PJ_HAS_SSL_SOCK 1" >>confdefs.h - $as_echo "#define PJ_SSL_SOCK_IMP PJ_SSL_SOCK_IMP_GNUTLS" >>confdefs.h + printf "%s\n" "#define PJ_SSL_SOCK_IMP PJ_SSL_SOCK_IMP_GNUTLS" >>confdefs.h ac_ssl_backend="gnutls" else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: ** No GnuTLS libraries found, disabling SSL support **" >&5 -$as_echo "** No GnuTLS libraries found, disabling SSL support **" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: ** No GnuTLS libraries found, disabling SSL support **" >&5 +printf "%s\n" "** No GnuTLS libraries found, disabling SSL support **" >&6; } fi fi @@ -8423,9 +9314,10 @@ # Check whether --with-opencore-amrnb was given. -if test "${with_opencore_amrnb+set}" = set; then : +if test ${with_opencore_amrnb+y} +then : withval=$with_opencore_amrnb; as_fn_error $? "This option is obsolete and replaced by --with-opencore-amr=DIR" "$LINENO" 5 -else +else $as_nop true; fi @@ -8433,9 +9325,10 @@ # Check whether --with-opencore-amr was given. -if test "${with_opencore_amr+set}" = set; then : +if test ${with_opencore_amr+y} +then : withval=$with_opencore_amr; -else +else $as_nop with_opencore_amr=no fi @@ -8447,9 +9340,10 @@ # Check whether --with-opencore-amrwbenc was given. -if test "${with_opencore_amrwbenc+set}" = set; then : +if test ${with_opencore_amrwbenc+y} +then : withval=$with_opencore_amrwbenc; -else +else $as_nop with_opencore_amrwbenc=no fi @@ -8463,50 +9357,52 @@ # Check whether --enable-opencore_amr was given. -if test "${enable_opencore_amr+set}" = set; then : +if test ${enable_opencore_amr+y} +then : enableval=$enable_opencore_amr; if test "$enable_opencore_amr" = "no"; then ac_no_opencore_amrnb=1 ac_no_opencore_amrwb=1 - $as_echo "#define PJMEDIA_HAS_OPENCORE_AMRNB_CODEC 0" >>confdefs.h + printf "%s\n" "#define PJMEDIA_HAS_OPENCORE_AMRNB_CODEC 0" >>confdefs.h - $as_echo "#define PJMEDIA_HAS_OPENCORE_AMRWB_CODEC 0" >>confdefs.h + printf "%s\n" "#define PJMEDIA_HAS_OPENCORE_AMRWB_CODEC 0" >>confdefs.h - { $as_echo "$as_me:${as_lineno-$LINENO}: result: Checking if OpenCORE AMR support is disabled... yes" >&5 -$as_echo "Checking if OpenCORE AMR support is disabled... yes" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: Checking if OpenCORE AMR support is disabled... yes" >&5 +printf "%s\n" "Checking if OpenCORE AMR support is disabled... yes" >&6; } fi -else +else $as_nop - { $as_echo "$as_me:${as_lineno-$LINENO}: result: checking for OpenCORE AMR installations.." >&5 -$as_echo "checking for OpenCORE AMR installations.." >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: checking for OpenCORE AMR installations.." >&5 +printf "%s\n" "checking for OpenCORE AMR installations.." >&6; } if test "x$with_opencore_amr" != "xno" -a "x$with_opencore_amr" != "x"; then CFLAGS="$CFLAGS -I$with_opencore_amr/include" CPPFLAGS="$CPPFLAGS -I$with_opencore_amr/include" LDFLAGS="$LDFLAGS -L$with_opencore_amr/lib" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: Using OpenCORE AMR prefix... $with_opencore_amr" >&5 -$as_echo "Using OpenCORE AMR prefix... $with_opencore_amr" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: Using OpenCORE AMR prefix... $with_opencore_amr" >&5 +printf "%s\n" "Using OpenCORE AMR prefix... $with_opencore_amr" >&6; } fi if test "x$with_opencore_amrwbenc" != "xno" -a "x$with_opencore_amrwbenc" != "x"; then CFLAGS="$CFLAGS -I$with_opencore_amrwbenc/include" CPPFLAGS="$CPPFLAGS -I$with_opencore_amrwbenc/include" LDFLAGS="$LDFLAGS -L$with_opencore_amrwbenc/lib" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: Using OpenCORE AMRWB-enc prefix... $with_opencore_amrwbenc" >&5 -$as_echo "Using OpenCORE AMRWB-enc prefix... $with_opencore_amrwbenc" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: Using OpenCORE AMRWB-enc prefix... $with_opencore_amrwbenc" >&5 +printf "%s\n" "Using OpenCORE AMRWB-enc prefix... $with_opencore_amrwbenc" >&6; } fi - ac_fn_c_check_header_mongrel "$LINENO" "opencore-amrnb/interf_enc.h" "ac_cv_header_opencore_amrnb_interf_enc_h" "$ac_includes_default" -if test "x$ac_cv_header_opencore_amrnb_interf_enc_h" = xyes; then : + ac_fn_c_check_header_compile "$LINENO" "opencore-amrnb/interf_enc.h" "ac_cv_header_opencore_amrnb_interf_enc_h" "$ac_includes_default" +if test "x$ac_cv_header_opencore_amrnb_interf_enc_h" = xyes +then : opencore_amrnb_h_present=1 fi - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Encoder_Interface_init in -lopencore-amrnb" >&5 -$as_echo_n "checking for Encoder_Interface_init in -lopencore-amrnb... " >&6; } -if ${ac_cv_lib_opencore_amrnb_Encoder_Interface_init+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for Encoder_Interface_init in -lopencore-amrnb" >&5 +printf %s "checking for Encoder_Interface_init in -lopencore-amrnb... " >&6; } +if test ${ac_cv_lib_opencore_amrnb_Encoder_Interface_init+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lopencore-amrnb $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -8515,64 +9411,64 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char Encoder_Interface_init (); int -main () +main (void) { return Encoder_Interface_init (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_opencore_amrnb_Encoder_Interface_init=yes -else +else $as_nop ac_cv_lib_opencore_amrnb_Encoder_Interface_init=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_opencore_amrnb_Encoder_Interface_init" >&5 -$as_echo "$ac_cv_lib_opencore_amrnb_Encoder_Interface_init" >&6; } -if test "x$ac_cv_lib_opencore_amrnb_Encoder_Interface_init" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_opencore_amrnb_Encoder_Interface_init" >&5 +printf "%s\n" "$ac_cv_lib_opencore_amrnb_Encoder_Interface_init" >&6; } +if test "x$ac_cv_lib_opencore_amrnb_Encoder_Interface_init" = xyes +then : opencore_amrnb_present=1 && LIBS="$LIBS -lopencore-amrnb" fi if test "x$opencore_amrnb_h_present" = "x1" -a "x$opencore_amrnb_present" = "x1"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: OpenCORE AMR-NB library found, AMR-NB support enabled" >&5 -$as_echo "OpenCORE AMR-NB library found, AMR-NB support enabled" >&6; } - $as_echo "#define PJMEDIA_HAS_OPENCORE_AMRNB_CODEC 1" >>confdefs.h + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: OpenCORE AMR-NB library found, AMR-NB support enabled" >&5 +printf "%s\n" "OpenCORE AMR-NB library found, AMR-NB support enabled" >&6; } + printf "%s\n" "#define PJMEDIA_HAS_OPENCORE_AMRNB_CODEC 1" >>confdefs.h else ac_no_opencore_amrnb=1 - $as_echo "#define PJMEDIA_HAS_OPENCORE_AMRNB_CODEC 0" >>confdefs.h + printf "%s\n" "#define PJMEDIA_HAS_OPENCORE_AMRNB_CODEC 0" >>confdefs.h fi - ac_fn_c_check_header_mongrel "$LINENO" "vo-amrwbenc/enc_if.h" "ac_cv_header_vo_amrwbenc_enc_if_h" "$ac_includes_default" -if test "x$ac_cv_header_vo_amrwbenc_enc_if_h" = xyes; then : + ac_fn_c_check_header_compile "$LINENO" "vo-amrwbenc/enc_if.h" "ac_cv_header_vo_amrwbenc_enc_if_h" "$ac_includes_default" +if test "x$ac_cv_header_vo_amrwbenc_enc_if_h" = xyes +then : opencore_amrwb_enc_h_present=1 fi - - ac_fn_c_check_header_mongrel "$LINENO" "opencore-amrwb/dec_if.h" "ac_cv_header_opencore_amrwb_dec_if_h" "$ac_includes_default" -if test "x$ac_cv_header_opencore_amrwb_dec_if_h" = xyes; then : + ac_fn_c_check_header_compile "$LINENO" "opencore-amrwb/dec_if.h" "ac_cv_header_opencore_amrwb_dec_if_h" "$ac_includes_default" +if test "x$ac_cv_header_opencore_amrwb_dec_if_h" = xyes +then : opencore_amrwb_dec_h_present=1 fi - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for D_IF_init in -lopencore-amrwb" >&5 -$as_echo_n "checking for D_IF_init in -lopencore-amrwb... " >&6; } -if ${ac_cv_lib_opencore_amrwb_D_IF_init+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for D_IF_init in -lopencore-amrwb" >&5 +printf %s "checking for D_IF_init in -lopencore-amrwb... " >&6; } +if test ${ac_cv_lib_opencore_amrwb_D_IF_init+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lopencore-amrwb $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -8581,38 +9477,38 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char D_IF_init (); int -main () +main (void) { return D_IF_init (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_opencore_amrwb_D_IF_init=yes -else +else $as_nop ac_cv_lib_opencore_amrwb_D_IF_init=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_opencore_amrwb_D_IF_init" >&5 -$as_echo "$ac_cv_lib_opencore_amrwb_D_IF_init" >&6; } -if test "x$ac_cv_lib_opencore_amrwb_D_IF_init" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_opencore_amrwb_D_IF_init" >&5 +printf "%s\n" "$ac_cv_lib_opencore_amrwb_D_IF_init" >&6; } +if test "x$ac_cv_lib_opencore_amrwb_D_IF_init" = xyes +then : opencore_amrwb_dec_present=1 && LIBS="$LIBS -lopencore-amrwb" fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for E_IF_init in -lvo-amrwbenc" >&5 -$as_echo_n "checking for E_IF_init in -lvo-amrwbenc... " >&6; } -if ${ac_cv_lib_vo_amrwbenc_E_IF_init+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for E_IF_init in -lvo-amrwbenc" >&5 +printf %s "checking for E_IF_init in -lvo-amrwbenc... " >&6; } +if test ${ac_cv_lib_vo_amrwbenc_E_IF_init+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lvo-amrwbenc $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -8621,41 +9517,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char E_IF_init (); int -main () +main (void) { return E_IF_init (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_vo_amrwbenc_E_IF_init=yes -else +else $as_nop ac_cv_lib_vo_amrwbenc_E_IF_init=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_vo_amrwbenc_E_IF_init" >&5 -$as_echo "$ac_cv_lib_vo_amrwbenc_E_IF_init" >&6; } -if test "x$ac_cv_lib_vo_amrwbenc_E_IF_init" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_vo_amrwbenc_E_IF_init" >&5 +printf "%s\n" "$ac_cv_lib_vo_amrwbenc_E_IF_init" >&6; } +if test "x$ac_cv_lib_vo_amrwbenc_E_IF_init" = xyes +then : opencore_amrwb_enc_present=1 && LIBS="$LIBS -lvo-amrwbenc" fi if test "x$opencore_amrwb_enc_h_present" = "x1" -a "x$opencore_amrwb_dec_h_present" = "x1" -a "x$opencore_amrwb_enc_present" = "x1" -a "x$opencore_amrwb_dec_present" = "x1"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: OpenCORE AMR-WB library found, AMR-WB support enabled" >&5 -$as_echo "OpenCORE AMR-WB library found, AMR-WB support enabled" >&6; } - $as_echo "#define PJMEDIA_HAS_OPENCORE_AMRWB_CODEC 1" >>confdefs.h + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: OpenCORE AMR-WB library found, AMR-WB support enabled" >&5 +printf "%s\n" "OpenCORE AMR-WB library found, AMR-WB support enabled" >&6; } + printf "%s\n" "#define PJMEDIA_HAS_OPENCORE_AMRWB_CODEC 1" >>confdefs.h else ac_no_opencore_amrwb=1 - $as_echo "#define PJMEDIA_HAS_OPENCORE_AMRWB_CODEC 0" >>confdefs.h + printf "%s\n" "#define PJMEDIA_HAS_OPENCORE_AMRWB_CODEC 0" >>confdefs.h fi @@ -8665,9 +9560,10 @@ # Check whether --with-silk was given. -if test "${with_silk+set}" = set; then : +if test ${with_silk+y} +then : withval=$with_silk; -else +else $as_nop with_silk=no fi @@ -8679,40 +9575,42 @@ # Check whether --enable-silk was given. -if test "${enable_silk+set}" = set; then : +if test ${enable_silk+y} +then : enableval=$enable_silk; if test "$enable_silk" = "no"; then ac_no_silk=1 - $as_echo "#define PJMEDIA_HAS_SILK_CODEC 0" >>confdefs.h + printf "%s\n" "#define PJMEDIA_HAS_SILK_CODEC 0" >>confdefs.h - { $as_echo "$as_me:${as_lineno-$LINENO}: result: Checking if SILK support is disabled... yes" >&5 -$as_echo "Checking if SILK support is disabled... yes" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: Checking if SILK support is disabled... yes" >&5 +printf "%s\n" "Checking if SILK support is disabled... yes" >&6; } fi -else +else $as_nop - { $as_echo "$as_me:${as_lineno-$LINENO}: result: checking for SILK installations.." >&5 -$as_echo "checking for SILK installations.." >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: checking for SILK installations.." >&5 +printf "%s\n" "checking for SILK installations.." >&6; } if test "x$with_silk" != "xno" -a "x$with_silk" != "x"; then CFLAGS="$CFLAGS -I$with_silk/interface" CPPFLAGS="$CPPFLAGS -I$with_silk/interface" LDFLAGS="$LDFLAGS -L$with_silk" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: Using SILK prefix... $with_silk" >&5 -$as_echo "Using SILK prefix... $with_silk" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: Using SILK prefix... $with_silk" >&5 +printf "%s\n" "Using SILK prefix... $with_silk" >&6; } fi - ac_fn_c_check_header_mongrel "$LINENO" "SKP_Silk_SDK_API.h" "ac_cv_header_SKP_Silk_SDK_API_h" "$ac_includes_default" -if test "x$ac_cv_header_SKP_Silk_SDK_API_h" = xyes; then : + ac_fn_c_check_header_compile "$LINENO" "SKP_Silk_SDK_API.h" "ac_cv_header_SKP_Silk_SDK_API_h" "$ac_includes_default" +if test "x$ac_cv_header_SKP_Silk_SDK_API_h" = xyes +then : silk_h_present=1 fi - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for SKP_Silk_SDK_get_version in -lSKP_SILK_SDK" >&5 -$as_echo_n "checking for SKP_Silk_SDK_get_version in -lSKP_SILK_SDK... " >&6; } -if ${ac_cv_lib_SKP_SILK_SDK_SKP_Silk_SDK_get_version+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for SKP_Silk_SDK_get_version in -lSKP_SILK_SDK" >&5 +printf %s "checking for SKP_Silk_SDK_get_version in -lSKP_SILK_SDK... " >&6; } +if test ${ac_cv_lib_SKP_SILK_SDK_SKP_Silk_SDK_get_version+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lSKP_SILK_SDK $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -8721,41 +9619,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char SKP_Silk_SDK_get_version (); int -main () +main (void) { return SKP_Silk_SDK_get_version (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_SKP_SILK_SDK_SKP_Silk_SDK_get_version=yes -else +else $as_nop ac_cv_lib_SKP_SILK_SDK_SKP_Silk_SDK_get_version=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_SKP_SILK_SDK_SKP_Silk_SDK_get_version" >&5 -$as_echo "$ac_cv_lib_SKP_SILK_SDK_SKP_Silk_SDK_get_version" >&6; } -if test "x$ac_cv_lib_SKP_SILK_SDK_SKP_Silk_SDK_get_version" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_SKP_SILK_SDK_SKP_Silk_SDK_get_version" >&5 +printf "%s\n" "$ac_cv_lib_SKP_SILK_SDK_SKP_Silk_SDK_get_version" >&6; } +if test "x$ac_cv_lib_SKP_SILK_SDK_SKP_Silk_SDK_get_version" = xyes +then : silk_present=1 && LIBS="$LIBS -lSKP_SILK_SDK" fi if test "x$silk_h_present" = "x1" -a "x$silk_present" = "x1"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: SILK library found, SILK support enabled" >&5 -$as_echo "SILK library found, SILK support enabled" >&6; } - $as_echo "#define PJMEDIA_HAS_SILK_CODEC 1" >>confdefs.h + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: SILK library found, SILK support enabled" >&5 +printf "%s\n" "SILK library found, SILK support enabled" >&6; } + printf "%s\n" "#define PJMEDIA_HAS_SILK_CODEC 1" >>confdefs.h else ac_no_silk=1 - $as_echo "#define PJMEDIA_HAS_SILK_CODEC 0" >>confdefs.h + printf "%s\n" "#define PJMEDIA_HAS_SILK_CODEC 0" >>confdefs.h fi @@ -8768,9 +9665,10 @@ # Check whether --with-opus was given. -if test "${with_opus+set}" = set; then : +if test ${with_opus+y} +then : withval=$with_opus; -else +else $as_nop with_opus=no fi @@ -8778,40 +9676,42 @@ # Check whether --enable-opus was given. -if test "${enable_opus+set}" = set; then : +if test ${enable_opus+y} +then : enableval=$enable_opus; if test "$enable_opus" = "no"; then ac_no_opus=1 - $as_echo "#define PJMEDIA_HAS_OPUS_CODEC 0" >>confdefs.h + printf "%s\n" "#define PJMEDIA_HAS_OPUS_CODEC 0" >>confdefs.h - { $as_echo "$as_me:${as_lineno-$LINENO}: result: Checking if OPUS support is disabled... yes" >&5 -$as_echo "Checking if OPUS support is disabled... yes" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: Checking if OPUS support is disabled... yes" >&5 +printf "%s\n" "Checking if OPUS support is disabled... yes" >&6; } fi -else +else $as_nop - { $as_echo "$as_me:${as_lineno-$LINENO}: result: checking for OPUS installations.." >&5 -$as_echo "checking for OPUS installations.." >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: checking for OPUS installations.." >&5 +printf "%s\n" "checking for OPUS installations.." >&6; } if test "x$with_opus" != "xno" -a "x$with_opus" != "x"; then CFLAGS="$CFLAGS -I$with_opus/include" CPPFLAGS="$CPPFLAGS -I$with_opus/include" LDFLAGS="$LDFLAGS -L$with_opus/lib" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: Using OPUS prefix... $with_opus" >&5 -$as_echo "Using OPUS prefix... $with_opus" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: Using OPUS prefix... $with_opus" >&5 +printf "%s\n" "Using OPUS prefix... $with_opus" >&6; } fi - ac_fn_c_check_header_mongrel "$LINENO" "opus/opus.h" "ac_cv_header_opus_opus_h" "$ac_includes_default" -if test "x$ac_cv_header_opus_opus_h" = xyes; then : + ac_fn_c_check_header_compile "$LINENO" "opus/opus.h" "ac_cv_header_opus_opus_h" "$ac_includes_default" +if test "x$ac_cv_header_opus_opus_h" = xyes +then : opus_h_present=1 fi - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for opus_repacketizer_get_size in -lopus" >&5 -$as_echo_n "checking for opus_repacketizer_get_size in -lopus... " >&6; } -if ${ac_cv_lib_opus_opus_repacketizer_get_size+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for opus_repacketizer_get_size in -lopus" >&5 +printf %s "checking for opus_repacketizer_get_size in -lopus... " >&6; } +if test ${ac_cv_lib_opus_opus_repacketizer_get_size+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lopus $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -8820,43 +9720,42 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char opus_repacketizer_get_size (); int -main () +main (void) { return opus_repacketizer_get_size (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_opus_opus_repacketizer_get_size=yes -else +else $as_nop ac_cv_lib_opus_opus_repacketizer_get_size=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_opus_opus_repacketizer_get_size" >&5 -$as_echo "$ac_cv_lib_opus_opus_repacketizer_get_size" >&6; } -if test "x$ac_cv_lib_opus_opus_repacketizer_get_size" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_opus_opus_repacketizer_get_size" >&5 +printf "%s\n" "$ac_cv_lib_opus_opus_repacketizer_get_size" >&6; } +if test "x$ac_cv_lib_opus_opus_repacketizer_get_size" = xyes +then : opus_present=1 && LIBS="-lopus $LIBS" fi if test "x$opus_h_present" = "x1" -a "x$opus_present" = "x1"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: OPUS library found, OPUS support enabled" >&5 -$as_echo "OPUS library found, OPUS support enabled" >&6; } - $as_echo "#define PJMEDIA_HAS_OPUS_CODEC 1" >>confdefs.h + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: OPUS library found, OPUS support enabled" >&5 +printf "%s\n" "OPUS library found, OPUS support enabled" >&6; } + printf "%s\n" "#define PJMEDIA_HAS_OPUS_CODEC 1" >>confdefs.h else ac_no_opus=1 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: OPUS library not found, OPUS support disabled" >&5 -$as_echo "OPUS library not found, OPUS support disabled" >&6; } - $as_echo "#define PJMEDIA_HAS_OPUS_CODEC 0" >>confdefs.h + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: OPUS library not found, OPUS support disabled" >&5 +printf "%s\n" "OPUS library not found, OPUS support disabled" >&6; } + printf "%s\n" "#define PJMEDIA_HAS_OPUS_CODEC 0" >>confdefs.h fi @@ -8865,9 +9764,10 @@ # Check whether --with-bcg729 was given. -if test "${with_bcg729+set}" = set; then : +if test ${with_bcg729+y} +then : withval=$with_bcg729; -else +else $as_nop with_bcg729=no fi @@ -8879,31 +9779,32 @@ # Check whether --enable-bcg729 was given. -if test "${enable_bcg729+set}" = set; then : +if test ${enable_bcg729+y} +then : enableval=$enable_bcg729; if test "$enable_bcg729" = "no"; then ac_no_bcg729=1 - $as_echo "#define PJMEDIA_HAS_BCG729 0" >>confdefs.h + printf "%s\n" "#define PJMEDIA_HAS_BCG729 0" >>confdefs.h - { $as_echo "$as_me:${as_lineno-$LINENO}: result: Checking if bcg729 is disabled... yes" >&5 -$as_echo "Checking if bcg729 is disabled... yes" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: Checking if bcg729 is disabled... yes" >&5 +printf "%s\n" "Checking if bcg729 is disabled... yes" >&6; } fi -else +else $as_nop if test "x$with_bcg729" != "xno" -a "x$with_bcg729" != "x"; then BCG729_PREFIX=$with_bcg729 BCG729_CFLAGS="-I$BCG729_PREFIX/include" BCG729_LDFLAGS="-L$BCG729_PREFIX/lib" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: Using bcg729 prefix... $with_bcg729" >&5 -$as_echo "Using bcg729 prefix... $with_bcg729" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: Using bcg729 prefix... $with_bcg729" >&5 +printf "%s\n" "Using bcg729 prefix... $with_bcg729" >&6; } else BCG729_CFLAGS="" BCG729_LDFLAGS="" fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking bcg729 usability" >&5 -$as_echo_n "checking bcg729 usability... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking bcg729 usability" >&5 +printf %s "checking bcg729 usability... " >&6; } BCG729_LIBS="-lbcg729" @@ -8921,7 +9822,7 @@ #include int -main () +main (void) { initBcg729EncoderChannel(0); @@ -8929,26 +9830,27 @@ return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : - $as_echo "#define PJMEDIA_HAS_BCG729 1" >>confdefs.h + printf "%s\n" "#define PJMEDIA_HAS_BCG729 1" >>confdefs.h - { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 -$as_echo "ok" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } -else +else $as_nop ac_no_bcg729=1 - $as_echo "#define PJMEDIA_HAS_BCG729 0" >>confdefs.h + printf "%s\n" "#define PJMEDIA_HAS_BCG729 0" >>confdefs.h LIBS="$SAVED_LIBS" LDFLAGS="$SAVED_LDFLAGS" CFLAGS="$SAVED_CFLAGS" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext @@ -8958,17 +9860,18 @@ # Check whether --enable-libyuv was given. -if test "${enable_libyuv+set}" = set; then : +if test ${enable_libyuv+y} +then : enableval=$enable_libyuv; if test "$enable_libyuv" = "no"; then ac_no_yuv=1 - $as_echo "#define PJMEDIA_HAS_LIBYUV 0" >>confdefs.h + printf "%s\n" "#define PJMEDIA_HAS_LIBYUV 0" >>confdefs.h - { $as_echo "$as_me:${as_lineno-$LINENO}: result: Checking if libyuv is disabled...yes" >&5 -$as_echo "Checking if libyuv is disabled...yes" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: Checking if libyuv is disabled...yes" >&5 +printf "%s\n" "Checking if libyuv is disabled...yes" >&6; } fi -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: Checking if libyuv is disabled...no" >&5 -$as_echo "Checking if libyuv is disabled...no" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: Checking if libyuv is disabled...no" >&5 +printf "%s\n" "Checking if libyuv is disabled...no" >&6; } fi @@ -8978,18 +9881,19 @@ # Check whether --enable-libwebrtc was given. -if test "${enable_libwebrtc+set}" = set; then : +if test ${enable_libwebrtc+y} +then : enableval=$enable_libwebrtc; if test "$enable_libwebrtc" = "no"; then ac_no_webrtc=1 - $as_echo "#define PJMEDIA_HAS_LIBWEBRTC 0" >>confdefs.h + printf "%s\n" "#define PJMEDIA_HAS_LIBWEBRTC 0" >>confdefs.h - { $as_echo "$as_me:${as_lineno-$LINENO}: result: Checking if libwebrtc is disabled...yes" >&5 -$as_echo "Checking if libwebrtc is disabled...yes" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: Checking if libwebrtc is disabled...yes" >&5 +printf "%s\n" "Checking if libwebrtc is disabled...yes" >&6; } fi -else +else $as_nop - { $as_echo "$as_me:${as_lineno-$LINENO}: result: Checking if libwebrtc is disabled...no" >&5 -$as_echo "Checking if libwebrtc is disabled...no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: Checking if libwebrtc is disabled...no" >&5 +printf "%s\n" "Checking if libwebrtc is disabled...no" >&6; } case $target in *-apple-darwin_ios*) case $target in @@ -9043,6 +9947,10 @@ ac_webrtc_instset=neon ac_webrtc_cflags="-DWEBRTC_ARCH_ARMV7 -mfloat-abi=hard -mfpu=neon" ;; + arm-apple-darwin* | aarch64*) + ac_webrtc_instset=neon + ac_webrtc_cflags="-DWEBRTC_ARCH_ARM64" + ;; *) ac_webrtc_instset=sse2 ;; @@ -9058,74 +9966,215 @@ -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if select() needs correct nfds" >&5 -$as_echo_n "checking if select() needs correct nfds... " >&6; } + + +# Check whether --enable-libwebrtc_aec3 was given. +if test ${enable_libwebrtc_aec3+y} +then : + enableval=$enable_libwebrtc_aec3; + if test "$enable_libwebrtc_aec3" = "yes"; then + # Test if we can build WebRtc AEC3 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if WebRtc AEC3 can be compiled with C++17" >&5 +printf %s "checking if WebRtc AEC3 can be compiled with C++17... " >&6; } + + SAVED_CXXFLAGS="$CXXFLAGS" + CXXFLAGS="$CXXFLAGS -std=c++17" + + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_link "$LINENO" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + LD="$CXX" +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + CXXFLAGS="$SAVED_CXXFLAGS" + ac_no_webrtc_aec3=1 + printf "%s\n" "#define PJMEDIA_HAS_LIBWEBRTC_AEC3 0" >>confdefs.h + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + + case $target in + *-apple-darwin_ios*) + case $target in + arm64*) + ac_webrtc_aec3_instset=neon + ac_webrtc_aec3_cflags="-DWEBRTC_ARCH_ARM64" + ;; + *arm*) + ac_webrtc_aec3_instset=neon + ;; + *) + ac_webrtc_aec3_instset=sse2 + ;; + esac + ac_webrtc_aec3_cflags+=" -DWEBRTC_IOS=1" + ;; + *android*) + case $TARGET_ABI in + armeabi-v7a) + ac_webrtc_aec3_instset=neon + ac_webrtc_aec3_cflags="-mfloat-abi=softfp -mfpu=neon" + ;; + armeabi) + ac_webrtc_aec3_instset=neon + ac_webrtc_aec3_cflags="-mthumb -mfloat-abi=softfp -mfpu=neon -march=armv7" + ;; + arm64*) + ac_webrtc_aec3_instset=neon + ac_webrtc_aec3_cflags="-DWEBRTC_ARCH_ARM64" + ;; + x86*) + ac_webrtc_aec3_instset=sse2 + ;; + esac + ac_webrtc_aec3_cflags+=" -DWEBRTC_ANDROID=1" + ;; + *mingw* | *cygw*) + ac_webrtc_aec3_instset=sse2 + ac_webrtc_aec3_cflags="-msse2" + ;; + *win32* | *w32* | *darwin* | *linux*) + case $target in + armv7l*gnueabihf) + ac_webrtc_aec3_instset=neon + ac_webrtc_aec3_cflags="-DWEBRTC_ARCH_ARMV7 -mfloat-abi=hard -mfpu=neon" + ;; + arm-apple-darwin* | aarch64*) + ac_webrtc_aec3_instset=neon + ac_webrtc_aec3_cflags="-DWEBRTC_ARCH_ARM64" + ;; + *) + ac_webrtc_aec3_instset=sse2 + ;; + esac + case $target in + *darwin*) + ac_webrtc_aec3_cflags+=" -DWEBRTC_MAC=1" + ;; + *linux*) + ac_webrtc_aec3_cflags+=" -DWEBRTC_LINUX=1" + ;; + esac + ;; + *) + ;; + esac + ac_webrtc_aec3_cflags+=" -DWEBRTC_APM_DEBUG_DUMP=0 -DWEBRTC_POSIX=1" + else + ac_no_webrtc_aec3=1 + printf "%s\n" "#define PJMEDIA_HAS_LIBWEBRTC_AEC3 0" >>confdefs.h + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: Checking if libwebrtc-aec3 is enabled...no" >&5 +printf "%s\n" "Checking if libwebrtc-aec3 is enabled...no" >&6; } + fi + +else $as_nop + ac_no_webrtc_aec3=1 + printf "%s\n" "#define PJMEDIA_HAS_LIBWEBRTC_AEC3 0" >>confdefs.h + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: Checking if libwebrtc-aec3 is enabled...no" >&5 +printf "%s\n" "Checking if libwebrtc-aec3 is enabled...no" >&6; } + +fi + + + + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if select() needs correct nfds" >&5 +printf %s "checking if select() needs correct nfds... " >&6; } case $target in - *rtems*) $as_echo "#define PJ_SELECT_NEEDS_NFDS 1" >>confdefs.h + *rtems*) printf "%s\n" "#define PJ_SELECT_NEEDS_NFDS 1" >>confdefs.h - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } ;; - *) $as_echo "#define PJ_SELECT_NEEDS_NFDS 0" >>confdefs.h + *) printf "%s\n" "#define PJ_SELECT_NEEDS_NFDS 0" >>confdefs.h - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no (default)" >&5 -$as_echo "no (default)" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: ** Decided that select() doesn't need correct nfds (please check)" >&5 -$as_echo "** Decided that select() doesn't need correct nfds (please check)" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no (default)" >&5 +printf "%s\n" "no (default)" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: ** Decided that select() doesn't need correct nfds (please check)" >&5 +printf "%s\n" "** Decided that select() doesn't need correct nfds (please check)" >&6; } ;; esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if pj_thread_create() should enforce stack size" >&5 -$as_echo_n "checking if pj_thread_create() should enforce stack size... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if pj_thread_create() should enforce stack size" >&5 +printf %s "checking if pj_thread_create() should enforce stack size... " >&6; } case $target in - *rtems*) $as_echo "#define PJ_THREAD_SET_STACK_SIZE 1" >>confdefs.h + *rtems*) printf "%s\n" "#define PJ_THREAD_SET_STACK_SIZE 1" >>confdefs.h - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } ;; - *) $as_echo "#define PJ_THREAD_SET_STACK_SIZE 0" >>confdefs.h + *) printf "%s\n" "#define PJ_THREAD_SET_STACK_SIZE 0" >>confdefs.h - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no (default)" >&5 -$as_echo "no (default)" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no (default)" >&5 +printf "%s\n" "no (default)" >&6; } ;; esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if pj_thread_create() should allocate stack" >&5 -$as_echo_n "checking if pj_thread_create() should allocate stack... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if pj_thread_create() should allocate stack" >&5 +printf %s "checking if pj_thread_create() should allocate stack... " >&6; } case $target in - *rtems*) $as_echo "#define PJ_THREAD_ALLOCATE_STACK 1" >>confdefs.h + *rtems*) printf "%s\n" "#define PJ_THREAD_ALLOCATE_STACK 1" >>confdefs.h - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } ;; - *) $as_echo "#define PJ_THREAD_ALLOCATE_STACK 0" >>confdefs.h + *) printf "%s\n" "#define PJ_THREAD_ALLOCATE_STACK 0" >>confdefs.h - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no (default)" >&5 -$as_echo "no (default)" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no (default)" >&5 +printf "%s\n" "no (default)" >&6; } ;; esac case $target in *mingw* | *cygw* | *win32* | *w32* ) - $as_echo "#define PJ_BLOCKING_ERROR_VAL WSAEWOULDBLOCK" >>confdefs.h + printf "%s\n" "#define PJ_BLOCKING_ERROR_VAL WSAEWOULDBLOCK" >>confdefs.h ;; - *) $as_echo "#define PJ_BLOCKING_ERROR_VAL EAGAIN" >>confdefs.h + *) printf "%s\n" "#define PJ_BLOCKING_ERROR_VAL EAGAIN" >>confdefs.h - { $as_echo "$as_me:${as_lineno-$LINENO}: result: ** Setting non-blocking recv() retval to EAGAIN (please check)" >&5 -$as_echo "** Setting non-blocking recv() retval to EAGAIN (please check)" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: ** Setting non-blocking recv() retval to EAGAIN (please check)" >&5 +printf "%s\n" "** Setting non-blocking recv() retval to EAGAIN (please check)" >&6; } ;; esac case $target in *mingw* | *cygw* | *win32* | *w32* ) - $as_echo "#define PJ_BLOCKING_CONNECT_ERROR_VAL WSAEWOULDBLOCK" >>confdefs.h + printf "%s\n" "#define PJ_BLOCKING_CONNECT_ERROR_VAL WSAEWOULDBLOCK" >>confdefs.h ;; - *) $as_echo "#define PJ_BLOCKING_CONNECT_ERROR_VAL EINPROGRESS" >>confdefs.h + *) printf "%s\n" "#define PJ_BLOCKING_CONNECT_ERROR_VAL EINPROGRESS" >>confdefs.h - { $as_echo "$as_me:${as_lineno-$LINENO}: result: ** Setting non-blocking connect() retval to EINPROGRESS (please check)" >&5 -$as_echo "** Setting non-blocking connect() retval to EINPROGRESS (please check)" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: ** Setting non-blocking connect() retval to EINPROGRESS (please check)" >&5 +printf "%s\n" "** Setting non-blocking connect() retval to EINPROGRESS (please check)" >&6; } ;; esac @@ -9172,8 +10221,8 @@ case $ac_val in #( *${as_nl}*) case $ac_var in #( - *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 -$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + *_cv_*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 +printf "%s\n" "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( @@ -9203,15 +10252,15 @@ /^ac_cv_env_/b end t clear :clear - s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ + s/^\([^=]*\)=\(.*[{}].*\)$/test ${\1+y} || &/ t end s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then if test "x$cache_file" != "x/dev/null"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 -$as_echo "$as_me: updating cache $cache_file" >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 +printf "%s\n" "$as_me: updating cache $cache_file" >&6;} if test ! -f "$cache_file" || test -h "$cache_file"; then cat confcache >"$cache_file" else @@ -9225,8 +10274,8 @@ fi fi else - { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 -$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 +printf "%s\n" "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache @@ -9243,7 +10292,7 @@ for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' - ac_i=`$as_echo "$ac_i" | sed "$ac_script"` + ac_i=`printf "%s\n" "$ac_i" | sed "$ac_script"` # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR # will be set to the directory where LIBOBJS objects are built. as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" @@ -9260,8 +10309,8 @@ ac_write_fail=0 ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" -{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 -$as_echo "$as_me: creating $CONFIG_STATUS" >&6;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 +printf "%s\n" "$as_me: creating $CONFIG_STATUS" >&6;} as_write_fail=0 cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 #! $SHELL @@ -9284,14 +10333,16 @@ # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : +as_nop=: +if test ${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1 +then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST -else +else $as_nop case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( @@ -9301,46 +10352,46 @@ fi + +# Reset variables that may have inherited troublesome values from +# the environment. + +# IFS needs to be set, to space, tab, and newline, in precisely that order. +# (If _AS_PATH_WALK were called with IFS unset, it would have the +# side effect of setting IFS to empty, thus disabling word splitting.) +# Quoting is to prevent editors from complaining about space-tab. as_nl=' ' export as_nl -# Printing a long string crashes Solaris 7 /usr/bin/printf. -as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' -as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo -as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo -# Prefer a ksh shell builtin over an external printf program on Solaris, -# but without wasting forks for bash or zsh. -if test -z "$BASH_VERSION$ZSH_VERSION" \ - && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then - as_echo='print -r --' - as_echo_n='print -rn --' -elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then - as_echo='printf %s\n' - as_echo_n='printf %s' -else - if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then - as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' - as_echo_n='/usr/ucb/echo -n' - else - as_echo_body='eval expr "X$1" : "X\\(.*\\)"' - as_echo_n_body='eval - arg=$1; - case $arg in #( - *"$as_nl"*) - expr "X$arg" : "X\\(.*\\)$as_nl"; - arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; - esac; - expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" - ' - export as_echo_n_body - as_echo_n='sh -c $as_echo_n_body as_echo' - fi - export as_echo_body - as_echo='sh -c $as_echo_body as_echo' -fi +IFS=" "" $as_nl" + +PS1='$ ' +PS2='> ' +PS4='+ ' + +# Ensure predictable behavior from utilities with locale-dependent output. +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# We cannot yet rely on "unset" to work, but we need these variables +# to be unset--not just set to an empty or harmless value--now, to +# avoid bugs in old shells (e.g. pre-3.0 UWIN ksh). This construct +# also avoids known problems related to "unset" and subshell syntax +# in other old shells (e.g. bash 2.01 and pdksh 5.2.14). +for as_var in BASH_ENV ENV MAIL MAILPATH CDPATH +do eval test \${$as_var+y} \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : +done + +# Ensure that fds 0, 1, and 2 are open. +if (exec 3>&0) 2>/dev/null; then :; else exec 0&1) 2>/dev/null; then :; else exec 1>/dev/null; fi +if (exec 3>&2) ; then :; else exec 2>/dev/null; fi # The user is always right. -if test "${PATH_SEPARATOR+set}" != set; then +if ${PATH_SEPARATOR+false} :; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || @@ -9349,13 +10400,6 @@ fi -# IFS -# We need space, tab and new line, in precisely that order. Quoting is -# there to prevent editors from complaining about space-tab. -# (If _AS_PATH_WALK were called with IFS unset, it would disable word -# splitting by setting IFS to empty value.) -IFS=" "" $as_nl" - # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( @@ -9364,8 +10408,12 @@ for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + test -r "$as_dir$0" && as_myself=$as_dir$0 && break done IFS=$as_save_IFS @@ -9377,30 +10425,10 @@ as_myself=$0 fi if test ! -f "$as_myself"; then - $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + printf "%s\n" "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi -# Unset variables that we do not need and which cause bugs (e.g. in -# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" -# suppresses any "Segmentation fault" message there. '((' could -# trigger a bug in pdksh 5.2.14. -for as_var in BASH_ENV ENV MAIL MAILPATH -do eval test x\${$as_var+set} = xset \ - && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : -done -PS1='$ ' -PS2='> ' -PS4='+ ' - -# NLS nuisances. -LC_ALL=C -export LC_ALL -LANGUAGE=C -export LANGUAGE - -# CDPATH. -(unset CDPATH) >/dev/null 2>&1 && unset CDPATH # as_fn_error STATUS ERROR [LINENO LOG_FD] @@ -9413,13 +10441,14 @@ as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi - $as_echo "$as_me: error: $2" >&2 + printf "%s\n" "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error + # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. @@ -9446,18 +10475,20 @@ { eval $1=; unset $1;} } as_unset=as_fn_unset + # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. -if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null +then : eval 'as_fn_append () { eval $1+=\$2 }' -else +else $as_nop as_fn_append () { eval $1=\$$1\$2 @@ -9469,12 +10500,13 @@ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. -if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null +then : eval 'as_fn_arith () { as_val=$(( $* )) }' -else +else $as_nop as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` @@ -9505,7 +10537,7 @@ $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X/"$0" | +printf "%s\n" X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q @@ -9527,6 +10559,10 @@ as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits + +# Determine whether it's possible to make 'echo' print without a newline. +# These variables are no longer used directly by Autoconf, but are AC_SUBSTed +# for compatibility with existing Makefiles. ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) @@ -9540,6 +10576,12 @@ ECHO_N='-n';; esac +# For backward compatibility with old third-party macros, we provide +# the shell variables $as_echo and $as_echo_n. New code should use +# AS_ECHO(["message"]) and AS_ECHO_N(["message"]), respectively. +as_echo='printf %s\n' +as_echo_n='printf %s' + rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file @@ -9581,7 +10623,7 @@ as_dirs= while :; do case $as_dir in #( - *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *\'*) as_qdir=`printf "%s\n" "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" @@ -9590,7 +10632,7 @@ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$as_dir" | +printf "%s\n" X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q @@ -9653,7 +10695,7 @@ # values after options handling. ac_log=" This file was extended by pjproject $as_me 2.x, which was -generated by GNU Autoconf 2.69. Invocation command line was +generated by GNU Autoconf 2.71. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS @@ -9711,14 +10753,16 @@ Report bugs to the package provider." _ACEOF +ac_cs_config=`printf "%s\n" "$ac_configure_args" | sed "$ac_safe_unquote"` +ac_cs_config_escaped=`printf "%s\n" "$ac_cs_config" | sed "s/^ //; s/'/'\\\\\\\\''/g"` cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" +ac_cs_config='$ac_cs_config_escaped' ac_cs_version="\\ pjproject config.status 2.x -configured by $0, generated by GNU Autoconf 2.69, +configured by $0, generated by GNU Autoconf 2.71, with options \\"\$ac_cs_config\\" -Copyright (C) 2012 Free Software Foundation, Inc. +Copyright (C) 2021 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." @@ -9755,15 +10799,15 @@ -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) - $as_echo "$ac_cs_version"; exit ;; + printf "%s\n" "$ac_cs_version"; exit ;; --config | --confi | --conf | --con | --co | --c ) - $as_echo "$ac_cs_config"; exit ;; + printf "%s\n" "$ac_cs_config"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift case $ac_optarg in - *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + *\'*) ac_optarg=`printf "%s\n" "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; '') as_fn_error $? "missing file argument" ;; esac as_fn_append CONFIG_FILES " '$ac_optarg'" @@ -9771,7 +10815,7 @@ --header | --heade | --head | --hea ) $ac_shift case $ac_optarg in - *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + *\'*) ac_optarg=`printf "%s\n" "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; esac as_fn_append CONFIG_HEADERS " '$ac_optarg'" ac_need_defaults=false;; @@ -9780,7 +10824,7 @@ as_fn_error $? "ambiguous option: \`$1' Try \`$0 --help' for more information.";; --help | --hel | -h ) - $as_echo "$ac_cs_usage"; exit ;; + printf "%s\n" "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; @@ -9808,7 +10852,7 @@ if \$ac_cs_recheck; then set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion shift - \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 + \printf "%s\n" "running CONFIG_SHELL=$SHELL \$*" >&6 CONFIG_SHELL='$SHELL' export CONFIG_SHELL exec "\$@" @@ -9822,7 +10866,7 @@ sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX - $as_echo "$ac_log" + printf "%s\n" "$ac_log" } >&5 _ACEOF @@ -9859,8 +10903,8 @@ # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then - test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files - test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers + test ${CONFIG_FILES+y} || CONFIG_FILES=$config_files + test ${CONFIG_HEADERS+y} || CONFIG_HEADERS=$config_headers fi # Have a temporary directory for convenience. Make it in the build tree @@ -10196,7 +11240,7 @@ esac || as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; esac - case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac + case $ac_f in *\'*) ac_f=`printf "%s\n" "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac as_fn_append ac_file_inputs " '$ac_f'" done @@ -10204,17 +11248,17 @@ # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ configure_input='Generated from '` - $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' + printf "%s\n" "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' `' by configure.' if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" - { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 -$as_echo "$as_me: creating $ac_file" >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 +printf "%s\n" "$as_me: creating $ac_file" >&6;} fi # Neutralize special characters interpreted by sed in replacement strings. case $configure_input in #( *\&* | *\|* | *\\* ) - ac_sed_conf_input=`$as_echo "$configure_input" | + ac_sed_conf_input=`printf "%s\n" "$configure_input" | sed 's/[\\\\&|]/\\\\&/g'`;; #( *) ac_sed_conf_input=$configure_input;; esac @@ -10231,7 +11275,7 @@ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$ac_file" | +printf "%s\n" X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q @@ -10255,9 +11299,9 @@ case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) - ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` + ac_dir_suffix=/`printf "%s\n" "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. - ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + ac_top_builddir_sub=`printf "%s\n" "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; @@ -10310,8 +11354,8 @@ case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 -$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 +printf "%s\n" "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_datarootdir_hack=' @@ -10353,9 +11397,9 @@ { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ "$ac_tmp/out"`; test -z "$ac_out"; } && - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&5 -$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' +printf "%s\n" "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&2;} rm -f "$ac_tmp/stdin" @@ -10371,20 +11415,20 @@ # if test x"$ac_file" != x-; then { - $as_echo "/* $configure_input */" \ + printf "%s\n" "/* $configure_input */" >&1 \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" } >"$ac_tmp/config.h" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then - { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 -$as_echo "$as_me: $ac_file is unchanged" >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 +printf "%s\n" "$as_me: $ac_file is unchanged" >&6;} else rm -f "$ac_file" mv "$ac_tmp/config.h" "$ac_file" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 fi else - $as_echo "/* $configure_input */" \ + printf "%s\n" "/* $configure_input */" >&1 \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \ || as_fn_error $? "could not create -" "$LINENO" 5 fi @@ -10425,13 +11469,13 @@ $ac_cs_success || as_fn_exit 1 fi if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 -$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 +printf "%s\n" "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: Configurations for current target have been written to 'build.mak', and 'os-auto.mak' in various build directories, and pjlib/include/pj/compat/os_auto.h. @@ -10441,7 +11485,7 @@ The next step now is to run 'make dep' and 'make'. " >&5 -$as_echo " +printf "%s\n" " Configurations for current target have been written to 'build.mak', and 'os-auto.mak' in various build directories, and pjlib/include/pj/compat/os_auto.h. @@ -10452,3 +11496,4 @@ The next step now is to run 'make dep' and 'make'. " >&6; } + diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/aconfigure.ac asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/aconfigure.ac --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/aconfigure.ac 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/aconfigure.ac 2022-02-24 07:54:38.000000000 +0000 @@ -5,7 +5,7 @@ AC_CANONICAL_BUILD AC_CANONICAL_HOST AC_CANONICAL_TARGET -AC_CONFIG_HEADER([pjlib/include/pj/compat/os_auto.h +AC_CONFIG_HEADERS([pjlib/include/pj/compat/os_auto.h pjlib/include/pj/compat/m_auto.h pjmedia/include/pjmedia/config_auto.h pjmedia/include/pjmedia-codec/config_auto.h @@ -38,7 +38,7 @@ dnl Make sure C++ compiler works AC_LANG_PUSH([C++]) -AC_TRY_LINK([], [], , AC_MSG_ERROR([C++ compiler does not work])) +AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[]])],[],[AC_MSG_ERROR(C++ compiler does not work)]) AC_LANG_POP([C++]) AC_PROG_RANLIB @@ -71,6 +71,7 @@ AC_SUBST(ac_pjdir) AC_SUBST(ac_build_mak_vars) +AC_SUBST(ac_cflags) case $host in *mingw* | *cygw* | *win32* | *w32* ) @@ -144,8 +145,10 @@ if test "x$ac_cv_c_bigendian" = "xyes"; then CFLAGS="$CFLAGS -DPJ_IS_BIG_ENDIAN=1 -DPJ_IS_LITTLE_ENDIAN=0" + ac_cflags="$ac_cflags -DPJ_IS_BIG_ENDIAN=1 -DPJ_IS_LITTLE_ENDIAN=0" else CFLAGS="$CFLAGS -DPJ_IS_BIG_ENDIAN=0 -DPJ_IS_LITTLE_ENDIAN=1" + ac_cflags="$ac_cflags -DPJ_IS_BIG_ENDIAN=0 -DPJ_IS_LITTLE_ENDIAN=1" fi dnl @@ -161,6 +164,11 @@ AC_DEFINE(PJ_WIN32,1) AC_DEFINE(PJ_WIN32_WINNT,0x0400) AC_DEFINE(WIN32_LEAN_AND_MEAN) + case $target in + *_64-w64-mingw* ) + AC_DEFINE(PJ_WIN64,1) + ;; + esac ;; *darwin*) AC_DEFINE(PJ_DARWINOS,1) @@ -460,6 +468,17 @@ AC_MSG_RESULT([Building shared libraries... no]) ) +AC_SUBST(ac_no_pjsua2) +AC_ARG_ENABLE(pjsua2, + AS_HELP_STRING([--disable-pjsua2], + [Exclude pjsua2 library and application from the build]), + [if test "$enable_pjsua2" = "no"; then + [ac_no_pjsua2=1] + AC_MSG_RESULT([Building pjsua2 library and application... no]) + fi], + AC_MSG_RESULT([Building pjsua2 library and application... yes]) + ) + dnl ###################### dnl # OS specific files @@ -487,11 +506,23 @@ ac_os_objs="$ac_os_objs sock_qos_bsd.o" ;; esac + # SSL + case $target in + *darwin*) + ac_os_objs="$ac_os_objs ssl_sock_apple.o" + ;; + esac # UUID case $target in *android*) ac_os_objs="$ac_os_objs guid_android.o" ;; + *darwin*) + ac_os_objs="$ac_os_objs guid_darwin.o" + ;; + *bsd*) + ac_os_objs="$ac_os_objs guid_bsd.o" + ;; *) if test "$ac_has_uuid_lib" = "1" -a "$ac_has_uuid_h" = "1"; then ac_os_objs="$ac_os_objs guid_uuid.o" @@ -648,6 +679,27 @@ ) +dnl # Use external webrtc AEC3 installation +AC_SUBST(ac_external_webrtc_aec3,0) +AC_ARG_WITH(external-webrtc-aec3, + AS_HELP_STRING([--with-external-webrtc-aec3], + [Use external webrtc AEC3 development files, not the one in "third_party" directory. When this option is set, make sure that webrtc is accessible to use (hint: use CFLAGS and LDFLAGS env var to set the include/lib paths)]), + [ + if test "x$with_external_webrtc_aec3" != "xno"; then + # Test webrtc AEC3 installation + AC_MSG_CHECKING([if external webrtc AEC3 is installed]) + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include "modules/audio_processing/aec3/echo_canceller3.h" + ]], + [EchoCanceller3 ec(EchoCanceller3Config(), 16000, 1, 1);])], + [AC_MSG_RESULT(yes!!) + ac_external_webrtc_aec3="1" + ], + [AC_MSG_ERROR([Unable to use external webrtc AEC3. If webrtc development files are not available in the default locations, use CFLAGS and LDFLAGS env var to set the include/lib paths])]) + fi + ] + ) + + dnl # Resample implementation AC_SUBST(ac_pjmedia_resample,libresample) AC_ARG_ENABLE(resample, @@ -704,14 +756,69 @@ ac_pa_cflags="$ac_pa_cflags -DPA_LITTLE_ENDIAN" fi + +dnl # Enable Android Oboe audio device +AC_SUBST(ac_oboe_cflags) +AC_SUBST(ac_oboe_ldflags) +AC_ARG_WITH(oboe, + AS_HELP_STRING([--with-oboe], + [Enable Android Oboe audio device backend.]), + [ + if test "x$with_oboe" != "xno" -a "x$with_oboe" != "x"; then + OBOE_PREFIX=$with_oboe + OBOE_CFLAGS="-I$OBOE_PREFIX/prefab/modules/oboe/include" + OBOE_LDFLAGS="-L$OBOE_PREFIX/prefab/modules/oboe/libs/android.$TARGET_ABI" + AC_MSG_RESULT([Using Oboe prefix... $with_oboe]) + else + OBOE_CFLAGS="" + OBOE_LDFLAGS="" + fi + + AC_MSG_CHECKING([Oboe usability]) + + OBOE_LIBS="-loboe -lOpenSLES -llog" + + SAVED_LIBS="$LIBS" + SAVED_LDFLAGS="$LDFLAGS" + SAVED_CXXFLAGS="$CXXFLAGS" + + LIBS="$OBOE_LIBS $LIBS" + LDFLAGS="$OBOE_LDFLAGS $LDFLAGS" + CXXFLAGS="$OBOE_CFLAGS $CXXFLAGS" + + AC_LANG_PUSH([C++]) + AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include ]], + [oboe::AudioStreamBuilder sb; sb.setDeviceId(0);] + )], + [ ac_oboe_cflags="-DPJMEDIA_AUDIO_DEV_HAS_OBOE=1 $OBOE_CFLAGS" + ac_oboe_ldflags="$OBOE_LDFLAGS $OBOE_LIBS" + AC_MSG_RESULT(yes) + ], + [ + LIBS="$SAVED_LIBS" + LDFLAGS="$SAVED_LDFLAGS" + AC_MSG_RESULT(no) + ]) + AC_LANG_POP([C++]) + + # Put back original CXXFLAGS as app won't needed it. + CXXFLAGS="$SAVED_CFLAGS" + ] + ) + + if test "$enable_sound" = "no"; then true; else AC_SUBST(ac_pjmedia_audiodev_objs) case $target in *android*) - LIBS="$LIBS -lOpenSLES" - AC_MSG_RESULT([Checking sound device backend... OpenSL ES]) + if test "x$ac_oboe_cflags" != "x"; then + AC_MSG_RESULT([Checking sound device backend... Oboe]) + else + LIBS="$LIBS -lOpenSLES" + AC_MSG_RESULT([Checking sound device backend... Android]) + fi ;; *-apple-darwin_ios*) LIBS="$LIBS -framework CoreAudio -framework CoreFoundation -framework AudioToolbox -framework CFNetwork -framework UIKit -framework AVFoundation" @@ -758,10 +865,12 @@ AC_SUBST(ac_pjmedia_video) -# Disable video on mingw +# Disable video on mingw by default (but respect --enable-video=yes) case $target in *mingw*) + if test ! "$enable_video" = "yes"; then enable_video="no" + fi ;; esac @@ -777,6 +886,7 @@ enable_v4l2="no" enable_openh264="no" enable_libyuv="no" + enable_vpx="no" fi], []) @@ -801,7 +911,7 @@ AC_SUBST(ac_pjmedia_video_has_android) AC_SUBST(ac_android_cflags) SAVED_LIBS="$LIBS" - LIBS="-lGLESv2 -lEGL -landroid -lgcc -lc" + LIBS="-lGLESv2 -lEGL -landroid -lc" AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [])],[ac_pjmedia_video_has_android=yes],[ac_pjmedia_video_has_android=no]) LIBS="$SAVED_LIBS" if test "$ac_pjmedia_video_has_android" = "yes"; then @@ -813,6 +923,18 @@ fi ac_android_cflags="$ac_android_cflags -DPJMEDIA_VIDEO_DEV_HAS_ANDROID=1" ;; + *mingw*) + if test "$enable_video" = "yes"; then + ac_pjmedia_video=windows_os + AC_SUBST(ac_pjmedia_video_dev_has_dshow) + ac_pjmedia_video_dev_has_dshow=yes + AC_SUBST(ac_dshow_cflags) + ac_dshow_cflags="-DPJMEDIA_HAS_VIDEO=1 -DPJMEDIA_VIDEO_DEV_HAS_DSHOW=1" + AC_SUBST(ac_dshow_ldflags) + ac_dshow_ldflags=" -lstdc++ -lquartz -lole32 -loleaut32 -lrpcrt4 -lwinmm -luuid -lmingwex -lstrmiids " + LIBS="$LIBS -lstdc++ -lquartz -lole32 -loleaut32 -lrpcrt4 -lwinmm -luuid -lmingwex -lstrmiids " + fi + ;; *darwin*) ac_pjmedia_video=darwin_os AC_SUBST(ac_pjmedia_video_has_darwin) @@ -1028,6 +1150,19 @@ AC_MSG_RESULT([Building libresample as shared library... no]) ) +dnl # Include Speex resample +AC_ARG_ENABLE(speex-resample, + AS_HELP_STRING([--enable-speex-resample], + [Enable Speex resample]), + [ + if test "$enable_speex_resample" = "yes"; then + AC_MSG_RESULT([Checking if Speex resample is enabled... yes]) + [ac_pjmedia_resample=speex] + else + AC_MSG_RESULT([Checking if Speex resample is enabled... no]) + fi + ], AC_MSG_RESULT([Checking if Speex resample is enabled... no])) + dnl # SDL alt prefix AC_ARG_WITH(sdl, AS_HELP_STRING([--with-sdl=DIR], @@ -1067,6 +1202,7 @@ ac_sdl_cflags=`$SDL_CONFIG --cflags` ac_sdl_cflags="-DPJMEDIA_VIDEO_DEV_HAS_SDL=1 $ac_sdl_cflags" ac_sdl_ldflags=`$SDL_CONFIG --libs` + ac_sdl_ldflags=${ac_sdl_ldflags//-mwindows/} LIBS="$LIBS $ac_sdl_ldflags" else AC_MSG_RESULT([Unsupported SDL version]) @@ -1286,7 +1422,7 @@ )], [ ac_openh264_cflags="-DPJMEDIA_HAS_OPENH264_CODEC=1 $OPENH264_CFLAGS" ac_openh264_ldflags="$OPENH264_LDFLAGS $OPENH264_LIBS" - AC_MSG_RESULT(ok) + AC_MSG_RESULT(yes) ], [ LIBS="$SAVED_LIBS" @@ -1351,7 +1487,7 @@ )], [ ac_vpx_cflags="-DPJMEDIA_HAS_VPX_CODEC=1 $VPX_CFLAGS" ac_vpx_ldflags="$VPX_LDFLAGS $VPX_LIBS" - AC_MSG_RESULT(ok) + AC_MSG_RESULT(yes) ], [ LIBS="$SAVED_LIBS" @@ -1484,7 +1620,7 @@ AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include ]], [ippStaticInit();])], - [AC_MSG_RESULT(ok)], + [AC_MSG_RESULT(yes)], [AC_MSG_FAILURE([Error: unable to recognize your IPP installation. Make sure the paths and ARCH suffix are set correctly, run with --help for more info])]) CFLAGS="$SAVED_CFLAGS" @@ -1574,7 +1710,7 @@ AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include ]], [extern USC_Fxns USC_G729AFP_Fxns;])], - [AC_MSG_RESULT(ok)], + [AC_MSG_RESULT(yes)], [AC_MSG_FAILURE(no)]) CFLAGS="$SAVED_CFLAGS" @@ -1598,6 +1734,29 @@ AC_MSG_RESULT([Skipping Intel IPP settings (not wanted)]) fi +dnl # Include Android MediaCodec +AC_SUBST(ac_no_mediacodec) + +AC_ARG_ENABLE(android-mediacodec, + AS_HELP_STRING([--disable-android-mediacodec], + [Exclude Android MediaCodec (default: autodetect)]), + [if test "$enable_android_mediacodec" = "no"; then + [ac_no_mediacodec=1] + AC_MSG_RESULT([Checking if Android MediaCodec support is disabled... yes]) + fi], + [ + case $target in + *android*) + AC_CHECK_LIB(mediandk,AMediaCodec_createDecoderByType,[ac_pjmedia_has_amediacodec=1 && LIBS="-lmediandk $LIBS"]) + if test "x$ac_pjmedia_has_amediacodec" = "x1"; then + AC_MSG_RESULT([Checking if Android AMediaCodec library is available... yes]) + AC_DEFINE(PJMEDIA_HAS_ANDROID_MEDIACODEC, 1) + else + AC_MSG_RESULT([Checking if Android AMediaCodec library is available... no]) + fi + ;; + esac + ]) dnl ########################################## dnl # @@ -2010,7 +2169,7 @@ )], [ AC_DEFINE(PJMEDIA_HAS_BCG729,1) - AC_MSG_RESULT(ok) + AC_MSG_RESULT(yes) ], [ [ac_no_bcg729=1] @@ -2105,6 +2264,10 @@ ac_webrtc_instset=neon ac_webrtc_cflags="-DWEBRTC_ARCH_ARMV7 -mfloat-abi=hard -mfpu=neon" ;; + arm-apple-darwin* | aarch64*) + ac_webrtc_instset=neon + ac_webrtc_cflags="-DWEBRTC_ARCH_ARM64" + ;; *) ac_webrtc_instset=sse2 ;; @@ -2116,6 +2279,111 @@ ]) +dnl # Include webrtc AEC3 +AC_SUBST(ac_no_webrtc_aec3) +AC_SUBST(ac_webrtc_aec3_instset) +AC_SUBST(ac_webrtc_aec3_cflags) +AC_SUBST(ac_webrtc_aec3_ldflags) +AC_ARG_ENABLE(libwebrtc_aec3, + AS_HELP_STRING([--enable-libwebrtc-aec3], + [Build libwebrtc-aec3 that's included in PJSIP]), + [ + if test "$enable_libwebrtc_aec3" = "yes"; then + # Test if we can build WebRtc AEC3 + AC_MSG_CHECKING([if WebRtc AEC3 can be compiled with C++17]) + + SAVED_CXXFLAGS="$CXXFLAGS" + CXXFLAGS="$CXXFLAGS -std=c++17" + + AC_LANG_PUSH([C++]) + AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [])], + [AC_MSG_RESULT(yes) + LD="$CXX"], + [AC_MSG_RESULT(no) + CXXFLAGS="$SAVED_CXXFLAGS" + ac_no_webrtc_aec3=1 + AC_DEFINE(PJMEDIA_HAS_LIBWEBRTC_AEC3,0)]) + AC_LANG_POP([C++]) + + case $target in + *-apple-darwin_ios*) + case $target in + arm64*) + ac_webrtc_aec3_instset=neon + ac_webrtc_aec3_cflags="-DWEBRTC_ARCH_ARM64" + ;; + *arm*) + ac_webrtc_aec3_instset=neon + ;; + *) + ac_webrtc_aec3_instset=sse2 + ;; + esac + ac_webrtc_aec3_cflags+=" -DWEBRTC_IOS=1" + ;; + *android*) + case $TARGET_ABI in + armeabi-v7a) + ac_webrtc_aec3_instset=neon + ac_webrtc_aec3_cflags="-mfloat-abi=softfp -mfpu=neon" + ;; + armeabi) + ac_webrtc_aec3_instset=neon + ac_webrtc_aec3_cflags="-mthumb -mfloat-abi=softfp -mfpu=neon -march=armv7" + ;; + arm64*) + ac_webrtc_aec3_instset=neon + ac_webrtc_aec3_cflags="-DWEBRTC_ARCH_ARM64" + ;; + x86*) + ac_webrtc_aec3_instset=sse2 + ;; + esac + ac_webrtc_aec3_cflags+=" -DWEBRTC_ANDROID=1" + ;; + *mingw* | *cygw*) + ac_webrtc_aec3_instset=sse2 + ac_webrtc_aec3_cflags="-msse2" + ;; + *win32* | *w32* | *darwin* | *linux*) + case $target in + armv7l*gnueabihf) + ac_webrtc_aec3_instset=neon + ac_webrtc_aec3_cflags="-DWEBRTC_ARCH_ARMV7 -mfloat-abi=hard -mfpu=neon" + ;; + arm-apple-darwin* | aarch64*) + ac_webrtc_aec3_instset=neon + ac_webrtc_aec3_cflags="-DWEBRTC_ARCH_ARM64" + ;; + *) + ac_webrtc_aec3_instset=sse2 + ;; + esac + case $target in + *darwin*) + ac_webrtc_aec3_cflags+=" -DWEBRTC_MAC=1" + ;; + *linux*) + ac_webrtc_aec3_cflags+=" -DWEBRTC_LINUX=1" + ;; + esac + ;; + *) + ;; + esac + ac_webrtc_aec3_cflags+=" -DWEBRTC_APM_DEBUG_DUMP=0 -DWEBRTC_POSIX=1" + else + ac_no_webrtc_aec3=1 + AC_DEFINE(PJMEDIA_HAS_LIBWEBRTC_AEC3,0) + AC_MSG_RESULT([Checking if libwebrtc-aec3 is enabled...no]) + fi + ], + [ac_no_webrtc_aec3=1 + AC_DEFINE(PJMEDIA_HAS_LIBWEBRTC_AEC3,0) + AC_MSG_RESULT([Checking if libwebrtc-aec3 is enabled...no]) + ]) + + dnl ########################################## dnl # dnl # MANUAL CONFIG diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/build/rules.mak asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/build/rules.mak --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/build/rules.mak 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/build/rules.mak 2022-02-24 07:54:38.000000000 +0000 @@ -129,7 +129,7 @@ $(OBJDIR)/$(app).o: $(OBJDIRS) $(OBJS) $(CROSS_COMPILE)ld -r -o $@ $(OBJS) -$(OBJDIR)/$(app).ko: $(OBJDIR)/$(app).o +$(OBJDIR)/$(app).ko: $(OBJDIR)/$(app).o | $(OBJDIRS) @echo Creating kbuild Makefile... @echo "# Our module name:" > $(OBJDIR)/Makefile @echo 'obj-m += $(app).o' >> $(OBJDIR)/Makefile @@ -154,27 +154,32 @@ ../lib/$(app).ko: $(LIB) $(OBJDIR)/$(app).ko cp $(OBJDIR)/$(app).ko ../lib -$(OBJDIR)/%$(OBJEXT): $(SRCDIR)/%.m +$(OBJDIR)/%$(OBJEXT): $(SRCDIR)/%.m | $(OBJDIRS) $(CC) $($(APP)_CFLAGS) \ $(CC_OUT)$(subst /,$(HOST_PSEP),$@) \ $(subst /,$(HOST_PSEP),$<) -$(OBJDIR)/%$(OBJEXT): $(SRCDIR)/%.c +$(OBJDIR)/%$(OBJEXT): $(SRCDIR)/%.c | $(OBJDIRS) $(CC) $($(APP)_CFLAGS) \ $(CC_OUT)$(subst /,$(HOST_PSEP),$@) \ $(subst /,$(HOST_PSEP),$<) -$(OBJDIR)/%$(OBJEXT): $(SRCDIR)/%.S +$(OBJDIR)/%$(OBJEXT): $(SRCDIR)/%.S | $(OBJDIRS) $(CC) $($(APP)_CFLAGS) \ $(CC_OUT)$(subst /,$(HOST_PSEP),$@) \ $(subst /,$(HOST_PSEP),$<) -$(OBJDIR)/%$(OBJEXT): $(SRCDIR)/%.cpp +$(OBJDIR)/dshowclasses.o: $(SRCDIR)/dshowclasses.cpp | $(OBJDIRS) + $(CXX) $($(APP)_CXXFLAGS) -I$(SRCDIR)/../../../third_party/BaseClasses -fpermissive \ + $(CC_OUT)$(subst /,$(HOST_PSEP),$@) \ + $(subst /,$(HOST_PSEP),$<) + +$(OBJDIR)/%$(OBJEXT): $(SRCDIR)/%.cpp | $(OBJDIRS) $(CXX) $($(APP)_CXXFLAGS) \ $(CC_OUT)$(subst /,$(HOST_PSEP),$@) \ $(subst /,$(HOST_PSEP),$<) -$(OBJDIR)/%$(OBJEXT): $(SRCDIR)/%.cc +$(OBJDIR)/%$(OBJEXT): $(SRCDIR)/%.cc | $(OBJDIRS) $(CXX) $($(APP)_CXXFLAGS) \ $(CC_OUT)$(subst /,$(HOST_PSEP),$@) \ $(subst /,$(HOST_PSEP),$<) @@ -223,8 +228,8 @@ for F in $(FULL_SRCS); do \ if test -f $$F; then \ echo "$(OBJDIR)/" | tr -d '\n' >> $(DEP_FILE); \ - if echo $$F | grep -q .cpp$$; then \ - dep="$(CC) -M $(DEPCXXFLAGS) $$F"; \ + if echo $$F | grep -q "\.c[c|pp]"; then \ + dep="$(CXX) -M $(DEPCXXFLAGS) $$F"; \ else \ dep="$(CC) -M $(DEPCFLAGS) $$F"; \ fi; \ diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/build/vs/pjproject-vs14-arm64-common-defaults.props asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/build/vs/pjproject-vs14-arm64-common-defaults.props --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/build/vs/pjproject-vs14-arm64-common-defaults.props 1970-01-01 00:00:00.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/build/vs/pjproject-vs14-arm64-common-defaults.props 2022-02-24 07:54:38.000000000 +0000 @@ -0,0 +1,25 @@ + + + + + + ARM64 + + + <_ProjectFileVersion>14.0.22823.1 + + + + Console + MachineARM64 + + + /ignore:4221 + + + + + $(TargetCPU) + + + \ No newline at end of file diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/build/vs/pjproject-vs14-arm64-release-defaults.props asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/build/vs/pjproject-vs14-arm64-release-defaults.props --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/build/vs/pjproject-vs14-arm64-release-defaults.props 1970-01-01 00:00:00.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/build/vs/pjproject-vs14-arm64-release-defaults.props 2022-02-24 07:54:38.000000000 +0000 @@ -0,0 +1,12 @@ + + + + + + + + <_ProjectFileVersion>14.0.22823.1 + + + + \ No newline at end of file diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/build/vs/pjproject-vs14-common-config.props asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/build/vs/pjproject-vs14-common-config.props --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/build/vs/pjproject-vs14-common-config.props 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/build/vs/pjproject-vs14-common-config.props 2022-02-24 07:54:38.000000000 +0000 @@ -26,6 +26,7 @@ v140 WIN32;PJ_WIN32=1;PJ_M_I386=1; WIN64;PJ_WIN64=1;PJ_M_X86_64=1; + PJ_M_ARM64=1; diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/build.mak.in asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/build.mak.in --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/build.mak.in 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/build.mak.in 2022-02-24 07:54:38.000000000 +0000 @@ -24,6 +24,10 @@ export PJ_SHARED_LIBRARIES := 1 endif +ifeq (@ac_no_pjsua2@,1) +export PJ_EXCLUDE_PJSUA2 := 1 +endif + ifndef EXCLUDE_APP ifeq ($(findstring android,$(TARGET_NAME)),) export EXCLUDE_APP := 0 @@ -148,6 +152,20 @@ endif endif +ifneq (@ac_no_webrtc_aec3@,1) +ifeq (@ac_external_webrtc_aec3@,1) +APP_THIRD_PARTY_EXT += -lwebrtc-aec3 +else +APP_THIRD_PARTY_LIB_FILES += $(PJ_DIR)/third_party/lib/libwebrtc-aec3-$(LIB_SUFFIX) +ifeq ($(PJ_SHARED_LIBRARIES),) +APP_THIRD_PARTY_LIBS += -lwebrtc-aec3-$(TARGET_NAME) +else +APP_THIRD_PARTY_LIBS += -lwebrtc-aec3 +APP_THIRD_PARTY_LIB_FILES += $(PJ_DIR)/third_party/lib/libwebrtc-aec3.$(SHLIB_SUFFIX).$(PJ_VERSION_MAJOR) $(PJ_DIR)/third_party/lib/libwebrtc.$(SHLIB_SUFFIX) +endif +endif +endif + # Additional flags @ac_build_mak_vars@ @@ -187,13 +205,23 @@ AC_PJMEDIA_VIDEO_HAS_IOS_OPENGL = @ac_pjmedia_video_has_ios_opengl@ DARWIN_CFLAGS = @ac_darwin_cflags@ +# mingw +AC_PJMEDIA_VIDEO_DEV_HAS_DSHOW = @ac_pjmedia_video_dev_has_dshow@ +ifeq (@ac_pjmedia_video_dev_has_dshow@,yes) +DSHOW_CFLAGS = @ac_dshow_cflags@ +DSHOW_LDFLAGS = @ac_dshow_ldflags@ +APP_THIRD_PARTY_LIB_FILES += $(PJ_DIR)/third_party/lib/libbaseclasses-$(LIB_SUFFIX) +APP_THIRD_PARTY_LIBS += -lbaseclasses-$(TARGET_NAME) +endif + # Android ANDROID_CFLAGS = @ac_android_cflags@ +OBOE_CFLAGS = @ac_oboe_cflags@ # PJMEDIA features exclusion -PJ_VIDEO_CFLAGS += $(SDL_CFLAGS) $(FFMPEG_CFLAGS) $(V4L2_CFLAGS) $(QT_CFLAGS) \ +PJ_VIDEO_CFLAGS += $(SDL_CFLAGS) $(FFMPEG_CFLAGS) $(V4L2_CFLAGS) $(DSHOW_CFLAGS) $(QT_CFLAGS) \ $(OPENH264_CFLAGS) $(VPX_CFLAGS) $(DARWIN_CFLAGS) -PJ_VIDEO_LDFLAGS += $(SDL_LDFLAGS) $(FFMPEG_LDFLAGS) $(V4L2_LDFLAGS) \ +PJ_VIDEO_LDFLAGS += $(SDL_LDFLAGS) $(FFMPEG_LDFLAGS) $(V4L2_LDFLAGS) $(DSHOW_LDFLAGS) \ $(OPENH264_LDFLAGS) $(VPX_LDFLAGS) # CFLAGS, LDFLAGS, and LIBS to be used by applications @@ -280,6 +308,10 @@ $(ADD_LIB_FILES) endif +ifeq ($(PJ_EXCLUDE_PJSUA2),1) +export PJSUA2_LIB_LDLIB := +endif + export APP_LDLIBS := $(PJSUA_LIB_LDLIB) \ $(PJSIP_UA_LDLIB) \ $(PJSIP_SIMPLE_LDLIB) \ @@ -299,7 +331,7 @@ -lstdc++ \ $(APP_LDLIBS) -# Here are the variabels to use if application is using the library +# Here are the variables to use if application is using the library # from within the source distribution export PJ_CC := $(APP_CC) export PJ_CXX := $(APP_CXX) @@ -317,6 +349,6 @@ export PJ_INSTALL_DIR := @prefix@ export PJ_INSTALL_INC_DIR := @includedir@ export PJ_INSTALL_LIB_DIR := @libdir@ -export PJ_INSTALL_CFLAGS := -I$(PJ_INSTALL_INC_DIR) -DPJ_AUTOCONF=1 @CFLAGS@ -export PJ_INSTALL_CXXFLAGS := @CXXFLAGS@ $(PJ_INSTALL_CFLAGS) -export PJ_INSTALL_LDFLAGS := -L$(PJ_INSTALL_LIB_DIR) $(APP_LDLIBS) +export PJ_INSTALL_CFLAGS := -I$(PJ_INSTALL_INC_DIR) -DPJ_AUTOCONF=1 @ac_cflags@ +export PJ_INSTALL_LDFLAGS_PRIVATE := $(APP_THIRD_PARTY_LIBS) $(APP_THIRD_PARTY_EXT) @LIBS@ +export PJ_INSTALL_LDFLAGS := -L$(PJ_INSTALL_LIB_DIR) $(filter-out $(PJ_INSTALL_LDFLAGS_PRIVATE),$(APP_LDXXLIBS)) diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/config.sub asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/config.sub --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/config.sub 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/config.sub 2022-02-24 07:54:38.000000000 +0000 @@ -123,7 +123,7 @@ maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` case $maybe_os in nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \ - linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \ + linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \ knetbsd*-gnu* | netbsd*-gnu* | \ kopensolaris*-gnu* | \ storm-chaos* | os2-emx* | rtmk-nova*) diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/configure-android asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/configure-android --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/configure-android 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/configure-android 2022-02-24 07:54:38.000000000 +0000 @@ -42,8 +42,14 @@ NDK_VER=`sed -n -E 's/^Pkg.Revision *= *([0-9]+).*/\1/p' ${ANDROID_NDK_ROOT}/source.properties` if test "x$APP_PLATFORM" = "x"; then - APP_PLATFORM=`ls ${ANDROID_NDK_ROOT}/platforms/ | sed 's/android-//' | sort -gr | head -1` - APP_PLATFORM="android-${APP_PLATFORM}" + if test -d ${ANDROID_NDK_ROOT}/platforms; then + APP_PLATFORM=`ls ${ANDROID_NDK_ROOT}/platforms/ | sed 's/android-//' | sort -gr | head -1` + fi + if test "x$APP_PLATFORM" != "x"; then + APP_PLATFORM="android-${APP_PLATFORM}" + else + APP_PLATFORM="latest" + fi echo "$F: APP_PLATFORM not specified, using ${APP_PLATFORM}" fi diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/configure-iphone asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/configure-iphone --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/configure-iphone 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/configure-iphone 2022-02-24 07:54:38.000000000 +0000 @@ -118,6 +118,10 @@ fi export ARCH_VAL=`echo ${ARCH} | sed 's/\-arch //' | sed -e 's/^[ \t]*//;s/[ \t]*$//' ` +if test "${ARCH_VAL}" = "arm64e"; then + export ARCH_VAL="arm64" +fi + if test "${MIN_IOS}" = ""; then MIN_IOS_VER="7.0" echo "$F: MIN_IOS is not specified, choosing ${MIN_IOS_VER}" @@ -129,7 +133,7 @@ # Set CXX if not set if test "${CXX}" = ""; then - export CXX=`echo ${CC} | sed 's/gcc/g++/'` + export CXX=`echo ${CC} | sed 's/clang/clang++/'` echo "$F: CXX is not specified, using ${CXX}" fi diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/.github/ISSUE_TEMPLATE/bug_report.yml asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/.github/ISSUE_TEMPLATE/bug_report.yml --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/.github/ISSUE_TEMPLATE/bug_report.yml 1970-01-01 00:00:00.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/.github/ISSUE_TEMPLATE/bug_report.yml 2022-02-24 07:54:38.000000000 +0000 @@ -0,0 +1,62 @@ +name: Bug Report +description: File a bug report +body: + - type: markdown + attributes: + value: | + Thanks for taking the time to fill out this bug report! + - type: textarea + id: bug-desc + attributes: + label: Describe the bug + description: A clear and concise description of what the bug is. + placeholder: | + E.g: Assertion in answering an incoming video call with response code 183. + validations: + required: true + - type: textarea + id: bug-repro + attributes: + label: Steps to reproduce + description: Describe how to reproduce the bug using sample apps such as [pjsua app](https://www.pjsip.org/pjsua.htm), [pjsua2 android](https://trac.pjsip.org/repos/wiki/Getting-Started/Android#Tryingoursampleapplicationandcreatingyourown), [iOS ipjsua](https://trac.pjsip.org/repos/wiki/Getting-Started/iPhone#BuildingPJSIP), or [other sample apps](https://github.com/pjsip/pjproject/tree/master/pjsip-apps/src/samples). + placeholder: | + E.g: + 1. run pjsua app with parameter: `--video --registrar sip:some.sip.registrar ...` + 2. make video call from other SIP client or another pjsua instance + 3. answer the call with 180 and soon 183, assertion occurs! + The assertion didn't occur if the call was answered with 183 directly. + validations: + required: true + - type: input + id: version + attributes: + label: PJSIP version + description: What PJSIP version are you using? + placeholder: | + E.g: 2.11 + validations: + required: true + - type: textarea + id: context + attributes: + label: Context + description: | + Context where the bug occurs, e.g: platform, device, OS version, configuration settings. + placeholder: | + E.g: + - The issue happens on Windows/Linux/MacOS desktop, iPhone 12, or Android device XYZ. + - App is built using Android NDK r20 or newer. + - 'configure-android' param: ... + - 'config_site.h' contents: ... + - Related third-party lib & version: ... (e.g: OpenSSL 1.1.1b) + - Applied patch(es): (e.g: patches from issue/PR #xyz) + validations: + required: true + - type: textarea + id: logs + attributes: + label: Log, call stack, etc + description: Please copy and paste any relevant PJSIP log output (with verbosity level 5), call stack trace, etc which may be useful for the investigation. This will be automatically formatted into code, so no need for backticks. + render: shell + validations: + required: true diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/.github/ISSUE_TEMPLATE/config.yml asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/.github/ISSUE_TEMPLATE/config.yml --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/.github/ISSUE_TEMPLATE/config.yml 1970-01-01 00:00:00.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/.github/ISSUE_TEMPLATE/config.yml 2022-02-24 07:54:38.000000000 +0000 @@ -0,0 +1,4 @@ +blank_issues_enabled: false +contact_links: + - name: PJSIP tag on Stack Overflow + url: https://stackoverflow.com/questions/tagged/pjsip diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/.github/ISSUE_TEMPLATE/feature_request.md asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/.github/ISSUE_TEMPLATE/feature_request.md --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/.github/ISSUE_TEMPLATE/feature_request.md 1970-01-01 00:00:00.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/.github/ISSUE_TEMPLATE/feature_request.md 2022-02-24 07:54:38.000000000 +0000 @@ -0,0 +1,20 @@ +--- +name: Feature request +about: Suggest an idea for this project +title: '' +labels: 'type: enhancement' +assignees: '' + +--- + +**Is your feature request related to a problem? Please describe.** +A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] + +**Describe the solution you'd like** +A clear and concise description of what you want to happen. + +**Describe alternatives you've considered** +A clear and concise description of any alternative solutions or features you've considered. + +**Additional context** +Add any other context or screenshots about the feature request here. diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/.github/PULL_REQUEST_TEMPLATE/pull_request_template.md asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/.github/PULL_REQUEST_TEMPLATE/pull_request_template.md --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/.github/PULL_REQUEST_TEMPLATE/pull_request_template.md 1970-01-01 00:00:00.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/.github/PULL_REQUEST_TEMPLATE/pull_request_template.md 2022-02-24 07:54:38.000000000 +0000 @@ -0,0 +1,31 @@ + + +## Description + + +## Motivation and Context + + + +## How Has This Been Tested? + + + + +## Screenshots (if appropriate): + +## Types of changes + +- [ ] Bug fix (non-breaking change which fixes an issue) +- [ ] New feature (non-breaking change which adds functionality) +- [ ] Breaking change (fix or feature that would cause existing functionality to change) + +## Checklist: + + +- [ ] My code follows the code style of this project. +- [ ] My change requires a change to the documentation. +- [ ] I have updated the documentation accordingly. +- [ ] I have read the **CONTRIBUTING** document. +- [ ] I have added tests to cover my changes. +- [ ] All new and existing tests passed. diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/.github/workflows/ccpp.yml asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/.github/workflows/ccpp.yml --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/.github/workflows/ccpp.yml 1970-01-01 00:00:00.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/.github/workflows/ccpp.yml 2022-02-24 07:54:38.000000000 +0000 @@ -0,0 +1,733 @@ +name: C/C++ CI +on: [push, pull_request] +jobs: + build-ubuntu-default: + # checking pure lib source distribution with plain configure & make + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: configure + run: ./configure + - name: make + run: make + + build-ubuntu-default-full-bundle-1: + # full bundle: enable all codecs + AEC + DTLS + # full bundle 1: running pjlib, pjlib-util, pjmedia, and pjsua tests + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: install dependencies + run: sudo apt-get install -y swig sip-tester libopencore-amrnb-dev + - name: config site + run: cd pjlib/include/pj && cp config_site_test.h config_site.h + - name: configure + run: CFLAGS="-g -fPIC" CXXFLAGS="-g -fPIC" LDFLAGS="-rdynamic" ./configure + - name: make + run: make + - name: swig bindings + run: cd pjsip-apps/src/swig && make + - name: set up Python 2.7 for pjsua test + uses: actions/setup-python@v2 + with: + python-version: 2.7 + - name: unit tests + run: make pjlib-test pjlib-util-test pjmedia-test pjsua-test + + build-ubuntu-default-full-bundle-2: + # full bundle 2: running pjnath test + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: install dependencies + run: sudo apt-get install -y libopencore-amrnb-dev + - name: config site + run: cd pjlib/include/pj && cp config_site_test.h config_site.h + - name: configure + run: CFLAGS="-g" LDFLAGS="-rdynamic" ./configure + - name: make + run: make + - name: unit tests + run: make pjnath-test + + build-ubuntu-default-full-bundle-3: + # full bundle 3: running pjsip test + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: install dependencies + run: sudo apt-get install -y libopencore-amrnb-dev + - name: config site + run: cd pjlib/include/pj && cp config_site_test.h config_site.h + - name: configure + run: CFLAGS="-g" LDFLAGS="-rdynamic" ./configure + - name: make + run: make + - name: unit tests + run: make pjsip-test + + build-ubuntu-no-tls: + # no TLS + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: install dependencies + run: sudo apt-get install -y swig + - name: configure + run: CFLAGS="-fPIC" CXXFLAGS="-fPIC" ./configure --disable-ssl + - name: make + run: make + - name: swig bindings + run: cd pjsip-apps/src/swig && make + + # build-ubuntu-openssl + # TLS: with OpenSSL (same as build-ubuntu-default) + + build-ubuntu-gnu-tls: + # TLS: with GnuTLS + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: install dependencies + run: sudo apt-get update && sudo apt-get install -y --fix-missing swig libgnutls28-dev + - name: configure + run: CFLAGS="-fPIC" CXXFLAGS="-fPIC" ./configure --with-gnutls=/usr/ + - name: make + run: make + - name: swig bindings + run: cd pjsip-apps/src/swig && make + + build-ubuntu-video-openh264-1: + # video: video enabled with vpx and openh264 + # video 1: running pjlib, pjlib-util, pjmedia, and pjsua tests + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: install dependencies + run: sudo apt-get install -y swig nasm sip-tester libvpx-dev libopencore-amrnb-dev + - name: get openh264 + run: git clone --single-branch --branch openh264v2.1.0 https://github.com/cisco/openh264.git + - name: build openh264 + run: cd openh264 && make && sudo make install && sudo ldconfig + - name: config site + run: cd pjlib/include/pj && cp config_site_test.h config_site.h && echo "#define PJMEDIA_HAS_VIDEO 1" >> config_site.h + - name: configure + run: CFLAGS="-g -fPIC -DHAS_VID_CODEC_TEST=0" CXXFLAGS="-g -fPIC" LDFLAGS="-rdynamic" ./configure + - name: make + run: make + - name: swig bindings + run: cd pjsip-apps/src/swig && make + - name: set up Python 2.7 for pjsua test + uses: actions/setup-python@v2 + with: + python-version: 2.7 + - name: unit tests + run: make pjlib-test pjlib-util-test pjmedia-test pjsua-test + + build-ubuntu-video-openh264-2: + # video 2: running pjnath test + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: install dependencies + run: sudo apt-get install -y nasm libvpx-dev libopencore-amrnb-dev + - name: get openh264 + run: git clone --single-branch --branch openh264v2.1.0 https://github.com/cisco/openh264.git + - name: build openh264 + run: cd openh264 && make && sudo make install && sudo ldconfig + - name: config site + run: cd pjlib/include/pj && cp config_site_test.h config_site.h && echo "#define PJMEDIA_HAS_VIDEO 1" >> config_site.h + - name: configure + run: CFLAGS="-g" LDFLAGS="-rdynamic" ./configure + - name: make + run: make + - name: unit tests + run: make pjnath-test + + build-ubuntu-video-openh264-3: + # video: 3: running pjsip test + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: install dependencies + run: sudo apt-get install -y nasm libvpx-dev libopencore-amrnb-dev + - name: get openh264 + run: git clone --single-branch --branch openh264v2.1.0 https://github.com/cisco/openh264.git + - name: build openh264 + run: cd openh264 && make && sudo make install && sudo ldconfig + - name: config site + run: cd pjlib/include/pj && cp config_site_test.h config_site.h && echo "#define PJMEDIA_HAS_VIDEO 1" >> config_site.h + - name: configure + run: CFLAGS="-g" LDFLAGS="-rdynamic" ./configure + - name: make + run: make + - name: unit tests + run: make pjsip-test + + build-ubuntu-video-ffmpeg: + # video enabled with vpx and ffmpeg and x264 + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: install dependencies + run: sudo apt-get install -y swig nasm libx264-dev libvpx-dev + - name: get ffmpeg + run: git clone --single-branch --branch release/4.2 https://github.com/FFmpeg/FFmpeg.git + - name: configure ffmpeg + run: cd FFmpeg && ./configure --enable-shared --disable-static --enable-gpl --enable-libx264 + - name: build ffmpeg + run: cd FFmpeg && make -j10 && sudo make install + - name: config site + run: echo -e "#define PJMEDIA_HAS_VIDEO 1\n" > pjlib/include/pj/config_site.h + - name: configure + run: CFLAGS="-fPIC" CXXFLAGS="-fPIC" ./configure + - name: make + run: make + - name: swig bindings + run: cd pjsip-apps/src/swig && make + + build-mac-default: + # checking pure lib source distribution with plain configure & make + runs-on: macos-latest + steps: + - uses: actions/checkout@v2 + - name: configure + run: ./configure + - name: make + run: make + + build-mac-default-full-bundle-1: + # full bundle: enable all codecs + AEC + DTLS + # full bundle 1: running pjlib, pjlib-util, pjmedia, and pjsua tests + runs-on: macos-latest + steps: + - uses: actions/checkout@v2 + - name: install dependencies + run: brew install openssl@1.1 opencore-amr swig sipp + - name: config site + run: cd pjlib/include/pj && cp config_site_test.h config_site.h + - name: configure + run: CFLAGS="-g -I/usr/local/include -I/usr/local/opt/openssl@1.1/include -fPIC" LDFLAGS="-L/usr/local/lib -L/usr/local/opt/openssl@1.1/lib" CXXFLAGS="-g -fPIC" ./configure + - name: make + run: make + - name: swig bindings + run: cd pjsip-apps/src/swig && make + - name: disable firewall + run: sudo /usr/libexec/ApplicationFirewall/socketfilterfw --setglobalstate off + - name: set up Python 2.7 for pjsua test + uses: actions/setup-python@v2 + with: + python-version: 2.7 + - name: unit tests + run: make pjlib-test pjmedia-test pjlib-util-test pjsua-test + + build-mac-default-full-bundle-2: + # full bundle 2: running pjnath test + runs-on: macos-latest + steps: + - uses: actions/checkout@v2 + - name: install dependencies + run: brew install openssl@1.1 opencore-amr + - name: config site + run: cd pjlib/include/pj && cp config_site_test.h config_site.h + - name: configure + run: CFLAGS="-g -I/usr/local/include -I/usr/local/opt/openssl@1.1/include" LDFLAGS="-L/usr/local/lib -L/usr/local/opt/openssl@1.1/lib" ./configure + - name: make + run: make + - name: disable firewall + run: sudo /usr/libexec/ApplicationFirewall/socketfilterfw --setglobalstate off + - name: unit tests + run: make pjnath-test + + build-mac-default-full-bundle-3: + # full bundle 3: running pjsip test + runs-on: macos-latest + steps: + - uses: actions/checkout@v2 + - name: install dependencies + run: brew install openssl@1.1 opencore-amr + - name: config site + run: cd pjlib/include/pj && cp config_site_test.h config_site.h + - name: configure + run: CFLAGS="-g -I/usr/local/include -I/usr/local/opt/openssl@1.1/include" LDFLAGS="-L/usr/local/lib -L/usr/local/opt/openssl@1.1/lib" ./configure + - name: make + run: make + - name: disable firewall + run: sudo /usr/libexec/ApplicationFirewall/socketfilterfw --setglobalstate off + - name: unit tests + run: make pjsip-test + + # build-ubuntu-no-tls: + # no TLS (same as build-mac-default) + + build-mac-openssl: + # TLS: with OpenSSL + runs-on: macos-latest + steps: + - uses: actions/checkout@v2 + - name: install dependencies + run: brew install openssl@1.1 swig + - name: configure + run: CFLAGS="-I/usr/local/include -I/usr/local/opt/openssl@1.1/include -fPIC" LDFLAGS="-L/usr/local/lib -L/usr/local/opt/openssl@1.1/lib" CXXFLAGS="-fPIC" ./configure + - name: make + run: make + - name: swig bindings + run: cd pjsip-apps/src/swig && make + + build-mac-gnu-tls: + # TLS: with GnuTLS + runs-on: macos-latest + steps: + - uses: actions/checkout@v2 + - name: install dependencies + run: brew install swig + - name: configure + run: CFLAGS="-fPIC" CXXFLAGS="-fPIC" ./configure --with-gnutls=/usr/local/ + - name: make + run: make + - name: swig bindings + run: cd pjsip-apps/src/swig && make + + build-mac-video-openh264-1: + # video: video enabled with vpx and openh264 + # video 1: running pjlib, pjlib-util, pjmedia, and pjsua tests + runs-on: macos-latest + steps: + - uses: actions/checkout@v2 + - name: install dependencies + run: brew install openssl@1.1 openh264 libvpx opencore-amr swig sipp + - name: config site + run: cd pjlib/include/pj && cp config_site_test.h config_site.h && echo "#define PJMEDIA_HAS_VIDEO 1" >> config_site.h + - name: configure + run: CFLAGS="-g -I/usr/local/include -I/usr/local/opt/openssl@1.1/include -DHAS_VID_CODEC_TEST=0 -fPIC" LDFLAGS="-L/usr/local/lib -L/usr/local/opt/openssl@1.1/lib" CXXFLAGS="-g -fPIC" ./configure + - name: make + run: make + - name: swig bindings + run: cd pjsip-apps/src/swig && make + - name: disable firewall + run: sudo /usr/libexec/ApplicationFirewall/socketfilterfw --setglobalstate off + - name: set up Python 2.7 for pjsua test + uses: actions/setup-python@v2 + with: + python-version: 2.7 + - name: unit tests + run: make pjlib-test pjmedia-test pjlib-util-test pjsua-test + + build-mac-video-openh264-2: + # video 2: running pjnath test + runs-on: macos-latest + steps: + - uses: actions/checkout@v2 + - name: install dependencies + run: brew install openssl@1.1 openh264 libvpx opencore-amr + - name: config site + run: cd pjlib/include/pj && cp config_site_test.h config_site.h && echo "#define PJMEDIA_HAS_VIDEO 1" >> config_site.h + - name: configure + run: CFLAGS="-g -I/usr/local/include -I/usr/local/opt/openssl@1.1/include" LDFLAGS="-L/usr/local/lib -L/usr/local/opt/openssl@1.1/lib" ./configure + - name: make + run: make + - name: disable firewall + run: sudo /usr/libexec/ApplicationFirewall/socketfilterfw --setglobalstate off + - name: unit tests + run: make pjnath-test + + build-mac-video-openh264-3: + # video 3: running pjsip test + runs-on: macos-latest + steps: + - uses: actions/checkout@v2 + - name: install dependencies + run: brew install openssl@1.1 openh264 libvpx opencore-amr + - name: config site + run: cd pjlib/include/pj && cp config_site_test.h config_site.h && echo "#define PJMEDIA_HAS_VIDEO 1" >> config_site.h + - name: configure + run: CFLAGS="-g -I/usr/local/include -I/usr/local/opt/openssl@1.1/include" LDFLAGS="-L/usr/local/lib -L/usr/local/opt/openssl@1.1/lib" ./configure + - name: make + run: make + - name: disable firewall + run: sudo /usr/libexec/ApplicationFirewall/socketfilterfw --setglobalstate off + - name: unit tests + run: make pjsip-test + + build-mac-video-ffmpeg: + # video enabled with vpx and ffmpeg and x264 + runs-on: macos-latest + steps: + - uses: actions/checkout@v2 + - name: install dependencies + run: brew install openssl@1.1 x264 libvpx nasm swig + - name: get ffmpeg + run: git clone --single-branch --branch release/4.2 https://github.com/FFmpeg/FFmpeg.git + - name: configure ffmpeg + run: cd FFmpeg && ./configure --enable-shared --disable-static --enable-gpl --enable-libx264 + - name: build ffmpeg + run: cd FFmpeg && make -j10 && sudo make install + - name: config site + run: echo -e "#define PJMEDIA_HAS_VIDEO 1\n" > pjlib/include/pj/config_site.h + - name: configure + run: CFLAGS="-I/usr/local/include -I/usr/local/opt/openssl@1.1/include -fPIC" LDFLAGS="-L/usr/local/lib -L/usr/local/opt/openssl@1.1/lib" CXXFLAGS="-fPIC" ./configure + - name: make + run: make + - name: swig bindings + run: cd pjsip-apps/src/swig && make + + build-mac-video-vid-toolbox: + # video enabled with vpx and video toolbox + runs-on: macos-latest + steps: + - uses: actions/checkout@v2 + - name: install dependencies + run: brew install openssl@1.1 libvpx swig + - name: config site + run: echo -e "#define PJMEDIA_HAS_VIDEO 1\n#define PJMEDIA_HAS_VID_TOOLBOX_CODEC 1\n" > pjlib/include/pj/config_site.h + - name: configure + run: CFLAGS="-I/usr/local/include -I/usr/local/opt/openssl@1.1/include -fPIC" LDFLAGS="-L/usr/local/lib -L/usr/local/opt/openssl@1.1/lib" CXXFLAGS="-fPIC" ./configure + - name: make + run: make + - name: swig bindings + run: cd pjsip-apps/src/swig && make + + build-windows-default: + runs-on: windows-latest + steps: + - uses: actions/checkout@master + - name: get swig + run: Invoke-WebRequest -Uri "http://nchc.dl.sourceforge.net/project/swig/swigwin/swigwin-4.0.1/swigwin-4.0.1.zip" -OutFile ".\swigwin.zip" + shell: powershell + - name: expand swig + run: | + Expand-Archive -LiteralPath .\swigwin.zip -DestinationPath .\swigwin\; pwd + cd swigwin\swigwin-4.0.1 + Add-Content ..\..\swig_path.txt $pwd.Path + shell: powershell + - name: config site + run: + type nul > pjlib/include/pj/config_site.h + shell: cmd + - name: MSBuild + run: | + call "%PROGRAMFILES%\Microsoft Visual Studio\2022\Enterprise\Common7\Tools\VsDevCmd.bat" + msbuild pjproject-vs14.sln /p:PlatformToolset=v143 /p:Configuration=Debug /p:Platform=win32 + shell: cmd + - name: build swig + run: | + set /P SWIG_PATH= pjlib\include\pj\config_site.h + Add-Content config_site.h "#define PJ_HAS_SSL_SOCK 1" + Add-Content config_site.h "#define PJ_SSL_SOCK_IMP PJ_SSL_SOCK_IMP_GNUTLS" + shell: powershell + - name: check VsDevCmd.bat + run: dir "%PROGRAMFILES%\Microsoft Visual Studio\2022\Enterprise\Common7\Tools\VsDevCmd.bat" + shell: cmd + - name: MSBuild + working-directory: . + run: | + set /P LIBGNUTLS_DIR= pjlib\include\pj\config_site.h + Add-Content config_site.h "#define PJMEDIA_HAS_VIDEO 1" + Add-Content config_site.h "#define PJMEDIA_HAS_FFMPEG 1" + Add-Content config_site.h "#define PJMEDIA_HAS_FFMPEG_VID_CODEC 1" + Add-Content config_site.h "#define PJMEDIA_VIDEO_DEV_HAS_FFMPEG 1" + Add-Content config_site.h "#define PJMEDIA_VIDEO_DEV_HAS_SDL 1" + shell: powershell + - name: check VsDevCmd.bat + run: dir "%PROGRAMFILES%\Microsoft Visual Studio\2022\Enterprise\Common7\Tools\VsDevCmd.bat" + shell: cmd + - name: MSBuild + working-directory: . + run: | + set /P LIBFFMPEG_DIR= $(DESTDIR)/$(libdir)/pkgconfig/libpjproject.pc + sed -e "s!@PJ_INSTALL_LDFLAGS@!$(PJ_INSTALL_LDFLAGS)!" | \ + sed -e "s!@PJ_INSTALL_LDFLAGS_PRIVATE@!$(PJ_INSTALL_LDFLAGS_PRIVATE)!" | \ + sed -e "s!@PJ_INSTALL_CFLAGS@!$(PJ_INSTALL_CFLAGS)!" > $(DESTDIR)$(libdir)/pkgconfig/libpjproject.pc uninstall: $(RM) $(DESTDIR)$(libdir)/pkgconfig/libpjproject.pc @@ -143,5 +148,5 @@ done; \ done rmdir $(DESTDIR)$(includedir) 2> /dev/null || true - $(RM) $(addprefix $(DESTDIR)$(libdir)/,$(notdir $(APP_LIB_FILES))) + $(RM) $(addprefix $(DESTDIR)$(libdir)/,$(notdir $(APP_LIBXX_FILES))) rmdir $(DESTDIR)$(libdir) 2> /dev/null || true Binary files /tmp/tmpgod_td0p/c4yCX_i6qB/asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjlib/build/cacert.der and /tmp/tmpgod_td0p/iHWlLhIivf/asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjlib/build/cacert.der differ diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjlib/build/cacert.pem asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjlib/build/cacert.pem --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjlib/build/cacert.pem 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjlib/build/cacert.pem 2022-02-24 07:54:38.000000000 +0000 @@ -1,14 +1,30 @@ -----BEGIN CERTIFICATE----- -MIICNDCCAZ2gAwIBAgIJAIa9mZggMk2WMA0GCSqGSIb3DQEBBAUAMDMxEjAQBgNV -BAMTCXBqc2lwLmxhYjEdMBsGCSqGSIb3DQEJARYOdGVzdEBwanNpcC5sYWIwHhcN -MTAwMjEwMDkwNTQ0WhcNMjAwMjA4MDkwNTQ0WjAzMRIwEAYDVQQDEwlwanNpcC5s -YWIxHTAbBgkqhkiG9w0BCQEWDnRlc3RAcGpzaXAubGFiMIGfMA0GCSqGSIb3DQEB -AQUAA4GNADCBiQKBgQDI9T0Pf+1gKOTOAGEpZ481Q6xfm5vz6n1+6udxzQtfPKlQ -rPD5x5im2u3tmy6ABxZeY5tCdeikBPiGlc5bRIRng6KM8kidkg3gEhwhRUxHCMWb -mBpkz7rFERf/pWAOCqYCiy1RT8QrK+XOFoFdJhdF85UPDEUw+pHEsYetTDs9RQID -AQABo1AwTjBMBgNVHREERTBDgglwanNpcC5sYWKCDXNpcC5wanNpcC5sYWKBDnRl -c3RAcGpzaXAubGFihhFzaXA6c2lwLnBqc2lwLmxhYocEfwAAATANBgkqhkiG9w0B -AQQFAAOBgQCLPl/WF1QvjT36kVLH0nxfHwDOJuAzlh6nv9rYBviOLw9FTEMgW6hA -oG55YSdVjTnMynTMOH/kVp4Vxlk46A8neE+/LI8RPh6lJh52vb+iPAtBpsQoq06T -+u4DfJcN8Y/jy+QAn78jryKjwKuZWfuWny9gxsLWMUbH5Bc6v6wfQQ== +MIIFNDCCAxygAwIBAgIUeMZNwp8GnetvaGka8ktFmsvLwbcwDQYJKoZIhvcNAQEL +BQAwFDESMBAGA1UEAwwJcGpzaXAubGFiMB4XDTIwMTIxMTEwMTI1M1oXDTMwMTIw +OTEwMTI1M1owFDESMBAGA1UEAwwJcGpzaXAubGFiMIICIjANBgkqhkiG9w0BAQEF +AAOCAg8AMIICCgKCAgEAp2uZV8GB+s3A2UvBlGbHk5GdONHFXPT1PxZCTP+fsP3j +A7SxwmCu7rq/oSGygHgkcX+bh7tGRtZDbS5DMzmhfRTUcHegTLFltf+L7JlT/M3O +wbdssOI+YLlnGAY98qchMs8S9Ij5oaXvGh68PC21epyJHYoaWRqf33Qvndx3Wclo +hgINHULPnDzT62HlkIeVgdGvgbitAaVwjUqIY2zQYVaKMxqurjeexeiPJpbwVvCy +6MQ33lw16monU+jbnHHpnHsbEL7RMNDg+950figM8EFLyFMkUtK4ZZyOEWJhrbtS +v/N692+EG2j2seC/QHkhDqlFYVKRDIYLelwIuR1lPWV5IXPPFX+yHgUcvSJQpsbp +B/0SG0IbxQIol615MEpBGbeL1T4I6KXilTTdnD8ROIVx3rkvu+9SCD26L1eRfLl9 +N2N7wXScjInCRxMdvbb9Dja5hSjv2VSXJPmtK9b+8BL698XSkK4BfU6G0fYohDFg +UJVFqDttOc4EhcwvNm5hNgiIgFzEoZ8y0BGtYwmi4B2BVtMud5LJZo/txLWkd/L+ +hdkO9FqPCDvFEIVtmD4xpczNpy4BhSczG7xUuul03qj0aZW94AdrO00fBMOTT8wF +gyvtPkMP0CRnbyUpaGiv3NdO2AndIdHCE0oi67J5RajD1RGwPMErvfxXBYnek0UC +AwEAAaN+MHwwHQYDVR0OBBYEFF6rnJ5vs8hTda7vbDQYWmekykW3MB8GA1UdIwQY +MBaAFF6rnJ5vs8hTda7vbDQYWmekykW3MA8GA1UdEwEB/wQFMAMBAf8wKQYDVR0R +BCIwIIINc2lwLnBqc2lwLmxhYoIJcGpzaXAubGFihwR/AAABMA0GCSqGSIb3DQEB +CwUAA4ICAQCXrMnVDhCAIZBduL8yeXOxKwnxDC9OB1GcOESbD3Rxorm2AI/jdbob +xBG5yhU587NZDpkjZcwjyjAxQOwvuX8b/EXWKqSS1lf/nvLXm5bGwIORpbhpVtac +UI6lmRPAyAEu59HLUuidqjkerGOeKYN91KSAFuWl78zBEXd58a6RfZ4ALpKO9X+a +od1jGYLdRaWq8/pwZub/VOcgk/gCifpK/cgST/mg4pUBoPo1w2kR5kccxDMK+6jy +3xbm18UItoxomLzUfyKNwQ1XTsZor3f9f0vX/hpPjpvcqzgSh0Ei6XiRFRClSaUv +DrHqny6jOMzt92Nyu804ALpN9gRi5y2ayDYuR4RTZ8dSuEqUbhllfvHgRo1x6MmA +i5uxVJca4nJwINWpZGkGk4RAeDVbdgHZoSsK3a1sWTqvvt/Dz5Srl6ilvG1ZiHZX +Tbihc54gpNx5BzLndbaCMJ74MIOCcAvn5pos2CgPaOPUQPcAFG/0+IqIM2kzmr1Z +LkdSVEOQ96BT4KEHKIEgTSNrv4/hA6XpmN0e/w07cNY3o5besXBfR85VV+nuceKw +cg9WqbaooDjTLdb7c+lhifHFtZRuKr2YHW7UMEeJO36MLDtj52m5RRMB2T4+wL+V +YaCSfdNI6I1/ZCY9FlwG+5qdmvJio6ueZDCX5CxcsZb4YraIis460A== -----END CERTIFICATE----- diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjlib/build/pjlib_test.vcxproj asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjlib/build/pjlib_test.vcxproj --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjlib/build/pjlib_test.vcxproj 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjlib/build/pjlib_test.vcxproj 2022-02-24 07:54:38.000000000 +0000 @@ -5,6 +5,10 @@ Debug-Dynamic ARM + + Debug-Dynamic + ARM64 + Debug-Dynamic Win32 @@ -17,6 +21,10 @@ Debug-Static ARM + + Debug-Static + ARM64 + Debug-Static Win32 @@ -29,6 +37,10 @@ Debug ARM + + Debug + ARM64 + Debug Win32 @@ -41,6 +53,10 @@ Release-Dynamic ARM + + Release-Dynamic + ARM64 + Release-Dynamic Win32 @@ -53,6 +69,10 @@ Release-Static ARM + + Release-Static + ARM64 + Release-Static Win32 @@ -65,6 +85,10 @@ Release ARM + + Release + ARM64 + Release Win32 @@ -78,7 +102,7 @@ {6AC3EF61-5A9E-4F43-A809-5B2FD1A43B16} - pjlib_test + pjlib_test en-US @@ -161,36 +185,72 @@ false MultiByte + + Application + v140 + false + MultiByte + Application v140 false MultiByte + + Application + v140 + false + MultiByte + Application v140 false MultiByte + + Application + v140 + false + MultiByte + Application v140 false MultiByte + + Application + v140 + false + MultiByte + Application v140 false MultiByte + + Application + v140 + false + MultiByte + Application v140 false MultiByte + + Application + v140 + false + MultiByte + $(BuildToolset) @@ -267,31 +327,61 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>14.0.22823.1 @@ -345,6 +435,20 @@ MachineX64 + + + + ../include;%(AdditionalIncludeDirectories) + _CONSOLE;%(PreprocessorDefinitions) + + + ProgramDatabase + + + netapi32.lib;mswsock.lib;ws2_32.lib;odbc32.lib;odbccp32.lib;oleaut32.lib;ole32.lib;%(AdditionalDependencies) + ..\bin\pjlib-test-$(TargetCPU)-$(Platform)-vc$(VSVer)-$(Configuration).exe + + ../include;%(AdditionalIncludeDirectories) @@ -383,6 +487,19 @@ MachineX64 + + + + ../include;%(AdditionalIncludeDirectories) + _CONSOLE;%(PreprocessorDefinitions) + + + + + netapi32.lib;mswsock.lib;ws2_32.lib;odbc32.lib;odbccp32.lib;oleaut32.lib;ole32.lib;%(AdditionalDependencies) + ..\bin\pjlib-test-$(TargetCPU)-$(Platform)-vc$(VSVer)-$(Configuration).exe + + ../include;%(AdditionalIncludeDirectories) @@ -422,6 +539,20 @@ MachineX64 + + + + ../include;%(AdditionalIncludeDirectories) + _CONSOLE;%(PreprocessorDefinitions) + + + ProgramDatabase + + + netapi32.lib;mswsock.lib;ws2_32.lib;odbc32.lib;odbccp32.lib;oleaut32.lib;ole32.lib;%(AdditionalDependencies) + ..\bin\pjlib-test-$(TargetCPU)-$(Platform)-vc$(VSVer)-$(Configuration).exe + + ../include;%(AdditionalIncludeDirectories) @@ -460,6 +591,19 @@ MachineX64 + + + + ../include;%(AdditionalIncludeDirectories) + _CONSOLE;%(PreprocessorDefinitions) + + + + + netapi32.lib;mswsock.lib;ws2_32.lib;odbc32.lib;odbccp32.lib;oleaut32.lib;ole32.lib;%(AdditionalDependencies) + ..\bin\pjlib-test-$(TargetCPU)-$(Platform)-vc$(VSVer)-$(Configuration).exe + + ../include;%(AdditionalIncludeDirectories) @@ -499,6 +643,20 @@ MachineX64 + + + + ../include;%(AdditionalIncludeDirectories) + _CONSOLE;%(PreprocessorDefinitions) + + + ProgramDatabase + + + netapi32.lib;mswsock.lib;ws2_32.lib;odbc32.lib;odbccp32.lib;oleaut32.lib;ole32.lib;%(AdditionalDependencies) + ..\bin\pjlib-test-$(TargetCPU)-$(Platform)-vc$(VSVer)-$(Configuration).exe + + ../include;%(AdditionalIncludeDirectories) @@ -537,6 +695,19 @@ MachineX64 + + + + ../include;%(AdditionalIncludeDirectories) + _CONSOLE;%(PreprocessorDefinitions) + + + + + netapi32.lib;mswsock.lib;ws2_32.lib;odbc32.lib;odbccp32.lib;oleaut32.lib;ole32.lib;%(AdditionalDependencies) + ..\bin\pjlib-test-$(TargetCPU)-$(Platform)-vc$(VSVer)-$(Configuration).exe + + @@ -557,41 +728,53 @@ true true true + true true true true + true true true true + true true true true + true true true true + true true true true + true true true true + true true true true + true true true true + true true true true + true true true true + true true true true + true diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjlib/build/pjlib_test.vcxproj.filters asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjlib/build/pjlib_test.vcxproj.filters --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjlib/build/pjlib_test.vcxproj.filters 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjlib/build/pjlib_test.vcxproj.filters 2022-02-24 07:54:38.000000000 +0000 @@ -117,6 +117,9 @@ Source Files + + Source Files + diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjlib/build/pjlib.vcxproj asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjlib/build/pjlib.vcxproj --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjlib/build/pjlib.vcxproj 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjlib/build/pjlib.vcxproj 2022-02-24 07:54:38.000000000 +0000 @@ -5,6 +5,10 @@ Debug-Dynamic ARM + + Debug-Dynamic + ARM64 + Debug-Dynamic Win32 @@ -17,6 +21,10 @@ Debug-Static ARM + + Debug-Static + ARM64 + Debug-Static Win32 @@ -29,6 +37,10 @@ Debug ARM + + Debug + ARM64 + Debug Win32 @@ -41,6 +53,10 @@ Release-Dynamic ARM + + Release-Dynamic + ARM64 + Release-Dynamic Win32 @@ -53,6 +69,10 @@ Release-Static ARM + + Release-Static + ARM64 + Release-Static Win32 @@ -65,6 +85,10 @@ Release ARM + + Release + ARM64 + Release Win32 @@ -148,31 +172,61 @@ v140 false + + StaticLibrary + v140 + false + StaticLibrary v140 false + + StaticLibrary + v140 + false + StaticLibrary v140 false + + StaticLibrary + v140 + false + StaticLibrary v140 false + + StaticLibrary + v140 + false + StaticLibrary v140 false + + StaticLibrary + v140 + false + StaticLibrary v140 false + + StaticLibrary + v140 + false + $(BuildToolset) @@ -247,31 +301,61 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>14.0.22823.1 @@ -307,6 +391,16 @@ ProgramDatabase + + + + ../include;%(AdditionalIncludeDirectories) + _LIB;%(PreprocessorDefinitions) + + + ProgramDatabase + + ../include;%(AdditionalIncludeDirectories) @@ -332,6 +426,15 @@ + + + + ../include;%(AdditionalIncludeDirectories) + _LIB;%(PreprocessorDefinitions) + + + + ../include;%(AdditionalIncludeDirectories) @@ -357,6 +460,16 @@ ProgramDatabase + + + + ../include;%(AdditionalIncludeDirectories) + _LIB;%(PreprocessorDefinitions) + + + ProgramDatabase + + ../include;%(AdditionalIncludeDirectories) @@ -381,6 +494,15 @@ + + + + ../include;%(AdditionalIncludeDirectories) + _LIB;%(PreprocessorDefinitions) + + + + ../include;%(AdditionalIncludeDirectories) @@ -406,6 +528,16 @@ ProgramDatabase + + + + ../include;%(AdditionalIncludeDirectories) + _LIB;%(PreprocessorDefinitions) + + + ProgramDatabase + + ../include;%(AdditionalIncludeDirectories) @@ -430,6 +562,15 @@ + + + + ../include;%(AdditionalIncludeDirectories) + _LIB;%(PreprocessorDefinitions) + + + + true @@ -450,21 +591,27 @@ true true true + true true true true + true true true true + true true true true + true true true true + true true true true + true @@ -478,21 +625,27 @@ true true true + true true true true + true true true true + true true true true + true true true true + true true true true + true @@ -500,21 +653,27 @@ true true true + true true true true + true true true true + true true true true + true true true true + true true true true + true @@ -522,102 +681,132 @@ true true true + true true true true + true true true true + true true true true + true true true true + true true true true + true true true true + true true true true + true true true true + true true true true + true true true true + true true true true + true true true true + true true true true + true true true true + true true true true + true true true true + true true true true + true true true true + true true true true + true true true true + true true true true + true true true true + true true true true + true true true true + true true true true + true true true true + true true true true + true true true true + true true true true + true true @@ -632,63 +821,81 @@ true true true + true true true true + true true true true + true true true true + true true true true + true true true true + true true true true + true true true true + true true true true + true true true true + true true true true + true true true true + true true true true + true true true true + true true true true + true true true true + true true true true + true true true true + true @@ -697,21 +904,27 @@ true true true + true true true true + true true true true + true true true true + true true true true + true true true true + true @@ -723,21 +936,27 @@ true true true + true true true true + true true true true + true true true true + true true true true + true true true true + true @@ -755,21 +974,27 @@ true true true + true true true true + true true true true + true true true true + true true true true + true true true - true + true + true @@ -778,21 +1003,27 @@ true true true + true true true true + true true true true + true true true true + true true true true + true true true true + true Binary files /tmp/tmpgod_td0p/c4yCX_i6qB/asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjlib/build/privkey.p12 and /tmp/tmpgod_td0p/iHWlLhIivf/asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjlib/build/privkey.p12 differ diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjlib/build/privkey.pem asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjlib/build/privkey.pem --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjlib/build/privkey.pem 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjlib/build/privkey.pem 2022-02-24 07:54:38.000000000 +0000 @@ -1,15 +1,54 @@ ------BEGIN RSA PRIVATE KEY----- -MIICXgIBAAKBgQDI9T0Pf+1gKOTOAGEpZ481Q6xfm5vz6n1+6udxzQtfPKlQrPD5 -x5im2u3tmy6ABxZeY5tCdeikBPiGlc5bRIRng6KM8kidkg3gEhwhRUxHCMWbmBpk -z7rFERf/pWAOCqYCiy1RT8QrK+XOFoFdJhdF85UPDEUw+pHEsYetTDs9RQIDAQAB -AoGAGV+1xQY/H7wqH8S2f/begzg3RJ8uUt8R13urm5frTqwnKNOdXbyRDshn8G9+ -sJW0gliLWxnuNP+Xrc6ujqGZIguK/yAxJ3LprAN2Ay1lW2ONyZNMquBeIY5Txhyy -SnU7U+NQYgA3+w9T7O7YQ575TTDm2gri558jIx8t55Wo9sUCQQDtjfGZ3sYXwpxR -MvtdtfwDxSKhf6glT6dn7/37KITBZXFy6Eb/tHrEEUuwR46g30vTd2JElCB+QExu -4sZDt813AkEA2I/WXdGVRXtHzVivf3AnqWyXfrfAAXlBmEkgPyIPwE1+mxeNxkU7 -TRn0MOqAfbQW4+GRIYCKSBLodRnRq2iKIwJBAJLYa8DyNQH7CyYmnbwQAvlRo1ax -0v89ff6CHD5ljar/SmH9s+XdawZIqsENet13KyhNZDGAX5WrqZPiGy1BMYECQQC1 -FREawfUfdEZF3rJgzVdcxACpZNyYXtwKipr8L28cTbBf3wIdmCZOAjW98VgfxEaf -pi3E5ca7HZRi1oQL4A4hAkEA5koHCQYl+5PDjbLtxl0VyVCpmT9BrcZ99MS+ZEaW -2+HpKIhXrEFxePQaWbCaW7gjKmKUwC0qqu0moedqJC3mzg== ------END RSA PRIVATE KEY----- +-----BEGIN ENCRYPTED PRIVATE KEY----- +MIIJnDBOBgkqhkiG9w0BBQ0wQTApBgkqhkiG9w0BBQwwHAQILwghSQuUF7MCAggA +MAwGCCqGSIb3DQIJBQAwFAYIKoZIhvcNAwcECHKyWOypiKo0BIIJSCS86LhyHmGK +oXggCF/oKjtnvSU6r29qAw2SU9DaW8/vQP32JdTZE1EEPxRDe4NziSpPeXIJ6Vf9 +MlGHC5RG56Zr/riBdk0nT6opx/2JIpSFzpqZwTuxeFLAAJEoM1DwAjmiU9FDDzPv +cHUoNBoFrsIRImcuOnsy8i5+uYT3QdIBUAA5w5mXwOdTlJ/F7h83SocgOKTc9xYW +02A1DecA4OKcrfz6LBC5yFdoPsBXvFrSz78LTFzirbdq2RuI1Ae3oD7hn/8b/Yzc +NwHZo4m8XMuu1XSQ0z36gmrwlYI0NQiPAL/nknpRCnQgjR8AJsk9n72VU+TfWTtR +H1wshrBu0RYLX4YQA1uwz44BYgN2YLtQsjrgPdGm7pUhTfVcxc/zL/8bWpOOs04T +2/oT2Ft/gmvvsHo08QhqzOcnkVxl7qnwuw1UI8TMLwZ1Rppsc1Malakj7s5GDLik +ayol1RDT2NK+1Oxj1liQOJgx9ojL1Pxu0oBXLfT5P4rCUuShIx7jr6Kxlixg2A8B +g+MHzcKtFSFHut9Ag5s5Car5JNFWc91zvqNVQXYLq49AqDV/Nl1Q5ulkZZvg1rl5 +PGWNkfRiok++OL8FdFKpmCCRhaUDg3M87iE293CDY/gwKlDXNv8QJZ2OTaDr2f4X +ASpuZjJHsGhKJzUXMFK4eQT0JYpFzYvLNe84CPuml6IsfRaSuRIZnOnv724Dp6wd +xdjtAtm0p6L/RRTTapt/TxEvB6aiy4J47ghbMCZvqI1QfCkw+otzbvg4LxcR/Rn8 +OQUhUVcmS+1NOCZPtA1S2vlZVCb97SfpveTSaQp6f1Tka8YBCyhd0OlbA/XnVEDb +tMGGl4oXhj9P2x57y47eur/2eTXDnGxorMJA4zooLljEucbk5t8r8U2tacUJDsyQ +K1tcOhY8bnrJudjTGYeewlI0W3pSAiUlBk8CtCNSsfJQr7MBoWcjasp/i6DQDBU1 +/wy7zCo1+2xIhWWw9KCQK5NBpGTvq0tUgkfre0ft+MNlqgWp1L58sNi9xqcb03cv +F8rOPO24VM7LiJfm6vvSiQJW0+YKFHlQdA0wCyTiRO8Xx98w7Lc04+XunaS2o/25 +1uZ0iK2oYtMlLxALG1FPmAnMAXn/AeAdcYuy2OaztYltnMzeOP4myyh25iRRaSlI +fuvQkZcn8FnoQYmVxlmWSlbQcJqIxbLlbCRIXCeqxz1jCEVurO9u1lSl5QsmN/Bm +KYW7wEcQXTxQsu4n7Rh+9ddAEBETf3NuA3XcSNR8EjdMBWz7lyAnzM54A5SEA7rL +J2YYkr3L05wJL0tWQjXx+bewe5mnDS8sYnQgE+xRvdasDuGYHXA35z7ORM5KatdG +LTLxbdXjgjVunTrXvyULKyrAAO6knjFHS1SKKm4Qp9i0eyhB65P6Ow3d2A0xSooO +z+eSiUEiTq1BeqJTLbds5blV/ivPkXIQOMwl2ziE2y4QR3qGlzgzO3uLdFcIWztQ +Gl+D2sOMPZLJ+z9HgqRsqtXbK+Ne73zW7k52xwC6aqMZ0zuZWcIjpB7GEKuHCauO +iJu8W7GkSHcfr39cvyVqXRHzYJs6MhVJSAMxaaoy6EL+5rqDD2bSbDjtsYXI4uvA +mmXOnnBY86A+mDn9AgJpTvY6tnVyD/XnfCBOiV+jKKEXEgXNqoNm9CIzpcK+myl2 +5FpMYcV771ckYFrhe/4ckhs/0vCpiFXviqZwhQZz8CczoJvLIhitCW0/UkUhVM+x +Y0lu10ju+w7WJsc9FyjdMl5AdCUIiXS10gOEgvW+iY1dIa/Z6jLFtmiPmgbleD+Q +lqYDZnbMuVz6xUPVkeuJ9s+J2iFQhfLEg5ftKIX71WvXwA1R7CdEasQ5f78CiZiB +E7hGIe5RcV5XA07lOQrrpJwR0kPsSHOrng/Sy+sYfbs6VkMUDR1gtGG1jXIeL4i3 +1QVTlHhJd5QiDQGCxkCU90ujDy1Syj2YSvMrpP7QJOLezyWHjoHdHEuRbsTlDuyo +bLx/9AvU8wPdBP1/w2MTWtCCMhIcwA/HJyj7YchLfq4jRuSxBRpJXf1A2pR1zv4+ +0/a1szx/9bWFtgD3ouUxmOHQlXOaqbejUbrHq3JFyisHrew7wjqWXF01JeLQkTXC +chwMSAKQBp69GpCOANyxjNQNFD6thV/AOoXGHWqwu37WfcKmAGmo39npNRGjd+m3 +nl4rHgXZ1lMtBuOeNLQP48+4HyecwnxRZ2fRQ+fH324vq0/qH4SVIddqcHCIIlsv +9paiYbXu0igbXjMHsLO+mmER+a1zzyUV/2IlLFbnEfg1BGT+jeGJ872Msgn+r4I7 +WZdjvrhuc21EVqp3LMzciE19+baFPvbRA6pnGfctS2LGwVLEUhMnrUnr6rEvUdez +auZGeAwkFpqO/HbchTiBsrppD3EhDlqFt7fh/cdJWjoSr4DBsNSbRJJ+txb0S2zr +yTuSHP74DCxFduoq7gwzZAbzqGAnW2/AWVmb5K5zvKYrrogQiNVsMOF4mr1cAsqI +jHsXLHIxpMOxN4xI5bgGWZR8RaPO8WxM0fjRm+gPqAxVZoW6mI+zD9pzAm4MTgR/ +JWi1eWQ+gQhRTa3FnZL/2egfafGAJpgGsSKTtN9s+/xWBC3CRzWA20djKxl0WO+7 +2awxrl6mPBsne+fh3QMGqriLtqSfSyp3TicLWp/jjxPAkZd14PxaRC8jUN4pCYIv +mIMLvHhvMU2TxFRr8kKjNXHgueotU5f+HrJf36ZHBPt8+Ma/q41F9BfC0gB3aGtt ++AU2x5sfFPp4qJ86Pyv1PCMpdF8DTLfJQ18a6C9IPIzV+rQIjRJWtLqNr5EYUi9A +BL3ZBn6UXp9R9eVKyp0Y4HuzYQdANqyfIK6XpAoPoM81SmAe2ZzpFghUFHVvi8Sr +Nsb34VBe7kZAnI0KOV752UEROJ1w2OgpBDHqmp4+J69K/zInNaRcmesy/4dCRbah +5c2AQC9pqONaKV8NOstf5/GNCGB8RWaEBZsJqWfkLVD8kTQN9pfN0piKU0YbsjuO ++qIHczZcJkgh2wcXiNGVErPBvkMhMg5MZSLn9DuitefeVtPF38Er2/l09bflCNVc +6/95JjcPr4zf2WgDgXWA+uyTTCx+BIaCdZR5Oa3BkToC6nxD/61uGmiSrkNkcNXn +M6S9qY7zKbxb/Hi8IdUYwA== +-----END ENCRYPTED PRIVATE KEY----- diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjlib/include/pj/compat/os_auto.h.in asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjlib/include/pj/compat/os_auto.h.in --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjlib/include/pj/compat/os_auto.h.in 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjlib/include/pj/compat/os_auto.h.in 2022-02-24 07:54:38.000000000 +0000 @@ -30,6 +30,7 @@ #undef PJ_OS_NAME /* Legacy macros */ +#undef PJ_WIN64 #undef PJ_WIN32 #undef PJ_WIN32_WINNT #undef WIN32_LEAN_AND_MEAN @@ -191,7 +192,9 @@ # if TARGET_OS_IPHONE # include "Availability.h" /* Use CFHost API for pj_getaddrinfo() (see ticket #1246) */ -# define PJ_GETADDRINFO_USE_CFHOST 1 +# ifndef PJ_GETADDRINFO_USE_CFHOST +# define PJ_GETADDRINFO_USE_CFHOST 0 +# endif # ifdef __IPHONE_4_0 /* Is multitasking support available? (see ticket #1107) */ # define PJ_IPHONE_OS_HAS_MULTITASKING_SUPPORT 1 @@ -220,7 +223,7 @@ #undef PJ_HAS_SSL_SOCK #endif #ifndef PJ_SSL_SOCK_IMP -# define PJ_SSL_SOCK_IMP PJ_SSL_SOCK_IMP_NONE +#undef PJ_SSL_SOCK_IMP #endif diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjlib/include/pj/compat/os_win32.h asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjlib/include/pj/compat/os_win32.h --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjlib/include/pj/compat/os_win32.h 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjlib/include/pj/compat/os_win32.h 2022-02-24 07:54:38.000000000 +0000 @@ -135,6 +135,14 @@ */ #define PJ_THREAD_ALLOCATE_STACK 0 +/* Endianness */ +#if defined(_M_ARM64) +# ifndef PJ_IS_LITTLE_ENDIAN +# define PJ_IS_LITTLE_ENDIAN 1 +# define PJ_IS_BIG_ENDIAN 0 +# endif +#endif + #endif /* __PJ_COMPAT_OS_WIN32_H__ */ diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjlib/include/pj/compat/socket.h asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjlib/include/pj/compat/socket.h --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjlib/include/pj/compat/socket.h 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjlib/include/pj/compat/socket.h 2022-02-24 07:54:38.000000000 +0000 @@ -179,10 +179,12 @@ /* * And undefine these.. + * Note (see issue #2311): unfortunately, this may cause build failure + * to anyone who uses these standard macros. */ -#undef s_addr -#undef s6_addr -#undef sin_zero +//#undef s_addr +//#undef s6_addr +//#undef sin_zero /* * This will finally be obsoleted, since it should be declared in diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjlib/include/pj/compat/string.h asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjlib/include/pj/compat/string.h --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjlib/include/pj/compat/string.h 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjlib/include/pj/compat/string.h 2022-02-24 07:54:38.000000000 +0000 @@ -46,8 +46,13 @@ #if defined(_MSC_VER) # define strcasecmp _stricmp # define strncasecmp _strnicmp + +/* snprintf() and vsnprintf() are available since Visual Studio 2015 */ +#if _MSC_VER < 1900 # define snprintf _snprintf # define vsnprintf _vsnprintf +#endif + # define snwprintf _snwprintf # define wcsicmp _wcsicmp # define wcsnicmp _wcsnicmp diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjlib/include/pj/config.h asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjlib/include/pj/config.h --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjlib/include/pj/config.h 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjlib/include/pj/config.h 2022-02-24 07:54:38.000000000 +0000 @@ -178,7 +178,6 @@ # define PJ_IS_LITTLE_ENDIAN 1 # define PJ_IS_BIG_ENDIAN 0 - #elif defined (PJ_M_X86_64) || defined(__amd64__) || defined(__amd64) || \ defined(__x86_64__) || defined(__x86_64) || \ defined(_M_X64) || defined(_M_AMD64) @@ -255,7 +254,8 @@ # define PJ_IS_LITTLE_ENDIAN 0 # define PJ_IS_BIG_ENDIAN 1 -#elif defined(ARM) || defined(_ARM_) || defined(__arm__) || defined(_M_ARM) +#elif defined(ARM) || defined(_ARM_) || defined(__arm__) || \ + defined(_M_ARM) || defined(_M_ARM64) # define PJ_HAS_PENTIUM 0 /* * ARM, bi-endian, so raise error if endianness is not configured @@ -271,6 +271,10 @@ # undef PJ_M_ARMV4 # define PJ_M_ARMV4 1 # define PJ_M_NAME "armv4" +# elif defined (PJ_M_ARM64) || defined(ARM64) +# undef PJ_M_ARM64 +# define PJ_M_ARM64 1 +# define PJ_M_NAME "arm64" # endif #elif defined (PJ_M_POWERPC) || defined(__powerpc) || defined(__powerpc__) || \ @@ -804,6 +808,19 @@ # define PJ_HAS_SEMAPHORE 1 #endif +/** + * Use dispatch semaphores on Darwin. + * + * Default: 1 on Darwin, 0 otherwise + */ +#ifndef PJ_SEMAPHORE_USE_DISPATCH_SEM +# if defined(PJ_DARWINOS) && PJ_DARWINOS != 0 +# define PJ_SEMAPHORE_USE_DISPATCH_SEM 1 +# else +# define PJ_SEMAPHORE_USE_DISPATCH_SEM 0 +# endif +#endif + /** * Event object (for synchronization, e.g. in Win32) @@ -973,7 +990,11 @@ #define PJ_SSL_SOCK_IMP_NONE 0 /**< Disable SSL socket. */ #define PJ_SSL_SOCK_IMP_OPENSSL 1 /**< Using OpenSSL. */ #define PJ_SSL_SOCK_IMP_GNUTLS 2 /**< Using GnuTLS. */ - +#define PJ_SSL_SOCK_IMP_DARWIN 3 /**< Using Apple's Secure + Transport (deprecated in + MacOS 10.15 & iOS 13.0)*/ +#define PJ_SSL_SOCK_IMP_APPLE 4 /**< Using Apple's Network + framework. */ /** * Select which SSL socket implementation to use. Currently pjlib supports @@ -1024,6 +1045,18 @@ # define PJ_SSL_SOCK_MAX_CURVES 32 #endif +/** + * Use OpenSSL thread locking callback. This is only applicable for OpenSSL + * version prior to 1.1.0 + * + * Default: 1 (enabled) + */ +#ifndef PJ_SSL_SOCK_OSSL_USE_THREAD_CB +# define PJ_SSL_SOCK_OSSL_USE_THREAD_CB 1 +#else +# define PJ_SSL_SOCK_OSSL_USE_THREAD_CB 0 +#endif + /** * Disable WSAECONNRESET error for UDP sockets on Win32 platforms. See @@ -1366,7 +1399,7 @@ #define PJ_VERSION_NUM_MAJOR 2 /** PJLIB version minor number. */ -#define PJ_VERSION_NUM_MINOR 10 +#define PJ_VERSION_NUM_MINOR 12 /** PJLIB version revision number. */ #define PJ_VERSION_NUM_REV 0 diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjlib/include/pj/config_site_test.h asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjlib/include/pj/config_site_test.h --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjlib/include/pj/config_site_test.h 1970-01-01 00:00:00.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjlib/include/pj/config_site_test.h 2022-02-24 07:54:38.000000000 +0000 @@ -0,0 +1,11 @@ +#define PJMEDIA_SRTP_HAS_DTLS 1 +#define PJMEDIA_HAS_WEBRTC_AEC 1 +#define PJMEDIA_CODEC_L16_HAS_8KHZ_MONO 1 +#define PJMEDIA_CODEC_L16_HAS_8KHZ_STEREO 1 +#define PJMEDIA_CODEC_L16_HAS_16KHZ_MONO 1 +#define PJMEDIA_CODEC_L16_HAS_16KHZ_STEREO 1 +#define PJMEDIA_CODEC_L16_HAS_48KHZ_MONO 1 +#define PJMEDIA_CODEC_L16_HAS_48KHZ_STEREO 1 +#define PJMEDIA_HAS_G7221_CODEC 1 +#define PJMEDIA_HAS_G722_CODEC 1 +#define PJ_EXCLUDE_BENCHMARK_TESTS 1 diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjlib/include/pj/ioqueue.h asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjlib/include/pj/ioqueue.h --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjlib/include/pj/ioqueue.h 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjlib/include/pj/ioqueue.h 2022-02-24 07:54:38.000000000 +0000 @@ -589,6 +589,19 @@ pj_ssize_t bytes_status ); +/** + * Clear ioqueue key states. This function will cancel any outstanding + * operations on that key, without invoking any completion callback. + * After calling this function, application should reinit its all operation + * keys, i.e: using pj_ioqueue_op_key_init(), before reusing them. + * + * @param key The key. + * + * @return PJ_SUCCESS on success or the appropriate error code. + */ +PJ_DECL(pj_status_t) pj_ioqueue_clear_key( pj_ioqueue_key_t *key ); + + #if defined(PJ_HAS_TCP) && PJ_HAS_TCP != 0 /** diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjlib/include/pj/list.h asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjlib/include/pj/list.h --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjlib/include/pj/list.h 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjlib/include/pj/list.h 2022-02-24 07:54:38.000000000 +0000 @@ -111,7 +111,6 @@ * @param pos The element to which the node will be inserted before. * @param node The element to be inserted. * - * @return void. */ PJ_IDECL(void) pj_list_insert_before(pj_list_type *pos, pj_list_type *node); @@ -145,7 +144,6 @@ * element. * @param node The element to be inserted after the position element. * - * @return void. */ PJ_IDECL(void) pj_list_insert_after(pj_list_type *pos, pj_list_type *node); @@ -185,7 +183,6 @@ * @param list1 The destination list. * @param list2 The source list. * - * @return void. */ PJ_IDECL(void) pj_list_merge_first(pj_list_type *list1, pj_list_type *list2); @@ -203,7 +200,6 @@ * element. * @param list2 The element in the list to be inserted. * - * @return void. */ PJ_IDECL(void) pj_list_merge_last( pj_list_type *list1, pj_list_type *list2); diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjlib/include/pj/lock.h asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjlib/include/pj/lock.h --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjlib/include/pj/lock.h 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjlib/include/pj/lock.h 2022-02-24 07:54:38.000000000 +0000 @@ -195,6 +195,15 @@ /** + * The group lock destroy handler, a destructor function called when + * a group lock is about to be destroyed. + * + * @param member A pointer to be passed to the handler. + */ +typedef void (*pj_grp_lock_handler)(void *member); + + +/** * Initialize the config with the default values. * * @param cfg The config to be initialized. @@ -203,7 +212,7 @@ /** * Create a group lock object. Initially the group lock will have reference - * counter of one. + * counter of zero. * * @param pool The group lock only uses the pool parameter to get * the pool factory, from which it will create its own @@ -220,7 +229,7 @@ /** * Create a group lock object, with the specified destructor handler, to be * called by the group lock when it is about to be destroyed. Initially the - * group lock will have reference counter of one. + * group lock will have reference counter of zero. * * @param pool The group lock only uses the pool parameter to get * the pool factory, from which it will create its own @@ -235,7 +244,7 @@ PJ_DECL(pj_status_t) pj_grp_lock_create_w_handler(pj_pool_t *pool, const pj_grp_lock_config *cfg, void *member, - void (*handler)(void *member), + pj_grp_lock_handler handler, pj_grp_lock_t **p_grp_lock); /** @@ -303,7 +312,7 @@ PJ_DECL(pj_status_t) pj_grp_lock_add_handler(pj_grp_lock_t *grp_lock, pj_pool_t *pool, void *member, - void (*handler)(void *member)); + pj_grp_lock_handler handler); /** * Remove previously registered handler. All parameters must be the same @@ -317,7 +326,7 @@ */ PJ_DECL(pj_status_t) pj_grp_lock_del_handler(pj_grp_lock_t *grp_lock, void *member, - void (*handler)(void *member)); + pj_grp_lock_handler handler); /** * Increment reference counter to prevent the group lock grom being destroyed. diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjlib/include/pj/os.h asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjlib/include/pj/os.h --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjlib/include/pj/os.h 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjlib/include/pj/os.h 2022-02-24 07:54:38.000000000 +0000 @@ -246,6 +246,9 @@ * value range, which can be retrieved with #pj_thread_get_prio_min() and * #pj_thread_get_prio_max() functions. * + * For Android, this function will only set the priority of the calling thread + * (the thread param must be set to NULL or the calling thread handle). + * * @param thread Thread handle. * @param prio New priority to be set to the thread. * diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjlib/include/pj/pool_alt.h asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjlib/include/pj/pool_alt.h --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjlib/include/pj/pool_alt.h 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjlib/include/pj/pool_alt.h 2022-02-24 07:54:38.000000000 +0000 @@ -56,8 +56,12 @@ * This constant denotes the exception number that will be thrown by default * memory factory policy when memory allocation fails. */ -extern int PJ_NO_MEMORY_EXCEPTION; +PJ_DECL_DATA(int) PJ_NO_MEMORY_EXCEPTION; +/** + * Get #PJ_NO_MEMORY_EXCEPTION constant. + */ +PJ_DECL(int) pj_NO_MEMORY_EXCEPTION(void); /* @@ -68,6 +72,8 @@ pj_pool_create_imp(__FILE__, __LINE__, fc, nm, init, inc, cb) #define pj_pool_release(pool) pj_pool_release_imp(pool) +#define pj_pool_safe_release(pool) pj_pool_safe_release_imp(pool) +#define pj_pool_secure_release(pool) pj_pool_secure_release_imp(pool) #define pj_pool_getobjname(pool) pj_pool_getobjname_imp(pool) #define pj_pool_reset(pool) pj_pool_reset_imp(pool) #define pj_pool_get_capacity(pool) pj_pool_get_capacity_imp(pool) @@ -98,6 +104,12 @@ /* Release pool */ PJ_DECL(void) pj_pool_release_imp(pj_pool_t *pool); +/* Safe release pool */ +PJ_DECL(void) pj_pool_safe_release_imp(pj_pool_t **pool); + +/* Secure release pool */ +PJ_DECL(void) pj_pool_secure_release_imp(pj_pool_t **pool); + /* Get pool name */ PJ_DECL(const char*) pj_pool_getobjname_imp(pj_pool_t *pool); diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjlib/include/pj/sock.h asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjlib/include/pj/sock.h --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjlib/include/pj/sock.h 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjlib/include/pj/sock.h 2022-02-24 07:54:38.000000000 +0000 @@ -26,6 +26,7 @@ */ #include +#include PJ_BEGIN_DECL @@ -484,6 +485,11 @@ */ #define PJ_INVALID_SOCKET (-1) +/* Undefining UNIX standard library macro such as s_addr is not + * recommended as it may cause build issues for anyone who uses + * the macro. See #2311 for more details. + */ +#if 0 /* Must undefine s_addr because of pj_in_addr below */ #undef s_addr @@ -495,6 +501,9 @@ pj_uint32_t s_addr; /**< The 32bit IP address. */ } pj_in_addr; +#else +typedef struct in_addr pj_in_addr; +#endif /** * Maximum length of text representation of an IPv4 address. @@ -532,10 +541,15 @@ #endif pj_uint16_t sin_port; /**< Transport layer port number. */ pj_in_addr sin_addr; /**< IP address. */ - char sin_zero[PJ_SOCKADDR_IN_SIN_ZERO_LEN]; /**< Padding.*/ + char sin_zero_pad[PJ_SOCKADDR_IN_SIN_ZERO_LEN]; /**< Padding.*/ }; +/* Undefining C standard library macro such as s6_addr is not + * recommended as it may cause build issues for anyone who uses + * the macro. See #2311 for more details. + */ +#if 0 #undef s6_addr /** @@ -560,6 +574,9 @@ #endif } pj_in6_addr; +#else +typedef struct in6_addr pj_in6_addr; +#endif /** Initializer value for pj_in6_addr. */ @@ -712,7 +729,7 @@ * * @return nonzero if the address is valid, zero if not. */ -PJ_DECL(int) pj_inet_aton(const pj_str_t *cp, struct pj_in_addr *inp); +PJ_DECL(int) pj_inet_aton(const pj_str_t *cp, pj_in_addr *inp); /** * This function converts an address in its standard text presentation form @@ -1502,7 +1519,7 @@ * @param port The port address. * @param buf Text buffer. * @param size Size of buffer. - * @param flags Bitmask combination of these value: + * @param flag Bitmask combination of these value: * - 1: port number is included. * * @return The address string. diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjlib/include/pj/ssl_sock.h asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjlib/include/pj/ssl_sock.h --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjlib/include/pj/ssl_sock.h 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjlib/include/pj/ssl_sock.h 2022-02-24 07:54:38.000000000 +0000 @@ -250,9 +250,9 @@ * Create credential from data buffer. The certificate expected is in * PEM format. * - * @param CA_file The buffer of trusted CA list. - * @param cert_file The buffer of certificate. - * @param privkey_file The buffer of private key. + * @param CA_buf The buffer of trusted CA list. + * @param cert_buf The buffer of certificate. + * @param privkey_buf The buffer of private key. * @param privkey_pass The password of private key, if any. * @param p_cert Pointer to credential instance to be created. * @@ -479,7 +479,7 @@ * Get curve list supported by SSL/TLS backend. * * @param curves The curves buffer to receive curve list. - * @param curves_num Maximum number of curves to be received. + * @param curve_num Maximum number of curves to be received. * * @return PJ_SUCCESS when successful. */ @@ -668,6 +668,21 @@ */ pj_bool_t (*on_connect_complete)(pj_ssl_sock_t *ssock, pj_status_t status); + + /** + * This callback is called when certificate verification is being done. + * Certification info can be obtained from #pj_ssl_sock_info. Currently + * it's only implemented for OpenSSL backend. + * + * @param ssock The secure socket. + * @param is_server PJ_TRUE to indicate an incoming connection. + * + * @return Return PJ_TRUE if verification is successful. + * If verification failed, then the connection will be + * dropped immediately. + * + */ + pj_bool_t (*on_verify_cb)(pj_ssl_sock_t *ssock, pj_bool_t is_server); } pj_ssl_sock_cb; @@ -708,6 +723,11 @@ */ PJ_SSL_SOCK_PROTO_TLS1_2 = (1 << 4), + /** + * TLSv1.3 protocol. + */ + PJ_SSL_SOCK_PROTO_TLS1_3 = (1 << 5), + /** * Certain backend implementation e.g:OpenSSL, has feature to enable all * protocol. @@ -996,7 +1016,8 @@ * (perform outgoing connection) and the server may host multiple * 'virtual' servers at a single underlying network address, setting * this will allow client to tell the server a name of the server - * it is contacting. + * it is contacting. This must be set to hostname and literal IP addresses + * are not allowed. * * Default value is zero/not-set. */ @@ -1350,7 +1371,7 @@ * @param ssock The secure socket. * @param pool Pool used to allocate some internal data for the * operation. - * @param localaddr Local address to bind on. + * @param local_addr Local address to bind on. * @param addr_len Length of buffer containing local address. * * @return PJ_SUCCESS if the operation has been successful, @@ -1371,7 +1392,7 @@ * @param ssock The secure socket. * @param pool Pool used to allocate some internal data for the * operation. - * @param localaddr Local address to bind on. + * @param local_addr Local address to bind on. * @param addr_len Length of buffer containing local address. * @param newsock_param Secure socket parameter for new accepted sockets. * diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjlib/include/pj/string.h asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjlib/include/pj/string.h --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjlib/include/pj/string.h 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjlib/include/pj/string.h 2022-02-24 07:54:38.000000000 +0000 @@ -46,7 +46,7 @@ * typedef struct pj_str_t * { * char *ptr; - * pj_size_t slen; + * pj_ssize_t slen; * } pj_str_t; * * @@ -70,6 +70,18 @@ */ /** + * Check if a string is truncated and if yes, put a suffix of ".." + * to indicate the truncation. + * This macro is used to check the result of pj_ansi_snprintf(). + * + * @param ret The return value of pj_ansi_snprintf(). + * @param str The string. + * @param len The length of the string buffer. + */ +#define PJ_CHECK_TRUNC_STR(ret, str, len) \ + if ((ret) >= (len) || (ret) < 0) pj_ansi_strcpy((str) + (len) - 3, "..") + +/** * Create string initializer from a normal C string. * * @param str Null terminated string to be stored. diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjlib/include/pj/string_i.h asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjlib/include/pj/string_i.h --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjlib/include/pj/string_i.h 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjlib/include/pj/string_i.h 2022-02-24 07:54:38.000000000 +0000 @@ -33,15 +33,17 @@ pj_str_t *dst, const pj_str_t *src) { + pj_assert(src->slen >= 0); + /* Without this, destination will be corrupted */ if (dst == src) return dst; - if (src->slen) { + if (src->slen > 0) { dst->ptr = (char*)pj_pool_alloc(pool, src->slen); pj_memcpy(dst->ptr, src->ptr, src->slen); } - dst->slen = src->slen; + dst->slen = (src->slen < 0)? 0: src->slen; return dst; } @@ -49,11 +51,19 @@ pj_str_t *dst, const pj_str_t *src) { - dst->ptr = (char*)pj_pool_alloc(pool, src->slen+1); - if (src->slen) { - pj_memcpy(dst->ptr, src->ptr, src->slen); + pj_size_t src_slen = src->slen; + + pj_assert(src->slen >= 0); + + /* Check if the source's length is invalid */ + if (src_slen < 0) + src_slen = 0; + + dst->ptr = (char*)pj_pool_alloc(pool, src_slen+1); + if (src_slen) { + pj_memcpy(dst->ptr, src->ptr, src_slen); } - dst->slen = src->slen; + dst->slen = src_slen; dst->ptr[dst->slen] = '\0'; return dst; } @@ -101,7 +111,9 @@ PJ_IDEF(pj_str_t*) pj_strcpy(pj_str_t *dst, const pj_str_t *src) { - dst->slen = src->slen; + pj_assert(src->slen >= 0); + + dst->slen = (src->slen < 0)? 0: src->slen; if (src->slen > 0) pj_memcpy(dst->ptr, src->ptr, src->slen); return dst; @@ -118,25 +130,29 @@ PJ_IDEF(pj_str_t*) pj_strncpy( pj_str_t *dst, const pj_str_t *src, pj_ssize_t max) { + pj_assert(src->slen >= 0); pj_assert(max >= 0); + if (max > src->slen) max = src->slen; if (max > 0) pj_memcpy(dst->ptr, src->ptr, max); - dst->slen = max; + dst->slen = (max < 0)? 0: max; return dst; } PJ_IDEF(pj_str_t*) pj_strncpy_with_null( pj_str_t *dst, const pj_str_t *src, pj_ssize_t max) { + pj_assert(src->slen >= 0); pj_assert(max > 0); if (max <= src->slen) - max = max-1; + max = (max > 0)? max-1: 0; else - max = src->slen; + max = (src->slen < 0)? 0: src->slen; - pj_memcpy(dst->ptr, src->ptr, max); + if (max > 0) + pj_memcpy(dst->ptr, src->ptr, max); dst->ptr[max] = '\0'; dst->slen = max; return dst; @@ -145,9 +161,12 @@ PJ_IDEF(int) pj_strcmp( const pj_str_t *str1, const pj_str_t *str2) { - if (str1->slen == 0) { - return str2->slen==0 ? 0 : -1; - } else if (str2->slen == 0) { + pj_assert(str1->slen >= 0); + pj_assert(str2->slen >= 0); + + if (str1->slen <= 0) { + return str2->slen<=0 ? 0 : -1; + } else if (str2->slen <= 0) { return 1; } else { pj_size_t min = (str1->slen < str2->slen)? str1->slen : str2->slen; @@ -166,13 +185,16 @@ { pj_str_t copy1, copy2; - if (len < (unsigned)str1->slen) { + pj_assert(str1->slen >= 0); + pj_assert(str2->slen >= 0); + + if (len < (unsigned)str1->slen && str1->slen > 0) { copy1.ptr = str1->ptr; copy1.slen = len; str1 = ©1; } - if (len < (unsigned)str2->slen) { + if (len < (unsigned)str2->slen && str2->slen > 0) { copy2.ptr = str2->ptr; copy2.slen = len; str2 = ©2; @@ -213,9 +235,12 @@ PJ_IDEF(int) pj_stricmp( const pj_str_t *str1, const pj_str_t *str2) { - if (str1->slen == 0) { - return str2->slen==0 ? 0 : -1; - } else if (str2->slen == 0) { + pj_assert(str1->slen >= 0); + pj_assert(str2->slen >= 0); + + if (str1->slen <= 0) { + return str2->slen<=0 ? 0 : -1; + } else if (str2->slen <= 0) { return 1; } else { pj_size_t min = (str1->slen < str2->slen)? str1->slen : str2->slen; @@ -320,13 +345,13 @@ { pj_str_t copy1, copy2; - if (len < (unsigned)str1->slen) { + if (len < (unsigned)str1->slen && str1->slen > 0) { copy1.ptr = str1->ptr; copy1.slen = len; str1 = ©1; } - if (len < (unsigned)str2->slen) { + if (len < (unsigned)str2->slen && str2->slen > 0) { copy2.ptr = str2->ptr; copy2.slen = len; str2 = ©2; @@ -352,7 +377,10 @@ PJ_IDEF(void) pj_strcat(pj_str_t *dst, const pj_str_t *src) { - if (src->slen) { + pj_assert(src->slen >= 0); + pj_assert(dst->slen >= 0); + + if (src->slen > 0 && dst->slen >= 0) { pj_memcpy(dst->ptr + dst->slen, src->ptr, src->slen); dst->slen += src->slen; } @@ -361,7 +389,10 @@ PJ_IDEF(void) pj_strcat2(pj_str_t *dst, const char *str) { pj_size_t len = str? pj_ansi_strlen(str) : 0; - if (len) { + + pj_assert(dst->slen >= 0); + + if (len && dst->slen >= 0) { pj_memcpy(dst->ptr + dst->slen, str, len); dst->slen += len; } diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjlib/include/pj/timer.h asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjlib/include/pj/timer.h --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjlib/include/pj/timer.h 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjlib/include/pj/timer.h 2022-02-24 07:54:38.000000000 +0000 @@ -120,7 +120,10 @@ /** * Internal unique timer ID, which is assigned by the timer heap. - * Application should not touch this ID. + * Positive values indicate that the timer entry is running, + * while -1 means that it's not. Any other value may indicate that it + * hasn't been properly initialised or is in a bad state. + * Application should not touch this ID. */ pj_timer_id_t _timer_id; diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjlib/src/pj/addr_resolv_sock.c asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjlib/src/pj/addr_resolv_sock.c --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjlib/src/pj/addr_resolv_sock.c 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjlib/src/pj/addr_resolv_sock.c 2022-02-24 07:54:38.000000000 +0000 @@ -178,7 +178,9 @@ /* Call getaddrinfo() */ pj_bzero(&hint, sizeof(hint)); hint.ai_family = af; - hint.ai_socktype = pj_SOCK_DGRAM() | pj_SOCK_STREAM(); + /* Zero value of ai_socktype means the implementation shall attempt + * to resolve the service name for all supported socket types */ + hint.ai_socktype = 0; rc = getaddrinfo(nodecopy, NULL, &hint, &res); if (rc != 0) @@ -188,10 +190,35 @@ /* Enumerate each item in the result */ for (i=0; i<*count && res; res=res->ai_next) { + unsigned j; + pj_bool_t duplicate_found = PJ_FALSE; + /* Ignore unwanted address families */ if (af!=PJ_AF_UNSPEC && res->ai_family != af) continue; + if (res->ai_socktype != pj_SOCK_DGRAM() && + res->ai_socktype != pj_SOCK_STREAM() && + /* It is possible that the result's sock type + * is unspecified. + */ + res->ai_socktype != 0) + { + continue; + } + + /* Add current address in the resulting list if there + * is no duplicates only. */ + for (j = 0; j < i; j++) { + if (!pj_sockaddr_cmp(&ai[j].ai_addr, res->ai_addr)) { + duplicate_found = PJ_TRUE; + break; + } + } + if (duplicate_found) { + continue; + } + /* Store canonical name (possibly truncating the name) */ if (res->ai_canonname) { pj_ansi_strncpy(ai[i].ai_canonname, res->ai_canonname, diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjlib/src/pj/array.c asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjlib/src/pj/array.c --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjlib/src/pj/array.c 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjlib/src/pj/array.c 2022-02-24 07:54:38.000000000 +0000 @@ -31,7 +31,7 @@ if (count && pos < count) { pj_memmove( (char*)array + (pos+1)*elem_size, (char*)array + pos*elem_size, - (count-pos)*elem_size); + (count-pos)*(pj_size_t)elem_size); } pj_memmove((char*)array + pos*elem_size, value, elem_size); } @@ -45,7 +45,7 @@ if (pos < count-1) { pj_memmove( (char*)array + pos*elem_size, (char*)array + (pos+1)*elem_size, - (count-pos-1)*elem_size); + (count-pos-1)*(pj_size_t)elem_size); } } diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjlib/src/pj/guid_bsd.c asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjlib/src/pj/guid_bsd.c --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjlib/src/pj/guid_bsd.c 1970-01-01 00:00:00.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjlib/src/pj/guid_bsd.c 2022-02-24 07:54:38.000000000 +0000 @@ -0,0 +1,50 @@ +/* + * Copyright (C) 2021-2021 Teluu Inc. (http://www.teluu.com) + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ +#include +#include +#include +#include +#include + +PJ_DEF_DATA(const unsigned) PJ_GUID_STRING_LENGTH = 36; + +PJ_DEF(unsigned) pj_GUID_STRING_LENGTH() +{ + return PJ_GUID_STRING_LENGTH; +} + +PJ_DEF(pj_str_t *) pj_generate_unique_string(pj_str_t *str) +{ + uint32_t status; + uuid_t u; + char *s = NULL; + pj_str_t sguid; + + PJ_ASSERT_RETURN(str && str->ptr, NULL); + PJ_CHECK_STACK(); + + uuid_create(&u, &status); + PJ_ASSERT_RETURN(status == uuid_s_ok, NULL); + uuid_to_string(&u, &s, &status); + PJ_ASSERT_RETURN(status == uuid_s_ok, NULL); + sguid = pj_str(s); + pj_strncpy(str, &sguid, PJ_GUID_STRING_LENGTH); + free(s); + + return str; +} diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjlib/src/pj/guid_darwin.c asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjlib/src/pj/guid_darwin.c --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjlib/src/pj/guid_darwin.c 1970-01-01 00:00:00.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjlib/src/pj/guid_darwin.c 2022-02-24 07:54:38.000000000 +0000 @@ -0,0 +1,56 @@ +/* + * Copyright (C) 2021-2021 Teluu Inc. (http://www.teluu.com) + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ +#include +#include +#include +#include + +#include + +PJ_DEF_DATA(const unsigned) PJ_GUID_STRING_LENGTH=36; + +PJ_DEF(unsigned) pj_GUID_STRING_LENGTH() +{ + return PJ_GUID_STRING_LENGTH; +} + +PJ_DEF(pj_str_t*) pj_generate_unique_string(pj_str_t *str) +{ + CFUUIDRef uuid_obj; + CFStringRef uuid_str; + pj_str_t sguid; + + PJ_ASSERT_RETURN(str->ptr != NULL, NULL); + PJ_CHECK_STACK(); + + /* Create universally unique identifier (object). */ + uuid_obj = CFUUIDCreate(kCFAllocatorDefault); + + /* Get the string representation of CFUUID object. */ + uuid_str = CFUUIDCreateString(kCFAllocatorDefault, uuid_obj); + CFRelease(uuid_obj); + + sguid.ptr = (char*)CFStringGetCStringPtr(uuid_str, kCFStringEncodingUTF8); + pj_assert(sguid.ptr); + sguid.slen = pj_ansi_strlen(sguid.ptr); + + pj_strncpy(str, &sguid, PJ_GUID_STRING_LENGTH); + CFRelease(uuid_str); + + return str; +} diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjlib/src/pj/ioqueue_common_abs.c asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjlib/src/pj/ioqueue_common_abs.c --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjlib/src/pj/ioqueue_common_abs.c 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjlib/src/pj/ioqueue_common_abs.c 2022-02-24 07:54:38.000000000 +0000 @@ -1282,6 +1282,7 @@ if (op_rec == (void*)op_key) { pj_list_erase(op_rec); op_rec->op = PJ_IOQUEUE_OP_NONE; + ioqueue_remove_from_set(key->ioqueue, key, READABLE_EVENT); pj_ioqueue_unlock_key(key); if (key->cb.on_read_complete) @@ -1297,6 +1298,7 @@ if (op_rec == (void*)op_key) { pj_list_erase(op_rec); op_rec->op = PJ_IOQUEUE_OP_NONE; + ioqueue_remove_from_set(key->ioqueue, key, WRITEABLE_EVENT); pj_ioqueue_unlock_key(key); if (key->cb.on_write_complete) @@ -1324,11 +1326,43 @@ op_rec = op_rec->next; } + /* Clear connecting operation. */ + if (key->connecting) { + key->connecting = 0; + ioqueue_remove_from_set(key->ioqueue, key, WRITEABLE_EVENT); + ioqueue_remove_from_set(key->ioqueue, key, EXCEPTION_EVENT); + } + pj_ioqueue_unlock_key(key); return PJ_EINVALIDOP; } + +PJ_DEF(pj_status_t) pj_ioqueue_clear_key( pj_ioqueue_key_t *key ) +{ + PJ_ASSERT_RETURN(key, PJ_EINVAL); + + pj_ioqueue_lock_key(key); + + /* Reset pending lists */ + pj_list_init(&key->read_list); + pj_list_init(&key->write_list); + pj_list_init(&key->accept_list); + key->connecting = 0; + + /* Remove key from sets */ + ioqueue_remove_from_set(key->ioqueue, key, READABLE_EVENT); + ioqueue_remove_from_set(key->ioqueue, key, WRITEABLE_EVENT); + ioqueue_remove_from_set(key->ioqueue, key, EXCEPTION_EVENT); + + pj_ioqueue_unlock_key(key); + + return PJ_SUCCESS; + +} + + PJ_DEF(pj_status_t) pj_ioqueue_set_default_concurrency( pj_ioqueue_t *ioqueue, pj_bool_t allow) { diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjlib/src/pj/ioqueue_epoll.c asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjlib/src/pj/ioqueue_epoll.c --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjlib/src/pj/ioqueue_epoll.c 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjlib/src/pj/ioqueue_epoll.c 2022-02-24 07:54:38.000000000 +0000 @@ -53,6 +53,7 @@ #define os_epoll_ctl epoll_ctl #define os_epoll_wait epoll_wait + #define THIS_FILE "ioq_epoll" //#define TRACE_(expr) PJ_LOG(3,expr) @@ -108,12 +109,46 @@ static void scan_closing_keys(pj_ioqueue_t *ioqueue); #endif + +/* EPOLLEXCLUSIVE or EPOLLONESHOT is reported to cause perm handshake error + * on OpenSSL 1.0.2, so let's disable this when using OpenSSL older than + * version 1.1.0. + */ +#if defined(PJ_HAS_SSL_SOCK) && PJ_HAS_SSL_SOCK != 0 && \ + (PJ_SSL_SOCK_IMP == PJ_SSL_SOCK_IMP_OPENSSL) + +# include +# if OPENSSL_VERSION_NUMBER < 0x10100000L +# define DONT_USE_EXCL_ONESHOT +# endif + +#endif + +/* Use EPOLLEXCLUSIVE or EPOLLONESHOT to signal one thread only at a time. */ +#if defined(EPOLLEXCLUSIVE) && !defined(DONT_USE_EXCL_ONESHOT) +# define USE_EPOLLEXCLUSIVE 1 +# define USE_EPOLLONESHOT 0 +#elif defined(EPOLLONESHOT) && !defined(DONT_USE_EXCL_ONESHOT) +# define USE_EPOLLEXCLUSIVE 0 +# define USE_EPOLLONESHOT 1 +#else +# define USE_EPOLLEXCLUSIVE 0 +# define USE_EPOLLONESHOT 0 +#endif + + /* * pj_ioqueue_name() */ PJ_DEF(const char*) pj_ioqueue_name(void) { +#if USE_EPOLLEXCLUSIVE + return "epoll-exclusive"; +#elif USE_EPOLLONESHOT + return "epoll-oneshot"; +#else return "epoll"; +#endif } /* @@ -196,6 +231,7 @@ ioqueue->epfd = os_epoll_create(max_fd); if (ioqueue->epfd < 0) { + pj_lock_acquire(ioqueue->lock); ioqueue_destroy(ioqueue); return PJ_RETURN_OS_ERROR(pj_get_native_os_error()); } @@ -206,7 +242,7 @@ ioqueue->queue = pj_pool_calloc(pool, max_fd, sizeof(struct queue)); PJ_ASSERT_RETURN(ioqueue->queue != NULL, PJ_ENOMEM); */ - PJ_LOG(4, ("pjlib", "epoll I/O Queue created (%p)", ioqueue)); + PJ_LOG(4, ("pjlib", "%s I/O Queue created (%p)", pj_ioqueue_name(), ioqueue)); *p_ioqueue = ioqueue; return PJ_SUCCESS; @@ -328,6 +364,11 @@ */ /* os_epoll_ctl. */ ev.events = EPOLLIN | EPOLLERR; +#if USE_EPOLLEXCLUSIVE + ev.events |= EPOLLEXCLUSIVE; +#elif USE_EPOLLONESHOT + ev.events |= EPOLLONESHOT; +#endif ev.epoll_data = (epoll_data_type)key; status = os_epoll_ctl(ioqueue->epfd, EPOLL_CTL_ADD, sock, &ev); if (status < 0) { @@ -505,6 +546,29 @@ return PJ_SUCCESS; } + +static void update_epoll_event_set(pj_ioqueue_t *ioqueue, + pj_ioqueue_key_t *key, + pj_uint32_t events) +{ + struct epoll_event ev; + + ev.epoll_data = (epoll_data_type)key; + ev.events = events; + +#if USE_EPOLLEXCLUSIVE + ev.events |= EPOLLEXCLUSIVE; + os_epoll_ctl( ioqueue->epfd, EPOLL_CTL_DEL, key->fd, &ev); + os_epoll_ctl( ioqueue->epfd, EPOLL_CTL_ADD, key->fd, &ev); +#elif USE_EPOLLONESHOT + ev.events |= EPOLLONESHOT; + os_epoll_ctl( ioqueue->epfd, EPOLL_CTL_MOD, key->fd, &ev); +#else + os_epoll_ctl( ioqueue->epfd, EPOLL_CTL_MOD, key->fd, &ev); +#endif +} + + /* ioqueue_remove_from_set() * This function is called from ioqueue_dispatch_event() to instruct * the ioqueue to remove the specified descriptor from ioqueue's descriptor @@ -514,13 +578,20 @@ pj_ioqueue_key_t *key, enum ioqueue_event_type event_type) { - if (event_type == WRITEABLE_EVENT) { - struct epoll_event ev; - - ev.events = EPOLLIN | EPOLLERR; - ev.epoll_data = (epoll_data_type)key; - os_epoll_ctl( ioqueue->epfd, EPOLL_CTL_MOD, key->fd, &ev); - } +#if USE_EPOLLONESHOT + /* For EPOLLONESHOT, always rearm ioqueue for events. */ + PJ_UNUSED_ARG(event_type); + pj_uint32_t ev = EPOLLIN | EPOLLERR; + if (key_has_pending_write(key)) + ev |= EPOLLOUT; + update_epoll_event_set(ioqueue, key, ev); +#else + /* Remove EPOLLOUT if write event received and no pending send */ + if (event_type == WRITEABLE_EVENT && !key_has_pending_write(key)) { + pj_uint32_t ev = EPOLLIN | EPOLLERR; + update_epoll_event_set(ioqueue, key, ev); + } +#endif } /* @@ -533,13 +604,14 @@ pj_ioqueue_key_t *key, enum ioqueue_event_type event_type ) { + /* Add EPOLLOUT if write-event requested (other events are always set) */ if (event_type == WRITEABLE_EVENT) { - struct epoll_event ev; + pj_uint32_t ev = EPOLLIN | EPOLLERR; + if (key_has_pending_connect(key) || key_has_pending_write(key)) + ev |= EPOLLOUT; - ev.events = EPOLLIN | EPOLLOUT | EPOLLERR; - ev.epoll_data = (epoll_data_type)key; - os_epoll_ctl( ioqueue->epfd, EPOLL_CTL_MOD, key->fd, &ev); - } + update_epoll_event_set(ioqueue, key, ev); + } } #if PJ_IOQUEUE_HAS_SAFE_UNREG @@ -755,7 +827,7 @@ pj_get_timestamp(&t1); TRACE_((THIS_FILE, "ioqueue_poll() returns %d, time=%d usec", - processed, pj_elapsed_usec(&t2, &t1))); + processed_cnt, pj_elapsed_usec(&t2, &t1))); return processed_cnt; } diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjlib/src/pj/ioqueue_select.c asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjlib/src/pj/ioqueue_select.c --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjlib/src/pj/ioqueue_select.c 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjlib/src/pj/ioqueue_select.c 2022-02-24 07:54:38.000000000 +0000 @@ -131,6 +131,12 @@ static pj_status_t replace_udp_sock(pj_ioqueue_key_t *h); #endif +#if defined(PJ_HAS_SSL_SOCK) && PJ_HAS_SSL_SOCK != 0 && \ + (PJ_SSL_SOCK_IMP == PJ_SSL_SOCK_IMP_APPLE) + /* Call SSL Network framework poll */ +pj_status_t ssl_network_event_poll(); +#endif + /* Include implementation for common abstraction after we declare * pj_ioqueue_key_t and pj_ioqueue_t. */ @@ -502,14 +508,15 @@ /* Ticket #520, key will be erased more than once */ pj_list_erase(key); #endif - PJ_FD_CLR(key->fd, &ioqueue->rfdset); - PJ_FD_CLR(key->fd, &ioqueue->wfdset); + + /* Remove socket from sets and close socket. */ + if (key->fd != PJ_INVALID_SOCKET) { + PJ_FD_CLR(key->fd, &ioqueue->rfdset); + PJ_FD_CLR(key->fd, &ioqueue->wfdset); #if PJ_HAS_TCP - PJ_FD_CLR(key->fd, &ioqueue->xfdset); + PJ_FD_CLR(key->fd, &ioqueue->xfdset); #endif - /* Close socket. */ - if (key->fd != PJ_INVALID_SOCKET) { pj_sock_close(key->fd); key->fd = PJ_INVALID_SOCKET; } @@ -926,6 +933,12 @@ PJ_ASSERT_RETURN(ioqueue, -PJ_EINVAL); +#if defined(PJ_HAS_SSL_SOCK) && PJ_HAS_SSL_SOCK != 0 && \ + (PJ_SSL_SOCK_IMP == PJ_SSL_SOCK_IMP_APPLE) + /* Call SSL Network framework event poll */ + ssl_network_event_poll(); +#endif + /* Lock ioqueue before making fd_set copies */ pj_lock_acquire(ioqueue->lock); diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjlib/src/pj/ip_helper_generic.c asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjlib/src/pj/ip_helper_generic.c --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjlib/src/pj/ip_helper_generic.c 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjlib/src/pj/ip_helper_generic.c 2022-02-24 07:54:38.000000000 +0000 @@ -97,6 +97,11 @@ continue; /* Skip when interface is down */ } + if ((it->ifa_flags & IFF_RUNNING)==0) { + TRACE_((THIS_FILE, " interface is not running")); + continue; /* Skip when interface is not running */ + } + #if PJ_IP_HELPER_IGNORE_LOOPBACK_IF if (it->ifa_flags & IFF_LOOPBACK) { TRACE_((THIS_FILE, " loopback interface")); @@ -116,6 +121,19 @@ continue; /* Skip when interface is down */ } + /* Ignore 192.0.0.0/29 address. + * Ref: https://datatracker.ietf.org/doc/html/rfc7335#section-4 + */ + if (af==pj_AF_INET() && + (pj_ntohl(((pj_sockaddr_in*)ad)->sin_addr.s_addr) >> 4) == + 201326592) /* 0b1100000000000000000000000000 which is + 192.0.0.0 >> 4 */ + { + TRACE_((THIS_FILE, " address %s ignored (192.0.0.0/29 class)", + get_addr(ad), ad->sa_family)); + continue; + } + /* Ignore 0.0.0.0/8 address. This is a special address * which doesn't seem to have practical use. */ @@ -208,6 +226,11 @@ continue; /* Skip when interface is down */ } + if ((iff.ifr_flags & IFF_RUNNING)==0) { + TRACE_((THIS_FILE, " interface is not running")); + continue; /* Skip when interface is not running */ + } + #if PJ_IP_HELPER_IGNORE_LOOPBACK_IF if (iff.ifr_flags & IFF_LOOPBACK) { TRACE_((THIS_FILE, " loopback interface")); @@ -215,6 +238,19 @@ } #endif + /* Ignore 192.0.0.0/29 address. + * Ref: https://datatracker.ietf.org/doc/html/rfc7335#section-4 + */ + if (af==pj_AF_INET() && + (pj_ntohl(((pj_sockaddr_in*)ad)->sin_addr.s_addr) >> 4) == + 201326592) /* 0b1100000000000000000000000000 which is + 192.0.0.0 >> 4 */ + { + TRACE_((THIS_FILE, " address %s ignored (192.0.0.0/29 class)", + get_addr(ad), ad->sa_family)); + continue; + } + /* Ignore 0.0.0.0/8 address. This is a special address * which doesn't seem to have practical use. */ @@ -286,6 +322,11 @@ continue; /* Skip when interface is down */ } + if ((ifreq.ifr_flags & IFF_RUNNING)==0) { + TRACE_((THIS_FILE, " interface is not running")); + continue; /* Skip when interface is not running */ + } + #if PJ_IP_HELPER_IGNORE_LOOPBACK_IF if (ifreq.ifr_flags & IFF_LOOPBACK) { TRACE_((THIS_FILE, " loopback interface")); @@ -309,6 +350,19 @@ continue; /* Not address family that we want, continue */ } + /* Ignore 192.0.0.0/29 address. + * Ref: https://datatracker.ietf.org/doc/html/rfc7335#section-4 + */ + if (af==pj_AF_INET() && + (pj_ntohl(((pj_sockaddr_in*)ad)->sin_addr.s_addr) >> 4) == + 201326592) /* 0b1100000000000000000000000000 which is + 192.0.0.0 >> 4 */ + { + TRACE_((THIS_FILE, " address %s ignored (192.0.0.0/29 class)", + get_addr(ad), ad->sa_family)); + continue; + } + /* Ignore 0.0.0.0/8 address. This is a special address * which doesn't seem to have practical use. */ diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjlib/src/pj/lock.c asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjlib/src/pj/lock.c --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjlib/src/pj/lock.c 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjlib/src/pj/lock.c 2022-02-24 07:54:38.000000000 +0000 @@ -260,17 +260,25 @@ static void grp_lock_set_owner_thread(pj_grp_lock_t *glock) { if (!glock->owner) { +#if PJ_HAS_THREADS glock->owner = pj_thread_this(); +#else + glock->owner = (pj_thread_t *) -1; +#endif glock->owner_cnt = 1; } else { +#if PJ_HAS_THREADS pj_assert(glock->owner == pj_thread_this()); +#endif glock->owner_cnt++; } } static void grp_lock_unset_owner_thread(pj_grp_lock_t *glock) { +#if PJ_HAS_THREADS pj_assert(glock->owner == pj_thread_this()); +#endif pj_assert(glock->owner_cnt > 0); if (--glock->owner_cnt <= 0) { glock->owner = NULL; diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjlib/src/pj/log.c asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjlib/src/pj/log.c --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjlib/src/pj/log.c 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjlib/src/pj/log.c 2022-02-24 07:54:38.000000000 +0000 @@ -167,12 +167,28 @@ } #endif g_last_thread = NULL; + + /* Normalize log decor, e.g: unset thread flags when threading is + * disabled. + */ + pj_log_set_decor(pj_log_get_decor()); + return PJ_SUCCESS; } PJ_DEF(void) pj_log_set_decor(unsigned decor) { log_decor = decor; + +#if !PJ_HAS_THREADS + /* Unset thread related flags */ + if (log_decor & PJ_LOG_HAS_THREAD_ID) { + log_decor &= ~(PJ_LOG_HAS_THREAD_ID); + } + if (log_decor & PJ_LOG_HAS_THREAD_SWC) { + log_decor &= ~(PJ_LOG_HAS_THREAD_SWC); + } +#endif } PJ_DEF(unsigned) pj_log_get_decor(void) diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjlib/src/pj/os_core_unix.c asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjlib/src/pj/os_core_unix.c --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjlib/src/pj/os_core_unix.c 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjlib/src/pj/os_core_unix.c 2022-02-24 07:54:38.000000000 +0000 @@ -39,6 +39,10 @@ # include #endif +#if defined(PJ_SEMAPHORE_USE_DISPATCH_SEM) && PJ_SEMAPHORE_USE_DISPATCH_SEM != 0 +# include +#endif + #include // getpid() #include // errno @@ -65,8 +69,10 @@ return JNI_VERSION_1_4; } + #endif + struct pj_thread_t { char obj_name[PJ_MAX_OBJ_NAME]; @@ -107,7 +113,11 @@ #if defined(PJ_HAS_SEMAPHORE) && PJ_HAS_SEMAPHORE != 0 struct pj_sem_t { +#if defined(PJ_SEMAPHORE_USE_DISPATCH_SEM) && PJ_SEMAPHORE_USE_DISPATCH_SEM != 0 + dispatch_semaphore_t sem; +#else sem_t *sem; +#endif char obj_name[PJ_MAX_OBJ_NAME]; }; #endif /* PJ_HAS_SEMAPHORE */ @@ -167,6 +177,9 @@ return PJ_SUCCESS; } + /* Init logging */ + pj_log_init(); + #if PJ_HAS_THREADS /* Init this thread's TLS. */ if ((rc=pj_thread_init()) != 0) { @@ -179,9 +192,6 @@ #endif - /* Init logging */ - pj_log_init(); - /* Initialize exception ID for the pool. * Must do so after critical section is configured. */ @@ -295,6 +305,95 @@ } +/* Thread priority utils for Android (via JNI as NDK does not provide it). + * Set priority is probably not enough because it does not change the thread + * group in scheduler. + * Temporary solution is to call the Java API to set the thread priority. + * A cool solution would be to port (if possible) the code from the + * android os regarding set_sched groups. + */ +#if PJ_ANDROID + +#include +#include +#include + +PJ_DEF(pj_bool_t) pj_jni_attach_jvm(JNIEnv **jni_env) +{ + if ((*pj_jni_jvm)->GetEnv(pj_jni_jvm, (void **)jni_env, + JNI_VERSION_1_4) < 0) + { + if ((*pj_jni_jvm)->AttachCurrentThread(pj_jni_jvm, jni_env, NULL) < 0) + { + jni_env = NULL; + return PJ_FALSE; + } + return PJ_TRUE; + } + + return PJ_FALSE; +} + +PJ_DEF(void) pj_jni_dettach_jvm(pj_bool_t attached) +{ + if (attached) + (*pj_jni_jvm)->DetachCurrentThread(pj_jni_jvm); +} + + +static pj_status_t set_android_thread_priority(int priority) +{ + jclass process_class; + jmethodID set_prio_method; + jthrowable exc; + pj_status_t result = PJ_SUCCESS; + JNIEnv *jni_env = 0; + pj_bool_t attached = pj_jni_attach_jvm(&jni_env); + + PJ_ASSERT_RETURN(jni_env, PJ_FALSE); + + /* Get pointer to the java class */ + process_class = (jclass)(*jni_env)->NewGlobalRef(jni_env, + (*jni_env)->FindClass(jni_env, "android/os/Process")); + if (process_class == 0) { + PJ_LOG(5, (THIS_FILE, "Unable to find class android.os.Process")); + result = PJ_EIGNORED; + goto on_return; + } + + /* Get the id of set thread priority function */ + set_prio_method = (*jni_env)->GetStaticMethodID(jni_env, process_class, + "setThreadPriority", + "(I)V"); + if (set_prio_method == 0) { + PJ_LOG(5, (THIS_FILE, "Unable to find setThreadPriority() method")); + result = PJ_EIGNORED; + goto on_return; + } + + /* Set the thread priority */ + (*jni_env)->CallStaticVoidMethod(jni_env, process_class, set_prio_method, + priority); + exc = (*jni_env)->ExceptionOccurred(jni_env); + if (exc) { + (*jni_env)->ExceptionDescribe(jni_env); + (*jni_env)->ExceptionClear(jni_env); + PJ_LOG(4, (THIS_FILE, "Failure in setting thread priority using " + "Java API, fallback to setpriority()")); + setpriority(PRIO_PROCESS, 0, priority); + } else { + PJ_LOG(5, (THIS_FILE, "Setting thread priority to %d successful", + priority)); + } + +on_return: + pj_jni_dettach_jvm(attached); + return result; +} + +#endif + + /* * Get thread priority value for the thread. */ @@ -323,6 +422,12 @@ PJ_DEF(pj_status_t) pj_thread_set_prio(pj_thread_t *thread, int prio) { #if PJ_HAS_THREADS + +# if PJ_ANDROID + PJ_ASSERT_RETURN(thread==NULL || thread==pj_thread_this(), PJ_EINVAL); + return set_android_thread_priority(prio); +# else + struct sched_param param; int policy; int rc; @@ -338,6 +443,9 @@ return PJ_RETURN_OS_ERROR(rc); return PJ_SUCCESS; + +# endif /* PJ_ANDROID */ + #else PJ_UNUSED_ARG(thread); PJ_UNUSED_ARG(prio); @@ -1569,6 +1677,11 @@ PJ_ASSERT_RETURN(sem, PJ_ENOMEM); #if defined(PJ_DARWINOS) && PJ_DARWINOS!=0 +# if defined(PJ_SEMAPHORE_USE_DISPATCH_SEM) && PJ_SEMAPHORE_USE_DISPATCH_SEM != 0 + sem->sem = dispatch_semaphore_create(initial); + if (sem->sem == NULL) + return PJ_RETURN_OS_ERROR(pj_get_native_os_error()); +# else /* MacOS X doesn't support anonymous semaphore */ { char sem_name[PJ_GUID_MAX_LENGTH+1]; @@ -1599,6 +1712,7 @@ /* And immediately release the name as we don't need it */ sem_unlink(sem_name); } +# endif #else sem->sem = PJ_POOL_ALLOC_T(pool, sem_t); if (sem_init( sem->sem, 0, initial) != 0) @@ -1632,7 +1746,7 @@ PJ_DEF(pj_status_t) pj_sem_wait(pj_sem_t *sem) { #if PJ_HAS_THREADS - int result; + long result; PJ_CHECK_STACK(); PJ_ASSERT_RETURN(sem, PJ_EINVAL); @@ -1640,7 +1754,11 @@ PJ_LOG(6, (sem->obj_name, "Semaphore: thread %s is waiting", pj_thread_this()->obj_name)); +#if defined(PJ_SEMAPHORE_USE_DISPATCH_SEM) && PJ_SEMAPHORE_USE_DISPATCH_SEM != 0 + result = dispatch_semaphore_wait(sem->sem, DISPATCH_TIME_FOREVER); +#else result = sem_wait( sem->sem ); +#endif if (result == 0) { PJ_LOG(6, (sem->obj_name, "Semaphore acquired by thread %s", @@ -1666,12 +1784,16 @@ PJ_DEF(pj_status_t) pj_sem_trywait(pj_sem_t *sem) { #if PJ_HAS_THREADS - int result; + long result; PJ_CHECK_STACK(); PJ_ASSERT_RETURN(sem, PJ_EINVAL); +#if defined(PJ_SEMAPHORE_USE_DISPATCH_SEM) && PJ_SEMAPHORE_USE_DISPATCH_SEM != 0 + result = dispatch_semaphore_wait(sem->sem, DISPATCH_TIME_NOW); +#else result = sem_trywait( sem->sem ); +#endif if (result == 0) { PJ_LOG(6, (sem->obj_name, "Semaphore acquired by thread %s", @@ -1696,7 +1818,12 @@ int result; PJ_LOG(6, (sem->obj_name, "Semaphore released by thread %s", pj_thread_this()->obj_name)); +#if defined(PJ_SEMAPHORE_USE_DISPATCH_SEM) && PJ_SEMAPHORE_USE_DISPATCH_SEM != 0 + dispatch_semaphore_signal(sem->sem); + result = 0; +#else result = sem_post( sem->sem ); +#endif if (result == 0) return PJ_SUCCESS; @@ -1722,7 +1849,12 @@ PJ_LOG(6, (sem->obj_name, "Semaphore destroyed by thread %s", pj_thread_this()->obj_name)); #if defined(PJ_DARWINOS) && PJ_DARWINOS!=0 +# if defined(PJ_SEMAPHORE_USE_DISPATCH_SEM) && PJ_SEMAPHORE_USE_DISPATCH_SEM != 0 + dispatch_release(sem->sem); + result = 0; +# else result = sem_close( sem->sem ); +# endif #else result = sem_destroy( sem->sem ); #endif diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjlib/src/pj/os_time_common.c asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjlib/src/pj/os_time_common.c --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjlib/src/pj/os_time_common.c 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjlib/src/pj/os_time_common.c 2022-02-24 07:54:38.000000000 +0000 @@ -75,13 +75,31 @@ #endif /* !PJ_WIN32 */ +static int get_tz_offset_secs() +{ + time_t epoch_plus_11h = 60 * 60 * 11; + struct tm ltime, gtime; + int offset_min; + +#if defined(PJ_HAS_LOCALTIME_R) && PJ_HAS_LOCALTIME_R != 0 + localtime_r(&epoch_plus_11h, <ime); + gmtime_r(&epoch_plus_11h, >ime); +#else + ltime = *localtime(&epoch_plus_11h); + gtime = *gmtime(&epoch_plus_11h); +#endif + + offset_min = (ltime.tm_hour*60+ltime.tm_min) - (gtime.tm_hour*60+gtime.tm_min); + return offset_min*60; +} + /** * Convert local time to GMT. */ PJ_DEF(pj_status_t) pj_time_local_to_gmt(pj_time_val *tv) { - PJ_UNUSED_ARG(tv); - return PJ_EBUG; + tv->sec -= get_tz_offset_secs(); + return PJ_SUCCESS; } /** @@ -89,8 +107,8 @@ */ PJ_DEF(pj_status_t) pj_time_gmt_to_local(pj_time_val *tv) { - PJ_UNUSED_ARG(tv); - return PJ_EBUG; + tv->sec += get_tz_offset_secs(); + return PJ_SUCCESS; } diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjlib/src/pj/os_timestamp_common.c asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjlib/src/pj/os_timestamp_common.c --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjlib/src/pj/os_timestamp_common.c 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjlib/src/pj/os_timestamp_common.c 2022-02-24 07:54:38.000000000 +0000 @@ -65,16 +65,19 @@ freq += ts_freq.u32.lo; #endif - /* Avoid division by zero. */ - if (freq == 0) freq = 1; - /* Get elapsed time in cycles. */ elapsed = get_elapsed(start, stop); /* usec = elapsed * MSEC / freq */ - pj_highprec_mul(elapsed, MSEC); - pj_highprec_div(elapsed, freq); - + pj_highprec_div(freq, MSEC); + + /* Avoid division by zero. */ + if (freq == 0) { + /* Regard freq = 1 */ + pj_highprec_mul(elapsed, MSEC); + } else { + pj_highprec_div(elapsed, freq); + } return elapsed; } diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjlib/src/pj/os_time_win32.c asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjlib/src/pj/os_time_win32.c --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjlib/src/pj/os_time_win32.c 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjlib/src/pj/os_time_win32.c 2022-02-24 07:54:38.000000000 +0000 @@ -18,6 +18,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include +#include #include #include #include @@ -293,11 +294,67 @@ /** * Convert local time to GMT. */ -PJ_DEF(pj_status_t) pj_time_local_to_gmt(pj_time_val *tv); +PJ_DEF(pj_status_t) pj_time_local_to_gmt(pj_time_val *tv) +{ +#ifdef WINCE_TIME + return PJ_ENOTSUP; +#else + LARGE_INTEGER li; + FILETIME ft_local; + FILETIME ft_gmt; + + li.QuadPart = tv->sec; + li.QuadPart += base_time.QuadPart; + li.QuadPart *= SECS_TO_FT_MULT; + + ft_local.dwLowDateTime = li.LowPart; + ft_local.dwHighDateTime = li.HighPart; + + if (LocalFileTimeToFileTime(&ft_local, &ft_gmt) == 0) + return PJ_EINVAL; + + li.LowPart = ft_gmt.dwLowDateTime; + li.HighPart = ft_gmt.dwHighDateTime; + li.QuadPart /= SECS_TO_FT_MULT; + li.QuadPart -= base_time.QuadPart; + + tv->sec = li.LowPart; + + return PJ_SUCCESS; +#endif +} /** * Convert GMT to local time. */ -PJ_DEF(pj_status_t) pj_time_gmt_to_local(pj_time_val *tv); +PJ_DEF(pj_status_t) pj_time_gmt_to_local(pj_time_val *tv) +{ +#ifdef WINCE_TIME + return PJ_ENOTSUP; +#else + LARGE_INTEGER li; + FILETIME ft_local; + FILETIME ft_gmt; + + li.QuadPart = tv->sec; + li.QuadPart += base_time.QuadPart; + li.QuadPart *= SECS_TO_FT_MULT; + + ft_gmt.dwLowDateTime = li.LowPart; + ft_gmt.dwHighDateTime = li.HighPart; + + if (FileTimeToLocalFileTime(&ft_gmt, &ft_local) == 0) + return PJ_EINVAL; + + li.LowPart = ft_local.dwLowDateTime; + li.HighPart = ft_local.dwHighDateTime; + li.QuadPart /= SECS_TO_FT_MULT; + li.QuadPart -= base_time.QuadPart; + + tv->sec = li.LowPart; + + return PJ_SUCCESS; +#endif +} diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjlib/src/pj/pool_dbg.c asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjlib/src/pj/pool_dbg.c --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjlib/src/pj/pool_dbg.c 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjlib/src/pj/pool_dbg.c 2022-02-24 07:54:38.000000000 +0000 @@ -44,7 +44,7 @@ -int PJ_NO_MEMORY_EXCEPTION; +PJ_DEF_DATA(int) PJ_NO_MEMORY_EXCEPTION; PJ_DEF(int) pj_NO_MEMORY_EXCEPTION() @@ -95,6 +95,24 @@ free(pool); } +/* Safe release pool */ +PJ_DEF(void) pj_pool_safe_release_imp( pj_pool_t **ppool ) +{ + pj_pool_t *pool = *ppool; + *ppool = NULL; + if (pool) + pj_pool_release(pool); +} + +/* Secure release pool */ +PJ_DEF(void) pj_pool_secure_release_imp( pj_pool_t **ppool ) +{ + /* Secure release is not implemented, so we just call + * safe release. + */ + pj_pool_safe_release_imp(ppool); +} + /* Get pool name */ PJ_DEF(const char*) pj_pool_getobjname_imp(pj_pool_t *pool) { diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjlib/src/pj/sock_bsd.c asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjlib/src/pj/sock_bsd.c --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjlib/src/pj/sock_bsd.c 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjlib/src/pj/sock_bsd.c 2022-02-24 07:54:38.000000000 +0000 @@ -244,7 +244,7 @@ * numbers-and-dots notation into binary data and stores it in the structure * that inp points to. */ -PJ_DEF(int) pj_inet_aton(const pj_str_t *cp, struct pj_in_addr *inp) +PJ_DEF(int) pj_inet_aton(const pj_str_t *cp, pj_in_addr *inp) { char tempaddr[PJ_INET_ADDRSTRLEN]; @@ -600,7 +600,7 @@ PJ_SOCKADDR_SET_LEN(&addr, sizeof(pj_sockaddr_in)); addr.sin_family = PJ_AF_INET; - pj_bzero(addr.sin_zero, sizeof(addr.sin_zero)); + pj_bzero(addr.sin_zero_pad, sizeof(addr.sin_zero_pad)); addr.sin_addr.s_addr = pj_htonl(addr32); addr.sin_port = pj_htons(port); diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjlib/src/pj/sock_common.c asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjlib/src/pj/sock_common.c --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjlib/src/pj/sock_common.c 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjlib/src/pj/sock_common.c 2022-02-24 07:54:38.000000000 +0000 @@ -129,7 +129,7 @@ PJ_SOCKADDR_RESET_LEN(addr); addr->sin_family = PJ_AF_INET; - pj_bzero(addr->sin_zero, sizeof(addr->sin_zero)); + pj_bzero(addr->sin_zero_pad, sizeof(addr->sin_zero_pad)); if (str_addr && str_addr->slen) { addr->sin_addr = pj_inet_addr(str_addr); @@ -210,7 +210,7 @@ PJ_SOCKADDR_RESET_LEN(addr); addr->sin_family = PJ_AF_INET; - pj_bzero(addr->sin_zero, sizeof(addr->sin_zero)); + pj_bzero(addr->sin_zero_pad, sizeof(addr->sin_zero_pad)); pj_sockaddr_in_set_port(addr, port); return pj_sockaddr_in_set_str_addr(addr, str_addr); } @@ -916,8 +916,10 @@ } if (j == cand_cnt) { - pj_sockaddr_copy_addr(&cand_addr[cand_cnt], - &cand_addr[start_if+i]); + if (cand_cnt != (start_if + i)) { + pj_sockaddr_copy_addr(&cand_addr[cand_cnt], + &cand_addr[start_if + i]); + } cand_weight[cand_cnt] += WEIGHT_INTERFACE; ++cand_cnt; } @@ -987,11 +989,11 @@ if (af==PJ_AF_INET) { addr->ipv4.sin_addr.s_addr = pj_htonl (0x7f000001); } else { - pj_in6_addr *s6_addr; + pj_in6_addr *s6_addr_; - s6_addr = (pj_in6_addr*) pj_sockaddr_get_addr(addr); - pj_bzero(s6_addr, sizeof(pj_in6_addr)); - s6_addr->s6_addr[15] = 1; + s6_addr_ = (pj_in6_addr*) pj_sockaddr_get_addr(addr); + pj_bzero(s6_addr_, sizeof(pj_in6_addr)); + s6_addr_->s6_addr[15] = 1; } TRACE_((THIS_FILE, "Loopback IP %s returned", pj_sockaddr_print(addr, strip, sizeof(strip), 3))); diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjlib/src/pj/sock_symbian.cpp asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjlib/src/pj/sock_symbian.cpp --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjlib/src/pj/sock_symbian.cpp 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjlib/src/pj/sock_symbian.cpp 2022-02-24 07:54:38.000000000 +0000 @@ -299,7 +299,7 @@ * numbers-and-dots notation into binary data and stores it in the structure * that inp points to. */ -PJ_DEF(int) pj_inet_aton(const pj_str_t *cp, struct pj_in_addr *inp) +PJ_DEF(int) pj_inet_aton(const pj_str_t *cp, pj_in_addr *inp) { enum { MAXIPLEN = PJ_INET_ADDRSTRLEN }; diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjlib/src/pj/sock_uwp.cpp asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjlib/src/pj/sock_uwp.cpp --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjlib/src/pj/sock_uwp.cpp 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjlib/src/pj/sock_uwp.cpp 2022-02-24 07:54:38.000000000 +0000 @@ -933,7 +933,7 @@ * numbers-and-dots notation into binary data and stores it in the structure * that inp points to. */ -PJ_DEF(int) pj_inet_aton(const pj_str_t *cp, struct pj_in_addr *inp) +PJ_DEF(int) pj_inet_aton(const pj_str_t *cp, pj_in_addr *inp) { char tempaddr[PJ_INET_ADDRSTRLEN]; diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjlib/src/pj/ssl_sock_apple.m asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjlib/src/pj/ssl_sock_apple.m --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjlib/src/pj/ssl_sock_apple.m 1970-01-01 00:00:00.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjlib/src/pj/ssl_sock_apple.m 2022-02-24 07:54:38.000000000 +0000 @@ -0,0 +1,2208 @@ +/* + * Copyright (C) 2019-2020 Teluu Inc. (http://www.teluu.com) + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#include +#include +#include +#include + +/* Only build when PJ_HAS_SSL_SOCK and the implementation is Apple SSL. */ +#if defined(PJ_HAS_SSL_SOCK) && PJ_HAS_SSL_SOCK != 0 && \ + (PJ_SSL_SOCK_IMP == PJ_SSL_SOCK_IMP_APPLE) + +#define THIS_FILE "ssl_sock_apple.m" + +/* Set to 1 to enable debugging messages. */ +#define SSL_DEBUG 0 + +#define SSL_SOCK_IMP_USE_CIRC_BUF +#define SSL_SOCK_IMP_USE_OWN_NETWORK + +#include "ssl_sock_imp_common.h" +#include "ssl_sock_imp_common.c" + +#include "TargetConditionals.h" + +#include +#include +#include +#include +#include +#include + +/* IMPORTANT note from Apple's Concurrency Programming Guide doc: + * "Because Grand Central Dispatch manages the relationship between the tasks + * you provide and the threads on which those tasks run, you should generally + * avoid calling POSIX thread routines from your task code" + * + * Since network events happen in a dispatch function block, we need to make + * sure not to call any PJLIB functions there (not even pj_pool_alloc() nor + * pj_log()). Instead, we will post those events to a singleton event manager + * to be polled by ioqueue polling thread(s). + */ + +/* Secure socket structure definition. */ +typedef struct applessl_sock_t { + pj_ssl_sock_t base; + + nw_listener_t listener; + nw_listener_state_t lis_state; + nw_connection_t connection; + nw_connection_state_t con_state; + dispatch_queue_t queue; + dispatch_semaphore_t ev_semaphore; + + SecTrustRef trust; + tls_ciphersuite_t cipher; + sec_identity_t identity; +} applessl_sock_t; + + +/* + ******************************************************************* + * Event manager + ******************************************************************* + */ + + typedef enum event_id +{ + EVENT_ACCEPT, + EVENT_CONNECT, + EVENT_VERIFY_CERT, + EVENT_HANDSHAKE_COMPLETE, + EVENT_DATA_READ, + EVENT_DATA_SENT, + EVENT_DISCARD +} event_id; + +typedef struct event_t +{ + PJ_DECL_LIST_MEMBER(struct event_t); + + event_id type; + pj_ssl_sock_t *ssock; + pj_bool_t async; + + union + { + struct + { + nw_connection_t newconn; + pj_sockaddr src_addr; + int src_addr_len; + pj_status_t status; + } accept_ev; + + struct + { + pj_status_t status; + } connect_ev; + + struct + { + pj_status_t status; + } handshake_ev; + + struct + { + pj_ioqueue_op_key_t *send_key; + pj_ssize_t sent; + } data_sent_ev; + + struct + { + void *data; + pj_size_t size; + pj_status_t status; + pj_size_t remainder; + } data_read_ev; + + } body; +} event_t; + +typedef struct event_manager +{ + NSLock *lock; + event_t event_list; + event_t free_event_list; +} event_manager; + +static event_manager *event_mgr = NULL; + +#if SSL_DEBUG +static pj_thread_desc queue_th_desc; +static pj_thread_t *queue_th; +#endif + +/* + ******************************************************************* + * Event manager's functions + ******************************************************************* + */ + +static pj_status_t verify_cert(applessl_sock_t *assock, pj_ssl_cert_t *cert); + +static void event_manager_destroy() +{ + event_manager *mgr = event_mgr; + + event_mgr = NULL; + + while (!pj_list_empty(&mgr->free_event_list)) { + event_t *event = mgr->free_event_list.next; + pj_list_erase(event); + free(event); + } + + while (!pj_list_empty(&mgr->event_list)) { + event_t *event = mgr->event_list.next; + pj_list_erase(event); + free(event); + } + + [mgr->lock release]; + + free(mgr); +} + +static pj_status_t event_manager_create() +{ + event_manager *mgr; + + if (event_mgr) + return PJ_SUCCESS; + + mgr = malloc(sizeof(event_manager)); + if (!mgr) return PJ_ENOMEM; + + mgr->lock = [[NSLock alloc]init]; + pj_list_init(&mgr->event_list); + pj_list_init(&mgr->free_event_list); + + event_mgr = mgr; + pj_atexit(&event_manager_destroy); + + return PJ_SUCCESS; +} + +/* Post event to the event manager. If the event is posted + * synchronously, the function will wait until the event is processed. + */ +static pj_status_t event_manager_post_event(pj_ssl_sock_t *ssock, + event_t *event_item, + pj_bool_t async) +{ + event_manager *mgr = event_mgr; + event_t *event; + +#if SSL_DEBUG + if (!pj_thread_is_registered()) { + pj_bzero(queue_th_desc, sizeof(pj_thread_desc)); + pj_thread_register("sslq", queue_th_desc, &queue_th); + } + PJ_LOG(3, (THIS_FILE, "Posting event %p %d", ssock, event_item->type)); +#endif + + if (ssock->is_closing || !ssock->pool || !mgr) + return PJ_EGONE; + +#if SSL_DEBUG + PJ_LOG(3,(THIS_FILE, "Post event success %p %d",ssock, event_item->type)); +#endif + + [mgr->lock lock]; + + if (pj_list_empty(&mgr->free_event_list)) { + event = malloc(sizeof(event_t)); + } else { + event = mgr->free_event_list.next; + pj_list_erase(event); + } + + pj_memcpy(event, event_item, sizeof(event_t)); + event->ssock = ssock; + event->async = async; + pj_list_push_back(&mgr->event_list, event); + + [mgr->lock unlock]; + + if (!async) { + dispatch_semaphore_wait(((applessl_sock_t *)ssock)->ev_semaphore, + DISPATCH_TIME_FOREVER); + } + + return PJ_SUCCESS; +} + +/* Remove all events associated with the socket. */ +static void event_manager_remove_events(pj_ssl_sock_t *ssock) +{ + event_t *event; + + [event_mgr->lock lock]; + event = event_mgr->event_list.next; + while (event != &event_mgr->event_list) { + event_t *event_ = event; + + event = event->next; + if (event_->ssock == ssock) { + pj_list_erase(event_); + /* If not async, signal the waiting socket */ + if (!event_->async) { + applessl_sock_t * assock; + assock = (applessl_sock_t *)event_->ssock; + dispatch_semaphore_signal(assock->ev_semaphore); + } + } + } + [event_mgr->lock unlock]; +} + +pj_status_t ssl_network_event_poll() +{ + if (!event_mgr) + return PJ_SUCCESS; + + while (!pj_list_empty(&event_mgr->event_list)) { + pj_ssl_sock_t *ssock; + applessl_sock_t * assock; + event_t *event; + pj_bool_t ret = PJ_TRUE, add_ref = PJ_FALSE; + + [event_mgr->lock lock]; + /* Check again, this time by holding the lock */ + if (pj_list_empty(&event_mgr->event_list)) { + [event_mgr->lock unlock]; + break; + } + event = event_mgr->event_list.next; + ssock = event->ssock; + assock = (applessl_sock_t *)ssock; + pj_list_erase(event); + + if (ssock->is_closing || !ssock->pool || + (!ssock->is_server && !assock->connection) || + (ssock->is_server && !assock->listener)) + { + PJ_LOG(3, (THIS_FILE, "Warning: Discarding SSL event type %d of " + "a closing socket %p", event->type, ssock)); + event->type = EVENT_DISCARD; + } else if (ssock->param.grp_lock) { + if (pj_grp_lock_get_ref(ssock->param.grp_lock) > 0) { + /* Prevent ssock from being destroyed while + * we are calling the callback. + */ + add_ref = PJ_TRUE; + pj_grp_lock_add_ref(ssock->param.grp_lock); + } else { + PJ_LOG(3, (THIS_FILE, "Warning: Discarding SSL event type %d " + " of a destroyed socket %p", event->type, ssock)); + event->type = EVENT_DISCARD; + } + } + + [event_mgr->lock unlock]; + + switch (event->type) { + case EVENT_ACCEPT: + ret = ssock_on_accept_complete(event->ssock, + PJ_INVALID_SOCKET, + event->body.accept_ev.newconn, + &event->body.accept_ev.src_addr, + event->body.accept_ev.src_addr_len, + event->body.accept_ev.status); + break; + case EVENT_CONNECT: + ret = ssock_on_connect_complete(event->ssock, + event->body.connect_ev.status); + break; + case EVENT_VERIFY_CERT: + verify_cert(assock, event->ssock->cert); + break; + case EVENT_HANDSHAKE_COMPLETE: + event->ssock->ssl_state = SSL_STATE_ESTABLISHED; + ret = on_handshake_complete(event->ssock, + event->body.handshake_ev.status); + break; + case EVENT_DATA_SENT: + ret = ssock_on_data_sent(event->ssock, + event->body.data_sent_ev.send_key, + event->body.data_sent_ev.sent); + break; + case EVENT_DATA_READ: + ret = ssock_on_data_read(event->ssock, + event->body.data_read_ev.data, + event->body.data_read_ev.size, + event->body.data_read_ev.status, + &event->body.data_read_ev.remainder); + break; + default: + break; + } + + /* If not async and not destroyed, signal the waiting socket */ + if (event->type != EVENT_DISCARD && ret && !event->async && ret) { + dispatch_semaphore_signal(assock->ev_semaphore); + } + + /* Put the event into the free list to be reused */ + [event_mgr->lock lock]; + if (add_ref) { + pj_grp_lock_dec_ref(ssock->param.grp_lock); + } + pj_list_push_back(&event_mgr->free_event_list, event); + [event_mgr->lock unlock]; + } + + return 0; +} + +/* + ******************************************************************* + * Static/internal functions. + ******************************************************************* + */ + +#define PJ_SSL_ERRNO_START (PJ_ERRNO_START_USER + \ + PJ_ERRNO_SPACE_SIZE*6) + +#define PJ_SSL_ERRNO_SPACE_SIZE PJ_ERRNO_SPACE_SIZE + +/* Convert from Apple SSL error to pj_status_t. */ +static pj_status_t pj_status_from_err(applessl_sock_t *assock, + const char *msg, + OSStatus err) +{ + pj_status_t status = (pj_status_t)-err; + CFStringRef errmsg; + + errmsg = SecCopyErrorMessageString(err, NULL); + PJ_LOG(3, (THIS_FILE, "Apple SSL error %s [%d]: %s", + (msg? msg: ""), err, + CFStringGetCStringPtr(errmsg, kCFStringEncodingUTF8))); + CFRelease(errmsg); + + if (status > PJ_SSL_ERRNO_SPACE_SIZE) + status = PJ_SSL_ERRNO_SPACE_SIZE; + status += PJ_SSL_ERRNO_START; + + if (assock) + assock->base.last_err = err; + + return status; +} + +/* Read cert or key file */ +static pj_status_t create_data_from_file(CFDataRef *data, + pj_str_t *fname, pj_str_t *path) +{ + CFURLRef file; + CFReadStreamRef read_stream; + UInt8 data_buf[8192]; + CFIndex nbytes = 0; + + if (path) { + CFURLRef filepath; + CFStringRef path_str; + + path_str = CFStringCreateWithBytes(NULL, (const UInt8 *)path->ptr, + path->slen, + kCFStringEncodingUTF8, false); + if (!path_str) return PJ_ENOMEM; + + filepath = CFURLCreateWithFileSystemPath(NULL, path_str, + kCFURLPOSIXPathStyle, true); + CFRelease(path_str); + if (!filepath) return PJ_ENOMEM; + + path_str = CFStringCreateWithBytes(NULL, (const UInt8 *)fname->ptr, + fname->slen, + kCFStringEncodingUTF8, false); + if (!path_str) { + CFRelease(filepath); + return PJ_ENOMEM; + } + + file = CFURLCreateCopyAppendingPathComponent(NULL, filepath, + path_str, false); + CFRelease(path_str); + CFRelease(filepath); + } else { + file = CFURLCreateFromFileSystemRepresentation(NULL, + (const UInt8 *)fname->ptr, fname->slen, false); + } + + if (!file) + return PJ_ENOMEM; + + read_stream = CFReadStreamCreateWithFile(NULL, file); + CFRelease(file); + + if (!read_stream) + return PJ_ENOTFOUND; + + if (!CFReadStreamOpen(read_stream)) { + PJ_LOG(2, (THIS_FILE, "Failed opening file")); + CFRelease(read_stream); + return PJ_EINVAL; + } + + nbytes = CFReadStreamRead(read_stream, data_buf, + sizeof(data_buf)); + if (nbytes > 0) + *data = CFDataCreate(NULL, data_buf, nbytes); + else + *data = NULL; + + CFReadStreamClose(read_stream); + CFRelease(read_stream); + + return (*data? PJ_SUCCESS: PJ_EINVAL); +} + +static pj_status_t create_identity_from_cert(applessl_sock_t *assock, + pj_ssl_cert_t *cert, + sec_identity_t *p_identity) +{ + CFStringRef password = NULL; + CFDataRef cert_data = NULL; + void *keys[1] = {NULL}; + void *values[1] = {NULL}; + CFDictionaryRef options; + CFArrayRef items; + CFIndex i, count; + SecIdentityRef identity = NULL; + OSStatus err; + pj_status_t status; + + /* Init */ + *p_identity = NULL; + + if (cert->privkey_file.slen || cert->privkey_buf.slen || + cert->privkey_pass.slen) + { + PJ_LOG(5, (THIS_FILE, "Ignoring supplied private key. Private key " + "must be placed in the keychain instead.")); + } + + if (cert->cert_file.slen) { + status = create_data_from_file(&cert_data, &cert->cert_file, NULL); + if (status != PJ_SUCCESS) { + PJ_PERROR(2, (THIS_FILE, status, "Failed reading cert file")); + return status; + } + } else if (cert->cert_buf.slen) { + cert_data = CFDataCreate(NULL, (const UInt8 *)cert->cert_buf.ptr, + cert->cert_buf.slen); + if (!cert_data) + return PJ_ENOMEM; + } + + if (cert_data) { + if (cert->privkey_pass.slen) { + password = CFStringCreateWithBytes(NULL, + (const UInt8 *)cert->privkey_pass.ptr, + cert->privkey_pass.slen, + kCFStringEncodingUTF8, + false); + keys[0] = (void *)kSecImportExportPassphrase; + values[0] = (void *)password; + } + + options = CFDictionaryCreate(NULL, (const void **)keys, + (const void **)values, + (password? 1: 0), NULL, NULL); + if (!options) + return PJ_ENOMEM; + +#if TARGET_OS_IPHONE + err = SecPKCS12Import(cert_data, options, &items); +#else + { + SecExternalFormat ext_format[3] = {kSecFormatPKCS12, + kSecFormatPEMSequence, + kSecFormatX509Cert/* DER */}; + SecExternalItemType ext_type = kSecItemTypeCertificate; + SecItemImportExportKeyParameters key_params; + + pj_bzero(&key_params, sizeof(key_params)); + key_params.version = SEC_KEY_IMPORT_EXPORT_PARAMS_VERSION; + key_params.passphrase = password; + + for (i = 0; i < PJ_ARRAY_SIZE(ext_format); i++) { + items = NULL; + err = SecItemImport(cert_data, NULL, &ext_format[i], + &ext_type, 0, &key_params, NULL, &items); + if (err == noErr && items) { + break; + } + } + } +#endif + + CFRelease(options); + if (password) + CFRelease(password); + CFRelease(cert_data); + if (err != noErr || !items) { + return pj_status_from_err(assock, "SecItemImport", err); + } + + count = CFArrayGetCount(items); + + for (i = 0; i < count; i++) { + CFTypeRef item; + CFTypeID item_id; + + item = (CFTypeRef) CFArrayGetValueAtIndex(items, i); + item_id = CFGetTypeID(item); + + if (item_id == CFDictionaryGetTypeID()) { + identity = (SecIdentityRef) + CFDictionaryGetValue((CFDictionaryRef) item, + kSecImportItemIdentity); + break; + } +#if !TARGET_OS_IPHONE + else if (item_id == SecCertificateGetTypeID()) { + err = SecIdentityCreateWithCertificate(NULL, + (SecCertificateRef) item, &identity); + if (err != noErr) { + pj_status_from_err(assock, "SecIdentityCreate", err); + if (err == errSecItemNotFound) { + PJ_LOG(2, (THIS_FILE, "Private key must be placed in " + "the keychain")); + } + } else { + break; + } + } +#endif + } + + CFRelease(items); + + if (!identity) { + PJ_LOG(2, (THIS_FILE, "Failed extracting identity from " + "the cert file")); + return PJ_EINVAL; + } + + *p_identity = sec_identity_create(identity); + + CFRelease(identity); + } + + return PJ_SUCCESS; +} + +static pj_status_t verify_cert(applessl_sock_t *assock, pj_ssl_cert_t *cert) +{ + CFDataRef ca_data = NULL; + SecTrustRef trust = assock->trust; + bool result; + CFErrorRef error; + pj_status_t status = PJ_SUCCESS; + OSStatus err = noErr; + + if (trust && cert && cert->CA_file.slen) { + status = create_data_from_file(&ca_data, &cert->CA_file, + (cert->CA_path.slen? &cert->CA_path: + NULL)); + if (status != PJ_SUCCESS) + PJ_LOG(2, (THIS_FILE, "Failed reading CA file")); + } else if (trust && cert && cert->CA_buf.slen) { + ca_data = CFDataCreate(NULL, (const UInt8 *)cert->CA_buf.ptr, + cert->CA_buf.slen); + if (!ca_data) + PJ_LOG(2, (THIS_FILE, "Not enough memory for CA buffer")); + } + + if (ca_data) { + SecCertificateRef ca_cert; + CFMutableArrayRef ca_array; + + ca_cert = SecCertificateCreateWithData(NULL, ca_data); + CFRelease(ca_data); + if (!ca_cert) { + PJ_LOG(2, (THIS_FILE, "Failed creating certificate from " + "CA file/buffer. It has to be " + "in DER format.")); + status = PJ_EINVAL; + goto on_return; + } + + ca_array = CFArrayCreateMutable(NULL, 0, &kCFTypeArrayCallBacks); + if (!ca_array) { + PJ_LOG(2, (THIS_FILE, "Not enough memory for CA array")); + CFRelease(ca_cert); + status = PJ_ENOMEM; + goto on_return; + } + + CFArrayAppendValue(ca_array, ca_cert); + CFRelease(ca_cert); + + err = SecTrustSetAnchorCertificates(trust, ca_array); + CFRelease(ca_array); + if (err != noErr) + pj_status_from_err(assock, "SetAnchorCerts", err); + + err = SecTrustSetAnchorCertificatesOnly(trust, true); + if (err != noErr) + pj_status_from_err(assock, "SetAnchorCertsOnly", err); + } + + result = SecTrustEvaluateWithError(trust, &error); + if (!result) { + pj_ssl_sock_t *ssock = &assock->base; + SecTrustResultType trust_result; + + err = SecTrustGetTrustResult(trust, &trust_result); + if (err == noErr) { + switch (trust_result) { + case kSecTrustResultInvalid: + ssock->verify_status |= PJ_SSL_CERT_EINVALID_FORMAT; + break; + + case kSecTrustResultDeny: + case kSecTrustResultFatalTrustFailure: + ssock->verify_status |= PJ_SSL_CERT_EUNTRUSTED; + break; + + case kSecTrustResultRecoverableTrustFailure: + /* Doc: "If you receive this result, you can retry + * after changing settings. For example, if trust is + * denied because the certificate has expired, ..." + * But this error can also mean another (recoverable) + * failure, though. + */ + ssock->verify_status |= PJ_SSL_CERT_EVALIDITY_PERIOD; + break; + + case kSecTrustResultOtherError: + ssock->verify_status |= PJ_SSL_CERT_EUNKNOWN; + break; + + default: + break; + } + } + + if (error) + CFRelease(error); + + /* Evaluation failed */ + status = PJ_EEOF; + } + +on_return: + if (status != PJ_SUCCESS && assock->base.verify_status == 0) + assock->base.verify_status |= PJ_SSL_CERT_EUNKNOWN; + + return status; +} + + +/* + ******************************************************************* + * Network functions. + ******************************************************************* + */ + +/* Send data. */ +static pj_status_t network_send(pj_ssl_sock_t *ssock, + pj_ioqueue_op_key_t *send_key, + const void *data, + pj_ssize_t *size, + unsigned flags) +{ + applessl_sock_t *assock = (applessl_sock_t *)ssock; + dispatch_data_t content; + + if (!assock->connection) + return PJ_EGONE; + + content = dispatch_data_create(data, *size, assock->queue, + DISPATCH_DATA_DESTRUCTOR_DEFAULT); + if (!content) + return PJ_ENOMEM; + + nw_connection_send(assock->connection, content, + NW_CONNECTION_DEFAULT_MESSAGE_CONTEXT, true, + ^(nw_error_t error) + { + event_t event; + + if (error != NULL) { + errno = nw_error_get_error_code(error); + if (errno == 89) { + /* Error 89 is network cancelled, not a send error. */ + return; + } else { + warn("Send error"); + } + } + + event.type = EVENT_DATA_SENT; + event.body.data_sent_ev.send_key = send_key; + if (error != NULL) { + event.body.data_sent_ev.sent = (errno > 0)? -errno: errno; + } else { + event.body.data_sent_ev.sent = dispatch_data_get_size(content); + } + + event_manager_post_event(ssock, &event, PJ_TRUE); + }); + dispatch_release(content); + + return PJ_EPENDING; +} + +static pj_status_t network_start_read(pj_ssl_sock_t *ssock, + unsigned async_count, + unsigned buff_size, + void *readbuf[], + pj_uint32_t flags) +{ + applessl_sock_t *assock = (applessl_sock_t *)ssock; + unsigned i; + + if (!assock->connection) + return PJ_EGONE; + + for (i = 0; i < async_count; i++) { + nw_connection_receive(assock->connection, 1, buff_size, + ^(dispatch_data_t content, nw_content_context_t context, + bool is_complete, nw_error_t error) + { + pj_status_t status = PJ_SUCCESS; + + /* If the context is marked as complete, and is the final context, + * we're read-closed. + */ + if (is_complete && + (context == NULL || nw_content_context_get_is_final(context))) + { + return; + } + + if (error != NULL) { + errno = nw_error_get_error_code(error); + if (errno == 89) { + /* Since error 89 is network intentionally cancelled by + * us, we immediately return. + */ + return; + } else { + warn("Read error, stopping further receives"); + status = PJ_EEOF; + } + } + + dispatch_block_t schedule_next_receive = + ^{ + /* If there was no error in receiving, request more data. */ + if (!error && !is_complete && assock->connection) { + network_start_read(ssock, async_count, buff_size, + readbuf, flags); + } + }; + + if (content) { + dispatch_data_apply(content, + ^(dispatch_data_t region, size_t offset, + const void *buffer, size_t inSize) + { + /* This block can be invoked multiple times, + * each for every contiguous memory region in the content. + */ + event_t event; + + memcpy(ssock->asock_rbuf[i], buffer, inSize); + + event.type = EVENT_DATA_READ; + event.body.data_read_ev.data = ssock->asock_rbuf[i]; + event.body.data_read_ev.size = inSize; + event.body.data_read_ev.status = status; + event.body.data_read_ev.remainder = 0; + + event_manager_post_event(ssock, &event, PJ_FALSE); + + return (bool)true; + }); + + schedule_next_receive(); + + } else { + if (status != PJ_SUCCESS) { + event_t event; + + /* Report read error to application */ + event.type = EVENT_DATA_READ; + event.body.data_read_ev.data = NULL; + event.body.data_read_ev.size = 0; + event.body.data_read_ev.status = status; + event.body.data_read_ev.remainder = 0; + + event_manager_post_event(ssock, &event, PJ_TRUE); + } + + schedule_next_receive(); + } + }); + } + + return PJ_SUCCESS; +} + +/* Get address of local endpoint */ +static pj_status_t network_get_localaddr(pj_ssl_sock_t *ssock, + pj_sockaddr_t *addr, + int *namelen) +{ + applessl_sock_t *assock = (applessl_sock_t *)ssock; + nw_path_t path; + nw_endpoint_t endpoint; + const struct sockaddr *address; + + path = nw_connection_copy_current_path(assock->connection); + if (!path) + return PJ_EINVALIDOP; + + endpoint = nw_path_copy_effective_local_endpoint(path); + nw_release(path); + if (!endpoint) + return PJ_EINVALIDOP; + + address = nw_endpoint_get_address(endpoint); + if (address) { + pj_sockaddr_cp(addr, address); + *namelen = pj_sockaddr_get_addr_len(addr); + } + nw_release(endpoint); + + return PJ_SUCCESS; +} + +static pj_status_t network_create_params(pj_ssl_sock_t * ssock, + const pj_sockaddr_t *localaddr, + pj_uint16_t port_range, + nw_parameters_t *p_params) +{ + applessl_sock_t *assock = (applessl_sock_t *)ssock; + char ip_addr[PJ_INET6_ADDRSTRLEN]; + unsigned port; + char port_str[PJ_INET6_ADDRSTRLEN]; + nw_endpoint_t local_endpoint; + nw_parameters_t parameters; + nw_parameters_configure_protocol_block_t configure_tls; + nw_protocol_stack_t protocol_stack; + nw_protocol_options_t ip_options; + tls_protocol_version_t min_proto = tls_protocol_version_TLSv10; + tls_protocol_version_t max_proto = tls_protocol_version_TLSv13; + + /* Set min and max protocol version */ + if (ssock->param.proto == PJ_SSL_SOCK_PROTO_DEFAULT) { + ssock->param.proto = PJ_SSL_SOCK_PROTO_TLS1 | + PJ_SSL_SOCK_PROTO_TLS1_1 | + PJ_SSL_SOCK_PROTO_TLS1_2 | + PJ_SSL_SOCK_PROTO_TLS1_3; + } + + if (ssock->param.proto & PJ_SSL_SOCK_PROTO_TLS1_3) { + max_proto = tls_protocol_version_TLSv13; + } else if (ssock->param.proto & PJ_SSL_SOCK_PROTO_TLS1_2) { + max_proto = tls_protocol_version_TLSv12; + } else if (ssock->param.proto & PJ_SSL_SOCK_PROTO_TLS1_1) { + max_proto = tls_protocol_version_TLSv11; + } else if (ssock->param.proto & PJ_SSL_SOCK_PROTO_TLS1) { + max_proto = tls_protocol_version_TLSv10; + } else { + PJ_LOG(3, (THIS_FILE, "Unsupported TLS protocol")); + return PJ_EINVAL; + } + + if (ssock->param.proto & PJ_SSL_SOCK_PROTO_TLS1) { + min_proto = tls_protocol_version_TLSv10; + } else if (ssock->param.proto & PJ_SSL_SOCK_PROTO_TLS1_1) { + min_proto = tls_protocol_version_TLSv11; + } else if (ssock->param.proto & PJ_SSL_SOCK_PROTO_TLS1_2) { + min_proto = tls_protocol_version_TLSv12; + } else if (ssock->param.proto & PJ_SSL_SOCK_PROTO_TLS1_3) { + min_proto = tls_protocol_version_TLSv13; + } + + /* Set certificate */ + if (ssock->cert) { + pj_status_t status = create_identity_from_cert(assock, ssock->cert, + &assock->identity); + if (status != PJ_SUCCESS) + return status; + } + + configure_tls = ^(nw_protocol_options_t tls_options) + { + sec_protocol_options_t sec_options; + + sec_options = nw_tls_copy_sec_protocol_options(tls_options); + + /* Set identity */ + if (ssock->cert && assock->identity) { + sec_protocol_options_set_local_identity(sec_options, + assock->identity); + } + + sec_protocol_options_set_min_tls_protocol_version(sec_options, + min_proto); + sec_protocol_options_set_max_tls_protocol_version(sec_options, + max_proto); + + /* Set cipher list */ + if (ssock->param.ciphers_num > 0) { + unsigned i; + for (i = 0; i < ssock->param.ciphers_num; i++) { + sec_protocol_options_append_tls_ciphersuite(sec_options, + (tls_ciphersuite_t)ssock->param.ciphers[i]); + } + } + + if (!ssock->is_server && ssock->param.server_name.slen) { + sec_protocol_options_set_tls_server_name(sec_options, + ssock->param.server_name.ptr); + } + + sec_protocol_options_set_tls_renegotiation_enabled(sec_options, + true); + /* This must be disabled, otherwise server may think this is + * a resumption of a previously closed connection, and our + * verify block may never be invoked! + */ + sec_protocol_options_set_tls_resumption_enabled(sec_options, false); + + /* SSL verification options */ + sec_protocol_options_set_peer_authentication_required(sec_options, + true); + + /* Handshake flow: + * 1. Server's challenge block, provide server's trust + * 2. Client's verify block, to verify server's trust + * 3. Client's challenge block, provide client's trust + * 4. Only if client's trust is not NULL, server's verify block, + * to verify client's trust. + */ + sec_protocol_options_set_challenge_block(sec_options, + ^(sec_protocol_metadata_t metadata, + sec_protocol_challenge_complete_t complete) + { + complete(assock->identity); + }, assock->queue); + + sec_protocol_options_set_verify_block(sec_options, + ^(sec_protocol_metadata_t metadata, sec_trust_t trust_ref, + sec_protocol_verify_complete_t complete) + { + event_t event; + pj_status_t status; + bool result = true; + + assock->trust = trust_ref? sec_trust_copy_ref(trust_ref): nil; + + assock->cipher = + sec_protocol_metadata_get_negotiated_tls_ciphersuite(metadata); + + /* For client, call on_connect_complete() callback first. */ + if (!ssock->is_server) { + if (!assock->connection) + complete(false); + + event.type = EVENT_CONNECT; + event.body.connect_ev.status = PJ_SUCCESS; + status = event_manager_post_event(ssock, &event, PJ_FALSE); + if (status == PJ_EGONE) + complete(false); + } + + event.type = EVENT_VERIFY_CERT; + status = event_manager_post_event(ssock, &event, PJ_FALSE); + if (status == PJ_EGONE) + complete(false); + + /* Check the result of cert verification. */ + if (ssock->verify_status != PJ_SSL_CERT_ESUCCESS) { + if (ssock->param.verify_peer) { + /* Verification failed. */ + result = false; + } else { + /* When verification is not requested just return ok here, + * however application can still get the verification status. + */ + result = true; + } + } + + complete(result); + }, assock->queue); + + nw_release(sec_options); + }; + + parameters = nw_parameters_create_secure_tcp(configure_tls, + NW_PARAMETERS_DEFAULT_CONFIGURATION); + + protocol_stack = nw_parameters_copy_default_protocol_stack(parameters); + ip_options = nw_protocol_stack_copy_internet_protocol(protocol_stack); + if (ssock->param.sock_af == pj_AF_INET()) { + nw_ip_options_set_version(ip_options, nw_ip_version_4); + } else if (ssock->param.sock_af == pj_AF_INET6()) { + nw_ip_options_set_version(ip_options, nw_ip_version_6); + } + nw_release(ip_options); + nw_release(protocol_stack); + + if (ssock->is_server && ssock->param.reuse_addr) { + nw_parameters_set_reuse_local_address(parameters, true); + } + + /* Create local endpoint. + * Currently we ignore QoS and socket options. + */ + pj_sockaddr_print(localaddr, ip_addr,sizeof(ip_addr),0); + + if (port_range) { + pj_uint16_t max_try = MAX_BIND_RETRY; + + if (port_range && port_range < max_try) { + max_try = port_range; + } + for (; max_try; --max_try) { + pj_uint16_t base_port; + + base_port = pj_sockaddr_get_port(localaddr); + port = (pj_uint16_t)(base_port + pj_rand() % (port_range + 1)); + pj_utoa(port, port_str); + + local_endpoint = nw_endpoint_create_host(ip_addr, port_str); + if (local_endpoint) + break; + } + } else { + port = pj_sockaddr_get_port(localaddr); + pj_utoa(port, port_str); + + local_endpoint = nw_endpoint_create_host(ip_addr, port_str); + } + + if (!local_endpoint) { + PJ_LOG(2, (THIS_FILE, "Failed creating local endpoint")); + return PJ_EINVALIDOP; + } + + nw_parameters_set_local_endpoint(parameters, local_endpoint); + nw_release(local_endpoint); + + *p_params = parameters; + return PJ_SUCCESS; +} + +/* Setup assock's connection state callback and start the connection */ +static pj_status_t network_setup_connection(pj_ssl_sock_t *ssock, + void *connection) +{ + applessl_sock_t *assock = (applessl_sock_t *)ssock; + assock->connection = (nw_connection_t)connection; + pj_status_t status; + + /* Initialize input circular buffer */ + status = circ_init(ssock->pool->factory, &ssock->circ_buf_input, 8192); + if (status != PJ_SUCCESS) + return status; + + /* Initialize output circular buffer */ + status = circ_init(ssock->pool->factory, &ssock->circ_buf_output, 8192); + if (status != PJ_SUCCESS) + return status; + + nw_connection_set_queue(assock->connection, assock->queue); + + assock->con_state = nw_connection_state_invalid; + nw_connection_set_state_changed_handler(assock->connection, + ^(nw_connection_state_t state, nw_error_t error) + { + pj_status_t status = PJ_SUCCESS; + pj_bool_t call_cb = PJ_FALSE; +#if SSL_DEBUG + if (!pj_thread_is_registered()) { + pj_bzero(queue_th_desc, sizeof(pj_thread_desc)); + pj_thread_register("sslq", queue_th_desc, &queue_th); + } + PJ_LOG(3, (THIS_FILE, "SSL state change %p %d", assock, state)); +#endif + + if (error && state != nw_connection_state_cancelled) { + errno = nw_error_get_error_code(error); + warn("Connection failed %p", assock); + status = PJ_STATUS_FROM_OS(errno); +#if SSL_DEBUG + PJ_LOG(3, (THIS_FILE, "SSL state and errno %d %d", state, errno)); +#endif + call_cb = PJ_TRUE; + } + + if (state == nw_connection_state_ready) { + if (ssock->is_server) { + nw_protocol_definition_t tls_def; + nw_protocol_metadata_t prot_meta; + sec_protocol_metadata_t meta; + + tls_def = nw_protocol_copy_tls_definition(); + prot_meta = nw_connection_copy_protocol_metadata(connection, + tls_def); + meta = nw_tls_copy_sec_protocol_metadata(prot_meta); + assock->cipher = + sec_protocol_metadata_get_negotiated_tls_ciphersuite(meta); + + if (ssock->param.require_client_cert && + !sec_protocol_metadata_access_peer_certificate_chain( + meta, ^(sec_certificate_t certificate) {} )) + { + status = PJ_EEOF; + } + nw_release(tls_def); + nw_release(prot_meta); + nw_release(meta); + } + call_cb = PJ_TRUE; + } else if (state == nw_connection_state_cancelled) { + /* We release the reference in ssl_destroy() */ + // nw_release(assock->connection); + // assock->connection = nil; + } + + if (call_cb) { + event_t event; + + event.type = EVENT_HANDSHAKE_COMPLETE; + event.body.handshake_ev.status = status; + event_manager_post_event(ssock, &event, PJ_TRUE); + + if (ssock->is_server && status == PJ_SUCCESS) { + status = network_start_read(ssock, ssock->param.async_cnt, + (unsigned)ssock->param.read_buffer_size, + ssock->asock_rbuf, 0); + } + } + + assock->con_state = state; + }); + + nw_connection_start(assock->connection); + + return PJ_SUCCESS; +} + +static pj_status_t network_start_accept(pj_ssl_sock_t *ssock, + pj_pool_t *pool, + const pj_sockaddr_t *localaddr, + int addr_len, + const pj_ssl_sock_param *newsock_param) +{ + applessl_sock_t *assock = (applessl_sock_t *)ssock; + pj_status_t status; + nw_parameters_t parameters = NULL; + + status = network_create_params(ssock, localaddr, 0, ¶meters); + if (status != PJ_SUCCESS) + return status; + + /* Create listener */ + assock->listener = nw_listener_create(parameters); + nw_release(parameters); + if (!assock->listener) { + PJ_LOG(2, (THIS_FILE, "Failed creating listener")); + return PJ_EINVALIDOP; + } + + nw_listener_set_queue(assock->listener, assock->queue); + /* Hold a reference until cancelled */ + nw_retain(assock->listener); + + assock->lis_state = nw_listener_state_invalid; + nw_listener_set_state_changed_handler(assock->listener, + ^(nw_listener_state_t state, nw_error_t error) + { + errno = error ? nw_error_get_error_code(error) : 0; + + if (state == nw_listener_state_failed) { + warn("listener failed\n"); + pj_sockaddr_set_port(&ssock->local_addr, 0); + dispatch_semaphore_signal(assock->ev_semaphore); + } else if (state == nw_listener_state_ready) { + /* Update local port */ + pj_sockaddr_set_port(&ssock->local_addr, + nw_listener_get_port(assock->listener)); + dispatch_semaphore_signal(assock->ev_semaphore); + } else if (state == nw_listener_state_cancelled) { + /* We release the reference in ssl_destroy() */ + // nw_release(assock->listener); + // assock->listener = nil; + } + assock->lis_state = state; + }); + + nw_listener_set_new_connection_handler(assock->listener, + ^(nw_connection_t connection) + { + nw_endpoint_t endpoint = nw_connection_copy_endpoint(connection); + const struct sockaddr *address; + event_t event; + + address = nw_endpoint_get_address(endpoint); + + event.type = EVENT_ACCEPT; + event.body.accept_ev.newconn = connection; + pj_sockaddr_cp(&event.body.accept_ev.src_addr, address); + event.body.accept_ev.src_addr_len = pj_sockaddr_get_addr_len(address); + event.body.accept_ev.status = PJ_SUCCESS; + + nw_retain(connection); + event_manager_post_event(ssock, &event, PJ_TRUE); + + nw_release(endpoint); + }); + + /* Update local address */ + ssock->addr_len = addr_len; + pj_sockaddr_cp(&ssock->local_addr, localaddr); + + /* Start accepting */ + pj_ssl_sock_param_copy(pool, &ssock->newsock_param, newsock_param); + ssock->newsock_param.grp_lock = NULL; + + /* Start listening to the address */ + nw_listener_start(assock->listener); + /* Wait until it's ready */ + dispatch_semaphore_wait(assock->ev_semaphore, DISPATCH_TIME_FOREVER); + + if (pj_sockaddr_get_port(&ssock->local_addr) == 0) { + /* Failed. */ + status = PJ_EEOF; + goto on_error; + } + + return PJ_SUCCESS; + +on_error: + ssl_reset_sock_state(ssock); + return status; +} + + +static pj_status_t network_start_connect(pj_ssl_sock_t *ssock, + pj_ssl_start_connect_param *connect_param) +{ + char ip_addr[PJ_INET6_ADDRSTRLEN]; + unsigned port; + char port_str[PJ_INET6_ADDRSTRLEN]; + nw_endpoint_t endpoint; + nw_parameters_t parameters; + nw_connection_t connection; + pj_status_t status; + + pj_pool_t *pool = connect_param->pool; + const pj_sockaddr_t *localaddr = connect_param->localaddr; + pj_uint16_t port_range = connect_param->local_port_range; + const pj_sockaddr_t *remaddr = connect_param->remaddr; + int addr_len = connect_param->addr_len; + + PJ_ASSERT_RETURN(ssock && pool && localaddr && remaddr && addr_len, + PJ_EINVAL); + + status = network_create_params(ssock, localaddr, port_range, + ¶meters); + if (status != PJ_SUCCESS) + return status; + + /* Create remote endpoint */ + pj_sockaddr_print(remaddr, ip_addr,sizeof(ip_addr),0); + port = pj_sockaddr_get_port(remaddr); + pj_utoa(port, port_str); + + endpoint = nw_endpoint_create_host(ip_addr, port_str); + if (!endpoint) { + PJ_LOG(2, (THIS_FILE, "Failed creating remote endpoint")); + nw_release(parameters); + return PJ_EINVALIDOP; + } + + connection = nw_connection_create(endpoint, parameters); + nw_release(endpoint); + nw_release(parameters); + if (!connection) { + PJ_LOG(2, (THIS_FILE, "Failed creating connection")); + return PJ_EINVALIDOP; + } + + /* Hold a reference until cancelled */ + nw_retain(connection); + + status = network_setup_connection(ssock, connection); + if (status != PJ_SUCCESS) + return status; + + /* Save remote address */ + pj_sockaddr_cp(&ssock->rem_addr, remaddr); + + /* Update local address */ + ssock->addr_len = addr_len; + pj_sockaddr_cp(&ssock->local_addr, localaddr); + + return PJ_EPENDING; +} + + +/* + ******************************************************************* + * SSL functions. + ******************************************************************* + */ + +static pj_ssl_sock_t *ssl_alloc(pj_pool_t *pool) +{ + applessl_sock_t *assock; + + /* Create event manager */ + if (event_manager_create() != PJ_SUCCESS) + return NULL; + + assock = PJ_POOL_ZALLOC_T(pool, applessl_sock_t); + + assock->queue = dispatch_queue_create("ssl_queue", DISPATCH_QUEUE_SERIAL); + assock->ev_semaphore = dispatch_semaphore_create(0); + if (!assock->queue || !assock->ev_semaphore) { + ssl_destroy(&assock->base); + return NULL; + } + + return (pj_ssl_sock_t *)assock; +} + +static pj_status_t ssl_create(pj_ssl_sock_t *ssock) +{ + /* Nothing to do here. SSL has been configured before connection + * is started. + */ + return PJ_SUCCESS; +} + +static void close_connection(applessl_sock_t *assock) +{ + if (assock->connection) { + unsigned i; + nw_connection_t conn = assock->connection; + + assock->connection = nil; + nw_connection_force_cancel(conn); + nw_release(conn); + + /* We need to wait until the connection is at cancelled state, + * otherwise events will still be delivered even though we + * already force cancel and release the connection. + */ + for (i = 0; i < 40; i++) { + if (assock->con_state == nw_connection_state_cancelled) break; + pj_thread_sleep(50); + } + + event_manager_remove_events(&assock->base); + + if (assock->con_state != nw_connection_state_cancelled) { + PJ_LOG(3, (THIS_FILE, "Warning: Failed to cancel SSL connection " + "%p %d", assock, assock->con_state)); + } + +#if SSL_DEBUG + PJ_LOG(3, (THIS_FILE, "SSL connection %p closed", assock)); +#endif + + } +} + +/* Close sockets */ +static void ssl_close_sockets(pj_ssl_sock_t *ssock) +{ + applessl_sock_t *assock = (applessl_sock_t *)ssock; + + if (assock->identity) { + nw_release(assock->identity); + assock->identity = nil; + } + + if (assock->trust) { + nw_release(assock->trust); + assock->trust = nil; + } + + /* This can happen when pj_ssl_sock_create() fails. */ + if (!ssock->write_mutex) + return; + + pj_lock_acquire(ssock->write_mutex); + close_connection(assock); + pj_lock_release(ssock->write_mutex); +} + +/* Destroy Apple SSL. */ +static void ssl_destroy(pj_ssl_sock_t *ssock) +{ + applessl_sock_t *assock = (applessl_sock_t *)ssock; + + close_connection(assock); + + if (assock->listener) { + unsigned i; + + nw_listener_set_new_connection_handler(assock->listener, nil); + nw_listener_cancel(assock->listener); + + for (i = 0; i < 20; i++) { + if (assock->lis_state == nw_listener_state_cancelled) break; + pj_thread_sleep(50); + } + if (assock->lis_state != nw_listener_state_cancelled) { + PJ_LOG(3, (THIS_FILE, "Warning: Failed to cancel SSL listener " + "%p %d", assock, assock->lis_state)); + } + nw_release(assock->listener); + assock->listener = nil; + } + + event_manager_remove_events(ssock); + + /* Important: if we are called from a blocking dispatch block, + * we need to signal it before destroying ourselves. + */ + if (assock->ev_semaphore) { + dispatch_semaphore_signal(assock->ev_semaphore); + } + + if (assock->queue) { + dispatch_release(assock->queue); + assock->queue = NULL; + } + + if (assock->ev_semaphore) { + dispatch_release(assock->ev_semaphore); + assock->ev_semaphore = nil; + } + + /* Destroy circular buffers */ + circ_deinit(&ssock->circ_buf_input); + circ_deinit(&ssock->circ_buf_output); + + PJ_LOG(4, (THIS_FILE, "SSL %p destroyed", ssock)); +} + + +/* Reset socket state. */ +static void ssl_reset_sock_state(pj_ssl_sock_t *ssock) +{ + pj_lock_acquire(ssock->circ_buf_output_mutex); + ssock->ssl_state = SSL_STATE_NULL; + pj_lock_release(ssock->circ_buf_output_mutex); + +#if SSL_DEBUG + PJ_LOG(3, (THIS_FILE, "SSL reset sock state %p", ssock)); +#endif + + ssl_close_sockets(ssock); +} + + +/* This function is taken from Apple's sslAppUtils.cpp (version 58286.41.2), + * with some modifications. + */ +const char *sslGetCipherSuiteString(SSLCipherSuite cs) +{ + switch (cs) { + /* TLS addenda using AES-CBC, RFC 3268 */ + case TLS_RSA_WITH_AES_128_CBC_SHA: + return "TLS_RSA_WITH_AES_128_CBC_SHA"; + case TLS_DH_DSS_WITH_AES_128_CBC_SHA: + return "TLS_DH_DSS_WITH_AES_128_CBC_SHA"; + case TLS_DH_RSA_WITH_AES_128_CBC_SHA: + return "TLS_DH_RSA_WITH_AES_128_CBC_SHA"; + case TLS_DHE_DSS_WITH_AES_128_CBC_SHA: + return "TLS_DHE_DSS_WITH_AES_128_CBC_SHA"; + case TLS_DHE_RSA_WITH_AES_128_CBC_SHA: + return "TLS_DHE_RSA_WITH_AES_128_CBC_SHA"; + case TLS_DH_anon_WITH_AES_128_CBC_SHA: + return "TLS_DH_anon_WITH_AES_128_CBC_SHA"; + case TLS_RSA_WITH_AES_256_CBC_SHA: + return "TLS_RSA_WITH_AES_256_CBC_SHA"; + case TLS_DH_DSS_WITH_AES_256_CBC_SHA: + return "TLS_DH_DSS_WITH_AES_256_CBC_SHA"; + case TLS_DH_RSA_WITH_AES_256_CBC_SHA: + return "TLS_DH_RSA_WITH_AES_256_CBC_SHA"; + case TLS_DHE_DSS_WITH_AES_256_CBC_SHA: + return "TLS_DHE_DSS_WITH_AES_256_CBC_SHA"; + case TLS_DHE_RSA_WITH_AES_256_CBC_SHA: + return "TLS_DHE_RSA_WITH_AES_256_CBC_SHA"; + case TLS_DH_anon_WITH_AES_256_CBC_SHA: + return "TLS_DH_anon_WITH_AES_256_CBC_SHA"; + + /* ECDSA addenda, RFC 4492 */ + case TLS_ECDH_ECDSA_WITH_NULL_SHA: + return "TLS_ECDH_ECDSA_WITH_NULL_SHA"; + case TLS_ECDH_ECDSA_WITH_RC4_128_SHA: + return "TLS_ECDH_ECDSA_WITH_RC4_128_SHA"; + case TLS_ECDH_ECDSA_WITH_3DES_EDE_CBC_SHA: + return "TLS_ECDH_ECDSA_WITH_3DES_EDE_CBC_SHA"; + case TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA: + return "TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA"; + case TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA: + return "TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA"; + case TLS_ECDHE_ECDSA_WITH_NULL_SHA: + return "TLS_ECDHE_ECDSA_WITH_NULL_SHA"; + case TLS_ECDHE_ECDSA_WITH_RC4_128_SHA: + return "TLS_ECDHE_ECDSA_WITH_RC4_128_SHA"; + case TLS_ECDHE_ECDSA_WITH_3DES_EDE_CBC_SHA: + return "TLS_ECDHE_ECDSA_WITH_3DES_EDE_CBC_SHA"; + case TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA: + return "TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA"; + case TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA: + return "TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA"; + case TLS_ECDH_RSA_WITH_NULL_SHA: + return "TLS_ECDH_RSA_WITH_NULL_SHA"; + case TLS_ECDH_RSA_WITH_RC4_128_SHA: + return "TLS_ECDH_RSA_WITH_RC4_128_SHA"; + case TLS_ECDH_RSA_WITH_3DES_EDE_CBC_SHA: + return "TLS_ECDH_RSA_WITH_3DES_EDE_CBC_SHA"; + case TLS_ECDH_RSA_WITH_AES_128_CBC_SHA: + return "TLS_ECDH_RSA_WITH_AES_128_CBC_SHA"; + case TLS_ECDH_RSA_WITH_AES_256_CBC_SHA: + return "TLS_ECDH_RSA_WITH_AES_256_CBC_SHA"; + case TLS_ECDHE_RSA_WITH_NULL_SHA: + return "TLS_ECDHE_RSA_WITH_NULL_SHA"; + case TLS_ECDHE_RSA_WITH_RC4_128_SHA: + return "TLS_ECDHE_RSA_WITH_RC4_128_SHA"; + case TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA: + return "TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA"; + case TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA: + return "TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA"; + case TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA: + return "TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA"; + case TLS_ECDH_anon_WITH_NULL_SHA: + return "TLS_ECDH_anon_WITH_NULL_SHA"; + case TLS_ECDH_anon_WITH_RC4_128_SHA: + return "TLS_ECDH_anon_WITH_RC4_128_SHA"; + case TLS_ECDH_anon_WITH_3DES_EDE_CBC_SHA: + return "TLS_ECDH_anon_WITH_3DES_EDE_CBC_SHA"; + case TLS_ECDH_anon_WITH_AES_128_CBC_SHA: + return "TLS_ECDH_anon_WITH_AES_128_CBC_SHA"; + case TLS_ECDH_anon_WITH_AES_256_CBC_SHA: + return "TLS_ECDH_anon_WITH_AES_256_CBC_SHA"; + + /* TLS 1.2 addenda, RFC 5246 */ + case TLS_RSA_WITH_AES_128_CBC_SHA256: + return "TLS_RSA_WITH_AES_128_CBC_SHA256"; + case TLS_RSA_WITH_AES_256_CBC_SHA256: + return "TLS_RSA_WITH_AES_256_CBC_SHA256"; + case TLS_DH_DSS_WITH_AES_128_CBC_SHA256: + return "TLS_DH_DSS_WITH_AES_128_CBC_SHA256"; + case TLS_DH_RSA_WITH_AES_128_CBC_SHA256: + return "TLS_DH_RSA_WITH_AES_128_CBC_SHA256"; + case TLS_DHE_DSS_WITH_AES_128_CBC_SHA256: + return "TLS_DHE_DSS_WITH_AES_128_CBC_SHA256"; + case TLS_DHE_RSA_WITH_AES_128_CBC_SHA256: + return "TLS_DHE_RSA_WITH_AES_128_CBC_SHA256"; + case TLS_DH_DSS_WITH_AES_256_CBC_SHA256: + return "TLS_DH_DSS_WITH_AES_256_CBC_SHA256"; + case TLS_DH_RSA_WITH_AES_256_CBC_SHA256: + return "TLS_DH_RSA_WITH_AES_256_CBC_SHA256"; + case TLS_DHE_DSS_WITH_AES_256_CBC_SHA256: + return "TLS_DHE_DSS_WITH_AES_256_CBC_SHA256"; + case TLS_DHE_RSA_WITH_AES_256_CBC_SHA256: + return "TLS_DHE_RSA_WITH_AES_256_CBC_SHA256"; + case TLS_DH_anon_WITH_AES_128_CBC_SHA256: + return "TLS_DH_anon_WITH_AES_128_CBC_SHA256"; + case TLS_DH_anon_WITH_AES_256_CBC_SHA256: + return "TLS_DH_anon_WITH_AES_256_CBC_SHA256"; + + /* TLS addenda using AES-GCM, RFC 5288 */ + case TLS_RSA_WITH_AES_128_GCM_SHA256: + return "TLS_RSA_WITH_AES_128_GCM_SHA256"; + case TLS_RSA_WITH_AES_256_GCM_SHA384: + return "TLS_DHE_RSA_WITH_AES_128_GCM_SHA256"; + case TLS_DHE_RSA_WITH_AES_128_GCM_SHA256: + return "TLS_DHE_RSA_WITH_AES_128_GCM_SHA256"; + case TLS_DHE_RSA_WITH_AES_256_GCM_SHA384: + return "TLS_DHE_RSA_WITH_AES_256_GCM_SHA384"; + case TLS_DH_RSA_WITH_AES_128_GCM_SHA256: + return "TLS_DH_RSA_WITH_AES_128_GCM_SHA256"; + case TLS_DH_RSA_WITH_AES_256_GCM_SHA384: + return "TLS_DH_RSA_WITH_AES_256_GCM_SHA384"; + case TLS_DHE_DSS_WITH_AES_128_GCM_SHA256: + return "TLS_DHE_DSS_WITH_AES_128_GCM_SHA256"; + case TLS_DHE_DSS_WITH_AES_256_GCM_SHA384: + return "TLS_DHE_DSS_WITH_AES_256_GCM_SHA384"; + case TLS_DH_DSS_WITH_AES_128_GCM_SHA256: + return "TLS_DH_DSS_WITH_AES_128_GCM_SHA256"; + case TLS_DH_DSS_WITH_AES_256_GCM_SHA384: + return "TLS_DH_DSS_WITH_AES_256_GCM_SHA384"; + case TLS_DH_anon_WITH_AES_128_GCM_SHA256: + return "TLS_DH_anon_WITH_AES_128_GCM_SHA256"; + case TLS_DH_anon_WITH_AES_256_GCM_SHA384: + return "TLS_DH_anon_WITH_AES_256_GCM_SHA384"; + + /* ECDSA addenda, RFC 5289 */ + case TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256: + return "TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256"; + case TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384: + return "TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384"; + case TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA256: + return "TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA256"; + case TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA384: + return "TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA384"; + case TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256: + return "TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256"; + case TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384: + return "TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384"; + case TLS_ECDH_RSA_WITH_AES_128_CBC_SHA256: + return "TLS_ECDH_RSA_WITH_AES_128_CBC_SHA256"; + case TLS_ECDH_RSA_WITH_AES_256_CBC_SHA384: + return "TLS_ECDH_RSA_WITH_AES_256_CBC_SHA384"; + case TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256: + return "TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256"; + case TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384: + return "TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384"; + case TLS_ECDH_ECDSA_WITH_AES_128_GCM_SHA256: + return "TLS_ECDH_ECDSA_WITH_AES_128_GCM_SHA256"; + case TLS_ECDH_ECDSA_WITH_AES_256_GCM_SHA384: + return "TLS_ECDH_ECDSA_WITH_AES_256_GCM_SHA384"; + case TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256: + return "TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256"; + case TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384: + return "TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384"; + case TLS_ECDH_RSA_WITH_AES_128_GCM_SHA256: + return "TLS_ECDH_RSA_WITH_AES_128_GCM_SHA256"; + case TLS_ECDH_RSA_WITH_AES_256_GCM_SHA384: + return "TLS_ECDH_RSA_WITH_AES_256_GCM_SHA384"; + + case TLS_AES_128_GCM_SHA256: + return "TLS_AES_128_GCM_SHA256"; + case TLS_AES_256_GCM_SHA384: + return "TLS_AES_256_GCM_SHA384"; + case TLS_CHACHA20_POLY1305_SHA256: + return "TLS_CHACHA20_POLY1305_SHA256"; + case TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256: + return "TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256"; + case TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256: + return "TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256"; + case TLS_RSA_WITH_3DES_EDE_CBC_SHA: + return "TLS_RSA_WITH_3DES_EDE_CBC_SHA"; + + default: + return "TLS_CIPHER_STRING_UNKNOWN"; + } +} + +static void ssl_ciphers_populate(void) +{ + /* SSLGetSupportedCiphers() is deprecated and we can't find + * the replacement API, so we just list the valid ciphers here + * taken from the tls_ciphersuite_t doc. + */ + tls_ciphersuite_t ciphers[] = { + tls_ciphersuite_AES_128_GCM_SHA256, + tls_ciphersuite_AES_256_GCM_SHA384, + tls_ciphersuite_CHACHA20_POLY1305_SHA256, + tls_ciphersuite_ECDHE_ECDSA_WITH_3DES_EDE_CBC_SHA, + tls_ciphersuite_ECDHE_ECDSA_WITH_AES_128_CBC_SHA, + tls_ciphersuite_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256, + tls_ciphersuite_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256, + tls_ciphersuite_ECDHE_ECDSA_WITH_AES_256_CBC_SHA, + tls_ciphersuite_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384, + tls_ciphersuite_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384, + tls_ciphersuite_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256, + tls_ciphersuite_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA, + tls_ciphersuite_ECDHE_RSA_WITH_AES_128_CBC_SHA, + tls_ciphersuite_ECDHE_RSA_WITH_AES_128_CBC_SHA256, + tls_ciphersuite_ECDHE_RSA_WITH_AES_128_GCM_SHA256, + tls_ciphersuite_ECDHE_RSA_WITH_AES_256_CBC_SHA, + tls_ciphersuite_ECDHE_RSA_WITH_AES_256_CBC_SHA384, + tls_ciphersuite_ECDHE_RSA_WITH_AES_256_GCM_SHA384, + tls_ciphersuite_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256, + tls_ciphersuite_RSA_WITH_3DES_EDE_CBC_SHA, + tls_ciphersuite_RSA_WITH_AES_128_CBC_SHA, + tls_ciphersuite_RSA_WITH_AES_128_CBC_SHA256, + tls_ciphersuite_RSA_WITH_AES_128_GCM_SHA256, + tls_ciphersuite_RSA_WITH_AES_256_CBC_SHA, + tls_ciphersuite_RSA_WITH_AES_256_CBC_SHA256, + tls_ciphersuite_RSA_WITH_AES_256_GCM_SHA384 + }; + if (!ssl_cipher_num) { + unsigned i; + + ssl_cipher_num = sizeof(ciphers)/sizeof(ciphers[0]); + for (i = 0; i < ssl_cipher_num; i++) { + ssl_ciphers[i].id = (pj_ssl_cipher)ciphers[i]; + ssl_ciphers[i].name = sslGetCipherSuiteString(ciphers[i]); + } + } +} + + +static pj_ssl_cipher ssl_get_cipher(pj_ssl_sock_t *ssock) +{ + applessl_sock_t *assock = (applessl_sock_t *)ssock; + + return (pj_ssl_cipher) assock->cipher; +} + + +#if !TARGET_OS_IPHONE +static void get_info_and_cn(CFArrayRef array, CFMutableStringRef info, + CFStringRef *cn) +{ + const void *keys[] = {kSecOIDOrganizationalUnitName, kSecOIDCountryName, + kSecOIDStateProvinceName, kSecOIDLocalityName, + kSecOIDOrganizationName, kSecOIDCommonName}; + const char *labels[] = { "OU=", "C=", "ST=", "L=", "O=", "CN="}; + pj_bool_t add_separator = PJ_FALSE; + int i, n; + + *cn = NULL; + for(i = 0; i < sizeof(keys)/sizeof(keys[0]); i++) { + for (n = 0 ; n < CFArrayGetCount(array); n++) { + CFDictionaryRef dict; + CFTypeRef dictkey; + CFStringRef str; + + dict = CFArrayGetValueAtIndex(array, n); + if (CFGetTypeID(dict) != CFDictionaryGetTypeID()) + continue; + dictkey = CFDictionaryGetValue(dict, kSecPropertyKeyLabel); + if (!CFEqual(dictkey, keys[i])) + continue; + str = (CFStringRef) CFDictionaryGetValue(dict, + kSecPropertyKeyValue); + + if (CFStringGetLength(str) > 0) { + if (add_separator) { + CFStringAppendCString(info, "/", kCFStringEncodingUTF8); + } + CFStringAppendCString(info, labels[i], kCFStringEncodingUTF8); + CFStringAppend(info, str); + add_separator = PJ_TRUE; + + if (CFEqual(keys[i], kSecOIDCommonName)) + *cn = str; + } + } + } +} + +static CFDictionaryRef get_cert_oid(SecCertificateRef cert, CFStringRef oid, + CFTypeRef *value) +{ + void *key[1]; + CFArrayRef key_arr; + CFDictionaryRef vals, dict; + + key[0] = (void *)oid; + key_arr = CFArrayCreate(NULL, (const void **)key, 1, + &kCFTypeArrayCallBacks); + + vals = SecCertificateCopyValues(cert, key_arr, NULL); + dict = CFDictionaryGetValue(vals, key[0]); + if (!dict) { + CFRelease(key_arr); + CFRelease(vals); + return NULL; + } + + *value = CFDictionaryGetValue(dict, kSecPropertyKeyValue); + + CFRelease(key_arr); + + return vals; +} + +#endif + +/* Get certificate info; in case the certificate info is already populated, + * this function will check if the contents need updating by inspecting the + * issuer and the serial number. + */ +static void get_cert_info(pj_pool_t *pool, pj_ssl_cert_info *ci, + SecCertificateRef cert) +{ + pj_bool_t update_needed; + char buf[512]; + size_t bufsize = sizeof(buf); + const pj_uint8_t *serial_no = NULL; + size_t serialsize = 0; + CFMutableStringRef issuer_info; + CFStringRef str; + CFDataRef serial = NULL; +#if !TARGET_OS_IPHONE + CFStringRef issuer_cn = NULL; + CFDictionaryRef dict; +#endif + + pj_assert(pool && ci && cert); + + /* Get issuer */ + issuer_info = CFStringCreateMutable(NULL, 0); +#if !TARGET_OS_IPHONE +{ + /* Unfortunately, unlike on Mac, on iOS we don't have these APIs + * to query the certificate info such as the issuer, version, + * validity, and alt names. + */ + CFArrayRef issuer_vals; + + dict = get_cert_oid(cert, kSecOIDX509V1IssuerName, + (CFTypeRef *)&issuer_vals); + if (dict) { + get_info_and_cn(issuer_vals, issuer_info, &issuer_cn); + if (issuer_cn) + issuer_cn = CFStringCreateCopy(NULL, issuer_cn); + CFRelease(dict); + } +} +#endif + CFStringGetCString(issuer_info, buf, bufsize, kCFStringEncodingUTF8); + + /* Get serial no */ + if (__builtin_available(macOS 10.13, iOS 11.0, *)) { + serial = SecCertificateCopySerialNumberData(cert, NULL); + if (serial) { + serial_no = CFDataGetBytePtr(serial); + serialsize = CFDataGetLength(serial); + } + } + + /* Check if the contents need to be updated */ + update_needed = pj_strcmp2(&ci->issuer.info, buf) || + pj_memcmp(ci->serial_no, serial_no, serialsize); + if (!update_needed) { + CFRelease(issuer_info); + return; + } + + /* Update cert info */ + + pj_bzero(ci, sizeof(pj_ssl_cert_info)); + + /* Version */ +#if !TARGET_OS_IPHONE +{ + CFStringRef version; + + dict = get_cert_oid(cert, kSecOIDX509V1Version, + (CFTypeRef *)&version); + if (dict) { + ci->version = CFStringGetIntValue(version); + CFRelease(dict); + } +} +#endif + + /* Issuer */ + pj_strdup2(pool, &ci->issuer.info, buf); +#if !TARGET_OS_IPHONE + if (issuer_cn) { + CFStringGetCString(issuer_cn, buf, bufsize, kCFStringEncodingUTF8); + pj_strdup2(pool, &ci->issuer.cn, buf); + CFRelease(issuer_cn); + } +#endif + CFRelease(issuer_info); + + /* Serial number */ + if (serial) { + if (serialsize > sizeof(ci->serial_no)) + serialsize = sizeof(ci->serial_no); + pj_memcpy(ci->serial_no, serial_no, serialsize); + CFRelease(serial); + } + + /* Subject */ + str = SecCertificateCopySubjectSummary(cert); + CFStringGetCString(str, buf, bufsize, kCFStringEncodingUTF8); + pj_strdup2(pool, &ci->subject.cn, buf); + CFRelease(str); +#if !TARGET_OS_IPHONE +{ + CFArrayRef subject; + CFMutableStringRef subject_info; + + dict = get_cert_oid(cert, kSecOIDX509V1SubjectName, + (CFTypeRef *)&subject); + if (dict) { + subject_info = CFStringCreateMutable(NULL, 0); + + get_info_and_cn(subject, subject_info, &str); + + CFStringGetCString(subject_info, buf, bufsize, kCFStringEncodingUTF8); + pj_strdup2(pool, &ci->subject.info, buf); + + CFRelease(dict); + CFRelease(subject_info); + } +} +#endif + + /* Validity */ +#if !TARGET_OS_IPHONE +{ + CFNumberRef validity; + double interval; + + dict = get_cert_oid(cert, kSecOIDX509V1ValidityNotBefore, + (CFTypeRef *)&validity); + if (dict) { + if (CFNumberGetValue(validity, CFNumberGetType(validity), + &interval)) + { + /* Darwin's absolute reference date is 1 Jan 2001 00:00:00 GMT */ + ci->validity.start.sec = (unsigned long)interval + 978278400L; + } + CFRelease(dict); + } + + dict = get_cert_oid(cert, kSecOIDX509V1ValidityNotAfter, + (CFTypeRef *)&validity); + if (dict) { + if (CFNumberGetValue(validity, CFNumberGetType(validity), + &interval)) + { + ci->validity.end.sec = (unsigned long)interval + 978278400L; + } + CFRelease(dict); + } +} +#endif + + /* Subject Alternative Name extension */ +#if !TARGET_OS_IPHONE +{ + CFArrayRef altname; + CFIndex i; + + dict = get_cert_oid(cert, kSecOIDSubjectAltName, (CFTypeRef *)&altname); + if (!dict || !CFArrayGetCount(altname)) + return; + + ci->subj_alt_name.entry = pj_pool_calloc(pool, CFArrayGetCount(altname), + sizeof(*ci->subj_alt_name.entry)); + + for (i = 0; i < CFArrayGetCount(altname); ++i) { + CFDictionaryRef item; + CFStringRef label, value; + pj_ssl_cert_name_type type = PJ_SSL_CERT_NAME_UNKNOWN; + + item = CFArrayGetValueAtIndex(altname, i); + if (CFGetTypeID(item) != CFDictionaryGetTypeID()) + continue; + + label = (CFStringRef)CFDictionaryGetValue(item, kSecPropertyKeyLabel); + if (CFGetTypeID(label) != CFStringGetTypeID()) + continue; + + value = (CFStringRef)CFDictionaryGetValue(item, kSecPropertyKeyValue); + + if (!CFStringCompare(label, CFSTR("DNS Name"), + kCFCompareCaseInsensitive)) + { + if (CFGetTypeID(value) != CFStringGetTypeID()) + continue; + CFStringGetCString(value, buf, bufsize, kCFStringEncodingUTF8); + type = PJ_SSL_CERT_NAME_DNS; + } else if (!CFStringCompare(label, CFSTR("IP Address"), + kCFCompareCaseInsensitive)) + { + if (CFGetTypeID(value) != CFStringGetTypeID()) + continue; + CFStringGetCString(value, buf, bufsize, kCFStringEncodingUTF8); + type = PJ_SSL_CERT_NAME_IP; + } else if (!CFStringCompare(label, CFSTR("Email Address"), + kCFCompareCaseInsensitive)) + { + if (CFGetTypeID(value) != CFStringGetTypeID()) + continue; + CFStringGetCString(value, buf, bufsize, kCFStringEncodingUTF8); + type = PJ_SSL_CERT_NAME_RFC822; + } else if (!CFStringCompare(label, CFSTR("URI"), + kCFCompareCaseInsensitive)) + { + CFStringRef uri; + + if (CFGetTypeID(value) != CFURLGetTypeID()) + continue; + uri = CFURLGetString((CFURLRef)value); + CFStringGetCString(uri, buf, bufsize, kCFStringEncodingUTF8); + type = PJ_SSL_CERT_NAME_URI; + } + + if (type != PJ_SSL_CERT_NAME_UNKNOWN) { + ci->subj_alt_name.entry[ci->subj_alt_name.cnt].type = type; + if (type == PJ_SSL_CERT_NAME_IP) { + char ip_buf[PJ_INET6_ADDRSTRLEN+10]; + int len = CFStringGetLength(value); + int af = pj_AF_INET(); + + if (len == sizeof(pj_in6_addr)) af = pj_AF_INET6(); + pj_inet_ntop2(af, buf, ip_buf, sizeof(ip_buf)); + pj_strdup2(pool, + &ci->subj_alt_name.entry[ci->subj_alt_name.cnt].name, + ip_buf); + } else { + pj_strdup2(pool, + &ci->subj_alt_name.entry[ci->subj_alt_name.cnt].name, + buf); + } + ci->subj_alt_name.cnt++; + } + } + + CFRelease(dict); +} +#endif +} + +/* Update local & remote certificates info. This function should be + * called after handshake successfully completed. + */ +static void ssl_update_certs_info(pj_ssl_sock_t *ssock) +{ + applessl_sock_t *assock = (applessl_sock_t *)ssock; + SecTrustRef trust = assock->trust; + CFIndex count; + SecCertificateRef cert; + + pj_assert(ssock->ssl_state == SSL_STATE_ESTABLISHED); + + /* Get active local certificate */ + if (assock->identity) { + CFArrayRef cert_arr; + + cert_arr = sec_identity_copy_certificates_ref(assock->identity); + if (cert_arr) { + count = CFArrayGetCount(cert_arr); + if (count > 0) { + CFTypeRef elmt; + + elmt = (CFTypeRef) CFArrayGetValueAtIndex(cert_arr, 0); + if (CFGetTypeID(elmt) == SecCertificateGetTypeID()) { + cert = (SecCertificateRef)elmt; + get_cert_info(ssock->pool, &ssock->local_cert_info, cert); + } + } + CFRelease(cert_arr); + } + } + + /* Get active remote certificate */ + if (trust) { + count = SecTrustGetCertificateCount(trust); + if (count > 0) { + cert = SecTrustGetCertificateAtIndex(trust, 0); + get_cert_info(ssock->pool, &ssock->remote_cert_info, cert); + } + } +} + +static void ssl_set_state(pj_ssl_sock_t *ssock, pj_bool_t is_server) +{ + PJ_UNUSED_ARG(ssock); + PJ_UNUSED_ARG(is_server); +} + +static void ssl_set_peer_name(pj_ssl_sock_t *ssock) +{ + /* Setting server name is done when configuring tls before connection + * is started. + */ + PJ_UNUSED_ARG(ssock); +} + +static pj_status_t ssl_do_handshake(pj_ssl_sock_t *ssock) +{ + /* Nothing to do here, just return EPENDING. Handshake has + * automatically been performed when starting a connection. + */ + + return PJ_EPENDING; +} + +static pj_status_t ssl_read(pj_ssl_sock_t *ssock, void *data, int *size) +{ + pj_size_t circ_buf_size, read_size; + + pj_lock_acquire(ssock->circ_buf_input_mutex); + + if (circ_empty(&ssock->circ_buf_input)) { + pj_lock_release(ssock->circ_buf_input_mutex); + *size = 0; + return PJ_SUCCESS; + } + + circ_buf_size = circ_size(&ssock->circ_buf_input); + read_size = PJ_MIN(circ_buf_size, *size); + + circ_read(&ssock->circ_buf_input, data, read_size); + + pj_lock_release(ssock->circ_buf_input_mutex); + + *size = read_size; + + return PJ_SUCCESS; +} + +/* + * Write the plain data to buffer. It will be encrypted later during + * sending. + */ +static pj_status_t ssl_write(pj_ssl_sock_t *ssock, const void *data, + pj_ssize_t size, int *nwritten) +{ + pj_status_t status; + + status = circ_write(&ssock->circ_buf_output, data, size); + *nwritten = (status == PJ_SUCCESS)? (int)size: 0; + + return status; +} + +static pj_status_t ssl_renegotiate(pj_ssl_sock_t *ssock) +{ + PJ_UNUSED_ARG(ssock); + + /* According to the doc, + * sec_protocol_options_set_tls_renegotiation_enabled() should + * enable TLS session renegotiation for versions 1.2 and earlier. + * But we can't trigger renegotiation manually, or can we? + */ + return PJ_ENOTSUP; +} + + +#endif /* PJ_SSL_SOCK_IMP_APPLE */ diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjlib/src/pj/ssl_sock_darwin.c asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjlib/src/pj/ssl_sock_darwin.c --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjlib/src/pj/ssl_sock_darwin.c 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjlib/src/pj/ssl_sock_darwin.c 2022-02-24 07:54:38.000000000 +0000 @@ -1,4 +1,3 @@ -/* $Id$ */ /* * Copyright (C) 2019-2019 Teluu Inc. (http://www.teluu.com) * @@ -409,32 +408,42 @@ ~PJ_SSL_SOCK_PROTO_SSL2; } - if (ssock->param.proto & PJ_SSL_SOCK_PROTO_SSL2) { - if (!min_proto) min_proto = kSSLProtocol2; - max_proto = kSSLProtocol2; - } - if (ssock->param.proto & PJ_SSL_SOCK_PROTO_SSL3) { - if (!min_proto) min_proto = kSSLProtocol3; - max_proto = kSSLProtocol3; - } - if (ssock->param.proto & PJ_SSL_SOCK_PROTO_TLS1) { - if (!min_proto) min_proto = kTLSProtocol1; - max_proto = kTLSProtocol1; - } - if (ssock->param.proto & PJ_SSL_SOCK_PROTO_TLS1_1) { - if (!min_proto) min_proto = kTLSProtocol11; + if (ssock->param.proto & PJ_SSL_SOCK_PROTO_TLS1_3) { + max_proto = kTLSProtocol13; + } else if (ssock->param.proto & PJ_SSL_SOCK_PROTO_TLS1_2) { + max_proto = kTLSProtocol12; + } else if (ssock->param.proto & PJ_SSL_SOCK_PROTO_TLS1_1) { max_proto = kTLSProtocol11; + } else if (ssock->param.proto & PJ_SSL_SOCK_PROTO_TLS1) { + max_proto = kTLSProtocol1; + } else if (ssock->param.proto & PJ_SSL_SOCK_PROTO_SSL3) { + max_proto = kSSLProtocol3; + } else { + PJ_LOG(3, (THIS_FILE, "Unsupported TLS/SSL protocol")); + return PJ_EINVAL; } - if (ssock->param.proto & PJ_SSL_SOCK_PROTO_TLS1_2) { - if (!min_proto) min_proto = kTLSProtocol12; - max_proto = kTLSProtocol12; + + if (ssock->param.proto & PJ_SSL_SOCK_PROTO_SSL3) { + min_proto = kSSLProtocol3; + } else if (ssock->param.proto & PJ_SSL_SOCK_PROTO_TLS1) { + min_proto = kTLSProtocol1; + } else if (ssock->param.proto & PJ_SSL_SOCK_PROTO_TLS1_1) { + min_proto = kTLSProtocol11; + } else if (ssock->param.proto & PJ_SSL_SOCK_PROTO_TLS1_2) { + min_proto = kTLSProtocol12; + } else if (ssock->param.proto & PJ_SSL_SOCK_PROTO_TLS1_3) { + min_proto = kTLSProtocol13; } - if (min_proto != kSSLProtocolUnknown) { + + /* According to the doc, we can't set min/max proto for TLS protocol + * higher than 1.0. The runtime error given is -9830 (Illegal parameter). + */ + if (min_proto != kSSLProtocolUnknown && min_proto <= kTLSProtocol1) { err = SSLSetProtocolVersionMin(ssl_ctx, min_proto); if (err != noErr) pj_status_from_err(dssock, "SetVersionMin", err); } - if (max_proto != kSSLProtocolUnknown) { + if (max_proto != kSSLProtocolUnknown && max_proto <= kTLSProtocol1) { err = SSLSetProtocolVersionMax(ssl_ctx, max_proto); if (err != noErr) pj_status_from_err(dssock, "SetVersionMax", err); } @@ -1160,7 +1169,9 @@ darwinssl_sock_t *dssock = (darwinssl_sock_t *)ssock; /* Set server name to connect */ - if (ssock->param.server_name.slen) { + if (ssock->param.server_name.slen && + get_ip_addr_ver(&ssock->param.server_name) == 0) + { OSStatus err; err = SSLSetPeerDomainName(dssock->ssl_ctx, diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjlib/src/pj/ssl_sock_gtls.c asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjlib/src/pj/ssl_sock_gtls.c --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjlib/src/pj/ssl_sock_gtls.c 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjlib/src/pj/ssl_sock_gtls.c 2022-02-24 07:54:38.000000000 +0000 @@ -1101,7 +1101,9 @@ gnutls_sock_t *gssock = (gnutls_sock_t *)ssock; /* Set server name to connect */ - if (ssock->param.server_name.slen) { + if (ssock->param.server_name.slen && + get_ip_addr_ver(&ssock->param.server_name) == 0) + { int ret; /* Server name is null terminated already */ ret = gnutls_server_name_set(gssock->session, GNUTLS_NAME_DNS, diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjlib/src/pj/ssl_sock_imp_common.c asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjlib/src/pj/ssl_sock_imp_common.c --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjlib/src/pj/ssl_sock_imp_common.c 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjlib/src/pj/ssl_sock_imp_common.c 2022-02-24 07:54:38.000000000 +0000 @@ -1,4 +1,3 @@ -/* $Id$ */ /* * Copyright (C) 2019-2019 Teluu Inc. (http://www.teluu.com) * @@ -33,6 +32,18 @@ enum { MAX_BIND_RETRY = 100 }; +#ifndef SSL_SOCK_IMP_USE_OWN_NETWORK +static pj_bool_t asock_on_data_read (pj_activesock_t *asock, + void *data, + pj_size_t size, + pj_status_t status, + pj_size_t *remainder); + +static pj_bool_t asock_on_data_sent (pj_activesock_t *asock, + pj_ioqueue_op_key_t *send_key, + pj_ssize_t sent); +#endif + #ifdef SSL_SOCK_IMP_USE_CIRC_BUF /* ******************************************************************* @@ -173,6 +184,26 @@ ******************************************************************* */ +#ifndef SSL_SOCK_IMP_USE_OWN_NETWORK + +/* Check IP address version. */ +static int get_ip_addr_ver(const pj_str_t *host) +{ + pj_in_addr dummy; + pj_in6_addr dummy6; + + /* First check if this is an IPv4 address */ + if (pj_inet_pton(pj_AF_INET(), host, &dummy) == PJ_SUCCESS) + return 4; + + /* Then check if this is an IPv6 address */ + if (pj_inet_pton(pj_AF_INET6(), host, &dummy6) == PJ_SUCCESS) + return 6; + + /* Not an IP address */ + return 0; +} + /* Close sockets */ static void ssl_close_sockets(pj_ssl_sock_t *ssock) { @@ -203,6 +234,7 @@ if (sock != PJ_INVALID_SOCKET) pj_sock_close(sock); } +#endif /* When handshake completed: * - notify application @@ -224,15 +256,19 @@ /* Accepting */ if (ssock->is_server) { + pj_bool_t ret = PJ_TRUE; + if (status != PJ_SUCCESS) { /* Handshake failed in accepting, destroy our self silently. */ char buf[PJ_INET6_ADDRSTRLEN+10]; - PJ_PERROR(3,(ssock->pool->obj_name, status, - "Handshake failed in accepting %s", - pj_sockaddr_print(&ssock->rem_addr, buf, - sizeof(buf), 3))); + if (pj_sockaddr_has_addr(&ssock->rem_addr)) { + PJ_PERROR(3,(ssock->pool->obj_name, status, + "Handshake failed in accepting %s", + pj_sockaddr_print(&ssock->rem_addr, buf, + sizeof(buf), 3))); + } if (ssock->param.cb.on_accept_complete2) { (*ssock->param.cb.on_accept_complete2) @@ -241,6 +277,12 @@ status); } + /* Decrement ref count of parent */ + if (ssock->parent->param.grp_lock) { + pj_grp_lock_dec_ref(ssock->parent->param.grp_lock); + ssock->parent = NULL; + } + /* Originally, this is a workaround for ticket #985. However, * a race condition may occur in multiple worker threads * environment when we are destroying SSL objects while other @@ -284,23 +326,29 @@ return PJ_FALSE; } + /* Notify application the newly accepted SSL socket */ if (ssock->param.cb.on_accept_complete2) { - pj_bool_t ret; ret = (*ssock->param.cb.on_accept_complete2) (ssock->parent, ssock, (pj_sockaddr_t*)&ssock->rem_addr, pj_sockaddr_get_len((pj_sockaddr_t*)&ssock->rem_addr), status); - if (ret == PJ_FALSE) - return PJ_FALSE; } else if (ssock->param.cb.on_accept_complete) { - pj_bool_t ret; ret = (*ssock->param.cb.on_accept_complete) (ssock->parent, ssock, (pj_sockaddr_t*)&ssock->rem_addr, pj_sockaddr_get_len((pj_sockaddr_t*)&ssock->rem_addr)); - if (ret == PJ_FALSE) - return PJ_FALSE; } + + /* Decrement ref count of parent and reset parent (we don't need it + * anymore, right?). + */ + if (ssock->parent->param.grp_lock) { + pj_grp_lock_dec_ref(ssock->parent->param.grp_lock); + ssock->parent = NULL; + } + + if (ret == PJ_FALSE) + return PJ_FALSE; } /* Connecting */ @@ -494,6 +542,10 @@ pj_lock_release(ssock->write_mutex); /* Send it */ +#ifdef SSL_SOCK_IMP_USE_OWN_NETWORK + status = network_send(ssock, &wdata->key, wdata->data.content, &len, + flags); +#else if (ssock->param.sock_type == pj_SOCK_STREAM()) { status = pj_activesock_send(ssock->asock, &wdata->key, wdata->data.content, &len, @@ -505,6 +557,7 @@ (pj_sockaddr_t*)&ssock->rem_addr, ssock->addr_len); } +#endif if (status != PJ_EPENDING) { /* When the sending is not pending, remove the wdata from send @@ -626,7 +679,7 @@ /* ******************************************************************* - * Active socket callbacks. + * Network callbacks. ******************************************************************* */ @@ -644,16 +697,15 @@ ((pj_int8_t*)(asock_rbuf) + \ ssock->param.read_buffer_size) -static pj_bool_t asock_on_data_read (pj_activesock_t *asock, +static pj_bool_t ssock_on_data_read (pj_ssl_sock_t *ssock, void *data, pj_size_t size, pj_status_t status, pj_size_t *remainder) { - pj_ssl_sock_t *ssock = (pj_ssl_sock_t*) - pj_activesock_get_user_data(asock); + if (status != PJ_SUCCESS) + goto on_error; - /* Socket error or closed */ if (data && size > 0) { pj_status_t status_; @@ -789,12 +841,10 @@ return PJ_FALSE; } -static pj_bool_t asock_on_data_sent (pj_activesock_t *asock, +static pj_bool_t ssock_on_data_sent (pj_ssl_sock_t *ssock, pj_ioqueue_op_key_t *send_key, pj_ssize_t sent) { - pj_ssl_sock_t *ssock = (pj_ssl_sock_t*) - pj_activesock_get_user_data(asock); write_data_t *wdata = (write_data_t*)send_key->user_data; pj_ioqueue_op_key_t *app_key = wdata->app_key; pj_ssize_t sent_len; @@ -845,28 +895,65 @@ return PJ_TRUE; } -static pj_bool_t asock_on_accept_complete (pj_activesock_t *asock, +static pj_status_t get_localaddr(pj_ssl_sock_t *ssock, + pj_sockaddr_t *addr, + int *namelen) +{ + PJ_UNUSED_ARG(addr); + PJ_UNUSED_ARG(namelen); + +#ifdef SSL_SOCK_IMP_USE_OWN_NETWORK + return network_get_localaddr(ssock, &ssock->local_addr, + &ssock->addr_len); +#else + return pj_sock_getsockname(ssock->sock, &ssock->local_addr, + &ssock->addr_len); +#endif +} + + +static pj_bool_t ssock_on_accept_complete (pj_ssl_sock_t *ssock_parent, pj_sock_t newsock, + void *newconn, const pj_sockaddr_t *src_addr, - int src_addr_len) + int src_addr_len, + pj_status_t accept_status) { - pj_ssl_sock_t *ssock_parent = (pj_ssl_sock_t*) - pj_activesock_get_user_data(asock); pj_ssl_sock_t *ssock; +#ifndef SSL_SOCK_IMP_USE_OWN_NETWORK pj_activesock_cb asock_cb; pj_activesock_cfg asock_cfg; +#endif unsigned i; pj_status_t status; +#ifndef SSL_SOCK_IMP_USE_OWN_NETWORK + PJ_UNUSED_ARG(newconn); +#endif + + if (accept_status != PJ_SUCCESS) { + if (ssock_parent->param.cb.on_accept_complete2) { + (*ssock_parent->param.cb.on_accept_complete2)(ssock_parent, NULL, + src_addr, + src_addr_len, + accept_status); + } + return PJ_TRUE; + } + /* Create new SSL socket instance */ status = pj_ssl_sock_create(ssock_parent->pool, &ssock_parent->newsock_param, &ssock); if (status != PJ_SUCCESS) goto on_return; + /* Set parent and add ref count (avoid parent destroy during handshake) */ + ssock->parent = ssock_parent; + if (ssock->parent->param.grp_lock) + pj_grp_lock_add_ref(ssock->parent->param.grp_lock); + /* Update new SSL socket attributes */ ssock->sock = newsock; - ssock->parent = ssock_parent; ssock->is_server = PJ_TRUE; if (ssock_parent->cert) { status = pj_ssl_sock_set_certificate(ssock, ssock->pool, @@ -875,31 +962,9 @@ goto on_return; } - /* Apply QoS, if specified */ - status = pj_sock_apply_qos2(ssock->sock, ssock->param.qos_type, - &ssock->param.qos_params, 1, - ssock->pool->obj_name, NULL); - if (status != PJ_SUCCESS && !ssock->param.qos_ignore_error) - goto on_return; - - /* Apply socket options, if specified */ - if (ssock->param.sockopt_params.cnt) { - status = pj_sock_setsockopt_params(ssock->sock, - &ssock->param.sockopt_params); - if (status != PJ_SUCCESS && !ssock->param.sockopt_ignore_error) - goto on_return; - } - - /* Update local address */ + /* Set local address */ ssock->addr_len = src_addr_len; - status = pj_sock_getsockname(ssock->sock, &ssock->local_addr, - &ssock->addr_len); - if (status != PJ_SUCCESS) { - /* This fails on few envs, e.g: win IOCP, just tolerate this and - * use parent local address instead. - */ - pj_sockaddr_cp(&ssock->local_addr, &ssock_parent->local_addr); - } + pj_sockaddr_cp(&ssock->local_addr, &ssock_parent->local_addr); /* Set remote address */ pj_sockaddr_cp(&ssock->rem_addr, src_addr); @@ -909,28 +974,29 @@ if (status != PJ_SUCCESS) goto on_return; + /* Set peer name */ + ssl_set_peer_name(ssock); + /* Prepare read buffer */ ssock->asock_rbuf = (void**)pj_pool_calloc(ssock->pool, ssock->param.async_cnt, sizeof(void*)); - if (!ssock->asock_rbuf) - return PJ_ENOMEM; + if (!ssock->asock_rbuf) { + status = PJ_ENOMEM; + goto on_return; + } for (i = 0; iparam.async_cnt; ++i) { ssock->asock_rbuf[i] = (void*) pj_pool_alloc( ssock->pool, ssock->param.read_buffer_size + sizeof(read_data_t*)); - if (!ssock->asock_rbuf[i]) - return PJ_ENOMEM; + if (!ssock->asock_rbuf[i]) { + status = PJ_ENOMEM; + goto on_return; + } } - /* Create active socket */ - pj_activesock_cfg_default(&asock_cfg); - asock_cfg.async_cnt = ssock->param.async_cnt; - asock_cfg.concurrency = ssock->param.concurrency; - asock_cfg.whole_data = PJ_TRUE; - /* If listener socket has group lock, automatically create group lock * for the new socket. */ @@ -942,11 +1008,39 @@ goto on_return; pj_grp_lock_add_ref(glock); - asock_cfg.grp_lock = ssock->param.grp_lock = glock; + ssock->param.grp_lock = glock; pj_grp_lock_add_handler(ssock->param.grp_lock, ssock->pool, ssock, ssl_on_destroy); } +#ifdef SSL_SOCK_IMP_USE_OWN_NETWORK + status = network_setup_connection(ssock, newconn); + if (status != PJ_SUCCESS) + goto on_return; + +#else + /* Apply QoS, if specified */ + status = pj_sock_apply_qos2(ssock->sock, ssock->param.qos_type, + &ssock->param.qos_params, 1, + ssock->pool->obj_name, NULL); + if (status != PJ_SUCCESS && !ssock->param.qos_ignore_error) + goto on_return; + + /* Apply socket options, if specified */ + if (ssock->param.sockopt_params.cnt) { + status = pj_sock_setsockopt_params(ssock->sock, + &ssock->param.sockopt_params); + if (status != PJ_SUCCESS && !ssock->param.sockopt_ignore_error) + goto on_return; + } + + /* Create active socket */ + pj_activesock_cfg_default(&asock_cfg); + asock_cfg.grp_lock = ssock->param.grp_lock; + asock_cfg.async_cnt = ssock->param.async_cnt; + asock_cfg.concurrency = ssock->param.concurrency; + asock_cfg.whole_data = PJ_TRUE; + pj_bzero(&asock_cb, sizeof(asock_cb)); asock_cb.on_data_read = asock_on_data_read; asock_cb.on_data_sent = asock_on_data_sent; @@ -970,6 +1064,16 @@ PJ_IOQUEUE_ALWAYS_ASYNC); if (status != PJ_SUCCESS) goto on_return; +#endif + + /* Update local address */ + status = get_localaddr(ssock, &ssock->local_addr, &ssock->addr_len); + if (status != PJ_SUCCESS) { + /* This fails on few envs, e.g: win IOCP, just tolerate this and + * use parent local address instead. + */ + pj_sockaddr_cp(&ssock->local_addr, &ssock_parent->local_addr); + } /* Prepare write/send state */ pj_assert(ssock->send_buf.max_len == 0); @@ -1009,39 +1113,13 @@ on_handshake_complete(ssock, status); } - /* Must return PJ_TRUE whatever happened, as active socket must - * continue listening. - */ + /* Must return PJ_TRUE whatever happened, as we must continue listening */ return PJ_TRUE; } -static pj_bool_t asock_on_accept_complete2(pj_activesock_t *asock, - pj_sock_t newsock, - const pj_sockaddr_t *src_addr, - int src_addr_len, - pj_status_t status) -{ - pj_bool_t ret = PJ_TRUE; - if (status != PJ_SUCCESS) { - pj_ssl_sock_t *ssock = (pj_ssl_sock_t*) - pj_activesock_get_user_data(asock); - - if (ssock->param.cb.on_accept_complete2) { - (*ssock->param.cb.on_accept_complete2) (ssock, NULL, - src_addr, src_addr_len, - status); - } - } else { - ret = asock_on_accept_complete(asock, newsock, src_addr, src_addr_len); - } - return ret; -} - -static pj_bool_t asock_on_connect_complete (pj_activesock_t *asock, +static pj_bool_t ssock_on_connect_complete (pj_ssl_sock_t *ssock, pj_status_t status) { - pj_ssl_sock_t *ssock = (pj_ssl_sock_t*) - pj_activesock_get_user_data(asock); unsigned i; if (status != PJ_SUCCESS) @@ -1049,8 +1127,7 @@ /* Update local address */ ssock->addr_len = sizeof(pj_sockaddr); - status = pj_sock_getsockname(ssock->sock, &ssock->local_addr, - &ssock->addr_len); + status = get_localaddr(ssock, &ssock->local_addr, &ssock->addr_len); if (status != PJ_SUCCESS) goto on_return; @@ -1076,10 +1153,16 @@ } /* Start read */ +#ifdef SSL_SOCK_IMP_USE_OWN_NETWORK + status = network_start_read(ssock, ssock->param.async_cnt, + (unsigned)ssock->param.read_buffer_size, + ssock->asock_rbuf, 0); +#else status = pj_activesock_start_read2(ssock->asock, ssock->pool, (unsigned)ssock->param.read_buffer_size, ssock->asock_rbuf, PJ_IOQUEUE_ALWAYS_ASYNC); +#endif if (status != PJ_SUCCESS) goto on_return; @@ -1112,6 +1195,51 @@ return on_handshake_complete(ssock, status); } +#ifndef SSL_SOCK_IMP_USE_OWN_NETWORK +static pj_bool_t asock_on_data_read (pj_activesock_t *asock, + void *data, + pj_size_t size, + pj_status_t status, + pj_size_t *remainder) +{ + pj_ssl_sock_t *ssock = (pj_ssl_sock_t*) + pj_activesock_get_user_data(asock); + + return ssock_on_data_read(ssock, data, size, status, remainder); +} + +static pj_bool_t asock_on_data_sent (pj_activesock_t *asock, + pj_ioqueue_op_key_t *send_key, + pj_ssize_t sent) +{ + pj_ssl_sock_t *ssock = (pj_ssl_sock_t*) + pj_activesock_get_user_data(asock); + + return ssock_on_data_sent(ssock, send_key, sent); +} + +static pj_bool_t asock_on_accept_complete2(pj_activesock_t *asock, + pj_sock_t newsock, + const pj_sockaddr_t *src_addr, + int src_addr_len, + pj_status_t status) +{ + pj_ssl_sock_t *ssock = (pj_ssl_sock_t*) + pj_activesock_get_user_data(asock); + + return ssock_on_accept_complete(ssock, newsock, NULL, + src_addr, src_addr_len, status); +} + +static pj_bool_t asock_on_connect_complete (pj_activesock_t *asock, + pj_status_t status) +{ + pj_ssl_sock_t *ssock = (pj_ssl_sock_t*) + pj_activesock_get_user_data(asock); + + return ssock_on_connect_complete(ssock, status); +} +#endif /* ******************************************************************* @@ -1277,6 +1405,8 @@ /* Create secure socket */ ssock = ssl_alloc(pool); + if (!ssock) + return PJ_ENOMEM; ssock->pool = pool; ssock->info_pool = info_pool; ssock->sock = PJ_INVALID_SOCKET; @@ -1337,9 +1467,11 @@ { PJ_ASSERT_RETURN(ssock, PJ_EINVAL); - if (!ssock->pool) + if (!ssock->pool || ssock->is_closing) return PJ_SUCCESS; + ssock->is_closing = PJ_TRUE; + if (ssock->timer.id != TIMER_NONE) { pj_timer_heap_cancel(ssock->param.timer_heap, &ssock->timer); ssock->timer.id = TIMER_NONE; @@ -1403,17 +1535,18 @@ /* Local address */ pj_sockaddr_cp(&info->local_addr, &ssock->local_addr); + + /* Certificates info */ + info->local_cert_info = &ssock->local_cert_info; + info->remote_cert_info = &ssock->remote_cert_info; + + /* Remote address */ + if (pj_sockaddr_has_addr(&ssock->rem_addr)) + pj_sockaddr_cp(&info->remote_addr, &ssock->rem_addr); if (info->established) { info->cipher = ssl_get_cipher(ssock); - /* Remote address */ - pj_sockaddr_cp(&info->remote_addr, &ssock->rem_addr); - - /* Certificates info */ - info->local_cert_info = &ssock->local_cert_info; - info->remote_cert_info = &ssock->remote_cert_info; - /* Verification status */ info->verify_status = ssock->verify_status; } @@ -1503,7 +1636,7 @@ for (i=0; iparam.async_cnt; ++i) { if (ssock->asock_rbuf[i]) { pj_size_t remainder = 0; - asock_on_data_read(ssock->asock, ssock->asock_rbuf[i], 0, + ssock_on_data_read(ssock, ssock->asock_rbuf[i], 0, PJ_SUCCESS, &remainder); } } @@ -1765,9 +1898,11 @@ int addr_len, const pj_ssl_sock_param *newsock_param) { + pj_status_t status; +#ifndef SSL_SOCK_IMP_USE_OWN_NETWORK pj_activesock_cb asock_cb; pj_activesock_cfg asock_cfg; - pj_status_t status; +#endif PJ_ASSERT_RETURN(ssock && pool && localaddr && addr_len, PJ_EINVAL); @@ -1779,6 +1914,14 @@ return PJ_EINVAL; } + ssock->is_server = PJ_TRUE; + +#ifdef SSL_SOCK_IMP_USE_OWN_NETWORK + status = network_start_accept(ssock, pool, localaddr, addr_len, + newsock_param); + if (status != PJ_SUCCESS) + goto on_error; +#else /* Create socket */ status = pj_sock_socket(ssock->param.sock_af, ssock->param.sock_type, 0, &ssock->sock); @@ -1827,7 +1970,7 @@ pj_activesock_cfg_default(&asock_cfg); asock_cfg.async_cnt = ssock->param.async_cnt; asock_cfg.concurrency = ssock->param.concurrency; - asock_cfg.whole_data = PJ_TRUE; + asock_cfg.whole_data = PJ_FALSE; asock_cfg.grp_lock = ssock->param.grp_lock; pj_bzero(&asock_cb, sizeof(asock_cb)); @@ -1859,8 +2002,7 @@ &ssock->addr_len); if (status != PJ_SUCCESS) pj_sockaddr_cp(&ssock->local_addr, localaddr); - - ssock->is_server = PJ_TRUE; +#endif return PJ_SUCCESS; @@ -1893,9 +2035,14 @@ pj_ssl_sock_t *ssock, pj_ssl_start_connect_param *connect_param) { + pj_status_t status; +#ifdef SSL_SOCK_IMP_USE_OWN_NETWORK + status = network_start_connect(ssock, connect_param); + if (status != PJ_EPENDING) + goto on_error; +#else pj_activesock_cb asock_cb; pj_activesock_cfg asock_cfg; - pj_status_t status; pj_pool_t *pool = connect_param->pool; const pj_sockaddr_t *localaddr = connect_param->localaddr; @@ -1971,22 +2118,6 @@ /* Save remote address */ pj_sockaddr_cp(&ssock->rem_addr, remaddr); - /* Start timer */ - if (ssock->param.timer_heap && - (ssock->param.timeout.sec != 0 || ssock->param.timeout.msec != 0)) - { - pj_assert(ssock->timer.id == TIMER_NONE); - status = pj_timer_heap_schedule_w_grp_lock(ssock->param.timer_heap, - &ssock->timer, - &ssock->param.timeout, - TIMER_HANDSHAKE_TIMEOUT, - ssock->param.grp_lock); - if (status != PJ_SUCCESS) { - ssock->timer.id = TIMER_NONE; - status = PJ_SUCCESS; - } - } - status = pj_activesock_start_connect(ssock->asock, pool, remaddr, addr_len); @@ -2007,6 +2138,24 @@ * once the socket is established. */ +#endif + + /* Start timer */ + if (ssock->param.timer_heap && + (ssock->param.timeout.sec != 0 || ssock->param.timeout.msec != 0)) + { + pj_assert(ssock->timer.id == TIMER_NONE); + status = pj_timer_heap_schedule_w_grp_lock(ssock->param.timer_heap, + &ssock->timer, + &ssock->param.timeout, + TIMER_HANDSHAKE_TIMEOUT, + ssock->param.grp_lock); + if (status != PJ_SUCCESS) { + ssock->timer.id = TIMER_NONE; + status = PJ_SUCCESS; + } + } + /* Update SSL state */ ssock->is_server = PJ_FALSE; diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjlib/src/pj/ssl_sock_imp_common.h asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjlib/src/pj/ssl_sock_imp_common.h --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjlib/src/pj/ssl_sock_imp_common.h 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjlib/src/pj/ssl_sock_imp_common.h 2022-02-24 07:54:38.000000000 +0000 @@ -1,4 +1,3 @@ -/* $Id$ */ /* * Copyright (C) 2019-2019 Teluu Inc. (http://www.teluu.com) * @@ -114,6 +113,7 @@ pj_timer_entry timer; pj_status_t verify_status; + pj_bool_t is_closing; unsigned long last_err; pj_sock_t sock; @@ -263,5 +263,33 @@ static pj_status_t ssl_write(pj_ssl_sock_t *ssock, const void *data, pj_ssize_t size, int *nwritten); +#ifdef SSL_SOCK_IMP_USE_OWN_NETWORK + +static void ssl_close_sockets(pj_ssl_sock_t *ssock); + +static pj_status_t network_send(pj_ssl_sock_t *ssock, + pj_ioqueue_op_key_t *send_key, + const void *data, + pj_ssize_t *size, + unsigned flags); +static pj_status_t network_start_read(pj_ssl_sock_t *ssock, + unsigned async_count, + unsigned buff_size, + void *readbuf[], + pj_uint32_t flags); +static pj_status_t network_start_accept(pj_ssl_sock_t *ssock, + pj_pool_t *pool, + const pj_sockaddr_t *localaddr, + int addr_len, + const pj_ssl_sock_param *newsock_param); +static pj_status_t network_start_connect(pj_ssl_sock_t *ssock, + pj_ssl_start_connect_param *connect_param); +static pj_status_t network_setup_connection(pj_ssl_sock_t *ssock, + void *connection); +static pj_status_t network_get_localaddr(pj_ssl_sock_t *ssock, + pj_sockaddr_t *addr, + int *namelen); + +#endif + #endif /* __SSL_SOCK_IMP_COMMON_H__ */ - \ No newline at end of file diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjlib/src/pj/ssl_sock_ossl.c asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjlib/src/pj/ssl_sock_ossl.c --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjlib/src/pj/ssl_sock_ossl.c 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjlib/src/pj/ssl_sock_ossl.c 2022-02-24 07:54:38.000000000 +0000 @@ -57,12 +57,41 @@ #include #include +/* Specify whether server supports session reuse using session ID. */ +#define SERVER_SUPPORT_SESSION_REUSE 1 + +/* Specify whether server should disable session tickets. */ +#define SERVER_DISABLE_SESSION_TICKETS 1 + +/* Each server application must set its own session id context, + * which is used to distinguish the contexts and is stored in + * exported sessions. + */ +#ifndef SERVER_SESSION_ID_CONTEXT +# define SERVER_SESSION_ID_CONTEXT 999 +#endif + +/* Server session timeout duration. Default is 300 sec. */ +#define SERVER_SESSION_TIMEOUT 300 + #if defined(LIBRESSL_VERSION_NUMBER) # define USING_LIBRESSL 1 #else # define USING_LIBRESSL 0 #endif +#if defined(OPENSSL_IS_BORINGSSL) +# define USING_BORINGSSL 1 + +# define TLSEXT_nid_unknown 0x1000000 + +#undef SSL_CTRL_SET_ECDH_AUTO +# define SSL_CTRL_SET_ECDH_AUTO 94 + +#else +# define USING_BORINGSSL 0 +#endif + #if !USING_LIBRESSL && !defined(OPENSSL_NO_EC) \ && OPENSSL_VERSION_NUMBER >= 0x1000200fL @@ -121,6 +150,11 @@ #endif +static void update_certs_info(pj_ssl_sock_t* ssock, + X509_STORE_CTX* ctx, + pj_ssl_cert_info *local_cert_info, + pj_ssl_cert_info *remote_cert_info, + pj_bool_t is_verify); #if !USING_LIBRESSL && OPENSSL_VERSION_NUMBER >= 0x10100000L # define OPENSSL_NO_SSL2 /* seems to be removed in 1.1.0 */ @@ -130,9 +164,10 @@ # define X509_get_notBefore(x) X509_get0_notBefore(x) # define X509_get_notAfter(x) X509_get0_notAfter(x) # endif -#else +#elif !USING_LIBRESSL # define SSL_CIPHER_get_id(c) (c)->id # define SSL_set_session(ssl, s) (ssl)->session = (s) +# define X509_STORE_CTX_get0_cert(ctx) ((ctx)->cert) #endif @@ -175,6 +210,7 @@ pj_ssl_sock_t base; SSL_CTX *ossl_ctx; + pj_bool_t own_ctx; SSL *ossl_ssl; BIO *ossl_rbio; BIO *ossl_wbio; @@ -327,7 +363,8 @@ ERROR_LOG("STATUS_FROM_SSL_ERR", err, ssock); } - ssock->last_err = err; + if (ssock) + ssock->last_err = err; return GET_STATUS_FROM_SSL_ERR(err); } @@ -344,7 +381,8 @@ /* Dig for more from OpenSSL error queue */ SSLLogErrors(action, ret, err, len, ssock); - ssock->last_err = ssl_err; + if (ssock) + ssock->last_err = ssl_err; return GET_STATUS_FROM_SSL_ERR(ssl_err); } @@ -368,7 +406,11 @@ ssl_err -= PJ_SSL_ERRNO_START; l = ssl_err / MAX_OSSL_ERR_REASON; r = ssl_err % MAX_OSSL_ERR_REASON; +#if USING_BORINGSSL + ssl_err = ERR_PACK(l, r); +#else ssl_err = ERR_PACK(l, 0, r); +#endif } #if defined(PJ_HAS_ERROR_STRING) && (PJ_HAS_ERROR_STRING != 0) @@ -394,6 +436,22 @@ return errstr; } +/* Additional ciphers recognized by SSL_set_cipher_list() + but not returned from SSL_get_ciphers(). + NOTE: ids are designed to not conflict with those from + SSL_get_cipher() which get masked to the lower 24 + bits before use. +*/ +static const struct ssl_ciphers_t ADDITIONAL_CIPHERS[] = { + {0xFF000000, "DEFAULT"}, + {0xFF000001, "@SECLEVEL=1"}, + {0xFF000002, "@SECLEVEL=2"}, + {0xFF000003, "@SECLEVEL=3"}, + {0xFF000004, "@SECLEVEL=4"}, + {0xFF000005, "@SECLEVEL=5"} +}; +static const unsigned int ADDITIONAL_CIPHER_COUNT = + sizeof (ADDITIONAL_CIPHERS) / sizeof (ADDITIONAL_CIPHERS[0]); /* ******************************************************************* @@ -455,6 +513,138 @@ /* OpenSSL application data index */ static int sslsock_idx; +#if defined(PJ_SSL_SOCK_OSSL_USE_THREAD_CB) && \ + PJ_SSL_SOCK_OSSL_USE_THREAD_CB != 0 && OPENSSL_VERSION_NUMBER < 0x10100000L + +/* Thread lock pool.*/ +static pj_caching_pool cp; +static pj_pool_t *lock_pool; + +/* OpenSSL locking list. */ +static pj_lock_t **ossl_locks; + +/* OpenSSL number locks. */ +static unsigned ossl_num_locks; + +#if OPENSSL_VERSION_NUMBER >= 0x10000000 +static void ossl_set_thread_id(CRYPTO_THREADID *id) +{ + CRYPTO_THREADID_set_numeric(id, + (unsigned long)pj_thread_get_os_handle(pj_thread_this())); +} + +#else + +static unsigned long ossl_thread_id(void) +{ + return ((unsigned long)pj_thread_get_os_handle(pj_thread_this())); +} +#endif + +static void ossl_lock(int mode, int id, const char *file, int line) +{ + PJ_UNUSED_ARG(file); + PJ_UNUSED_ARG(line); + + if (openssl_init_count == 0) + return; + + if (mode & CRYPTO_LOCK) { + if (ossl_locks[id]) { + //PJ_LOG(6, (THIS_FILE, "Lock File (%s) Line(%d)", file, line)); + pj_lock_acquire(ossl_locks[id]); + } + } else { + if (ossl_locks[id]) { + //PJ_LOG(6, (THIS_FILE, "Unlock File (%s) Line(%d)", file, line)); + pj_lock_release(ossl_locks[id]); + } + } +} + +static void release_thread_cb(void) +{ + unsigned i = 0; + +#if OPENSSL_VERSION_NUMBER >= 0x10000000 + CRYPTO_THREADID_set_callback(NULL); +#else + CRYPTO_set_id_callback(NULL); +#endif + CRYPTO_set_locking_callback(NULL); + + for (; i < ossl_num_locks; ++i) { + if (ossl_locks[i]) { + pj_lock_destroy(ossl_locks[i]); + ossl_locks[i] = NULL; + } + } + if (lock_pool) { + pj_pool_release(lock_pool); + lock_pool = NULL; + pj_caching_pool_destroy(&cp); + } + ossl_locks = NULL; + ossl_num_locks = 0; +} + +static pj_status_t init_ossl_lock() +{ + pj_status_t status = PJ_SUCCESS; + + pj_caching_pool_init(&cp, NULL, 0); + + lock_pool = pj_pool_create(&cp.factory, + "ossl-lock", + 64, + 64, + NULL); + + if (!lock_pool) { + status = PJ_ENOMEM; + PJ_PERROR(1, (THIS_FILE, status,"Fail creating OpenSSL lock pool")); + pj_caching_pool_destroy(&cp); + return status; + } + + ossl_num_locks = CRYPTO_num_locks(); + ossl_locks = (pj_lock_t **)pj_pool_calloc(lock_pool, + ossl_num_locks, + sizeof(pj_lock_t*)); + + if (ossl_locks) { + unsigned i = 0; + for (; (i < ossl_num_locks) && (status == PJ_SUCCESS); ++i) { + status = pj_lock_create_simple_mutex(lock_pool, "ossl_lock%p", + &ossl_locks[i]); + } + if (status != PJ_SUCCESS) { + PJ_PERROR(1, (THIS_FILE, status, + "Fail creating mutex for OpenSSL lock")); + release_thread_cb(); + return status; + } + +#if OPENSSL_VERSION_NUMBER >= 0x10000000 + CRYPTO_THREADID_set_callback(ossl_set_thread_id); +#else + CRYPTO_set_id_callback(ossl_thread_id); +#endif + CRYPTO_set_locking_callback(ossl_lock); + status = pj_atexit(&release_thread_cb); + if (status != PJ_SUCCESS) { + PJ_PERROR(1, (THIS_FILE, status, "Warning! Unable to set OpenSSL " + "lock thread callback unrelease method.")); + } + } else { + status = PJ_ENOMEM; + PJ_PERROR(1, (THIS_FILE, status,"Fail creating OpenSSL locks")); + release_thread_cb(); + } + return status; +} + +#endif /* Initialize OpenSSL */ static pj_status_t init_openssl(void) @@ -525,8 +715,8 @@ sk_cipher = SSL_get_ciphers(ssl); n = sk_SSL_CIPHER_num(sk_cipher); - if (n > PJ_ARRAY_SIZE(ssl_ciphers)) - n = PJ_ARRAY_SIZE(ssl_ciphers); + if (n > PJ_ARRAY_SIZE(ssl_ciphers) - ADDITIONAL_CIPHER_COUNT) + n = PJ_ARRAY_SIZE(ssl_ciphers) - ADDITIONAL_CIPHER_COUNT; for (i = 0; i < n; ++i) { const SSL_CIPHER *c; @@ -536,19 +726,80 @@ 0x00FFFFFF; ssl_ciphers[i].name = SSL_CIPHER_get_name(c); } + + /* Add cipher aliases not returned from SSL_get_ciphers() */ + for (i = 0; i < ADDITIONAL_CIPHER_COUNT; ++i) { + ssl_ciphers[n++] = ADDITIONAL_CIPHERS[i]; + } ssl_cipher_num = n; +#if USING_BORINGSSL + ssl_sess = SSL_SESSION_new(ctx); +#else ssl_sess = SSL_SESSION_new(); +#endif SSL_set_session(ssl, ssl_sess); #if !USING_LIBRESSL && !defined(OPENSSL_NO_EC) \ && OPENSSL_VERSION_NUMBER >= 0x1000200fL +#if OPENSSL_VERSION_NUMBER >= 0x1010100fL + ssl_curves_num = EC_get_builtin_curves(NULL, 0); +#else + +#if USING_BORINGSSL + ssl_curves_num = SSL_get_curve_id(ssl); +#else ssl_curves_num = SSL_get_shared_curve(ssl,-1); +#endif + if (ssl_curves_num > PJ_ARRAY_SIZE(ssl_curves)) ssl_curves_num = PJ_ARRAY_SIZE(ssl_curves); +#endif + + if( ssl_curves_num > 0 ) { +#if OPENSSL_VERSION_NUMBER >= 0x1010100fL + EC_builtin_curve * curves = NULL; + + curves = OPENSSL_malloc((int)sizeof(*curves) * ssl_curves_num); + if (!EC_get_builtin_curves(curves, ssl_curves_num)) { + OPENSSL_free(curves); + curves = NULL; + ssl_curves_num = 0; + } + + n = ssl_curves_num; + ssl_curves_num = 0; + + for (i = 0; i < n; i++) { + nid = curves[i].nid; + + if ( 0 != get_cid_from_nid(nid) ) { + cname = OBJ_nid2sn(nid); + + if (!cname) + cname = OBJ_nid2sn(nid); + if (cname) { + ssl_curves[ssl_curves_num].id = get_cid_from_nid(nid); + ssl_curves[ssl_curves_num].name = cname; + + ssl_curves_num++; + + if (ssl_curves_num >= PJ_SSL_SOCK_MAX_CURVES ) + break; + } + } + } + + if(curves) + OPENSSL_free(curves); +#else for (i = 0; i < ssl_curves_num; i++) { +#if USING_BORINGSSL + nid = SSL_get_curve_id(ssl); +#else nid = SSL_get_shared_curve(ssl, i); +#endif if (nid & TLSEXT_nid_unknown) { cname = "curve unknown"; @@ -562,6 +813,9 @@ ssl_curves[i].id = get_cid_from_nid(nid); ssl_curves[i].name = cname; } +#endif + + } #else PJ_UNUSED_ARG(nid); PJ_UNUSED_ARG(cname); @@ -587,18 +841,31 @@ /* Create OpenSSL application data index for SSL socket */ sslsock_idx = SSL_get_ex_new_index(0, "SSL socket", NULL, NULL, NULL); + if (sslsock_idx == -1) { + status = STATUS_FROM_SSL_ERR2("Init", NULL, -1, ERR_get_error(), 0); + PJ_LOG(1,(THIS_FILE, + "Fatal error: failed to get application data index for " + "SSL socket")); + return status; + } + +#if defined(PJ_SSL_SOCK_OSSL_USE_THREAD_CB) && \ + PJ_SSL_SOCK_OSSL_USE_THREAD_CB != 0 && OPENSSL_VERSION_NUMBER < 0x10100000L + + status = init_ossl_lock(); + if (status != PJ_SUCCESS) + return status; +#endif return status; } - /* Shutdown OpenSSL */ static void shutdown_openssl(void) { PJ_UNUSED_ARG(openssl_init_count); } - /* SSL password callback. */ static int password_cb(char *buf, int num, int rwflag, void *user_data) { @@ -614,21 +881,45 @@ } -/* SSL password callback. */ +/* SSL certificate verification result callback. + * Note that this callback seems to be always called from library worker + * thread, e.g: active socket on_read_complete callback, which should have + * already been equipped with race condition avoidance mechanism (should not + * be destroyed while callback is being invoked). + */ static int verify_cb(int preverify_ok, X509_STORE_CTX *x509_ctx) { - pj_ssl_sock_t *ssock; - SSL *ossl_ssl; + pj_ssl_sock_t *ssock = NULL; + SSL *ossl_ssl = NULL; int err; /* Get SSL instance */ ossl_ssl = X509_STORE_CTX_get_ex_data(x509_ctx, SSL_get_ex_data_X509_STORE_CTX_idx()); - pj_assert(ossl_ssl); + if (!ossl_ssl) { + PJ_LOG(1,(THIS_FILE, + "SSL verification callback failed to get SSL instance")); + goto on_return; + } /* Get SSL socket instance */ ssock = SSL_get_ex_data(ossl_ssl, sslsock_idx); - pj_assert(ssock); + if (!ssock) { + /* SSL socket may have been destroyed */ + PJ_LOG(1,(THIS_FILE, + "SSL verification callback failed to get SSL socket " + "instance (sslsock_idx=%d).", sslsock_idx)); + goto on_return; + } + + if (ssock->param.cb.on_verify_cb) { + update_certs_info(ssock, x509_ctx, &ssock->local_cert_info, + &ssock->remote_cert_info, PJ_TRUE); + preverify_ok = (*ssock->param.cb.on_verify_cb)(ssock, + ssock->is_server); + + goto on_return; + } /* Store verification status */ err = X509_STORE_CTX_get_error(x509_ctx); @@ -706,6 +997,7 @@ if (PJ_FALSE == ssock->param.verify_peer) preverify_ok = 1; +on_return: return preverify_ok; } @@ -724,34 +1016,35 @@ return (pj_ssl_sock_t *)PJ_POOL_ZALLOC_T(pool, ossl_sock_t); } +#if !USING_BORINGSSL + static int xname_cmp(const X509_NAME * const *a, const X509_NAME * const *b) { return X509_NAME_cmp(*a, *b); } -/* Create and initialize new SSL context and instance */ -static pj_status_t ssl_create(pj_ssl_sock_t *ssock) +#else + +static int xname_cmp(const X509_NAME **a, const X509_NAME **b) { + return X509_NAME_cmp(*a, *b); +} + +#endif + +/* Initialize OpenSSL context for the ssock */ +static pj_status_t init_ossl_ctx(pj_ssl_sock_t *ssock) { ossl_sock_t *ossock = (ossl_sock_t *)ssock; + SSL_CTX *ctx = NULL; #if !defined(OPENSSL_NO_DH) BIO *bio; DH *dh; long options; #endif SSL_METHOD *ssl_method = NULL; - SSL_CTX *ctx; pj_uint32_t ssl_opt = 0; - pj_ssl_cert_t *cert; - int mode, rc; + pj_ssl_cert_t *cert = ssock->cert; + int rc; pj_status_t status; - - pj_assert(ssock); - - cert = ssock->cert; - - /* Make sure OpenSSL library has been initialized */ - init_openssl(); - - set_entropy(ssock); if (ssock->param.proto == PJ_SSL_SOCK_PROTO_DEFAULT) ssock->param.proto = PJ_SSL_SOCK_PROTO_SSL23; @@ -813,19 +1106,51 @@ /** Check if TLSv1_2 is enabled */ ssl_opt |= ((ssock->param.proto & PJ_SSL_SOCK_PROTO_TLS1_2)==0)? SSL_OP_NO_TLSv1_2:0; +#endif +#ifdef SSL_OP_NO_TLSv1_3 + /** Check if TLSv1_3 is enabled */ + ssl_opt |= ((ssock->param.proto & PJ_SSL_SOCK_PROTO_TLS1_3)==0)? + SSL_OP_NO_TLSv1_3:0; #endif } - /* Create SSL context */ - ctx = SSL_CTX_new(ssl_method); + ossock->ossl_ctx = ctx = SSL_CTX_new(ssl_method); if (ctx == NULL) { return GET_SSL_STATUS(ssock); } + + if (ssock->is_server) { + unsigned int sid_ctx = SERVER_SESSION_ID_CONTEXT; + +#if SERVER_DISABLE_SESSION_TICKETS + /* Disable session tickets for TLSv1.2 and below. */ + ssl_opt |= SSL_OP_NO_TICKET; +#ifdef SSL_CTX_set_num_tickets + /* Set the number of TLSv1.3 session tickets issued to 0. */ + SSL_CTX_set_num_tickets(ctx, 0); +#endif + +#endif + + SSL_CTX_set_timeout(ctx, SERVER_SESSION_TIMEOUT); + if (!SSL_CTX_set_session_id_context(ctx, + (const unsigned char *)&sid_ctx, sizeof(sid_ctx))) + { + PJ_LOG(1, (THIS_FILE, "Warning! Unable to set server session id " + "context. Session reuse will not work.")); + } + } + if (ssl_opt) SSL_CTX_set_options(ctx, ssl_opt); + /* Set cipher list */ + status = set_cipher_list(ssock); + if (status != PJ_SUCCESS) + return status; + /* Apply credentials */ if (cert) { /* Load CA list if one is specified. */ @@ -850,6 +1175,13 @@ } SSL_CTX_free(ctx); return status; + } else { + PJ_LOG(4,(ssock->pool->obj_name, + "CA certificates loaded from '%s%s%s'", + cert->CA_file.ptr, + ((cert->CA_file.slen && cert->CA_path.slen)? + " + ":""), + cert->CA_path.ptr)); } } @@ -873,6 +1205,10 @@ cert->cert_file.ptr)); SSL_CTX_free(ctx); return status; + } else { + PJ_LOG(4,(ssock->pool->obj_name, + "Certificate chain loaded from '%s'", + cert->cert_file.ptr)); } } @@ -890,6 +1226,10 @@ cert->privkey_file.ptr)); SSL_CTX_free(ctx); return status; + } else { + PJ_LOG(4,(ssock->pool->obj_name, + "Private key loaded from '%s'", + cert->privkey_file.ptr)); } #if !defined(OPENSSL_NO_DH) @@ -935,6 +1275,9 @@ BIO_free(cbio); SSL_CTX_free(ctx); return status; + } else { + PJ_LOG(4,(ssock->pool->obj_name, + "Certificate chain loaded from buffer")); } X509_free(xcert); } @@ -952,13 +1295,29 @@ NULL, NULL); if (inf != NULL) { - int i = 0; + int i = 0, cnt = 0; for (; i < sk_X509_INFO_num(inf); i++) { X509_INFO *itmp = sk_X509_INFO_value(inf, i); - if (itmp->x509) { - X509_STORE_add_cert(cts, itmp->x509); + if (!itmp->x509) + continue; + + rc = X509_STORE_add_cert(cts, itmp->x509); + if (rc == 1) { + ++cnt; + } else { +#if PJ_LOG_MAX_LEVEL >= 4 + char buf[256]; + PJ_LOG(4,(ssock->pool->obj_name, + "Error adding CA cert: %s", + X509_NAME_oneline( + X509_get_subject_name(itmp->x509), + buf, sizeof(buf)))); +#endif } } + PJ_LOG(4,(ssock->pool->obj_name, + "CA certificates loaded from buffer (cnt=%d)", + cnt)); } sk_X509_INFO_pop_free(inf, X509_INFO_free); BIO_free(cbio); @@ -972,7 +1331,8 @@ kbio = BIO_new_mem_buf((void*)cert->privkey_buf.ptr, cert->privkey_buf.slen); if (kbio != NULL) { - pkey = PEM_read_bio_PrivateKey(kbio, NULL, 0, NULL); + pkey = PEM_read_bio_PrivateKey(kbio, NULL, &password_cb, + cert); if (pkey) { rc = SSL_CTX_use_PrivateKey(ctx, pkey); if (rc != 1) { @@ -983,9 +1343,16 @@ BIO_free(kbio); SSL_CTX_free(ctx); return status; + } else { + PJ_LOG(4,(ssock->pool->obj_name, + "Private key loaded from buffer")); } EVP_PKEY_free(pkey); + } else { + PJ_LOG(1,(ssock->pool->obj_name, + "Error reading private key from buffer")); } + if (ssock->is_server) { dh = PEM_read_bio_DHparams(kbio, NULL, NULL, NULL); if (dh != NULL) { @@ -1051,12 +1418,16 @@ pj_memcpy(p, "rsa", CERT_TYPE_LEN); } +#if USING_BORINGSSL + if (SSL_CTX_set_mode(ctx, SSL_CTRL_SET_ECDH_AUTO)) { +#else #ifndef SSL_CTRL_SET_ECDH_AUTO #define SSL_CTRL_SET_ECDH_AUTO 94 #endif /* SSL_CTX_set_ecdh_auto(ctx,on) requires OpenSSL 1.0.2 which wraps: */ if (SSL_CTX_ctrl(ctx, SSL_CTRL_SET_ECDH_AUTO, 1, NULL)) { +#endif PJ_LOG(4,(ssock->pool->obj_name, "SSL ECDH initialized " "(automatic), faster PFS ciphers enabled")); #if !defined(OPENSSL_NO_ECDH) && OPENSSL_VERSION_NUMBER >= 0x10000000L && \ @@ -1115,7 +1486,11 @@ if ((xn = X509_NAME_dup(xn)) == NULL ) break; +#if !USING_BORINGSSL if (sk_X509_NAME_find(sk, xn) >= 0) { +#else + if (sk_X509_NAME_find(sk, NULL, xn) >= 0) { +#endif X509_NAME_free(xn); } else { sk_X509_NAME_push(sk, xn); @@ -1130,8 +1505,16 @@ BIO_free(new_bio); } - if (ca_dn != NULL) - SSL_CTX_set_client_CA_list(ctx, ca_dn); + if (ca_dn != NULL) { + SSL_CTX_set_client_CA_list(ctx, ca_dn); + PJ_LOG(4,(ssock->pool->obj_name, + "CA certificates loaded from %s", + (cert->CA_file.slen?cert->CA_file.ptr:"buffer"))); + } else { + PJ_LOG(1,(ssock->pool->obj_name, + "Error reading CA certificates from %s", + (cert->CA_file.slen?cert->CA_file.ptr:"buffer"))); + } } /* Early sensitive data cleanup after OpenSSL context setup. However, @@ -1142,8 +1525,47 @@ pj_ssl_cert_wipe_keys(cert); } + return PJ_SUCCESS; +} + + +/* Create and initialize new SSL context and instance */ +static pj_status_t ssl_create(pj_ssl_sock_t *ssock) +{ + ossl_sock_t *ossock = (ossl_sock_t *)ssock; + int mode; + pj_status_t status; + + pj_assert(ssock); + + /* Make sure OpenSSL library has been initialized */ + init_openssl(); + + set_entropy(ssock); + + if (ssock->param.proto == PJ_SSL_SOCK_PROTO_DEFAULT) + ssock->param.proto = PJ_SSL_SOCK_PROTO_SSL23; + + /* Create SSL context */ + if (SERVER_SUPPORT_SESSION_REUSE && ssock->is_server) { + SSL_CTX *server_ctx = ((ossl_sock_t *)ssock->parent)->ossl_ctx; + + if (!server_ctx) { + status = init_ossl_ctx(ssock->parent); + if (status != PJ_SUCCESS) + return status; + + server_ctx = ((ossl_sock_t *)ssock->parent)->ossl_ctx; + ((ossl_sock_t *)ssock->parent)->own_ctx = PJ_TRUE; + } + ossock->ossl_ctx = server_ctx; + } else { + status = init_ossl_ctx(ssock); + if (status != PJ_SUCCESS) + return status; + } + /* Create SSL instance */ - ossock->ossl_ctx = ctx; ossock->ossl_ssl = SSL_new(ossock->ossl_ctx); if (ossock->ossl_ssl == NULL) { return GET_SSL_STATUS(ssock); @@ -1159,11 +1581,6 @@ SSL_set_verify(ossock->ossl_ssl, mode, &verify_cb); - /* Set cipher list */ - status = set_cipher_list(ssock); - if (status != PJ_SUCCESS) - return status; - /* Set curve list */ status = set_curves_list(ssock); if (status != PJ_SUCCESS) @@ -1198,7 +1615,12 @@ /* Destroy SSL context */ if (ossock->ossl_ctx) { - SSL_CTX_free(ossock->ossl_ctx); + if (ssock->is_server) { + if (!SERVER_SUPPORT_SESSION_REUSE || ossock->own_ctx) + SSL_CTX_free(ossock->ossl_ctx); + } else { + SSL_CTX_free(ossock->ossl_ctx); + } ossock->ossl_ctx = NULL; } @@ -1213,6 +1635,12 @@ static void ssl_reset_sock_state(pj_ssl_sock_t *ssock) { ossl_sock_t *ossock = (ossl_sock_t *)ssock; + + /* Detach from SSL instance */ + if (ossock->ossl_ssl) { + SSL_set_ex_data(ossock->ossl_ssl, sslsock_idx, NULL); + } + /** * Avoid calling SSL_shutdown() if handshake wasn't completed. * OpenSSL 1.0.2f complains if SSL_shutdown() is called during an @@ -1272,12 +1700,11 @@ char *buf = NULL; enum { BUF_SIZE = 8192 }; pj_str_t cipher_list; - STACK_OF(SSL_CIPHER) *sk_cipher; - unsigned i; - int j, ret; + unsigned i, j; + int ret; if (ssock->param.ciphers_num == 0) { - ret = SSL_set_cipher_list(ossock->ossl_ssl, PJ_SSL_SOCK_OSSL_CIPHERS); + ret = SSL_CTX_set_cipher_list(ossock->ossl_ctx, PJ_SSL_SOCK_OSSL_CIPHERS); if (ret < 1) { return GET_SSL_STATUS(ssock); } @@ -1295,22 +1722,12 @@ pj_strset(&cipher_list, buf, 0); - /* Set SSL with ALL available ciphers */ - SSL_set_cipher_list(ossock->ossl_ssl, "ALL:COMPLEMENTOFALL"); - /* Generate user specified cipher list in OpenSSL format */ - sk_cipher = SSL_get_ciphers(ossock->ossl_ssl); for (i = 0; i < ssock->param.ciphers_num; ++i) { - for (j = 0; j < sk_SSL_CIPHER_num(sk_cipher); ++j) { - const SSL_CIPHER *c; - c = sk_SSL_CIPHER_value(sk_cipher, j); - if (ssock->param.ciphers[i] == (pj_ssl_cipher) - ((pj_uint32_t)SSL_CIPHER_get_id(c) & - 0x00FFFFFF)) + for (j = 0; j < ssl_cipher_num; ++j) { + if (ssock->param.ciphers[i] == ssl_ciphers[j].id) { - const char *c_name; - - c_name = SSL_CIPHER_get_name(c); + const char *c_name = ssl_ciphers[j].name; /* Check buffer size */ if (cipher_list.slen + pj_ansi_strlen(c_name) + 2 > @@ -1335,7 +1752,7 @@ cipher_list.ptr[cipher_list.slen] = '\0'; /* Finally, set chosen cipher list */ - ret = SSL_set_cipher_list(ossock->ossl_ssl, buf); + ret = SSL_CTX_set_cipher_list(ossock->ossl_ctx, buf); if (ret < 1) { pj_pool_release(tmp_pool); return GET_SSL_STATUS(ssock); @@ -1385,6 +1802,7 @@ int ret; if (ssock->param.sigalgs.ptr && ssock->param.sigalgs.slen) { +#if !USING_BORINGSSL if (ssock->is_server) { ret = SSL_set1_client_sigalgs_list(ossock->ossl_ssl, ssock->param.sigalgs.ptr); @@ -1392,6 +1810,10 @@ ret = SSL_set1_sigalgs_list(ossock->ossl_ssl, ssock->param.sigalgs.ptr); } +#else + ret = SSL_set1_sigalgs_list(ossock->ossl_ssl, + ssock->param.sigalgs.ptr); +#endif if (ret < 1) return GET_SSL_STATUS(ssock); @@ -1699,39 +2121,60 @@ */ static void ssl_update_certs_info(pj_ssl_sock_t *ssock) { - ossl_sock_t *ossock = (ossl_sock_t *)ssock; - X509 *x; - STACK_OF(X509) *chain; - pj_assert(ssock->ssl_state == SSL_STATE_ESTABLISHED); + update_certs_info(ssock, NULL, &ssock->local_cert_info, + &ssock->remote_cert_info, PJ_FALSE); +} + + +static void update_certs_info(pj_ssl_sock_t* ssock, + X509_STORE_CTX* ctx, + pj_ssl_cert_info *local_cert_info, + pj_ssl_cert_info *remote_cert_info, + pj_bool_t is_verify) +{ + ossl_sock_t* ossock = (ossl_sock_t*)ssock; + X509* x; + STACK_OF(X509)* chain; + /* Active local certificate */ x = SSL_get_certificate(ossock->ossl_ssl); if (x) { - get_cert_info(ssock->pool, &ssock->local_cert_info, x, PJ_FALSE); + get_cert_info(ssock->pool, local_cert_info, x, PJ_FALSE); /* Don't free local's X509! */ } else { - pj_bzero(&ssock->local_cert_info, sizeof(pj_ssl_cert_info)); + pj_bzero(local_cert_info, sizeof(pj_ssl_cert_info)); } /* Active remote certificate */ - x = SSL_get_peer_certificate(ossock->ossl_ssl); + if (is_verify) { + x = X509_STORE_CTX_get0_cert(ctx); + } else { + x = SSL_get_peer_certificate(ossock->ossl_ssl); + } if (x) { - get_cert_info(ssock->pool, &ssock->remote_cert_info, x, PJ_TRUE); - /* Free peer's X509 */ - X509_free(x); + get_cert_info(ssock->pool, remote_cert_info, x, PJ_TRUE); + if (!is_verify) { + /* Free peer's X509 */ + X509_free(x); + } } else { - pj_bzero(&ssock->remote_cert_info, sizeof(pj_ssl_cert_info)); + pj_bzero(remote_cert_info, sizeof(pj_ssl_cert_info)); } - chain = SSL_get_peer_cert_chain(ossock->ossl_ssl); + if (is_verify) { + chain = X509_STORE_CTX_get1_chain(ctx); + } else { + chain = SSL_get_peer_cert_chain(ossock->ossl_ssl); + } if (chain) { pj_pool_reset(ssock->info_pool); ssl_update_remote_cert_chain_info(ssock->info_pool, - &ssock->remote_cert_info, + remote_cert_info, chain, PJ_TRUE); } else { - ssock->remote_cert_info.raw_chain.cnt = 0; + remote_cert_info->raw_chain.cnt = 0; } } @@ -1758,25 +2201,54 @@ } +/* Server Name Indication server callback */ +static int sni_cb(SSL *ssl, int *al, void *arg) +{ + pj_ssl_sock_t *ssock = (pj_ssl_sock_t *)arg; + const char *sname; + + PJ_UNUSED_ARG(al); + + sname = SSL_get_servername(ssl, TLSEXT_NAMETYPE_host_name); + if (!sname || pj_stricmp2(&ssock->param.server_name, sname)) { + PJ_LOG(4, (THIS_FILE, "Client SNI rejected: %s", sname)); + return SSL_TLSEXT_ERR_ALERT_FATAL; + } + + return SSL_TLSEXT_ERR_OK; +} + static void ssl_set_peer_name(pj_ssl_sock_t *ssock) { -#ifdef SSL_set_tlsext_host_name ossl_sock_t *ossock = (ossl_sock_t *)ssock; /* Set server name to connect */ - if (ssock->param.server_name.slen) { - /* Server name is null terminated already */ - if (!SSL_set_tlsext_host_name(ossock->ossl_ssl, - ssock->param.server_name.ptr)) - { - char err_str[PJ_ERR_MSG_SIZE]; + if (ssock->param.server_name.slen && + get_ip_addr_ver(&ssock->param.server_name) == 0) + { + if (ssock->is_server) { +#if defined(SSL_CTX_set_tlsext_servername_callback) && \ + defined(SSL_CTX_set_tlsext_servername_arg) + + SSL_CTX_set_tlsext_servername_callback(ossock->ossl_ctx, &sni_cb); + SSL_CTX_set_tlsext_servername_arg(ossock->ossl_ctx, ssock); + +#endif + } else { +#ifdef SSL_set_tlsext_host_name + /* Server name is null terminated already */ + if (!SSL_set_tlsext_host_name(ossock->ossl_ssl, + ssock->param.server_name.ptr)) + { + char err_str[PJ_ERR_MSG_SIZE]; - ERR_error_string_n(ERR_get_error(), err_str, sizeof(err_str)); - PJ_LOG(3,(ssock->pool->obj_name, "SSL_set_tlsext_host_name() " - "failed: %s", err_str)); + ERR_error_string_n(ERR_get_error(), err_str, sizeof(err_str)); + PJ_LOG(3,(ssock->pool->obj_name, "SSL_set_tlsext_host_name() " + "failed: %s", err_str)); + } +#endif } } -#endif } @@ -1812,6 +2284,40 @@ /* Check if handshake has been completed */ if (SSL_is_init_finished(ossock->ossl_ssl)) { + +#if OPENSSL_VERSION_NUMBER >= 0x10100000L + if (ssock->is_server && ssock->ssl_state != SSL_STATE_ESTABLISHED) { + enum {BUF_SIZE = 64}; + unsigned int len = 0, i; + const unsigned char *sctx, *sid; + char buf[BUF_SIZE+1]; + SSL_SESSION *sess; + + sess = SSL_get_session(ossock->ossl_ssl); + + PJ_LOG(5, (THIS_FILE, "Session info: reused=%d, resumable=%d, " + "timeout=%d", + SSL_session_reused(ossock->ossl_ssl), + SSL_SESSION_is_resumable(sess), + SSL_SESSION_get_timeout(sess))); + + sid = SSL_SESSION_get_id(sess, &len); + len *= 2; + if (len >= BUF_SIZE) len = BUF_SIZE; + for (i = 0; i < len; i+=2) + pj_ansi_sprintf(buf+i, "%02X", sid[i/2]); + buf[len] = '\0'; + PJ_LOG(5, (THIS_FILE, "Session id: %s", buf)); + + sctx = SSL_SESSION_get0_id_context(sess, &len); + if (len >= BUF_SIZE) len = BUF_SIZE; + for (i = 0; i < len; i++) + pj_ansi_sprintf(buf + i, "%d", sctx[i]); + buf[len] = '\0'; + PJ_LOG(5, (THIS_FILE, "Session id context: %s", buf)); + } +#endif + ssock->ssl_state = SSL_STATE_ESTABLISHED; return PJ_SUCCESS; } diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjlib/src/pj/string.c asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjlib/src/pj/string.c --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjlib/src/pj/string.c 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjlib/src/pj/string.c 2022-02-24 07:54:38.000000000 +0000 @@ -94,8 +94,11 @@ { pj_ssize_t str_idx; + pj_assert(str->slen >= 0); + pj_assert(delim->slen >= 0); + tok->slen = 0; - if ((str->slen == 0) || ((pj_size_t)str->slen < start_idx)) { + if ((str->slen <= 0) || ((pj_size_t)str->slen < start_idx)) { return str->slen; } @@ -119,8 +122,10 @@ { pj_ssize_t str_idx; + pj_assert(str->slen >= 0); + tok->slen = 0; - if ((str->slen == 0) || ((pj_size_t)str->slen < start_idx)) { + if ((str->slen <= 0) || ((pj_size_t)str->slen < start_idx)) { return str->slen; } @@ -143,8 +148,14 @@ { const char *s, *ends; - /* Special case when substr is zero */ - if (substr->slen == 0) { + PJ_ASSERT_RETURN(str->slen >= 0 && substr->slen >= 0, NULL); + + /* Check if the string is empty */ + if (str->slen <= 0) + return NULL; + + /* Special case when substr is empty */ + if (substr->slen <= 0) { return (char*)str->ptr; } @@ -162,7 +173,13 @@ { const char *s, *ends; - /* Special case when substr is zero */ + PJ_ASSERT_RETURN(str->slen >= 0 && substr->slen >= 0, NULL); + + /* Check if the string is empty */ + if (str->slen <= 0) + return NULL; + + /* Special case when substr is empty */ if (substr->slen == 0) { return (char*)str->ptr; } @@ -181,6 +198,9 @@ { char *end = str->ptr + str->slen; register char *p = str->ptr; + + pj_assert(str->slen >= 0); + while (p < end && pj_isspace(*p)) ++p; str->slen -= (p - str->ptr); @@ -192,6 +212,9 @@ { char *end = str->ptr + str->slen; register char *p = end - 1; + + pj_assert(str->slen >= 0); + while (p >= str->ptr && pj_isspace(*p)) --p; str->slen -= ((end - p) - 1); @@ -243,6 +266,8 @@ PJ_CHECK_STACK(); + PJ_ASSERT_RETURN(str->slen >= 0, PJ_EINVAL); + if (!str || !value) { return PJ_EINVAL; } @@ -289,6 +314,8 @@ PJ_CHECK_STACK(); + pj_assert(str->slen >= 0); + value = 0; for (i=0; i<(unsigned)str->slen; ++i) { if (!pj_isdigit(str->ptr[i])) @@ -306,6 +333,8 @@ PJ_CHECK_STACK(); + pj_assert(str->slen >= 0); + value = 0; if (base <= 10) { for (i=0; i<(unsigned)str->slen; ++i) { @@ -328,7 +357,7 @@ if (endptr) { endptr->ptr = str->ptr + i; - endptr->slen = str->slen - i; + endptr->slen = (str->slen < 0)? 0: (str->slen - i); } return value; @@ -342,6 +371,8 @@ PJ_CHECK_STACK(); + PJ_ASSERT_RETURN(str->slen >= 0, PJ_EINVAL); + if (!str || !value) { return PJ_EINVAL; } @@ -405,7 +436,9 @@ char *pdot; float val; - if (str->slen == 0) + pj_assert(str->slen >= 0); + + if (str->slen <= 0) return 0; pdot = (char*)pj_memchr(str->ptr, '.', str->slen); diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjlib/src/pj/timer.c asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjlib/src/pj/timer.c --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjlib/src/pj/timer.c 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjlib/src/pj/timer.c 2022-02-24 07:54:38.000000000 +0000 @@ -403,7 +403,7 @@ memcpy(new_timer_dups, ht->timer_dups, ht->max_size * sizeof(pj_timer_entry_dup)); for (i = 0; i < ht->cur_size; i++) { - int idx = ht->heap[i] - ht->timer_dups; + int idx = (int)(ht->heap[i] - ht->timer_dups); // Point to the address in the new array pj_assert(idx >= 0 && idx < (int)ht->max_size); new_heap[i] = &new_timer_dups[idx]; @@ -535,7 +535,7 @@ PJ_CHECK_STACK(); // Check to see if the timer_id is out of range - if (entry->_timer_id < 0 || (pj_size_t)entry->_timer_id > ht->max_size) { + if (entry->_timer_id < 1 || (pj_size_t)entry->_timer_id >= ht->max_size) { entry->_timer_id = -1; return 0; } diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjlib/src/pjlib-test/main.c asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjlib/src/pjlib-test/main.c --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjlib/src/pjlib-test/main.c 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjlib/src/pjlib-test/main.c 2022-02-24 07:54:38.000000000 +0000 @@ -40,7 +40,9 @@ #define boost() #endif + #if defined(PJ_SUNOS) && PJ_SUNOS!=0 + #include static void init_signals() { @@ -52,6 +54,30 @@ sigaction(SIGALRM, &act, NULL); } +#elif PJ_LINUX || PJ_DARWINOS + +#include +#include +#include +#include +#include +static void print_stack(int sig) +{ + void *array[16]; + size_t size; + + size = backtrace(array, 16); + fprintf(stderr, "Error: signal %d:\n", sig); + backtrace_symbols_fd(array, size, STDERR_FILENO); + exit(1); +} + +static void init_signals(void) +{ + signal(SIGSEGV, &print_stack); + signal(SIGABRT, &print_stack); +} + #else #define init_signals() #endif @@ -60,9 +86,9 @@ { int rc; int interractive = 0; + int no_trap = 0; boost(); - init_signals(); while (argc > 1) { char *arg = argv[--argc]; @@ -70,6 +96,8 @@ if (*arg=='-' && *(arg+1)=='i') { interractive = 1; + } else if (*arg=='-' && *(arg+1)=='n') { + no_trap = 1; } else if (*arg=='-' && *(arg+1)=='p') { pj_str_t port = pj_str(argv[--argc]); @@ -92,6 +120,10 @@ } } + if (!no_trap) { + init_signals(); + } + rc = test_main(); if (interractive) { diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjlib/src/pjlib-test/sock.c asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjlib/src/pjlib-test/sock.c --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjlib/src/pjlib-test/sock.c 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjlib/src/pjlib-test/sock.c 2022-02-24 07:54:38.000000000 +0000 @@ -162,11 +162,11 @@ #endif /* PJ_HAS_IPV6 */ /* Test that pj_sockaddr_in_init() initialize the whole structure, - * including sin_zero. + * including sin_zero_pad. */ pj_sockaddr_in_init(&addr2, 0, 1000); pj_bzero(zero, sizeof(zero)); - if (pj_memcmp(addr2.sin_zero, zero, sizeof(addr2.sin_zero)) != 0) + if (pj_memcmp(addr2.sin_zero_pad, zero, sizeof(addr2.sin_zero_pad)) != 0) return -35; /* pj_gethostname() */ diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjlib/src/pjlib-test/ssl_sock.c asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjlib/src/pjlib-test/ssl_sock.c --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjlib/src/pjlib-test/ssl_sock.c 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjlib/src/pjlib-test/ssl_sock.c 2022-02-24 07:54:38.000000000 +0000 @@ -22,7 +22,8 @@ #define CERT_DIR "../build/" -#if (PJ_SSL_SOCK_IMP == PJ_SSL_SOCK_IMP_DARWIN) +#if (PJ_SSL_SOCK_IMP == PJ_SSL_SOCK_IMP_DARWIN) || \ + (PJ_SSL_SOCK_IMP == PJ_SSL_SOCK_IMP_APPLE) /* If we use Darwin SSL, use the cert in DER format. */ # define CERT_CA_FILE CERT_DIR "cacert.der" #else @@ -30,7 +31,7 @@ #endif #define CERT_FILE CERT_DIR "cacert.pem" #define CERT_PRIVKEY_FILE CERT_DIR "privkey.pem" -#define CERT_PRIVKEY_PASS "" +#define CERT_PRIVKEY_PASS "privkeypass" #define TEST_LOAD_FROM_FILES 1 @@ -174,10 +175,13 @@ goto on_return; } - if (status == PJ_SUCCESS) + if (status == PJ_SUCCESS) { st->sent += size; - else + } else { + if (status == PJ_EPENDING) + status = PJ_SUCCESS; break; + } } on_return: @@ -196,7 +200,8 @@ static pj_bool_t ssl_on_accept_complete(pj_ssl_sock_t *ssock, pj_ssl_sock_t *newsock, const pj_sockaddr_t *src_addr, - int src_addr_len) + int src_addr_len, + pj_status_t accept_status) { struct test_state *parent_st = (struct test_state*) pj_ssl_sock_get_user_data(ssock); @@ -207,6 +212,14 @@ pj_status_t status; PJ_UNUSED_ARG(src_addr_len); + + if (accept_status != PJ_SUCCESS) { + if (newsock) { + st = (struct test_state*) pj_ssl_sock_get_user_data(newsock); + st->err = accept_status; + } + return PJ_FALSE; + } /* Duplicate parent test state to newly accepted test state */ st = (struct test_state*)pj_pool_zalloc(parent_st->pool, sizeof(struct test_state)); @@ -245,10 +258,13 @@ goto on_return; } - if (status == PJ_SUCCESS) + if (status == PJ_SUCCESS) { st->sent += size; - else + } else { + if (status == PJ_EPENDING) + status = PJ_SUCCESS; break; + } } on_return: @@ -304,8 +320,11 @@ goto on_return; } - if (status == PJ_SUCCESS) + if (status == PJ_SUCCESS) { st->sent += size_; + } else if (status == PJ_EPENDING) { + status = PJ_SUCCESS; + } } /* Verify echoed data when specified to */ @@ -526,6 +545,7 @@ { pj_pool_t *pool = NULL; pj_ioqueue_t *ioqueue = NULL; + pj_timer_heap_t *timer = NULL; pj_ssl_sock_t *ssock_serv = NULL; pj_ssl_sock_t *ssock_cli = NULL; pj_ssl_sock_param param; @@ -543,12 +563,18 @@ goto on_return; } + status = pj_timer_heap_create(pool, 4, &timer); + if (status != PJ_SUCCESS) { + goto on_return; + } + pj_ssl_sock_param_default(¶m); - param.cb.on_accept_complete = &ssl_on_accept_complete; + param.cb.on_accept_complete2 = &ssl_on_accept_complete; param.cb.on_connect_complete = &ssl_on_connect_complete; param.cb.on_data_read = &ssl_on_data_read; param.cb.on_data_sent = &ssl_on_data_sent; param.ioqueue = ioqueue; + param.timer_heap = timer; param.ciphers = ciphers; /* Init default bind address */ @@ -733,12 +759,25 @@ PJ_LOG(3, ("", ".....Sent/recv: %d/%d bytes", state_cli.sent, state_cli.recv)); on_return: +#if (PJ_SSL_SOCK_IMP == PJ_SSL_SOCK_IMP_DARWIN) || \ + (PJ_SSL_SOCK_IMP == PJ_SSL_SOCK_IMP_APPLE) + if (status != PJ_SUCCESS) { + PJ_LOG(3, ("", "Apple SSL requires the private key to be " + "inside the Keychain. So double click on " + "the file pjlib/build/privkey.p12 to " + "place it in the Keychain. " + "The password is \"pjsip\".")); + } +#endif + if (ssock_serv) pj_ssl_sock_close(ssock_serv); if (ssock_cli && !state_cli.err && !state_cli.done) pj_ssl_sock_close(ssock_cli); if (ioqueue) pj_ioqueue_destroy(ioqueue); + if (timer) + pj_timer_heap_destroy(timer); if (pool) pj_pool_release(pool); @@ -892,14 +931,6 @@ pj_str_t privkey_file = pj_str(CERT_PRIVKEY_FILE); pj_str_t privkey_pass = pj_str(CERT_PRIVKEY_PASS); -#if (PJ_SSL_SOCK_IMP == PJ_SSL_SOCK_IMP_DARWIN) - PJ_LOG(3, ("", "Darwin SSL requires the private key to be " - "inside the Keychain. So double click on " - "the file pjlib/build/privkey.p12 to " - "place it in the Keychain. " - "The password is \"pjsip\".")); -#endif - #if (defined(TEST_LOAD_FROM_FILES) && TEST_LOAD_FROM_FILES==1) status = pj_ssl_cert_load_from_files(pool, &ca_file, &cert_file, &privkey_file, &privkey_pass, @@ -932,7 +963,7 @@ } pj_ssl_sock_param_default(¶m); - param.cb.on_accept_complete = &ssl_on_accept_complete; + param.cb.on_accept_complete2 = &ssl_on_accept_complete; param.cb.on_data_read = &ssl_on_data_read; param.cb.on_data_sent = &ssl_on_data_sent; param.ioqueue = ioqueue; @@ -1263,7 +1294,7 @@ } pj_ssl_sock_param_default(¶m); - param.cb.on_accept_complete = &ssl_on_accept_complete; + param.cb.on_accept_complete2 = &ssl_on_accept_complete; param.cb.on_connect_complete = &ssl_on_connect_complete; param.cb.on_data_read = &ssl_on_data_read; param.cb.on_data_sent = &ssl_on_data_sent; @@ -1510,19 +1541,49 @@ if (ret != 0) return ret; - PJ_LOG(3,("", "..echo test w/ incompatible proto")); + PJ_LOG(3,("", "..echo test w/ compatible proto: server TLSv1.2 vs client TLSv1.2")); + ret = echo_test(PJ_SSL_SOCK_PROTO_TLS1_2, PJ_SSL_SOCK_PROTO_TLS1_2, + -1, -1, + PJ_FALSE, PJ_FALSE); + if (ret != 0) + return ret; + + PJ_LOG(3,("", "..echo test w/ compatible proto: server TLSv1.2+1.3 vs client TLSv1.3")); + ret = echo_test(PJ_SSL_SOCK_PROTO_TLS1_2 | PJ_SSL_SOCK_PROTO_TLS1_3, PJ_SSL_SOCK_PROTO_TLS1_3, + -1, -1, + PJ_FALSE, PJ_FALSE); + if (ret != 0) + return ret; + + PJ_LOG(3,("", "..echo test w/ incompatible proto: server TLSv1 vs client SSL3")); ret = echo_test(PJ_SSL_SOCK_PROTO_TLS1, PJ_SSL_SOCK_PROTO_SSL3, PJ_TLS_RSA_WITH_DES_CBC_SHA, PJ_TLS_RSA_WITH_DES_CBC_SHA, PJ_FALSE, PJ_FALSE); if (ret == 0) return PJ_EBUG; +/* We can't set min/max proto for TLS protocol higher than 1.0. */ +#if (PJ_SSL_SOCK_IMP != PJ_SSL_SOCK_IMP_DARWIN) + PJ_LOG(3,("", "..echo test w/ incompatible proto: server TLSv1.2 vs client TLSv1.3")); + ret = echo_test(PJ_SSL_SOCK_PROTO_TLS1_2, PJ_SSL_SOCK_PROTO_TLS1_3, + -1, -1, + PJ_FALSE, PJ_FALSE); + if (ret == 0) + return PJ_EBUG; +#endif + +/* We can't seem to enable certain ciphers only. SSLSetEnabledCiphers() is + * deprecated and we only have sec_protocol_options_append_tls_ciphersuite(), + * but there's no API to remove certain or all ciphers. + */ +#if (PJ_SSL_SOCK_IMP != PJ_SSL_SOCK_IMP_APPLE) PJ_LOG(3,("", "..echo test w/ incompatible ciphers")); ret = echo_test(PJ_SSL_SOCK_PROTO_DEFAULT, PJ_SSL_SOCK_PROTO_DEFAULT, PJ_TLS_RSA_WITH_DES_CBC_SHA, PJ_TLS_RSA_WITH_AES_256_CBC_SHA, PJ_FALSE, PJ_FALSE); if (ret == 0) return PJ_EBUG; +#endif PJ_LOG(3,("", "..echo test w/ client cert required but not provided")); ret = echo_test(PJ_SSL_SOCK_PROTO_DEFAULT, PJ_SSL_SOCK_PROTO_DEFAULT, @@ -1538,15 +1599,16 @@ if (ret != 0) return ret; +#if WITH_BENCHMARK PJ_LOG(3,("", "..performance test")); ret = perf_test(PJ_IOQUEUE_MAX_HANDLES/2 - 1, 0); if (ret != 0) return ret; +#endif PJ_LOG(3,("", "..client non-SSL (handshake timeout 5 secs)")); ret = client_non_ssl(5000); - /* PJ_TIMEDOUT won't be returned as accepted socket is deleted silently */ - if (ret != 0) + if (ret != PJ_ETIMEDOUT) return ret; #endif diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjlib/src/pjlib-test/test.c asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjlib/src/pjlib-test/test.c --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjlib/src/pjlib-test/test.c 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjlib/src/pjlib-test/test.c 2022-02-24 07:54:38.000000000 +0000 @@ -39,7 +39,7 @@ const char *param_echo_server = ECHO_SERVER_ADDRESS; int param_echo_port = ECHO_SERVER_START_PORT; int param_log_decor = PJ_LOG_HAS_NEWLINE | PJ_LOG_HAS_TIME | - PJ_LOG_HAS_MICRO_SEC; + PJ_LOG_HAS_MICRO_SEC | PJ_LOG_HAS_INDENT; int null_func() { diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjlib/src/pjlib-test/test.h asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjlib/src/pjlib-test/test.h --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjlib/src/pjlib-test/test.h 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjlib/src/pjlib-test/test.h 2022-02-24 07:54:38.000000000 +0000 @@ -32,6 +32,12 @@ # define GROUP_FILE 1 #endif +#if defined(PJ_EXCLUDE_BENCHMARK_TESTS) && (PJ_EXCLUDE_BENCHMARK_TESTS==1) +# define WITH_BENCHMARK 0 +#else +# define WITH_BENCHMARK 1 +#endif + #define INCLUDE_ERRNO_TEST GROUP_LIBC #define INCLUDE_TIMESTAMP_TEST GROUP_OS #define INCLUDE_EXCEPTION_TEST GROUP_LIBC @@ -39,7 +45,7 @@ #define INCLUDE_LIST_TEST GROUP_DATA_STRUCTURE #define INCLUDE_HASH_TEST GROUP_DATA_STRUCTURE #define INCLUDE_POOL_TEST GROUP_LIBC -#define INCLUDE_POOL_PERF_TEST GROUP_LIBC +#define INCLUDE_POOL_PERF_TEST (GROUP_LIBC && WITH_BENCHMARK) #define INCLUDE_STRING_TEST GROUP_DATA_STRUCTURE #define INCLUDE_FIFOBUF_TEST 0 // GROUP_DATA_STRUCTURE #define INCLUDE_RBTREE_TEST GROUP_DATA_STRUCTURE @@ -50,13 +56,13 @@ #define INCLUDE_OS_TEST GROUP_OS #define INCLUDE_THREAD_TEST (PJ_HAS_THREADS && GROUP_OS) #define INCLUDE_SOCK_TEST GROUP_NETWORK -#define INCLUDE_SOCK_PERF_TEST GROUP_NETWORK +#define INCLUDE_SOCK_PERF_TEST (GROUP_NETWORK && WITH_BENCHMARK) #define INCLUDE_SELECT_TEST GROUP_NETWORK #define INCLUDE_UDP_IOQUEUE_TEST GROUP_NETWORK #define INCLUDE_TCP_IOQUEUE_TEST GROUP_NETWORK #define INCLUDE_ACTIVESOCK_TEST GROUP_NETWORK #define INCLUDE_SSLSOCK_TEST (PJ_HAS_SSL_SOCK && GROUP_NETWORK) -#define INCLUDE_IOQUEUE_PERF_TEST (PJ_HAS_THREADS && GROUP_NETWORK) +#define INCLUDE_IOQUEUE_PERF_TEST (PJ_HAS_THREADS && GROUP_NETWORK && WITH_BENCHMARK) #define INCLUDE_IOQUEUE_UNREG_TEST (PJ_HAS_THREADS && GROUP_NETWORK) #define INCLUDE_FILE_TEST GROUP_FILE diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjlib/src/pjlib-test/timer.c asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjlib/src/pjlib-test/timer.c --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjlib/src/pjlib-test/timer.c 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjlib/src/pjlib-test/timer.c 2022-02-24 07:54:38.000000000 +0000 @@ -963,9 +963,11 @@ if (rc != 0) return rc; +#if WITH_BENCHMARK rc = timer_bench_test(); if (rc != 0) return rc; +#endif return 0; } diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjlib-util/build/pjlib_util_test.vcxproj asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjlib-util/build/pjlib_util_test.vcxproj --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjlib-util/build/pjlib_util_test.vcxproj 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjlib-util/build/pjlib_util_test.vcxproj 2022-02-24 07:54:38.000000000 +0000 @@ -1,6 +1,10 @@  + + Debug-Dynamic + ARM64 + Debug-Dynamic Win32 @@ -9,6 +13,10 @@ Debug-Dynamic x64 + + Debug-Static + ARM64 + Debug-Static Win32 @@ -17,6 +25,10 @@ Debug-Static x64 + + Debug + ARM64 + Debug Win32 @@ -25,6 +37,10 @@ Debug x64 + + Release-Dynamic + ARM64 + Release-Dynamic Win32 @@ -33,6 +49,10 @@ Release-Dynamic x64 + + Release-Static + ARM64 + Release-Static Win32 @@ -41,6 +61,10 @@ Release-Static x64 + + Release + ARM64 + Release Win32 @@ -51,10 +75,10 @@ - + {ED02BE13-8297-4770-8097-27DC2CCABF9A} - pjlib_util_test + pjlib_util_test en-US @@ -101,40 +125,77 @@ false MultiByte + + Application + v140 + false + MultiByte + Application v140 false MultiByte + + Application + v140 + false + MultiByte + Application v140 false MultiByte + + Application + v140 + false + MultiByte + Application v140 false MultiByte + + Application + v140 + false + MultiByte + Application v140 false MultiByte + + Application + v140 + false + MultiByte + Application v140 false MultiByte + + Application + v140 + false + MultiByte + $(BuildToolset) - + + Application StaticLibrary @@ -176,35 +237,65 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>14.0.22823.1 - pjlib-util-test-$(TargetCPU)-$(Platform)-vc$(VSVer)-$(Configuration) + pjlib-util-test-$(TargetCPU)-$(Platform)-vc$(VSVer)-$(Configuration) @@ -235,21 +326,39 @@ pjlib-util-test-$(TargetCPU)-$(Platform)-vc$(VSVer)-$(Configuration) + + pjlib-util-test-$(TargetCPU)-$(Platform)-vc$(VSVer)-$(Configuration) + pjlib-util-test-$(TargetCPU)-$(Platform)-vc$(VSVer)-$(Configuration) + + pjlib-util-test-$(TargetCPU)-$(Platform)-vc$(VSVer)-$(Configuration) + pjlib-util-test-$(TargetCPU)-$(Platform)-vc$(VSVer)-$(Configuration) + + pjlib-util-test-$(TargetCPU)-$(Platform)-vc$(VSVer)-$(Configuration) + pjlib-util-test-$(TargetCPU)-$(Platform)-vc$(VSVer)-$(Configuration) + + pjlib-util-test-$(TargetCPU)-$(Platform)-vc$(VSVer)-$(Configuration) + pjlib-util-test-$(TargetCPU)-$(Platform)-vc$(VSVer)-$(Configuration) + + pjlib-util-test-$(TargetCPU)-$(Platform)-vc$(VSVer)-$(Configuration) + pjlib-util-test-$(TargetCPU)-$(Platform)-vc$(VSVer)-$(Configuration) + + pjlib-util-test-$(TargetCPU)-$(Platform)-vc$(VSVer)-$(Configuration) + ../include;../../pjlib/include;%(AdditionalIncludeDirectories) @@ -276,6 +385,19 @@ MachineX64 + + + + ../include;../../pjlib/include;%(AdditionalIncludeDirectories) + _CONSOLE;%(PreprocessorDefinitions) + + + + + netapi32.lib;mswsock.lib;ws2_32.lib;odbc32.lib;odbccp32.lib;oleaut32.lib;ole32.lib;%(AdditionalDependencies) + ..\bin\pjlib-util-test-$(TargetCPU)-$(Platform)-vc$(VSVer)-$(Configuration).exe + + ../include;../../pjlib/include;%(AdditionalIncludeDirectories) @@ -303,6 +425,20 @@ MachineX64 + + + + ../include;../../pjlib/include;%(AdditionalIncludeDirectories) + _CONSOLE;%(PreprocessorDefinitions) + + + ProgramDatabase + + + netapi32.lib;mswsock.lib;ws2_32.lib;odbc32.lib;odbccp32.lib;oleaut32.lib;ole32.lib;%(AdditionalDependencies) + ..\bin\pjlib-util-test-$(TargetCPU)-$(Platform)-vc$(VSVer)-$(Configuration).exe + + ../include;../../pjlib/include;%(AdditionalIncludeDirectories) @@ -330,6 +466,20 @@ MachineX64 + + + + ../include;../../pjlib/include;%(AdditionalIncludeDirectories) + _CONSOLE;%(PreprocessorDefinitions) + + + ProgramDatabase + + + netapi32.lib;mswsock.lib;ws2_32.lib;odbc32.lib;odbccp32.lib;oleaut32.lib;ole32.lib;%(AdditionalDependencies) + ..\bin\pjlib-util-test-$(TargetCPU)-$(Platform)-vc$(VSVer)-$(Configuration).exe + + ../include;../../pjlib/include;%(AdditionalIncludeDirectories) @@ -356,6 +506,19 @@ MachineX64 + + + + ../include;../../pjlib/include;%(AdditionalIncludeDirectories) + _CONSOLE;%(PreprocessorDefinitions) + + + + + netapi32.lib;mswsock.lib;ws2_32.lib;odbc32.lib;odbccp32.lib;oleaut32.lib;ole32.lib;%(AdditionalDependencies) + ..\bin\pjlib-util-test-$(TargetCPU)-$(Platform)-vc$(VSVer)-$(Configuration).exe + + ../include;../../pjlib/include;%(AdditionalIncludeDirectories) @@ -383,6 +546,20 @@ MachineX64 + + + + ../include;../../pjlib/include;%(AdditionalIncludeDirectories) + _CONSOLE;%(PreprocessorDefinitions) + + + ProgramDatabase + + + netapi32.lib;mswsock.lib;ws2_32.lib;odbc32.lib;odbccp32.lib;oleaut32.lib;ole32.lib;%(AdditionalDependencies) + ..\bin\pjlib-util-test-$(TargetCPU)-$(Platform)-vc$(VSVer)-$(Configuration).exe + + ../include;../../pjlib/include;%(AdditionalIncludeDirectories) @@ -409,6 +586,19 @@ MachineX64 + + + + ../include;../../pjlib/include;%(AdditionalIncludeDirectories) + _CONSOLE;%(PreprocessorDefinitions) + + + + + netapi32.lib;mswsock.lib;ws2_32.lib;odbc32.lib;odbccp32.lib;oleaut32.lib;ole32.lib;%(AdditionalDependencies) + ..\bin\pjlib-util-test-$(TargetCPU)-$(Platform)-vc$(VSVer)-$(Configuration).exe + + @@ -417,16 +607,22 @@ true true + true true true + true true true + true true true + true true true + true true true + true diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjlib-util/build/pjlib_util.vcxproj asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjlib-util/build/pjlib_util.vcxproj --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjlib-util/build/pjlib_util.vcxproj 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjlib-util/build/pjlib_util.vcxproj 2022-02-24 07:54:38.000000000 +0000 @@ -5,6 +5,10 @@ Debug-Dynamic ARM + + Debug-Dynamic + ARM64 + Debug-Dynamic Win32 @@ -17,6 +21,10 @@ Debug-Static ARM + + Debug-Static + ARM64 + Debug-Static Win32 @@ -29,6 +37,10 @@ Debug ARM + + Debug + ARM64 + Debug Win32 @@ -41,6 +53,10 @@ Release-Dynamic ARM + + Release-Dynamic + ARM64 + Release-Dynamic Win32 @@ -53,6 +69,10 @@ Release-Static ARM + + Release-Static + ARM64 + Release-Static Win32 @@ -65,6 +85,10 @@ Release ARM + + Release + ARM64 + Release Win32 @@ -78,7 +102,7 @@ {FE07F272-AE7F-4549-9E9F-EF9B80CB1693} - pjlib_util + pjlib_util en-US @@ -161,40 +185,77 @@ false MultiByte + + StaticLibrary + v140 + false + MultiByte + StaticLibrary v140 false MultiByte + + StaticLibrary + v140 + false + MultiByte + StaticLibrary v140 false MultiByte + + StaticLibrary + v140 + false + MultiByte + StaticLibrary v140 false MultiByte + + StaticLibrary + v140 + false + MultiByte + StaticLibrary v140 false MultiByte + + StaticLibrary + v140 + false + MultiByte + StaticLibrary v140 false MultiByte + + StaticLibrary + v140 + false + MultiByte + $(BuildToolset) - + + @@ -264,34 +325,64 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - <_ProjectFileVersion>14.0.22823.1 + <_ProjectFileVersion>14.0.22823.1 pjlib-util-$(TargetCPU)-$(Platform)-vc$(VSVer)-$(Configuration) @@ -334,6 +425,18 @@ ..\lib\pjlib-util-$(TargetCPU)-$(Platform)-vc$(VSVer)-$(Configuration).lib + + + + ../include;../../pjlib/include;%(AdditionalIncludeDirectories) + _LIB;%(PreprocessorDefinitions) + + + + + ..\lib\pjlib-util-$(TargetCPU)-$(Platform)-vc$(VSVer)-$(Configuration).lib + + ../include;../../pjlib/include;%(AdditionalIncludeDirectories) @@ -369,6 +472,19 @@ ..\lib\pjlib-util-$(TargetCPU)-$(Platform)-vc$(VSVer)-$(Configuration).lib + + + + ../include;../../pjlib/include;%(AdditionalIncludeDirectories) + _LIB;%(PreprocessorDefinitions) + + + ProgramDatabase + + + ..\lib\pjlib-util-$(TargetCPU)-$(Platform)-vc$(VSVer)-$(Configuration).lib + + ../include;../../pjlib/include;%(AdditionalIncludeDirectories) @@ -404,6 +520,19 @@ ..\lib\pjlib-util-$(TargetCPU)-$(Platform)-vc$(VSVer)-$(Configuration).lib + + + + ../include;../../pjlib/include;%(AdditionalIncludeDirectories) + _LIB;%(PreprocessorDefinitions) + + + ProgramDatabase + + + ..\lib\pjlib-util-$(TargetCPU)-$(Platform)-vc$(VSVer)-$(Configuration).lib + + ../include;../../pjlib/include;%(AdditionalIncludeDirectories) @@ -438,6 +567,18 @@ ..\lib\pjlib-util-$(TargetCPU)-$(Platform)-vc$(VSVer)-$(Configuration).lib + + + + ../include;../../pjlib/include;%(AdditionalIncludeDirectories) + _LIB;%(PreprocessorDefinitions) + + + + + ..\lib\pjlib-util-$(TargetCPU)-$(Platform)-vc$(VSVer)-$(Configuration).lib + + ../include;../../pjlib/include;%(AdditionalIncludeDirectories) @@ -473,6 +614,19 @@ ..\lib\pjlib-util-$(TargetCPU)-$(Platform)-vc$(VSVer)-$(Configuration).lib + + + + ../include;../../pjlib/include;%(AdditionalIncludeDirectories) + _LIB;%(PreprocessorDefinitions) + + + ProgramDatabase + + + ..\lib\pjlib-util-$(TargetCPU)-$(Platform)-vc$(VSVer)-$(Configuration).lib + + ../include;../../pjlib/include;%(AdditionalIncludeDirectories) @@ -507,6 +661,18 @@ ..\lib\pjlib-util-$(TargetCPU)-$(Platform)-vc$(VSVer)-$(Configuration).lib + + + + ../include;../../pjlib/include;%(AdditionalIncludeDirectories) + _LIB;%(PreprocessorDefinitions) + + + + + ..\lib\pjlib-util-$(TargetCPU)-$(Platform)-vc$(VSVer)-$(Configuration).lib + + @@ -530,41 +696,53 @@ true true true + true true true true + true true true true + true true true true + true true true true + true true true true + true true true true + true true true true + true true true true + true true true true + true true true true + true true true true + true diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjlib-util/include/pjlib-util/cli.h asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjlib-util/include/pjlib-util/cli.h --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjlib-util/include/pjlib-util/cli.h 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjlib-util/include/pjlib-util/cli.h 2022-02-24 07:54:38.000000000 +0000 @@ -289,7 +289,7 @@ * This specifies the callback type for command handlers, which will be * executed when the specified command is invoked. * - * @param cmd_val The command that is specified by the user. + * @param cval The command that is specified by the user. * * @return Return the status of the command execution. */ @@ -390,7 +390,7 @@ /** * Register a front end to the CLI application. * - * @param CLI The CLI application. + * @param cli The CLI application. * @param fe The CLI front end to be registered. */ PJ_DECL(void) pj_cli_register_front_end(pj_cli_t *cli, diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjlib-util/include/pjlib-util/cli_telnet.h asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjlib-util/include/pjlib-util/cli_telnet.h --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjlib-util/include/pjlib-util/cli_telnet.h 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjlib-util/include/pjlib-util/cli_telnet.h 2022-02-24 07:54:38.000000000 +0000 @@ -151,7 +151,7 @@ /** * Retrieve cli telnet info. * - * @param telnet_info The telnet runtime information. + * @param info The telnet runtime information. * * @return PJ_SUCCESS on success. */ diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjlib-util/include/pjlib-util/config.h asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjlib-util/include/pjlib-util/config.h --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjlib-util/include/pjlib-util/config.h 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjlib-util/include/pjlib-util/config.h 2022-02-24 07:54:38.000000000 +0000 @@ -352,10 +352,10 @@ /** * Maximum number of argument values of choice type. - * Default: 16 + * Default: 64 */ #ifndef PJ_CLI_MAX_CHOICE_VAL -# define PJ_CLI_MAX_CHOICE_VAL 16 +# define PJ_CLI_MAX_CHOICE_VAL 64 #endif /** diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjlib-util/include/pjlib-util/http_client.h asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjlib-util/include/pjlib-util/http_client.h --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjlib-util/include/pjlib-util/http_client.h 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjlib-util/include/pjlib-util/http_client.h 2022-02-24 07:54:38.000000000 +0000 @@ -357,7 +357,7 @@ * * @param headers The headers. * @param name The header field name. - * @param value The header field value. + * @param val The header field value. * * @return PJ_SUCCESS if the operation has been successful, * or the appropriate error code on failure. @@ -373,7 +373,7 @@ * * @param headers The headers. * @param name The header field name. - * @param value The header field value. + * @param val The header field value. * * @return PJ_SUCCESS if the operation has been successful, * or the appropriate error code on failure. diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjlib-util/src/pjlib-util/cli_telnet.c asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjlib-util/src/pjlib-util/cli_telnet.c --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjlib-util/src/pjlib-util/cli_telnet.c 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjlib-util/src/pjlib-util/cli_telnet.c 2022-02-24 07:54:38.000000000 +0000 @@ -385,14 +385,14 @@ { cmd_history *in_history; pj_str_t cmd; - cmd.ptr = cmd_val; - cmd.slen = pj_ansi_strlen(cmd_val)-1; + PJ_ASSERT_RETURN(sess, PJ_EINVAL); + + cmd = pj_str(cmd_val); + pj_strtrim(&cmd); if (cmd.slen == 0) return PJ_SUCCESS; - PJ_ASSERT_RETURN(sess, PJ_EINVAL); - /* Find matching history */ in_history = pj_list_search(sess->history, (void*)&cmd, compare_str); if (!in_history) { @@ -407,11 +407,12 @@ } else { /* Get the oldest history */ in_history = sess->history->prev; + pj_list_erase(in_history); } + pj_strncpy(&in_history->command, &cmd, PJ_CLI_MAX_CMDBUF); } else { - pj_list_insert_nodes_after(in_history->prev, in_history->next); + pj_list_erase(in_history); } - pj_strcpy(&in_history->command, pj_strtrim(&cmd)); pj_list_push_front(sess->history, in_history); sess->active_history = sess->history; @@ -1408,9 +1409,15 @@ pj_mutex_unlock(tfe->mutex); - pj_activesock_close(tfe->asock); - if (tfe->own_ioqueue) + if (tfe->asock) { + pj_activesock_close(tfe->asock); + tfe->asock = NULL; + } + + if (tfe->own_ioqueue && tfe->cfg.ioqueue) { pj_ioqueue_destroy(tfe->cfg.ioqueue); + tfe->cfg.ioqueue = NULL; + } if (tfe->worker_thread) { pj_thread_destroy(tfe->worker_thread); @@ -1418,6 +1425,7 @@ } pj_mutex_destroy(tfe->mutex); + pj_pool_release(tfe->pool); } @@ -1486,6 +1494,7 @@ if (status != PJ_SUCCESS && status != PJ_EPENDING) { TRACE_((THIS_FILE, "Error on data read %d", status)); + pj_cli_sess_end_session(&sess->base); return PJ_FALSE; } @@ -1497,8 +1506,15 @@ if (*cdata == 0 || *cdata == '\n') { pj_mutex_unlock(sess->smutex); is_valid = handle_return(sess); - if (!is_valid) + if (!is_valid) { + // handle_return() can only return PJ_FALSE if + // pj_cli_sess_exec() returns PJ_CLI_EEXIT, + // in which case CLI session has been ended by + // cmd_handler() of CLI_CMD_EXIT. + // + // pj_cli_sess_end_session(&sess->base); return PJ_FALSE; + } pj_mutex_lock(sess->smutex); } break; @@ -1602,9 +1618,18 @@ return PJ_FALSE; if (status != PJ_SUCCESS && status != PJ_EPENDING) { - TRACE_((THIS_FILE, "Error on data accept %d", status)); - if (status == PJ_ESOCKETSTOP) - telnet_restart(fe); + TRACE_((THIS_FILE, "Error on data accept (status=%d)", status)); + if (status == PJ_ESOCKETSTOP) { + sstatus = telnet_restart(fe); + if (sstatus != PJ_SUCCESS) { + if (fe->own_ioqueue && fe->cfg.ioqueue) { + pj_ioqueue_destroy(fe->cfg.ioqueue); + fe->cfg.ioqueue = NULL; + } + TRACE_((THIS_FILE, "Error restarting telnet (status=%d)", + status)); + } + } return PJ_FALSE; } @@ -1749,14 +1774,20 @@ if (p_fe) *p_fe = &fe->base; + TRACE_((THIS_FILE, "Telnet started")); + return PJ_SUCCESS; on_exit: - if (fe->own_ioqueue) + if (fe->own_ioqueue && fe->cfg.ioqueue) { pj_ioqueue_destroy(fe->cfg.ioqueue); + fe->cfg.ioqueue = NULL; + } - if (fe->mutex) + if (fe->mutex) { pj_mutex_destroy(fe->mutex); + fe->mutex = NULL; + } pj_pool_release(pool); return status; @@ -1856,18 +1887,14 @@ (*fe->cfg.on_started)(status); } - if (fe->asock) + if (fe->asock) { pj_activesock_close(fe->asock); - else if (sock != PJ_INVALID_SOCKET) + fe->asock = NULL; + } else if (sock != PJ_INVALID_SOCKET) { pj_sock_close(sock); + sock = PJ_INVALID_SOCKET; + } - if (fe->own_ioqueue) - pj_ioqueue_destroy(fe->cfg.ioqueue); - - if (fe->mutex) - pj_mutex_destroy(fe->mutex); - - pj_pool_release(fe->pool); return status; } @@ -1879,6 +1906,8 @@ fe->is_quitting = PJ_TRUE; if (fe->worker_thread) { pj_thread_join(fe->worker_thread); + pj_thread_destroy(fe->worker_thread); + fe->worker_thread = NULL; } pj_mutex_lock(fe->mutex); @@ -1897,21 +1926,20 @@ if (status != PJ_SUCCESS) goto on_exit; - if (fe->worker_thread) { - pj_thread_destroy(fe->worker_thread); - fe->worker_thread = NULL; - } - + fe->asock = NULL; fe->is_quitting = PJ_FALSE; /** Start Telnet **/ status = telnet_start(fe); - if (status == PJ_SUCCESS) { - if (fe->cfg.on_started) { - (*fe->cfg.on_started)(status); - } - TRACE_((THIS_FILE, "Telnet Restarted")); + if (status != PJ_SUCCESS) + goto on_exit; + + if (fe->cfg.on_started) { + (*fe->cfg.on_started)(PJ_SUCCESS); } + + TRACE_((THIS_FILE, "Telnet restarted")); + on_exit: return status; } diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjlib-util/src/pjlib-util/scanner.c asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjlib-util/src/pjlib-util/scanner.c --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjlib-util/src/pjlib-util/scanner.c 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjlib-util/src/pjlib-util/scanner.c 2022-02-24 07:54:38.000000000 +0000 @@ -195,7 +195,7 @@ PJ_DEF(void) pj_scan_skip_line( pj_scanner *scanner ) { - char *s = pj_ansi_strchr(scanner->curptr, '\n'); + char *s = pj_memchr(scanner->curptr, '\n', scanner->end - scanner->curptr); if (!s) { scanner->curptr = scanner->end; } else { @@ -444,16 +444,21 @@ PJ_DEF(int) pj_scan_get_char( pj_scanner *scanner ) { - int chr = *scanner->curptr; + register char *s = scanner->curptr; + int chr; - if (!chr) { + if (s >= scanner->end || !*s) { pj_scan_syntax_err(scanner); return 0; } - ++scanner->curptr; + chr = *s; - if (PJ_SCAN_IS_PROBABLY_SPACE(*scanner->curptr) && scanner->skip_ws) { + ++s; + scanner->curptr = s; + if (PJ_SCAN_CHECK_EOF(s) && PJ_SCAN_IS_PROBABLY_SPACE(*s) && + scanner->skip_ws) + { pj_scan_skip_whitespace(scanner); } return chr; diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjlib-util/src/pjlib-util-test/main.c asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjlib-util/src/pjlib-util-test/main.c --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjlib-util/src/pjlib-util-test/main.c 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjlib-util/src/pjlib-util-test/main.c 2022-02-24 07:54:38.000000000 +0000 @@ -21,6 +21,7 @@ #include #if defined(PJ_SUNOS) && PJ_SUNOS!=0 + #include static void init_signals() { @@ -32,8 +33,34 @@ sigaction(SIGALRM, &act, NULL); } +#elif PJ_LINUX || PJ_DARWINOS + +#include +#include +#include +#include +#include +static void print_stack(int sig) +{ + void *array[16]; + size_t size; + + size = backtrace(array, 16); + fprintf(stderr, "Error: signal %d:\n", sig); + backtrace_symbols_fd(array, size, STDERR_FILENO); + exit(1); +} + +static void init_signals(void) +{ + signal(SIGSEGV, &print_stack); + signal(SIGABRT, &print_stack); +} + #else + #define init_signals() + #endif #define boost() @@ -41,23 +68,35 @@ int main(int argc, char *argv[]) { int rc; - - PJ_UNUSED_ARG(argc); - PJ_UNUSED_ARG(argv); + int interractive = 0; + int no_trap = 0; boost(); - init_signals(); + + while (argc > 1) { + char *arg = argv[--argc]; + + if (*arg=='-' && *(arg+1)=='i') { + interractive = 1; + + } else if (*arg=='-' && *(arg+1)=='n') { + no_trap = 1; + } + } + + if (!no_trap) { + init_signals(); + } rc = test_main(); - if (argc==2 && pj_ansi_strcmp(argv[1], "-i")==0) { + if (interractive) { char s[10]; - - puts("Press ENTER to quit"); - if (fgets(s, sizeof(s), stdin) == NULL) + puts(""); + puts("Press to exit"); + if (!fgets(s, sizeof(s), stdin)) return rc; } return rc; } - diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjlib-util/src/pjlib-util-test/resolver_test.c asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjlib-util/src/pjlib-util-test/resolver_test.c --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjlib-util/src/pjlib-util-test/resolver_test.c 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjlib-util/src/pjlib-util-test/resolver_test.c 2022-02-24 07:54:38.000000000 +0000 @@ -37,6 +37,9 @@ #define ACTION_IGNORE -1 #define ACTION_CB -2 +#undef s6_addr32 +#define s6_addr32(addr, idx) *((pj_uint32_t *)(addr.s6_addr + idx*4)) + static struct server_t { pj_sock_t sock; @@ -376,8 +379,15 @@ } /* Verify packet */ - pj_assert(req->hdr.qdcount == 1); - pj_assert(req->q[0].dnsclass == 1); + if (req->hdr.qdcount != 1) { + PJ_LOG(5,(THIS_FILE, "server receive multiple queries in a packet")); + continue; + } + + if (req->q[0].dnsclass != 1) { + PJ_LOG(5,(THIS_FILE, "server receive query with invalid DNS class")); + continue; + } /* Simulate network RTT */ pj_thread_sleep(50); @@ -767,7 +777,7 @@ pkt.ans[3].type = PJ_DNS_TYPE_AAAA; pkt.ans[3].dnsclass = 1; pkt.ans[3].ttl = 1; - pkt.ans[3].rdata.aaaa.ip_addr.u6_addr32[0] = 0x01020304; + s6_addr32(pkt.ans[3].rdata.aaaa.ip_addr, 0) = 0x01020304; rc = pj_dns_parse_addr_response(&pkt, &rec); @@ -776,7 +786,7 @@ pj_assert(rec.alias.slen == 0); pj_assert(rec.addr_count == 2); pj_assert(rec.addr[0].af==pj_AF_INET() && rec.addr[0].ip.v4.s_addr == 0x01020304); - pj_assert(rec.addr[1].af==pj_AF_INET6() && rec.addr[1].ip.v6.u6_addr32[0] == 0x01020304); + pj_assert(rec.addr[1].af==pj_AF_INET6() && s6_addr32(rec.addr[1].ip.v6, 0) == 0x01020304); /* Answer with the target corresponds to a CNAME entry, but not * as the first record, and with additions of some CNAME and A @@ -1044,13 +1054,12 @@ pj_sem_wait(sem); pj_thread_sleep(1000); - /* Now only server 0 should get packet, since both servers are + /* Now only one of the servers should get packet, since both servers are * in STATE_ACTIVE state */ - pj_assert((g_server[0].pkt_count == 1 && g_server[1].pkt_count == 0) || - (g_server[1].pkt_count == 1 && g_server[0].pkt_count == 0)); + pj_assert(g_server[0].pkt_count + g_server[1].pkt_count == 1); - /* Wait to allow probing period to complete */ + /* Wait to allow active period to complete and get into probing state */ PJ_LOG(3,(THIS_FILE, " waiting for active NS to expire (%d sec)", set.good_ns_ttl)); pj_thread_sleep(set.good_ns_ttl * 1000); @@ -1073,9 +1082,12 @@ pj_sem_wait(sem); + /* Both servers must get packet as both are in probing state */ + pj_assert(g_server[0].pkt_count >= 1 && g_server[1].pkt_count == 1); + /* * Check that both servers still receive requests, since they are - * in probing state. + * in probing & active state. */ PJ_LOG(3,(THIS_FILE, " checking both NS during probing period")); g_server[0].action = ACTION_IGNORE; @@ -1091,13 +1103,12 @@ return -1000; pj_sem_wait(sem); - pj_thread_sleep(set.qretr_delay * set.qretr_count); + pj_thread_sleep(1000); - /* Both servers must get requests */ - pj_assert(g_server[0].pkt_count >= 1); - pj_assert(g_server[1].pkt_count == 1); + /* Both servers must get packet as both are in probing & active state */ + pj_assert(g_server[0].pkt_count >= 1 && g_server[1].pkt_count == 1); - /* Wait to allow probing period to complete */ + /* Wait to allow probing period to complete, server 0 will be in bad state */ PJ_LOG(3,(THIS_FILE, " waiting for probing state to end (%d sec)", set.qretr_delay * (set.qretr_count+2) / 1000)); @@ -1123,11 +1134,11 @@ pj_sem_wait(sem); pj_thread_sleep(1000); - /* Both servers must get requests */ + /* Only server 1 get the request */ pj_assert(g_server[0].pkt_count == 0); pj_assert(g_server[1].pkt_count == 1); - /* Wait to allow probing period to complete */ + /* Wait to allow active & bad period to complete, both will be in probing state */ PJ_LOG(3,(THIS_FILE, " waiting for active NS to expire (%d sec)", set.good_ns_ttl)); pj_thread_sleep(set.good_ns_ttl * 1000); @@ -1149,10 +1160,10 @@ pj_sem_wait(sem); - /* Wait to allow probing period to complete */ + /* Wait to allow probing period to complete, server 0 remains active, server 1 will be bad */ PJ_LOG(3,(THIS_FILE, " waiting for probing state (%d sec)", set.qretr_delay * (set.qretr_count+2) / 1000)); - pj_thread_sleep(set.qretr_delay * (set.qretr_count + 2)); + pj_thread_sleep(1000 + set.qretr_delay * (set.qretr_count + 2)); /* * Now only server 0 should get requests. @@ -1256,10 +1267,10 @@ res->ans[1].dnsclass = 1; res->ans[1].ttl = 1; res->ans[1].name = pj_str(alias); - res->ans[1].rdata.aaaa.ip_addr.u6_addr32[0] = IP_ADDR1; - res->ans[1].rdata.aaaa.ip_addr.u6_addr32[1] = IP_ADDR1; - res->ans[1].rdata.aaaa.ip_addr.u6_addr32[2] = IP_ADDR1; - res->ans[1].rdata.aaaa.ip_addr.u6_addr32[3] = IP_ADDR1; + s6_addr32(res->ans[1].rdata.aaaa.ip_addr, 0) = IP_ADDR1; + s6_addr32(res->ans[1].rdata.aaaa.ip_addr, 1) = IP_ADDR1; + s6_addr32(res->ans[1].rdata.aaaa.ip_addr, 2) = IP_ADDR1; + s6_addr32(res->ans[1].rdata.aaaa.ip_addr, 3) = IP_ADDR1; } *p_res = res; @@ -1329,7 +1340,7 @@ PJ_ASSERT_ON_FAIL(rec->entry[0].server.addr[0].af == pj_AF_INET() && rec->entry[0].server.addr[0].ip.v4.s_addr == IP_ADDR1, return); PJ_ASSERT_ON_FAIL(rec->entry[0].server.addr[1].af == pj_AF_INET6() && - rec->entry[0].server.addr[1].ip.v6.u6_addr32[0] == IP_ADDR1, return); + s6_addr32(rec->entry[0].server.addr[1].ip.v6, 0) == IP_ADDR1, return); } @@ -1355,7 +1366,7 @@ /* IPv6 only */ PJ_ASSERT_ON_FAIL(rec->entry[0].server.addr_count == 1, return); PJ_ASSERT_ON_FAIL(rec->entry[0].server.addr[0].af == pj_AF_INET6() && - rec->entry[0].server.addr[0].ip.v6.u6_addr32[0] == IP_ADDR1, return); + s6_addr32(rec->entry[0].server.addr[0].ip.v6, 0) == IP_ADDR1, return); } @@ -1365,6 +1376,8 @@ pj_str_t domain = pj_str("somedomain.com"); pj_str_t res_name = pj_str("_sip._udp."); + /* Last servers state: server 0=active, server 1=bad*/ + /* Successful scenario */ PJ_LOG(3,(THIS_FILE, " srv_resolve(): success scenario")); @@ -1387,10 +1400,9 @@ pj_assert(g_server[1].pkt_count == 0); - /* Wait until cache expires and nameserver state moves out from STATE_PROBING */ - PJ_LOG(3,(THIS_FILE, " waiting for cache to expire (~15 secs)..")); - pj_thread_sleep(1000 + - ((set.qretr_count + 2) * set.qretr_delay)); + /* Wait until cache expires */ + PJ_LOG(3,(THIS_FILE, " waiting for cache to expire (~1 secs)..")); + pj_thread_sleep(1000 + 100); /* DNS SRV option PJ_DNS_SRV_RESOLVE_AAAA */ @@ -1410,7 +1422,6 @@ pj_assert(status == PJ_SUCCESS); pj_sem_wait(sem); - pj_thread_sleep(1000); /* DNS SRV option PJ_DNS_SRV_RESOLVE_AAAA_ONLY */ @@ -1430,7 +1441,6 @@ pj_assert(status == PJ_SUCCESS); pj_sem_wait(sem); - pj_thread_sleep(1000); @@ -1458,7 +1468,7 @@ /* Since TTL is one, subsequent queries should fail */ PJ_LOG(3,(THIS_FILE, " srv_resolve(): cache expires scenario")); - pj_thread_sleep(1000); + pj_thread_sleep(1000 + 100); g_server[0].action = PJ_DNS_RCODE_NXDOMAIN; g_server[1].action = PJ_DNS_RCODE_NXDOMAIN; @@ -1468,7 +1478,7 @@ pj_assert(status == PJ_SUCCESS); pj_sem_wait(sem); - + pj_thread_sleep(1000); return status; } @@ -1544,87 +1554,91 @@ res->ans[1].dnsclass = 1; res->ans[1].ttl = 1; res->ans[1].name = pj_str(alias); - res->ans[1].rdata.aaaa.ip_addr.u6_addr32[0] = IP_ADDR2; - res->ans[1].rdata.aaaa.ip_addr.u6_addr32[1] = IP_ADDR2; - res->ans[1].rdata.aaaa.ip_addr.u6_addr32[2] = IP_ADDR2; - res->ans[1].rdata.aaaa.ip_addr.u6_addr32[3] = IP_ADDR2; + s6_addr32(res->ans[1].rdata.aaaa.ip_addr, 0) = IP_ADDR2; + s6_addr32(res->ans[1].rdata.aaaa.ip_addr, 1) = IP_ADDR2; + s6_addr32(res->ans[1].rdata.aaaa.ip_addr, 2) = IP_ADDR2; + s6_addr32(res->ans[1].rdata.aaaa.ip_addr, 3) = IP_ADDR2; } *p_res = res; } +#define SRV_CB_CHECK(cond, err) if(!(cond)) { *cb_err=err; goto on_return; } + static void srv_cb_2(void *user_data, pj_status_t status, const pj_dns_srv_record *rec) { - PJ_UNUSED_ARG(user_data); + int *cb_err = (int*)user_data; - pj_sem_post(sem); - - PJ_ASSERT_ON_FAIL(status == PJ_SUCCESS, return); - PJ_ASSERT_ON_FAIL(rec->count == 1, return); - PJ_ASSERT_ON_FAIL(rec->entry[0].priority == 0, return); - PJ_ASSERT_ON_FAIL(rec->entry[0].weight == 0, return); - PJ_ASSERT_ON_FAIL(pj_strcmp2(&rec->entry[0].server.name, TARGET)==0, - return); - PJ_ASSERT_ON_FAIL(pj_strcmp2(&rec->entry[0].server.alias, "sipalias01." TARGET)==0, - return); - PJ_ASSERT_ON_FAIL(rec->entry[0].port == PORT2, return); + SRV_CB_CHECK(status == PJ_SUCCESS, -10); + SRV_CB_CHECK(rec->count == 1, -20); + SRV_CB_CHECK(rec->entry[0].priority == 0, -30); + SRV_CB_CHECK(rec->entry[0].weight == 0, -40); + SRV_CB_CHECK(pj_strcmp2(&rec->entry[0].server.name, TARGET)==0, -50); + SRV_CB_CHECK(pj_strcmp2(&rec->entry[0].server.alias, + "sipalias01." TARGET)==0, -60); + SRV_CB_CHECK(rec->entry[0].port == PORT2, -70); /* IPv4 only */ - PJ_ASSERT_ON_FAIL(rec->entry[0].server.addr_count == 1, return); - PJ_ASSERT_ON_FAIL(rec->entry[0].server.addr[0].af == pj_AF_INET() && - rec->entry[0].server.addr[0].ip.v4.s_addr == IP_ADDR2, return); + SRV_CB_CHECK(rec->entry[0].server.addr_count == 1, -80); + SRV_CB_CHECK(rec->entry[0].server.addr[0].af == pj_AF_INET() && + rec->entry[0].server.addr[0].ip.v4.s_addr == IP_ADDR2, -90); + +on_return: + pj_sem_post(sem); } static void srv_cb_2a(void *user_data, pj_status_t status, const pj_dns_srv_record *rec) { - PJ_UNUSED_ARG(user_data); + int *cb_err = (int*)user_data; - pj_sem_post(sem); - - PJ_ASSERT_ON_FAIL(status == PJ_SUCCESS, return); - PJ_ASSERT_ON_FAIL(rec->count == 1, return); - PJ_ASSERT_ON_FAIL(rec->entry[0].priority == 0, return); - PJ_ASSERT_ON_FAIL(rec->entry[0].weight == 0, return); - PJ_ASSERT_ON_FAIL(pj_strcmp2(&rec->entry[0].server.name, TARGET)==0, - return); - PJ_ASSERT_ON_FAIL(pj_strcmp2(&rec->entry[0].server.alias, "sipalias01." TARGET)==0, - return); - PJ_ASSERT_ON_FAIL(rec->entry[0].port == PORT2, return); + SRV_CB_CHECK(status == PJ_SUCCESS, -10); + SRV_CB_CHECK(rec->count == 1, -20); + SRV_CB_CHECK(rec->entry[0].priority == 0, -30); + SRV_CB_CHECK(rec->entry[0].weight == 0, -40); + SRV_CB_CHECK(pj_strcmp2(&rec->entry[0].server.name, TARGET)==0, -50); + SRV_CB_CHECK(pj_strcmp2(&rec->entry[0].server.alias, + "sipalias01." TARGET)==0, -60); + SRV_CB_CHECK(rec->entry[0].port == PORT2, -70); /* IPv4 and IPv6 */ - PJ_ASSERT_ON_FAIL(rec->entry[0].server.addr_count == 2, return); - PJ_ASSERT_ON_FAIL(rec->entry[0].server.addr[0].af == pj_AF_INET() && - rec->entry[0].server.addr[0].ip.v4.s_addr == IP_ADDR2, return); - PJ_ASSERT_ON_FAIL(rec->entry[0].server.addr[1].af == pj_AF_INET6() && - rec->entry[0].server.addr[1].ip.v6.u6_addr32[0] == IP_ADDR2, return); + SRV_CB_CHECK(rec->entry[0].server.addr_count == 2, -80); + SRV_CB_CHECK(rec->entry[0].server.addr[0].af == pj_AF_INET() && + rec->entry[0].server.addr[0].ip.v4.s_addr == IP_ADDR2, -90); + SRV_CB_CHECK(rec->entry[0].server.addr[1].af == pj_AF_INET6() && + s6_addr32(rec->entry[0].server.addr[1].ip.v6, 0) == IP_ADDR2, + -100); + +on_return: + pj_sem_post(sem); } static void srv_cb_2b(void *user_data, pj_status_t status, const pj_dns_srv_record *rec) { - PJ_UNUSED_ARG(user_data); + int *cb_err = (int*)user_data; - pj_sem_post(sem); - - PJ_ASSERT_ON_FAIL(status == PJ_SUCCESS, return); - PJ_ASSERT_ON_FAIL(rec->count == 1, return); - PJ_ASSERT_ON_FAIL(rec->entry[0].priority == 0, return); - PJ_ASSERT_ON_FAIL(rec->entry[0].weight == 0, return); - PJ_ASSERT_ON_FAIL(pj_strcmp2(&rec->entry[0].server.name, TARGET)==0, - return); - PJ_ASSERT_ON_FAIL(pj_strcmp2(&rec->entry[0].server.alias, "sipalias01." TARGET)==0, - return); - PJ_ASSERT_ON_FAIL(rec->entry[0].port == PORT2, return); + SRV_CB_CHECK(status == PJ_SUCCESS, -10); + SRV_CB_CHECK(rec->count == 1, -20); + SRV_CB_CHECK(rec->entry[0].priority == 0, -30); + SRV_CB_CHECK(rec->entry[0].weight == 0, -40); + SRV_CB_CHECK(pj_strcmp2(&rec->entry[0].server.name, TARGET)==0, -50); + SRV_CB_CHECK(pj_strcmp2(&rec->entry[0].server.alias, + "sipalias01." TARGET)==0, -60); + SRV_CB_CHECK(rec->entry[0].port == PORT2, -70); /* IPv6 only */ - PJ_ASSERT_ON_FAIL(rec->entry[0].server.addr_count == 1, return); - PJ_ASSERT_ON_FAIL(rec->entry[0].server.addr[0].af == pj_AF_INET6() && - rec->entry[0].server.addr[0].ip.v6.u6_addr32[0] == IP_ADDR2, return); + SRV_CB_CHECK(rec->entry[0].server.addr_count == 1, -80); + SRV_CB_CHECK(rec->entry[0].server.addr[0].af == pj_AF_INET6() && + s6_addr32(rec->entry[0].server.addr[0].ip.v6, 0) == IP_ADDR2, + -90); + +on_return: + pj_sem_post(sem); } static int srv_resolver_fallback_test(void) @@ -1632,6 +1646,7 @@ pj_status_t status; pj_str_t domain = pj_str(TARGET); pj_str_t res_name = pj_str("_sip._udp."); + int cb_err = 0; /* Fallback test */ PJ_LOG(3,(THIS_FILE, " srv_resolve(): fallback test")); @@ -1642,30 +1657,42 @@ g_server[1].action_cb = &action2_1; status = pj_dns_srv_resolve(&domain, &res_name, PORT2, pool, resolver, PJ_TRUE, - NULL, &srv_cb_2, NULL); + &cb_err, &srv_cb_2, NULL); if (status != PJ_SUCCESS) { app_perror(" srv_resolve error", status); - pj_assert(status == PJ_SUCCESS); + return -10; } pj_sem_wait(sem); + if (cb_err != 0) { + PJ_LOG(3,("test", " srv_resolve cb error, code=%d", cb_err)); + return -20; + } + /* Subsequent query should just get the response from the cache */ PJ_LOG(3,(THIS_FILE, " srv_resolve(): cache test")); g_server[0].pkt_count = 0; g_server[1].pkt_count = 0; status = pj_dns_srv_resolve(&domain, &res_name, PORT2, pool, resolver, PJ_TRUE, - NULL, &srv_cb_2, NULL); + &cb_err, &srv_cb_2, NULL); if (status != PJ_SUCCESS) { app_perror(" srv_resolve error", status); - pj_assert(status == PJ_SUCCESS); + return -30; } pj_sem_wait(sem); - pj_assert(g_server[0].pkt_count == 0); - pj_assert(g_server[1].pkt_count == 0); + if (cb_err != 0) { + PJ_LOG(3,("test", " srv_resolve cb error, code=%d", cb_err)); + return -40; + } + + if (g_server[0].pkt_count != 0 || g_server[1].pkt_count != 0) { + PJ_LOG(3,("test", " srv_resolve() not from cache")); + return -50; + } /* Clear cache */ pj_thread_sleep(1000); @@ -1680,14 +1707,19 @@ status = pj_dns_srv_resolve(&domain, &res_name, PORT2, pool, resolver, PJ_DNS_SRV_FALLBACK_A | PJ_DNS_SRV_FALLBACK_AAAA, - NULL, &srv_cb_2a, NULL); + &cb_err, &srv_cb_2a, NULL); if (status != PJ_SUCCESS) { app_perror(" srv_resolve error", status); - pj_assert(status == PJ_SUCCESS); + return -60; } pj_sem_wait(sem); + if (cb_err != 0) { + PJ_LOG(3,("test", " srv_resolve cb error, code=%d", cb_err)); + return -70; + } + /* Clear cache */ pj_thread_sleep(1000); @@ -1701,14 +1733,19 @@ status = pj_dns_srv_resolve(&domain, &res_name, PORT2, pool, resolver, PJ_DNS_SRV_FALLBACK_AAAA, - NULL, &srv_cb_2b, NULL); + &cb_err, &srv_cb_2b, NULL); if (status != PJ_SUCCESS) { app_perror(" srv_resolve error", status); - pj_assert(status == PJ_SUCCESS); + return -80; } pj_sem_wait(sem); + if (cb_err != 0) { + PJ_LOG(3,("test", " srv_resolve cb error, code=%d", cb_err)); + return -90; + } + /* Clear cache */ pj_thread_sleep(1000); @@ -1790,30 +1827,31 @@ const pj_dns_srv_record *rec) { unsigned i; + int *cb_err = (int*)user_data; - PJ_UNUSED_ARG(user_data); PJ_UNUSED_ARG(status); PJ_UNUSED_ARG(rec); - pj_assert(status == PJ_SUCCESS); - pj_assert(rec->count == PJ_DNS_SRV_MAX_ADDR); + SRV_CB_CHECK(status == PJ_SUCCESS, -10); + SRV_CB_CHECK(rec->count == PJ_DNS_SRV_MAX_ADDR, -20); for (i=0; ientry[i].priority == i); - pj_assert(rec->entry[i].weight == 2); + SRV_CB_CHECK(rec->entry[i].priority == i, -30); + SRV_CB_CHECK(rec->entry[i].weight == 2, -40); //pj_assert(pj_strcmp2(&rec->entry[i].server.name, "sip." DOMAIN3)==0); - pj_assert(rec->entry[i].server.alias.slen == 0); - pj_assert(rec->entry[i].port == PORT3+i); + SRV_CB_CHECK(rec->entry[i].server.alias.slen == 0, -50); + SRV_CB_CHECK(rec->entry[i].port == PORT3+i, -60); - pj_assert(rec->entry[i].server.addr_count == PJ_DNS_MAX_IP_IN_A_REC); + SRV_CB_CHECK(rec->entry[i].server.addr_count == PJ_DNS_MAX_IP_IN_A_REC, -70); for (j=0; jentry[i].server.addr[j].ip.v4.s_addr == IP_ADDR3+j); + SRV_CB_CHECK(rec->entry[i].server.addr[j].ip.v4.s_addr == IP_ADDR3+j, -80); } } +on_return: pj_sem_post(sem); } @@ -1822,6 +1860,7 @@ pj_status_t status; pj_str_t domain = pj_str(DOMAIN3); pj_str_t res_name = pj_str("_sip._udp."); + int cb_err = 0; /* Successful scenario */ PJ_LOG(3,(THIS_FILE, " srv_resolve(): too many entries test")); @@ -1835,12 +1874,20 @@ g_server[1].pkt_count = 0; status = pj_dns_srv_resolve(&domain, &res_name, 1, pool, resolver, PJ_TRUE, - NULL, &srv_cb_3, NULL); - pj_assert(status == PJ_SUCCESS); + &cb_err, &srv_cb_3, NULL); + if (status != PJ_SUCCESS) { + app_perror(" srv_resolve error", status); + return -10; + } pj_sem_wait(sem); - return status; + if (cb_err != 0) { + PJ_LOG(3,("test", " srv_resolve cb error, code=%d", cb_err)); + return -20; + } + + return 0; } @@ -1871,9 +1918,17 @@ if (rc != 0) goto on_error; - srv_resolver_test(); - srv_resolver_fallback_test(); - srv_resolver_many_test(); + rc = srv_resolver_test(); + if (rc != 0) + goto on_error; + + rc = srv_resolver_fallback_test(); + if (rc != 0) + goto on_error; + + rc = srv_resolver_many_test(); + if (rc != 0) + goto on_error; destroy(); @@ -1894,9 +1949,17 @@ if (rc != 0) goto on_error; - srv_resolver_test(); - srv_resolver_fallback_test(); - srv_resolver_many_test(); + rc = srv_resolver_test(); + if (rc != 0) + goto on_error; + + rc = srv_resolver_fallback_test(); + if (rc != 0) + goto on_error; + + rc = srv_resolver_many_test(); + if (rc != 0) + goto on_error; destroy(); #endif diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjlib-util/src/pjlib-util-test/test.c asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjlib-util/src/pjlib-util-test/test.c --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjlib-util/src/pjlib-util-test/test.c 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjlib-util/src/pjlib-util-test/test.c 2022-02-24 07:54:38.000000000 +0000 @@ -43,8 +43,8 @@ pj_pool_factory *mem; -int param_log_decor = PJ_LOG_HAS_NEWLINE | PJ_LOG_HAS_TIME | - PJ_LOG_HAS_MICRO_SEC; +int param_log_decor = PJ_LOG_HAS_NEWLINE | PJ_LOG_HAS_TIME | + PJ_LOG_HAS_MICRO_SEC | PJ_LOG_HAS_INDENT; static int test_inner(void) { @@ -78,7 +78,9 @@ #if INCLUDE_ENCRYPTION_TEST DO_TEST(encryption_test()); +# if WITH_BENCHMARK DO_TEST(encryption_benchmark()); +# endif #endif #if INCLUDE_STUN_TEST diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjlib-util/src/pjlib-util-test/test.h asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjlib-util/src/pjlib-util-test/test.h --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjlib-util/src/pjlib-util-test/test.h 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjlib-util/src/pjlib-util-test/test.h 2022-02-24 07:54:38.000000000 +0000 @@ -19,6 +19,12 @@ */ #include +#if defined(PJ_EXCLUDE_BENCHMARK_TESTS) && (PJ_EXCLUDE_BENCHMARK_TESTS==1) +# define WITH_BENCHMARK 0 +#else +# define WITH_BENCHMARK 1 +#endif + #define INCLUDE_XML_TEST 1 #define INCLUDE_JSON_TEST 1 #define INCLUDE_ENCRYPTION_TEST 1 diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjmedia/build/Makefile asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjmedia/build/Makefile --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjmedia/build/Makefile 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjmedia/build/Makefile 2022-02-24 07:54:38.000000000 +0000 @@ -62,8 +62,8 @@ bidirectional.o clock_thread.o codec.o conference.o \ conf_switch.o converter.o converter_libswscale.o converter_libyuv.o \ delaybuf.o echo_common.o \ - echo_port.o echo_suppress.o echo_webrtc.o endpoint.o errno.o \ - event.o format.o ffmpeg_util.o \ + echo_port.o echo_suppress.o echo_webrtc.o echo_webrtc_aec3.o \ + endpoint.o errno.o event.o format.o ffmpeg_util.o \ g711.o jbuf.o master_port.o mem_capture.o mem_player.o \ null_port.o plc_common.o port.o splitcomb.o \ resample_resample.o resample_libsamplerate.o resample_speex.o \ @@ -92,7 +92,7 @@ export PJMEDIA_AUDIODEV_OBJS += audiodev.o audiotest.o errno.o \ legacy_dev.o null_dev.o pa_dev.o wmme_dev.o \ alsa_dev.o bb10_dev.o bdimad_dev.o \ - android_jni_dev.o opensl_dev.o + android_jni_dev.o opensl_dev.o oboe_dev.o export PJMEDIA_AUDIODEV_CFLAGS += $(_CFLAGS) export PJMEDIA_AUDIODEV_CXXFLAGS += $(_CXXFLAGS) export PJMEDIA_AUDIODEV_LDFLAGS += $(PJMEDIA_LDLIB) \ @@ -136,7 +136,7 @@ # export PJMEDIA_CODEC_SRCDIR = ../src/pjmedia-codec export PJMEDIA_CODEC_OBJS += audio_codecs.o ffmpeg_vid_codecs.o openh264.o \ - h263_packetizer.o h264_packetizer.o \ + h263_packetizer.o h264_packetizer.o vpx_packetizer.o \ $(OS_OBJS) $(M_OBJS) $(CC_OBJS) $(HOST_OBJS) \ ipp_codecs.o silk.o opus.o $(CODEC_OBJS) \ g7221_sdp_match.o amr_sdp_match.o passthrough.o \ diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjmedia/build/os-auto.mak.in asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjmedia/build/os-auto.mak.in --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjmedia/build/os-auto.mak.in 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjmedia/build/os-auto.mak.in 2022-02-24 07:54:38.000000000 +0000 @@ -18,6 +18,10 @@ V4L2_CFLAGS = @ac_v4l2_cflags@ V4L2_LDFLAGS = @ac_v4l2_ldflags@ +# Directshow +DSHOW_CFLAGS = @ac_dshow_cflags@ +DSHOW_LDFLAGS = @ac_dshow_ldflags@ + # QT AC_PJMEDIA_VIDEO_HAS_QT = @ac_pjmedia_video_has_qt@ # QT_CFLAGS = @ac_qt_cflags@ @@ -27,6 +31,8 @@ # Android ANDROID_CFLAGS = @ac_android_cflags@ +OBOE_CFLAGS = @ac_oboe_cflags@ +OBOE_LDFLAGS = @ac_oboe_ldflags@ # openh264 OPENH264_CFLAGS = @ac_openh264_cflags@ @@ -39,11 +45,11 @@ # PJMEDIA features exclusion export CFLAGS += @ac_no_small_filter@ @ac_no_large_filter@ @ac_no_speex_aec@ \ - $(SDL_CFLAGS) $(FFMPEG_CFLAGS) $(V4L2_CFLAGS) $(QT_CFLAGS) \ + $(SDL_CFLAGS) $(FFMPEG_CFLAGS) $(V4L2_CFLAGS) $(DSHOW_CFLAGS) $(QT_CFLAGS) \ $(DARWIN_CFLAGS) $(ANDROID_CFLAGS) \ - $(OPENH264_CFLAGS) $(VPX_CFLAGS) -export LDFLAGS += $(SDL_LDFLAGS) $(FFMPEG_LDFLAGS) $(V4L2_LDFLAGS) \ - $(OPENH264_LDFLAGS) $(VPX_LDFLAGS) + $(OPENH264_CFLAGS) $(VPX_CFLAGS) $(OBOE_CFLAGS) +export LDFLAGS += $(SDL_LDFLAGS) $(FFMPEG_LDFLAGS) $(V4L2_LDFLAGS) $(DSHOW_LDFLAGS) \ + $(OPENH264_LDFLAGS) $(VPX_LDFLAGS) $(OBOE_LDFLAGS) # Define the desired sound device backend # Valid values are: @@ -67,6 +73,7 @@ AC_NO_OPENCORE_AMRNB=@ac_no_opencore_amrnb@ AC_NO_OPENCORE_AMRWB=@ac_no_opencore_amrwb@ AC_NO_BCG729=@ac_no_bcg729@ +AC_NO_ANDROID_MEDIACODEC=@ac_no_mediacodec@ export CODEC_OBJS= @@ -139,6 +146,11 @@ export CODEC_OBJS += bcg729.o endif +ifeq ($(AC_NO_ANDROID_MEDIACODEC),1) +export CFLAGS += -DPJMEDIA_HAS_ANDROID_MEDIACODEC=0 +else +export CODEC_OBJS += and_aud_mediacodec.o and_vid_mediacodec.o +endif # # SRTP @@ -216,6 +228,19 @@ endif endif +# +# libwebrtc-aec3 +# +ifeq (@ac_no_webrtc_aec3@,1) +export CFLAGS += -DPJMEDIA_HAS_WEBRTC_AEC3=0 +else +export CFLAGS += -DPJMEDIA_HAS_WEBRTC_AEC3=1 @ac_webrtc_aec3_cflags@ + +ifeq (@ac_external_webrtc@,0) +export CFLAGS += -I$(THIRD_PARTY)/webrtc_aec3/src +endif +endif + # # MacOSX specific @@ -290,6 +315,14 @@ endif # +# Directshow video device +# +ifeq ($(AC_PJMEDIA_VIDEO_DEV_HAS_DSHOW),yes) +export PJMEDIA_VIDEODEV_OBJS += dshow_dev.o dshowclasses.o +export CFLAGS += -I$(THIRD_PARTY)/BaseClasses +endif + +# # Android video device # ifeq ($(AC_PJMEDIA_VIDEO),android_os) diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjmedia/build/pjmedia_audiodev.vcxproj asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjmedia/build/pjmedia_audiodev.vcxproj --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjmedia/build/pjmedia_audiodev.vcxproj 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjmedia/build/pjmedia_audiodev.vcxproj 2022-02-24 07:54:38.000000000 +0000 @@ -5,6 +5,10 @@ Debug-Dynamic ARM + + Debug-Dynamic + ARM64 + Debug-Dynamic Win32 @@ -17,6 +21,10 @@ Debug-Static ARM + + Debug-Static + ARM64 + Debug-Static Win32 @@ -29,6 +37,10 @@ Debug ARM + + Debug + ARM64 + Debug Win32 @@ -41,6 +53,10 @@ Release-Dynamic ARM + + Release-Dynamic + ARM64 + Release-Dynamic Win32 @@ -53,6 +69,10 @@ Release-Static ARM + + Release-Static + ARM64 + Release-Static Win32 @@ -65,6 +85,10 @@ Release ARM + + Release + ARM64 + Release Win32 @@ -78,7 +102,7 @@ {4281CA5E-1D48-45D4-A991-2718A454B4BA} - pjmedia_audiodev + pjmedia_audiodev en-US @@ -161,40 +185,77 @@ false MultiByte + + StaticLibrary + v140 + false + MultiByte + StaticLibrary v140 false MultiByte + + StaticLibrary + v140 + false + MultiByte + StaticLibrary v140 false MultiByte + + StaticLibrary + v140 + false + MultiByte + StaticLibrary v140 false MultiByte + + StaticLibrary + v140 + false + MultiByte + StaticLibrary v140 false MultiByte + + StaticLibrary + v140 + false + MultiByte + StaticLibrary v140 false MultiByte + + StaticLibrary + v140 + false + MultiByte + $(BuildToolset) - + + @@ -264,31 +325,61 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>14.0.22823.1 @@ -335,6 +426,19 @@ ..\lib\pjmedia-audiodev-$(TargetCPU)-$(Platform)-vc$(VSVer)-$(Configuration).lib + + + + ../include;../../pjlib/include;../../pjlib-util/include;../../pjnath/include;../../third_party/portaudio/include;../../third_party/speex/include;../../third_party/build/srtp;../../third_party/srtp/crypto/include;../../third_party/srtp/include;../..;%(AdditionalIncludeDirectories) + _LIB;%(PreprocessorDefinitions) + + + ProgramDatabase + + + ..\lib\pjmedia-audiodev-$(TargetCPU)-$(Platform)-vc$(VSVer)-$(Configuration).lib + + ../include;../../pjlib/include;../../pjlib-util/include;../../pjnath/include;../../third_party/portaudio/include;../../third_party/speex/include;../../third_party/build/srtp;../../third_party/srtp/crypto/include;../../third_party/srtp/include;../..;%(AdditionalIncludeDirectories) @@ -369,6 +473,18 @@ ..\lib\pjmedia-audiodev-$(TargetCPU)-$(Platform)-vc$(VSVer)-$(Configuration).lib + + + + ../include;../../pjlib/include;../../pjlib-util/include;../../pjnath/include;../../third_party/portaudio/include;../../third_party/speex/include;../../third_party/build/srtp;../../third_party/srtp/crypto/include;../../third_party/srtp/include;../..;%(AdditionalIncludeDirectories) + _LIB;%(PreprocessorDefinitions) + + + + + ..\lib\pjmedia-audiodev-$(TargetCPU)-$(Platform)-vc$(VSVer)-$(Configuration).lib + + ../include;../../pjlib/include;../../pjlib-util/include;../../pjnath/include;../../third_party/portaudio/include;../../third_party/speex/include;../../third_party/build/srtp;../../third_party/srtp/crypto/include;../../third_party/srtp/include;../..;%(AdditionalIncludeDirectories) @@ -404,6 +520,19 @@ ..\lib\pjmedia-audiodev-$(TargetCPU)-$(Platform)-vc$(VSVer)-$(Configuration).lib + + + + ../include;../../pjlib/include;../../pjlib-util/include;../../pjnath/include;../../third_party/portaudio/include;../../third_party/speex/include;../../third_party/build/srtp;../../third_party/srtp/crypto/include;../../third_party/srtp/include;../..;%(AdditionalIncludeDirectories) + _LIB;%(PreprocessorDefinitions) + + + ProgramDatabase + + + ..\lib\pjmedia-audiodev-$(TargetCPU)-$(Platform)-vc$(VSVer)-$(Configuration).lib + + ../include;../../pjlib/include;../../pjlib-util/include;../../pjnath/include;../../third_party/portaudio/include;../../third_party/speex/include;../../third_party/build/srtp;../../third_party/srtp/crypto/include;../../third_party/srtp/include;../..;%(AdditionalIncludeDirectories) @@ -438,6 +567,18 @@ ..\lib\pjmedia-audiodev-$(TargetCPU)-$(Platform)-vc$(VSVer)-$(Configuration).lib + + + + ../include;../../pjlib/include;../../pjlib-util/include;../../pjnath/include;../../third_party/portaudio/include;../../third_party/speex/include;../../third_party/build/srtp;../../third_party/srtp/crypto/include;../../third_party/srtp/include;../..;%(AdditionalIncludeDirectories) + _LIB;%(PreprocessorDefinitions) + + + + + ..\lib\pjmedia-audiodev-$(TargetCPU)-$(Platform)-vc$(VSVer)-$(Configuration).lib + + ../include;../../pjlib/include;../../pjlib-util/include;../../pjnath/include;../../third_party/portaudio/include;../../third_party/speex/include;../../third_party/build/srtp;../../third_party/srtp/crypto/include;../../third_party/srtp/include;../..;%(AdditionalIncludeDirectories) @@ -473,6 +614,19 @@ ..\lib\pjmedia-audiodev-$(TargetCPU)-$(Platform)-vc$(VSVer)-$(Configuration).lib + + + + ../include;../../pjlib/include;../../pjlib-util/include;../../pjnath/include;../../third_party/portaudio/include;../../third_party/speex/include;../../third_party/build/srtp;../../third_party/srtp/crypto/include;../../third_party/srtp/include;../..;%(AdditionalIncludeDirectories) + _LIB;%(PreprocessorDefinitions) + + + ProgramDatabase + + + ..\lib\pjmedia-audiodev-$(TargetCPU)-$(Platform)-vc$(VSVer)-$(Configuration).lib + + ../include;../../pjlib/include;../../pjlib-util/include;../../pjnath/include;../../third_party/portaudio/include;../../third_party/speex/include;../../third_party/build/srtp;../../third_party/srtp/crypto/include;../../third_party/srtp/include;../..;%(AdditionalIncludeDirectories) @@ -507,6 +661,18 @@ ..\lib\pjmedia-audiodev-$(TargetCPU)-$(Platform)-vc$(VSVer)-$(Configuration).lib + + + + ../include;../../pjlib/include;../../pjlib-util/include;../../pjnath/include;../../third_party/portaudio/include;../../third_party/speex/include;../../third_party/build/srtp;../../third_party/srtp/crypto/include;../../third_party/srtp/include;../..;%(AdditionalIncludeDirectories) + _LIB;%(PreprocessorDefinitions) + + + + + ..\lib\pjmedia-audiodev-$(TargetCPU)-$(Platform)-vc$(VSVer)-$(Configuration).lib + + @@ -519,61 +685,79 @@ true true true + true true true true + true true true true + true true true true + true true true true + true true true true + true true true true + true true true true + true true true true + true true true true + true true true true + true true true true + true true true true + true true true true + true true true true + true true true true + true true true true + true true true true + true true diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjmedia/build/pjmedia_audiodev.vcxproj.filters asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjmedia/build/pjmedia_audiodev.vcxproj.filters --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjmedia/build/pjmedia_audiodev.vcxproj.filters 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjmedia/build/pjmedia_audiodev.vcxproj.filters 2022-02-24 07:54:38.000000000 +0000 @@ -44,9 +44,6 @@ Source Files - - Source Files - diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjmedia/build/pjmedia_codec.vcproj asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjmedia/build/pjmedia_codec.vcproj --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjmedia/build/pjmedia_codec.vcproj 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjmedia/build/pjmedia_codec.vcproj 2022-02-24 07:54:38.000000000 +0000 @@ -3631,8 +3631,12 @@ - - + + + - - + + + + diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjmedia/build/pjmedia_codec.vcxproj asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjmedia/build/pjmedia_codec.vcxproj --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjmedia/build/pjmedia_codec.vcxproj 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjmedia/build/pjmedia_codec.vcxproj 2022-02-24 07:54:38.000000000 +0000 @@ -5,6 +5,10 @@ Debug-Dynamic ARM + + Debug-Dynamic + ARM64 + Debug-Dynamic Win32 @@ -17,6 +21,10 @@ Debug-Static ARM + + Debug-Static + ARM64 + Debug-Static Win32 @@ -29,6 +37,10 @@ Debug ARM + + Debug + ARM64 + Debug Win32 @@ -41,6 +53,10 @@ Release-Dynamic ARM + + Release-Dynamic + ARM64 + Release-Dynamic Win32 @@ -53,6 +69,10 @@ Release-Static ARM + + Release-Static + ARM64 + Release-Static Win32 @@ -65,6 +85,10 @@ Release ARM + + Release + ARM64 + Release Win32 @@ -161,36 +185,72 @@ false MultiByte + + StaticLibrary + v140 + false + MultiByte + StaticLibrary v140 false MultiByte + + StaticLibrary + v140 + false + MultiByte + StaticLibrary v140 false MultiByte + + StaticLibrary + v140 + false + MultiByte + StaticLibrary v140 false MultiByte + + StaticLibrary + v140 + false + MultiByte + StaticLibrary v140 false MultiByte + + StaticLibrary + v140 + false + MultiByte + StaticLibrary v140 false MultiByte + + StaticLibrary + v140 + false + MultiByte + $(BuildToolset) @@ -265,31 +325,61 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>14.0.22823.1 @@ -336,6 +426,19 @@ ..\lib\pjmedia-codec-$(TargetCPU)-$(Platform)-vc$(VSVer)-$(Configuration).lib + + + + ../include;../../pjlib/include;../../third_party/speex/include;../../third_party;%(AdditionalIncludeDirectories) + _LIB;%(PreprocessorDefinitions) + + + ProgramDatabase + + + ..\lib\pjmedia-codec-$(TargetCPU)-$(Platform)-vc$(VSVer)-$(Configuration).lib + + ../include;../../pjlib/include;../../third_party/speex/include;../../third_party;%(AdditionalIncludeDirectories) @@ -370,6 +473,18 @@ ..\lib\pjmedia-codec-$(TargetCPU)-$(Platform)-vc$(VSVer)-$(Configuration).lib + + + + ../include;../../pjlib/include;../../third_party/speex/include;../../third_party;%(AdditionalIncludeDirectories) + _LIB;%(PreprocessorDefinitions) + + + + + ..\lib\pjmedia-codec-$(TargetCPU)-$(Platform)-vc$(VSVer)-$(Configuration).lib + + ../include;../../pjlib/include;../../third_party/speex/include;../../third_party;%(AdditionalIncludeDirectories) @@ -405,6 +520,19 @@ ..\lib\pjmedia-codec-$(TargetCPU)-$(Platform)-vc$(VSVer)-$(Configuration).lib + + + + ../include;../../pjlib/include;../../third_party/speex/include;../../third_party;%(AdditionalIncludeDirectories) + _LIB;%(PreprocessorDefinitions) + + + ProgramDatabase + + + ..\lib\pjmedia-codec-$(TargetCPU)-$(Platform)-vc$(VSVer)-$(Configuration).lib + + ../include;../../pjlib/include;../../third_party/speex/include;../../third_party;%(AdditionalIncludeDirectories) @@ -439,6 +567,18 @@ ..\lib\pjmedia-codec-$(TargetCPU)-$(Platform)-vc$(VSVer)-$(Configuration).lib + + + + ../include;../../pjlib/include;../../third_party/speex/include;../../third_party;%(AdditionalIncludeDirectories) + _LIB;%(PreprocessorDefinitions) + + + + + ..\lib\pjmedia-codec-$(TargetCPU)-$(Platform)-vc$(VSVer)-$(Configuration).lib + + ../include;../../pjlib/include;../../third_party/speex/include;../../third_party;%(AdditionalIncludeDirectories) @@ -474,6 +614,19 @@ ..\lib\pjmedia-codec-$(TargetCPU)-$(Platform)-vc$(VSVer)-$(Configuration).lib + + + + ../include;../../pjlib/include;../../third_party/speex/include;../../third_party;%(AdditionalIncludeDirectories) + _LIB;%(PreprocessorDefinitions) + + + ProgramDatabase + + + ..\lib\pjmedia-codec-$(TargetCPU)-$(Platform)-vc$(VSVer)-$(Configuration).lib + + ../include;../../pjlib/include;../../third_party/speex/include;../../third_party;%(AdditionalIncludeDirectories) @@ -508,6 +661,18 @@ ..\lib\pjmedia-codec-$(TargetCPU)-$(Platform)-vc$(VSVer)-$(Configuration).lib + + + + ../include;../../pjlib/include;../../third_party/speex/include;../../third_party;%(AdditionalIncludeDirectories) + _LIB;%(PreprocessorDefinitions) + + + + + ..\lib\pjmedia-codec-$(TargetCPU)-$(Platform)-vc$(VSVer)-$(Configuration).lib + + @@ -531,6 +696,7 @@ + @@ -556,6 +722,7 @@ + diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjmedia/build/pjmedia_codec.vcxproj.filters asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjmedia/build/pjmedia_codec.vcxproj.filters --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjmedia/build/pjmedia_codec.vcxproj.filters 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjmedia/build/pjmedia_codec.vcxproj.filters 2022-02-24 07:54:38.000000000 +0000 @@ -80,6 +80,9 @@ Source Files + + Source Files + @@ -157,5 +160,8 @@ Header Files + + Header Files + \ No newline at end of file diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjmedia/build/pjmedia_test.vcxproj asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjmedia/build/pjmedia_test.vcxproj --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjmedia/build/pjmedia_test.vcxproj 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjmedia/build/pjmedia_test.vcxproj 2022-02-24 07:54:38.000000000 +0000 @@ -1,6 +1,10 @@  + + Debug-Dynamic + ARM64 + Debug-Dynamic Win32 @@ -9,6 +13,10 @@ Debug-Dynamic x64 + + Debug-Static + ARM64 + Debug-Static Win32 @@ -17,6 +25,10 @@ Debug-Static x64 + + Debug + ARM64 + Debug Win32 @@ -25,6 +37,10 @@ Debug x64 + + Release-Dynamic + ARM64 + Release-Dynamic Win32 @@ -33,6 +49,10 @@ Release-Dynamic x64 + + Release-Static + ARM64 + Release-Static Win32 @@ -41,6 +61,10 @@ Release-Static x64 + + Release + ARM64 + Release Win32 @@ -54,7 +78,7 @@ {21C0CECF-69DD-4F70-BC2B-9B4DE7F15277} - pjmedia_test + pjmedia_test en-US @@ -101,110 +125,177 @@ false MultiByte + + Application + v140 + false + MultiByte + Application v140 false MultiByte + + Application + v140 + false + MultiByte + Application v140 false MultiByte + + Application + v140 + false + MultiByte + Application v140 false MultiByte + + Application + v140 + false + MultiByte + Application v140 false MultiByte + + Application + v140 + false + MultiByte + Application v140 false MultiByte + + Application + v140 + false + MultiByte + $(BuildToolset) - + + Application StaticLibrary - + - - + + - - + + - - + + - - + + - - + + - - + + - - + + + + + + + - - + + + + + + + - - + + + + + + + - - + + + + + + + - - + + + + + + + - - + + + + + + + <_ProjectFileVersion>14.0.22823.1 - pjmedia-test-$(TargetCPU)-$(Platform)-vc$(VSVer)-$(Configuration) + pjmedia-test-$(TargetCPU)-$(Platform)-vc$(VSVer)-$(Configuration) @@ -244,6 +335,21 @@ MachineX64 + + + + ../../pjlib/include;../include;../../pjnath/include;../../pjlib-util/include;%(AdditionalIncludeDirectories) + _CONSOLE;%(PreprocessorDefinitions) + + + ProgramDatabase + + + dsound.lib;dxguid.lib;netapi32.lib;mswsock.lib;ws2_32.lib;odbc32.lib;odbccp32.lib;ole32.lib;user32.lib;%(AdditionalDependencies) + ..\bin\pjmedia-test-$(TargetCPU)-$(Platform)-vc$(VSVer)-$(Configuration).exe + MSVCRT.LIB;%(IgnoreSpecificDefaultLibraries) + + ../../pjlib/include;../include;../../pjnath/include;../../pjlib-util/include;%(AdditionalIncludeDirectories) @@ -270,6 +376,19 @@ MachineX64 + + + + ../../pjlib/include;../include;../../pjnath/include;../../pjlib-util/include;%(AdditionalIncludeDirectories) + _CONSOLE;%(PreprocessorDefinitions) + + + + + dsound.lib;dxguid.lib;netapi32.lib;mswsock.lib;ws2_32.lib;odbc32.lib;odbccp32.lib;ole32.lib;user32.lib;%(AdditionalDependencies) + ..\bin\pjmedia-test-$(TargetCPU)-$(Platform)-vc$(VSVer)-$(Configuration).exe + + ../../pjlib/include;../include;../../pjnath/include;../../pjlib-util/include;%(AdditionalIncludeDirectories) @@ -299,6 +418,21 @@ MachineX64 + + + + ../../pjlib/include;../include;../../pjnath/include;../../pjlib-util/include;%(AdditionalIncludeDirectories) + _CONSOLE;%(PreprocessorDefinitions) + + + ProgramDatabase + + + dsound.lib;dxguid.lib;netapi32.lib;mswsock.lib;ws2_32.lib;odbc32.lib;odbccp32.lib;ole32.lib;user32.lib;%(AdditionalDependencies) + ..\bin\pjmedia-test-$(TargetCPU)-$(Platform)-vc$(VSVer)-$(Configuration).exe + MSVCRT.LIB;%(IgnoreSpecificDefaultLibraries) + + ../../pjlib/include;../include;../../pjnath/include;../../pjlib-util/include;%(AdditionalIncludeDirectories) @@ -325,6 +459,19 @@ MachineX64 + + + + ../../pjlib/include;../include;../../pjnath/include;../../pjlib-util/include;%(AdditionalIncludeDirectories) + _CONSOLE;%(PreprocessorDefinitions) + + + + + dsound.lib;dxguid.lib;netapi32.lib;mswsock.lib;ws2_32.lib;odbc32.lib;odbccp32.lib;ole32.lib;user32.lib;%(AdditionalDependencies) + ..\bin\pjmedia-test-$(TargetCPU)-$(Platform)-vc$(VSVer)-$(Configuration).exe + + ../../pjlib/include;../include;../../pjnath/include;../../pjlib-util/include;%(AdditionalIncludeDirectories) @@ -354,6 +501,21 @@ MachineX64 + + + + ../../pjlib/include;../include;../../pjnath/include;../../pjlib-util/include;%(AdditionalIncludeDirectories) + _CONSOLE;%(PreprocessorDefinitions) + + + ProgramDatabase + + + dsound.lib;dxguid.lib;netapi32.lib;mswsock.lib;ws2_32.lib;odbc32.lib;odbccp32.lib;ole32.lib;user32.lib;%(AdditionalDependencies) + ..\bin\pjmedia-test-$(TargetCPU)-$(Platform)-vc$(VSVer)-$(Configuration).exe + MSVCRT.LIB;%(IgnoreSpecificDefaultLibraries) + + ../../pjlib/include;../include;../../pjnath/include;../../pjlib-util/include;%(AdditionalIncludeDirectories) @@ -382,6 +544,20 @@ MachineX64 + + + + ../../pjlib/include;../include;../../pjnath/include;../../pjlib-util/include;%(AdditionalIncludeDirectories) + _CONSOLE;%(PreprocessorDefinitions) + + + + + dsound.lib;dxguid.lib;netapi32.lib;mswsock.lib;ws2_32.lib;odbc32.lib;odbccp32.lib;ole32.lib;user32.lib;%(AdditionalDependencies) + ..\bin\pjmedia-test-$(TargetCPU)-$(Platform)-vc$(VSVer)-$(Configuration).exe + MSVCRT.LIB;%(IgnoreSpecificDefaultLibraries) + + @@ -391,31 +567,43 @@ true true + true true true + true true true + true true true + true true true + true true true + true true true + true true true + true true true + true true true + true true true + true true true + true @@ -424,16 +612,22 @@ true true + true true true + true true true + true true true + true true true + true true true + true diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjmedia/build/pjmedia.vcxproj asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjmedia/build/pjmedia.vcxproj --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjmedia/build/pjmedia.vcxproj 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjmedia/build/pjmedia.vcxproj 2022-02-24 07:54:38.000000000 +0000 @@ -5,6 +5,10 @@ Debug-Dynamic ARM + + Debug-Dynamic + ARM64 + Debug-Dynamic Win32 @@ -17,6 +21,10 @@ Debug-Static ARM + + Debug-Static + ARM64 + Debug-Static Win32 @@ -29,6 +37,10 @@ Debug ARM + + Debug + ARM64 + Debug Win32 @@ -41,6 +53,10 @@ Release-Dynamic ARM + + Release-Dynamic + ARM64 + Release-Dynamic Win32 @@ -53,6 +69,10 @@ Release-Static ARM + + Release-Static + ARM64 + Release-Static Win32 @@ -65,6 +85,10 @@ Release ARM + + Release + ARM64 + Release Win32 @@ -166,36 +190,72 @@ false MultiByte + + StaticLibrary + v140 + false + MultiByte + StaticLibrary v140 false MultiByte + + StaticLibrary + v140 + false + MultiByte + StaticLibrary v140 false MultiByte + + StaticLibrary + v140 + false + MultiByte + StaticLibrary v140 false MultiByte + + StaticLibrary + v140 + false + MultiByte + StaticLibrary v140 false MultiByte + + StaticLibrary + v140 + false + MultiByte + StaticLibrary v140 false MultiByte + + StaticLibrary + v140 + false + MultiByte + $(BuildToolset) @@ -270,31 +330,61 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>14.0.22823.1 @@ -307,15 +397,15 @@ - ../include;../../pjlib/include;../../pjlib-util/include;../../pjnath/include;../../third_party/portaudio/include;../../third_party/speex/include;../../third_party/build/srtp;../../third_party/srtp/include;../../third_party/srtp/crypto/include;../../third_party/yuv/include;../../third_party/webrtc/src;../..;$(DXSDK_DIR)include;%(AdditionalIncludeDirectories) - _LIB;%(PreprocessorDefinitions) + ../include;../../pjlib/include;../../pjlib-util/include;../../pjnath/include;../../third_party/portaudio/include;../../third_party/speex/include;../../third_party/build/srtp;../../third_party/srtp/include;../../third_party/srtp/crypto/include;../../third_party/yuv/include;../../third_party/webrtc/src;../../third_party/webrtc_aec3/src;../..;$(DXSDK_DIR)include;%(AdditionalIncludeDirectories) + _LIB;WEBRTC_WIN;WEBRTC_APM_DEBUG_DUMP=0;NOMINMAX;%(PreprocessorDefinitions) - ../include;../../pjlib/include;../../pjlib-util/include;../../pjnath/include;../../third_party/portaudio/include;../../third_party/speex/include;../../third_party/build/srtp;../../third_party/srtp/include;../../third_party/srtp/crypto/include;../../third_party/yuv/include;../../third_party/webrtc/src;../..;$(DXSDK_DIR)include;%(AdditionalIncludeDirectories) - _LIB;__ARMEL__;%(PreprocessorDefinitions) + ../include;../../pjlib/include;../../pjlib-util/include;../../pjnath/include;../../third_party/portaudio/include;../../third_party/speex/include;../../third_party/build/srtp;../../third_party/srtp/include;../../third_party/srtp/crypto/include;../../third_party/yuv/include;../../third_party/webrtc/src;../../third_party/webrtc_aec3/src;../..;$(DXSDK_DIR)include;%(AdditionalIncludeDirectories) + _LIB;__ARMEL__;WEBRTC_WIN;WEBRTC_APM_DEBUG_DUMP=0;NOMINMAX;%(PreprocessorDefinitions) @@ -325,22 +415,31 @@ X64 - ../include;../../pjlib/include;../../pjlib-util/include;../../pjnath/include;../../third_party/portaudio/include;../../third_party/speex/include;../../third_party/build/srtp;../../third_party/srtp/include;../../third_party/srtp/crypto/include;../../third_party/yuv/include;../../third_party/webrtc/src;../..;$(DXSDK_DIR)include;%(AdditionalIncludeDirectories) - _LIB;%(PreprocessorDefinitions) + ../include;../../pjlib/include;../../pjlib-util/include;../../pjnath/include;../../third_party/portaudio/include;../../third_party/speex/include;../../third_party/build/srtp;../../third_party/srtp/include;../../third_party/srtp/crypto/include;../../third_party/yuv/include;../../third_party/webrtc/src;../../third_party/webrtc_aec3/src;../..;$(DXSDK_DIR)include;%(AdditionalIncludeDirectories) + _LIB;WEBRTC_WIN;WEBRTC_APM_DEBUG_DUMP=0;NOMINMAX;%(PreprocessorDefinitions) + + + + ../include;../../pjlib/include;../../pjlib-util/include;../../pjnath/include;../../third_party/portaudio/include;../../third_party/speex/include;../../third_party/build/srtp;../../third_party/srtp/include;../../third_party/srtp/crypto/include;../../third_party/yuv/include;../../third_party/webrtc/src;../../third_party/webrtc_aec3/src;../..;$(DXSDK_DIR)include;%(AdditionalIncludeDirectories) + _LIB;WEBRTC_WIN;WEBRTC_APM_DEBUG_DUMP=0;NOMINMAX;%(PreprocessorDefinitions) + + + + - ../include;../../pjlib/include;../../pjlib-util/include;../../pjnath/include;../../third_party/portaudio/include;../../third_party/speex/include;../../third_party/build/srtp;../../third_party/srtp/include;../../third_party/srtp/crypto/include;../../third_party/yuv/include;../../third_party/webrtc/src;../..;$(DXSDK_DIR)include;%(AdditionalIncludeDirectories) - _LIB;%(PreprocessorDefinitions) + ../include;../../pjlib/include;../../pjlib-util/include;../../pjnath/include;../../third_party/portaudio/include;../../third_party/speex/include;../../third_party/build/srtp;../../third_party/srtp/include;../../third_party/srtp/crypto/include;../../third_party/yuv/include;../../third_party/webrtc/src;../../third_party/webrtc_aec3/src;../..;$(DXSDK_DIR)include;%(AdditionalIncludeDirectories) + _LIB;WEBRTC_WIN;WEBRTC_APM_DEBUG_DUMP=0;NOMINMAX;%(PreprocessorDefinitions) - ../include;../../pjlib/include;../../pjlib-util/include;../../pjnath/include;../../third_party/portaudio/include;../../third_party/speex/include;../../third_party/build/srtp;../../third_party/srtp/include;../../third_party/srtp/crypto/include;../../third_party/yuv/include;../../third_party/webrtc/src;../..;$(DXSDK_DIR)include;%(AdditionalIncludeDirectories) - _LIB;__ARMEL__;%(PreprocessorDefinitions) + ../include;../../pjlib/include;../../pjlib-util/include;../../pjnath/include;../../third_party/portaudio/include;../../third_party/speex/include;../../third_party/build/srtp;../../third_party/srtp/include;../../third_party/srtp/crypto/include;../../third_party/yuv/include;../../third_party/webrtc/src;../../third_party/webrtc_aec3/src;../..;$(DXSDK_DIR)include;%(AdditionalIncludeDirectories) + _LIB;__ARMEL__;WEBRTC_WIN;WEBRTC_APM_DEBUG_DUMP=0;NOMINMAX;%(PreprocessorDefinitions) @@ -350,23 +449,33 @@ X64 - ../include;../../pjlib/include;../../pjlib-util/include;../../pjnath/include;../../third_party/portaudio/include;../../third_party/speex/include;../../third_party/build/srtp;../../third_party/srtp/include;../../third_party/srtp/crypto/include;../../third_party/yuv/include;../../third_party/webrtc/src;../..;$(DXSDK_DIR)include;%(AdditionalIncludeDirectories) - _LIB;%(PreprocessorDefinitions) + ../include;../../pjlib/include;../../pjlib-util/include;../../pjnath/include;../../third_party/portaudio/include;../../third_party/speex/include;../../third_party/build/srtp;../../third_party/srtp/include;../../third_party/srtp/crypto/include;../../third_party/yuv/include;../../third_party/webrtc/src;../../third_party/webrtc_aec3/src;../..;$(DXSDK_DIR)include;%(AdditionalIncludeDirectories) + _LIB;WEBRTC_WIN;WEBRTC_APM_DEBUG_DUMP=0;NOMINMAX;%(PreprocessorDefinitions) ProgramDatabase + + + + ../include;../../pjlib/include;../../pjlib-util/include;../../pjnath/include;../../third_party/portaudio/include;../../third_party/speex/include;../../third_party/build/srtp;../../third_party/srtp/include;../../third_party/srtp/crypto/include;../../third_party/yuv/include;../../third_party/webrtc/src;../../third_party/webrtc_aec3/src;../..;$(DXSDK_DIR)include;%(AdditionalIncludeDirectories) + _LIB;WEBRTC_WIN;WEBRTC_APM_DEBUG_DUMP=0;NOMINMAX;%(PreprocessorDefinitions) + + + ProgramDatabase + + - ../include;../../pjlib/include;../../pjlib-util/include;../../pjnath/include;../../third_party/portaudio/include;../../third_party/speex/include;../../third_party/build/srtp;../../third_party/srtp/include;../../third_party/srtp/crypto/include;../../third_party/yuv/include;../../third_party/webrtc/src;../..;$(DXSDK_DIR)include;%(AdditionalIncludeDirectories) - _LIB;%(PreprocessorDefinitions) + ../include;../../pjlib/include;../../pjlib-util/include;../../pjnath/include;../../third_party/portaudio/include;../../third_party/speex/include;../../third_party/build/srtp;../../third_party/srtp/include;../../third_party/srtp/crypto/include;../../third_party/yuv/include;../../third_party/webrtc/src;../../third_party/webrtc_aec3/src;../..;$(DXSDK_DIR)include;%(AdditionalIncludeDirectories) + _LIB;WEBRTC_WIN;WEBRTC_APM_DEBUG_DUMP=0;NOMINMAX;%(PreprocessorDefinitions) - ../include;../../pjlib/include;../../pjlib-util/include;../../pjnath/include;../../third_party/portaudio/include;../../third_party/speex/include;../../third_party/build/srtp;../../third_party/srtp/include;../../third_party/srtp/crypto/include;../../third_party/yuv/include;../../third_party/webrtc/src;../..;$(DXSDK_DIR)include;%(AdditionalIncludeDirectories) - _LIB;__ARMEL__;%(PreprocessorDefinitions) + ../include;../../pjlib/include;../../pjlib-util/include;../../pjnath/include;../../third_party/portaudio/include;../../third_party/speex/include;../../third_party/build/srtp;../../third_party/srtp/include;../../third_party/srtp/crypto/include;../../third_party/yuv/include;../../third_party/webrtc/src;../../third_party/webrtc_aec3/src;../..;$(DXSDK_DIR)include;%(AdditionalIncludeDirectories) + _LIB;__ARMEL__;WEBRTC_WIN;WEBRTC_APM_DEBUG_DUMP=0;NOMINMAX;%(PreprocessorDefinitions) @@ -376,23 +485,33 @@ X64 - ../include;../../pjlib/include;../../pjlib-util/include;../../pjnath/include;../../third_party/portaudio/include;../../third_party/speex/include;../../third_party/build/srtp;../../third_party/srtp/include;../../third_party/srtp/crypto/include;../../third_party/yuv/include;../../third_party/webrtc/src;../..;$(DXSDK_DIR)include;%(AdditionalIncludeDirectories) - _LIB;%(PreprocessorDefinitions) + ../include;../../pjlib/include;../../pjlib-util/include;../../pjnath/include;../../third_party/portaudio/include;../../third_party/speex/include;../../third_party/build/srtp;../../third_party/srtp/include;../../third_party/srtp/crypto/include;../../third_party/yuv/include;../../third_party/webrtc/src;../../third_party/webrtc_aec3/src;../..;$(DXSDK_DIR)include;%(AdditionalIncludeDirectories) + _LIB;WEBRTC_WIN;WEBRTC_APM_DEBUG_DUMP=0;NOMINMAX;%(PreprocessorDefinitions) ProgramDatabase + + + + ../include;../../pjlib/include;../../pjlib-util/include;../../pjnath/include;../../third_party/portaudio/include;../../third_party/speex/include;../../third_party/build/srtp;../../third_party/srtp/include;../../third_party/srtp/crypto/include;../../third_party/yuv/include;../../third_party/webrtc/src;../../third_party/webrtc_aec3/src;../..;$(DXSDK_DIR)include;%(AdditionalIncludeDirectories) + _LIB;WEBRTC_WIN;WEBRTC_APM_DEBUG_DUMP=0;NOMINMAX;%(PreprocessorDefinitions) + + + ProgramDatabase + + - ../include;../../pjlib/include;../../pjlib-util/include;../../pjnath/include;../../third_party/portaudio/include;../../third_party/speex/include;../../third_party/build/srtp;../../third_party/srtp/include;../../third_party/srtp/crypto/include;../../third_party/yuv/include;../../third_party/webrtc/src;../..;$(DXSDK_DIR)include;%(AdditionalIncludeDirectories) - _LIB;%(PreprocessorDefinitions) + ../include;../../pjlib/include;../../pjlib-util/include;../../pjnath/include;../../third_party/portaudio/include;../../third_party/speex/include;../../third_party/build/srtp;../../third_party/srtp/include;../../third_party/srtp/crypto/include;../../third_party/yuv/include;../../third_party/webrtc/src;../../third_party/webrtc_aec3/src;../..;$(DXSDK_DIR)include;%(AdditionalIncludeDirectories) + _LIB;WEBRTC_WIN;WEBRTC_APM_DEBUG_DUMP=0;NOMINMAX;%(PreprocessorDefinitions) - ../include;../../pjlib/include;../../pjlib-util/include;../../pjnath/include;../../third_party/portaudio/include;../../third_party/speex/include;../../third_party/build/srtp;../../third_party/srtp/include;../../third_party/srtp/crypto/include;../../third_party/yuv/include;../../third_party/webrtc/src;../..;$(DXSDK_DIR)include;%(AdditionalIncludeDirectories) - _LIB;__ARMEL__;%(PreprocessorDefinitions) + ../include;../../pjlib/include;../../pjlib-util/include;../../pjnath/include;../../third_party/portaudio/include;../../third_party/speex/include;../../third_party/build/srtp;../../third_party/srtp/include;../../third_party/srtp/crypto/include;../../third_party/yuv/include;../../third_party/webrtc/src;../../third_party/webrtc_aec3/src;../..;$(DXSDK_DIR)include;%(AdditionalIncludeDirectories) + _LIB;__ARMEL__;WEBRTC_WIN;WEBRTC_APM_DEBUG_DUMP=0;NOMINMAX;%(PreprocessorDefinitions) @@ -402,22 +521,31 @@ X64 - ../include;../../pjlib/include;../../pjlib-util/include;../../pjnath/include;../../third_party/portaudio/include;../../third_party/speex/include;../../third_party/build/srtp;../../third_party/srtp/include;../../third_party/srtp/crypto/include;../../third_party/yuv/include;../../third_party/webrtc/src;../..;$(DXSDK_DIR)include;%(AdditionalIncludeDirectories) - _LIB;%(PreprocessorDefinitions) + ../include;../../pjlib/include;../../pjlib-util/include;../../pjnath/include;../../third_party/portaudio/include;../../third_party/speex/include;../../third_party/build/srtp;../../third_party/srtp/include;../../third_party/srtp/crypto/include;../../third_party/yuv/include;../../third_party/webrtc/src;../../third_party/webrtc_aec3/src;../..;$(DXSDK_DIR)include;%(AdditionalIncludeDirectories) + _LIB;WEBRTC_WIN;WEBRTC_APM_DEBUG_DUMP=0;NOMINMAX;%(PreprocessorDefinitions) + + + + ../include;../../pjlib/include;../../pjlib-util/include;../../pjnath/include;../../third_party/portaudio/include;../../third_party/speex/include;../../third_party/build/srtp;../../third_party/srtp/include;../../third_party/srtp/crypto/include;../../third_party/yuv/include;../../third_party/webrtc/src;../../third_party/webrtc_aec3/src;../..;$(DXSDK_DIR)include;%(AdditionalIncludeDirectories) + _LIB;WEBRTC_WIN;WEBRTC_APM_DEBUG_DUMP=0;NOMINMAX;%(PreprocessorDefinitions) + + + + - ../include;../../pjlib/include;../../pjlib-util/include;../../pjnath/include;../../third_party/portaudio/include;../../third_party/speex/include;../../third_party/build/srtp;../../third_party/srtp/include;../../third_party/srtp/crypto/include;../../third_party/yuv/include;../../third_party/webrtc/src;../..;$(DXSDK_DIR)include;%(AdditionalIncludeDirectories) - _LIB;%(PreprocessorDefinitions) + ../include;../../pjlib/include;../../pjlib-util/include;../../pjnath/include;../../third_party/portaudio/include;../../third_party/speex/include;../../third_party/build/srtp;../../third_party/srtp/include;../../third_party/srtp/crypto/include;../../third_party/yuv/include;../../third_party/webrtc/src;../../third_party/webrtc_aec3/src;../..;$(DXSDK_DIR)include;%(AdditionalIncludeDirectories) + _LIB;WEBRTC_WIN;WEBRTC_APM_DEBUG_DUMP=0;NOMINMAX;%(PreprocessorDefinitions) - ../include;../../pjlib/include;../../pjlib-util/include;../../pjnath/include;../../third_party/portaudio/include;../../third_party/speex/include;../../third_party/build/srtp;../../third_party/srtp/include;../../third_party/srtp/crypto/include;../../third_party/yuv/include;../../third_party/webrtc/src;../..;$(DXSDK_DIR)include;%(AdditionalIncludeDirectories) - _LIB;__ARMEL__;%(PreprocessorDefinitions) + ../include;../../pjlib/include;../../pjlib-util/include;../../pjnath/include;../../third_party/portaudio/include;../../third_party/speex/include;../../third_party/build/srtp;../../third_party/srtp/include;../../third_party/srtp/crypto/include;../../third_party/yuv/include;../../third_party/webrtc/src;../../third_party/webrtc_aec3/src;../..;$(DXSDK_DIR)include;%(AdditionalIncludeDirectories) + _LIB;__ARMEL__;WEBRTC_WIN;WEBRTC_APM_DEBUG_DUMP=0;NOMINMAX;%(PreprocessorDefinitions) @@ -427,23 +555,33 @@ X64 - ../include;../../pjlib/include;../../pjlib-util/include;../../pjnath/include;../../third_party/portaudio/include;../../third_party/speex/include;../../third_party/build/srtp;../../third_party/srtp/include;../../third_party/srtp/crypto/include;../../third_party/yuv/include;../../third_party/webrtc/src;../..;$(DXSDK_DIR)include;%(AdditionalIncludeDirectories) - _LIB;%(PreprocessorDefinitions) + ../include;../../pjlib/include;../../pjlib-util/include;../../pjnath/include;../../third_party/portaudio/include;../../third_party/speex/include;../../third_party/build/srtp;../../third_party/srtp/include;../../third_party/srtp/crypto/include;../../third_party/yuv/include;../../third_party/webrtc/src;../../third_party/webrtc_aec3/src;../..;$(DXSDK_DIR)include;%(AdditionalIncludeDirectories) + _LIB;WEBRTC_WIN;WEBRTC_APM_DEBUG_DUMP=0;NOMINMAX;%(PreprocessorDefinitions) ProgramDatabase + + + + ../include;../../pjlib/include;../../pjlib-util/include;../../pjnath/include;../../third_party/portaudio/include;../../third_party/speex/include;../../third_party/build/srtp;../../third_party/srtp/include;../../third_party/srtp/crypto/include;../../third_party/yuv/include;../../third_party/webrtc/src;../../third_party/webrtc_aec3/src;../..;$(DXSDK_DIR)include;%(AdditionalIncludeDirectories) + _LIB;WEBRTC_WIN;WEBRTC_APM_DEBUG_DUMP=0;NOMINMAX;%(PreprocessorDefinitions) + + + ProgramDatabase + + - ../include;../../pjlib/include;../../pjlib-util/include;../../pjnath/include;../../third_party/portaudio/include;../../third_party/speex/include;../../third_party/build/srtp;../../third_party/srtp/include;../../third_party/srtp/crypto/include;../../third_party/yuv/include;../../third_party/webrtc/src;../..;$(DXSDK_DIR)include;%(AdditionalIncludeDirectories) - _LIB;%(PreprocessorDefinitions) + ../include;../../pjlib/include;../../pjlib-util/include;../../pjnath/include;../../third_party/portaudio/include;../../third_party/speex/include;../../third_party/build/srtp;../../third_party/srtp/include;../../third_party/srtp/crypto/include;../../third_party/yuv/include;../../third_party/webrtc/src;../../third_party/webrtc_aec3/src;../..;$(DXSDK_DIR)include;%(AdditionalIncludeDirectories) + _LIB;WEBRTC_WIN;WEBRTC_APM_DEBUG_DUMP=0;NOMINMAX;%(PreprocessorDefinitions) - ../include;../../pjlib/include;../../pjlib-util/include;../../pjnath/include;../../third_party/portaudio/include;../../third_party/speex/include;../../third_party/build/srtp;../../third_party/srtp/include;../../third_party/srtp/crypto/include;../../third_party/yuv/include;../../third_party/webrtc/src;../..;$(DXSDK_DIR)include;%(AdditionalIncludeDirectories) - _LIB;__ARMEL__;%(PreprocessorDefinitions) + ../include;../../pjlib/include;../../pjlib-util/include;../../pjnath/include;../../third_party/portaudio/include;../../third_party/speex/include;../../third_party/build/srtp;../../third_party/srtp/include;../../third_party/srtp/crypto/include;../../third_party/yuv/include;../../third_party/webrtc/src;../../third_party/webrtc_aec3/src;../..;$(DXSDK_DIR)include;%(AdditionalIncludeDirectories) + _LIB;__ARMEL__;WEBRTC_WIN;WEBRTC_APM_DEBUG_DUMP=0;NOMINMAX;%(PreprocessorDefinitions) @@ -453,11 +591,20 @@ X64 - ../include;../../pjlib/include;../../pjlib-util/include;../../pjnath/include;../../third_party/portaudio/include;../../third_party/speex/include;../../third_party/build/srtp;../../third_party/srtp/include;../../third_party/srtp/crypto/include;../../third_party/yuv/include;../../third_party/webrtc/src;../..;$(DXSDK_DIR)include;%(AdditionalIncludeDirectories) - _LIB;%(PreprocessorDefinitions) + ../include;../../pjlib/include;../../pjlib-util/include;../../pjnath/include;../../third_party/portaudio/include;../../third_party/speex/include;../../third_party/build/srtp;../../third_party/srtp/include;../../third_party/srtp/crypto/include;../../third_party/yuv/include;../../third_party/webrtc/src;../../third_party/webrtc_aec3/src;../..;$(DXSDK_DIR)include;%(AdditionalIncludeDirectories) + _LIB;WEBRTC_WIN;WEBRTC_APM_DEBUG_DUMP=0;NOMINMAX;%(PreprocessorDefinitions) + + + + ../include;../../pjlib/include;../../pjlib-util/include;../../pjnath/include;../../third_party/portaudio/include;../../third_party/speex/include;../../third_party/build/srtp;../../third_party/srtp/include;../../third_party/srtp/crypto/include;../../third_party/yuv/include;../../third_party/webrtc/src;../../third_party/webrtc_aec3/src;../..;$(DXSDK_DIR)include;%(AdditionalIncludeDirectories) + _LIB;WEBRTC_WIN;WEBRTC_APM_DEBUG_DUMP=0;NOMINMAX;%(PreprocessorDefinitions) + + + + @@ -477,6 +624,9 @@ + + stdcpp17 + @@ -528,11 +678,17 @@ true true true + true true + true true + true true + true true + true true + true true @@ -548,11 +704,17 @@ true true true + true true + true true + true true + true true + true true + true diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjmedia/build/pjmedia.vcxproj.filters asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjmedia/build/pjmedia.vcxproj.filters --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjmedia/build/pjmedia.vcxproj.filters 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjmedia/build/pjmedia.vcxproj.filters 2022-02-24 07:54:38.000000000 +0000 @@ -227,6 +227,9 @@ Source Files + + Source Files + diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjmedia/build/pjmedia_videodev.vcxproj asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjmedia/build/pjmedia_videodev.vcxproj --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjmedia/build/pjmedia_videodev.vcxproj 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjmedia/build/pjmedia_videodev.vcxproj 2022-02-24 07:54:38.000000000 +0000 @@ -5,6 +5,10 @@ Debug-Dynamic ARM + + Debug-Dynamic + ARM64 + Debug-Dynamic Win32 @@ -17,6 +21,10 @@ Debug-Static ARM + + Debug-Static + ARM64 + Debug-Static Win32 @@ -29,6 +37,10 @@ Debug ARM + + Debug + ARM64 + Debug Win32 @@ -41,6 +53,10 @@ Release-Dynamic ARM + + Release-Dynamic + ARM64 + Release-Dynamic Win32 @@ -53,6 +69,10 @@ Release-Static ARM + + Release-Static + ARM64 + Release-Static Win32 @@ -65,6 +85,10 @@ Release ARM + + Release + ARM64 + Release Win32 @@ -161,40 +185,77 @@ false MultiByte + + StaticLibrary + v140 + false + MultiByte + StaticLibrary v140 false MultiByte + + StaticLibrary + v140 + false + MultiByte + StaticLibrary v140 false MultiByte + + StaticLibrary + v140 + false + MultiByte + StaticLibrary v140 false MultiByte + + StaticLibrary + v140 + false + MultiByte + StaticLibrary v140 false MultiByte + + StaticLibrary + v140 + false + MultiByte + StaticLibrary v140 false MultiByte + + StaticLibrary + v140 + false + MultiByte + $(BuildToolset) - + + @@ -264,31 +325,61 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>14.0.22823.1 @@ -335,6 +426,19 @@ ..\lib\pjmedia-videodev-$(TargetCPU)-$(Platform)-vc$(VSVer)-$(Configuration).lib + + + + ../include;../../pjlib/include;../../pjlib-util/include;../../pjnath/include;../../third_party/portaudio/include;../../third_party/speex/include;../../third_party/build/srtp;../../third_party/srtp/crypto/include;../../third_party/srtp/include;../..;../../third_party/BaseClasses;%(AdditionalIncludeDirectories) + _LIB;%(PreprocessorDefinitions) + + + ProgramDatabase + + + ..\lib\pjmedia-videodev-$(TargetCPU)-$(Platform)-vc$(VSVer)-$(Configuration).lib + + ../include;../../pjlib/include;../../pjlib-util/include;../../pjnath/include;../../third_party/portaudio/include;../../third_party/speex/include;../../third_party/build/srtp;../../third_party/srtp/crypto/include;../../third_party/srtp/include;../..;../../third_party/BaseClasses;%(AdditionalIncludeDirectories) @@ -369,6 +473,18 @@ ..\lib\pjmedia-videodev-$(TargetCPU)-$(Platform)-vc$(VSVer)-$(Configuration).lib + + + + ../include;../../pjlib/include;../../pjlib-util/include;../../pjnath/include;../../third_party/portaudio/include;../../third_party/speex/include;../../third_party/build/srtp;../../third_party/srtp/crypto/include;../../third_party/srtp/include;../..;../../third_party/BaseClasses;%(AdditionalIncludeDirectories) + _LIB;%(PreprocessorDefinitions) + + + + + ..\lib\pjmedia-videodev-$(TargetCPU)-$(Platform)-vc$(VSVer)-$(Configuration).lib + + ../include;../../pjlib/include;../../pjlib-util/include;../../pjnath/include;../../third_party/portaudio/include;../../third_party/speex/include;../../third_party/build/srtp;../../third_party/srtp/crypto/include;../../third_party/srtp/include;../..;../../third_party/BaseClasses;%(AdditionalIncludeDirectories) @@ -404,6 +520,19 @@ ..\lib\pjmedia-videodev-$(TargetCPU)-$(Platform)-vc$(VSVer)-$(Configuration).lib + + + + ../include;../../pjlib/include;../../pjlib-util/include;../../pjnath/include;../../third_party/portaudio/include;../../third_party/speex/include;../../third_party/build/srtp;../../third_party/srtp/crypto/include;../../third_party/srtp/include;../..;../../third_party/BaseClasses;%(AdditionalIncludeDirectories) + _LIB;%(PreprocessorDefinitions) + + + ProgramDatabase + + + ..\lib\pjmedia-videodev-$(TargetCPU)-$(Platform)-vc$(VSVer)-$(Configuration).lib + + ../include;../../pjlib/include;../../pjlib-util/include;../../pjnath/include;../../third_party/portaudio/include;../../third_party/speex/include;../../third_party/build/srtp;../../third_party/srtp/crypto/include;../../third_party/srtp/include;../..;../../third_party/BaseClasses;%(AdditionalIncludeDirectories) @@ -438,6 +567,18 @@ ..\lib\pjmedia-videodev-$(TargetCPU)-$(Platform)-vc$(VSVer)-$(Configuration).lib + + + + ../include;../../pjlib/include;../../pjlib-util/include;../../pjnath/include;../../third_party/portaudio/include;../../third_party/speex/include;../../third_party/build/srtp;../../third_party/srtp/crypto/include;../../third_party/srtp/include;../..;../../third_party/BaseClasses;%(AdditionalIncludeDirectories) + _LIB;%(PreprocessorDefinitions) + + + + + ..\lib\pjmedia-videodev-$(TargetCPU)-$(Platform)-vc$(VSVer)-$(Configuration).lib + + ../include;../../pjlib/include;../../pjlib-util/include;../../pjnath/include;../../third_party/portaudio/include;../../third_party/speex/include;../../third_party/build/srtp;../../third_party/srtp/crypto/include;../../third_party/srtp/include;../..;../../third_party/BaseClasses;%(AdditionalIncludeDirectories) @@ -473,6 +614,19 @@ ..\lib\pjmedia-videodev-$(TargetCPU)-$(Platform)-vc$(VSVer)-$(Configuration).lib + + + + ../include;../../pjlib/include;../../pjlib-util/include;../../pjnath/include;../../third_party/portaudio/include;../../third_party/speex/include;../../third_party/build/srtp;../../third_party/srtp/crypto/include;../../third_party/srtp/include;../..;../../third_party/BaseClasses;%(AdditionalIncludeDirectories) + _LIB;%(PreprocessorDefinitions) + + + ProgramDatabase + + + ..\lib\pjmedia-videodev-$(TargetCPU)-$(Platform)-vc$(VSVer)-$(Configuration).lib + + ../include;../../pjlib/include;../../pjlib-util/include;../../pjnath/include;../../third_party/portaudio/include;../../third_party/speex/include;../../third_party/build/srtp;../../third_party/srtp/crypto/include;../../third_party/srtp/include;../..;../../third_party/BaseClasses;%(AdditionalIncludeDirectories) @@ -505,6 +659,18 @@ ..\lib\pjmedia-videodev-$(TargetCPU)-$(Platform)-vc$(VSVer)-$(Configuration).lib + + + + + + ../include;../../pjlib/include;../../pjlib-util/include;../../pjnath/include;../../third_party/portaudio/include;../../third_party/speex/include;../../third_party/build/srtp;../../third_party/srtp/crypto/include;../../third_party/srtp/include;../..;../../third_party/BaseClasses;%(AdditionalIncludeDirectories) + _LIB;%(PreprocessorDefinitions) + + + + + ..\lib\pjmedia-videodev-$(TargetCPU)-$(Platform)-vc$(VSVer)-$(Configuration).lib diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjmedia/include/pjmedia/conference.h asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjmedia/include/pjmedia/conference.h --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjmedia/include/pjmedia/conference.h 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjmedia/include/pjmedia/conference.h 2022-02-24 07:54:38.000000000 +0000 @@ -361,6 +361,32 @@ /** + * Disconnect unidirectional audio from all sources to the specified sink slot. + * + * @param conf The conference bridge. + * @param sink_slot Sink slot. + * + * @return PJ_SUCCESS on success. + */ +PJ_DECL(pj_status_t) +pjmedia_conf_disconnect_port_from_sources( pjmedia_conf *conf, + unsigned sink_slot); + + +/** + * Disconnect unidirectional audio from the specified source to all sink slots. + * + * @param conf The conference bridge. + * @param src_slot Source slot. + * + * @return PJ_SUCCESS on success. + */ +PJ_DECL(pj_status_t) +pjmedia_conf_disconnect_port_from_sinks( pjmedia_conf *conf, + unsigned src_slot); + + +/** * Get number of ports currently registered to the conference bridge. * * @param conf The conference bridge. diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjmedia/include/pjmedia/config.h asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjmedia/include/pjmedia/config.h --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjmedia/include/pjmedia/config.h 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjmedia/include/pjmedia/config.h 2022-02-24 07:54:38.000000000 +0000 @@ -45,6 +45,34 @@ #endif /** + * Initial memory block for media endpoint. + */ +#ifndef PJMEDIA_POOL_LEN_ENDPT +# define PJMEDIA_POOL_LEN_ENDPT 512 +#endif + +/** + * Memory increment for media endpoint. + */ +#ifndef PJMEDIA_POOL_INC_ENDPT +# define PJMEDIA_POOL_INC_ENDPT 512 +#endif + +/** + * Initial memory block for event manager. + */ +#ifndef PJMEDIA_POOL_LEN_EVTMGR +# define PJMEDIA_POOL_LEN_EVTMGR 500 +#endif + +/** + * Memory increment for evnt manager. + */ +#ifndef PJMEDIA_POOL_INC_EVTMGR +# define PJMEDIA_POOL_INC_EVTMGR 500 +#endif + +/** * Specify whether we prefer to use audio switch board rather than * conference bridge. * @@ -603,7 +631,7 @@ #endif /** - * Perform RTP payload type checking in the stream. Normally the peer + * Perform RTP payload type checking in the audio stream. Normally the peer * MUST send RTP with payload type as we specified in our SDP. Certain * agents may not be able to follow this hence the only way to have * communication is to disable this check. @@ -864,6 +892,20 @@ /** + * This macro declares whether PJMEDIA should generate multiple + * telephone-event formats in SDP offer, i.e: one for each audio codec + * clock rate (see also ticket #2088). If this macro is set to zero, only + * one telephone event format will be generated and it uses clock rate 8kHz + * (old behavior before ticket #2088). + * + * Default: 1 (yes) + */ +#ifndef PJMEDIA_TELEPHONE_EVENT_ALL_CLOCKRATES +# define PJMEDIA_TELEPHONE_EVENT_ALL_CLOCKRATES 1 +#endif + + +/** * Maximum tones/digits that can be enqueued in the tone generator. */ #ifndef PJMEDIA_TONEGEN_MAX_DIGITS @@ -1095,6 +1137,28 @@ /** + * Specify whether SRTP needs to handle condition that old packets with + * incorect RTP seq are still coming when SRTP is restarted. + * + * Default: enabled. + */ +#ifndef PJMEDIA_SRTP_CHECK_RTP_SEQ_ON_RESTART +# define PJMEDIA_SRTP_CHECK_RTP_SEQ_ON_RESTART 1 +#endif + + +/** + * Specify whether SRTP needs to handle condition that remote may reset + * or maintain ROC when SRTP is restarted. + * + * Default: enabled. + */ +#ifndef PJMEDIA_SRTP_CHECK_ROC_ON_RESTART +# define PJMEDIA_SRTP_CHECK_ROC_ON_RESTART 1 +#endif + + +/** * Let the library handle libsrtp initialization and deinitialization. * Application may want to disable this and manually perform libsrtp * initialization and deinitialization when it needs to use libsrtp @@ -1152,7 +1216,7 @@ * Maximum size in bytes of storage buffer of a transport specific info. */ #ifndef PJMEDIA_TRANSPORT_SPECIFIC_INFO_MAXSIZE -# define PJMEDIA_TRANSPORT_SPECIFIC_INFO_MAXSIZE (36*sizeof(long)) +# define PJMEDIA_TRANSPORT_SPECIFIC_INFO_MAXSIZE (50*sizeof(long)) #endif @@ -1220,6 +1284,30 @@ /** + * Specify the number of keep-alive needed to be sent after the stream is + * created. + * + * Setting this to 0 will disable it. + * + * Default : 2 + */ +#ifndef PJMEDIA_STREAM_START_KA_CNT +# define PJMEDIA_STREAM_START_KA_CNT 2 +#endif + + +/** + * Specify the interval to send keep-alive after the stream is created, + * in msec. + * + * Default : 1000 + */ +#ifndef PJMEDIA_STREAM_START_KA_INTERVAL_MSEC +# define PJMEDIA_STREAM_START_KA_INTERVAL_MSEC 1000 +#endif + + +/** * Specify the number of identical consecutive error that will be ignored when * receiving RTP/RTCP data before the library tries to restart the transport. * @@ -1428,6 +1516,24 @@ /** + * Reset jitter buffer and return silent audio on stream playback start + * (first get_frame()). This is useful to avoid possible noise that may be + * introduced by discard algorithm and neutralize latency when audio device + * is started later than the stream. + * + * Set this to N>0 to allow N silent audio frames returned on stream playback + * start, this will allow about N frames to be buffered in the jitter buffer + * before the playback is started (prefetching effect). + * Set this to zero to disable this feature. + * + * Default: 1 + */ +#ifndef PJMEDIA_STREAM_SOFT_START +# define PJMEDIA_STREAM_SOFT_START 1 +#endif + + +/** * Video stream will discard old picture from the jitter buffer as soon as * new picture is received, to reduce latency. * @@ -1559,6 +1665,17 @@ #endif +/** + * Perform RTP payload type checking in the video stream. Normally the peer + * MUST send RTP with payload type as we specified in our SDP. Certain + * agents may not be able to follow this hence the only way to have + * communication is to disable this check. + * + * Default: PJMEDIA_STREAM_CHECK_RTP_PT (follow audio stream's setting) + */ +#ifndef PJMEDIA_VID_STREAM_CHECK_RTP_PT +# define PJMEDIA_VID_STREAM_CHECK_RTP_PT PJMEDIA_STREAM_CHECK_RTP_PT +#endif /** * @} diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjmedia/include/pjmedia/converter.h asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjmedia/include/pjmedia/converter.h --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjmedia/include/pjmedia/converter.h 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjmedia/include/pjmedia/converter.h 2022-02-24 07:54:38.000000000 +0000 @@ -347,10 +347,10 @@ * @param cv The converter instance. * @param src_frame The source frame. * @param src_frame_size The source frame size. - * @param src_reg_pos The source region position. + * @param src_pos The source region position. * @param dst_frame The destination frame. * @param dst_frame_size The destination frame size. - * @param dst_reg_pos The destination region position. + * @param dst_pos The destination region position. * @param param This is unused for now and must be NULL. * * @return PJ_SUCCESS if conversion has been performed diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjmedia/include/pjmedia/echo.h asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjmedia/include/pjmedia/echo.h --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjmedia/include/pjmedia/echo.h 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjmedia/include/pjmedia/echo.h 2022-02-24 07:54:38.000000000 +0000 @@ -59,34 +59,36 @@ { /** * Use any available backend echo canceller algorithm. This is - * the default settings. This setting is mutually exclusive with - * PJMEDIA_ECHO_SIMPLE and PJMEDIA_ECHO_SPEEX. + * the default settings. You can only choose one backend. */ PJMEDIA_ECHO_DEFAULT= 0, /** * Force to use Speex AEC as the backend echo canceller algorithm. - * This setting is mutually exclusive with PJMEDIA_ECHO_SIMPLE and - * PJMEDIA_ECHO_WEBRTC. + * You can only choose one backend. */ PJMEDIA_ECHO_SPEEX = 1, /** * If PJMEDIA_ECHO_SIMPLE flag is specified during echo canceller * creation, then a simple echo suppressor will be used instead of - * an accoustic echo cancellation. This setting is mutually exclusive - * with PJMEDIA_ECHO_SPEEX and PJMEDIA_ECHO_WEBRTC. + * an accoustic echo cancellation. You can only choose one backend. */ PJMEDIA_ECHO_SIMPLE = 2, /** * Force to use WebRTC AEC as the backend echo canceller algorithm. - * This setting is mutually exclusive with PJMEDIA_ECHO_SIMPLE and - * PJMEDIA_ECHO_SPEEX. + * You can only choose one backend. */ PJMEDIA_ECHO_WEBRTC = 3, /** + * Force to use WebRTC AEC3 as the backend echo canceller algorithm. + * You can only choose one backend. + */ + PJMEDIA_ECHO_WEBRTC_AEC3 = 4, + + /** * For internal use. */ PJMEDIA_ECHO_ALGO_MASK = 15, @@ -116,6 +118,12 @@ * canceller will also apply noise suppressor method to reduce noise. */ PJMEDIA_ECHO_USE_NOISE_SUPPRESSOR = 128, + + /** + * If PJMEDIA_ECHO_USE_GAIN_CONTROLLER flag is specified, the echo + * canceller will also apply automatic gain control. + */ + PJMEDIA_ECHO_USE_GAIN_CONTROLLER = 256, /** * Use default aggressiveness setting for the echo canceller algorithm. @@ -129,26 +137,26 @@ * algorithm. This setting is mutually exclusive with the other * aggressiveness settings. */ - PJMEDIA_ECHO_AGGRESSIVENESS_CONSERVATIVE = 0x100, + PJMEDIA_ECHO_AGGRESSIVENESS_CONSERVATIVE = 0x1000, /** * Use moderate aggressiveness setting for the echo canceller algorithm. * This setting is mutually exclusive with the other aggressiveness * settings. */ - PJMEDIA_ECHO_AGGRESSIVENESS_MODERATE = 0x200, + PJMEDIA_ECHO_AGGRESSIVENESS_MODERATE = 0x2000, /** * Use aggressive aggressiveness setting for the echo canceller * algorithm. This setting is mutually exclusive with the other * aggressiveness settings. */ - PJMEDIA_ECHO_AGGRESSIVENESS_AGGRESSIVE = 0x300, + PJMEDIA_ECHO_AGGRESSIVENESS_AGGRESSIVE = 0x3000, /** * For internal use. */ - PJMEDIA_ECHO_AGGRESSIVENESS_MASK = 0xF00 + PJMEDIA_ECHO_AGGRESSIVENESS_MASK = 0xF000 } pjmedia_echo_flag; @@ -168,10 +176,22 @@ const char *name; /** - * Echo delay median value (in ms). + * Echo delay value (in ms). + * PJMEDIA_ECHO_STAT_NOT_SPECIFIED if unavailable. + */ + int delay; + + /** + * Echo return loss. + * PJMEDIA_ECHO_STAT_NOT_SPECIFIED if unavailable. + */ + double return_loss; + + /** + * Echo return loss enhancement. * PJMEDIA_ECHO_STAT_NOT_SPECIFIED if unavailable. */ - int median; + double return_loss_enh; /** * Echo delay standard deviation (in ms). diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjmedia/include/pjmedia/endpoint.h asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjmedia/include/pjmedia/endpoint.h --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjmedia/include/pjmedia/endpoint.h 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjmedia/include/pjmedia/endpoint.h 2022-02-24 07:54:38.000000000 +0000 @@ -60,6 +60,20 @@ } pjmedia_endpt_flag; +/** + * This structure specifies various settings that can be passed when creating + * audio/video sdp. + */ +typedef struct pjmedia_endpt_create_sdp_param +{ + /** + * Direction of the media. + * + * Default: PJMEDIA_DIR_ENCODING_DECODING + */ + pjmedia_dir dir; + +} pjmedia_endpt_create_sdp_param; /** * Type of callback to register to pjmedia_endpt_atexit(). @@ -68,6 +82,15 @@ /** + * Call this function to initialize \a pjmedia_endpt_create_sdp_param with default + * values. + * + * @param param The param to be initialized. + */ +PJ_DECL(void) +pjmedia_endpt_create_sdp_param_default(pjmedia_endpt_create_sdp_param *param); + +/** * Create an instance of media endpoint. * * @param pf Pool factory, which will be used by the media endpoint @@ -296,16 +319,18 @@ * @param endpt The media endpoint. * @param pool Pool to allocate memory from. * @param si Socket information. - * @param options Option flags, must be zero for now. + * @param options Options parameter, can be NULL. If set to NULL, + * default values will be used. * @param p_m Pointer to receive the created SDP media. * * @return PJ_SUCCESS on success, or the appropriate error code. */ -PJ_DECL(pj_status_t) pjmedia_endpt_create_audio_sdp(pjmedia_endpt *endpt, - pj_pool_t *pool, - const pjmedia_sock_info*si, - unsigned options, - pjmedia_sdp_media **p_m); +PJ_DECL(pj_status_t) +pjmedia_endpt_create_audio_sdp(pjmedia_endpt *endpt, + pj_pool_t *pool, + const pjmedia_sock_info *si, + const pjmedia_endpt_create_sdp_param *options, + pjmedia_sdp_media **p_m); /** * Create SDP media line for video media. @@ -313,16 +338,18 @@ * @param endpt The media endpoint. * @param pool Pool to allocate memory from. * @param si Socket information. - * @param options Option flags, must be zero for now. + * @param options Options parameter, can be NULL. If set to NULL, + * default values will be used. * @param p_m Pointer to receive the created SDP media. * * @return PJ_SUCCESS on success, or the appropriate error code. */ -PJ_DECL(pj_status_t) pjmedia_endpt_create_video_sdp(pjmedia_endpt *endpt, - pj_pool_t *pool, - const pjmedia_sock_info*si, - unsigned options, - pjmedia_sdp_media **p_m); +PJ_DECL(pj_status_t) +pjmedia_endpt_create_video_sdp(pjmedia_endpt *endpt, + pj_pool_t *pool, + const pjmedia_sock_info *si, + const pjmedia_endpt_create_sdp_param *options, + pjmedia_sdp_media **p_m); /** * Dump media endpoint capabilities. diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjmedia/include/pjmedia/format.h asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjmedia/include/pjmedia/format.h --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjmedia/include/pjmedia/format.h 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjmedia/include/pjmedia/format.h 2022-02-24 07:54:38.000000000 +0000 @@ -227,6 +227,8 @@ PJMEDIA_FORMAT_MPEG2VIDEO = PJMEDIA_FORMAT_PACK('M', 'P', '2', 'V'), PJMEDIA_FORMAT_MPEG4 = PJMEDIA_FORMAT_PACK('M', 'P', 'G', '4'), + PJMEDIA_FORMAT_INVALID = 0xFFFFFFFF + } pjmedia_format_id; /** @@ -639,8 +641,6 @@ * @param height Image heigth. * @param fps_num FPS numerator. * @param fps_denum FPS denumerator. - * @param avg_bps Average bitrate. - * @param max_bps Maximum bitrate. */ PJ_DECL(void) pjmedia_format_init_video(pjmedia_format *fmt, pj_uint32_t fmt_id, @@ -793,6 +793,25 @@ */ PJ_DECL(void) pjmedia_video_format_mgr_destroy(pjmedia_video_format_mgr *mgr); + +/***************************************************************************** + * FORMAT FUNCTION HELPER: + */ + +/** + * Fill video frame buffer with black color. + * + * @param fmt The video format. + * @param buf The frame buffer. + * @param buf_size The frame buffer size. + * + * @return PJ_SUCCESS if successfull. + */ +PJ_DECL(pj_status_t) pjmedia_video_format_fill_black(const pjmedia_format *fmt, + void *buf, + pj_size_t buf_size); + + PJ_END_DECL /** diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjmedia/include/pjmedia/rtcp_fb.h asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjmedia/include/pjmedia/rtcp_fb.h --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjmedia/include/pjmedia/rtcp_fb.h 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjmedia/include/pjmedia/rtcp_fb.h 2022-02-24 07:54:38.000000000 +0000 @@ -227,7 +227,6 @@ * @param dst Destination configuration. * @param src Source configuration. * - * @return PJ_SUCCESS on success. */ PJ_DECL(void) pjmedia_rtcp_fb_setting_dup(pj_pool_t *pool, pjmedia_rtcp_fb_setting *dst, @@ -241,7 +240,6 @@ * @param dst Destination info. * @param src Source info. * - * @return PJ_SUCCESS on success. */ PJ_DECL(void) pjmedia_rtcp_fb_info_dup(pj_pool_t *pool, pjmedia_rtcp_fb_info *dst, diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjmedia/include/pjmedia/rtp.h asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjmedia/include/pjmedia/rtp.h --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjmedia/include/pjmedia/rtp.h 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjmedia/include/pjmedia/rtp.h 2022-02-24 07:54:38.000000000 +0000 @@ -155,6 +155,20 @@ }; /** + * Mask for the E ("End") bit of telephony-events payload. + * + * @see pjmedia_rtp_dtmf_event + */ +#define PJMEDIA_RTP_DTMF_EVENT_END_MASK 0x80 + +/** + * Mask for the Volume field of telephony-events payload. + * + * @see pjmedia_rtp_dtmf_event + */ +#define PJMEDIA_RTP_DTMF_EVENT_VOLUME_MASK 0x3F + +/** * @see pjmedia_rtp_dtmf_event */ typedef struct pjmedia_rtp_dtmf_event pjmedia_rtp_dtmf_event; diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjmedia/include/pjmedia/sdp.h asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjmedia/include/pjmedia/sdp.h --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjmedia/include/pjmedia/sdp.h 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjmedia/include/pjmedia/sdp.h 2022-02-24 07:54:38.000000000 +0000 @@ -348,7 +348,7 @@ * * @param attr Generic attribute to be converted to ssrc, which * name must be "ssrc". - * @param ssrc SDP ssrc attribute to be initialized. + * @param rtcp SDP ssrc attribute to be initialized. * * @return PJ_SUCCESS on success. */ @@ -408,7 +408,7 @@ * Compare connection info. * * @param conn1 The first connection info to compare. - * @param conn1 The second connection info to compare. + * @param conn2 The second connection info to compare. * @param option Comparison option, which should be zero for now. * * @return PJ_SUCCESS when both connection info are equal, otherwise @@ -484,6 +484,17 @@ */ typedef struct pjmedia_sdp_media pjmedia_sdp_media; +/** + * Print media description to a buffer. + * + * @param media The media description. + * @param buf The buffer. + * @param size The buffer length. + * + * @return the length printed, or -1 if the buffer is too + * short. + */ +PJ_DECL(int) pjmedia_sdp_media_print(const pjmedia_sdp_media *media, char *buf, pj_size_t size); /** * Clone SDP media description. diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjmedia/include/pjmedia/signatures.h asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjmedia/include/pjmedia/signatures.h --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjmedia/include/pjmedia/signatures.h 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjmedia/include/pjmedia/signatures.h 2022-02-24 07:54:38.000000000 +0000 @@ -112,7 +112,7 @@ /** * Macro to generate signature from four ASCII letters. */ -#define PJMEDIA_SIGNATURE(a,b,c,d) PJMEDIA_FOURCC(a,b,c,d) +#define PJMEDIA_SIGNATURE(a,b,c,d) PJMEDIA_FOURCC(d,c,b,a) /************************************************************************* * Codec signature ('Cxxx'). Please keep the constant names sorted. @@ -124,13 +124,13 @@ * Audio codec signatures ('CAxx'). Please keep the constant names sorted. */ #define PJMEDIA_SIG_CLASS_AUD_CODEC(c,d) PJMEDIA_SIG_CLASS_CODEC('A',c,d) -#define PJMEDIA_SIG_IS_CLASS_AUD_CODEC(s) ((s)>>24=='C' && (s)>>16=='A') +#define PJMEDIA_SIG_IS_CLASS_AUD_CODEC(s) ((s)>>24=='C' && (((s)>>16)&0xff)=='A') /************************************************************************* * Video codec signatures ('CVxx'). Please keep the constant names sorted. */ #define PJMEDIA_SIG_CLASS_VID_CODEC(c,d) PJMEDIA_SIG_CLASS_CODEC('V',c,d) -#define PJMEDIA_SIG_IS_CLASS_VID_CODEC(sig) ((s)>>24=='C' && (s)>>16=='V') +#define PJMEDIA_SIG_IS_CLASS_VID_CODEC(sig) ((s)>>24=='C' && (((s)>>16)&0xff)=='V') #define PJMEDIA_SIG_VID_CODEC_FFMPEG PJMEDIA_SIG_CLASS_VID_CODEC('F','F') @@ -144,7 +144,7 @@ * Audio ports signatures ('PAxx'). Please keep the constant names sorted. */ #define PJMEDIA_SIG_CLASS_PORT_AUD(c,d) PJMEDIA_SIG_CLASS_PORT('A',c,d) -#define PJMEDIA_SIG_IS_CLASS_PORT_AUD(s) ((s)>>24=='P' && (s)>>16=='A') +#define PJMEDIA_SIG_IS_CLASS_PORT_AUD(s) ((s)>>24=='P' && (((s)>>16)&0xff)=='A') #define PJMEDIA_SIG_PORT_BIDIR PJMEDIA_SIG_CLASS_PORT_AUD('B','D') #define PJMEDIA_SIG_PORT_CONF PJMEDIA_SIG_CLASS_PORT_AUD('C','F') @@ -169,7 +169,7 @@ * Video ports signatures ('PVxx'). Please keep the constant names sorted. */ #define PJMEDIA_SIG_CLASS_PORT_VID(c,d) PJMEDIA_SIG_CLASS_PORT('V',c,d) -#define PJMEDIA_SIG_IS_CLASS_PORT_VID(s) ((s)>>24=='P' && (s)>>16=='V') +#define PJMEDIA_SIG_IS_CLASS_PORT_VID(s) ((s)>>24=='P' && (((s)>>16)&0xff)=='V') /** AVI player signature. */ #define PJMEDIA_SIG_PORT_VID_AVI_PLAYER PJMEDIA_SIG_CLASS_PORT_VID('A','V') @@ -181,7 +181,7 @@ * Video device signatures ('VDxx'). Please keep the constant names sorted. */ #define PJMEDIA_SIG_CLASS_VID_DEV(c,d) PJMEDIA_SIGNATURE('V','D',c,d) -#define PJMEDIA_SIG_IS_CLASS_VID_DEV(s) ((s)>>24=='V' && (s)>>16=='D') +#define PJMEDIA_SIG_IS_CLASS_VID_DEV(s) ((s)>>24=='V' && (((s)>>16)&0xff)=='D') #define PJMEDIA_SIG_VID_DEV_COLORBAR PJMEDIA_SIG_CLASS_VID_DEV('C','B') #define PJMEDIA_SIG_VID_DEV_SDL PJMEDIA_SIG_CLASS_VID_DEV('S','D') @@ -195,7 +195,7 @@ * Other video objects ('VOxx'). Please keep the constant names sorted. */ #define PJMEDIA_SIG_CLASS_VID_OTHER(c,d) PJMEDIA_SIGNATURE('V','O',c,d) -#define PJMEDIA_SIG_IS_CLASS_VID_OTHER(s) ((s)>>24=='V' && (s)>>16=='O') +#define PJMEDIA_SIG_IS_CLASS_VID_OTHER(s) ((s)>>24=='V' && (((s)>>16)&0xff)=='O') #define PJMEDIA_SIG_VID_CONF PJMEDIA_SIG_CLASS_VID_OTHER('C','F') #define PJMEDIA_SIG_VID_PORT PJMEDIA_SIG_CLASS_VID_OTHER('P','O') diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjmedia/include/pjmedia/sound.h asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjmedia/include/pjmedia/sound.h --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjmedia/include/pjmedia/sound.h 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjmedia/include/pjmedia/sound.h 2022-02-24 07:54:38.000000000 +0000 @@ -123,7 +123,7 @@ * * @param user_data User data associated with the stream. * @param timestamp Timestamp, in samples. - * @param output Buffer containing the captured audio samples. + * @param input Buffer containing the captured audio samples. * @param size The size of the data in the buffer, in bytes. * * @return Non-zero to stop the stream. diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjmedia/include/pjmedia/splitcomb.h asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjmedia/include/pjmedia/splitcomb.h --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjmedia/include/pjmedia/splitcomb.h 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjmedia/include/pjmedia/splitcomb.h 2022-02-24 07:54:38.000000000 +0000 @@ -113,7 +113,10 @@ * @param options Normally is zero, but the lower 8-bit of the * options can be used to specify the number of * buffers in the circular buffer. If zero, then - * default number will be used (default: 8). + * default number will be used (default: 8). The second + * lowest 8 bits can be used to specify the options for + * the underlying delay buffer (see + * #pjmedia_delay_buf_flag for the possible options). * @param p_chport The media port created with reverse phase for * the specified audio channel. * diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjmedia/include/pjmedia/stream_common.h asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjmedia/include/pjmedia/stream_common.h --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjmedia/include/pjmedia/stream_common.h 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjmedia/include/pjmedia/stream_common.h 2022-02-24 07:54:38.000000000 +0000 @@ -55,7 +55,48 @@ } pjmedia_stream_rtp_sess_info; +#if defined(PJMEDIA_STREAM_ENABLE_KA) && PJMEDIA_STREAM_ENABLE_KA!=0 +/** + * Structure of configuration settings for stream keepalive. + */ +typedef struct pjmedia_stream_ka_config +{ + /** + * The number of keepalive to be sent after the stream is created. + * When this is set to 0, keepalive will be sent once for NAT hole + * punching if stream's #use_ka is enabled. + * + * Default: PJMEDIA_STREAM_START_KA_CNT + */ + unsigned start_count; + + /** + * The keepalive sending interval after the stream is created. + * + * Default: PJMEDIA_STREAM_START_KA_INTERVAL_MSEC + */ + unsigned start_interval; + + /** + * The keepalive sending interval, after #start_count number keepalive + * was sent. + * + * Default: PJMEDIA_STREAM_KA_INTERVAL (seconds) + */ + unsigned ka_interval; + +} pjmedia_stream_ka_config; + +/** + * Initialize the stream send keep-alive with default settings. + * + * @param cfg Stream send keep-alive structure to be initialized. + */ +PJ_DECL(void) +pjmedia_stream_ka_config_default(pjmedia_stream_ka_config *cfg); + +#endif /** * This is internal function for parsing SDP format parameter of specific diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjmedia/include/pjmedia/stream.h asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjmedia/include/pjmedia/stream.h --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjmedia/include/pjmedia/stream.h 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjmedia/include/pjmedia/stream.h 2022-02-24 07:54:38.000000000 +0000 @@ -85,7 +85,7 @@ */ typedef struct pjmedia_channel pjmedia_channel; -/** +/** * This structure describes media stream information. Each media stream * corresponds to one "m=" line in SDP session descriptor, and it has * its own RTP/RTCP socket pair. @@ -95,6 +95,7 @@ pjmedia_type type; /**< Media type (audio, video) */ pjmedia_tp_proto proto; /**< Transport protocol (RTP/AVP, etc.) */ pjmedia_dir dir; /**< Media direction. */ + pj_sockaddr local_addr; /**< Local RTP address */ pj_sockaddr rem_addr; /**< Remote RTP address */ pj_sockaddr rem_rtcp; /**< Optional remote RTCP address. If sin_family is zero, the RTP address @@ -138,17 +139,52 @@ int jb_max_pre; /**< Jitter buffer maximum prefetch delay in msec (-1 for default). */ int jb_max; /**< Jitter buffer max delay in msec. */ + pjmedia_jb_discard_algo jb_discard_algo; + /**< Jitter buffer discard algorithm. */ #if defined(PJMEDIA_STREAM_ENABLE_KA) && PJMEDIA_STREAM_ENABLE_KA!=0 pj_bool_t use_ka; /**< Stream keep-alive and NAT hole punch (see #PJMEDIA_STREAM_ENABLE_KA) is enabled? */ + pjmedia_stream_ka_config ka_cfg; + /**< Stream send kep-alive settings. */ #endif pj_bool_t rtcp_sdes_bye_disabled; /**< Disable automatic sending of RTCP SDES and BYE. */ } pjmedia_stream_info; +/** + * This enumeration defines flags used by #pjmedia_stream_dtmf_event. + */ +typedef enum pjmedia_stream_dtmf_event_flags { + /** + * The event was already indicated earlier. The new indication contains an + * updated event duration. + */ + PJMEDIA_STREAM_DTMF_IS_UPDATE = (1 << 0), + + /** + * The event has ended and the indication contains the final event + * duration. + * Note that end indications might get lost. Hence it is not guaranteed + * to receive an event with PJMEDIA_STREAM_DTMF_IS_END for every event. + */ + PJMEDIA_STREAM_DTMF_IS_END = (1 << 1), +} pjmedia_stream_dtmf_event_flags; + +/** + * This structure describes DTMF telephony-events indicated through + * #pjmedia_stream_set_dtmf_event_callback(). + */ +typedef struct pjmedia_stream_dtmf_event { + int digit; /**< DTMF digit as ASCII character. */ + pj_uint32_t timestamp; /**< RTP timestamp of the event. */ + pj_uint16_t duration; /**< Event duration, in milliseconds. */ + pj_uint16_t flags; /**< Event flags (see + #pjmedia_stream_dtmf_event_flags). */ +} pjmedia_stream_dtmf_event; + /** * This function will initialize the stream info based on information @@ -401,6 +437,8 @@ * Set callback to be called upon receiving DTMF digits. If callback is * registered, the stream will not buffer incoming DTMF but rather call * the callback as soon as DTMF digit is received completely. + * This callback will not be called if another callback is set via + * #pjmedia_stream_set_dtmf_event_callback() as well. * * @param stream The media stream. * @param cb Callback to be called upon receiving DTMF digits. @@ -418,6 +456,26 @@ int digit), void *user_data); +/** + * Set callback to be called upon receiving DTMF digits. If callback is + * registered, the stream will not buffer incoming DTMF but rather call + * the callback as soon as DTMF digit is received. + * + * @param stream The media stream. + * @param cb Callback to be called upon receiving DTMF digits. + * See #pjmedia_stream_dtmf_event. + * @param user_data User data to be returned back when the callback + * is called. + * + * @return PJ_SUCCESS on success. + */ +PJ_DECL(pj_status_t) +pjmedia_stream_set_dtmf_event_callback(pjmedia_stream *stream, + void (*cb)(pjmedia_stream*, + void *user_data, + const pjmedia_stream_dtmf_event *event), + void *user_data); + /** * Send RTCP SDES for the media stream. diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjmedia/include/pjmedia/tonegen.h asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjmedia/include/pjmedia/tonegen.h --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjmedia/include/pjmedia/tonegen.h 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjmedia/include/pjmedia/tonegen.h 2022-02-24 07:54:38.000000000 +0000 @@ -200,6 +200,16 @@ /** + * Instruct the tone generator to stop looping of the current tone set. + * + * @param tonegen The tone generator instance. + * + * @return PJ_SUCCESS on success. + */ +PJ_DECL(pj_status_t) pjmedia_tonegen_stop_loop(pjmedia_port *tonegen); + + +/** * Rewind the playback. This will start the playback to the first * tone in the playback list. * diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjmedia/include/pjmedia/transport_ice.h asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjmedia/include/pjmedia/transport_ice.h --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjmedia/include/pjmedia/transport_ice.h 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjmedia/include/pjmedia/transport_ice.h 2022-02-24 07:54:38.000000000 +0000 @@ -74,6 +74,25 @@ pj_status_t status, void *user_data); + /** + * Callback to report a new ICE local candidate, e.g: after successful + * STUN Binding, after a successful TURN allocation. Only new candidates + * whose type is server reflexive or relayed will be notified via this + * callback. This callback also indicates end-of-candidate via parameter + * 'last'. + * + * Trickle ICE can use this callback to convey the new candidate + * to remote agent and monitor end-of-candidate indication. + * + * @param tp PJMEDIA ICE transport. + * @param cand The new local candidate, can be NULL when the last + * local candidate initialization failed/timeout. + * @param last PJ_TRUE if this is the last of local candidate. + */ + void (*on_new_candidate)(pjmedia_transport *tp, + const pj_ice_sess_cand *cand, + pj_bool_t last); + } pjmedia_ice_cb; @@ -99,6 +118,9 @@ */ pj_ice_sess_role role; + pj_str_t loc_ufrag; + pj_str_t rem_ufrag; + /** * Number of components in the component array. Before ICE negotiation * is complete, the number represents the number of components of the @@ -152,7 +174,18 @@ * are different after several packets are received. * Specifying this option will disable this feature. */ - PJMEDIA_ICE_NO_SRC_ADDR_CHECKING = 1 + PJMEDIA_ICE_NO_SRC_ADDR_CHECKING = 1, + + /** + * The standard (rfc5245) specify that ice-mismatch attribute is used + * due to a mismatch of candidates with the default destination for media + * signaled in the SDP. The purpose is to identify some poorly ALGs that + * alter signaling information in ways that break ICE + * (e.g., by rewriting IP addresses in SDP). Specifying this option is + * to disable the ice mismatch check and allow ICE to continue + * if such scenario occur. + */ + PJMEDIA_ICE_DISABLE_ICE_MISMATCH = 2 }; @@ -278,6 +311,141 @@ void *user_data); +/** + * Check if trickle support is signalled in the specified SDP. This function + * will check trickle indication in the media level first, if not found, it + * will check in the session level. + * + * @param sdp The SDP. + * @param med_idx The media index to be checked. + * + * @return PJ_TRUE if trickle ICE indication is found. + */ +PJ_DECL(pj_bool_t) pjmedia_ice_sdp_has_trickle(const pjmedia_sdp_session *sdp, + unsigned med_idx); + + +/** + * Update check list after remote ICE candidates list are received or after + * or local ICE candidates are conveyed. This function may also be called + * after end-of-candidates indication is received or conveyed. ICE + * connectivity checks will automatically be started if both sides have + * conveyed ICE info (ICE user fragment and/or candidate list). + * + * To update the check list after conveying any new local candidates, + * application can set the remote ICE parameters to NULL or zero. Note that + * the checklist should only be updated after any newly found local candidates + * are conveyed to remote, instead of immediately after the finding. + * + * This function is only applicable when trickle ICE is not disabled. + * + * @param tp The ICE media transport. + * @param rem_ufrag Remote ufrag, as seen in the SDP received from + * the remote agent. + * @param rem_passwd Remote password, as seen in the SDP received from + * the remote agent. + * @param rcand_cnt Number of new remote candidates in the array. + * @param rcand New remote candidates array. + * @param rcand_end Set to PJ_TRUE if remote has signalled + * end-of-candidate. + * + * @return PJ_SUCCESS, or the appropriate error code. + */ +PJ_DECL(pj_status_t) pjmedia_ice_trickle_update( + pjmedia_transport *tp, + const pj_str_t *rem_ufrag, + const pj_str_t *rem_passwd, + unsigned rcand_cnt, + const pj_ice_sess_cand rcand[], + pj_bool_t rcand_end); + + +/** + * Decode trickle ICE info from the specified SDP. + * + * @param sdp The SDP containing trickle ICE info. + * @param media_index The media index. + * @param mid Output, media ID. + * @param ufrag Output, ufrag. + * @param passwd Output, password. + * @param cand_cnt On input, maximum number of candidate array. + * On output, the number of candidates. + * @param cand Output, the candidates. + * @param end_of_cand Output, end of candidate indication. + * + * @return PJ_SUCCESS, or the appropriate error code. + */ +PJ_DECL(pj_status_t) pjmedia_ice_trickle_decode_sdp( + const pjmedia_sdp_session *sdp, + unsigned media_index, + pj_str_t *mid, + pj_str_t *ufrag, + pj_str_t *passwd, + unsigned *cand_cnt, + pj_ice_sess_cand cand[], + pj_bool_t *end_of_cand); + + +/** + * Encode trickle ICE info into the specified SDP. This function may generate + * the following SDP attributes: + * - Media ID, "a=mid". + * - ICE ufrag & password, "a=ice-ufrag" & "a=ice-pwd". + * - Trickle ICE support indication, "a=ice-options:trickle". + * - ICE candidates, "a=candidate". + * - End of candidate indication, "a=end-of-candidates". + * + * @param sdp_pool The memory pool for generating SDP attributes. + * @param sdp The SDP to be updated. + * @param mid The media ID. + * @param ufrag The ufrag, optional. + * @param passwd The password, optional. + * @param cand_cnt The number of local candidates, can be zero. + * @param cand The local candidates. + * @param end_of_cand End of candidate indication. + * + * @return PJ_SUCCESS, or the appropriate error code. + */ +PJ_DECL(pj_status_t) pjmedia_ice_trickle_encode_sdp( + pj_pool_t *sdp_pool, + pjmedia_sdp_session *sdp, + const pj_str_t *mid, + const pj_str_t *ufrag, + const pj_str_t *passwd, + unsigned cand_cnt, + const pj_ice_sess_cand cand[], + pj_bool_t end_of_cand); + + +/** + * Check if trickling ICE has found any new local candidates since the last + * conveyance (via pjmedia_ice_trickle_send_local_cand()). + * + * @param tp The ICE media transport. + * + * @return PJ_TRUE if new local canditates are available. + */ +PJ_DECL(pj_bool_t) pjmedia_ice_trickle_has_new_cand(pjmedia_transport *tp); + + +/** + * Convey all local candidates via the specified SDP. + * + * @param tp The ICE media transport. + * @param sdp_pool The memory pool for generating SDP attributes. + * @param sdp The SDP. + * @param p_end_of_cand Optional, pointer to receive the indication that + * candidate gathering has been completed. + * + * @return PJ_SUCCESS, or the appropriate error code. + */ +PJ_DECL(pj_status_t) pjmedia_ice_trickle_send_local_cand( + pjmedia_transport *tp, + pj_pool_t *sdp_pool, + pjmedia_sdp_session *sdp, + pj_bool_t *p_end_of_cand); + + PJ_END_DECL diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjmedia/include/pjmedia/transport_srtp.h asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjmedia/include/pjmedia/transport_srtp.h --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjmedia/include/pjmedia/transport_srtp.h 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjmedia/include/pjmedia/transport_srtp.h 2022-02-24 07:54:38.000000000 +0000 @@ -115,6 +115,13 @@ PJMEDIA_SRTP_DISABLED, /** + * When this flag is specified, SRTP setting is unknown. This is to set + * the initial remote's SRTP usage. It will be set later after remote's + * policy in the SDP is received. + */ + PJMEDIA_SRTP_UNKNOWN = PJMEDIA_SRTP_DISABLED, + + /** * When this flag is specified, SRTP will be advertised as optional and * incoming SRTP offer will be accepted. */ @@ -172,6 +179,23 @@ /** + * RTP sequence rollover counter settings. + */ +typedef struct pjmedia_srtp_roc +{ + /** + * The synchronization source. + */ + pj_uint32_t ssrc; + + /** + * The rollover counter. + */ + pj_uint32_t roc; + +} pjmedia_srtp_roc; + +/** * Settings to be given when creating SRTP transport. Application should call * #pjmedia_srtp_setting_default() to initialize this structure with its * default values. @@ -223,6 +247,30 @@ pjmedia_srtp_keying_method keying[PJMEDIA_SRTP_KEYINGS_COUNT]; /** + * RTP sequence rollover counter initialization value for incoming + * direction. This is useful to maintain ROC after media transport + * recreation such as in IP change scenario. + */ + pjmedia_srtp_roc rx_roc; + + /** + * The previous value of RTP sequence rollover counter. This is + * useful in situations when we expect the remote to reset/maintain + * ROC but for some reason, they don't. Thus, when we encounter + * SRTP packet unprotect failure during probation, we will retry to + * unprotect with this ROC value as well. + * Set prev_rx_roc.ssrc to 0 to disable this feature. + */ + pjmedia_srtp_roc prev_rx_roc; + + /** + * RTP sequence rollover counter initialization value for outgoing + * direction. This is useful to maintain ROC after media transport + * recreation such as in IP change scenario. + */ + pjmedia_srtp_roc tx_roc; + + /** * Specify SRTP callback. */ pjmedia_srtp_cb cb; @@ -266,6 +314,16 @@ */ pjmedia_srtp_use peer_use; + /** + * RTP sequence rollover counter info for incoming direction. + */ + pjmedia_srtp_roc rx_roc; + + /** + * RTP sequence rollover counter info for outgoing direction. + */ + pjmedia_srtp_roc tx_roc; + } pjmedia_srtp_info; @@ -344,7 +402,7 @@ * @param count On input, specifies the maximum length of keying method * array. On output, the number of available keying method * initialized by this function. - * @param crypto The SRTP keying method array output. + * @param keying The SRTP keying method array output. * * @return PJ_SUCCESS on success. */ @@ -372,6 +430,31 @@ pjmedia_transport **p_tp); /** + * Get current SRTP media transport setting. + * + * @param srtp The SRTP transport. + * @param opt Structure to receive the SRTP setting + * + * @return PJ_SUCCESS on success. + */ +PJ_DECL(pj_status_t) pjmedia_transport_srtp_get_setting( + pjmedia_transport *srtp, + pjmedia_srtp_setting *opt); + + +/** + * Modify SRTP media transport setting. + * + * @param srtp The SRTP transport. + * @param opt New setting + * + * @return PJ_SUCCESS on success. + */ +PJ_DECL(pj_status_t) pjmedia_transport_srtp_modify_setting( + pjmedia_transport *srtp, + const pjmedia_srtp_setting *opt); + +/** * Get fingerprint of local DTLS-SRTP certificate. * * @param srtp The SRTP transport. diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjmedia/include/pjmedia/vid_codec.h asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjmedia/include/pjmedia/vid_codec.h --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjmedia/include/pjmedia/vid_codec.h 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjmedia/include/pjmedia/vid_codec.h 2022-02-24 07:54:38.000000000 +0000 @@ -610,7 +610,6 @@ * * @param mgr The codec manager instance. If NULL, the default codec * manager instance will be used. - * @param pool The pool instance. * @param info The codec info, which default parameter's is being * updated. * @param param The new default codec parameter. Set to NULL to reset diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjmedia/include/pjmedia/vid_conf.h asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjmedia/include/pjmedia/vid_conf.h --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjmedia/include/pjmedia/vid_conf.h 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjmedia/include/pjmedia/vid_conf.h 2022-02-24 07:54:38.000000000 +0000 @@ -222,7 +222,7 @@ /** * Enumerate occupied slots in the video conference bridge. * - * @param conf The video conference bridge. + * @param vid_conf The video conference bridge. * @param slots Array of slot to be filled in. * @param count On input, specifies the maximum number of slot * in the array. On return, it will be filled with @@ -254,7 +254,7 @@ * Enable unidirectional video flow from the specified source slot to * the specified sink slot. * - * @param conf The video conference bridge. + * @param vid_conf The video conference bridge. * @param src_slot Source slot. * @param sink_slot Sink slot. * @param opt The option, for future use, currently this must @@ -273,7 +273,7 @@ * Disconnect unidirectional video flow from the specified source to * the specified sink slot. * - * @param conf The video conference bridge. + * @param vid_conf The video conference bridge. * @param src_slot Source slot. * @param sink_slot Sink slot. * @@ -285,6 +285,23 @@ unsigned sink_slot); +/** + * Update or refresh port states from video port info. Some port may + * change its port info in the middle of a session, for example when + * a video stream decoder learns that incoming video size or frame rate + * has changed, video conference needs to be informed to update its + * internal states. + * + * @param vid_conf The video conference bridge. + * @param slot The media port's slot index to be updated. + * + * @return PJ_SUCCESS on success, or the appropriate error + * code. + */ +PJ_DECL(pj_status_t) pjmedia_vid_conf_update_port(pjmedia_vid_conf *vid_conf, + unsigned slot); + + PJ_END_DECL /** diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjmedia/include/pjmedia/videodev.h asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjmedia/include/pjmedia/videodev.h --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjmedia/include/pjmedia/videodev.h 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjmedia/include/pjmedia/videodev.h 2022-02-24 07:54:38.000000000 +0000 @@ -163,6 +163,30 @@ /** + * Enumeration of window fullscreen flags. + */ +typedef enum pjmedia_vid_dev_fullscreen_flag +{ + /** + * Windowed or disable fullscreen. + */ + PJMEDIA_VID_DEV_WINDOWED = 0, + + /** + * Fullscreen enabled, video mode may be changed. + */ + PJMEDIA_VID_DEV_FULLSCREEN = 1, + + /** + * Fullscreen enabled by resizing video frame to match to the desktop, + * video mode will not be changed. + */ + PJMEDIA_VID_DEV_FULLSCREEN_DESKTOP = 2 + +} pjmedia_vid_dev_fullscreen_flag; + + +/** * This enumeration identifies various video device capabilities. These video * capabilities indicates what features are supported by the underlying * video device implementation. @@ -469,10 +493,11 @@ unsigned window_flags; /** - * Video window's full screen status. This setting is optional, and will only be - * used if PJMEDIA_VID_DEV_CAP_OUTPUT_FULLSCREEN is set in the flags. + * Video window's fullscreen status. This setting is optional, and will + * only be used if PJMEDIA_VID_DEV_CAP_OUTPUT_FULLSCREEN is set in the + * flags. */ - pj_bool_t window_fullscreen; + pjmedia_vid_dev_fullscreen_flag window_fullscreen; } pjmedia_vid_dev_param; diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjmedia/include/pjmedia/vid_port.h asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjmedia/include/pjmedia/vid_port.h --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjmedia/include/pjmedia/vid_port.h 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjmedia/include/pjmedia/vid_port.h 2022-02-24 07:54:38.000000000 +0000 @@ -168,6 +168,18 @@ pjmedia_port *port); /** + * Unsubscribe media event notifications from the specified media port. + * + * @param vid_port The video port. + * @param port The media port whose events to be unsubscribed. + * + * @return PJ_SUCCESS on success or the appropriate error code. + */ +PJ_DECL(pj_status_t) pjmedia_vid_port_unsubscribe_event( + pjmedia_vid_port *vid_port, + pjmedia_port *port); + +/** * Connect the video port to a downstream (slave) media port. This operation * is only valid for video ports created with active interface selected. * Connecting a passive video port may raise an assertion. diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjmedia/include/pjmedia/vid_stream.h asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjmedia/include/pjmedia/vid_stream.h --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjmedia/include/pjmedia/vid_stream.h 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjmedia/include/pjmedia/vid_stream.h 2022-02-24 07:54:38.000000000 +0000 @@ -152,6 +152,7 @@ pjmedia_type type; /**< Media type (audio, video) */ pjmedia_tp_proto proto; /**< Transport protocol (RTP/AVP, etc.) */ pjmedia_dir dir; /**< Media direction. */ + pj_sockaddr local_addr; /**< Local RTP address */ pj_sockaddr rem_addr; /**< Remote RTP address */ pj_sockaddr rem_rtcp; /**< Optional remote RTCP address. If sin_family is zero, the RTP address @@ -185,6 +186,8 @@ pj_bool_t use_ka; /**< Stream keep-alive and NAT hole punch (see #PJMEDIA_STREAM_ENABLE_KA) is enabled? */ + pjmedia_stream_ka_config ka_cfg; + /**< Stream send kep-alive settings. */ #endif pjmedia_vid_codec_info codec_info; /**< Incoming codec format info. */ @@ -434,9 +437,9 @@ /** - * Send RTCP SDES for the media stream. + * Send RTCP SDES for the video stream. * - * @param stream The media stream. + * @param stream The video stream. * * @return PJ_SUCCESS on success. */ @@ -445,15 +448,27 @@ /** - * Send RTCP BYE for the media stream. + * Send RTCP BYE for the video stream. * - * @param stream The media stream. + * @param stream The video stream. * * @return PJ_SUCCESS on success. */ PJ_DECL(pj_status_t) pjmedia_vid_stream_send_rtcp_bye( pjmedia_vid_stream *stream); + +/** + * Send RTCP PLI for the video stream. + * + * @param stream The video stream. + * + * @return PJ_SUCCESS on success. + */ +PJ_DECL(pj_status_t) pjmedia_vid_stream_send_rtcp_pli( + pjmedia_vid_stream *stream); + + /** * Get the RTP session information of the video media stream. This function * can be useful for app with custom media transport to inject/filter some diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjmedia/include/pjmedia/wav_playlist.h asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjmedia/include/pjmedia/wav_playlist.h --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjmedia/include/pjmedia/wav_playlist.h 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjmedia/include/pjmedia/wav_playlist.h 2022-02-24 07:54:38.000000000 +0000 @@ -49,6 +49,8 @@ * @param pool Pool to create memory buffers for this port. * @param port_label Optional label to set as the port name. * @param file_list Array of WAV file names. + * Each filename's length must be smaller than + * PJ_MAXPATH. * @param file_count Number of files in the array. * @param ptime The duration (in miliseconds) of each frame read * from this port. If the value is zero, the default diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjmedia/include/pjmedia-audiodev/config.h asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjmedia/include/pjmedia-audiodev/config.h --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjmedia/include/pjmedia-audiodev/config.h 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjmedia/include/pjmedia-audiodev/config.h 2022-02-24 07:54:38.000000000 +0000 @@ -82,6 +82,14 @@ #endif /** + * This setting controls whether Android Oboe audio support should be + * included. + */ +#ifndef PJMEDIA_AUDIO_DEV_HAS_OBOE +# define PJMEDIA_AUDIO_DEV_HAS_OBOE 0 +#endif + +/** * This setting controls whether BlackBerry 10 (BB10) audio support * should be included. */ diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjmedia/include/pjmedia-codec/amr_helper.h asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjmedia/include/pjmedia-codec/amr_helper.h --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjmedia/include/pjmedia-codec/amr_helper.h 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjmedia/include/pjmedia-codec/amr_helper.h 2022-02-24 07:54:38.000000000 +0000 @@ -887,7 +887,7 @@ unsigned i, max_pkt_size; - max_pkt_size = *pkt_size; + max_pkt_size = (unsigned)*pkt_size; if (setting->amr_nb) { SID_FT = 8; diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjmedia/include/pjmedia-codec/and_aud_mediacodec.h asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjmedia/include/pjmedia-codec/and_aud_mediacodec.h --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjmedia/include/pjmedia-codec/and_aud_mediacodec.h 1970-01-01 00:00:00.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjmedia/include/pjmedia-codec/and_aud_mediacodec.h 2022-02-24 07:54:38.000000000 +0000 @@ -0,0 +1,131 @@ +/* + * Copyright (C)2020 Teluu Inc. (http://www.teluu.com) + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#ifndef __PJMEDIA_CODEC_AND_AUD_MEDIACODEC_H__ +#define __PJMEDIA_CODEC_AND_AUD_MEDIACODEC_H__ + +/** + * @file and_aud_mediacodec.h + * @brief Android audio MediaCodec codecs. + */ + +#include + +/** + * @defgroup PJMEDIA_CODEC_AUD_MEDIACODEC Audio MediaCodec Codec + * @ingroup PJMEDIA_CODEC_CODECS + * @{ + * + * Audio MediaCodec codec wrapper for Android. + * + * This codec wrapper contains varius codecs: i.e: AMR and AMR-WB. + * + * \section pjmedia_codec_mediacodec_AMR MediaCodec AMRNB/AMR-WB + * + * MediaCodec AMR supports 16-bit PCM audio signal with sampling rate 8000Hz, + * 20ms frame length and producing various bitrates that ranges from 4.75kbps + * to 12.2kbps. + * \subsection codec_setting Codec Settings + * + * General codec settings for this codec such as VAD and PLC can be + * manipulated through the setting field in #pjmedia_codec_param. + * Please see the documentation of #pjmedia_codec_param for more info. + * Note that MediaCodec doesn't provide internal VAD/PLC feature, they will be + * provided by PJMEDIA instead. + * + * \subsubsection bitrate Bitrate + * + * By default, encoding bitrate is 7400bps. This default setting can be + * modified using #pjmedia_codec_mgr_set_default_param() by specifying + * prefered AMR bitrate in field info::avg_bps of + * #pjmedia_codec_param. Valid bitrates could be seen in + * #pjmedia_codec_amrnb_bitrates. + * + * \subsubsection payload_format Payload Format + * + * There are two AMR payload format types, bandwidth-efficient and + * octet-aligned. Default setting is using octet-aligned. This default payload + * format can be modified using #pjmedia_codec_mgr_set_default_param(). + * + * In #pjmedia_codec_param, payload format can be set by specifying SDP + * format parameters "octet-align" in the SDP "a=fmtp" attribute for + * decoding direction. Valid values are "0" (for bandwidth efficient mode) + * and "1" (for octet-aligned mode). + * + * \subsubsection mode_set Mode-Set + * + * Mode-set is used for restricting AMR modes in decoding direction. + * + * By default, no mode-set restriction applied. This default setting can be + * be modified using #pjmedia_codec_mgr_set_default_param(). + * + * In #pjmedia_codec_param, mode-set could be specified via format parameters + * "mode-set" in the SDP "a=fmtp" attribute for decoding direction. Valid + * value is a comma separated list of modes from the set 0 - 7, e.g: + * "4,5,6,7". When this parameter is omitted, no mode-set restrictions applied. + * + * Here is an example of modifying AMR default codec param: + \code + pjmedia_codec_param param; + + pjmedia_codec_mgr_get_default_param(.., ¶m); + ... + // set default encoding bitrate to the highest 12.2kbps + param.info.avg_bps = 12200; + + // restrict decoding bitrate to 10.2kbps and 12.2kbps only + param.setting.dec_fmtp.param[0].name = pj_str("mode-set"); + param.setting.dec_fmtp.param[0].val = pj_str("6,7"); + + // also set to use bandwidth-efficient payload format + param.setting.dec_fmtp.param[1].name = pj_str("octet-align"); + param.setting.dec_fmtp.param[1].val = pj_str("0"); + + param.setting.dec_fmtp.cnt = 2; + ... + pjmedia_codec_mgr_set_default_param(.., ¶m); + \endcode + */ + +PJ_BEGIN_DECL + +/** + * Initialize and register Android audio MediaCodec factory to pjmedia + * endpoint. + * + * @param endpt The pjmedia endpoint. + * + * @return PJ_SUCCESS on success. + */ +PJ_DECL(pj_status_t) pjmedia_codec_and_media_aud_init( pjmedia_endpt *endpt ); + +/** + * Unregister Android audio MediaCodec factory from pjmedia endpoint + * and deinitialize the codec library. + * + * @return PJ_SUCCESS on success. + */ +PJ_DECL(pj_status_t) pjmedia_codec_and_media_aud_deinit( void ); + +PJ_END_DECL + +/** + * @} + */ + +#endif /* __PJMEDIA_CODEC_AND_AUD_MEDIACODEC_H__ */ diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjmedia/include/pjmedia-codec/and_vid_mediacodec.h asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjmedia/include/pjmedia-codec/and_vid_mediacodec.h --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjmedia/include/pjmedia-codec/and_vid_mediacodec.h 1970-01-01 00:00:00.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjmedia/include/pjmedia-codec/and_vid_mediacodec.h 2022-02-24 07:54:38.000000000 +0000 @@ -0,0 +1,77 @@ +/* + * Copyright (C)2020 Teluu Inc. (http://www.teluu.com) + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#ifndef __PJMEDIA_CODEC_AND_VID_MEDIACODEC_H__ +#define __PJMEDIA_CODEC_AND_VID_MEDIACODEC_H__ + +#include +#include + +/** + * @file pjmedia-codec/and_vid_mediacodec.h + * @brief Android video Mediacodec codecs. + */ + +PJ_BEGIN_DECL + +/** + * @defgroup PJMEDIA_HAS_ANDROID_MEDIACODEC Android Mediacodec Codec + * @ingroup PJMEDIA_CODEC_VID_CODECS + * @{ + * + * + * Video MediaCodec codec wrapper for Android. + * + * This codec wrapper contains varius codecs: i.e: H.264/AVC, VP8 and VP9. + * The H.264 codec wrapper only supports non-interleaved packetization + * mode. If remote uses a different mode (e.g: single-nal), this will cause + * unpacketization issue and affect decoding process. + */ + +/** + * Initialize and register Android Mediacodec video codec factory. + * + * @param mgr The video codec manager instance where this codec will + * be registered to. Specify NULL to use default instance + * (in that case, an instance of video codec manager must + * have been created beforehand). + * @param pf Pool factory. + * + * @return PJ_SUCCESS on success. + */ +PJ_DECL(pj_status_t) pjmedia_codec_and_media_vid_init( + pjmedia_vid_codec_mgr *mgr, + pj_pool_factory *pf); + +/** + * Unregister Android Mediacodec video codecs factory from the video codec + * manager and deinitialize the codec library. + * + * @return PJ_SUCCESS on success. + */ +PJ_DECL(pj_status_t) pjmedia_codec_and_media_vid_deinit(void); + + +/** + * @} + */ + + +PJ_END_DECL + +#endif /* __PJMEDIA_CODEC_AND_VID_MEDIACODEC_H__ */ diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjmedia/include/pjmedia-codec/config_auto.h.in asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjmedia/include/pjmedia-codec/config_auto.h.in --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjmedia/include/pjmedia-codec/config_auto.h.in 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjmedia/include/pjmedia-codec/config_auto.h.in 2022-02-24 07:54:38.000000000 +0000 @@ -94,6 +94,11 @@ #undef PJMEDIA_HAS_BCG729 #endif +/* Android MediCodec codecs */ +#ifndef PJMEDIA_HAS_ANDROID_MEDIACODEC +#undef PJMEDIA_HAS_ANDROID_MEDIACODEC +#endif + #endif /* __PJMEDIA_CODEC_CONFIG_AUTO_H_ */ diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjmedia/include/pjmedia-codec/config.h asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjmedia/include/pjmedia-codec/config.h --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjmedia/include/pjmedia-codec/config.h 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjmedia/include/pjmedia-codec/config.h 2022-02-24 07:54:38.000000000 +0000 @@ -144,6 +144,19 @@ # define PJMEDIA_HAS_G722_CODEC 1 #endif +/** + * Initial memory block for G.722 codec implementation. + */ +#ifndef PJMEDIA_POOL_LEN_G722_CODEC +# define PJMEDIA_POOL_LEN_G722_CODEC 1000 +#endif + +/** + * Memory increment for G.722 codec implementation. + */ +#ifndef PJMEDIA_POOL_INC_G722_CODEC +# define PJMEDIA_POOL_INC_G722_CODEC 1000 +#endif /** * Default G.722 codec encoder and decoder level adjustment. The G.722 @@ -571,6 +584,26 @@ #endif /** + * Enable FFMPEG VPX codec (requires libvpx) + */ +#ifndef PJMEDIA_HAS_FFMPEG_CODEC_VP8 +# if defined(PJMEDIA_HAS_VPX_CODEC) && PJMEDIA_HAS_VPX_CODEC != 0 +# define PJMEDIA_HAS_FFMPEG_CODEC_VP8 0 +# else +# define PJMEDIA_HAS_FFMPEG_CODEC_VP8 1 +# endif +#endif + +#ifndef PJMEDIA_HAS_FFMPEG_CODEC_VP9 +# if defined(PJMEDIA_HAS_VPX_CODEC) && PJMEDIA_HAS_VPX_CODEC != 0 +# define PJMEDIA_HAS_FFMPEG_CODEC_VP9 0 +# else +# define PJMEDIA_HAS_FFMPEG_CODEC_VP9 1 +# endif +#endif + + +/** * Determine the log level of the native openH264 log which will be forwarded * to the library's log. * Set to WELS_LOG_QUIET to disable logging, or WELS_LOG_DETAIL for debugging. @@ -600,6 +633,86 @@ #endif /** + * Enable Android MediaCodec AMRNB codec. + * + * Default: 1 + */ +#ifndef PJMEDIA_HAS_AND_MEDIA_AMRNB +# define PJMEDIA_HAS_AND_MEDIA_AMRNB 1 +#endif + +/** + * Enable Android MediaCodec AMRWB codec. + * + * Default: 1 + */ +#ifndef PJMEDIA_HAS_AND_MEDIA_AMRWB +# define PJMEDIA_HAS_AND_MEDIA_AMRWB 1 +#endif + +/** + * Enable Android MediaCodec AVC/H264 codec. + * + * Default: 1 + */ +#ifndef PJMEDIA_HAS_AND_MEDIA_H264 +# define PJMEDIA_HAS_AND_MEDIA_H264 1 +#endif + +/** + * Enable Android MediaCodec VP8 codec. + * + * Default: 1 + */ +#ifndef PJMEDIA_HAS_AND_MEDIA_VP8 +# define PJMEDIA_HAS_AND_MEDIA_VP8 1 +#endif + +/** + * Enable Android MediaCodec VP9 codec. + * + * Default: 1 + */ +#ifndef PJMEDIA_HAS_AND_MEDIA_VP9 +# define PJMEDIA_HAS_AND_MEDIA_VP9 1 +#endif + +/** + * Prioritize to use software video encoder on Android MediaCodec. + * Set to 0 to prioritize Hardware encoder. + * Note: based on test, software encoder configuration provided the most stable + * configuration. + * + * Default: 1 + */ +#ifndef PJMEDIA_AND_MEDIA_PRIO_SW_VID_ENC +# define PJMEDIA_AND_MEDIA_PRIO_SW_VID_ENC 1 +#endif + +/** + * Prioritize to use software video encoder on Android MediaCodec. + * Set to 0 to prioritize Hardware encoder. + * Note: based on test, software decoder configuration provided the most stable + * configuration. + * + * Default: 1 + */ +#ifndef PJMEDIA_AND_MEDIA_PRIO_SW_VID_DEC +# define PJMEDIA_AND_MEDIA_PRIO_SW_VID_DEC 1 +#endif + + +/** + * Maximum interval between keyframes for Apple VideoToolbox codecs, + * in second. + * + * Default: 5 (seconds) + */ +#ifndef PJMEDIA_CODEC_VID_TOOLBOX_MAX_KEYFRAME_INTERVAL +# define PJMEDIA_CODEC_VID_TOOLBOX_MAX_KEYFRAME_INTERVAL 5 +#endif + +/** * @} */ diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjmedia/include/pjmedia-codec/types.h asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjmedia/include/pjmedia-codec/types.h --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjmedia/include/pjmedia-codec/types.h 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjmedia/include/pjmedia-codec/types.h 2022-02-24 07:54:38.000000000 +0000 @@ -118,15 +118,19 @@ { /* Video payload types */ PJMEDIA_RTP_PT_VID_START = (PJMEDIA_RTP_PT_DYNAMIC-1), - PJMEDIA_RTP_PT_H263P, - PJMEDIA_RTP_PT_H264, - PJMEDIA_RTP_PT_H264_RSV1, - PJMEDIA_RTP_PT_H264_RSV2, - PJMEDIA_RTP_PT_H264_RSV3, + PJMEDIA_RTP_PT_H263P, /* used by ffmpeg avcodec */ + PJMEDIA_RTP_PT_H264, /* used by OpenH264 */ + PJMEDIA_RTP_PT_H264_RSV1, /* used by video toolbox */ + PJMEDIA_RTP_PT_H264_RSV2, /* used by MediaCodec */ + PJMEDIA_RTP_PT_H264_RSV3, /* used by ffmpeg avcodec */ PJMEDIA_RTP_PT_H264_RSV4, - PJMEDIA_RTP_PT_VP8, - PJMEDIA_RTP_PT_VP9, + PJMEDIA_RTP_PT_VP8, /* used by VPX */ + PJMEDIA_RTP_PT_VP8_RSV1, /* used by MediaCodec */ + PJMEDIA_RTP_PT_VP8_RSV2, + PJMEDIA_RTP_PT_VP9, /* used by VPX */ + PJMEDIA_RTP_PT_VP9_RSV1, /* used by MediaCodec */ + PJMEDIA_RTP_PT_VP9_RSV2, /* Caution! * Ensure the value of the last pt above is <= 127. diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjmedia/include/pjmedia-codec/vpx_packetizer.h asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjmedia/include/pjmedia-codec/vpx_packetizer.h --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjmedia/include/pjmedia-codec/vpx_packetizer.h 1970-01-01 00:00:00.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjmedia/include/pjmedia-codec/vpx_packetizer.h 2022-02-24 07:54:38.000000000 +0000 @@ -0,0 +1,123 @@ +/* + * Copyright (C) 2020 Teluu Inc. (http://www.teluu.com) + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ +#ifndef __PJMEDIA_VPX_PACKETIZER_H__ +#define __PJMEDIA_VPX_PACKETIZER_H__ + +/** + * @file vpx_packetizer.h + * @brief Packetizes VPX bitstream into RTP payload and vice versa. + */ + +#include + +PJ_BEGIN_DECL + +/** + * Opaque declaration for VPX packetizer. + */ +typedef struct pjmedia_vpx_packetizer pjmedia_vpx_packetizer; + + +/** + * VPX packetizer setting. + */ +typedef struct pjmedia_vpx_packetizer_cfg +{ + /** + * VPX format id. + * Default: PJMEDIA_FORMAT_VP8 + */ + pj_uint32_t fmt_id; + + /** + * MTU size. + * Default: PJMEDIA_MAX_VID_PAYLOAD_SIZE + */ + unsigned mtu; +} +pjmedia_vpx_packetizer_cfg; + +/** + * Use this function to initialize VPX packetizer config. + * + * @param cfg The VPX packetizer config to be initialized. + */ +PJ_DECL(void) pjmedia_vpx_packetizer_cfg_default( + pjmedia_vpx_packetizer_cfg *cfg); + + +/** + * Create VPX packetizer. + * + * @param pool The memory pool. + * @param cfg Packetizer settings, if NULL, default setting + * will be used. + * @param p_pktz Pointer to receive the packetizer. + * + * @return PJ_SUCCESS on success. + */ +PJ_DECL(pj_status_t) pjmedia_vpx_packetizer_create( + pj_pool_t *pool, + const pjmedia_vpx_packetizer_cfg *cfg, + pjmedia_vpx_packetizer **p_pktz); + + +/** + * Generate an RTP payload from a VPX picture bitstream. Note that this + * function will apply in-place processing, so the bitstream may be modified + * during the packetization. + * + * @param pktz The packetizer. + * @param bits_len The length of the bitstream. + * @param bits_pos The bitstream offset to be packetized. + * @param is_keyframe The frame is keyframe. + * @param payload The output payload. + * @param payload_len The output payload length, on input it represents max + * payload length. + * + * @return PJ_SUCCESS on success. + */ +PJ_DECL(pj_status_t) pjmedia_vpx_packetize(const pjmedia_vpx_packetizer *pktz, + pj_size_t bits_len, + unsigned *bits_pos, + pj_bool_t is_keyframe, + pj_uint8_t **payload, + pj_size_t *payload_len); + + +/** + * Append an RTP payload to an VPX picture bitstream. Note that in case of + * noticing packet lost, application should keep calling this function with + * payload pointer set to NULL, as the packetizer need to update its internal + * state. + * + * @param pktz The packetizer. + * @param payload The payload to be unpacketized. + * @param payload_len The payload length. + * @param payload_desc_len The payload description length. + * + * @return PJ_SUCCESS on success. + */ +PJ_DECL(pj_status_t) pjmedia_vpx_unpacketize(pjmedia_vpx_packetizer *pktz, + const pj_uint8_t *payload, + pj_size_t payload_len, + unsigned *payload_desc_len); + +PJ_END_DECL + +#endif /* __PJMEDIA_VPX_PACKETIZER_H__ */ diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjmedia/include/pjmedia-codec.h asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjmedia/include/pjmedia-codec.h --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjmedia/include/pjmedia-codec.h 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjmedia/include/pjmedia-codec.h 2022-02-24 07:54:38.000000000 +0000 @@ -24,7 +24,8 @@ * @file pjmedia-codec.h * @brief Include all codecs API in PJMEDIA-CODEC */ - +#include +#include #include #include #include diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjmedia/include/pjmedia-videodev/avi_dev.h asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjmedia/include/pjmedia-videodev/avi_dev.h --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjmedia/include/pjmedia-videodev/avi_dev.h 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjmedia/include/pjmedia-videodev/avi_dev.h 2022-02-24 07:54:38.000000000 +0000 @@ -113,7 +113,7 @@ * Retrieve the parameters set for the virtual device. * * @param id Device ID. - * @param prm Structure to receive the settings. + * @param param Structure to receive the settings. * * @return PJ_SUCCESS or the appropriate error code. */ diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjmedia/src/pjmedia/avi_player.c asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjmedia/src/pjmedia/avi_player.c --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjmedia/src/pjmedia/avi_player.c 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjmedia/src/pjmedia/avi_player.c 2022-02-24 07:54:38.000000000 +0000 @@ -21,6 +21,7 @@ * Default file player/writer buffer size. */ #include +#include #include #include #include @@ -397,19 +398,26 @@ } } else { /* Check supported audio formats here */ - if ((avi_hdr.strl_hdr[i].codec != PJMEDIA_FORMAT_PCM && - avi_hdr.strl_hdr[i].codec != PJMEDIA_FORMAT_ALAW && - avi_hdr.strl_hdr[i].codec != PJMEDIA_FORMAT_ULAW && - avi_hdr.strl_hdr[i].codec != PJMEDIA_WAVE_FMT_TAG_PCM) || - avi_hdr.strf_hdr[i].strf_audio_hdr.bits_per_sample != 16) + strf_audio_hdr_t *hdr = (strf_audio_hdr_t*) + &avi_hdr.strf_hdr[i].strf_audio_hdr; + if (hdr->fmt_tag == PJMEDIA_WAVE_FMT_TAG_PCM && + hdr->bits_per_sample == 16) + { + fmt_id = PJMEDIA_FORMAT_PCM; + } + else if (hdr->fmt_tag == PJMEDIA_WAVE_FMT_TAG_ALAW) + { + fmt_id = PJMEDIA_FORMAT_PCMA; + } + else if (hdr->fmt_tag == PJMEDIA_WAVE_FMT_TAG_ULAW) + { + fmt_id = PJMEDIA_FORMAT_PCMU; + } + else { PJ_LOG(4, (THIS_FILE, "Unsupported audio stream")); continue; } - /* Normalize format ID */ - fmt_id = avi_hdr.strl_hdr[i].codec; - if (avi_hdr.strl_hdr[i].codec == PJMEDIA_WAVE_FMT_TAG_PCM) - fmt_id = PJMEDIA_FORMAT_PCM; } if (nstr > 0) { @@ -500,7 +508,15 @@ 20000 /* fport[i]->usec_per_frame */, strf_hdr->bytes_per_sec * 8, strf_hdr->bytes_per_sec * 8); - } + + /* Set format to PCM (we will decode PCMA/U) */ + if (fport[i]->fmt_id == PJMEDIA_FORMAT_PCMA || + fport[i]->fmt_id == PJMEDIA_FORMAT_PCMU) + { + fport[i]->base.info.fmt.id = PJMEDIA_FORMAT_PCM; + fport[i]->base.info.fmt.det.aud.bits_per_sample = 16; + } + } pj_strdup2(pool, &fport[i]->base.info.name, filename); } @@ -731,6 +747,14 @@ pj_file_setpos(fport->fd, fport->start_data, PJ_SEEK_SET); } + /* For PCMU/A audio stream, reduce frame size to half (temporarily). */ + if (fport->base.info.fmt.type == PJMEDIA_TYPE_AUDIO && + (fport->fmt_id == PJMEDIA_FORMAT_PCMA || + fport->fmt_id == PJMEDIA_FORMAT_PCMU)) + { + frame->size >>= 1; + } + /* Fill frame buffer. */ size_to_read = frame->size; do { @@ -822,9 +846,34 @@ break; } while(1); - frame->timestamp.u64 = fport->next_ts.u64; if (frame->type == PJMEDIA_FRAME_TYPE_AUDIO) { + + /* Decode PCMU/A frame */ + if (fport->fmt_id == PJMEDIA_FORMAT_PCMA || + fport->fmt_id == PJMEDIA_FORMAT_PCMU) + { + unsigned i; + pj_uint16_t *dst; + pj_uint8_t *src; + + dst = (pj_uint16_t*)frame->buf + frame->size - 1; + src = (pj_uint8_t*)frame->buf + frame->size - 1; + + if (fport->fmt_id == PJMEDIA_FORMAT_PCMU) { + for (i = 0; i < frame->size; ++i) { + *dst-- = (pj_uint16_t) pjmedia_ulaw2linear(*src--); + } + } else { + for (i = 0; i < frame->size; ++i) { + *dst-- = (pj_uint16_t) pjmedia_alaw2linear(*src--); + } + } + + /* Return back the frame size */ + frame->size <<= 1; + } + if (fport->usec_per_frame) { fport->next_ts.u64 += (fport->usec_per_frame * fport->base.info.fmt.det.aud.clock_rate / @@ -848,10 +897,17 @@ on_error2: if (status == AVI_EOF) { + fport->eof = PJ_TRUE; + size_to_read -= size_read; + if (size_to_read == (pj_ssize_t)frame->size) { + /* Frame is empty */ + frame->type = PJMEDIA_FRAME_TYPE_NONE; + frame->size = 0; + return PJ_EEOF; + } pj_bzero((char *)frame->buf + frame->size - size_to_read, size_to_read); - fport->eof = PJ_TRUE; return PJ_SUCCESS; } diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjmedia/src/pjmedia/clock_thread.c asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjmedia/src/pjmedia/clock_thread.c --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjmedia/src/pjmedia/clock_thread.c 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjmedia/src/pjmedia/clock_thread.c 2022-02-24 07:54:38.000000000 +0000 @@ -179,7 +179,7 @@ clock->max_jump = MAX_JUMP_MSEC * clock->freq.u64 / 1000; clock->timestamp_inc = (unsigned)(param->usec_interval * param->clock_rate / - USEC_IN_SEC); + (unsigned)USEC_IN_SEC); clock->options = options; clock->cb = cb; clock->user_data = user_data; @@ -266,7 +266,7 @@ USEC_IN_SEC; clock->timestamp_inc = (unsigned)(param->usec_interval * param->clock_rate / - USEC_IN_SEC); + (unsigned)USEC_IN_SEC); return PJ_SUCCESS; } @@ -378,8 +378,10 @@ (*clock->cb)(&clock->timestamp, clock->user_data); /* Best effort way to detect if we've been destroyed in the callback */ - if (clock->quitting) + if (clock->quitting) { + pj_lock_release(clock->lock); break; + } /* Increment timestamp */ clock->timestamp.u64 += clock->timestamp_inc; diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjmedia/src/pjmedia/conference.c asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjmedia/src/pjmedia/conference.c --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjmedia/src/pjmedia/conference.c 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjmedia/src/pjmedia/conference.c 2022-02-24 07:54:38.000000000 +0000 @@ -1078,6 +1078,8 @@ dst_port->transmitter_cnt < conf->max_ports); pj_array_erase(src_port->listener_slots, sizeof(SLOT_TYPE), src_port->listener_cnt, i); + pj_array_erase(src_port->listener_adj_level, sizeof(unsigned), + src_port->listener_cnt, i); --conf->connect_cnt; --src_port->listener_cnt; --dst_port->transmitter_cnt; @@ -1105,6 +1107,102 @@ return PJ_SUCCESS; } + +/* + * Disconnect port from all sources + */ +PJ_DEF(pj_status_t) +pjmedia_conf_disconnect_port_from_sources( pjmedia_conf *conf, + unsigned sink_slot) +{ + unsigned i; + + /* Check arguments */ + PJ_ASSERT_RETURN(conf && sink_slotmax_ports, PJ_EINVAL); + + pj_mutex_lock(conf->mutex); + + /* Remove this port from transmit array of other ports. */ + for (i=0; imax_ports; ++i) { + unsigned j; + struct conf_port *src_port; + + src_port = conf->ports[i]; + + if (!src_port) + continue; + + if (src_port->listener_cnt == 0) + continue; + + for (j=0; jlistener_cnt; ++j) { + if (src_port->listener_slots[j] == sink_slot) { + pj_array_erase(src_port->listener_slots, sizeof(SLOT_TYPE), + src_port->listener_cnt, j); + pj_array_erase(src_port->listener_adj_level, sizeof(unsigned), + src_port->listener_cnt, j); + pj_assert(conf->connect_cnt > 0); + --conf->connect_cnt; + --src_port->listener_cnt; + break; + } + } + } + + if (conf->connect_cnt == 0) { + pause_sound(conf); + } + + pj_mutex_unlock(conf->mutex); + + return PJ_SUCCESS; +} + + +/* + * Disconnect port from all sinks + */ +PJ_DEF(pj_status_t) +pjmedia_conf_disconnect_port_from_sinks( pjmedia_conf *conf, + unsigned src_slot) +{ + struct conf_port *src_port; + + /* Check arguments */ + PJ_ASSERT_RETURN(conf && src_slotmax_ports, PJ_EINVAL); + + pj_mutex_lock(conf->mutex); + + /* Port must be valid. */ + src_port = conf->ports[src_slot]; + if (!src_port) { + pj_mutex_unlock(conf->mutex); + return PJ_EINVAL; + } + + /* Update transmitter_cnt of ports we're transmitting to */ + while (src_port->listener_cnt) { + unsigned dst_slot; + struct conf_port *dst_port; + + dst_slot = src_port->listener_slots[src_port->listener_cnt-1]; + dst_port = conf->ports[dst_slot]; + --dst_port->transmitter_cnt; + --src_port->listener_cnt; + pj_assert(conf->connect_cnt > 0); + --conf->connect_cnt; + } + + if (conf->connect_cnt == 0) { + pause_sound(conf); + } + + pj_mutex_unlock(conf->mutex); + + return PJ_SUCCESS; +} + + /* * Get number of ports currently registered to the conference bridge. */ @@ -1129,7 +1227,6 @@ unsigned port ) { struct conf_port *conf_port; - unsigned i; /* Check arguments */ PJ_ASSERT_RETURN(conf && port < conf->max_ports, PJ_EINVAL); @@ -1151,43 +1248,11 @@ conf_port->tx_setting = PJMEDIA_PORT_DISABLE; conf_port->rx_setting = PJMEDIA_PORT_DISABLE; - /* Remove this port from transmit array of other ports. */ - for (i=0; imax_ports; ++i) { - unsigned j; - struct conf_port *src_port; - - src_port = conf->ports[i]; - - if (!src_port) - continue; - - if (src_port->listener_cnt == 0) - continue; - - for (j=0; jlistener_cnt; ++j) { - if (src_port->listener_slots[j] == port) { - pj_array_erase(src_port->listener_slots, sizeof(SLOT_TYPE), - src_port->listener_cnt, j); - pj_assert(conf->connect_cnt > 0); - --conf->connect_cnt; - --src_port->listener_cnt; - break; - } - } - } - - /* Update transmitter_cnt of ports we're transmitting to */ - while (conf_port->listener_cnt) { - unsigned dst_slot; - struct conf_port *dst_port; + /* disconnect port from all sources which are transmitting to it */ + pjmedia_conf_disconnect_port_from_sources(conf, port); - dst_slot = conf_port->listener_slots[conf_port->listener_cnt-1]; - dst_port = conf->ports[dst_slot]; - --dst_port->transmitter_cnt; - --conf_port->listener_cnt; - pj_assert(conf->connect_cnt > 0); - --conf->connect_cnt; - } + /* disconnect port from all sinks to which it is transmitting to */ + pjmedia_conf_disconnect_port_from_sinks(conf, port); /* Destroy resample if this conf port has it. */ if (conf_port->rx_resample) { @@ -1216,12 +1281,6 @@ pj_mutex_unlock(conf->mutex); - - /* Stop sound if there's no connection. */ - if (conf->connect_cnt == 0) { - pause_sound(conf); - } - return PJ_SUCCESS; } @@ -1278,6 +1337,12 @@ info->slot = slot; info->name = conf_port->name; + if (conf_port->port) { + pjmedia_format_copy(&info->format, &conf_port->port->info.fmt); + } else { + pj_bzero(&info->format, sizeof(info->format)); + info->format.id = (pj_uint32_t)PJMEDIA_FORMAT_INVALID; + } info->tx_setting = conf_port->tx_setting; info->rx_setting = conf_port->rx_setting; info->listener_cnt = conf_port->listener_cnt; @@ -1653,11 +1718,17 @@ *frm_type = PJMEDIA_FRAME_TYPE_AUDIO; + /* Skip port if it is disabled */ + if (cport->tx_setting != PJMEDIA_PORT_ENABLE) { + cport->tx_level = 0; + *frm_type = PJMEDIA_FRAME_TYPE_NONE; + return PJ_SUCCESS; + } /* If port is muted or nobody is transmitting to this port, * transmit NULL frame. */ - if (cport->tx_setting == PJMEDIA_PORT_MUTE || cport->transmitter_cnt==0) { - + else if ((cport->tx_setting == PJMEDIA_PORT_MUTE) || + (cport->transmitter_cnt == 0)) { pjmedia_frame frame; /* Clear left-over samples in tx_buffer, if any, so that it won't @@ -1693,11 +1764,6 @@ cport->tx_level = 0; *frm_type = PJMEDIA_FRAME_TYPE_NONE; return PJ_SUCCESS; - - } else if (cport->tx_setting != PJMEDIA_PORT_ENABLE) { - cport->tx_level = 0; - *frm_type = PJMEDIA_FRAME_TYPE_NONE; - return PJ_SUCCESS; } /* Reset heart-beat sample count */ diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjmedia/src/pjmedia/converter_libyuv.c asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjmedia/src/pjmedia/converter_libyuv.c --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjmedia/src/pjmedia/converter_libyuv.c 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjmedia/src/pjmedia/converter_libyuv.c 2022-02-24 07:54:38.000000000 +0000 @@ -689,7 +689,7 @@ pjmedia_video_apply_fmt_param *ap = &src_fmt_info->apply_param; unsigned j; for (j = 0; j < src_fmt_info->vid_fmt_info->plane_cnt; ++j) { - int y = src_pos->y * ap->plane_bytes[j] / ap->strides[j] / + int y = src_pos->y * (int)ap->plane_bytes[j] / ap->strides[j] / ap->size.h; ap->planes[j] += y * ap->strides[j] + src_pos->x * ap->strides[j] / ap->size.w; @@ -701,7 +701,7 @@ unsigned j; for (j = 0; j < dst_fmt_info->vid_fmt_info->plane_cnt; ++j) { - int y = dst_pos->y * ap->plane_bytes[j] / ap->strides[j] / + int y = dst_pos->y * (int)ap->plane_bytes[j] / ap->strides[j] / ap->size.h; ap->planes[j] += y * ap->strides[j] + dst_pos->x * ap->strides[j] / ap->size.w; diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjmedia/src/pjmedia/echo_common.c asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjmedia/src/pjmedia/echo_common.c --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjmedia/src/pjmedia/echo_common.c 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjmedia/src/pjmedia/echo_common.c 2022-02-24 07:54:38.000000000 +0000 @@ -146,10 +146,29 @@ }; #endif +/* + * WebRTC AEC3 prototypes + */ +#if defined(PJMEDIA_HAS_WEBRTC_AEC3) && PJMEDIA_HAS_WEBRTC_AEC3!=0 +static struct ec_operations webrtc_aec3_op = +{ + "WebRTC AEC3", + &webrtc_aec3_create, + &webrtc_aec3_destroy, + &webrtc_aec3_reset, + &webrtc_aec3_cancel_echo, + NULL, + NULL, + &webrtc_aec3_get_stat +}; +#endif + PJ_DEF(void) pjmedia_echo_stat_default(pjmedia_echo_stat *stat) { pj_bzero(stat, sizeof(pjmedia_echo_stat)); - stat->median = PJMEDIA_ECHO_STAT_NOT_SPECIFIED; + stat->delay = PJMEDIA_ECHO_STAT_NOT_SPECIFIED; + stat->return_loss = (double)PJMEDIA_ECHO_STAT_NOT_SPECIFIED; + stat->return_loss_enh = (double)PJMEDIA_ECHO_STAT_NOT_SPECIFIED; stat->std = PJMEDIA_ECHO_STAT_NOT_SPECIFIED; stat->frac_delay = (float)PJMEDIA_ECHO_STAT_NOT_SPECIFIED; stat->duration = PJMEDIA_ECHO_STAT_NOT_SPECIFIED; @@ -226,6 +245,13 @@ ec->op = &webrtc_aec_op; #endif +#if defined(PJMEDIA_HAS_WEBRTC_AEC3) && PJMEDIA_HAS_WEBRTC_AEC3!=0 + } else if ((options & PJMEDIA_ECHO_ALGO_MASK)==PJMEDIA_ECHO_WEBRTC_AEC3 || + (options & PJMEDIA_ECHO_ALGO_MASK) == PJMEDIA_ECHO_DEFAULT) + { + ec->op = &webrtc_aec3_op; +#endif + } else { ec->op = &echo_supp_op; } diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjmedia/src/pjmedia/echo_internal.h asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjmedia/src/pjmedia/echo_internal.h --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjmedia/src/pjmedia/echo_internal.h 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjmedia/src/pjmedia/echo_internal.h 2022-02-24 07:54:38.000000000 +0000 @@ -97,6 +97,22 @@ unsigned options, void *reserved ); +PJ_DECL(pj_status_t) webrtc_aec3_create(pj_pool_t *pool, + unsigned clock_rate, + unsigned channel_count, + unsigned samples_per_frame, + unsigned tail_ms, + unsigned options, + void **p_echo ); +PJ_DECL(pj_status_t) webrtc_aec3_destroy(void *state ); +PJ_DECL(pj_status_t) webrtc_aec3_get_stat(void *state, + pjmedia_echo_stat *p_stat); +PJ_DECL(void) webrtc_aec3_reset(void *state ); +PJ_DECL(pj_status_t) webrtc_aec3_cancel_echo(void *state, + pj_int16_t *rec_frm, + const pj_int16_t *play_frm, + unsigned options, + void *reserved ); PJ_END_DECL diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjmedia/src/pjmedia/echo_webrtc_aec3.cpp asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjmedia/src/pjmedia/echo_webrtc_aec3.cpp --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjmedia/src/pjmedia/echo_webrtc_aec3.cpp 1970-01-01 00:00:00.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjmedia/src/pjmedia/echo_webrtc_aec3.cpp 2022-02-24 07:54:38.000000000 +0000 @@ -0,0 +1,272 @@ +/* + * Copyright (C) 2011-2021 Teluu Inc. (http://www.teluu.com) + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#include +#include +#include +#include +#include +#include + +#if defined(PJMEDIA_HAS_WEBRTC_AEC3) && PJMEDIA_HAS_WEBRTC_AEC3 != 0 + +#ifdef _MSC_VER +# pragma warning(disable: 4100) // Unreferenced parameter +# pragma warning(disable: 4244) // Possible loss of data +#endif + +#include "modules/audio_processing/aec3/echo_canceller3.h" +#include "modules/audio_processing/ns/noise_suppressor.h" +#include "modules/audio_processing/gain_controller2.h" +#include "modules/audio_processing/audio_buffer.h" + +using namespace webrtc; + +#include "echo_internal.h" + +#define THIS_FILE "echo_webrtc_aec3.cpp" + +typedef struct webrtc_ec +{ + unsigned options; + unsigned samples_per_frame; + unsigned clock_rate; + unsigned channel_count; + unsigned frame_length; + unsigned num_bands; + + pj_bool_t get_metrics; + EchoControl::Metrics metrics; + + EchoControl *aec; + NoiseSuppressor *ns; + GainController2 *agc; + AudioBuffer *cap_buf; + AudioBuffer *rend_buf; +} webrtc_ec; + + +/* + * Create the AEC. + */ +PJ_DEF(pj_status_t) webrtc_aec3_create(pj_pool_t *pool, + unsigned clock_rate, + unsigned channel_count, + unsigned samples_per_frame, + unsigned tail_ms, + unsigned options, + void **p_echo ) +{ + webrtc_ec *echo; + + *p_echo = NULL; + + echo = PJ_POOL_ZALLOC_T(pool, webrtc_ec); + PJ_ASSERT_RETURN(echo != NULL, PJ_ENOMEM); + + if (clock_rate != 16000 && clock_rate != 32000 && clock_rate != 48000) { + PJ_LOG(3, (THIS_FILE, "Unsupported clock rate for WebRTC AEC3")); + return PJ_ENOTSUP; + } + + echo->options = options; + echo->channel_count = channel_count; + echo->samples_per_frame = samples_per_frame; + echo->clock_rate = clock_rate; + echo->frame_length = clock_rate/100; + echo->num_bands = clock_rate/16000; + + echo->aec = new EchoCanceller3(EchoCanceller3Config(), clock_rate, + channel_count, channel_count); + + echo->cap_buf = new AudioBuffer(clock_rate, channel_count, clock_rate, + channel_count, clock_rate, channel_count); + echo->rend_buf = new AudioBuffer(clock_rate, channel_count, clock_rate, + channel_count, clock_rate, channel_count); + + if (options & PJMEDIA_ECHO_USE_NOISE_SUPPRESSOR) { + NsConfig cfg; + /* Valid values are 6, 12, 18, 21 dB */ + cfg.target_level = NsConfig::SuppressionLevel::k12dB; + echo->ns = new NoiseSuppressor(cfg, clock_rate, channel_count); + } + + if (options & PJMEDIA_ECHO_USE_GAIN_CONTROLLER) { + echo->agc = new GainController2(); + echo->agc->Initialize(clock_rate); + + AudioProcessing::Config::GainController2 cfg; + cfg.adaptive_digital.enabled = true; + if (GainController2::Validate(cfg)) + echo->agc->ApplyConfig(cfg); + } + + /* Done */ + *p_echo = echo; + return PJ_SUCCESS; +} + + +/* + * Destroy AEC + */ +PJ_DEF(pj_status_t) webrtc_aec3_destroy(void *state ) +{ + webrtc_ec *echo = (webrtc_ec*) state; + PJ_ASSERT_RETURN(echo, PJ_EINVAL); + + if (echo->aec) { + delete echo->aec; + echo->aec = NULL; + } + if (echo->ns) { + delete echo->ns; + echo->ns = NULL; + } + if (echo->agc) { + delete echo->agc; + echo->agc = NULL; + } + + if (echo->cap_buf) { + delete echo->cap_buf; + echo->cap_buf = NULL; + } + if (echo->rend_buf) { + delete echo->rend_buf; + echo->rend_buf = NULL; + } + + return PJ_SUCCESS; +} + + +/* + * Reset AEC + */ +PJ_DEF(void) webrtc_aec3_reset(void *state ) +{ + webrtc_ec *echo = (webrtc_ec*) state; + + pj_assert(echo != NULL); + + PJ_LOG(4, (THIS_FILE, "WebRTC AEC3 reset no-op")); +} + + +/* + * Perform echo cancellation. + */ +PJ_DEF(pj_status_t) webrtc_aec3_cancel_echo(void *state, + pj_int16_t *rec_frm, + const pj_int16_t *play_frm, + unsigned options, + void *reserved ) +{ + webrtc_ec *echo = (webrtc_ec*) state; + unsigned i; + + PJ_UNUSED_ARG(options); + PJ_UNUSED_ARG(reserved); + + /* Sanity checks */ + PJ_ASSERT_RETURN(echo && rec_frm && play_frm, PJ_EINVAL); + + for (i = 0; i < echo->samples_per_frame; + i += echo->frame_length) + { + StreamConfig scfg(echo->clock_rate, echo->channel_count); + + echo->cap_buf->CopyFrom(rec_frm + i, scfg); + echo->rend_buf->CopyFrom(play_frm + i, scfg); + + if (echo->clock_rate > 16000) { + echo->cap_buf->SplitIntoFrequencyBands(); + echo->rend_buf->SplitIntoFrequencyBands(); + } + + echo->aec->AnalyzeCapture(echo->cap_buf); + echo->aec->AnalyzeRender(echo->rend_buf); + + if (echo->ns) { + echo->ns->Analyze(*echo->cap_buf); + echo->ns->Process(echo->cap_buf); + } + + echo->aec->ProcessCapture(echo->cap_buf, false); + + if (echo->agc) { + echo->agc->Process(echo->cap_buf); + } + + if (echo->clock_rate > 16000) { + echo->cap_buf->MergeFrequencyBands(); + } + + echo->cap_buf->CopyTo(scfg, rec_frm + i); + } + + if (echo->get_metrics) { + echo->metrics = echo->aec->GetMetrics(); + echo->get_metrics = PJ_FALSE; + } + + return PJ_SUCCESS; +} + + +PJ_DEF(pj_status_t) webrtc_aec3_get_stat(void *state, + pjmedia_echo_stat *p_stat) +{ + webrtc_ec *echo = (webrtc_ec*) state; + unsigned i = 0; + + if (!echo || !echo->aec) + return PJ_EINVAL; + + /* We cannot perform get metrics here since it may cause a race + * condition with echo cancellation process and crash with: + * "Check failed: !race_checker.RaceDetected()". + * (The doc of EchoCanceller3 specifies that "The class is supposed + * to be used in a non-concurrent manner"). + * + * So we just do a simple dispatch. Using mutex seems like + * an overkill here. + */ + // echo->metrics = echo->aec->GetMetrics(); + echo->get_metrics = PJ_TRUE; + while (echo->get_metrics && i < 100000) i++; + + p_stat->delay = echo->metrics.delay_ms; + p_stat->return_loss = echo->metrics.echo_return_loss; + p_stat->return_loss_enh = echo->metrics.echo_return_loss_enhancement; + + p_stat->name = "WebRTC AEC3"; + p_stat->stat_info.ptr = p_stat->buf_; + p_stat->stat_info.slen = + pj_ansi_snprintf(p_stat->buf_, sizeof(p_stat->buf_), + "WebRTC AEC3 metrics: delay=%d ms, " + "return loss=%.02f, return loss enh=%.02f", + p_stat->delay, p_stat->return_loss, + p_stat->return_loss_enh); + + return PJ_SUCCESS; +} + + +#endif diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjmedia/src/pjmedia/echo_webrtc.c asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjmedia/src/pjmedia/echo_webrtc.c --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjmedia/src/pjmedia/echo_webrtc.c 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjmedia/src/pjmedia/echo_webrtc.c 2022-02-24 07:54:38.000000000 +0000 @@ -1,4 +1,3 @@ -/* $Id$ */ /* * Copyright (C) 2011-2015 Teluu Inc. (http://www.teluu.com) * @@ -357,7 +356,7 @@ { webrtc_ec *echo = (webrtc_ec*) state; - if (WebRtcAec_GetDelayMetrics(echo->AEC_inst, &p_stat->median, + if (WebRtcAec_GetDelayMetrics(echo->AEC_inst, &p_stat->delay, &p_stat->std, &p_stat->frac_delay) != 0) { return PJ_EUNKNOWN; @@ -369,7 +368,7 @@ pj_ansi_snprintf(p_stat->buf_, sizeof(p_stat->buf_), "WebRTC delay metric: median=%d, std=%d, " "frac of poor delay=%.02f", - p_stat->median, p_stat->std, p_stat->frac_delay); + p_stat->delay, p_stat->std, p_stat->frac_delay); return PJ_SUCCESS; } diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjmedia/src/pjmedia/endpoint.c asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjmedia/src/pjmedia/endpoint.c --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjmedia/src/pjmedia/endpoint.c 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjmedia/src/pjmedia/endpoint.c 2022-02-24 07:54:38.000000000 +0000 @@ -40,7 +40,9 @@ static const pj_str_t STR_RTP_AVP = { "RTP/AVP", 7 }; static const pj_str_t STR_SDP_NAME = { "pjmedia", 7 }; static const pj_str_t STR_SENDRECV = { "sendrecv", 8 }; - +static const pj_str_t STR_SENDONLY = { "sendonly", 8 }; +static const pj_str_t STR_RECVONLY = { "recvonly", 8 }; +static const pj_str_t STR_INACTIVE = { "inactive", 8 }; /* Config to control rtpmap inclusion for static payload types */ @@ -102,6 +104,13 @@ exit_cb exit_cb_list; }; + +PJ_DEF(void) +pjmedia_endpt_create_sdp_param_default(pjmedia_endpt_create_sdp_param *param) +{ + param->dir = PJMEDIA_DIR_ENCODING_DECODING; +} + /** * Initialize and get the instance of media endpoint. */ @@ -122,7 +131,8 @@ PJ_ASSERT_RETURN(pf && p_endpt, PJ_EINVAL); PJ_ASSERT_RETURN(worker_cnt <= MAX_THREADS, PJ_EINVAL); - pool = pj_pool_create(pf, "med-ept", 512, 512, NULL); + pool = pj_pool_create(pf, "med-ept", PJMEDIA_POOL_LEN_ENDPT, + PJMEDIA_POOL_INC_ENDPT, NULL); if (!pool) return PJ_ENOMEM; @@ -359,7 +369,8 @@ static pj_status_t init_sdp_media(pjmedia_sdp_media *m, pj_pool_t *pool, const pj_str_t *media_type, - const pjmedia_sock_info *sock_info) + const pjmedia_sock_info *sock_info, + pjmedia_dir dir) { char tmp_addr[PJ_INET6_ADDRSTRLEN]; pjmedia_sdp_attr *attr; @@ -395,20 +406,31 @@ } #endif - /* Add sendrecv attribute. */ - attr = PJ_POOL_ZALLOC_T(pool, pjmedia_sdp_attr); - attr->name = STR_SENDRECV; - m->attr[m->attr_count++] = attr; + /* Add direction attribute. */ + if (m->desc.port != 0) { + attr = PJ_POOL_ZALLOC_T(pool, pjmedia_sdp_attr); + if (dir == PJMEDIA_DIR_ENCODING) { + attr->name = STR_SENDONLY; + } else if (dir == PJMEDIA_DIR_DECODING) { + attr->name = STR_RECVONLY; + } else if (dir == PJMEDIA_DIR_NONE) { + attr->name = STR_INACTIVE; + } else { + attr->name = STR_SENDRECV; + } + m->attr[m->attr_count++] = attr; + } return PJ_SUCCESS; } /* Create m=audio SDP media line */ -PJ_DEF(pj_status_t) pjmedia_endpt_create_audio_sdp(pjmedia_endpt *endpt, - pj_pool_t *pool, - const pjmedia_sock_info *si, - unsigned options, - pjmedia_sdp_media **p_m) +PJ_DEF(pj_status_t) +pjmedia_endpt_create_audio_sdp(pjmedia_endpt *endpt, + pj_pool_t *pool, + const pjmedia_sock_info *si, + const pjmedia_endpt_create_sdp_param *options, + pjmedia_sdp_media **p_m) { const pj_str_t STR_AUDIO = { "audio", 5 }; pjmedia_sdp_media *m; @@ -423,8 +445,7 @@ #endif unsigned used_pt_num = 0; unsigned used_pt[PJMEDIA_MAX_SDP_FMT]; - - PJ_UNUSED_ARG(options); + pjmedia_endpt_create_sdp_param param; /* Check that there are not too many codecs */ PJ_ASSERT_RETURN(endpt->codec_mgr.codec_cnt <= PJMEDIA_MAX_SDP_FMT, @@ -435,12 +456,20 @@ PJMEDIA_RTP_PT_TELEPHONE_EVENTS != 0 if (endpt->has_telephone_event) { used_pt[used_pt_num++] = PJMEDIA_RTP_PT_TELEPHONE_EVENTS; + +# if PJMEDIA_TELEPHONE_EVENT_ALL_CLOCKRATES==0 + televent_num = 1; + televent_clockrates[0] = 8000; +# endif + } #endif /* Create and init basic SDP media */ m = PJ_POOL_ZALLOC_T(pool, pjmedia_sdp_media); - status = init_sdp_media(m, pool, &STR_AUDIO, si); + pjmedia_endpt_create_sdp_param_default(¶m); + status = init_sdp_media(m, pool, &STR_AUDIO, si, options? options->dir: + param.dir); if (status != PJ_SUCCESS) return status; @@ -533,14 +562,13 @@ if (codec_param.setting.dec_fmtp.cnt > 0) { enum { MAX_FMTP_STR_LEN = 160 }; char buf[MAX_FMTP_STR_LEN]; - unsigned buf_len = 0, ii; + unsigned buf_len = 0, n, ii; pjmedia_codec_fmtp *dec_fmtp = &codec_param.setting.dec_fmtp; /* Print codec PT */ - buf_len += pj_ansi_snprintf(buf, - MAX_FMTP_STR_LEN - buf_len, - "%d", - pt); + n = pj_ansi_snprintf(buf, MAX_FMTP_STR_LEN - buf_len, + "%d", pt); + buf_len = PJ_MIN(buf_len + n, MAX_FMTP_STR_LEN); for (ii = 0; ii < dec_fmtp->cnt; ++ii) { pj_size_t test_len = 2; @@ -552,26 +580,28 @@ return PJ_ETOOBIG; /* Print delimiter */ - buf_len += pj_ansi_snprintf(&buf[buf_len], - MAX_FMTP_STR_LEN - buf_len, - (ii == 0?" ":";")); + n = pj_ansi_snprintf(&buf[buf_len], + MAX_FMTP_STR_LEN - buf_len, + (ii == 0?" ":";")); + buf_len = PJ_MIN(buf_len + n, MAX_FMTP_STR_LEN); /* Print an fmtp param */ if (dec_fmtp->param[ii].name.slen) - buf_len += pj_ansi_snprintf( - &buf[buf_len], - MAX_FMTP_STR_LEN - buf_len, - "%.*s=%.*s", - (int)dec_fmtp->param[ii].name.slen, - dec_fmtp->param[ii].name.ptr, - (int)dec_fmtp->param[ii].val.slen, - dec_fmtp->param[ii].val.ptr); + n = pj_ansi_snprintf(&buf[buf_len], + MAX_FMTP_STR_LEN - buf_len, + "%.*s=%.*s", + (int)dec_fmtp->param[ii].name.slen, + dec_fmtp->param[ii].name.ptr, + (int)dec_fmtp->param[ii].val.slen, + dec_fmtp->param[ii].val.ptr); else - buf_len += pj_ansi_snprintf(&buf[buf_len], - MAX_FMTP_STR_LEN - buf_len, - "%.*s", - (int)dec_fmtp->param[ii].val.slen, - dec_fmtp->param[ii].val.ptr); + n = pj_ansi_snprintf(&buf[buf_len], + MAX_FMTP_STR_LEN - buf_len, + "%.*s", + (int)dec_fmtp->param[ii].val.slen, + dec_fmtp->param[ii].val.ptr); + + buf_len = PJ_MIN(buf_len + n, MAX_FMTP_STR_LEN); } attr = PJ_POOL_ZALLOC_T(pool, pjmedia_sdp_attr); @@ -587,7 +617,8 @@ /* List clock rate of audio codecs for generating telephone-event */ #if defined(PJMEDIA_RTP_PT_TELEPHONE_EVENTS) && \ - PJMEDIA_RTP_PT_TELEPHONE_EVENTS != 0 + PJMEDIA_RTP_PT_TELEPHONE_EVENTS != 0 && \ + PJMEDIA_TELEPHONE_EVENT_ALL_CLOCKRATES != 0 if (endpt->has_telephone_event) { unsigned j; @@ -706,11 +737,12 @@ #if defined(PJMEDIA_HAS_VIDEO) && (PJMEDIA_HAS_VIDEO != 0) /* Create m=video SDP media line */ -PJ_DEF(pj_status_t) pjmedia_endpt_create_video_sdp(pjmedia_endpt *endpt, - pj_pool_t *pool, - const pjmedia_sock_info *si, - unsigned options, - pjmedia_sdp_media **p_m) +PJ_DEF(pj_status_t) +pjmedia_endpt_create_video_sdp(pjmedia_endpt *endpt, + pj_pool_t *pool, + const pjmedia_sock_info *si, + const pjmedia_endpt_create_sdp_param *options, + pjmedia_sdp_media **p_m) { @@ -721,17 +753,18 @@ pjmedia_sdp_attr *attr; unsigned cnt, i; unsigned max_bitrate = 0; + pjmedia_endpt_create_sdp_param param; pj_status_t status; - PJ_UNUSED_ARG(options); - /* Make sure video codec manager is instantiated */ if (!pjmedia_vid_codec_mgr_instance()) pjmedia_vid_codec_mgr_create(endpt->pool, NULL); /* Create and init basic SDP media */ + pjmedia_endpt_create_sdp_param_default(¶m); m = PJ_POOL_ZALLOC_T(pool, pjmedia_sdp_media); - status = init_sdp_media(m, pool, &STR_VIDEO, si); + status = init_sdp_media(m, pool, &STR_VIDEO, si, options? options->dir: + param.dir); if (status != PJ_SUCCESS) return status; @@ -764,9 +797,8 @@ break; } - /* Must support RTP packetization and bidirectional */ - if ((codec_info[i].packings & PJMEDIA_VID_PACKING_PACKETS) == 0 || - codec_info[i].dir != PJMEDIA_DIR_ENCODING_DECODING) + /* Must support RTP packetization */ + if ((codec_info[i].packings & PJMEDIA_VID_PACKING_PACKETS) == 0) { continue; } @@ -794,14 +826,14 @@ if (codec_param.dec_fmtp.cnt > 0) { enum { MAX_FMTP_STR_LEN = 160 }; char buf[MAX_FMTP_STR_LEN]; - unsigned buf_len = 0, j; + unsigned buf_len = 0, n, j; pjmedia_codec_fmtp *dec_fmtp = &codec_param.dec_fmtp; /* Print codec PT */ - buf_len += pj_ansi_snprintf(buf, - MAX_FMTP_STR_LEN - buf_len, - "%d", - codec_info[i].pt); + n = pj_ansi_snprintf(buf, MAX_FMTP_STR_LEN - buf_len, + "%d", + codec_info[i].pt); + buf_len = PJ_MIN(buf_len + n, MAX_FMTP_STR_LEN); for (j = 0; j < dec_fmtp->cnt; ++j) { pj_size_t test_len = 2; @@ -813,26 +845,28 @@ return PJ_ETOOBIG; /* Print delimiter */ - buf_len += pj_ansi_snprintf(&buf[buf_len], - MAX_FMTP_STR_LEN - buf_len, - (j == 0?" ":";")); + n = pj_ansi_snprintf(&buf[buf_len], + MAX_FMTP_STR_LEN - buf_len, + (j == 0?" ":";")); + buf_len = PJ_MIN(buf_len + n, MAX_FMTP_STR_LEN); /* Print an fmtp param */ if (dec_fmtp->param[j].name.slen) - buf_len += pj_ansi_snprintf( - &buf[buf_len], - MAX_FMTP_STR_LEN - buf_len, - "%.*s=%.*s", - (int)dec_fmtp->param[j].name.slen, - dec_fmtp->param[j].name.ptr, - (int)dec_fmtp->param[j].val.slen, - dec_fmtp->param[j].val.ptr); + n = pj_ansi_snprintf(&buf[buf_len], + MAX_FMTP_STR_LEN - buf_len, + "%.*s=%.*s", + (int)dec_fmtp->param[j].name.slen, + dec_fmtp->param[j].name.ptr, + (int)dec_fmtp->param[j].val.slen, + dec_fmtp->param[j].val.ptr); else - buf_len += pj_ansi_snprintf(&buf[buf_len], - MAX_FMTP_STR_LEN - buf_len, - "%.*s", - (int)dec_fmtp->param[j].val.slen, - dec_fmtp->param[j].val.ptr); + n = pj_ansi_snprintf(&buf[buf_len], + MAX_FMTP_STR_LEN - buf_len, + "%.*s", + (int)dec_fmtp->param[j].val.slen, + dec_fmtp->param[j].val.ptr); + + buf_len = PJ_MIN(buf_len + n, MAX_FMTP_STR_LEN); } attr = PJ_POOL_ZALLOC_T(pool, pjmedia_sdp_attr); diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjmedia/src/pjmedia/event.c asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjmedia/src/pjmedia/event.c --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjmedia/src/pjmedia/event.c 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjmedia/src/pjmedia/event.c 2022-02-24 07:54:38.000000000 +0000 @@ -29,6 +29,15 @@ #define MAX_EVENTS 16 +/* Enable some tracing */ +// #define EVENT_TRACE + +#ifdef EVENT_TRACE + #define TRACE_(arg) PJ_LOG(4, arg) +#else + #define TRACE_(arg) +#endif + typedef struct esub esub; struct esub @@ -54,6 +63,7 @@ pj_bool_t is_quitting; pj_sem_t *sem; pj_mutex_t *mutex; + pj_mutex_t *cb_mutex; event_queue ev_queue; event_queue *pub_ev_queue; /**< publish() event queue. */ esub esub_list; /**< list of subscribers. */ @@ -95,6 +105,7 @@ pj_status_t err = PJ_SUCCESS; esub * sub = mgr->esub_list.next; pjmedia_event *ev = &ev_queue->events[ev_queue->head]; + unsigned i = 0; while (sub != &mgr->esub_list) { *next_sub = sub->next; @@ -107,17 +118,28 @@ void *user_data = sub->user_data; pj_status_t status; - if (rls_lock) + if (rls_lock) { + /* To make sure that event unsubscription waits + * until the callback completes. + */ + pj_mutex_lock(mgr->cb_mutex); pj_mutex_unlock(mgr->mutex); + } + + TRACE_((THIS_FILE, "Distributing event %d sub->epub %p ev->epub %p " + "user data %p", i, sub->epub, ev->epub, sub->user_data)); status = (*cb)(ev, user_data); if (status != PJ_SUCCESS && err == PJ_SUCCESS) err = status; - if (rls_lock) + if (rls_lock) { + pj_mutex_unlock(mgr->cb_mutex); pj_mutex_lock(mgr->mutex); + } } sub = *next_sub; + i++; } *next_sub = NULL; @@ -156,7 +178,9 @@ pj_status_t status; mgr = PJ_POOL_ZALLOC_T(pool, pjmedia_event_mgr); - mgr->pool = pj_pool_create(pool->factory, "evt mgr", 500, 500, NULL); + mgr->pool = pj_pool_create(pool->factory, "evt mgr", + PJMEDIA_POOL_LEN_EVTMGR, + PJMEDIA_POOL_INC_EVTMGR, NULL); pj_list_init(&mgr->esub_list); pj_list_init(&mgr->free_esub_list); @@ -181,6 +205,13 @@ return status; } + status = pj_mutex_create_recursive(mgr->pool, "ev_cb_mutex", + &mgr->cb_mutex); + if (status != PJ_SUCCESS) { + pjmedia_event_mgr_destroy(mgr); + return status; + } + if (!event_manager_instance) event_manager_instance = mgr; @@ -221,6 +252,11 @@ mgr->mutex = NULL; } + if (mgr->cb_mutex) { + pj_mutex_destroy(mgr->cb_mutex); + mgr->cb_mutex = NULL; + } + if (mgr->pool) pj_pool_release(mgr->pool); @@ -246,6 +282,7 @@ void *epub) { esub *sub; + unsigned i = 0; PJ_ASSERT_RETURN(cb, PJ_EINVAL); @@ -267,6 +304,7 @@ return PJ_SUCCESS; } sub = next; + i++; } if (mgr->free_esub_list.next != &mgr->free_esub_list) { @@ -278,6 +316,10 @@ sub->user_data = user_data; sub->epub = epub; pj_list_push_back(&mgr->esub_list, sub); + + TRACE_((THIS_FILE, "Media event: subscribing event %d epub %p " + "user data %p", i, epub, user_data)); + pj_mutex_unlock(mgr->mutex); return PJ_SUCCESS; @@ -290,19 +332,31 @@ void *epub) { esub *sub; + unsigned i = 0, j = 0; + PJ_UNUSED_ARG(j); PJ_ASSERT_RETURN(cb, PJ_EINVAL); if (!mgr) mgr = pjmedia_event_mgr_instance(); PJ_ASSERT_RETURN(mgr, PJ_EINVAL); - pj_mutex_lock(mgr->mutex); + while(1) { + pj_mutex_lock(mgr->mutex); + if (pj_mutex_trylock(mgr->cb_mutex) == PJ_SUCCESS) + break; + + /* The callback is currently being called, wait for a while. */ + pj_mutex_unlock(mgr->mutex); + pj_thread_sleep(10); + } + sub = mgr->esub_list.next; while (sub != &mgr->esub_list) { esub *next = sub->next; if (sub->cb == cb && (sub->user_data == user_data || !user_data) && (sub->epub == epub || !epub)) { + j = i; /* If the worker thread or pjmedia_event_publish() API is * in the process of distributing events, make sure that * its pointer to the next subscriber stays valid. @@ -317,7 +371,13 @@ break; } sub = next; + i++; } + + TRACE_((THIS_FILE, "Media event: unsubscribing event %d/%d epub %p " + "user data %p", j, i, epub, user_data)); + + pj_mutex_unlock(mgr->cb_mutex); pj_mutex_unlock(mgr->mutex); return PJ_SUCCESS; diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjmedia/src/pjmedia/ffmpeg_util.c asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjmedia/src/pjmedia/ffmpeg_util.c --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjmedia/src/pjmedia/ffmpeg_util.c 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjmedia/src/pjmedia/ffmpeg_util.c 2022-02-24 07:54:38.000000000 +0000 @@ -62,6 +62,8 @@ {PJMEDIA_FORMAT_H263, AV(CODEC_ID_H263)}, {PJMEDIA_FORMAT_H263P, AV(CODEC_ID_H263P)}, {PJMEDIA_FORMAT_H264, AV(CODEC_ID_H264)}, + {PJMEDIA_FORMAT_VP8, AV(CODEC_ID_VP8)}, + {PJMEDIA_FORMAT_VP9, AV(CODEC_ID_VP9)}, {PJMEDIA_FORMAT_MPEG1VIDEO, AV(CODEC_ID_MPEG1VIDEO)}, {PJMEDIA_FORMAT_MPEG2VIDEO, AV(CODEC_ID_MPEG2VIDEO)}, {PJMEDIA_FORMAT_MPEG4, AV(CODEC_ID_MPEG4)}, diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjmedia/src/pjmedia/format.c asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjmedia/src/pjmedia/format.c --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjmedia/src/pjmedia/format.c 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjmedia/src/pjmedia/format.c 2022-02-24 07:54:38.000000000 +0000 @@ -427,4 +427,64 @@ video_format_mgr_instance = NULL; } + +/***************************************************************************** + * FORMAT FUNCTION HELPER: + */ + +/* + * Fill video frame buffer with black color. + */ +PJ_DEF(pj_status_t) pjmedia_video_format_fill_black(const pjmedia_format *fmt, + void *buf, + pj_size_t buf_size) +{ + const pjmedia_video_format_info *vfi; + pjmedia_video_apply_fmt_param vafp; + pjmedia_format_id fmt_id; + pj_status_t status; + + PJ_ASSERT_RETURN(fmt && buf && buf_size, PJ_EINVAL); + + fmt_id = fmt->id; + vfi = pjmedia_get_video_format_info(NULL, fmt_id); + pj_bzero(&vafp, sizeof(vafp)); + vafp.size = fmt->det.vid.size; + status = (*vfi->apply_fmt)(vfi, &vafp); + if (status != PJ_SUCCESS) + return status; + + if (buf_size < vafp.framebytes) + return PJ_ETOOSMALL; + + if (vfi->color_model == PJMEDIA_COLOR_MODEL_RGB) { + pj_memset(buf, 0, vafp.framebytes); + } else if (fmt_id == PJMEDIA_FORMAT_I420 || + fmt_id == PJMEDIA_FORMAT_YV12 || + fmt_id == PJMEDIA_FORMAT_I422) + { + pj_memset(buf, 16, vafp.plane_bytes[0]); + pj_memset((pj_uint8_t*)buf + vafp.plane_bytes[0], 0x80, + vafp.plane_bytes[1] * 2); + } else if (fmt_id == PJMEDIA_FORMAT_NV12 || + fmt_id == PJMEDIA_FORMAT_NV21) + { + pj_memset(buf, 16, vafp.plane_bytes[0]); + pj_memset((pj_uint8_t*)buf + vafp.plane_bytes[0], 0x80, + vafp.plane_bytes[1]); + } else if (fmt_id == PJMEDIA_FORMAT_YUY2) { + pj_uint8_t *ptr = (pj_uint8_t *)buf; + pj_size_t i; + + for (i = vafp.framebytes / 2; i > 0; i--) { + *(ptr++) = 0x10; *(ptr++) = 0x80; + } + } else { + /* Don't know how to fill it black (for now) */ + return PJ_ENOTSUP; + } + + return PJ_SUCCESS; +} + #endif /* PJMEDIA_HAS_VIDEO */ diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjmedia/src/pjmedia/jbuf.c asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjmedia/src/pjmedia/jbuf.c --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjmedia/src/pjmedia/jbuf.c 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjmedia/src/pjmedia/jbuf.c 2022-02-24 07:54:38.000000000 +0000 @@ -198,7 +198,7 @@ framelist->max_count = max_count; framelist->content = (char*) pj_pool_alloc(pool, - framelist->frame_size* + (pj_size_t)framelist->frame_size* framelist->max_count); framelist->frame_type = (int*) pj_pool_alloc(pool, @@ -634,7 +634,7 @@ jb->jb_frame_ptime = ptime; jb->jb_min_shrink_gap = PJMEDIA_JBUF_DISC_MIN_GAP / ptime; - jb->jb_max_burst = PJ_MAX(MAX_BURST_MSEC / ptime, + jb->jb_max_burst = (int)PJ_MAX(MAX_BURST_MSEC / ptime, jb->jb_max_count*3/4); return PJ_SUCCESS; @@ -719,6 +719,8 @@ jb_framelist_reset(&jb->jb_framelist); + PJ_LOG(5, (jb->jb_name.ptr, "Jitter buffer reset")); + return PJ_SUCCESS; } @@ -1191,7 +1193,7 @@ state->frame_size = (unsigned)jb->jb_frame_size; state->min_prefetch = jb->jb_min_prefetch; state->max_prefetch = jb->jb_max_prefetch; - state->max_count = jb->jb_max_count; + state->max_count = (unsigned)jb->jb_max_count; state->burst = jb->jb_eff_level; state->prefetch = jb->jb_prefetch; diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjmedia/src/pjmedia/mem_player.c asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjmedia/src/pjmedia/mem_player.c --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjmedia/src/pjmedia/mem_player.c 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjmedia/src/pjmedia/mem_player.c 2022-02-24 07:54:38.000000000 +0000 @@ -182,6 +182,7 @@ struct mem_player *player; char *endpos; pj_size_t size_needed, size_written; + pj_bool_t delayed_cb = PJ_FALSE; PJ_ASSERT_RETURN(this_port->info.signature == SIGNATURE, PJ_EINVALIDOP); @@ -190,41 +191,42 @@ if (player->eof) { pj_status_t status = PJ_SUCCESS; + pj_bool_t no_loop = (player->options & PJMEDIA_MEM_NO_LOOP); /* Call callback, if any */ if (player->cb2) { - pj_bool_t no_loop = (player->options & PJMEDIA_MEM_NO_LOOP); - if (!player->subscribed) { - status = pjmedia_event_subscribe(NULL, &player_on_event, + pj_status_t status2; + status2 = pjmedia_event_subscribe(NULL, &player_on_event, player, player); - player->subscribed = (status == PJ_SUCCESS)? PJ_TRUE: - PJ_FALSE; + player->subscribed = (status2 == PJ_SUCCESS)? PJ_TRUE: + PJ_FALSE; } if (player->subscribed && player->eof != 2) { - pjmedia_event event; - if (no_loop) { + pjmedia_event event; + /* To prevent the callback from being called repeatedly */ player->eof = 2; - } else { - player->eof = PJ_FALSE; - } - - pjmedia_event_init(&event, PJMEDIA_EVENT_CALLBACK, - NULL, player); - pjmedia_event_publish(NULL, player, &event, - PJMEDIA_EVENT_PUBLISH_POST_EVENT); + + pjmedia_event_init(&event, PJMEDIA_EVENT_CALLBACK, + NULL, player); + pjmedia_event_publish(NULL, player, &event, + PJMEDIA_EVENT_PUBLISH_POST_EVENT); + /* Should not access player port after this since + * it might have been destroyed by the callback. + */ + } else { + delayed_cb = PJ_TRUE; + } } - /* Should not access player port after this since - * it might have been destroyed by the callback. - */ - frame->type = PJMEDIA_FRAME_TYPE_NONE; - frame->size = 0; - - return (no_loop? PJ_EEOF: PJ_SUCCESS); + if (no_loop) { + frame->type = PJMEDIA_FRAME_TYPE_NONE; + frame->size = 0; + return PJ_EEOF; + } } else if (player->cb) { status = (*player->cb)(this_port, player->user_data); @@ -234,7 +236,7 @@ * return immediately (and don't try to access player port since * it might have been destroyed by the callback). */ - if ((status != PJ_SUCCESS) || (player->options & PJMEDIA_MEM_NO_LOOP)) + if ((status != PJ_SUCCESS) || no_loop) { frame->type = PJMEDIA_FRAME_TYPE_NONE; frame->size = 0; @@ -285,6 +287,17 @@ player->timestamp.u64 += PJMEDIA_PIA_SPF(&this_port->info); + if (delayed_cb) { + pjmedia_event event; + pjmedia_event_init(&event, PJMEDIA_EVENT_CALLBACK, + NULL, player); + pjmedia_event_publish(NULL, player, &event, + PJMEDIA_EVENT_PUBLISH_POST_EVENT); + /* Should not access player port after this since + * it might have been destroyed by the callback. + */ + } + return PJ_SUCCESS; } diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjmedia/src/pjmedia/resample_libsamplerate.c asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjmedia/src/pjmedia/resample_libsamplerate.c --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjmedia/src/pjmedia/resample_libsamplerate.c 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjmedia/src/pjmedia/resample_libsamplerate.c 2022-02-24 07:54:38.000000000 +0000 @@ -67,7 +67,8 @@ pjmedia_resample **p_resample) { pjmedia_resample *resample; - int type, err; + int type, err, i=0; + enum { MAX_KICKOFF = 10 }; PJ_ASSERT_RETURN(pool && p_resample && rate_in && rate_out && samples_per_frame, PJ_EINVAL); @@ -115,6 +116,30 @@ return PJMEDIA_ERROR; } + /* Kick off. Some initial processes may return samples less than + * samples_per_frame for unknown reason (lookahead buffering?), which + * will cause false 'extra' mechanism and introduce click noise in + * the whole session. So now, let's feed the engine with silent + * audio frames, until full frame is returned, to avoid that. + */ + while (++i <= MAX_KICKOFF) { + SRC_DATA src_data; + pj_bzero(&src_data, sizeof(src_data)); + src_data.data_in = resample->frame_in; + src_data.data_out = resample->frame_out; + src_data.input_frames = resample->in_samples; + src_data.output_frames = resample->out_samples; + src_data.src_ratio = resample->ratio; + src_process(resample->state, &src_data); + if (src_data.output_frames_gen == (int)resample->out_samples) + break; + + PJ_LOG(5,(THIS_FILE, + "Resample kickoff #%d: output_frames_gen=%d (expected=%d)%s", + i, src_data.output_frames_gen, resample->out_samples, + (i==MAX_KICKOFF?", warning: kickoff failed!":""))); + } + /* Done */ PJ_LOG(5,(THIS_FILE, diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjmedia/src/pjmedia/rtcp.c asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjmedia/src/pjmedia/rtcp.c --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjmedia/src/pjmedia/rtcp.c 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjmedia/src/pjmedia/rtcp.c 2022-02-24 07:54:38.000000000 +0000 @@ -502,12 +502,22 @@ /* Parse RTCP */ if (common->pt == RTCP_SR) { + if (sizeof (pjmedia_rtcp_common) + sizeof (pjmedia_rtcp_sr) > size) { + TRACE_((sess->name, "Discarding RTCP SR due to truncated size " + "%d bytes", size)); + return; + } sr = (pjmedia_rtcp_sr*) (((char*)pkt) + sizeof(pjmedia_rtcp_common)); if (common->count > 0 && size >= (sizeof(pjmedia_rtcp_sr_pkt))) { rr = (pjmedia_rtcp_rr*)(((char*)pkt) + (sizeof(pjmedia_rtcp_common) + sizeof(pjmedia_rtcp_sr))); } } else if (common->pt == RTCP_RR && common->count > 0) { + if (sizeof (pjmedia_rtcp_common) + sizeof (pjmedia_rtcp_rr) > size) { + TRACE_((sess->name, "Discarding RTCP RR due to truncated size " + "%d bytes", size)); + return; + } rr = (pjmedia_rtcp_rr*)(((char*)pkt) + sizeof(pjmedia_rtcp_common)); #if defined(PJMEDIA_HAS_RTCP_XR) && (PJMEDIA_HAS_RTCP_XR != 0) } else if (common->pt == RTCP_XR) { @@ -757,8 +767,15 @@ /* Check and get BYE reason */ if (size > 8) { + /* Make sure the BYE reason does not exceed: + * - the size of the available buffer + * - the declared reason's length + * - the actual packet size + */ reason.slen = PJ_MIN(sizeof(sess->stat.peer_sdes_buf_), *((pj_uint8_t*)pkt+8)); + reason.slen = PJ_MIN(reason.slen, (pj_ssize_t)(size-9)); + pj_memcpy(sess->stat.peer_sdes_buf_, ((pj_uint8_t*)pkt+9), reason.slen); reason.ptr = sess->stat.peer_sdes_buf_; @@ -819,12 +836,20 @@ p = (pj_uint8_t*)pkt; p_end = p + size; while (p < p_end) { - pjmedia_rtcp_common *common = (pjmedia_rtcp_common*)p; + pjmedia_rtcp_common *common; unsigned len; + if (p + sizeof(pjmedia_rtcp_common) > p_end) { + TRACE_((sess->name, "Receiving truncated RTCP packet (1)")); + break; + } + common = (pjmedia_rtcp_common*)p; + len = (pj_ntohs((pj_uint16_t)common->length)+1) * 4; - if (p + len > p_end) + if (p + len > p_end) { + TRACE_((sess->name, "Receiving truncated RTCP packet (2)")); break; + } switch(common->pt) { case RTCP_SR: diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjmedia/src/pjmedia/rtcp_fb.c asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjmedia/src/pjmedia/rtcp_fb.c --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjmedia/src/pjmedia/rtcp_fb.c 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjmedia/src/pjmedia/rtcp_fb.c 2022-02-24 07:54:38.000000000 +0000 @@ -172,7 +172,7 @@ PJ_ASSERT_RETURN(session && buf && length && rpsi, PJ_EINVAL); - bitlen = rpsi->rpsi_bit_len + 16; + bitlen = (unsigned)rpsi->rpsi_bit_len + 16; padlen = (32 - (bitlen % 32)) % 32; len = (3 + (bitlen+padlen)/32) * 4; if (len > *length) @@ -631,7 +631,8 @@ if (hdr->pt != RTCP_RTPFB || hdr->count != 1) return PJ_ENOTFOUND; - cnt = pj_ntohs((pj_uint16_t)hdr->length) - 2; + cnt = pj_ntohs((pj_uint16_t)hdr->length); + if (cnt > 2) cnt -= 2; else cnt = 0; if (length < (cnt+3)*4) return PJ_ETOOSMALL; @@ -663,7 +664,9 @@ pjmedia_rtcp_common *hdr = (pjmedia_rtcp_common*) buf; PJ_ASSERT_RETURN(buf, PJ_EINVAL); - PJ_ASSERT_RETURN(length >= 12, PJ_ETOOSMALL); + + if (length < 12) + return PJ_ETOOSMALL; /* PLI uses pt==RTCP_PSFB and FMT==1 */ if (hdr->pt != RTCP_PSFB || hdr->count != 1) diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjmedia/src/pjmedia/rtcp_xr.c asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjmedia/src/pjmedia/rtcp_xr.c --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjmedia/src/pjmedia/rtcp_xr.c 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjmedia/src/pjmedia/rtcp_xr.c 2022-02-24 07:54:38.000000000 +0000 @@ -436,16 +436,32 @@ if (rb_len) { switch (rb_hdr->bt) { case BT_RR_TIME: - rb_rr_time = (pjmedia_rtcp_xr_rb_rr_time*) rb_hdr; + if ((char*)rb_hdr + sizeof(*rb_rr_time) <= + (char*)pkt + size) + { + rb_rr_time = (pjmedia_rtcp_xr_rb_rr_time*)rb_hdr; + } break; case BT_DLRR: - rb_dlrr = (pjmedia_rtcp_xr_rb_dlrr*) rb_hdr; + if ((char*)rb_hdr + sizeof(*rb_dlrr) <= + (char*)pkt + size) + { + rb_dlrr = (pjmedia_rtcp_xr_rb_dlrr*)rb_hdr; + } break; case BT_STATS: - rb_stats = (pjmedia_rtcp_xr_rb_stats*) rb_hdr; + if ((char*)rb_hdr + sizeof(*rb_stats) <= + (char*)pkt + size) + { + rb_stats = (pjmedia_rtcp_xr_rb_stats*)rb_hdr; + } break; case BT_VOIP_METRICS: - rb_voip_mtc = (pjmedia_rtcp_xr_rb_voip_mtc*) rb_hdr; + if ((char*)rb_hdr + sizeof(*rb_voip_mtc) <= + (char*)pkt + size) + { + rb_voip_mtc = (pjmedia_rtcp_xr_rb_voip_mtc*)rb_hdr; + } break; default: break; diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjmedia/src/pjmedia/rtp.c asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjmedia/src/pjmedia/rtp.c --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjmedia/src/pjmedia/rtp.c 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjmedia/src/pjmedia/rtp.c 2022-02-24 07:54:38.000000000 +0000 @@ -113,6 +113,11 @@ ses->peer_ssrc = settings.peer_ssrc; } + PJ_LOG(5, (THIS_FILE, + "pjmedia_rtp_session_init2: ses=%p, seq=%d, ts=%d, peer_ssrc=%d", + ses, pj_ntohs(ses->out_hdr.seq), pj_ntohl(ses->out_hdr.ts), + ses->has_peer_ssrc? ses->peer_ssrc : 0)); + return PJ_SUCCESS; } @@ -185,6 +190,8 @@ /* Decode RTP extension. */ if ((*hdr)->x) { + if (offset + sizeof (pjmedia_rtp_ext_hdr) > (unsigned)pkt_len) + return PJMEDIA_RTP_EINLEN; dec_hdr->ext_hdr = (pjmedia_rtp_ext_hdr*)(((pj_uint8_t*)pkt) + offset); dec_hdr->ext = (pj_uint32_t*)(dec_hdr->ext_hdr + 1); dec_hdr->ext_len = pj_ntohs((dec_hdr->ext_hdr)->length); diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjmedia/src/pjmedia/sdp.c asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjmedia/src/pjmedia/sdp.c --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjmedia/src/pjmedia/sdp.c 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjmedia/src/pjmedia/sdp.c 2022-02-24 07:54:38.000000000 +0000 @@ -50,21 +50,21 @@ /* * Prototypes for line parser. */ -static void parse_version(pj_scanner *scanner, parse_context *ctx); +static void parse_version(pj_scanner *scanner, volatile parse_context *ctx); static void parse_origin(pj_scanner *scanner, pjmedia_sdp_session *ses, - parse_context *ctx); + volatile parse_context *ctx); static void parse_time(pj_scanner *scanner, pjmedia_sdp_session *ses, - parse_context *ctx); + volatile parse_context *ctx); static void parse_generic_line(pj_scanner *scanner, pj_str_t *str, - parse_context *ctx); + volatile parse_context *ctx); static void parse_connection_info(pj_scanner *scanner, pjmedia_sdp_conn *conn, - parse_context *ctx); + volatile parse_context *ctx); static void parse_bandwidth_info(pj_scanner *scanner, pjmedia_sdp_bandw *bandw, - parse_context *ctx); + volatile parse_context *ctx); static pjmedia_sdp_attr *parse_attr(pj_pool_t *pool, pj_scanner *scanner, - parse_context *ctx); + volatile parse_context *ctx); static void parse_media(pj_scanner *scanner, pjmedia_sdp_media *med, - parse_context *ctx); + volatile parse_context *ctx); static void on_scanner_error(pj_scanner *scanner); /* @@ -313,9 +313,9 @@ /* Expecting either '/' or EOF */ if (*scanner.curptr == '/') { + /* Skip the '/' */ pj_scan_get_char(&scanner); - rtpmap->param.ptr = scanner.curptr; - rtpmap->param.slen = scanner.end - scanner.curptr; + pj_scan_get(&scanner, &cs_token, &rtpmap->param); } else { rtpmap->param.slen = 0; } @@ -551,7 +551,7 @@ + 10 /* 32-bit integer */ + 1 /* NULL */); attr->value.slen = pj_ansi_snprintf(attr->value.ptr, cname->slen+18, - "%d cname:%.*s", ssrc, + "%u cname:%.*s", ssrc, (int)cname->slen, cname->ptr); return attr; @@ -706,7 +706,7 @@ return p-buf; } -static int print_media_desc( pjmedia_sdp_media *m, char *buf, int len) +static int print_media_desc(const pjmedia_sdp_media *m, char *buf, pj_size_t len) { char *p = buf; char *end = buf+len; @@ -714,7 +714,7 @@ int printed; /* check length for the "m=" line. */ - if (len < m->desc.media.slen+m->desc.transport.slen+12+24) { + if (len < (pj_size_t)m->desc.media.slen+m->desc.transport.slen+12+24) { return -1; } *p++ = 'm'; /* m= */ @@ -770,6 +770,12 @@ return (int)(p-buf); } +PJ_DEF(int) pjmedia_sdp_media_print(const pjmedia_sdp_media *media, + char *buf, pj_size_t size) +{ + return print_media_desc(media, buf, size); +} + PJ_DEF(pjmedia_sdp_media*) pjmedia_sdp_media_clone( pj_pool_t *pool, const pjmedia_sdp_media *rhs) @@ -962,7 +968,8 @@ * PARSERS */ -static void parse_version(pj_scanner *scanner, parse_context *ctx) +static void parse_version(pj_scanner *scanner, + volatile parse_context *ctx) { ctx->last_error = PJMEDIA_SDP_EINVER; @@ -983,7 +990,7 @@ } static void parse_origin(pj_scanner *scanner, pjmedia_sdp_session *ses, - parse_context *ctx) + volatile parse_context *ctx) { pj_str_t str; @@ -1029,7 +1036,7 @@ } static void parse_time(pj_scanner *scanner, pjmedia_sdp_session *ses, - parse_context *ctx) + volatile parse_context *ctx) { pj_str_t str; @@ -1059,7 +1066,7 @@ } static void parse_generic_line(pj_scanner *scanner, pj_str_t *str, - parse_context *ctx) + volatile parse_context *ctx) { ctx->last_error = PJMEDIA_SDP_EINSDP; @@ -1080,7 +1087,7 @@ } static void parse_connection_info(pj_scanner *scanner, pjmedia_sdp_conn *conn, - parse_context *ctx) + volatile parse_context *ctx) { ctx->last_error = PJMEDIA_SDP_EINCONN; @@ -1104,7 +1111,7 @@ } static void parse_bandwidth_info(pj_scanner *scanner, pjmedia_sdp_bandw *bandw, - parse_context *ctx) + volatile parse_context *ctx) { pj_str_t str; @@ -1126,7 +1133,7 @@ } static void parse_media(pj_scanner *scanner, pjmedia_sdp_media *med, - parse_context *ctx) + volatile parse_context *ctx) { pj_str_t str; @@ -1198,7 +1205,7 @@ } static pjmedia_sdp_attr *parse_attr( pj_pool_t *pool, pj_scanner *scanner, - parse_context *ctx) + volatile parse_context *ctx) { pjmedia_sdp_attr *attr; @@ -1317,7 +1324,7 @@ pjmedia_sdp_bandw *bandw; pj_str_t dummy; int cur_name = 254; - parse_context ctx; + volatile parse_context ctx; PJ_USE_EXCEPTION; ctx.last_error = PJ_SUCCESS; @@ -1431,8 +1438,7 @@ ctx.last_error = PJ_SUCCESS; } - PJ_CATCH_ANY { - + PJ_CATCH_ANY { PJ_PERROR(4, (THIS_FILE, ctx.last_error, "Error parsing SDP in line %d col %d", scanner.line, pj_scan_get_col(&scanner))); diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjmedia/src/pjmedia/sdp_neg.c asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjmedia/src/pjmedia/sdp_neg.c --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjmedia/src/pjmedia/sdp_neg.c 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjmedia/src/pjmedia/sdp_neg.c 2022-02-24 07:54:38.000000000 +0000 @@ -304,7 +304,6 @@ { pjmedia_sdp_session *new_offer; pjmedia_sdp_session *old_offer; - char media_used[PJMEDIA_MAX_SDP_MEDIA]; unsigned oi; /* old offer media index */ pj_status_t status; @@ -323,8 +322,19 @@ /* Change state to STATE_LOCAL_OFFER */ neg->state = PJMEDIA_SDP_NEG_STATE_LOCAL_OFFER; + /* When there is no active local SDP in state PJMEDIA_SDP_NEG_STATE_DONE, + * it means that the previous initial SDP nego must have been failed, + * so we'll just set the local SDP offer here. + */ + if (!neg->active_local_sdp) { + neg->initial_sdp_tmp = NULL; + neg->initial_sdp = pjmedia_sdp_session_clone(pool, local); + neg->neg_local_sdp = pjmedia_sdp_session_clone(pool, local); + + return PJ_SUCCESS; + } + /* Init vars */ - pj_bzero(media_used, sizeof(media_used)); old_offer = neg->active_local_sdp; new_offer = pjmedia_sdp_session_clone(pool, local); @@ -447,7 +457,18 @@ neg->state = PJMEDIA_SDP_NEG_STATE_LOCAL_OFFER; neg->neg_local_sdp = pjmedia_sdp_session_clone(pool, neg->active_local_sdp); - *offer = neg->active_local_sdp; + +#if PJMEDIA_SDP_NEG_COMPARE_BEFORE_INC_VERSION + if (pjmedia_sdp_session_cmp(neg->neg_local_sdp, + neg->initial_sdp, 0) != PJ_SUCCESS) + { + neg->neg_local_sdp->origin.version++; + } +#else + neg->neg_local_sdp->origin.version++; +#endif + + *offer = neg->neg_local_sdp; } else { /* We assume that we're in STATE_LOCAL_OFFER. @@ -680,6 +701,17 @@ return PJMEDIA_SDPNEG_EINVANSMEDIA; } + /* Check if remote has rejected our offer */ + if (answer->desc.port == 0) { + + /* Remote has rejected our offer. + * Deactivate our media too. + */ + pjmedia_sdp_media_deactivate(pool, offer); + + /* Don't need to proceed */ + return PJ_SUCCESS; + } /* Check that transport in the answer match our offer. */ @@ -694,18 +726,6 @@ } - /* Check if remote has rejected our offer */ - if (answer->desc.port == 0) { - - /* Remote has rejected our offer. - * Deactivate our media too. - */ - pjmedia_sdp_media_deactivate(pool, offer); - - /* Don't need to proceed */ - return PJ_SUCCESS; - } - /* Ticket #1148: check if remote answer does not set port to zero when * offered with port zero. Let's just tolerate it. */ @@ -906,7 +926,7 @@ * after receiving remote answer. */ static pj_status_t process_answer(pj_pool_t *pool, - pjmedia_sdp_session *offer, + pjmedia_sdp_session *local_offer, pjmedia_sdp_session *answer, pj_bool_t allow_asym, pjmedia_sdp_session **p_active) @@ -914,10 +934,14 @@ unsigned omi = 0; /* Offer media index */ unsigned ami = 0; /* Answer media index */ pj_bool_t has_active = PJ_FALSE; + pjmedia_sdp_session *offer; pj_status_t status; /* Check arguments. */ - PJ_ASSERT_RETURN(pool && offer && answer && p_active, PJ_EINVAL); + PJ_ASSERT_RETURN(pool && local_offer && answer && p_active, PJ_EINVAL); + + /* Duplicate local offer SDP. */ + offer = pjmedia_sdp_session_clone(pool, local_offer); /* Check that media count match between offer and answer */ // Ticket #527, different media count is allowed for more interoperability, @@ -1071,6 +1095,7 @@ pjmedia_sdp_media *answer; const pjmedia_sdp_media *master, *slave; unsigned nclockrate = 0, clockrate[PJMEDIA_MAX_SDP_FMT]; + unsigned ntel_clockrate = 0, tel_clockrate[PJMEDIA_MAX_SDP_FMT]; /* If offer has zero port, just clone the offer */ if (offer->desc.port == 0) { @@ -1224,6 +1249,18 @@ if (k == nclockrate) clockrate[nclockrate++] = or_.clock_rate; } else { + unsigned k; + + /* Keep track of tel-event clock rate, + * to prevent duplicate. + */ + for (k=0; kaud_param.dir & PJMEDIA_DIR_CAPTURE) { + if ((snd_port->aud_param.dir & PJMEDIA_DIR_CAPTURE) || + (snd_port->aud_param.dir & PJMEDIA_DIR_PLAYBACK)) + { pjmedia_aud_dev_info dev_info; + pjmedia_aud_dev_index dev_id = + (snd_port->aud_param.dir & PJMEDIA_DIR_CAPTURE) ? + snd_port->aud_param.rec_id : + snd_port->aud_param.play_id; - status = pjmedia_aud_dev_get_info(snd_port->aud_param.rec_id, - &dev_info); + status = pjmedia_aud_dev_get_info(dev_id, &dev_info); if (status != PJ_SUCCESS) return status; snd_port->aud_caps = dev_info.caps; - } else { - snd_port->aud_caps = 0; } /* Process EC settings */ @@ -561,10 +564,9 @@ pjmedia_aud_param prm; pj_status_t status; - /* Sound must be opened in full-duplex mode */ - PJ_ASSERT_RETURN(snd_port && - snd_port->dir == PJMEDIA_DIR_CAPTURE_PLAYBACK, - PJ_EINVALIDOP); + PJ_ASSERT_RETURN(snd_port && + ((snd_port->dir & PJMEDIA_DIR_CAPTURE)|| + (snd_port->dir & PJMEDIA_DIR_PLAYBACK)), PJ_EINVALIDOP); /* Determine whether we use device or software EC */ if ((snd_port->prm_ec_options & PJMEDIA_ECHO_USE_SW_ECHO) == 0 && diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjmedia/src/pjmedia/splitcomb.c asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjmedia/src/pjmedia/splitcomb.c --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjmedia/src/pjmedia/splitcomb.c 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjmedia/src/pjmedia/splitcomb.c 2022-02-24 07:54:38.000000000 +0000 @@ -309,6 +309,7 @@ struct splitcomb *sc = (struct splitcomb*) splitcomb; struct reverse_port *rport; unsigned buf_cnt; + unsigned buf_options; const pjmedia_audio_format_detail *sc_afd, *p_afd; pjmedia_port *port; pj_status_t status; @@ -352,6 +353,9 @@ if (buf_cnt == 0) buf_cnt = MAX_BUF_CNT; + /* Buffer options */ + buf_options = (options >> 8U) & 0xFF; + rport->max_burst = MAX_BURST; rport->max_null_frames = MAX_NULL_FRAMES; @@ -361,7 +365,8 @@ PJMEDIA_PIA_SPF(&port->info), p_afd->channel_count, buf_cnt * p_afd->frame_time_usec / 1000, - 0, &rport->buf[DIR_DOWNSTREAM].dbuf); + buf_options, + &rport->buf[DIR_DOWNSTREAM].dbuf); if (status != PJ_SUCCESS) { return status; } @@ -372,7 +377,8 @@ PJMEDIA_PIA_SPF(&port->info), p_afd->channel_count, buf_cnt * p_afd->frame_time_usec / 1000, - 0, &rport->buf[DIR_UPSTREAM].dbuf); + buf_options, + &rport->buf[DIR_UPSTREAM].dbuf); if (status != PJ_SUCCESS) { pjmedia_delay_buf_destroy(rport->buf[DIR_DOWNSTREAM].dbuf); return status; diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjmedia/src/pjmedia/stream.c asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjmedia/src/pjmedia/stream.c --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjmedia/src/pjmedia/stream.c 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjmedia/src/pjmedia/stream.c 2022-02-24 07:54:38.000000000 +0000 @@ -164,6 +164,7 @@ pjmedia_jbuf *jb; /**< Jitter buffer. */ char jb_last_frm; /**< Last frame type from jb */ unsigned jb_last_frm_cnt;/**< Last JB frame type counter*/ + unsigned soft_start_cnt;/**< Stream soft start counter */ pjmedia_rtcp_session rtcp; /**< RTCP for incoming RTP. */ @@ -185,6 +186,7 @@ int rx_event_pt; /**< Incoming pt for dtmf. */ int last_dtmf; /**< Current digit, or -1. */ pj_uint32_t last_dtmf_dur; /**< Start ts for cur digit. */ + pj_bool_t last_dtmf_ended; unsigned rx_dtmf_count; /**< # of digits in dtmf rx buf.*/ char rx_dtmf_buf[32];/**< Incoming DTMF buffer. */ @@ -192,6 +194,10 @@ void (*dtmf_cb)(pjmedia_stream*, void*, int); void *dtmf_cb_user_data; + void (*dtmf_event_cb)(pjmedia_stream*, void*, + const pjmedia_stream_dtmf_event*); + void *dtmf_event_cb_user_data; + #if defined(PJMEDIA_HANDLE_G722_MPEG_BUG) && (PJMEDIA_HANDLE_G722_MPEG_BUG!=0) /* Enable support to handle codecs with inconsistent clock rate * between clock rate in SDP/RTP & the clock rate that is actually used. @@ -230,8 +236,16 @@ pj_bool_t use_ka; /**< Stream keep-alive with non- codec-VAD mechanism is enabled? */ - pj_timestamp last_frm_ts_sent; /**< Timestamp of last sending + unsigned ka_interval; /**< The keepalive sending + interval */ + pj_time_val last_frm_ts_sent; /**< Time of last sending packet */ + unsigned start_ka_count; /**< The number of keep-alive + to be sent after it is + created */ + unsigned start_ka_interval;/**< The keepalive sending + interval after the stream + is created */ #endif pj_sockaddr rem_rtp_addr; /**< Remote RTP address */ @@ -518,6 +532,19 @@ return PJ_SUCCESS; } + if (stream->soft_start_cnt) { + if (stream->soft_start_cnt == PJMEDIA_STREAM_SOFT_START) { + PJ_LOG(4,(stream->port.info.name.ptr, + "Resetting jitter buffer in stream playback start")); + pj_mutex_lock( stream->jb_mutex ); + pjmedia_jbuf_reset(stream->jb); + pj_mutex_unlock( stream->jb_mutex ); + } + --stream->soft_start_cnt; + frame->type = PJMEDIA_FRAME_TYPE_NONE; + return PJ_SUCCESS; + } + /* Repeat get frame from the jitter buffer and decode the frame * until we have enough frames according to codec's ptime. */ @@ -753,7 +780,8 @@ stream->dec_buf_count); } } else if (use_dec_buf) { - stream->dec_buf_count = frame_out.size / sizeof(pj_int16_t); + stream->dec_buf_count = (unsigned)frame_out.size / + sizeof(pj_int16_t); } if (stream->jb_last_frm != frame_type) { @@ -1305,24 +1333,27 @@ */ if (stream->use_ka) { - pj_uint32_t dtx_duration; + pj_uint32_t dtx_duration, ka_interval; + pj_time_val now, tmp; - dtx_duration = pj_timestamp_diff32(&stream->last_frm_ts_sent, - &frame->timestamp); - if (dtx_duration > - PJMEDIA_STREAM_KA_INTERVAL * PJMEDIA_PIA_SRATE(&stream->port.info)) - { - send_keep_alive_packet(stream); - stream->last_frm_ts_sent = frame->timestamp; - } - } -#endif + pj_gettimeofday(&now); + tmp = now; + PJ_TIME_VAL_SUB(tmp, stream->last_frm_ts_sent); + dtx_duration = PJ_TIME_VAL_MSEC(tmp); + if (stream->start_ka_count) { + ka_interval = stream->start_ka_interval; + } else { + ka_interval = stream->ka_interval * 1000; + } + if (dtx_duration > ka_interval) { + send_keep_alive_packet(stream); + stream->last_frm_ts_sent = now; - /* Don't do anything if stream is paused */ - if (channel->paused) { - stream->enc_buf_pos = stream->enc_buf_count = 0; - return PJ_SUCCESS; + if (stream->start_ka_count) + stream->start_ka_count--; + } } +#endif /* Number of samples in the frame */ if (frame->type == PJMEDIA_FRAME_TYPE_AUDIO) @@ -1334,9 +1365,6 @@ else ts_len = 0; - /* Increment transmit duration */ - stream->tx_duration += ts_len; - #if defined(PJMEDIA_HANDLE_G722_MPEG_BUG) && (PJMEDIA_HANDLE_G722_MPEG_BUG!=0) /* Handle special case for audio codec with RTP timestamp inconsistence * e.g: G722, MPEG audio. @@ -1349,6 +1377,23 @@ rtp_ts_len = ts_len; #endif + /* Don't do anything if stream is paused, except updating RTP timestamp */ + if (channel->paused) { + stream->enc_buf_pos = stream->enc_buf_count = 0; + + /* Update RTP session's timestamp. */ + status = pjmedia_rtp_encode_rtp( &channel->rtp, 0, 0, 0, rtp_ts_len, + NULL, NULL); + + /* Update RTCP stats with last RTP timestamp. */ + stream->rtcp.stat.rtp_tx_last_ts = pj_ntohl(channel->rtp.out_hdr.ts); + + return PJ_SUCCESS; + } + + /* Increment transmit duration */ + stream->tx_duration += ts_len; + /* Init frame_out buffer. */ frame_out.buf = ((char*)channel->out_pkt) + sizeof(pjmedia_rtp_hdr); frame_out.size = 0; @@ -1426,7 +1471,6 @@ (const void**)&rtphdr, &rtphdrlen); - /* Encode audio frame */ } else if ((frame->type == PJMEDIA_FRAME_TYPE_AUDIO && frame->buf != NULL) || @@ -1529,8 +1573,8 @@ stream->rtcp.stat.rtp_tx_last_seq = pj_ntohs(stream->enc->rtp.out_hdr.seq); #if defined(PJMEDIA_STREAM_ENABLE_KA) && PJMEDIA_STREAM_ENABLE_KA!=0 - /* Update timestamp of last sending packet. */ - stream->last_frm_ts_sent = frame->timestamp; + /* Update time of last sending packet. */ + pj_gettimeofday(&stream->last_frm_ts_sent); #endif return PJ_SUCCESS; @@ -1677,9 +1721,14 @@ * Handle incoming DTMF digits. */ static void handle_incoming_dtmf( pjmedia_stream *stream, + const pj_timestamp *timestamp, const void *payload, unsigned payloadlen) { pjmedia_rtp_dtmf_event *event = (pjmedia_rtp_dtmf_event*) payload; + pj_uint16_t event_duration; + pjmedia_stream_dtmf_event dtmf_event; + pj_bool_t is_event_end; + pj_bool_t emit_event; /* Check compiler packing. */ pj_assert(sizeof(pjmedia_rtp_dtmf_event)==4); @@ -1690,16 +1739,6 @@ //dump_bin(payload, payloadlen); - /* Check if this is the same/current digit of the last packet. */ - if (stream->last_dtmf != -1 && - event->event == stream->last_dtmf && - pj_ntohs(event->duration) >= stream->last_dtmf_dur) - { - /* Yes, this is the same event. */ - stream->last_dtmf_dur = pj_ntohs(event->duration); - return; - } - /* Ignore unknown event. */ #if defined(PJMEDIA_HAS_DTMF_FLASH) && PJMEDIA_HAS_DTMF_FLASH!= 0 if (event->event > 16) { @@ -1712,22 +1751,68 @@ return; } + /* Extract event data. */ + event_duration = pj_ntohs(event->duration); + is_event_end = (event->e_vol & PJMEDIA_RTP_DTMF_EVENT_END_MASK) != 0; + + /* Check if this is the same/current digit of the last packet. */ + if (stream->last_dtmf != -1 && + event->event == stream->last_dtmf && + event_duration >= stream->last_dtmf_dur) + { + /* Emit all updates but hide duplicate end frames. */ + emit_event = !is_event_end || stream->last_dtmf_ended != is_event_end; + + /* Yes, this is the same event. */ + stream->last_dtmf_dur = event_duration; + stream->last_dtmf_ended = is_event_end; + + /* If DTMF callback is installed and end of event hasn't been reported + * already, call it. + */ + if (stream->dtmf_event_cb && emit_event) { + dtmf_event.digit = digitmap[event->event]; + dtmf_event.timestamp = (pj_uint32_t)(timestamp->u64 / + (stream->codec_param.info.clock_rate / 1000)); + dtmf_event.duration = (pj_uint16_t)(event_duration / + (stream->codec_param.info.clock_rate / 1000)); + dtmf_event.flags = PJMEDIA_STREAM_DTMF_IS_UPDATE; + if (is_event_end) { + dtmf_event.flags |= PJMEDIA_STREAM_DTMF_IS_END; + } + stream->dtmf_event_cb(stream, stream->dtmf_event_cb_user_data, + &dtmf_event); + } + return; + } + /* New event! */ PJ_LOG(5,(stream->port.info.name.ptr, "Received DTMF digit %c, vol=%d", digitmap[event->event], - (event->e_vol & 0x3F))); + (event->e_vol & PJMEDIA_RTP_DTMF_EVENT_VOLUME_MASK))); stream->last_dtmf = event->event; - stream->last_dtmf_dur = pj_ntohs(event->duration); + stream->last_dtmf_dur = event_duration; + stream->last_dtmf_ended = is_event_end; /* If DTMF callback is installed, call the callback, otherwise keep * the DTMF digits in the buffer. */ - if (stream->dtmf_cb) { - + if (stream->dtmf_event_cb) { + dtmf_event.digit = digitmap[event->event]; + dtmf_event.timestamp = (pj_uint32_t)(timestamp->u64 / + (stream->codec_param.info.clock_rate / 1000)); + dtmf_event.duration = (pj_uint16_t)(event_duration / + (stream->codec_param.info.clock_rate / 1000)); + dtmf_event.flags = 0; + if (is_event_end) { + dtmf_event.flags |= PJMEDIA_STREAM_DTMF_IS_END; + } + stream->dtmf_event_cb(stream, stream->dtmf_event_cb_user_data, + &dtmf_event); + } else if (stream->dtmf_cb) { stream->dtmf_cb(stream, stream->dtmf_cb_user_data, digitmap[event->event]); - } else { /* By convention, we use jitter buffer's mutex to access shared * DTMF variables. @@ -1782,7 +1867,7 @@ return; } - /* Ignore keep-alive packets */ + /* Ignore non-RTP keep-alive packets */ if (bytes_read < (pj_ssize_t) sizeof(pjmedia_rtp_hdr)) return; @@ -1799,25 +1884,88 @@ if (stream->si.rtcp_mux && hdr->pt >= 64 && hdr->pt <= 95) { on_rx_rtcp(stream, pkt, bytes_read); return; + } + + /* See if source address of RTP packet is different than the + * configured address, and check if we need to tell the + * media transport to switch RTP remote address. + */ + if (param->src_addr) { + pj_uint32_t peer_ssrc = channel->rtp.peer_ssrc; + pj_bool_t badssrc = PJ_FALSE; + + /* Check SSRC. */ + if (!channel->rtp.has_peer_ssrc && peer_ssrc == 0) + peer_ssrc = pj_ntohl(hdr->ssrc); + + if ((stream->si.has_rem_ssrc) && (pj_ntohl(hdr->ssrc) != peer_ssrc)) { + badssrc = PJ_TRUE; + } + + if (pj_sockaddr_cmp(&stream->rem_rtp_addr, param->src_addr) == 0) { + /* We're still receiving from rem_rtp_addr. */ + stream->rtp_src_cnt = 0; + stream->rem_rtp_flag = badssrc? 2: 1; + } else { + stream->rtp_src_cnt++; + + if (stream->rtp_src_cnt < PJMEDIA_RTP_NAT_PROBATION_CNT) { + if (stream->rem_rtp_flag == 1 || + (stream->rem_rtp_flag == 2 && badssrc)) + { + /* Only discard if: + * - we have ever received packet with good ssrc from + * remote address (rem_rtp_addr), or + * - we have ever received packet with bad ssrc from + * remote address and this packet also has bad ssrc. + */ + return; + } + if (!badssrc && stream->rem_rtp_flag != 1) + { + /* Immediately switch if we receive packet with the + * correct ssrc AND we never receive packets with + * good ssrc from rem_rtp_addr. + */ + param->rem_switch = PJ_TRUE; + } + } else { + /* Switch. We no longer receive packets from rem_rtp_addr. */ + param->rem_switch = PJ_TRUE; + } + + if (param->rem_switch) { + /* Set remote RTP address to source address */ + pj_sockaddr_cp(&stream->rem_rtp_addr, param->src_addr); + + /* Reset counter and flag */ + stream->rtp_src_cnt = 0; + stream->rem_rtp_flag = badssrc? 2: 1; + + /* Update RTCP peer ssrc */ + stream->rtcp.peer_ssrc = pj_ntohl(hdr->ssrc); + } + } } - /* Ignore the packet if decoder is paused */ pj_bzero(&seq_st, sizeof(seq_st)); - if (channel->paused) + /* Ignore the packet if decoder is paused */ + if (channel->paused) { goto on_return; + } /* Update RTP session (also checks if RTP session can accept * the incoming packet. */ check_pt = (hdr->pt != stream->rx_event_pt) && PJMEDIA_STREAM_CHECK_RTP_PT; pjmedia_rtp_session_update2(&channel->rtp, hdr, &seq_st, check_pt); -#if !PJMEDIA_STREAM_CHECK_RTP_PT +#if !PJMEDIA_STREAM_CHECK_RTP_PT if (!check_pt && hdr->pt != channel->rtp.out_pt && - hdr->pt != stream->rx_event_pt) - { - seq_st.status.flag.badpt = 1; - } -#endif + hdr->pt != stream->rx_event_pt) + { + seq_st.status.flag.badpt = 1; + } +#endif if (seq_st.status.value) { TRC_ ((stream->port.info.name.ptr, "RTP status: badpt=%d, badssrc=%d, dup=%d, " @@ -1859,6 +2007,8 @@ /* Handle incoming DTMF. */ if (hdr->pt == stream->rx_event_pt) { + pj_timestamp ts; + /* Ignore out-of-order packet as it will be detected as new * digit. Also ignore duplicate packet as it serves no use. */ @@ -1866,64 +2016,11 @@ goto on_return; } - handle_incoming_dtmf(stream, payload, payloadlen); - goto on_return; - } - - /* See if source address of RTP packet is different than the - * configured address, and check if we need to tell the - * media transport to switch RTP remote address. - */ - if (param->src_addr) { - pj_bool_t badssrc = (stream->si.has_rem_ssrc && - seq_st.status.flag.badssrc); - - if (pj_sockaddr_cmp(&stream->rem_rtp_addr, param->src_addr) == 0) { - /* We're still receiving from rem_rtp_addr. */ - stream->rtp_src_cnt = 0; - stream->rem_rtp_flag = badssrc? 2: 1; - } else { - stream->rtp_src_cnt++; - - if (stream->rtp_src_cnt < PJMEDIA_RTP_NAT_PROBATION_CNT) { - if (stream->rem_rtp_flag == 1 || - (stream->rem_rtp_flag == 2 && badssrc)) - { - /* Only discard if: - * - we have ever received packet with good ssrc from - * remote address (rem_rtp_addr), or - * - we have ever received packet with bad ssrc from - * remote address and this packet also has bad ssrc. - */ - pkt_discarded = PJ_TRUE; - goto on_return; - } - if (stream->si.has_rem_ssrc && !seq_st.status.flag.badssrc && - stream->rem_rtp_flag != 1) - { - /* Immediately switch if we receive packet with the - * correct ssrc AND we never receive packets with - * good ssrc from rem_rtp_addr. - */ - param->rem_switch = PJ_TRUE; - } - } else { - /* Switch. We no longer receive packets from rem_rtp_addr. */ - param->rem_switch = PJ_TRUE; - } - - if (param->rem_switch) { - /* Set remote RTP address to source address */ - pj_sockaddr_cp(&stream->rem_rtp_addr, param->src_addr); - - /* Reset counter and flag */ - stream->rtp_src_cnt = 0; - stream->rem_rtp_flag = badssrc? 2: 1; + /* Get the timestamp of the event */ + ts.u64 = pj_ntohl(hdr->ts); - /* Update RTCP peer ssrc */ - stream->rtcp.peer_ssrc = pj_ntohl(hdr->ssrc); - } - } + handle_incoming_dtmf(stream, &ts, payload, payloadlen); + goto on_return; } /* Put "good" packet to jitter buffer, or reset the jitter buffer @@ -1944,6 +2041,7 @@ unsigned i, count = MAX; unsigned ts_span; pjmedia_frame frames[MAX]; + pj_bzero(frames, sizeof(frames[0]) * MAX); /* Get the timestamp of the first sample */ ts.u64 = pj_ntohl(hdr->ts); @@ -1955,13 +2053,15 @@ LOGERR_((stream->port.info.name.ptr, status, "Codec parse() error")); count = 0; + } else if (count == 0) { + PJ_LOG(2, (stream->port.info.name.ptr, "codec parsed 0 frames")); } else if (stream->detect_ptime_change && frames[0].bit_info > 0xFFFF) { - unsigned dec_ptime; + unsigned dec_ptime, old_ptime; + + old_ptime = stream->dec_ptime; - PJ_LOG(4, (stream->port.info.name.ptr, "codec decode " - "ptime change detected")); frames[0].bit_info &= 0xFFFF; dec_ptime = frames[0].bit_info * 1000 / stream->codec_param.info.clock_rate; @@ -1970,6 +2070,10 @@ stream->dec_ptime = (pj_uint16_t)dec_ptime; pjmedia_jbuf_set_ptime(stream->jb, stream->dec_ptime); + PJ_LOG(4, (stream->port.info.name.ptr, "codec decode " + "ptime change detected: %d -> %d", + old_ptime, dec_ptime)); + /* Reset jitter buffer after ptime changed */ pjmedia_jbuf_reset(stream->jb); } @@ -2038,7 +2142,7 @@ /* Adjust the timestamp of the parsed frames */ for (i=0; ilast_dtmf = -1; stream->jb_last_frm = PJMEDIA_JB_NORMAL_FRAME; stream->rtcp_fb_nack.pid = -1; + stream->soft_start_cnt = PJMEDIA_STREAM_SOFT_START; #if defined(PJMEDIA_STREAM_ENABLE_KA) && PJMEDIA_STREAM_ENABLE_KA!=0 stream->use_ka = info->use_ka; + stream->ka_interval = info->ka_cfg.ka_interval; + stream->start_ka_count = info->ka_cfg.start_count; + stream->start_ka_interval = info->ka_cfg.start_interval; #endif stream->cname = info->cname; @@ -2608,6 +2716,7 @@ /* Set up jitter buffer */ pjmedia_jbuf_set_adaptive( stream->jb, jb_init, jb_min_pre, jb_max_pre); + pjmedia_jbuf_set_discard(stream->jb, info->jb_discard_algo); /* Create decoder channel: */ @@ -3113,6 +3222,7 @@ if ((dir & PJMEDIA_DIR_DECODING) && stream->dec) { stream->dec->paused = 0; + stream->soft_start_cnt = PJMEDIA_STREAM_SOFT_START; PJ_LOG(4,(stream->port.info.name.ptr, "Decoder stream resumed")); } @@ -3263,6 +3373,27 @@ pj_mutex_unlock(stream->jb_mutex); + return PJ_SUCCESS; +} + +PJ_DEF(pj_status_t) pjmedia_stream_set_dtmf_event_callback(pjmedia_stream *stream, + void (*cb)(pjmedia_stream*, + void *user_data, + const pjmedia_stream_dtmf_event *event), + void *user_data) +{ + PJ_ASSERT_RETURN(stream, PJ_EINVAL); + + /* By convention, we use jitter buffer's mutex to access DTMF + * digits resources. + */ + pj_mutex_lock(stream->jb_mutex); + + stream->dtmf_event_cb = cb; + stream->dtmf_event_cb_user_data = user_data; + + pj_mutex_unlock(stream->jb_mutex); + return PJ_SUCCESS; } diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjmedia/src/pjmedia/stream_common.c asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjmedia/src/pjmedia/stream_common.c --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjmedia/src/pjmedia/stream_common.c 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjmedia/src/pjmedia/stream_common.c 2022-02-24 07:54:38.000000000 +0000 @@ -21,6 +21,19 @@ #define THIS_FILE "stream_common.c" +#if defined(PJMEDIA_STREAM_ENABLE_KA) && PJMEDIA_STREAM_ENABLE_KA!=0 + +PJ_DEF(void) +pjmedia_stream_ka_config_default(pjmedia_stream_ka_config *cfg) +{ + pj_bzero(cfg, sizeof(*cfg)); + cfg->start_count = PJMEDIA_STREAM_START_KA_CNT; + cfg->start_interval = PJMEDIA_STREAM_START_KA_INTERVAL_MSEC; + cfg->ka_interval = PJMEDIA_STREAM_KA_INTERVAL; +} + +#endif + /* * Parse fmtp for specified format/payload type. */ diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjmedia/src/pjmedia/stream_info.c asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjmedia/src/pjmedia/stream_info.c --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjmedia/src/pjmedia/stream_info.c 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjmedia/src/pjmedia/stream_info.c 2022-02-24 07:54:38.000000000 +0000 @@ -83,6 +83,7 @@ const pjmedia_sdp_attr *attr; pjmedia_sdp_rtpmap *rtpmap; unsigned i, fmti, pt = 0; + unsigned rx_ev_clock_rate = 0; pj_status_t status; /* Find the first codec which is not telephone-event */ @@ -315,6 +316,7 @@ continue; if (pj_strcmp(&r.enc_name, &ID_TELEPHONE_EVENT) == 0) { si->rx_event_pt = pj_strtoul(&r.pt); + rx_ev_clock_rate = r.clock_rate; break; } } @@ -330,8 +332,13 @@ if (pjmedia_sdp_attr_get_rtpmap(attr, &r) != PJ_SUCCESS) continue; if (pj_strcmp(&r.enc_name, &ID_TELEPHONE_EVENT) == 0) { - si->tx_event_pt = pj_strtoul(&r.pt); - break; + /* Check if the clock rate matches local event's clock rate. */ + if (r.clock_rate == rx_ev_clock_rate) { + si->tx_event_pt = pj_strtoul(&r.pt); + break; + } else if (si->tx_event_pt == -1) { + si->tx_event_pt = pj_strtoul(&r.pt); + } } } @@ -362,7 +369,6 @@ const pjmedia_sdp_conn *local_conn; const pjmedia_sdp_conn *rem_conn; int rem_af, local_af; - pj_sockaddr local_addr; unsigned i; pj_status_t status; @@ -438,6 +444,14 @@ /* Set remote address: */ status = pj_sockaddr_init(rem_af, &si->rem_addr, &rem_conn->addr, rem_m->desc.port); + if (status == PJ_ERESOLVE && rem_af == pj_AF_INET()) { + /* Handle special case in NAT64 scenario where for some reason, server + * puts IPv6 (literal or FQDN) in SDP answer while indicating "IP4" + * in its address type, let's retry resolving using AF_INET6. + */ + status = pj_sockaddr_init(pj_AF_INET6(), &si->rem_addr, + &rem_conn->addr, rem_m->desc.port); + } if (status != PJ_SUCCESS) { /* Invalid IP address. */ return PJMEDIA_EINVALIDIP; @@ -459,7 +473,7 @@ } /* Set remote address: */ - status = pj_sockaddr_init(local_af, &local_addr, &local_conn->addr, + status = pj_sockaddr_init(local_af, &si->local_addr, &local_conn->addr, local_m->desc.port); if (status != PJ_SUCCESS) { /* Invalid IP address. */ @@ -481,7 +495,7 @@ /* Media direction: */ if (local_m->desc.port == 0 || - pj_sockaddr_has_addr(&local_addr)==PJ_FALSE || + pj_sockaddr_has_addr(&si->local_addr)==PJ_FALSE || pj_sockaddr_has_addr(&si->rem_addr)==PJ_FALSE || pjmedia_sdp_media_find_attr(local_m, &STR_INACTIVE, NULL)!=NULL) { @@ -598,6 +612,7 @@ /* Set default jitter buffer parameter. */ si->jb_init = si->jb_max = si->jb_min_pre = si->jb_max_pre = -1; + si->jb_discard_algo = PJMEDIA_JB_DISCARD_PROGRESSIVE; /* Get local RTCP-FB info */ status = pjmedia_rtcp_fb_decode_sdp2(pool, endpt, NULL, local, stream_idx, diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjmedia/src/pjmedia/tonegen.c asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjmedia/src/pjmedia/tonegen.c --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjmedia/src/pjmedia/tonegen.c 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjmedia/src/pjmedia/tonegen.c 2022-02-24 07:54:38.000000000 +0000 @@ -511,6 +511,22 @@ return PJ_SUCCESS; } +/* + * Instruct the tone generator to stop looping of the current tone set. + */ +PJ_DEF(pj_status_t) pjmedia_tonegen_stop_loop(pjmedia_port *port) +{ + struct tonegen *tonegen = (struct tonegen*) port; + PJ_ASSERT_RETURN(port->info.signature == SIGNATURE, PJ_EINVAL); + + TRACE_((THIS_FILE, "tonegen_stop_loop()")); + + pj_lock_acquire(tonegen->lock); + tonegen->playback_options &= ~PJMEDIA_TONEGEN_LOOP; + pj_lock_release(tonegen->lock); + + return PJ_SUCCESS; +} /* * Instruct the tone generator to stop current processing. diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjmedia/src/pjmedia/transport_ice.c asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjmedia/src/pjmedia/transport_ice.c --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjmedia/src/pjmedia/transport_ice.c 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjmedia/src/pjmedia/transport_ice.c 2022-02-24 07:54:38.000000000 +0000 @@ -44,6 +44,7 @@ pj_bool_t ice_mismatch; /* Address doesn't match candidates */ pj_bool_t ice_restart; /* Offer to restart ICE */ pj_ice_sess_role local_role; /* Our role */ + pj_bool_t has_trickle; /* Has trickle ICE attribute */ }; /* ICE listener */ @@ -88,6 +89,12 @@ unsigned tx_drop_pct; /**< Percent of tx pkts to drop. */ unsigned rx_drop_pct; /**< Percent of rx pkts to drop. */ + pj_ice_sess_trickle trickle_ice; /**< Trickle ICE mode. */ + unsigned last_send_cand_cnt[PJ_ICE_MAX_COMP]; + /**< Last local candidate count. */ + pj_bool_t end_of_cand; /**< Local cand gathering done? */ + pj_str_t sdp_mid; /**< SDP "a=mid" attribute. */ + void (*rtp_cb)(void*, void*, pj_ssize_t); @@ -162,6 +169,9 @@ static void ice_on_ice_complete(pj_ice_strans *ice_st, pj_ice_strans_op op, pj_status_t status); +static void ice_on_new_candidate(pj_ice_strans *ice_st, + const pj_ice_sess_cand *cand, + pj_bool_t last); /* * Clean up ICE resources. @@ -198,12 +208,30 @@ static const pj_str_t STR_RTCP_MUX = { "rtcp-mux", 8 }; static const pj_str_t STR_BANDW_RR = { "RR", 2 }; static const pj_str_t STR_BANDW_RS = { "RS", 2 }; +static const pj_str_t STR_ICE_OPTIONS = { "ice-options", 11 }; +static const pj_str_t STR_TRICKLE = { "trickle", 7 }; +static const pj_str_t STR_END_OF_CAND = { "end-of-candidates", 17 }; enum { COMP_RTP = 1, COMP_RTCP = 2 }; + +/* Forward declaration of internal functions */ + +static int print_sdp_cand_attr(char *buffer, int max_len, + const pj_ice_sess_cand *cand); +static void get_ice_attr(const pjmedia_sdp_session *rem_sdp, + const pjmedia_sdp_media *rem_m, + const pjmedia_sdp_attr **p_ice_ufrag, + const pjmedia_sdp_attr **p_ice_pwd); +static pj_status_t parse_cand(const char *obj_name, + pj_pool_t *pool, + const pj_str_t *orig_input, + pj_ice_sess_cand *cand); + + /* * Create ICE media transport. */ @@ -265,6 +293,7 @@ tp_ice->initial_sdp = PJ_TRUE; tp_ice->oa_role = ROLE_NONE; tp_ice->use_ice = PJ_FALSE; + tp_ice->trickle_ice = cfg->opt.trickle; pj_list_init(&tp_ice->listener); pj_list_init(&tp_ice->listener_empty); @@ -281,6 +310,7 @@ pj_bzero(&ice_st_cb, sizeof(ice_st_cb)); ice_st_cb.on_ice_complete = &ice_on_ice_complete; ice_st_cb.on_rx_data = &ice_on_rx_data; + ice_st_cb.on_new_candidate = &ice_on_new_candidate; /* Configure RTP socket buffer settings, if not set */ if (ice_st_cfg.comp[COMP_RTP-1].so_rcvbuf_size == 0) { @@ -391,6 +421,359 @@ return (il != &tp_ice->listener? PJ_SUCCESS : PJ_ENOTFOUND); } + +/* Check if trickle support is signalled in the specified SDP. */ +PJ_DEF(pj_bool_t) pjmedia_ice_sdp_has_trickle( const pjmedia_sdp_session *sdp, + unsigned med_idx) +{ + const pjmedia_sdp_media *m; + const pjmedia_sdp_attr *a; + + PJ_ASSERT_RETURN(sdp && med_idx < sdp->media_count, PJ_EINVAL); + + /* Find in media level */ + m = sdp->media[med_idx]; + a = pjmedia_sdp_attr_find(m->attr_count, m->attr, &STR_ICE_OPTIONS, NULL); + if (a && pj_strstr(&a->value, &STR_TRICKLE)) + return PJ_TRUE; + + /* Find in session level */ + a = pjmedia_sdp_attr_find(sdp->attr_count, sdp->attr, &STR_ICE_OPTIONS, + NULL); + if (a && pj_strstr(&a->value, &STR_TRICKLE)) + return PJ_TRUE; + + return PJ_FALSE; +} + + +/* Update check list after discovering and conveying new local ICE candidate, + * or receiving update of remote ICE candidates in trickle ICE. + */ +PJ_DEF(pj_status_t) pjmedia_ice_trickle_update( + pjmedia_transport *tp, + const pj_str_t *rem_ufrag, + const pj_str_t *rem_passwd, + unsigned rcand_cnt, + const pj_ice_sess_cand rcand[], + pj_bool_t rcand_end) +{ + struct transport_ice *tp_ice = (struct transport_ice*)tp; + pj_status_t status; + + PJ_ASSERT_RETURN(tp_ice && tp_ice->ice_st, PJ_EINVAL); + PJ_ASSERT_RETURN(tp_ice->trickle_ice != PJ_ICE_SESS_TRICKLE_DISABLED, + PJ_EINVALIDOP); + + + /* Update the checklist */ + status = pj_ice_strans_update_check_list(tp_ice->ice_st, + rem_ufrag, rem_passwd, + rcand_cnt, rcand, rcand_end); + if (status != PJ_SUCCESS) + return status; + + /* Start ICE if both sides have sent their (initial) SDPs */ + if (!pj_ice_strans_sess_is_running(tp_ice->ice_st)) { + unsigned i, comp_cnt; + + comp_cnt = pj_ice_strans_get_running_comp_cnt(tp_ice->ice_st); + for (i = 0; i < comp_cnt; ++i) { + if (tp_ice->last_send_cand_cnt[i] > 0) + break; + } + if (i != comp_cnt) { + pj_str_t rufrag; + pj_ice_strans_get_ufrag_pwd(tp_ice->ice_st, NULL, NULL, + &rufrag, NULL); + if (rufrag.slen > 0) { + PJ_LOG(3,(THIS_FILE,"Trickle ICE starts connectivity check")); + status = pj_ice_strans_start_ice(tp_ice->ice_st, NULL, NULL, + 0, NULL); + } + } + } + + return status; +} + + +/* Fetch trickle ICE info from the specified SDP. */ +PJ_DEF(pj_status_t) pjmedia_ice_trickle_decode_sdp( + const pjmedia_sdp_session *sdp, + unsigned media_index, + pj_str_t *mid, + pj_str_t *ufrag, + pj_str_t *passwd, + unsigned *cand_cnt, + pj_ice_sess_cand cand[], + pj_bool_t *end_of_cand) +{ + const pjmedia_sdp_media *m; + const pjmedia_sdp_attr *a; + + PJ_ASSERT_RETURN(sdp && media_index < sdp->media_count, PJ_EINVAL); + + m = sdp->media[media_index]; + + if (mid) { + a = pjmedia_sdp_attr_find2(m->attr_count, m->attr, "mid", NULL); + if (a) { + *mid = a->value; + } else { + pj_bzero(mid, sizeof(*mid)); + } + } + + if (ufrag && passwd) { + const pjmedia_sdp_attr *a_ufrag, *a_pwd; + get_ice_attr(sdp, m, &a_ufrag, &a_pwd); + if (a_ufrag && a_pwd) { + *ufrag = a_ufrag->value; + *passwd = a_pwd->value; + } else { + pj_bzero(ufrag, sizeof(*ufrag)); + pj_bzero(passwd, sizeof(*passwd)); + } + } + + if (cand_cnt && cand && *cand_cnt > 0) { + pj_status_t status; + unsigned i, cnt = 0; + + for (i=0; iattr_count && cnt<*cand_cnt; ++i) { + a = m->attr[i]; + if (pj_strcmp(&a->name, &STR_CANDIDATE)!=0) + continue; + + /* Parse candidate */ + status = parse_cand("trickle-ice", NULL, &a->value, &cand[cnt]); + if (status != PJ_SUCCESS) { + PJ_PERROR(4,("trickle-ice", status, + "Error in parsing SDP candidate attribute '%.*s', " + "candidate is ignored", + (int)a->value.slen, a->value.ptr)); + continue; + } + ++cnt; + } + *cand_cnt = cnt; + } + + if (end_of_cand) { + a = pjmedia_sdp_attr_find(m->attr_count, m->attr, &STR_END_OF_CAND, + NULL); + if (!a) { + a = pjmedia_sdp_attr_find(sdp->attr_count, sdp->attr, + &STR_END_OF_CAND, NULL); + } + *end_of_cand = (a != NULL); + } + return PJ_SUCCESS; +} + + +/* Generate SDP attributes for trickle ICE in the specified SDP. */ +PJ_DEF(pj_status_t) pjmedia_ice_trickle_encode_sdp( + pj_pool_t *sdp_pool, + pjmedia_sdp_session *sdp, + const pj_str_t *mid, + const pj_str_t *ufrag, + const pj_str_t *passwd, + unsigned cand_cnt, + const pj_ice_sess_cand cand[], + pj_bool_t end_of_cand) +{ + pjmedia_sdp_media *m = NULL; + pjmedia_sdp_attr *a; + unsigned i; + + PJ_ASSERT_RETURN(sdp_pool && sdp, PJ_EINVAL); + + /* Find media by checking "a=mid"*/ + for (i = 0; i < sdp->media_count; ++i) { + m = sdp->media[i]; + a = pjmedia_sdp_media_find_attr2(m, "mid", NULL); + if (a && pj_strcmp(&a->value, mid)==0) + break; + } + + /* Media not exist, try to add it */ + if (i == sdp->media_count) { + if (sdp->media_count >= PJMEDIA_MAX_SDP_MEDIA) { + PJ_LOG(3,(THIS_FILE,"Trickle ICE failed to encode candidates, " + "the specified SDP has too many media")); + return PJ_ETOOMANY; + } + + /* Add a new media to the SDP */ + m = PJ_POOL_ZALLOC_T(sdp_pool, pjmedia_sdp_media); + m->desc.media = pj_str("audio"); + m->desc.fmt_count = 1; + m->desc.fmt[0] = pj_str("0"); + m->desc.transport = pj_str("RTP/AVP"); + sdp->media[sdp->media_count++] = m; + + /* Add media ID attribute "a=mid" */ + a = pjmedia_sdp_attr_create(sdp_pool, "mid", mid); + pjmedia_sdp_attr_add(&m->attr_count, m->attr, a); + } + + /* Add "a=ice-options:trickle" in session level */ + a = pjmedia_sdp_attr_find(sdp->attr_count, sdp->attr, &STR_ICE_OPTIONS, + NULL); + if (!a || !pj_strstr(&a->value, &STR_TRICKLE)) { + a = pjmedia_sdp_attr_create(sdp_pool, STR_ICE_OPTIONS.ptr, + &STR_TRICKLE); + pjmedia_sdp_attr_add(&sdp->attr_count, sdp->attr, a); + } + + /* Add "a=ice-options:trickle" in media level */ + /* + a = pjmedia_sdp_attr_find(m->attr_count, m->attr, &STR_ICE_OPTIONS, + NULL); + if (!a || !pj_strstr(&a->value, &STR_TRICKLE)) { + a = pjmedia_sdp_attr_create(sdp_pool, STR_ICE_OPTIONS.ptr, + &STR_TRICKLE); + pjmedia_sdp_attr_add(&m->attr_count, m->attr, a); + } + */ + + /* Add ice-ufrag & ice-pwd attributes */ + if (ufrag && passwd && + !pjmedia_sdp_attr_find(m->attr_count, m->attr, &STR_ICE_UFRAG, NULL)) + { + a = pjmedia_sdp_attr_create(sdp_pool, STR_ICE_UFRAG.ptr, ufrag); + pjmedia_sdp_attr_add(&m->attr_count, m->attr, a); + + a = pjmedia_sdp_attr_create(sdp_pool, STR_ICE_PWD.ptr, passwd); + pjmedia_sdp_attr_add(&m->attr_count, m->attr, a); + } + + /* Add candidates */ + for (i=0; iattr_count, m->attr, a); + } + + /* Add "a=end-of-candidates" */ + if (end_of_cand) { + a = pjmedia_sdp_attr_find(m->attr_count, m->attr, &STR_END_OF_CAND, + NULL); + if (!a) { + a = pjmedia_sdp_attr_create(sdp_pool, STR_END_OF_CAND.ptr, NULL); + pjmedia_sdp_attr_add(&m->attr_count, m->attr, a); + } + } + + return PJ_SUCCESS; +} + + +PJ_DEF(pj_bool_t) pjmedia_ice_trickle_has_new_cand(pjmedia_transport *tp) +{ + struct transport_ice *tp_ice = (struct transport_ice*)tp; + unsigned i, comp_cnt; + + /* Make sure ICE transport has session already */ + if (!tp_ice->ice_st || !pj_ice_strans_has_sess(tp_ice->ice_st)) + return PJ_FALSE; + + /* Count all local candidates */ + comp_cnt = pj_ice_strans_get_running_comp_cnt(tp_ice->ice_st); + for (i = 0; i < comp_cnt; ++i) { + if (tp_ice->last_send_cand_cnt[i] < + pj_ice_strans_get_cands_count(tp_ice->ice_st, i+1)) + { + return PJ_TRUE; + } + } + return PJ_FALSE; +} + + +/* Add any new local candidates to the specified SDP to be conveyed to + * remote (e.g: via SIP INFO). + */ +PJ_DEF(pj_status_t) pjmedia_ice_trickle_send_local_cand( + pjmedia_transport *tp, + pj_pool_t *sdp_pool, + pjmedia_sdp_session *sdp, + pj_bool_t *p_end_of_cand) +{ + struct transport_ice *tp_ice = (struct transport_ice*)tp; + pj_str_t ufrag, pwd; + pj_ice_sess_cand cand[PJ_ICE_MAX_CAND]; + unsigned cand_cnt, i, comp_cnt; + pj_bool_t end_of_cand; + pj_status_t status; + + PJ_ASSERT_RETURN(tp && sdp_pool && sdp, PJ_EINVAL); + + /* Make sure ICE transport has session already */ + if (!tp_ice->ice_st || !pj_ice_strans_has_sess(tp_ice->ice_st)) + return PJ_EINVALIDOP; + + end_of_cand = tp_ice->end_of_cand; + + /* Get ufrag and pwd from current session */ + pj_ice_strans_get_ufrag_pwd(tp_ice->ice_st, &ufrag, &pwd, NULL, NULL); + + cand_cnt = 0; + comp_cnt = pj_ice_strans_get_running_comp_cnt(tp_ice->ice_st); + for (i = 0; i < comp_cnt; ++i) { + unsigned cnt = PJ_ICE_MAX_CAND - cand_cnt; + + /* Get all local candidates for this comp */ + status = pj_ice_strans_enum_cands(tp_ice->ice_st, i+1, + &cnt, &cand[cand_cnt]); + if (status != PJ_SUCCESS) { + PJ_PERROR(3,(tp_ice->base.name, status, + "Failed enumerating local candidates for comp-id=%d", + i+1)); + continue; + } + cand_cnt += cnt; + + tp_ice->last_send_cand_cnt[i] = cnt; + } + + /* Update the SDP with all local candidates (not just the new ones). + * https://tools.ietf.org/html/draft-ietf-mmusic-trickle-ice-sip-18: + * 4.4. Delivering Candidates in INFO Requests: the agent MUST + * repeat in the INFO request body all candidates that were previously + * sent under the same combination of "a=ice-pwd:" and "a=ice-ufrag:" + * in the same order as they were sent before. + */ + status = pjmedia_ice_trickle_encode_sdp(sdp_pool, sdp, &tp_ice->sdp_mid, + &ufrag, &pwd, cand_cnt, cand, + end_of_cand); + if (status != PJ_SUCCESS) { + PJ_PERROR(3,(tp_ice->base.name, status, + "Failed encoding local candidates to SDP")); + } + + if (p_end_of_cand) + *p_end_of_cand = end_of_cand; + + return PJ_SUCCESS; +} + + /* Disable ICE when SDP from remote doesn't contain a=candidate line */ static void set_no_ice(struct transport_ice *tp_ice, const char *reason, pj_status_t err) @@ -508,7 +891,8 @@ unsigned media_index, unsigned comp_cnt, pj_bool_t restart_session, - pj_bool_t rtcp_mux) + pj_bool_t rtcp_mux, + pj_bool_t trickle) { enum { ATTR_BUF_LEN = 160, /* Max len of a=candidate attr */ @@ -773,6 +1157,28 @@ m->attr[m->attr_count++] = add_attr; } + /* Add trickle ICE attributes */ + if (trickle) { + pj_bool_t end_of_cand; + + /* Add media ID attribute "a=mid" */ + attr = pjmedia_sdp_attr_find2(m->attr_count, m->attr, "mid", NULL); + if (!attr) { + attr = pjmedia_sdp_attr_create(sdp_pool, "mid", &tp_ice->sdp_mid); + pjmedia_sdp_attr_add(&m->attr_count, m->attr, attr); + } + + end_of_cand = tp_ice->end_of_cand; + status = pjmedia_ice_trickle_encode_sdp(sdp_pool, sdp_local, + &tp_ice->sdp_mid, NULL, NULL, + 0, NULL, end_of_cand); + if (status != PJ_SUCCESS) { + PJ_PERROR(3,(tp_ice->base.name, status, + "Failed in adding trickle ICE attributes")); + return status; + } + } + return PJ_SUCCESS; } @@ -799,7 +1205,11 @@ TRACE__((obj_name, "Expecting ICE foundation in candidate")); goto on_return; } - pj_strdup(pool, &cand->foundation, &token); + if (pool) { + pj_strdup(pool, &cand->foundation, &token); + } else { + cand->foundation = token; + } /* Component ID */ found_idx = pj_strtok(orig_input, &delim, &token, found_idx + token.slen); @@ -908,7 +1318,9 @@ /* Encode ICE in SDP */ status = encode_session_in_sdp(tp_ice, sdp_pool, loc_sdp, media_index, tp_ice->comp_cnt, PJ_FALSE, - tp_ice->enable_rtcp_mux); + tp_ice->enable_rtcp_mux, + tp_ice->trickle_ice != + PJ_ICE_SESS_TRICKLE_DISABLED); if (status != PJ_SUCCESS) { set_no_ice(tp_ice, "Error encoding SDP answer", status); return status; @@ -1053,6 +1465,8 @@ */ for (i=0; iattr_count; ++i) { pj_ice_sess_cand cand; + unsigned disable_ice_mismatch = tp_ice->options & + PJMEDIA_ICE_DISABLE_ICE_MISMATCH; if (pj_strcmp(&rem_m->attr[i]->name, &STR_CANDIDATE)!=0) continue; @@ -1068,14 +1482,20 @@ continue; } - if (!comp1_found && cand.comp_id==COMP_RTP && - pj_sockaddr_cmp(&rem_conn_addr, &cand.addr)==0) + if (!comp1_found && cand.comp_id==COMP_RTP) { - comp1_found = PJ_TRUE; - } else if (!comp2_found && cand.comp_id==COMP_RTCP && - pj_sockaddr_cmp(&rtcp_addr, &cand.addr)==0) + if ((disable_ice_mismatch) || + (pj_sockaddr_cmp(&rem_conn_addr, &cand.addr) == 0)) + { + comp1_found = PJ_TRUE; + } + } else if (!comp2_found && cand.comp_id==COMP_RTCP) { - comp2_found = PJ_TRUE; + if ((disable_ice_mismatch) || + (pj_sockaddr_cmp(&rtcp_addr, &cand.addr) == 0)) + { + comp2_found = PJ_TRUE; + } } if (cand.comp_id == COMP_RTCP) @@ -1134,14 +1554,31 @@ } } + /* Check trickle ICE indication */ + if (tp_ice->trickle_ice != PJ_ICE_SESS_TRICKLE_DISABLED) { + sdp_state->has_trickle = pjmedia_ice_sdp_has_trickle(rem_sdp, + media_index); + + /* Reset ICE mismatch flag if conn addr is default address */ + if (sdp_state->ice_mismatch && sdp_state->has_trickle) { + pj_sockaddr def_addr; + pj_sockaddr_init(rem_af, &def_addr, NULL, 9); + if (pj_sockaddr_cmp(&rem_conn_addr, &def_addr)==0) + sdp_state->ice_mismatch = PJ_FALSE; + } + } else { + sdp_state->has_trickle = PJ_FALSE; + } + PJ_LOG(4,(tp_ice->base.name, "Processing SDP: support ICE=%u, common comp_cnt=%u, " - "ice_mismatch=%u, ice_restart=%u, local_role=%s", + "ice_mismatch=%u, ice_restart=%u, local_role=%s, trickle=%u", (sdp_state->match_comp_cnt != 0), sdp_state->match_comp_cnt, sdp_state->ice_mismatch, sdp_state->ice_restart, - pj_ice_sess_role_name(sdp_state->local_role))); + pj_ice_sess_role_name(sdp_state->local_role), + sdp_state->has_trickle)); return PJ_SUCCESS; @@ -1210,6 +1647,7 @@ unsigned media_index) { const pjmedia_sdp_media *rem_m = rem_sdp->media[media_index]; + pj_bool_t with_trickle; pj_status_t status; /* Check if media is removed (just in case) */ @@ -1242,9 +1680,12 @@ } /* Encode ICE in SDP */ + with_trickle = tp_ice->rem_offer_state.has_trickle && + tp_ice->trickle_ice != PJ_ICE_SESS_TRICKLE_DISABLED; status = encode_session_in_sdp(tp_ice, sdp_pool, loc_sdp, media_index, tp_ice->rem_offer_state.match_comp_cnt, - PJ_FALSE, tp_ice->use_rtcp_mux); + PJ_FALSE, tp_ice->use_rtcp_mux, + with_trickle); if (status != PJ_SUCCESS) { set_no_ice(tp_ice, "Error encoding SDP answer", status); return status; @@ -1270,7 +1711,8 @@ comp_cnt = pj_ice_strans_get_running_comp_cnt(tp_ice->ice_st); return encode_session_in_sdp(tp_ice, sdp_pool, loc_sdp, media_index, - comp_cnt, PJ_FALSE, tp_ice->enable_rtcp_mux); + comp_cnt, PJ_FALSE, tp_ice->enable_rtcp_mux, + PJ_FALSE); } @@ -1312,13 +1754,15 @@ status = encode_session_in_sdp(tp_ice, sdp_pool, loc_sdp, media_index, tp_ice->rem_offer_state.match_comp_cnt, tp_ice->rem_offer_state.ice_restart, - tp_ice->use_rtcp_mux); + tp_ice->use_rtcp_mux, PJ_FALSE); if (status != PJ_SUCCESS) return status; /* Done */ } else { + pj_bool_t with_trickle; + /* * Received subsequent offer while we DON'T have ICE active. */ @@ -1346,10 +1790,13 @@ return status; } + with_trickle = tp_ice->rem_offer_state.has_trickle && + tp_ice->trickle_ice != PJ_ICE_SESS_TRICKLE_DISABLED; status = encode_session_in_sdp(tp_ice, sdp_pool, loc_sdp, media_index, tp_ice->rem_offer_state.match_comp_cnt, tp_ice->rem_offer_state.ice_restart, - tp_ice->use_rtcp_mux); + tp_ice->use_rtcp_mux, + with_trickle); if (status != PJ_SUCCESS) return status; @@ -1382,6 +1829,38 @@ tp_ice->oa_role = ROLE_NONE; tp_ice->initial_sdp = PJ_TRUE; + /* Init SDP "a=mid" attribute. Get from remote SDP for answerer or + * generate one for offerer (or if remote doesn't specify). + */ + tp_ice->sdp_mid.slen = 0; + if (rem_sdp) { + pjmedia_sdp_media *m = rem_sdp->media[media_index]; + pjmedia_sdp_attr *a; + a = pjmedia_sdp_attr_find2(m->attr_count, m->attr, "mid", NULL); + if (a) { + pj_strdup(tp_ice->pool, &tp_ice->sdp_mid, &a->value); + } + } + if (tp_ice->sdp_mid.slen == 0) { + char tmp_buf[8]; + pj_ansi_snprintf(tmp_buf, sizeof(tmp_buf), "%d", media_index+1); + tp_ice->sdp_mid = pj_strdup3(tp_ice->pool, tmp_buf); + } + + /* If RTCP mux is being used, set component count to 1 */ + if (rem_sdp && tp_ice->enable_rtcp_mux) { + pjmedia_sdp_media *rem_m = rem_sdp->media[media_index]; + pjmedia_sdp_attr *attr; + attr = pjmedia_sdp_attr_find(rem_m->attr_count, rem_m->attr, + &STR_RTCP_MUX, NULL); + tp_ice->use_rtcp_mux = (attr? PJ_TRUE: PJ_FALSE); + } + if (tp_ice->use_rtcp_mux && + pj_ice_strans_get_running_comp_cnt(tp_ice->ice_st)>1) + { + pj_ice_strans_update_comp_cnt(tp_ice->ice_st, 1); + } + /* Init ICE, the initial role is set now based on availability of * rem_sdp, but it will be checked again later. */ @@ -1389,6 +1868,34 @@ PJ_ICE_SESS_ROLE_CONTROLLED); status = pj_ice_strans_init_ice(tp_ice->ice_st, ice_role, NULL, NULL); + /* For trickle ICE, if remote SDP has been received, process any remote + * ICE info now (ICE user fragment and/or initial ICE candidate list). + */ + if (rem_sdp && status == PJ_SUCCESS) { + if (tp_ice->trickle_ice != PJ_ICE_SESS_TRICKLE_DISABLED && + pjmedia_ice_sdp_has_trickle(rem_sdp, media_index)) + { + pj_str_t ufrag, pwd; + unsigned cand_cnt = PJ_ICE_ST_MAX_CAND; + pj_ice_sess_cand cand[PJ_ICE_ST_MAX_CAND]; + pj_bool_t end_of_cand; + + status = pjmedia_ice_trickle_decode_sdp(rem_sdp, media_index, + NULL, &ufrag, &pwd, + &cand_cnt, cand, + &end_of_cand); + if (status == PJ_SUCCESS) + status = pj_ice_strans_update_check_list( + tp_ice->ice_st, &ufrag, &pwd, + cand_cnt, cand, end_of_cand); + if (status != PJ_SUCCESS) { + PJ_PERROR(1,(tp_ice->base.name, status, + "Failed create checklist for trickling ICE")); + return status; + } + } + } + /* Done */ return status; } @@ -1451,6 +1958,18 @@ tp_ice->oa_role = ROLE_ANSWERER; else tp_ice->oa_role = ROLE_OFFERER; + + if (tp_ice->use_ice) { + /* Update last local candidate count, so trickle ICE can identify + * if there is any new local candidate. + */ + unsigned i, comp_cnt; + comp_cnt = pj_ice_strans_get_running_comp_cnt(tp_ice->ice_st); + for (i = 0; i < comp_cnt; ++i) { + tp_ice->last_send_cand_cnt[i] = + pj_ice_strans_get_cands_count(tp_ice->ice_st, i+1); + } + } } return status; @@ -1706,11 +2225,15 @@ } } - /* Now start ICE */ - status = start_ice(tp_ice, tmp_pool, rem_sdp, media_index); - if (status != PJ_SUCCESS) { - PJ_PERROR(1,(tp_ice->base.name, status, "ICE restart failed!")); - return status; + /* Now start ICE, if not yet (trickle ICE may have started it earlier) */ + if (!pj_ice_strans_sess_is_running(tp_ice->ice_st) && + !pj_ice_strans_sess_is_complete(tp_ice->ice_st)) + { + status = start_ice(tp_ice, tmp_pool, rem_sdp, media_index); + if (status != PJ_SUCCESS) { + PJ_PERROR(1,(tp_ice->base.name, status, "ICE restart failed!")); + return status; + } } /* Done */ @@ -1735,6 +2258,7 @@ { struct transport_ice *tp_ice = (struct transport_ice*)tp; pj_ice_sess_cand cand; + pj_sockaddr_t *addr; pj_status_t status; pj_bzero(&info->sock_info, sizeof(info->sock_info)); @@ -1745,17 +2269,57 @@ if (status != PJ_SUCCESS) return status; - pj_sockaddr_cp(&info->sock_info.rtp_addr_name, &cand.addr); + /* Address of the default candidate may not be available (e.g: + * STUN/TURN address is still being resolved), so let's find address + * of any other candidate, if still not available, the draft RFC + * seems to allow us using "0.0.0.0:9" in SDP. + */ + addr = NULL; + if (pj_sockaddr_has_addr(&cand.addr)) { + addr = &cand.addr; + } else if (pj_ice_strans_has_sess(tp_ice->ice_st)) { + unsigned i, cnt = PJ_ICE_ST_MAX_CAND; + pj_ice_sess_cand cands[PJ_ICE_ST_MAX_CAND]; + pj_ice_strans_enum_cands(tp_ice->ice_st, 1, &cnt, cands); + for (i = 0; i < cnt && !addr; ++i) { + if (pj_sockaddr_has_addr(&cands[i].addr)) + addr = &cands[i].addr; + } + } + if (addr) { + pj_sockaddr_cp(&info->sock_info.rtp_addr_name, addr); + } else { + pj_sockaddr_init(PJ_AF_INET, &info->sock_info.rtp_addr_name, NULL, 9); + } /* Get RTCP default address */ if (tp_ice->use_rtcp_mux) { - pj_sockaddr_cp(&info->sock_info.rtcp_addr_name, &cand.addr); + pj_sockaddr_cp(&info->sock_info.rtcp_addr_name, addr); } else if (tp_ice->comp_cnt > 1) { status = pj_ice_strans_get_def_cand(tp_ice->ice_st, 2, &cand); if (status != PJ_SUCCESS) return status; - pj_sockaddr_cp(&info->sock_info.rtcp_addr_name, &cand.addr); + /* Address of the default candidate may not be available (e.g: + * STUN/TURN address is still being resolved), so let's find address + * of any other candidate. If none is available, SDP must not include + * "a=rtcp" attribute. + */ + addr = NULL; + if (pj_sockaddr_has_addr(&cand.addr)) { + addr = &cand.addr; + } else if (pj_ice_strans_has_sess(tp_ice->ice_st)) { + unsigned i, cnt = PJ_ICE_ST_MAX_CAND; + pj_ice_sess_cand cands[PJ_ICE_ST_MAX_CAND]; + pj_ice_strans_enum_cands(tp_ice->ice_st, 2, &cnt, cands); + for (i = 0; i < cnt && !addr; ++i) { + if (pj_sockaddr_has_addr(&cands[i].addr)) + addr = &cands[i].addr; + } + } + if (addr) { + pj_sockaddr_cp(&info->sock_info.rtcp_addr_name, addr); + } } /* Set remote address originating RTP & RTCP if this transport has @@ -1788,10 +2352,13 @@ ii->active = tp_ice->use_ice; - if (pj_ice_strans_has_sess(tp_ice->ice_st)) + if (pj_ice_strans_has_sess(tp_ice->ice_st)) { ii->role = pj_ice_strans_get_role(tp_ice->ice_st); - else + pj_ice_strans_get_ufrag_pwd(tp_ice->ice_st, &ii->loc_ufrag, NULL, + &ii->rem_ufrag, NULL); + } else { ii->role = PJ_ICE_SESS_ROLE_UNKNOWN; + } ii->sess_state = pj_ice_strans_get_state(tp_ice->ice_st); ii->comp_cnt = pj_ice_strans_get_running_comp_cnt(tp_ice->ice_st); @@ -2096,6 +2663,10 @@ return; } + /* Set the flag indicating that local candidate gathering is completed */ + if (op == PJ_ICE_STRANS_OP_INIT && result == PJ_SUCCESS) + tp_ice->end_of_cand = PJ_TRUE; + pj_perror(5, tp_ice->base.name, result, "ICE operation complete" " (op=%d%s)", op, (op==PJ_ICE_STRANS_OP_INIT? "/initialization" : @@ -2114,6 +2685,31 @@ } } } + + +static void ice_on_new_candidate(pj_ice_strans *ice_st, + const pj_ice_sess_cand *cand, + pj_bool_t last) +{ + struct transport_ice *tp_ice; + ice_listener *il; + + tp_ice = (struct transport_ice*) pj_ice_strans_get_user_data(ice_st); + if (!tp_ice) { + /* Destroy on progress */ + return; + } + + /* Notify application */ + if (tp_ice->cb.on_new_candidate) + (*tp_ice->cb.on_new_candidate)(&tp_ice->base, cand, last); + + for (il=tp_ice->listener.next; il!=&tp_ice->listener; il=il->next) { + if (il->cb.on_new_candidate) { + (*il->cb.on_new_candidate)(&tp_ice->base, cand, last); + } + } +} /* Simulate lost */ diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjmedia/src/pjmedia/transport_loop.c asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjmedia/src/pjmedia/transport_loop.c --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjmedia/src/pjmedia/transport_loop.c 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjmedia/src/pjmedia/transport_loop.c 2022-02-24 07:54:38.000000000 +0000 @@ -28,7 +28,7 @@ #include -struct user +struct tp_user { pj_bool_t rx_disabled; /**< Doesn't want to receive pkt? */ void *user_data; /**< Only valid when attached */ @@ -47,7 +47,7 @@ pj_pool_t *pool; /**< Memory pool */ unsigned user_cnt; /**< Number of attachments */ - struct user users[4]; /**< Array of users. */ + struct tp_user users[4]; /**< Array of users. */ pj_bool_t disable_rx; /**< Disable RX. */ pjmedia_loop_tp_setting setting; /**< Setting. */ @@ -175,7 +175,7 @@ tp = PJ_POOL_ZALLOC_T(pool, struct transport_loop); tp->pool = pool; - pj_ansi_strncpy(tp->base.name, tp->pool->obj_name, PJ_MAX_OBJ_NAME-1); + pj_memcpy(tp->base.name, tp->pool->obj_name, PJ_MAX_OBJ_NAME); tp->base.op = &transport_udp_op; tp->base.type = PJMEDIA_TRANSPORT_TYPE_UDP; diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjmedia/src/pjmedia/transport_srtp.c asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjmedia/src/pjmedia/transport_srtp.c --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjmedia/src/pjmedia/transport_srtp.c 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjmedia/src/pjmedia/transport_srtp.c 2022-02-24 07:54:38.000000000 +0000 @@ -32,6 +32,12 @@ #if defined(PJMEDIA_HAS_SRTP) && (PJMEDIA_HAS_SRTP != 0) +/* Enable this to test ROC initialization setting. For offerer, + * it will send packets with ROC 1 and expect to receive ROC 2. + * For answerer it will be the other way around. + */ +#define TEST_ROC 0 + #if defined(PJ_HAS_SSL_SOCK) && PJ_HAS_SSL_SOCK != 0 && \ (PJ_SSL_SOCK_IMP == PJ_SSL_SOCK_IMP_OPENSSL) # include @@ -302,6 +308,13 @@ */ unsigned keying_pending_cnt; + /* RTP SSRC in receiving direction, used in getting and setting SRTP + * roll over counter (ROC) on SRTP restart. + */ + pj_uint32_t rx_ssrc; + + pj_uint32_t tx_ssrc; + } transport_srtp; @@ -807,6 +820,31 @@ /* + * Get SRTP media transport setting. + */ +PJ_DEF(pj_status_t) pjmedia_transport_srtp_get_setting( + pjmedia_transport *tp, + pjmedia_srtp_setting *opt) +{ + transport_srtp *srtp = (transport_srtp*) tp; + *opt = srtp->setting; + return PJ_SUCCESS; +} + +/* + * Modify SRTP media transport setting. + */ +PJ_DEF(pj_status_t) pjmedia_transport_srtp_modify_setting( + pjmedia_transport *tp, + const pjmedia_srtp_setting *opt) +{ + transport_srtp *srtp = (transport_srtp*) tp; + srtp->setting = *opt; + return PJ_SUCCESS; +} + + +/* * Initialize and start SRTP session with the given parameters. */ PJ_DEF(pj_status_t) pjmedia_transport_srtp_start( @@ -879,8 +917,15 @@ else tx_.rtp.sec_serv = sec_serv_none; tx_.key = (uint8_t*)srtp->tx_key; - tx_.ssrc.type = ssrc_any_outbound; - tx_.ssrc.value = 0; + if (srtp->setting.tx_roc.roc != 0 && + srtp->setting.tx_roc.ssrc != 0) + { + tx_.ssrc.type = ssrc_specific; + tx_.ssrc.value = srtp->setting.tx_roc.ssrc; + } else { + tx_.ssrc.type = ssrc_any_outbound; + tx_.ssrc.value = 0; + } tx_.rtp.cipher_type = crypto_suites[cr_tx_idx].cipher_type; tx_.rtp.cipher_key_len = crypto_suites[cr_tx_idx].cipher_key_len; tx_.rtp.auth_type = crypto_suites[au_tx_idx].auth_type; @@ -894,6 +939,18 @@ status = PJMEDIA_ERRNO_FROM_LIBSRTP(err); goto on_return; } + if (srtp->setting.tx_roc.roc != 0 && + srtp->setting.tx_roc.ssrc != 0) + { + srtp_err_status_t status; + status = srtp_set_stream_roc(srtp->srtp_tx_ctx, + srtp->setting.tx_roc.ssrc, + srtp->setting.tx_roc.roc); + PJ_LOG(4, (THIS_FILE, "Initializing SRTP TX ROC to SSRC %d with " + "ROC %d %s\n", srtp->setting.tx_roc.ssrc, + srtp->setting.tx_roc.roc, + (status == srtp_err_status_ok)? "succeeded": "failed")); + } srtp->tx_policy = *tx; pj_strset(&srtp->tx_policy.key, srtp->tx_key, tx->key.slen); srtp->tx_policy.name=pj_str(crypto_suites[get_crypto_idx(&tx->name)].name); @@ -911,8 +968,15 @@ else rx_.rtp.sec_serv = sec_serv_none; rx_.key = (uint8_t*)srtp->rx_key; - rx_.ssrc.type = ssrc_any_inbound; - rx_.ssrc.value = 0; + if (srtp->setting.rx_roc.roc != 0 && + srtp->setting.rx_roc.ssrc != 0) + { + rx_.ssrc.type = ssrc_specific; + rx_.ssrc.value = srtp->setting.rx_roc.ssrc; + } else { + rx_.ssrc.type = ssrc_any_inbound; + rx_.ssrc.value = 0; + } rx_.rtp.sec_serv = crypto_suites[cr_rx_idx].service; rx_.rtp.cipher_type = crypto_suites[cr_rx_idx].cipher_type; rx_.rtp.cipher_key_len = crypto_suites[cr_rx_idx].cipher_key_len; @@ -928,6 +992,18 @@ status = PJMEDIA_ERRNO_FROM_LIBSRTP(err); goto on_return; } + if (srtp->setting.rx_roc.roc != 0 && + srtp->setting.rx_roc.ssrc != 0) + { + srtp_err_status_t status; + status = srtp_set_stream_roc(srtp->srtp_rx_ctx, + srtp->setting.rx_roc.ssrc, + srtp->setting.rx_roc.roc); + PJ_LOG(4, (THIS_FILE, "Initializing SRTP RX ROC from SSRC %d with " + "ROC %d %s\n", + srtp->setting.rx_roc.ssrc, srtp->setting.rx_roc.roc, + (status == srtp_err_status_ok)? "succeeded": "failed")); + } srtp->rx_policy = *rx; pj_strset(&srtp->rx_policy.key, srtp->rx_key, rx->key.slen); srtp->rx_policy.name=pj_str(crypto_suites[get_crypto_idx(&rx->name)].name); @@ -1038,9 +1114,6 @@ return PJ_SUCCESS; } - /* Reset probation counts */ - srtp->probation_cnt = PROBATION_CNT_INIT; - /* Got policy_local & policy_remote, let's initalize the SRTP */ /* Ticket #1075: media_start() is called whenever media description @@ -1057,6 +1130,9 @@ if (status != PJ_SUCCESS) return status; + /* Reset probation counts */ + srtp->probation_cnt = PROBATION_CNT_INIT; + PJ_LOG(4, (srtp->pool->obj_name, "SRTP started, keying=%s, crypto=%s", ((int)srtp->keying[0]->type==PJMEDIA_SRTP_KEYING_SDES? @@ -1101,6 +1177,26 @@ srtp_info.use = srtp->setting.use; srtp_info.peer_use = srtp->peer_use; + pj_bzero(&srtp_info.tx_roc, sizeof(srtp_info.tx_roc)); + pj_bzero(&srtp_info.rx_roc, sizeof(srtp_info.rx_roc)); + + if (srtp->srtp_rx_ctx && srtp->rx_ssrc != 0) { + srtp_info.rx_roc.ssrc = srtp->rx_ssrc; + srtp_get_stream_roc(srtp->srtp_rx_ctx, srtp->rx_ssrc, + &srtp_info.rx_roc.roc); + } else if (srtp->setting.rx_roc.ssrc != 0) { + srtp_info.rx_roc.ssrc = srtp->setting.rx_roc.ssrc; + srtp_info.rx_roc.roc = srtp->setting.rx_roc.roc; + } + if (srtp->srtp_tx_ctx && srtp->tx_ssrc != 0) { + srtp_info.tx_roc.ssrc = srtp->tx_ssrc; + srtp_get_stream_roc(srtp->srtp_tx_ctx, srtp->tx_ssrc, + &srtp_info.tx_roc.roc); + } else if (srtp->setting.tx_roc.ssrc != 0) { + srtp_info.tx_roc.ssrc = srtp->setting.tx_roc.ssrc; + srtp_info.tx_roc.roc = srtp->setting.tx_roc.roc; + } + spc_info_idx = info->specific_info_cnt++; info->spc_info[spc_info_idx].type = PJMEDIA_TRANSPORT_TYPE_SRTP; info->spc_info[spc_info_idx].cbsize = sizeof(srtp_info); @@ -1203,6 +1299,24 @@ pj_lock_release(srtp->mutex); return PJMEDIA_SRTP_EKEYNOTREADY; } + + /* Save outgoing SSRC */ + srtp->tx_ssrc = ntohl(((pjmedia_rtp_hdr*)pkt)->ssrc); + +#if TEST_ROC + if (srtp->setting.tx_roc.ssrc == 0) { + srtp_err_status_t status; + status = srtp_set_stream_roc(srtp->srtp_tx_ctx, srtp->tx_ssrc, + (srtp->offerer_side? 1: 2)); + if (status == srtp_err_status_ok) { + srtp->setting.tx_roc.ssrc = srtp->tx_ssrc; + srtp->setting.tx_roc.roc = (srtp->offerer_side? 1: 2); + PJ_LOG(4, (THIS_FILE, "Setting TX ROC to SSRC %d to %d", + srtp->tx_ssrc, srtp->setting.tx_roc.roc)); + } + } +#endif + err = srtp_protect(srtp->srtp_tx_ctx, srtp->rtp_tx_buffer, &len); pj_lock_release(srtp->mutex); @@ -1379,9 +1493,30 @@ return; } } + +#if TEST_ROC + if (srtp->setting.rx_roc.ssrc == 0) { + srtp_err_status_t status; + + srtp->rx_ssrc = ntohl(((pjmedia_rtp_hdr*)pkt)->ssrc); + status = srtp_set_stream_roc(srtp->srtp_rx_ctx, srtp->rx_ssrc, + (srtp->offerer_side? 2: 1)); + if (status == srtp_err_status_ok) { + srtp->setting.rx_roc.ssrc = srtp->rx_ssrc; + srtp->setting.rx_roc.roc = (srtp->offerer_side? 2: 1); + + PJ_LOG(4, (THIS_FILE, "Setting RX ROC from SSRC %d to %d", + srtp->rx_ssrc, srtp->setting.rx_roc.roc)); + } else { + PJ_LOG(4, (THIS_FILE, "Setting RX ROC %s", + get_libsrtp_errstr(status))); + } + } +#endif err = srtp_unprotect(srtp->srtp_rx_ctx, (pj_uint8_t*)pkt, &len); - + +#if PJMEDIA_SRTP_CHECK_RTP_SEQ_ON_RESTART if (srtp->probation_cnt > 0 && (err == srtp_err_status_replay_old || err == srtp_err_status_replay_fail)) @@ -1395,6 +1530,11 @@ pjmedia_srtp_crypto tx, rx; pj_status_t status; + /* Stop SRTP first, otherwise srtp_start() will maintain current + * roll-over counter. + */ + pjmedia_transport_srtp_stop((pjmedia_transport*)srtp); + tx = srtp->tx_policy; rx = srtp->rx_policy; status = pjmedia_transport_srtp_start((pjmedia_transport*)srtp, @@ -1406,6 +1546,34 @@ err = srtp_unprotect(srtp->srtp_rx_ctx, (pj_uint8_t*)pkt, &len); } } +#if PJMEDIA_SRTP_CHECK_ROC_ON_RESTART + else +#endif +#endif + +#if PJMEDIA_SRTP_CHECK_ROC_ON_RESTART + if (srtp->probation_cnt > 0 && err == srtp_err_status_auth_fail && + srtp->setting.prev_rx_roc.ssrc != 0 && + srtp->setting.prev_rx_roc.ssrc == srtp->setting.rx_roc.ssrc && + srtp->setting.prev_rx_roc.roc != srtp->setting.rx_roc.roc) + { + unsigned roc, new_roc; + srtp_err_status_t status; + + srtp_get_stream_roc(srtp->srtp_rx_ctx, srtp->setting.rx_roc.ssrc, + &roc); + new_roc = (roc == srtp->setting.rx_roc.roc? + srtp->setting.prev_rx_roc.roc: srtp->setting.rx_roc.roc); + status = srtp_set_stream_roc(srtp->srtp_rx_ctx, + srtp->setting.rx_roc.ssrc, new_roc); + if (status == srtp_err_status_ok) { + PJ_LOG(4, (srtp->pool->obj_name, + "Retrying to unprotect SRTP from ROC %d to new ROC %d", + roc, new_roc)); + err = srtp_unprotect(srtp->srtp_rx_ctx, (pj_uint8_t*)pkt, &len); + } + } +#endif if (err != srtp_err_status_ok) { PJ_LOG(5,(srtp->pool->obj_name, @@ -1415,6 +1583,9 @@ cb = srtp->rtp_cb; cb2 = srtp->rtp_cb2; cb_data = srtp->user_data; + + /* Save SSRC after successful SRTP unprotect */ + srtp->rx_ssrc = ntohl(((pjmedia_rtp_hdr*)pkt)->ssrc); } pj_lock_release(srtp->mutex); @@ -1495,6 +1666,7 @@ pj_bzero(&srtp->rx_policy_neg, sizeof(srtp->rx_policy_neg)); pj_bzero(&srtp->tx_policy_neg, sizeof(srtp->tx_policy_neg)); + srtp->tx_ssrc = srtp->rx_ssrc = 0; srtp->media_option = member_tp_option = options; srtp->offerer_side = (sdp_remote == NULL); diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjmedia/src/pjmedia/transport_srtp_dtls.c asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjmedia/src/pjmedia/transport_srtp_dtls.c --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjmedia/src/pjmedia/transport_srtp_dtls.c 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjmedia/src/pjmedia/transport_srtp_dtls.c 2022-02-24 07:54:38.000000000 +0000 @@ -528,6 +528,9 @@ } SSL_free(ds->ossl_ssl); /* this will also close BIOs */ ds->ossl_ssl = NULL; + /* thus reset the BIOs as well */ + ds->ossl_rbio = NULL; + ds->ossl_wbio = NULL; } /* Destroy SSL context */ @@ -690,6 +693,8 @@ pj_size_t len; pj_status_t status = PJ_SUCCESS; + if (ds->ossl_wbio == NULL) return PJ_EGONE; + /* Check whether there is data to send */ if (BIO_ctrl_pending(ds->ossl_wbio) > 0) { /* Yes, get and send it */ @@ -898,60 +903,97 @@ return PJ_SUCCESS; } - static pj_status_t get_rem_addrs(dtls_srtp *ds, const pjmedia_sdp_session *sdp_remote, - unsigned media_index) + unsigned media_index, + pj_sockaddr *rem_rtp, + pj_sockaddr *rem_rtcp, + pj_bool_t *rtcp_mux) { pjmedia_sdp_media *m_rem = sdp_remote->media[media_index]; pjmedia_sdp_conn *conn; pjmedia_sdp_attr *a; int af = pj_AF_UNSPEC(); + pj_bool_t use_ice_info = PJ_FALSE; + + /* Init RTP & RTCP address */ + pj_bzero(rem_rtp, sizeof(*rem_rtp)); + pj_bzero(rem_rtcp, sizeof(*rem_rtcp)); + + /* If underlying transport is ICE, get remote addresses from ICE */ + if (ds->use_ice) { + pjmedia_transport_info info; + pjmedia_ice_transport_info *ice_info; + + pjmedia_transport_info_init(&info); + pjmedia_transport_get_info(ds->srtp->member_tp, &info); + ice_info = (pjmedia_ice_transport_info*) + pjmedia_transport_info_get_spc_info( + &info, PJMEDIA_TRANSPORT_TYPE_ICE); + if (ice_info) { + *rem_rtp = ice_info->comp[0].rcand_addr; + if (ice_info->comp_cnt > 1) + *rem_rtcp = ice_info->comp[1].rcand_addr; - /* Get RTP address */ - conn = m_rem->conn ? m_rem->conn : sdp_remote->conn; - if (pj_stricmp2(&conn->net_type, "IN")==0) { - if (pj_stricmp2(&conn->addr_type, "IP4")==0) { - af = pj_AF_INET(); - } else if (pj_stricmp2(&conn->addr_type, "IP6")==0) { - af = pj_AF_INET6(); + use_ice_info = PJ_TRUE; } } - if (af != pj_AF_UNSPEC()) { - pj_sockaddr_init(af, &ds->rem_addr, &conn->addr, - m_rem->desc.port); - } else { - return PJ_EAFNOTSUP; - } - /* Get RTCP address. If "rtcp" attribute is present in the SDP, - * set the RTCP address from that attribute. Otherwise, calculate - * from RTP address. - */ - a = pjmedia_sdp_attr_find2(m_rem->attr_count, m_rem->attr, - "rtcp", NULL); - if (a) { - pjmedia_sdp_rtcp_attr rtcp; - pj_status_t status; - status = pjmedia_sdp_attr_get_rtcp(a, &rtcp); - if (status == PJ_SUCCESS) { - if (rtcp.addr.slen) { - pj_sockaddr_init(af, &ds->rem_rtcp, &rtcp.addr, - (pj_uint16_t)rtcp.port); - } else { - pj_sockaddr_init(af, &ds->rem_rtcp, NULL, - (pj_uint16_t)rtcp.port); - pj_memcpy(pj_sockaddr_get_addr(&ds->rem_rtcp), - pj_sockaddr_get_addr(&ds->rem_addr), - pj_sockaddr_get_addr_len(&ds->rem_addr)); + /* Get remote addresses from SDP */ + if (!use_ice_info) { + + /* Get RTP address */ + conn = m_rem->conn ? m_rem->conn : sdp_remote->conn; + if (pj_stricmp2(&conn->net_type, "IN")==0) { + if (pj_stricmp2(&conn->addr_type, "IP4")==0) { + af = pj_AF_INET(); + } else if (pj_stricmp2(&conn->addr_type, "IP6")==0) { + af = pj_AF_INET6(); } } + if (af != pj_AF_UNSPEC()) { + pj_sockaddr_init(af, rem_rtp, &conn->addr, + m_rem->desc.port); + } else { + return PJ_EAFNOTSUP; + } + + /* Get RTCP address. If "rtcp" attribute is present in the SDP, + * set the RTCP address from that attribute. Otherwise, calculate + * from RTP address. + */ + a = pjmedia_sdp_attr_find2(m_rem->attr_count, m_rem->attr, + "rtcp", NULL); + if (a) { + pjmedia_sdp_rtcp_attr rtcp; + pj_status_t status; + status = pjmedia_sdp_attr_get_rtcp(a, &rtcp); + if (status == PJ_SUCCESS) { + if (rtcp.addr.slen) { + pj_sockaddr_init(af, rem_rtcp, &rtcp.addr, + (pj_uint16_t)rtcp.port); + } else { + pj_sockaddr_init(af, rem_rtcp, NULL, + (pj_uint16_t)rtcp.port); + pj_memcpy(pj_sockaddr_get_addr(rem_rtcp), + pj_sockaddr_get_addr(rem_rtp), + pj_sockaddr_get_addr_len(rem_rtp)); + } + } + } + if (!pj_sockaddr_has_addr(rem_rtcp)) { + int rtcp_port; + pj_memcpy(rem_rtcp, rem_rtp, sizeof(pj_sockaddr)); + rtcp_port = pj_sockaddr_get_port(rem_rtp) + 1; + pj_sockaddr_set_port(rem_rtcp, (pj_uint16_t)rtcp_port); + } } - if (!pj_sockaddr_has_addr(&ds->rem_rtcp)) { - int rtcp_port; - pj_memcpy(&ds->rem_rtcp, &ds->rem_addr, sizeof(pj_sockaddr)); - rtcp_port = pj_sockaddr_get_port(&ds->rem_addr) + 1; - pj_sockaddr_set_port(&ds->rem_rtcp, (pj_uint16_t)rtcp_port); + + /* Check if remote indicates the desire to use rtcp-mux in its SDP. */ + if (rtcp_mux) { + a = pjmedia_sdp_attr_find2(m_rem->attr_count, m_rem->attr, + "rtcp-mux", NULL); + *rtcp_mux = (a? PJ_TRUE: PJ_FALSE); } return PJ_SUCCESS; @@ -968,6 +1010,8 @@ char tmp[128]; pj_size_t nwritten; + if (ds->ossl_rbio == NULL) return PJ_EGONE; + nwritten = BIO_write(ds->ossl_rbio, data, (int)len); if (nwritten < len) { /* Error? */ @@ -1235,6 +1279,7 @@ /* As answerer */ dtls_setup last_setup = ds->setup; pj_str_t last_rem_fp = ds->rem_fingerprint; + pj_bool_t rem_addr_changed = PJ_FALSE; /* Parse a=setup and a=fingerprint */ status = parse_setup_finger_attr(ds, PJ_TRUE, sdp_remote, @@ -1247,12 +1292,47 @@ (ds->setup==DTLS_SETUP_ACTIVE? &ID_ACTIVE:&ID_PASSIVE)); pjmedia_sdp_media_add_attr(m_loc, a); + if (last_setup != DTLS_SETUP_UNKNOWN && sdp_remote) { + pj_sockaddr rem_rtp; + pj_sockaddr rem_rtcp; + pj_bool_t use_rtcp_mux; + + status = get_rem_addrs(ds, sdp_remote, media_index, &rem_rtp, + &rem_rtcp, &use_rtcp_mux); + if (status == PJ_SUCCESS) { + if (use_rtcp_mux) { + /* Remote indicates it wants to use rtcp-mux */ + pjmedia_transport_info info; + + pjmedia_transport_info_init(&info); + pjmedia_transport_get_info(ds->srtp->member_tp, &info); + if (pj_sockaddr_cmp(&info.sock_info.rtp_addr_name, + &info.sock_info.rtcp_addr_name)) + { + /* But we do not wish to use rtcp mux */ + use_rtcp_mux = PJ_FALSE; + } + } + if (pj_sockaddr_has_addr(&ds->rem_addr) && + pj_sockaddr_has_addr(&rem_rtp) && + (pj_sockaddr_cmp(&ds->rem_addr, &rem_rtp) || + (!use_rtcp_mux && + pj_sockaddr_has_addr(&ds->rem_rtcp) && + pj_sockaddr_has_addr(&rem_rtcp) && + pj_sockaddr_cmp(&ds->rem_rtcp, &rem_rtcp)))) + { + rem_addr_changed = PJ_TRUE; + } + } + } + /* Check if remote signals DTLS re-nego by changing its - * setup/fingerprint in SDP. + * setup/fingerprint in SDP or media transport address in SDP. */ if ((last_setup != DTLS_SETUP_UNKNOWN && last_setup != ds->setup) || (last_rem_fp.slen && - pj_memcmp(&last_rem_fp, &ds->rem_fingerprint, sizeof(pj_str_t)))) + pj_memcmp(&last_rem_fp, &ds->rem_fingerprint, sizeof(pj_str_t)))|| + (rem_addr_changed)) { ssl_destroy(ds); ds->nego_started = PJ_FALSE; @@ -1306,8 +1386,10 @@ ap.user_data = ds->srtp; pjmedia_transport_get_info(ds->srtp->member_tp, &info); - if (sdp_remote) - get_rem_addrs(ds, sdp_remote, media_index); + if (sdp_remote) { + get_rem_addrs(ds, sdp_remote, media_index, &ds->rem_addr, + &ds->rem_rtcp, NULL); + } if (pj_sockaddr_has_addr(&ds->rem_addr)) { pj_sockaddr_cp(&ap.rem_addr, &ds->rem_addr); @@ -1391,6 +1473,7 @@ pj_ice_strans_state ice_state; pj_bool_t use_rtcp_mux = PJ_FALSE; pj_status_t status = PJ_SUCCESS; + struct transport_srtp *srtp = (struct transport_srtp*)tp->user_data; #if DTLS_DEBUG PJ_LOG(2,(ds->base.name, "dtls_media_start()")); @@ -1446,6 +1529,10 @@ &info, PJMEDIA_TRANSPORT_TYPE_ICE); ds->use_ice = ice_info && ice_info->active; ice_state = ds->use_ice? ice_info->sess_state : 0; + + /* Update remote RTP & RTCP addresses */ + get_rem_addrs(ds, sdp_remote, media_index, &ds->rem_addr, + &ds->rem_rtcp, NULL); } /* Check if the background DTLS nego has completed */ @@ -1472,6 +1559,8 @@ ds->srtp->keying_pending_cnt++; ds->pending_start = PJ_TRUE; + srtp->peer_use = PJMEDIA_SRTP_MANDATORY; + /* If our DTLS setup is ACTIVE: * - start DTLS nego after ICE nego, or * - start it now if there is no ICE. @@ -1492,9 +1581,6 @@ ap.user_data = ds->srtp; /* Attach ourselves to member transport for DTLS nego. */ - if (!pj_sockaddr_has_addr(&ds->rem_addr)) - get_rem_addrs(ds, sdp_remote, media_index); - if (pj_sockaddr_has_addr(&ds->rem_addr)) pj_sockaddr_cp(&ap.rem_addr, &ds->rem_addr); else @@ -1553,6 +1639,16 @@ if (ds->clock) pjmedia_clock_stop(ds->clock); + + /* Reset DTLS state */ + ssl_destroy(ds); + ds->setup = DTLS_SETUP_UNKNOWN; + ds->use_ice = PJ_FALSE; + ds->nego_started = PJ_FALSE; + ds->nego_completed = PJ_FALSE; + ds->got_keys = PJ_FALSE; + ds->rem_fingerprint.slen = 0; + ds->rem_fprint_status = PJ_EPENDING; return PJ_SUCCESS; } diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjmedia/src/pjmedia/transport_srtp_sdes.c asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjmedia/src/pjmedia/transport_srtp_sdes.c --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjmedia/src/pjmedia/transport_srtp_sdes.c 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjmedia/src/pjmedia/transport_srtp_sdes.c 2022-02-24 07:54:38.000000000 +0000 @@ -22,8 +22,11 @@ /* Include OpenSSL libraries for MSVC */ # ifdef _MSC_VER # if (PJ_SSL_SOCK_IMP == PJ_SSL_SOCK_IMP_OPENSSL) +# include # if OPENSSL_VERSION_NUMBER >= 0x10100000L # pragma comment(lib, "libcrypto") +# pragma comment(lib, "libssl") +# pragma comment(lib, "crypt32") # else # pragma comment(lib, "libeay32") # pragma comment(lib, "ssleay32") @@ -647,11 +650,39 @@ srtp->peer_use = PJMEDIA_SRTP_OPTIONAL; } - /* For answerer side, this function will just have to start SRTP as - * SRTP crypto policies have been populated in media_encode_sdp(). + /* For answerer side, SRTP crypto policies have been populated in + * media_encode_sdp(). Check if the key changes on the local SDP. */ - if (!srtp->offerer_side) - return PJ_SUCCESS; + if (!srtp->offerer_side) { + if (srtp->tx_policy_neg.name.slen == 0) + return PJ_SUCCESS; + + /* Get the local crypto. */ + fill_local_crypto(srtp->pool, m_loc, loc_crypto, &loc_cryto_cnt); + + if (loc_cryto_cnt == 0) + return PJ_SUCCESS; + + if ((pj_stricmp(&srtp->tx_policy_neg.name, + &loc_crypto[0].name) == 0) && + (pj_stricmp(&srtp->tx_policy_neg.key, + &loc_crypto[0].key) != 0)) + { + srtp->tx_policy_neg = loc_crypto[0]; + for (i = 0; isetting.crypto_count ;++i) { + if ((pj_stricmp(&srtp->setting.crypto[i].name, + &loc_crypto[0].name) == 0) && + (pj_stricmp(&srtp->setting.crypto[i].key, + &loc_crypto[0].key) != 0)) + { + pj_strdup(pool, &srtp->setting.crypto[i].key, + &loc_crypto[0].key); + } + } + } + + return PJ_SUCCESS; + } /* Check remote media transport & set local media transport * based on SRTP usage option. @@ -717,14 +748,14 @@ return PJMEDIA_SRTP_ECRYPTONOTMATCH; } - /* Find the crypto from the setting. */ - for (j = 0; j < (int)srtp->setting.crypto_count; ++j) { - if (pj_stricmp(&tmp_tx_crypto.name, - &srtp->setting.crypto[j].name) == 0) + /* Find the crypto from the local crypto. */ + for (j = 0; j < (int)loc_cryto_cnt; ++j) { + if (pj_stricmp(&tmp_tx_crypto.name, + &loc_crypto[j].name) == 0) { - srtp->tx_policy_neg = srtp->setting.crypto[j]; + srtp->tx_policy_neg = loc_crypto[j]; break; - } + } } srtp->rx_policy_neg = tmp_tx_crypto; diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjmedia/src/pjmedia/transport_udp.c asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjmedia/src/pjmedia/transport_udp.c --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjmedia/src/pjmedia/transport_udp.c 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjmedia/src/pjmedia/transport_udp.c 2022-02-24 07:54:38.000000000 +0000 @@ -37,6 +37,13 @@ /* Maximum pending write operations */ #define MAX_PENDING 4 +#if 1 +# define TRACE_(expr) +#else +# define TRACE_(expr) PJ_LOG(3,expr) +#endif + + /* Pending write buffer */ typedef struct pending_write { @@ -288,7 +295,6 @@ pj_pool_t *pool; pj_ioqueue_t *ioqueue; pj_ioqueue_callback rtp_cb, rtcp_cb; - unsigned i; pj_status_t status; @@ -356,6 +362,7 @@ if (status != PJ_SUCCESS) goto on_error; +#if 0 // See #2097: move read op kick-off to media_start() pj_ioqueue_op_key_init(&tp->rtp_read_op, sizeof(tp->rtp_read_op)); for (i=0; irtp_pending_write); ++i) { tp->rtp_pending_write[i].is_pending = PJ_FALSE; @@ -363,7 +370,6 @@ sizeof(tp->rtp_pending_write[i].op_key)); } -#if 0 // See #2097: move read op kick-off to media_start() /* Kick of pending RTP read from the ioqueue */ tp->rtp_addrlen = sizeof(tp->rtp_src_addr); size = sizeof(tp->rtp_pkt); @@ -388,11 +394,10 @@ if (status != PJ_SUCCESS) goto on_error; +#if 0 // See #2097: move read op kick-off to media_start() pj_ioqueue_op_key_init(&tp->rtcp_read_op, sizeof(tp->rtcp_read_op)); pj_ioqueue_op_key_init(&tp->rtcp_write_op, sizeof(tp->rtcp_write_op)); - -#if 0 // See #2097: move read op kick-off to media_start() /* Kick of pending RTCP read from the ioqueue */ size = sizeof(tp->rtcp_pkt); tp->rtcp_addr_len = sizeof(tp->rtcp_src_addr); @@ -451,6 +456,7 @@ udp->rtcp_sock = PJ_INVALID_SOCKET; } + PJ_LOG(4,(udp->base.name, "UDP media transport destroyed")); pj_pool_release(udp->pool); return PJ_SUCCESS; @@ -511,11 +517,16 @@ PJ_UNUSED_ARG(op_key); - if (-bytes_read == PJ_ECANCELLED) return; - udp = (struct transport_udp*) pj_ioqueue_get_user_data(key); + if (-bytes_read == PJ_ECANCELLED) { + TRACE_((udp->base.name, "on_rx_rtp(): got PJ_ECANCELLED")); + return; + } + if (-bytes_read == PJ_ESOCKETSTOP) { + TRACE_((udp->base.name, "on_rx_rtp(): got PJ_ESOCKETSTOP")); + /* Try to recover by restarting the transport. */ status = transport_restart(PJ_TRUE, udp); if (status != PJ_SUCCESS) { @@ -620,6 +631,7 @@ } } bytes_read = -status; + TRACE_((udp->base.name, "on_rx_rtp(): recvfrom error=%d", status)); } } while (status != PJ_EPENDING && status != PJ_ECANCELLED && udp->started); @@ -657,11 +669,16 @@ PJ_UNUSED_ARG(op_key); - if (-bytes_read == PJ_ECANCELLED) return; - udp = (struct transport_udp*) pj_ioqueue_get_user_data(key); + if (-bytes_read == PJ_ECANCELLED) { + TRACE_((udp->base.name, "on_rx_rtcp(): got PJ_ECANCELLED")); + return; + } + if (-bytes_read == PJ_ESOCKETSTOP) { + TRACE_((udp->base.name, "on_rx_rtcp(): got PJ_ESOCKETSTOP")); + /* Try to recover by restarting the transport. */ status = transport_restart(PJ_FALSE, udp); if (status != PJ_SUCCESS) { @@ -740,6 +757,7 @@ } } bytes_read = -status; + TRACE_((udp->base.name, "on_rx_rtcp(): recvfrom error=%d", status)); } } while (status != PJ_EPENDING && status != PJ_ECANCELLED && udp->started); @@ -806,12 +824,16 @@ udp->use_rtcp_mux = (pj_sockaddr_has_addr(rem_addr) && pj_sockaddr_cmp(rem_addr, rem_rtcp) == 0); + TRACE_((udp->base.name, "attach(): before locking keys")); + /* Lock the ioqueue keys to make sure that callbacks are * not executed. See ticket #844 for details. */ pj_ioqueue_lock_key(udp->rtp_key); pj_ioqueue_lock_key(udp->rtcp_key); + TRACE_((udp->base.name, "attach(): inside locked keys")); + /* "Attach" the application: */ rem_addr_len = sizeof(pj_sockaddr); @@ -912,6 +934,8 @@ pj_ioqueue_unlock_key(udp->rtcp_key); pj_ioqueue_unlock_key(udp->rtp_key); + PJ_LOG(4,(udp->base.name, "UDP media transport attached")); + return PJ_SUCCESS; } @@ -956,14 +980,17 @@ //if (udp->attached) { if (1) { - int i; - /* Lock the ioqueue keys to make sure that callbacks are * not executed. See ticket #460 for details. */ + + TRACE_((udp->base.name, "detach(): before locking keys")); + pj_ioqueue_lock_key(udp->rtp_key); pj_ioqueue_lock_key(udp->rtcp_key); + TRACE_((udp->base.name, "detach(): inside locked keys")); + /* User data is unreferenced on Release build */ PJ_UNUSED_ARG(user_data); @@ -979,17 +1006,18 @@ udp->rtcp_cb = NULL; udp->user_data = NULL; - /* Cancel any outstanding send */ - for (i=0; irtp_pending_write); ++i) { - pj_ioqueue_post_completion(udp->rtp_key, - &udp->rtp_pending_write[i].op_key, 0); - udp->rtp_pending_write[i].is_pending = PJ_FALSE; - } - pj_ioqueue_post_completion(udp->rtcp_key, &udp->rtcp_write_op, 0); + /* Cancel any outstanding operations */ + pj_ioqueue_clear_key(udp->rtp_key); + pj_ioqueue_clear_key(udp->rtcp_key); + + /* Set key status to 'stopped' as keys have been cleared */ + udp->started = PJ_FALSE; /* Unlock keys */ pj_ioqueue_unlock_key(udp->rtcp_key); pj_ioqueue_unlock_key(udp->rtp_key); + + PJ_LOG(4,(udp->base.name, "UDP media transport detached")); } } @@ -1120,6 +1148,8 @@ PJ_UNUSED_ARG(sdp_remote); PJ_UNUSED_ARG(media_index); + PJ_LOG(4,(udp->base.name, "UDP media transport created")); + return PJ_SUCCESS; } @@ -1200,6 +1230,7 @@ return PJ_SUCCESS; } + static pj_status_t transport_media_start(pjmedia_transport *tp, pj_pool_t *pool, const pjmedia_sdp_session *sdp_local, @@ -1209,6 +1240,7 @@ struct transport_udp *udp = (struct transport_udp*)tp; pj_ssize_t size; pj_status_t status; + unsigned i; PJ_ASSERT_RETURN(tp, PJ_EINVAL); @@ -1218,8 +1250,21 @@ PJ_UNUSED_ARG(media_index); /* Just return success if there is already pending read */ - if (udp->started) + if (udp->started) { + PJ_LOG(5,(udp->base.name, "UDP media transport already started")); return PJ_SUCCESS; + } + + pj_ioqueue_op_key_init(&udp->rtp_read_op, sizeof(udp->rtp_read_op)); + for (i=0; irtp_pending_write); ++i) { + pj_ioqueue_op_key_init(&udp->rtp_pending_write[i].op_key, + sizeof(udp->rtp_pending_write[i].op_key)); + } + + pj_ioqueue_op_key_init(&udp->rtcp_read_op, sizeof(udp->rtcp_read_op)); + pj_ioqueue_op_key_init(&udp->rtcp_write_op, sizeof(udp->rtcp_write_op)); + + TRACE_((udp->base.name, "media_start(): before recvfrom RTP")); /* Kick off pending RTP read from the ioqueue */ udp->rtp_addrlen = sizeof(udp->rtp_src_addr); @@ -1227,8 +1272,13 @@ status = pj_ioqueue_recvfrom(udp->rtp_key, &udp->rtp_read_op, udp->rtp_pkt, &size, PJ_IOQUEUE_ALWAYS_ASYNC, &udp->rtp_src_addr, &udp->rtp_addrlen); - if (status != PJ_EPENDING) + if (status != PJ_EPENDING) { + PJ_PERROR(3, (udp->base.name, status, + "media_start(): recvfrom RTP failed")); return status; + } + + TRACE_((udp->base.name, "media_start(): before recvfrom RTCP")); /* Kick off pending RTCP read from the ioqueue */ udp->rtcp_addr_len = sizeof(udp->rtcp_src_addr); @@ -1237,11 +1287,17 @@ udp->rtcp_pkt, &size, PJ_IOQUEUE_ALWAYS_ASYNC, &udp->rtcp_src_addr, &udp->rtcp_addr_len); - if (status != PJ_EPENDING) + if (status != PJ_EPENDING) { + PJ_PERROR(3, (udp->base.name, status, + "media_start(): recvfrom RTCP failed")); + pj_ioqueue_clear_key(udp->rtp_key); return status; + } udp->started = PJ_TRUE; + PJ_LOG(4,(udp->base.name, "UDP media transport started")); + return PJ_SUCCESS; } @@ -1252,17 +1308,18 @@ PJ_ASSERT_RETURN(tp, PJ_EINVAL); /* Just return success if there is no pending read */ - if (!udp->started) + if (!udp->started) { + PJ_LOG(5, (udp->base.name, "UDP media transport already stopped")); return PJ_SUCCESS; + } - pj_ioqueue_post_completion(udp->rtp_key, &udp->rtp_read_op, - -PJ_ECANCELLED); - - pj_ioqueue_post_completion(udp->rtcp_key, &udp->rtcp_read_op, - -PJ_ECANCELLED); + pj_ioqueue_clear_key(udp->rtp_key); + pj_ioqueue_clear_key(udp->rtcp_key); udp->started = PJ_FALSE; + PJ_LOG(4, (udp->base.name, "UDP media transport stopped")); + return PJ_SUCCESS; } @@ -1286,6 +1343,24 @@ static pj_status_t transport_restart(pj_bool_t is_rtp, struct transport_udp *udp) { + PJ_UNUSED_ARG(udp); + PJ_UNUSED_ARG(is_rtp); + + return PJ_ENOTSUP; + +/* This code is disabled for the following reason (see also #2881): + * The following code will set ioqueue key to NULL or replace with a new one, + * and that may introduces issues, e.g: + * - this code is invoked from on_rx_rtp/rtcp(), which is invoked by + * ioqueue_dispatch_read_event(), which may need to unlock ioqueue key + * after returning from the callback (when allow_concurrent is false), + * if the ioqueue key has been unregistered by this code, a crash may occur + * when unlocking the invalid ioqueue key. + * - this code may set ioqueue key to NULL, while other code may assume + * it may never be changed to NULL, and cause crash, e.g: transport_detach(). + */ +#if 0 + pj_ioqueue_key_t *key = (is_rtp ? udp->rtp_key : udp->rtcp_key); pj_sock_t *sock = (is_rtp ? &udp->rtp_sock : &udp->rtcp_sock); pj_status_t status; @@ -1390,4 +1465,6 @@ PJ_PERROR(1, (udp->base.name, status, "Error restarting %s transport", (is_rtp)?"RTP":"RTCP")); return status; + +#endif } diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjmedia/src/pjmedia/vid_conf.c asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjmedia/src/pjmedia/vid_conf.c --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjmedia/src/pjmedia/vid_conf.c 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjmedia/src/pjmedia/vid_conf.c 2022-02-24 07:54:38.000000000 +0000 @@ -36,6 +36,9 @@ */ #define AUTO_STOP_CLOCK 0 +/* Maximum number of consecutive errors that will only be printed once. */ +#define MAX_ERR_COUNT 150 + /* Clockrate for video timestamp unit */ #define TS_CLOCK_RATE 90000 @@ -84,10 +87,12 @@ unsigned idx; /**< Port index. */ pj_str_t name; /**< Port name. */ pjmedia_port *port; /**< Video port. */ + pjmedia_format format; /**< Copy of port format info. */ pj_uint32_t ts_interval; /**< Port put/get interval. */ pj_timestamp ts_next; /**< Time for next put/get_frame(). */ void *get_buf; /**< Buffer for get_frame(). */ pj_size_t get_buf_size; /**< Buffer size for get_frame(). */ + pj_bool_t got_frame; /**< Last get_frame() got frame? */ void *put_buf; /**< Buffer for put_frame(). */ pj_size_t put_buf_size; /**< Buffer size for put_frame(). */ @@ -99,6 +104,9 @@ pj_pool_t **render_pool; /**< Array of pool for render state */ render_state **render_states; /**< Array of render_state (one for each transmitter). */ + + pj_status_t last_err; /**< Last error status. */ + unsigned last_err_cnt; /**< Last error count. */ } vconf_port; @@ -263,6 +271,7 @@ /* Set pool, port, index, and name */ cport->pool = pool; cport->port = port; + cport->format = port->info.fmt; cport->idx = index; pj_strdup_with_null(pool, &cport->name, name); @@ -296,6 +305,7 @@ PJ_LOG(4,(THIS_FILE, "pjmedia_vid_conf_add_port(): " "unrecognized format %04X", port->info.fmt.id)); + pj_mutex_unlock(vid_conf->mutex); return PJMEDIA_EBADFMT; } @@ -306,6 +316,7 @@ PJ_LOG(4,(THIS_FILE, "pjmedia_vid_conf_add_port(): " "Failed to apply format %04X", port->info.fmt.id)); + pj_mutex_unlock(vid_conf->mutex); return status; } if (port->put_frame) { @@ -323,28 +334,41 @@ pj_pool_zalloc(pool, vid_conf->opt.max_slot_cnt * sizeof(unsigned)); - PJ_ASSERT_RETURN(cport->listener_slots, PJ_ENOMEM); + if (!cport->listener_slots) { + pj_mutex_unlock(vid_conf->mutex); + return PJ_ENOMEM; + } /* Create transmitter array */ cport->transmitter_slots = (unsigned*) pj_pool_zalloc(pool, vid_conf->opt.max_slot_cnt * - sizeof(unsigned)); - PJ_ASSERT_RETURN(cport->transmitter_slots, PJ_ENOMEM); + sizeof(unsigned)); + if (!cport->transmitter_slots) { + pj_mutex_unlock(vid_conf->mutex); + return PJ_ENOMEM; + } /* Create pointer-to-render_state array */ cport->render_states = (render_state**) pj_pool_zalloc(pool, vid_conf->opt.max_slot_cnt * sizeof(render_state*)); - PJ_ASSERT_RETURN(cport->render_states, PJ_ENOMEM); + + if (!cport->render_states) { + pj_mutex_unlock(vid_conf->mutex); + return PJ_ENOMEM; + } /* Create pointer-to-render-pool array */ cport->render_pool = (pj_pool_t**) pj_pool_zalloc(pool, vid_conf->opt.max_slot_cnt * - sizeof(pj_pool_t*)); - PJ_ASSERT_RETURN(cport->render_pool, PJ_ENOMEM); + sizeof(pj_pool_t*)); + if (!cport->render_pool) { + pj_mutex_unlock(vid_conf->mutex); + return PJ_ENOMEM; + } /* Register the conf port. */ vid_conf->ports[index] = cport; @@ -412,6 +436,7 @@ status = pjmedia_clock_stop(vid_conf->clock); if (status != PJ_SUCCESS) { PJ_PERROR(4, (THIS_FILE, status, "Failed to stop clock")); + pj_mutex_unlock(vid_conf->mutex); return status; } } @@ -552,6 +577,7 @@ status = pjmedia_clock_start(vid_conf->clock); if (status != PJ_SUCCESS) { PJ_PERROR(4, (THIS_FILE, status, "Failed to start clock")); + pj_mutex_unlock(vid_conf->mutex); return status; } } @@ -608,10 +634,9 @@ break; } - if (i != src_port->listener_cnt) { + if (i != src_port->listener_cnt && j != dst_port->transmitter_cnt) { unsigned k; - pj_assert(j != dst_port->transmitter_cnt); pj_assert(src_port->listener_cnt > 0 && src_port->listener_cnt < vid_conf->opt.max_slot_cnt); pj_assert(dst_port->transmitter_cnt > 0 && @@ -642,6 +667,7 @@ status = pjmedia_clock_stop(vid_conf->clock); if (status != PJ_SUCCESS) { PJ_PERROR(4, (THIS_FILE, status, "Failed to stop clock")); + pj_mutex_unlock(vid_conf->mutex); return status; } } @@ -681,7 +707,7 @@ ciport_cnt; ++i) { unsigned j; - pj_bool_t got_frame = PJ_FALSE; + pj_bool_t frame_rendered = PJ_FALSE; pj_bool_t ts_incremented = PJ_FALSE; vconf_port *sink = vid_conf->ports[i]; @@ -707,8 +733,14 @@ if (ts_diff < 0 || ts_diff > TS_CLOCK_RATE) continue; - /* Clean up sink put buffer (should we draw black instead?) */ - //pj_bzero(sink->put_buf, sink->put_buf_size); + /* There is a possibility that the sink port's format has + * changed, but we haven't received the event yet. + */ + if (pj_memcmp(&sink->format, &sink->port->info.fmt, + sizeof(pjmedia_format))) + { + pjmedia_vid_conf_update_port(vid_conf, i); + } /* Iterate transmitters of this sink port */ for (j=0; j < sink->transmitter_cnt; ++j) { @@ -735,8 +767,11 @@ status = pjmedia_port_get_frame(src->port, &frame); if (status != PJ_SUCCESS) { PJ_PERROR(5, (THIS_FILE, status, - "Failed to get frame from port [%s]!", - src->port->info.name.ptr)); + "Failed to get frame from port %d [%s]!", + src->idx, src->port->info.name.ptr)); + src->got_frame = PJ_FALSE; + } else { + src->got_frame = (frame.size == src->get_buf_size); } /* Update next src put/get */ @@ -744,18 +779,21 @@ ts_incremented = src==sink; } - /* Render src get buffer to sink put buffer (based on sink layout - * settings, if any) - */ - status = render_src_frame(src, sink, j); - if (status != PJ_SUCCESS) { - PJ_PERROR(5, (THIS_FILE, status, - "Failed to render frame from port [%s] to [%s]", - src->port->info.name.ptr, - sink->port->info.name.ptr)); + if (src->got_frame) { + /* Render src get buffer to sink put buffer (based on + * sink layout settings, if any) + */ + status = render_src_frame(src, sink, j); + if (status == PJ_SUCCESS) { + frame_rendered = PJ_TRUE; + } else { + PJ_PERROR(5, (THIS_FILE, status, + "Failed to render frame from port %d [%s] " + "to port %d [%s]", + src->idx, src->port->info.name.ptr, + sink->idx, sink->port->info.name.ptr)); + } } - - got_frame = PJ_TRUE; } /* Call sink->put_frame() @@ -766,15 +804,27 @@ pj_bzero(&frame, sizeof(frame)); frame.type = PJMEDIA_FRAME_TYPE_VIDEO; frame.timestamp = *now; - if (got_frame) { + if (frame_rendered) { frame.buf = sink->put_buf; frame.size = sink->put_buf_size; } status = pjmedia_port_put_frame(sink->port, &frame); - if (status != PJ_SUCCESS) { - PJ_PERROR(5, (THIS_FILE, status, - "Failed to put frame to port [%s]!", - sink->port->info.name.ptr)); + if (frame_rendered && status != PJ_SUCCESS) { + sink->last_err_cnt++; + if (sink->last_err != status || + sink->last_err_cnt % MAX_ERR_COUNT == 0) + { + if (sink->last_err != status) + sink->last_err_cnt = 1; + sink->last_err = status; + PJ_PERROR(5, (THIS_FILE, status, + "Failed (%d time(s)) to put frame to port %d" + " [%s]!", sink->last_err_cnt, + sink->idx, sink->port->info.name.ptr)); + } + } else { + sink->last_err = status; + sink->last_err_cnt = 0; } /* Update next put/get, careful that it may have been updated @@ -838,6 +888,7 @@ } } + /* This function will do: * - Recalculate layout setting, i.e: get video pos and size * for each transmitter @@ -852,6 +903,31 @@ unsigned i; pj_status_t status; + fmt_id = cp->port->info.fmt.id; + size = cp->port->info.fmt.det.vid.size; + + /* Initialize sink buffer with black color. */ + if (cp->port->put_frame) { + status = pjmedia_video_format_fill_black(&cp->port->info.fmt, + cp->put_buf, + cp->put_buf_size); + if (status != PJ_SUCCESS) { + PJ_PERROR(4,(THIS_FILE, status, + "Warning: failed to init sink buffer with black")); + } + } + + /* Initialize source buffer with black color. */ + if (cp->port->get_frame) { + status = pjmedia_video_format_fill_black(&cp->port->info.fmt, + cp->get_buf, + cp->get_buf_size); + if (status != PJ_SUCCESS) { + PJ_PERROR(4,(THIS_FILE, status, + "Warning: failed to init source buffer with black")); + } + } + /* Nothing to render, just return */ if (cp->transmitter_cnt == 0) return; @@ -859,8 +935,6 @@ TRACE_((THIS_FILE, "Updating render state for port id %d (%d sources)..", cp->idx, cp->transmitter_cnt)); - fmt_id = cp->port->info.fmt.id; - size = cp->port->info.fmt.det.vid.size; for (i = 0; i < cp->transmitter_cnt; ++i) { vconf_port *tr = vid_conf->ports[cp->transmitter_slots[i]]; @@ -1031,9 +1105,19 @@ pj_status_t status; render_state *rs = sink->render_states[transmitter_idx]; + /* There is a possibility that the sink port's format has + * changed, but we haven't received the event yet. + */ + if (pj_memcmp(&sink->format, &sink->port->info.fmt, + sizeof(pjmedia_format))) + { + return PJMEDIA_EVID_BADFORMAT; + } + if (sink->transmitter_cnt == 1 && (!rs || !rs->converter)) { /* The only transmitter and no conversion needed */ - pj_assert(src->get_buf_size <= sink->put_buf_size); + if (src->get_buf_size != sink->put_buf_size) + return PJMEDIA_EVID_BADFORMAT; pj_memcpy(sink->put_buf, src->get_buf, src->get_buf_size); } else if (rs && rs->converter) { pjmedia_frame src_frame, dst_frame; @@ -1065,6 +1149,122 @@ return PJ_SUCCESS; } + + +/* Update or refresh port states from video port info. */ +PJ_DEF(pj_status_t) pjmedia_vid_conf_update_port( pjmedia_vid_conf *vid_conf, + unsigned slot) +{ + vconf_port *cport; + pjmedia_format old_fmt; + pjmedia_format new_fmt; + + PJ_ASSERT_RETURN(vid_conf && slotopt.max_slot_cnt, PJ_EINVAL); + + pj_mutex_lock(vid_conf->mutex); + + /* Port must be valid. */ + cport = vid_conf->ports[slot]; + if (cport == NULL) { + pj_mutex_unlock(vid_conf->mutex); + return PJ_EINVAL; + } + + /* Get the old & new formats */ + old_fmt = cport->format; + new_fmt = cport->port->info.fmt; + + /* Update put/get_frame() intervals */ + if (pj_memcmp(&new_fmt.det.vid.fps, &old_fmt.det.vid.fps, + sizeof(pjmedia_ratio))) + { + pjmedia_ratio *fps = &new_fmt.det.vid.fps; + pj_uint32_t vconf_interval = (pj_uint32_t) + (TS_CLOCK_RATE * 1.0 / + vid_conf->opt.frame_rate); + cport->ts_interval = (pj_uint32_t)(TS_CLOCK_RATE * 1.0 / + fps->num * fps->denum); + + /* Normalize the interval */ + if (cport->ts_interval < vconf_interval) { + cport->ts_interval = vconf_interval; + PJ_LOG(3,(THIS_FILE, "Warning: frame rate of port %s is higher " + "than video conference bridge (%d > %d)", + cport->name.ptr, (int)(fps->num/fps->denum), + vid_conf->opt.frame_rate)); + } + + PJ_LOG(4,(THIS_FILE, + "Port %d (%s): updated frame rate %d -> %d", + slot, cport->name.ptr, + (int)(old_fmt.det.vid.fps.num/old_fmt.det.vid.fps.denum), + (int)(fps->num/fps->denum))); + } + + /* Update buffer for put/get_frame() */ + if (new_fmt.id != old_fmt.id || + pj_memcmp(&new_fmt.det.vid.size, &old_fmt.det.vid.size, + sizeof(pjmedia_rect_size))) + { + const pjmedia_video_format_info *vfi; + pjmedia_video_apply_fmt_param vafp; + pj_status_t status; + unsigned i; + + vfi = pjmedia_get_video_format_info(NULL, new_fmt.id); + if (!vfi) { + PJ_LOG(1,(THIS_FILE, "pjmedia_vid_conf_update_port(): " + "unrecognized format %04X", + new_fmt.id)); + pj_mutex_unlock(vid_conf->mutex); + return PJMEDIA_EBADFMT; + } + + pj_bzero(&vafp, sizeof(vafp)); + vafp.size = new_fmt.det.vid.size; + status = (*vfi->apply_fmt)(vfi, &vafp); + if (status != PJ_SUCCESS) { + PJ_LOG(1,(THIS_FILE, "pjmedia_vid_conf_update_port(): " + "Failed to apply format %04X", + new_fmt.id)); + pj_mutex_unlock(vid_conf->mutex); + return status; + } + if (cport->port->put_frame) { + if (cport->put_buf_size < vafp.framebytes) + cport->put_buf = pj_pool_zalloc(cport->pool, vafp.framebytes); + cport->put_buf_size = vafp.framebytes; + } + if (cport->port->get_frame) { + if (cport->get_buf_size < vafp.framebytes) + cport->get_buf = pj_pool_zalloc(cport->pool, vafp.framebytes); + cport->get_buf_size = vafp.framebytes; + cport->got_frame = PJ_FALSE; + } + + /* Update render state */ + update_render_state(vid_conf, cport); + + /* Update render state of listeners */ + for (i=0; i < cport->listener_cnt; ++i) { + vconf_port *sink = vid_conf->ports[cport->listener_slots[i]]; + update_render_state(vid_conf, sink); + } + + PJ_LOG(4,(THIS_FILE, + "Port %d (%s): updated frame size %dx%d -> %dx%d", + slot, cport->name.ptr, + old_fmt.det.vid.size.w, old_fmt.det.vid.size.h, + new_fmt.det.vid.size.w, new_fmt.det.vid.size.h)); + } + + + /* Update cport format info */ + cport->format = new_fmt; + pj_mutex_unlock(vid_conf->mutex); + + return PJ_SUCCESS; +} #endif /* PJMEDIA_HAS_VIDEO */ diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjmedia/src/pjmedia/vid_port.c asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjmedia/src/pjmedia/vid_port.c --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjmedia/src/pjmedia/vid_port.c 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjmedia/src/pjmedia/vid_port.c 2022-02-24 07:54:38.000000000 +0000 @@ -111,6 +111,7 @@ pjmedia_frame *frm_buf; pj_size_t frm_buf_size; pj_mutex_t *frm_mutex; + pj_size_t src_size; }; struct vid_pasv_port @@ -184,6 +185,12 @@ static pj_status_t create_converter(pjmedia_vid_port *vp) { + pj_status_t status; + pjmedia_video_apply_fmt_param vafp; + + status = get_vfi(&vp->conv.conv_param.src, NULL, &vafp); + vp->src_size = vafp.framebytes; + if (vp->conv.conv) { pjmedia_converter_destroy(vp->conv.conv); vp->conv.conv = NULL; @@ -196,8 +203,6 @@ (vp->conv.conv_param.src.det.vid.size.h != vp->conv.conv_param.dst.det.vid.size.h)) { - pj_status_t status; - /* Yes, we need converter */ status = pjmedia_converter_create(NULL, vp->pool, &vp->conv.conv_param, &vp->conv.conv); @@ -210,9 +215,6 @@ if (vp->conv.conv || (vp->role==ROLE_ACTIVE && (vp->dir & PJMEDIA_DIR_ENCODING))) { - pj_status_t status; - pjmedia_video_apply_fmt_param vafp; - /* Allocate buffer for conversion */ status = get_vfi(&vp->conv.conv_param.dst, NULL, &vafp); if (status != PJ_SUCCESS) @@ -670,6 +672,15 @@ vp->frm_buf->size = vp->frm_buf_size; vp->frm_buf->type = PJMEDIA_FRAME_TYPE_NONE; + /* Initialize buffer with black color */ + status = pjmedia_video_format_fill_black(&vp->conv.conv_param.src, + vp->frm_buf->buf, + vp->frm_buf_size); + if (status != PJ_SUCCESS) { + PJ_PERROR(4,(THIS_FILE, status, + "Warning: failed to init buffer with black")); + } + status = pj_mutex_create_simple(pool, vp->dev_name.ptr, &vp->frm_mutex); if (status != PJ_SUCCESS) @@ -742,6 +753,18 @@ return pjmedia_event_subscribe(NULL, &client_port_event_cb, vp, port); } + +PJ_DEF(pj_status_t) pjmedia_vid_port_unsubscribe_event( + pjmedia_vid_port *vp, + pjmedia_port *port) +{ + PJ_ASSERT_RETURN(vp && port, PJ_EINVAL); + + /* Unsubscribe to port's events */ + return pjmedia_event_unsubscribe(NULL, &client_port_event_cb, vp, port); +} + + PJ_DEF(pj_status_t) pjmedia_vid_port_connect(pjmedia_vid_port *vp, pjmedia_port *port, pj_bool_t destroy) @@ -783,40 +806,19 @@ PJ_ASSERT_RETURN(vp, PJ_EINVAL); + /* Initialize buffer with black color */ + status = pjmedia_video_format_fill_black(&vp->conv.conv_param.src, + vp->frm_buf->buf, + vp->frm_buf_size); + if (status != PJ_SUCCESS) { + PJ_PERROR(4,(THIS_FILE, status, + "Warning: failed to init buffer with black")); + } + status = pjmedia_vid_dev_stream_start(vp->strm); if (status != PJ_SUCCESS) goto on_error; - /* Initialize buffer with black color */ - { - const pjmedia_video_format_info *vfi; - const pjmedia_format *fmt; - pjmedia_video_apply_fmt_param vafp; - pjmedia_frame frame; - - pj_bzero(&frame, sizeof(pjmedia_frame)); - frame.buf = vp->frm_buf->buf; - frame.size = vp->frm_buf_size; - - fmt = &vp->conv.conv_param.src; - status = get_vfi(fmt, &vfi, &vafp); - if (status == PJ_SUCCESS && frame.buf) { - frame.type = PJMEDIA_FRAME_TYPE_VIDEO; - pj_assert(frame.size >= vafp.framebytes); - frame.size = vafp.framebytes; - - if (vfi->color_model == PJMEDIA_COLOR_MODEL_RGB) { - pj_memset(frame.buf, 0, vafp.framebytes); - } else if (fmt->id == PJMEDIA_FORMAT_I420 || - fmt->id == PJMEDIA_FORMAT_YV12) - { - pj_memset(frame.buf, 16, vafp.plane_bytes[0]); - pj_memset((pj_uint8_t*)frame.buf + vafp.plane_bytes[0], - 0x80, vafp.plane_bytes[1] * 2); - } - } - } - if (vp->clock) { status = pjmedia_clock_start(vp->clock); if (status != PJ_SUCCESS) @@ -856,18 +858,26 @@ PJ_LOG(4,(THIS_FILE, "Closing %s..", vp->dev_name.ptr)); + /* Unsubscribe events first, otherwise the event callbacks can be called + * and try to access already destroyed objects. + */ + if (vp->strm) { + pjmedia_event_unsubscribe(NULL, &vidstream_event_cb, vp, vp->strm); + } + if (vp->client_port) { + pjmedia_event_unsubscribe(NULL, &client_port_event_cb, vp, + vp->client_port); + } + if (vp->clock) { pjmedia_clock_destroy(vp->clock); vp->clock = NULL; } if (vp->strm) { - pjmedia_event_unsubscribe(NULL, &vidstream_event_cb, vp, vp->strm); pjmedia_vid_dev_stream_destroy(vp->strm); vp->strm = NULL; } if (vp->client_port) { - pjmedia_event_unsubscribe(NULL, &client_port_event_cb, vp, - vp->client_port); if (vp->destroy_client_port) pjmedia_port_destroy(vp->client_port); vp->client_port = NULL; @@ -1332,6 +1342,20 @@ */ pj_status_t status; pjmedia_frame frame_; + + if (frame->size != vp->src_size) { + if (frame->size > 0) { + PJ_LOG(4, (THIS_FILE, "Unexpected frame size %d, expected %d", + frame->size, vp->src_size)); + } + + pj_memcpy(&frame_, frame, sizeof(pjmedia_frame)); + frame_.buf = NULL; + frame_.size = 0; + + /* Send heart beat for updating timestamp or keep-alive. */ + return pjmedia_vid_dev_stream_put_frame(vp->strm, &frame_); + } pj_bzero(&frame_, sizeof(frame_)); status = convert_frame(vp, frame, &frame_); @@ -1345,7 +1369,8 @@ * frame in the buffer. * The encoding counterpart is located in vidstream_cap_cb() */ - copy_frame_to_buffer(vp, frame); + if (frame->size == vp->src_size) + copy_frame_to_buffer(vp, frame); } return PJ_SUCCESS; diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjmedia/src/pjmedia/vid_stream.c asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjmedia/src/pjmedia/vid_stream.c --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjmedia/src/pjmedia/vid_stream.c 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjmedia/src/pjmedia/vid_stream.c 2022-02-24 07:54:38.000000000 +0000 @@ -137,6 +137,7 @@ pjmedia_ratio dec_max_fps; /**< Max fps of decoding dir. */ pjmedia_frame dec_frame; /**< Current decoded frame. */ unsigned dec_delay_cnt; /**< Decoding delay (in frames).*/ + unsigned dec_max_delay; /**< Decoding max delay (in ts).*/ pjmedia_event fmt_event; /**< Buffered fmt_changed event to avoid deadlock */ pjmedia_event miss_keyframe_event; @@ -162,8 +163,18 @@ pj_bool_t use_ka; /**< Stream keep-alive with non- codec-VAD mechanism is enabled? */ - pj_timestamp last_frm_ts_sent; /**< Timestamp of last sending + unsigned ka_interval; /**< The keepalive sending + interval */ + pj_time_val last_frm_ts_sent; /**< Time of last sending packet */ + unsigned start_ka_count; /**< The number of keep-alive + to be sent after it is + created */ + unsigned start_ka_interval;/**< The keepalive sending + interval after the stream + is created */ + pj_timestamp last_start_ka_tx; /**< Timestamp of the last + keepalive sent */ #endif #if TRACE_JB @@ -380,7 +391,7 @@ const pjmedia_port_info *pi = &chan->port.info; char fourcc_name[5]; - PJ_LOG(5, (pi->name.ptr, + PJ_LOG(4, (pi->name.ptr, " %s format %s: %dx%d %s%s %d/%d(~%d)fps", (chan->dir==PJMEDIA_DIR_DECODING? "Decoding":"Encoding"), event_name, @@ -523,7 +534,7 @@ pkt_len); /* Send RTCP */ - send_rtcp(stream, PJ_TRUE, PJ_FALSE); + send_rtcp(stream, PJ_TRUE, PJ_FALSE, PJ_FALSE, PJ_FALSE); /* Update stats in case the stream is paused */ stream->rtcp.stat.rtp_tx_last_seq = pj_ntohs(stream->enc->rtp.out_hdr.seq); @@ -567,7 +578,6 @@ pj_uint8_t *pkt; int len, max_len; pj_status_t status; - pjmedia_vid_channel *channel = stream->enc; /* Build RTCP RR/SR packet */ pjmedia_rtcp_build_rtcp(&stream->rtcp, &sr_rr_pkt, &len); @@ -643,8 +653,7 @@ status = pjmedia_transport_send_rtcp(stream->transport, pkt, len); if (status != PJ_SUCCESS) { if (stream->rtcp_tx_err_cnt++ == 0) { - LOGERR_((channel->port.info.name.ptr, status, - "Error sending RTCP")); + LOGERR_((stream->name.ptr, status, "Error sending RTCP")); } if (stream->rtcp_tx_err_cnt > SEND_ERR_COUNT_TO_REPORT) { stream->rtcp_tx_err_cnt = 0; @@ -751,6 +760,7 @@ unsigned payloadlen; pjmedia_rtp_status seq_st; pj_status_t status; + long ts_diff; pj_bool_t pkt_discarded = PJ_FALSE; /* Check for errors */ @@ -797,7 +807,13 @@ /* Update RTP session (also checks if RTP session can accept * the incoming packet. */ - pjmedia_rtp_session_update2(&channel->rtp, hdr, &seq_st, PJ_TRUE); + pjmedia_rtp_session_update2(&channel->rtp, hdr, &seq_st, + PJMEDIA_VID_STREAM_CHECK_RTP_PT); +#if !PJMEDIA_VID_STREAM_CHECK_RTP_PT + if (hdr->pt != channel->rtp.out_pt) { + seq_st.status.flag.badpt = 1; + } +#endif if (seq_st.status.value) { TRC_ ((channel->port.info.name.ptr, "RTP status: badpt=%d, badssrc=%d, dup=%d, " @@ -898,7 +914,8 @@ /* Quickly see if there may be a full picture in the jitter buffer, and * decode them if so. More thorough check will be done in decode_frame(). */ - if ((pj_ntohl(hdr->ts) != stream->dec_frame.timestamp.u32.lo) || hdr->m) { + ts_diff = pj_ntohl(hdr->ts) - stream->dec_frame.timestamp.u32.lo; + if (ts_diff != 0 || hdr->m) { if (PJMEDIA_VID_STREAM_SKIP_PACKETS_TO_REDUCE_LATENCY) { /* Always decode whenever we have picture in jb and * overwrite already decoded picture if necessary @@ -921,6 +938,17 @@ else if (stream->dec_frame.size == 0) { can_decode = PJ_TRUE; } + /* For video, checking for a full jbuf above is not very useful + * since video jbuf has a rather large capacity (to accommodate + * many chunks per frame) and thus can typically store frames + * that are much longer than max latency/delay specified in jb_max + * setting. + * So we need to compare the last decoded frame's timestamp with + * the current timestamp. + */ + else if (ts_diff > (long)stream->dec_max_delay) { + can_decode = PJ_TRUE; + } if (can_decode) { stream->dec_frame.size = stream->dec_max_size; @@ -1054,28 +1082,44 @@ */ if (stream->use_ka) { - pj_uint32_t dtx_duration; + pj_uint32_t dtx_duration, ka_interval; + pj_time_val tm_now, tmp; - dtx_duration = pj_timestamp_diff32(&stream->last_frm_ts_sent, - &frame->timestamp); + pj_gettimeofday(&tm_now); - if (dtx_duration > - PJMEDIA_STREAM_KA_INTERVAL * stream->info.codec_info.clock_rate) - { - send_keep_alive_packet(stream); - stream->last_frm_ts_sent = frame->timestamp; - } + tmp = tm_now; + PJ_TIME_VAL_SUB(tmp, stream->last_frm_ts_sent); + dtx_duration = PJ_TIME_VAL_MSEC(tmp); + + if (stream->start_ka_count) { + ka_interval = stream->start_ka_interval; + } else { + ka_interval = stream->ka_interval * 1000; + } + if (dtx_duration > ka_interval) { + send_keep_alive_packet(stream); + stream->last_frm_ts_sent = tm_now; + + if (stream->start_ka_count) + stream->start_ka_count--; + } } #endif + /* Get frame length in timestamp unit */ + rtp_ts_len = stream->frame_ts_len; - /* Don't do anything if stream is paused */ + /* Don't do anything if stream is paused, except updating RTP timestamp */ if (channel->paused) { + /* Update RTP session's timestamp. */ + status = pjmedia_rtp_encode_rtp( &channel->rtp, 0, 0, 0, rtp_ts_len, + NULL, NULL); + + /* Update RTCP stats with last RTP timestamp. */ + stream->rtcp.stat.rtp_tx_last_ts = + pj_ntohl(channel->rtp.out_hdr.ts); return PJ_SUCCESS; } - /* Get frame length in timestamp unit */ - rtp_ts_len = stream->frame_ts_len; - /* Empty video frame? Just update RTP timestamp for now */ if (frame->type==PJMEDIA_FRAME_TYPE_VIDEO && frame->size==0) { pjmedia_rtp_encode_rtp(&channel->rtp, channel->pt, 1, 0, @@ -1269,8 +1313,8 @@ } #if defined(PJMEDIA_STREAM_ENABLE_KA) && PJMEDIA_STREAM_ENABLE_KA!=0 - /* Update timestamp of last sending packet. */ - stream->last_frm_ts_sent = frame->timestamp; + /* Update time of last sending packet. */ + pj_gettimeofday(&stream->last_frm_ts_sent); #endif return PJ_SUCCESS; @@ -1282,6 +1326,7 @@ { pjmedia_vid_channel *channel = stream->dec; pj_uint32_t last_ts = 0, frm_ts = 0; + pj_bool_t last_ts_inited = PJ_FALSE; int frm_first_seq = 0, frm_last_seq = 0; pj_bool_t got_frame = PJ_FALSE; unsigned cnt, frm_pkt_cnt = 0, frm_cnt = 0; @@ -1301,18 +1346,19 @@ pjmedia_jbuf_peek_frame(stream->jb, cnt, NULL, NULL, &ptype, NULL, &ts, &seq); if (ptype == PJMEDIA_JB_NORMAL_FRAME) { - if (stream->last_dec_ts == ts) { + if (stream->last_dec_ts == ts) { /* Remove any late packet (the frame has been decoded) */ pjmedia_jbuf_remove_frame(stream->jb, 1); continue; } - if (last_ts == 0) { + if (!last_ts_inited) { last_ts = ts; /* Init timestamp and first seq of the first frame */ frm_ts = ts; frm_first_seq = seq; + last_ts_inited = PJ_TRUE; } if (ts != last_ts) { last_ts = ts; @@ -1529,7 +1575,8 @@ stream->dec : stream->enc, "changed"); - pjmedia_event_publish(NULL, port, &stream->fmt_event, 0); + pjmedia_event_publish(NULL, port, &stream->fmt_event, + PJMEDIA_EVENT_PUBLISH_POST_EVENT); stream->fmt_event.type = PJMEDIA_EVENT_NONE; } @@ -1766,6 +1813,9 @@ #if defined(PJMEDIA_STREAM_ENABLE_KA) && PJMEDIA_STREAM_ENABLE_KA!=0 stream->use_ka = info->use_ka; + stream->ka_interval = info->ka_cfg.ka_interval; + stream->start_ka_count = info->ka_cfg.start_count; + stream->start_ka_interval = info->ka_cfg.start_interval; #endif stream->num_keyframe = info->sk_cfg.count; @@ -1866,16 +1916,20 @@ stream->dec_frame.buf = pj_pool_alloc(pool, stream->dec_max_size); /* Init jitter buffer parameters: */ - frm_ptime = 1000 * vfd_enc->fps.denum / vfd_enc->fps.num; + frm_ptime = 1000 * vfd_dec->fps.denum / vfd_dec->fps.num; chunks_per_frm = stream->frame_size / PJMEDIA_MAX_MRU; if (chunks_per_frm < MIN_CHUNKS_PER_FRM) chunks_per_frm = MIN_CHUNKS_PER_FRM; /* JB max count, default 500ms */ - if (info->jb_max >= frm_ptime) + if (info->jb_max >= frm_ptime) { jb_max = info->jb_max * chunks_per_frm / frm_ptime; - else + stream->dec_max_delay = info->codec_info.clock_rate * info->jb_max / + 1000; + } else { jb_max = 500 * chunks_per_frm / frm_ptime; + stream->dec_max_delay = info->codec_info.clock_rate * 500 / 1000; + } /* JB min prefetch, default 1 frame */ if (info->jb_min_pre >= frm_ptime) @@ -2133,6 +2187,7 @@ /* Free mutex */ if (stream->jb_mutex) { + pj_mutex_unlock(stream->jb_mutex); pj_mutex_destroy(stream->jb_mutex); stream->jb_mutex = NULL; } @@ -2389,6 +2444,22 @@ } return PJ_SUCCESS; +} + + +/* + * Send RTCP PLI. + */ +PJ_DEF(pj_status_t) pjmedia_vid_stream_send_rtcp_pli( + pjmedia_vid_stream *stream) +{ + PJ_ASSERT_RETURN(stream, PJ_EINVAL); + + if (stream->transport) { + return send_rtcp(stream, PJ_FALSE, PJ_FALSE, PJ_FALSE, PJ_TRUE); + } + + return PJ_SUCCESS; } diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjmedia/src/pjmedia/vid_stream_info.c asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjmedia/src/pjmedia/vid_stream_info.c --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjmedia/src/pjmedia/vid_stream_info.c 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjmedia/src/pjmedia/vid_stream_info.c 2022-02-24 07:54:38.000000000 +0000 @@ -191,7 +191,6 @@ const pjmedia_sdp_conn *local_conn; const pjmedia_sdp_conn *rem_conn; int rem_af, local_af; - pj_sockaddr local_addr; unsigned i; pj_status_t status; @@ -283,7 +282,7 @@ } /* Set remote address: */ - status = pj_sockaddr_init(local_af, &local_addr, &local_conn->addr, + status = pj_sockaddr_init(local_af, &si->local_addr, &local_conn->addr, local_m->desc.port); if (status != PJ_SUCCESS) { /* Invalid IP address. */ @@ -305,7 +304,7 @@ /* Media direction: */ if (local_m->desc.port == 0 || - pj_sockaddr_has_addr(&local_addr)==PJ_FALSE || + pj_sockaddr_has_addr(&si->local_addr)==PJ_FALSE || pj_sockaddr_has_addr(&si->rem_addr)==PJ_FALSE || pjmedia_sdp_media_find_attr(local_m, &STR_INACTIVE, NULL)!=NULL) { diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjmedia/src/pjmedia/wav_player.c asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjmedia/src/pjmedia/wav_player.c --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjmedia/src/pjmedia/wav_player.c 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjmedia/src/pjmedia/wav_player.c 2022-02-24 07:54:38.000000000 +0000 @@ -342,8 +342,13 @@ /* Validate length. */ if (wave_hdr.data_hdr.len > fport->fsize - fport->start_data) { - pj_file_close(fport->fd); - return PJMEDIA_EWAVEUNSUPP; + /* Actual data length may be shorter than declared. We should still + * try to play whatever data is there instead of immediately returning + * error. + */ + wave_hdr.data_hdr.len = (pj_uint32_t)fport->fsize - fport->start_data; + // pj_file_close(fport->fd); + // return PJMEDIA_EWAVEUNSUPP; } if (wave_hdr.data_hdr.len < ptime * wave_hdr.fmt_hdr.sample_rate * wave_hdr.fmt_hdr.nchan / 1000) diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjmedia/src/pjmedia/wav_playlist.c asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjmedia/src/pjmedia/wav_playlist.c --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjmedia/src/pjmedia/wav_playlist.c 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjmedia/src/pjmedia/wav_playlist.c 2022-02-24 07:54:38.000000000 +0000 @@ -324,7 +324,9 @@ /* Be sure all files exist */ for (index=0; index= 0, PJ_ETOOSMALL); + if (file_list[index].slen >= PJ_MAXPATH) + return PJ_ENAMETOOLONG; pj_memcpy(filename, file_list[index].ptr, file_list[index].slen); filename[file_list[index].slen] = '\0'; diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjmedia/src/pjmedia/wsola.c asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjmedia/src/pjmedia/wsola.c --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjmedia/src/pjmedia/wsola.c 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjmedia/src/pjmedia/wsola.c 2022-02-24 07:54:38.000000000 +0000 @@ -248,7 +248,7 @@ /* Process remaining samples. */ for (; ipb_mixer_name, snd_mixer_selem_get_name(elem), - sizeof(af->pb_mixer_name)); - TRACE_((THIS_FILE, "Playback mixer name: %s", af->pb_mixer_name)); - break; - } + const char* elemname; + elemname = snd_mixer_selem_get_name(elem); + if (snd_mixer_selem_is_active(elem)) + { + if (snd_mixer_selem_has_playback_volume(elem)) + { + pj_ansi_strncpy(af->pb_mixer_name, elemname, + sizeof(af->pb_mixer_name)); + af->pb_mixer_name[sizeof(af->pb_mixer_name)-1] = 0; + TRACE_((THIS_FILE, "Playback mixer name: %s", + af->pb_mixer_name)); + } + if (snd_mixer_selem_has_capture_volume(elem)) + { + pj_ansi_strncpy(af->cap_mixer_name, elemname, + sizeof(af->cap_mixer_name)); + af->cap_mixer_name[sizeof(af->cap_mixer_name)-1] = 0; + TRACE_((THIS_FILE, "Capture mixer name: %s", + af->cap_mixer_name)); + } + } } snd_mixer_close(handle); } @@ -442,7 +456,10 @@ pj_memcpy(info, &af->devs[index], sizeof(*info)); info->caps = PJMEDIA_AUD_DEV_CAP_INPUT_LATENCY | - PJMEDIA_AUD_DEV_CAP_OUTPUT_LATENCY; + PJMEDIA_AUD_DEV_CAP_OUTPUT_LATENCY | + PJMEDIA_AUD_DEV_CAP_INPUT_VOLUME_SETTING | + PJMEDIA_AUD_DEV_CAP_OUTPUT_VOLUME_SETTING; + return PJ_SUCCESS; } @@ -672,8 +689,15 @@ /* Set number of channels */ TRACE_((THIS_FILE, "open_playback: set channels: %d", param->channel_count)); - snd_pcm_hw_params_set_channels (stream->pb_pcm, params, - param->channel_count); + result = snd_pcm_hw_params_set_channels (stream->pb_pcm, params, + param->channel_count); + if (result < 0) { + PJ_LOG (3,(THIS_FILE, "Unable to set a channel count of %d for " + "playback device '%s'", param->channel_count, + stream->af->devs[param->play_id].name)); + snd_pcm_close (stream->pb_pcm); + return PJMEDIA_EAUD_SYSERR; + } /* Set clock rate */ rate = param->clock_rate; @@ -689,8 +713,11 @@ tmp_period_size = stream->pb_frames; snd_pcm_hw_params_set_period_size_near (stream->pb_pcm, params, &tmp_period_size, NULL); - stream->pb_frames = tmp_period_size > stream->pb_frames ? tmp_period_size : - stream->pb_frames; + /* Commenting this as it may cause the number of samples per frame + * to be incorrest. + */ + // stream->pb_frames = tmp_period_size > stream->pb_frames ? + // tmp_period_size : stream->pb_frames; TRACE_((THIS_FILE, "open_playback: period size set to: %d", tmp_period_size)); @@ -699,6 +726,8 @@ tmp_buf_size = (rate / 1000) * param->output_latency_ms; else tmp_buf_size = (rate / 1000) * PJMEDIA_SND_DEFAULT_PLAY_LATENCY; + if (tmp_buf_size < tmp_period_size * 2) + tmp_buf_size = tmp_period_size * 2; snd_pcm_hw_params_set_buffer_size_near (stream->pb_pcm, params, &tmp_buf_size); stream->param.output_latency_ms = tmp_buf_size / (rate / 1000); @@ -720,6 +749,12 @@ return PJMEDIA_EAUD_SYSERR; } + if (param->flags & PJMEDIA_AUD_DEV_CAP_OUTPUT_VOLUME_SETTING) { + alsa_stream_set_cap(&stream->base, + PJMEDIA_AUD_DEV_CAP_OUTPUT_VOLUME_SETTING, + ¶m->output_vol); + } + PJ_LOG (5,(THIS_FILE, "Opened device alsa(%s) for playing, sample rate=%d" ", ch=%d, bits=%d, period size=%d frames, latency=%d ms", stream->af->devs[param->play_id].name, @@ -792,8 +827,15 @@ /* Set number of channels */ TRACE_((THIS_FILE, "open_capture: set channels: %d", param->channel_count)); - snd_pcm_hw_params_set_channels (stream->ca_pcm, params, - param->channel_count); + result = snd_pcm_hw_params_set_channels (stream->ca_pcm, params, + param->channel_count); + if (result < 0) { + PJ_LOG (3,(THIS_FILE, "Unable to set a channel count of %d for " + "capture device '%s'", param->channel_count, + stream->af->devs[param->rec_id].name)); + snd_pcm_close (stream->ca_pcm); + return PJMEDIA_EAUD_SYSERR; + } /* Set clock rate */ rate = param->clock_rate; @@ -809,8 +851,11 @@ tmp_period_size = stream->ca_frames; snd_pcm_hw_params_set_period_size_near (stream->ca_pcm, params, &tmp_period_size, NULL); - stream->ca_frames = tmp_period_size > stream->ca_frames ? tmp_period_size : - stream->ca_frames; + /* Commenting this as it may cause the number of samples per frame + * to be incorrest. + */ + // stream->ca_frames = tmp_period_size > stream->ca_frames ? + // tmp_period_size : stream->ca_frames; TRACE_((THIS_FILE, "open_capture: period size set to: %d", tmp_period_size)); @@ -819,6 +864,8 @@ tmp_buf_size = (rate / 1000) * param->input_latency_ms; else tmp_buf_size = (rate / 1000) * PJMEDIA_SND_DEFAULT_REC_LATENCY; + if (tmp_buf_size < tmp_period_size * 2) + tmp_buf_size = tmp_period_size * 2; snd_pcm_hw_params_set_buffer_size_near (stream->ca_pcm, params, &tmp_buf_size); stream->param.input_latency_ms = tmp_buf_size / (rate / 1000); @@ -840,6 +887,12 @@ return PJMEDIA_EAUD_SYSERR; } + if (param->flags & PJMEDIA_AUD_DEV_CAP_INPUT_VOLUME_SETTING) { + alsa_stream_set_cap(&stream->base, + PJMEDIA_AUD_DEV_CAP_INPUT_VOLUME_SETTING, + ¶m->input_vol); + } + PJ_LOG (5,(THIS_FILE, "Opened device alsa(%s) for capture, sample rate=%d" ", ch=%d, bits=%d, period size=%d frames, latency=%d ms", stream->af->devs[param->rec_id].name, @@ -952,8 +1005,10 @@ { struct alsa_factory *af = ((struct alsa_stream*)strm)->af; - if (cap==PJMEDIA_AUD_DEV_CAP_OUTPUT_VOLUME_SETTING && - pj_ansi_strlen(af->pb_mixer_name)) + if ((cap==PJMEDIA_AUD_DEV_CAP_OUTPUT_VOLUME_SETTING && + pj_ansi_strlen(af->pb_mixer_name)) || + (cap==PJMEDIA_AUD_DEV_CAP_INPUT_VOLUME_SETTING && + pj_ansi_strlen(af->cap_mixer_name))) { pj_ssize_t min, max; snd_mixer_t *handle; @@ -975,14 +1030,30 @@ snd_mixer_selem_id_alloca(&sid); snd_mixer_selem_id_set_index(sid, 0); - snd_mixer_selem_id_set_name(sid, af->pb_mixer_name); + if (cap==PJMEDIA_AUD_DEV_CAP_OUTPUT_VOLUME_SETTING) + snd_mixer_selem_id_set_name(sid, af->pb_mixer_name); + else if (cap==PJMEDIA_AUD_DEV_CAP_INPUT_VOLUME_SETTING) + snd_mixer_selem_id_set_name(sid, af->cap_mixer_name); + elem = snd_mixer_find_selem(handle, sid); if (!elem) return PJMEDIA_EAUD_SYSERR; - snd_mixer_selem_get_playback_volume_range(elem, &min, &max); - if (snd_mixer_selem_set_playback_volume_all(elem, vol * max / 100) < 0) - return PJMEDIA_EAUD_SYSERR; + if (cap == PJMEDIA_AUD_DEV_CAP_OUTPUT_VOLUME_SETTING) { + snd_mixer_selem_get_playback_volume_range(elem, &min, &max); + if (snd_mixer_selem_set_playback_volume_all(elem, + vol * max / 100) < 0) + { + return PJMEDIA_EAUD_SYSERR; + } + } else if (cap == PJMEDIA_AUD_DEV_CAP_INPUT_VOLUME_SETTING) { + snd_mixer_selem_get_capture_volume_range(elem, &min, &max); + if (snd_mixer_selem_set_capture_volume_all(elem, + vol * max / 100) < 0) + { + return PJMEDIA_EAUD_SYSERR; + } + } snd_mixer_close(handle); return PJ_SUCCESS; diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjmedia/src/pjmedia-audiodev/android/PjAudioDevInfo.java asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjmedia/src/pjmedia-audiodev/android/PjAudioDevInfo.java --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjmedia/src/pjmedia-audiodev/android/PjAudioDevInfo.java 1970-01-01 00:00:00.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjmedia/src/pjmedia-audiodev/android/PjAudioDevInfo.java 2022-02-24 07:54:38.000000000 +0000 @@ -0,0 +1,167 @@ +/* + * Copyright (C) 2021 Teluu Inc. (http://www.teluu.com) + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ +package org.pjsip; + +import android.content.Context; +import android.media.AudioDeviceInfo; +import android.media.AudioManager; +import android.os.Build; +import android.util.Log; +import android.util.SparseArray; +import java.util.Arrays; + +public class PjAudioDevInfo { + + /* API */ + + public int id; + public String name; + public int direction; + public int[] supportedClockRates; + public int[] supportedChannelCounts; + + public static int GetCount() + { + return devices.size(); + } + + public static PjAudioDevInfo GetInfo(int idx) + { + return devices.valueAt(idx); + } + + public static void RefreshDevices(Context context) + { + devices = new SparseArray<>(); + + /* Default device */ + PjAudioDevInfo pj_adi = new PjAudioDevInfo(); + pj_adi.id = 0; + pj_adi.name = "Default"; + pj_adi.direction = 3; + devices.put(0, pj_adi); + + /* Enumerate devices (for API level 23 or later) */ + if (android.os.Build.VERSION.SDK_INT < 23) + return; + + AudioManager am = (AudioManager)context.getSystemService(Context.AUDIO_SERVICE); + AudioDeviceInfo[] devs = am.getDevices(AudioManager.GET_DEVICES_ALL); + Log.i("Oboe", "Enumerating AudioManager devices.."); + for (AudioDeviceInfo adi: devs) { + LogDevInfo(adi); + + pj_adi = new PjAudioDevInfo(); + pj_adi.id = adi.getId(); + pj_adi.name = DevTypeStr(adi.getType()) + " - " + adi.getProductName().toString(); + pj_adi.direction = 0; + if (adi.isSource()) pj_adi.direction |= 1; + if (adi.isSink()) pj_adi.direction |= 2; + pj_adi.supportedChannelCounts = adi.getChannelCounts(); + pj_adi.supportedClockRates = adi.getSampleRates(); + devices.put(adi.getId(), pj_adi); + } + } + + /* Private members */ + + private static SparseArray devices; + + private static String DevTypeStr(int type) { + if (android.os.Build.VERSION.SDK_INT < 23) + return "Unknown"; + + /* + if (android.os.Build.VERSION.SDK_INT > 30) { + if (type == AudioDeviceInfo.TYPE_BLE_HEADSET) + return "BLE Headset"; + if (type == AudioDeviceInfo.TYPE_BLE_SPEAKER) + return "BLE Speaker"; + } + */ + + switch (type) { + case AudioDeviceInfo.TYPE_BUILTIN_EARPIECE: + return "Builtin Earpiece"; + case AudioDeviceInfo.TYPE_BUILTIN_SPEAKER: + return "Builtin Speaker"; + case AudioDeviceInfo.TYPE_WIRED_HEADSET: + return "Wired Headset"; + case AudioDeviceInfo.TYPE_WIRED_HEADPHONES: + return "Wired Headphones"; + case AudioDeviceInfo.TYPE_LINE_ANALOG: + return "Line Analog"; + case AudioDeviceInfo.TYPE_LINE_DIGITAL: + return "Line Digital"; + case AudioDeviceInfo.TYPE_BLUETOOTH_SCO: + return "Bluetooth SCO"; + case AudioDeviceInfo.TYPE_BLUETOOTH_A2DP: + return "Bluetooth A2DP"; + case AudioDeviceInfo.TYPE_HDMI: + return "HDMI"; + case AudioDeviceInfo.TYPE_HDMI_ARC: + return "HDMI ARC"; + case AudioDeviceInfo.TYPE_USB_DEVICE: + return "USB Device"; + case AudioDeviceInfo.TYPE_USB_ACCESSORY: + return "USB Accessory"; + case AudioDeviceInfo.TYPE_DOCK: + return "Dock"; + case AudioDeviceInfo.TYPE_FM: + return "FM"; + case AudioDeviceInfo.TYPE_BUILTIN_MIC: + return "Builtin Mic"; + case AudioDeviceInfo.TYPE_FM_TUNER: + return "FM Tuner"; + case AudioDeviceInfo.TYPE_TV_TUNER: + return "TV Tuner"; + case AudioDeviceInfo.TYPE_TELEPHONY: + return "Telephony"; + case AudioDeviceInfo.TYPE_AUX_LINE: + return "AUX Line"; + case AudioDeviceInfo.TYPE_IP: + return "IP"; + case AudioDeviceInfo.TYPE_BUS: + return "Bus"; + case AudioDeviceInfo.TYPE_USB_HEADSET: + return "USB Headset"; + default: + return "Unknown ("+ type +")"; + } + } + + private static void LogDevInfo(AudioDeviceInfo adi) { + if (Build.VERSION.SDK_INT < 23) + return; + + StringBuilder info = new StringBuilder(); + info.append("id=").append(adi.getId()); + info.append(","); + if (adi.isSource()) info.append(" in"); + if (adi.isSink()) info.append(" out"); + info.append(", ").append(DevTypeStr(adi.getType())); + if (adi.getChannelCounts().length > 0) { + info.append(", channels=").append(Arrays.toString(adi.getChannelCounts())); + } + if (adi.getSampleRates().length > 0) { + info.append(", clock rates=").append(Arrays.toString(adi.getSampleRates())); + } + Log.i("Oboe", info.toString()); + } +} + diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjmedia/src/pjmedia-audiodev/android_jni_dev.c asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjmedia/src/pjmedia-audiodev/android_jni_dev.c --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjmedia/src/pjmedia-audiodev/android_jni_dev.c 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjmedia/src/pjmedia-audiodev/android_jni_dev.c 2022-02-24 07:54:38.000000000 +0000 @@ -141,81 +141,12 @@ &strm_destroy }; -extern JavaVM *pj_jni_jvm; - -static pj_bool_t attach_jvm(JNIEnv **jni_env) -{ - if ((*pj_jni_jvm)->GetEnv(pj_jni_jvm, (void **)jni_env, - JNI_VERSION_1_4) < 0) - { - if ((*pj_jni_jvm)->AttachCurrentThread(pj_jni_jvm, jni_env, NULL) < 0) - { - jni_env = NULL; - return PJ_FALSE; - } - return PJ_TRUE; - } - - return PJ_FALSE; -} - -#define detach_jvm(attached) \ - if (attached) \ - (*pj_jni_jvm)->DetachCurrentThread(pj_jni_jvm); - -/* Thread priority utils */ -/* TODO : port it to pj_thread functions */ -#define THREAD_PRIORITY_AUDIO -16 -#define THREAD_PRIORITY_URGENT_AUDIO -19 - -pj_status_t set_android_thread_priority(int priority) -{ - jclass process_class; - jmethodID set_prio_method; - jthrowable exc; - pj_status_t result = PJ_SUCCESS; - JNIEnv *jni_env = 0; - pj_bool_t attached = attach_jvm(&jni_env); - - PJ_ASSERT_RETURN(jni_env, PJ_FALSE); - - /* Get pointer to the java class */ - process_class = (jclass)(*jni_env)->NewGlobalRef(jni_env, - (*jni_env)->FindClass(jni_env, "android/os/Process")); - if (process_class == 0) { - PJ_LOG(4, (THIS_FILE, "Unable to find os process class")); - result = PJ_EIGNORED; - goto on_return; - } - - /* Get the id of set thread priority function */ - set_prio_method = (*jni_env)->GetStaticMethodID(jni_env, process_class, - "setThreadPriority", - "(I)V"); - if (set_prio_method == 0) { - PJ_LOG(4, (THIS_FILE, "Unable to find setThreadPriority() method")); - result = PJ_EIGNORED; - goto on_return; - } - - /* Set the thread priority */ - (*jni_env)->CallStaticVoidMethod(jni_env, process_class, set_prio_method, - priority); - exc = (*jni_env)->ExceptionOccurred(jni_env); - if (exc) { - (*jni_env)->ExceptionDescribe(jni_env); - (*jni_env)->ExceptionClear(jni_env); - PJ_LOG(4, (THIS_FILE, "Failure in setting thread priority using " - "Java API, fallback to setpriority()")); - setpriority(PRIO_PROCESS, 0, priority); - } else { - PJ_LOG(4, (THIS_FILE, "Setting thread priority successful")); - } - -on_return: - detach_jvm(attached); - return result; -} +PJ_DECL(pj_bool_t) pj_jni_attach_jvm(JNIEnv **jni_env); +PJ_DECL(void) pj_jni_dettach_jvm(pj_bool_t attached); +#define attach_jvm(jni_env) pj_jni_attach_jvm(jni_env) +#define detach_jvm(attached) pj_jni_dettach_jvm(attached) +#define THREAD_PRIORITY_AUDIO -16 +#define THREAD_PRIORITY_URGENT_AUDIO -19 static int AndroidRecorderCallback(void *userData) @@ -255,15 +186,8 @@ goto on_return; } - /* Start recording - * setpriority(PRIO_PROCESS, 0, -19); //ANDROID_PRIORITY_AUDIO - * set priority is probably not enough because it does not change the thread - * group in scheduler - * Temporary solution is to call the java api to set the thread priority. - * A cool solution would be to port (if possible) the code from the - * android os regarding set_sched groups - */ - set_android_thread_priority(THREAD_PRIORITY_URGENT_AUDIO); + /* Start recording */ + pj_thread_set_prio(NULL, THREAD_PRIORITY_URGENT_AUDIO); (*jni_env)->CallVoidMethod(jni_env, stream->record, record_method); while (!stream->quit_flag) { @@ -356,7 +280,7 @@ buf = (*jni_env)->GetByteArrayElements(jni_env, outputBuffer, 0); /* Start playing */ - set_android_thread_priority(THREAD_PRIORITY_URGENT_AUDIO); + pj_thread_set_prio(NULL, THREAD_PRIORITY_URGENT_AUDIO); (*jni_env)->CallVoidMethod(jni_env, stream->track, play_method); while (!stream->quit_flag) { diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjmedia/src/pjmedia-audiodev/audiodev.c asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjmedia/src/pjmedia-audiodev/audiodev.c --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjmedia/src/pjmedia-audiodev/audiodev.c 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjmedia/src/pjmedia-audiodev/audiodev.c 2022-02-24 07:54:38.000000000 +0000 @@ -44,6 +44,10 @@ pjmedia_aud_dev_factory* pjmedia_android_factory(pj_pool_factory *pf); #endif +#if PJMEDIA_AUDIO_DEV_HAS_OBOE +pjmedia_aud_dev_factory* pjmedia_android_oboe_factory(pj_pool_factory *pf); +#endif + #if PJMEDIA_AUDIO_DEV_HAS_BB10 pjmedia_aud_dev_factory* pjmedia_bb10_factory(pj_pool_factory *pf); #endif @@ -103,6 +107,9 @@ aud_subsys->dev_cnt = 0; /* Register creation functions */ +#if PJMEDIA_AUDIO_DEV_HAS_OBOE + aud_subsys->drv[aud_subsys->drv_cnt++].create = &pjmedia_android_oboe_factory; +#endif #if PJMEDIA_AUDIO_DEV_HAS_OPENSL aud_subsys->drv[aud_subsys->drv_cnt++].create = &pjmedia_opensl_factory; #endif diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjmedia/src/pjmedia-audiodev/coreaudio_dev.m asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjmedia/src/pjmedia-audiodev/coreaudio_dev.m --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjmedia/src/pjmedia-audiodev/coreaudio_dev.m 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjmedia/src/pjmedia-audiodev/coreaudio_dev.m 2022-02-24 07:54:38.000000000 +0000 @@ -1475,10 +1475,25 @@ if (dir & PJMEDIA_DIR_PLAYBACK) { AURenderCallbackStruct output_cb; AudioStreamBasicDescription streamFormat = strm->streamFormat; + BOOL isMacCatalystApp = false; + +#ifdef __IPHONE_13_0 + if (@available(iOS 13.0, *)) { + /* According to Apple's doc, the property isMacCatalystApp is true + * when the process is: + * - A Mac app built with Mac Catalyst, or an iOS app running on Apple silicon. + * - Running on a Mac. + */ + isMacCatalystApp = [NSProcessInfo processInfo].isMacCatalystApp; + } +#endif /* Set the stream format */ -#if COREAUDIO_MAC - if (strm->param.ec_enabled) { + if (strm->param.ec_enabled +#if !COREAUDIO_MAC + && isMacCatalystApp +#endif + ) { /* When using VPIO on Mac, we need to use float data. Using * signed integer will generate no errors, but strangely, * no sound will be played. @@ -1491,7 +1506,7 @@ streamFormat.mBytesPerPacket = streamFormat.mBytesPerFrame * streamFormat.mFramesPerPacket; } -#endif + ostatus = AudioUnitSetProperty(*io_unit, kAudioUnitProperty_StreamFormat, kAudioUnitScope_Input, diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjmedia/src/pjmedia-audiodev/oboe_dev.cpp asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjmedia/src/pjmedia-audiodev/oboe_dev.cpp --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjmedia/src/pjmedia-audiodev/oboe_dev.cpp 1970-01-01 00:00:00.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjmedia/src/pjmedia-audiodev/oboe_dev.cpp 2022-02-24 07:54:38.000000000 +0000 @@ -0,0 +1,1128 @@ +/* + * Copyright (C) 2021 Teluu Inc. (http://www.teluu.com) + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + + +/* This file is the implementation of Android Oboe audio device. */ + +#include +#include +#include +#include +#include +#include +#include + +#if defined(PJMEDIA_AUDIO_DEV_HAS_OBOE) && PJMEDIA_AUDIO_DEV_HAS_OBOE != 0 + +#define THIS_FILE "oboe_dev.cpp" +#define DRIVER_NAME "Oboe" + +#include +#include +#include +#include + +#include + + +/* Device info */ +typedef struct aud_dev_info +{ + pjmedia_aud_dev_info info; /**< Base info */ + int id; /**< Original dev ID */ +} aud_dev_info; + + +/* Oboe factory */ +struct oboe_aud_factory +{ + pjmedia_aud_dev_factory base; + pj_pool_factory *pf; + pj_pool_t *pool; + + pj_pool_t *dev_pool; /**< Device list pool */ + unsigned dev_count; /**< Device count */ + aud_dev_info *dev_info; /**< Device info list */ +}; + +class MyOboeEngine; + + +/* + * Sound stream descriptor. + * This struct may be used for both unidirectional or bidirectional sound + * streams. + */ +struct oboe_aud_stream +{ + pjmedia_aud_stream base; + pj_pool_t *pool; + pj_str_t name; + pjmedia_dir dir; + pjmedia_aud_param param; + struct oboe_aud_factory *f; + + int bytes_per_sample; + pj_uint32_t samples_per_sec; + unsigned samples_per_frame; + int channel_count; + void *user_data; + pj_bool_t running; + + /* Capture/record */ + MyOboeEngine *rec_engine; + pjmedia_aud_rec_cb rec_cb; + + /* Playback */ + MyOboeEngine *play_engine; + pjmedia_aud_play_cb play_cb; +}; + +/* Factory prototypes */ +static pj_status_t oboe_init(pjmedia_aud_dev_factory *f); +static pj_status_t oboe_destroy(pjmedia_aud_dev_factory *f); +static pj_status_t oboe_refresh(pjmedia_aud_dev_factory *f); +static unsigned oboe_get_dev_count(pjmedia_aud_dev_factory *f); +static pj_status_t oboe_get_dev_info(pjmedia_aud_dev_factory *f, + unsigned index, + pjmedia_aud_dev_info *info); +static pj_status_t oboe_default_param(pjmedia_aud_dev_factory *f, + unsigned index, + pjmedia_aud_param *param); +static pj_status_t oboe_create_stream(pjmedia_aud_dev_factory *f, + const pjmedia_aud_param *param, + pjmedia_aud_rec_cb rec_cb, + pjmedia_aud_play_cb play_cb, + void *user_data, + pjmedia_aud_stream **p_aud_strm); + +/* Stream prototypes */ +static pj_status_t strm_get_param(pjmedia_aud_stream *strm, + pjmedia_aud_param *param); +static pj_status_t strm_get_cap(pjmedia_aud_stream *strm, + pjmedia_aud_dev_cap cap, + void *value); +static pj_status_t strm_set_cap(pjmedia_aud_stream *strm, + pjmedia_aud_dev_cap cap, + const void *value); +static pj_status_t strm_start(pjmedia_aud_stream *strm); +static pj_status_t strm_stop(pjmedia_aud_stream *strm); +static pj_status_t strm_destroy(pjmedia_aud_stream *strm); + +static pjmedia_aud_dev_factory_op oboe_op = +{ + &oboe_init, + &oboe_destroy, + &oboe_get_dev_count, + &oboe_get_dev_info, + &oboe_default_param, + &oboe_create_stream, + &oboe_refresh +}; + +static pjmedia_aud_stream_op oboe_strm_op = +{ + &strm_get_param, + &strm_get_cap, + &strm_set_cap, + &strm_start, + &strm_stop, + &strm_destroy +}; + + +/* + * Init Android Oboe audio driver. + */ +#ifdef __cplusplus +extern "C"{ +#endif +pjmedia_aud_dev_factory* pjmedia_android_oboe_factory(pj_pool_factory *pf) +{ + struct oboe_aud_factory *f; + pj_pool_t *pool; + + pool = pj_pool_create(pf, "oboe", 256, 256, NULL); + f = PJ_POOL_ZALLOC_T(pool, struct oboe_aud_factory); + f->pf = pf; + f->pool = pool; + f->base.op = &oboe_op; + f->dev_pool = pj_pool_create(pf, "oboe_dev", 256, 256, NULL); + + return &f->base; +} +#ifdef __cplusplus +} +#endif + + +/* JNI stuff for enumerating audio devices. This will invoke Java code + * in pjmedia/src/pjmedia-audiodev/android/PjAudioDevInfo.java. + */ +#define PJ_AUDDEV_INFO_CLASS_PATH "org/pjsip/PjAudioDevInfo" + +static struct jni_objs_t +{ + struct { + jclass cls; + jmethodID m_get_cnt; + jmethodID m_get_info; + jmethodID m_refresh; + jfieldID f_id; + jfieldID f_name; + jfieldID f_direction; + jfieldID f_sup_clockrates; + jfieldID f_sup_channels; + } dev_info; + + struct { + jclass cls; + jmethodID m_current; + jmethodID m_get_app; + } activity_thread; + +} jobjs; + + +/* Declare JNI JVM helper from PJLIB OS */ +extern "C" { + pj_bool_t pj_jni_attach_jvm(JNIEnv **jni_env); + void pj_jni_dettach_jvm(pj_bool_t attached); +} + +#define GET_CLASS(class_path, class_name, cls) \ + cls = jni_env->FindClass(class_path); \ + if (cls == NULL || jni_env->ExceptionCheck()) { \ + jni_env->ExceptionClear(); \ + PJ_LOG(3, (THIS_FILE, "[JNI] Unable to find class '" \ + class_name "'")); \ + status = PJMEDIA_EAUD_SYSERR; \ + goto on_return; \ + } else { \ + jclass tmp = cls; \ + cls = (jclass)jni_env->NewGlobalRef(tmp); \ + jni_env->DeleteLocalRef(tmp); \ + if (cls == NULL) { \ + PJ_LOG(3, (THIS_FILE, "[JNI] Unable to get global ref for " \ + "class '" class_name "'")); \ + status = PJMEDIA_EAUD_SYSERR; \ + goto on_return; \ + } \ + } +#define GET_METHOD_ID(cls, class_name, method_name, signature, id) \ + id = jni_env->GetMethodID(cls, method_name, signature); \ + if (id == 0) { \ + PJ_LOG(3, (THIS_FILE, "[JNI] Unable to find method '" method_name \ + "' in class '" class_name "'")); \ + status = PJMEDIA_EAUD_SYSERR; \ + goto on_return; \ + } +#define GET_SMETHOD_ID(cls, class_name, method_name, signature, id) \ + id = jni_env->GetStaticMethodID(cls, method_name, signature); \ + if (id == 0) { \ + PJ_LOG(3, (THIS_FILE, "[JNI] Unable to find static method '" \ + method_name "' in class '" class_name "'")); \ + status = PJMEDIA_EAUD_SYSERR; \ + goto on_return; \ + } +#define GET_FIELD_ID(cls, class_name, field_name, signature, id) \ + id = jni_env->GetFieldID(cls, field_name, signature); \ + if (id == 0) { \ + PJ_LOG(3, (THIS_FILE, "[JNI] Unable to find field '" field_name \ + "' in class '" class_name "'")); \ + status = PJMEDIA_EAUD_SYSERR; \ + goto on_return; \ + } + +/* Get Java object IDs (via FindClass, GetMethodID, GetFieldID, etc). + * Note that this function should be called from library-loader thread, + * otherwise FindClass, etc, may fail, see: + * http://developer.android.com/training/articles/perf-jni.html#faq_FindClass + */ +static pj_status_t jni_init_ids() +{ + JNIEnv *jni_env; + pj_status_t status = PJ_SUCCESS; + pj_bool_t with_attach = pj_jni_attach_jvm(&jni_env); + + /* PjAudioDevInfo class info */ + GET_CLASS(PJ_AUDDEV_INFO_CLASS_PATH, "PjAudioDevInfo", jobjs.dev_info.cls); + GET_SMETHOD_ID(jobjs.dev_info.cls, "PjAudioDevInfo", "GetCount", "()I", + jobjs.dev_info.m_get_cnt); + GET_SMETHOD_ID(jobjs.dev_info.cls, "PjAudioDevInfo", "GetInfo", + "(I)L" PJ_AUDDEV_INFO_CLASS_PATH ";", + jobjs.dev_info.m_get_info); + GET_SMETHOD_ID(jobjs.dev_info.cls, "PjAudioDevInfo", "RefreshDevices", + "(Landroid/content/Context;)V", + jobjs.dev_info.m_refresh); + GET_FIELD_ID(jobjs.dev_info.cls, "PjAudioDevInfo", "id", "I", + jobjs.dev_info.f_id); + GET_FIELD_ID(jobjs.dev_info.cls, "PjAudioDevInfo", "name", "Ljava/lang/String;", + jobjs.dev_info.f_name); + GET_FIELD_ID(jobjs.dev_info.cls, "PjAudioDevInfo", "direction", "I", + jobjs.dev_info.f_direction); + GET_FIELD_ID(jobjs.dev_info.cls, "PjAudioDevInfo", "supportedClockRates", "[I", + jobjs.dev_info.f_sup_clockrates); + GET_FIELD_ID(jobjs.dev_info.cls, "PjAudioDevInfo", "supportedChannelCounts", "[I", + jobjs.dev_info.f_sup_channels); + + /* ActivityThread class info */ + GET_CLASS("android/app/ActivityThread", "ActivityThread", + jobjs.activity_thread.cls); + GET_SMETHOD_ID(jobjs.activity_thread.cls, "ActivityThread", + "currentActivityThread", "()Landroid/app/ActivityThread;", + jobjs.activity_thread.m_current); + GET_METHOD_ID(jobjs.activity_thread.cls, "ActivityThread", + "getApplication", "()Landroid/app/Application;", + jobjs.activity_thread.m_get_app); + +on_return: + pj_jni_dettach_jvm(with_attach); + return status; +} + +#undef GET_CLASS_ID +#undef GET_METHOD_ID +#undef GET_SMETHOD_ID +#undef GET_FIELD_ID + +static void jni_deinit_ids() +{ + JNIEnv *jni_env; + pj_bool_t with_attach = pj_jni_attach_jvm(&jni_env); + + if (jobjs.dev_info.cls) { + jni_env->DeleteGlobalRef(jobjs.dev_info.cls); + jobjs.dev_info.cls = NULL; + } + + if (jobjs.activity_thread.cls) { + jni_env->DeleteGlobalRef(jobjs.activity_thread.cls); + jobjs.activity_thread.cls = NULL; + } + + pj_jni_dettach_jvm(with_attach); +} + +static jobject get_global_context(JNIEnv *jni_env) +{ + jobject context = NULL; + jobject cur_at = jni_env->CallStaticObjectMethod( + jobjs.activity_thread.cls, + jobjs.activity_thread.m_current); + if (cur_at==NULL) + return NULL; + + context = jni_env->CallObjectMethod(cur_at, + jobjs.activity_thread.m_get_app); + return context; +} + + +/* API: Init factory */ +static pj_status_t oboe_init(pjmedia_aud_dev_factory *f) +{ + pj_status_t status; + + status = jni_init_ids(); + if (status != PJ_SUCCESS) + return status; + + status = oboe_refresh(f); + if (status != PJ_SUCCESS) + return status; + + return PJ_SUCCESS; +} + + +/* API: refresh the list of devices */ +static pj_status_t oboe_refresh(pjmedia_aud_dev_factory *ff) +{ + struct oboe_aud_factory *f = (struct oboe_aud_factory*)ff; + JNIEnv *jni_env; + pj_bool_t with_attach; + int i, dev_count = 0; + pj_status_t status = PJ_SUCCESS; + + /* Clean up device info and pool */ + f->dev_count = 0; + pj_pool_reset(f->dev_pool); + + with_attach = pj_jni_attach_jvm(&jni_env); + + jobject context = get_global_context(jni_env); + if (context == NULL) { + PJ_LOG(3, (THIS_FILE, "Failed to get context")); + status = PJMEDIA_EAUD_SYSERR; + goto on_return; + } + + /* PjAudioDevInfo::RefreshDevices(Context) */ + jni_env->CallStaticVoidMethod(jobjs.dev_info.cls, + jobjs.dev_info.m_refresh, context); + + /* dev_count = PjAudioDevInfo::GetCount() */ + dev_count = jni_env->CallStaticIntMethod(jobjs.dev_info.cls, + jobjs.dev_info.m_get_cnt); + if (dev_count < 0) { + PJ_LOG(3, (THIS_FILE, "Failed to get camera count")); + status = PJMEDIA_EAUD_SYSERR; + goto on_return; + } + + /* Start querying device info */ + f->dev_info = (aud_dev_info*) + pj_pool_calloc(f->dev_pool, dev_count, + sizeof(aud_dev_info)); + + for (i = 0; i < dev_count; i++) { + aud_dev_info *adi = &f->dev_info[f->dev_count]; + pjmedia_aud_dev_info *base_adi = &adi->info; + jobject jdev_info; + jint jinttmp; + + /* jdev_info = PjAudioDevInfo::GetInfo(i) */ + jdev_info = jni_env->CallStaticObjectMethod( + jobjs.dev_info.cls, + jobjs.dev_info.m_get_info, + i); + if (jdev_info == NULL) + continue; + + /* Get device ID, direction, etc */ + adi->id = jni_env->GetIntField(jdev_info, jobjs.dev_info.f_id); + jinttmp = jni_env->GetIntField(jdev_info, jobjs.dev_info.f_direction); + base_adi->input_count = (jinttmp & PJMEDIA_DIR_CAPTURE); + base_adi->output_count = (jinttmp & PJMEDIA_DIR_PLAYBACK); + base_adi->caps = 0; + + /* Get name info */ + jstring jstrtmp = (jstring)jni_env->GetObjectField(jdev_info, jobjs.dev_info.f_name); + const char *strtmp = jni_env->GetStringUTFChars(jstrtmp, NULL); + pj_ansi_strncpy(base_adi->name, strtmp, sizeof(base_adi->name)); + + f->dev_count++; + + on_skip_dev: + jni_env->DeleteLocalRef(jdev_info); + } + + PJ_LOG(4, (THIS_FILE, + "Oboe audio device initialized with %d device(s):", + f->dev_count)); + + for (i = 0; i < f->dev_count; i++) { + aud_dev_info *adi = &f->dev_info[i]; + PJ_LOG(4, (THIS_FILE, "%2d (native id=%d): %s (%s%s%s)", + i, adi->id, adi->info.name, + adi->info.input_count?"in":"", + adi->info.input_count && adi->info.output_count?"+":"", + adi->info.output_count?"out":"" + )); + } + +on_return: + if (context) + jni_env->DeleteLocalRef(context); + + pj_jni_dettach_jvm(with_attach); + return status; +} + + +/* API: Destroy factory */ +static pj_status_t oboe_destroy(pjmedia_aud_dev_factory *f) +{ + struct oboe_aud_factory *pa = (struct oboe_aud_factory*)f; + pj_pool_t *pool; + + PJ_LOG(4, (THIS_FILE, "Oboe sound library shutting down..")); + + jni_deinit_ids(); + + pool = pa->pool; + pa->pool = NULL; + pj_pool_release(pool); + + return PJ_SUCCESS; +} + +/* API: Get device count. */ +static unsigned oboe_get_dev_count(pjmedia_aud_dev_factory *ff) +{ + struct oboe_aud_factory *f = (struct oboe_aud_factory*)ff; + return f->dev_count; +} + +/* API: Get device info. */ +static pj_status_t oboe_get_dev_info(pjmedia_aud_dev_factory *ff, + unsigned index, + pjmedia_aud_dev_info *info) +{ + struct oboe_aud_factory *f = (struct oboe_aud_factory*)ff; + + PJ_ASSERT_RETURN(index < f->dev_count, PJMEDIA_EAUD_INVDEV); + + pj_memcpy(info, &f->dev_info[index].info, sizeof(*info)); + + return PJ_SUCCESS; +} + +/* API: fill in with default parameter. */ +static pj_status_t oboe_default_param(pjmedia_aud_dev_factory *ff, + unsigned index, + pjmedia_aud_param *param) +{ + struct oboe_aud_factory *f = (struct oboe_aud_factory*)ff; + pjmedia_aud_dev_info adi; + pj_status_t status; + + PJ_ASSERT_RETURN(index < f->dev_count, PJMEDIA_EAUD_INVDEV); + + status = oboe_get_dev_info(ff, index, &adi); + if (status != PJ_SUCCESS) + return status; + + pj_bzero(param, sizeof(*param)); + if (adi.input_count && adi.output_count) { + param->dir = PJMEDIA_DIR_CAPTURE_PLAYBACK; + param->rec_id = index; + param->play_id = index; + } else if (adi.input_count) { + param->dir = PJMEDIA_DIR_CAPTURE; + param->rec_id = index; + param->play_id = PJMEDIA_AUD_INVALID_DEV; + } else if (adi.output_count) { + param->dir = PJMEDIA_DIR_PLAYBACK; + param->play_id = index; + param->rec_id = PJMEDIA_AUD_INVALID_DEV; + } else { + return PJMEDIA_EAUD_INVDEV; + } + + param->clock_rate = adi.default_samples_per_sec; + param->channel_count = 1; + param->samples_per_frame = adi.default_samples_per_sec * 20 / 1000; + param->bits_per_sample = 16; + param->input_latency_ms = PJMEDIA_SND_DEFAULT_REC_LATENCY; + param->output_latency_ms = PJMEDIA_SND_DEFAULT_PLAY_LATENCY; + + return PJ_SUCCESS; +} + + +/* Atomic queue (ring buffer) for single consumer & single producer. + * + * Producer invokes 'put(frame)' to put a frame to the back of the queue and + * consumer invokes 'get(frame)' to get a frame from the head of the queue. + * + * For producer, there is write pointer 'ptrWrite' that will be incremented + * every time a frame is queued to the back of the queue. If the queue is + * almost full (the write pointer is right before the read pointer) the + * producer will forcefully discard the oldest frame in the head of the + * queue by incrementing read pointer. + * + * For consumer, there is read pointer 'ptrRead' that will be incremented + * every time a frame is fetched from the head of the queue, only if the + * pointer is not modified by producer (in case of queue full). + */ +class AtomicQueue { +public: + + AtomicQueue(unsigned max_frame_cnt, unsigned frame_size, + const char* name_= "") : + maxFrameCnt(max_frame_cnt), frameSize(frame_size), + ptrWrite(0), ptrRead(0), + buffer(NULL), name(name_) + { + buffer = new char[maxFrameCnt * frameSize]; + + /* Surpress warning when debugging log is disabled */ + PJ_UNUSED_ARG(name); + } + + ~AtomicQueue() { + delete [] buffer; + } + + /* Get a frame from the head of the queue */ + bool get(void* frame) { + if (ptrRead == ptrWrite) + return false; + + unsigned cur_ptr = ptrRead; + void *p = &buffer[cur_ptr * frameSize]; + pj_memcpy(frame, p, frameSize); + inc_ptr_read_if_not_yet(cur_ptr); + + //__android_log_print(ANDROID_LOG_INFO, name, + // "GET: ptrRead=%d ptrWrite=%d\n", + // ptrRead.load(), ptrWrite.load()); + return true; + } + + /* Put a frame to the back of the queue */ + void put(void* frame) { + unsigned cur_ptr = ptrWrite; + void *p = &buffer[cur_ptr * frameSize]; + pj_memcpy(p, frame, frameSize); + unsigned next_ptr = inc_ptr_write(cur_ptr); + + /* Increment read pointer if next write is overlapping (next_ptr == read ptr) */ + unsigned next_read_ptr = (next_ptr == maxFrameCnt-1)? 0 : (next_ptr+1); + ptrRead.compare_exchange_strong(next_ptr, next_read_ptr); + + //__android_log_print(ANDROID_LOG_INFO, name, + // "PUT: ptrRead=%d ptrWrite=%d\n", + // ptrRead.load(), ptrWrite.load()); + } + +private: + + unsigned maxFrameCnt; + unsigned frameSize; + std::atomic ptrWrite; + std::atomic ptrRead; + char *buffer; + const char *name; + + /* Increment read pointer, only if producer not incemented it already. + * Producer may increment the read pointer if the write pointer is + * right before the read pointer (buffer almost full). + */ + bool inc_ptr_read_if_not_yet(unsigned old_ptr) { + unsigned new_ptr = (old_ptr == maxFrameCnt-1)? 0 : (old_ptr+1); + return ptrRead.compare_exchange_strong(old_ptr, new_ptr); + } + + /* Increment write pointer */ + unsigned inc_ptr_write(unsigned old_ptr) { + unsigned new_ptr = (old_ptr == maxFrameCnt-1)? 0 : (old_ptr+1); + if (ptrWrite.compare_exchange_strong(old_ptr, new_ptr)) + return new_ptr; + + /* Should never happen */ + pj_assert(!"There is more than one producer!"); + return old_ptr; + } + + AtomicQueue() {} +}; + + +/* Interface to Oboe */ +class MyOboeEngine : oboe::AudioStreamDataCallback, + oboe::AudioStreamErrorCallback +{ +public: + MyOboeEngine(struct oboe_aud_stream *stream_, pjmedia_dir dir_) + : stream(stream_), dir(dir_), oboe_stream(NULL), dir_st(NULL), + thread(NULL), thread_quit(PJ_FALSE), queue(NULL), + err_thread_registered(false) + { + pj_assert(dir == PJMEDIA_DIR_CAPTURE || dir == PJMEDIA_DIR_PLAYBACK); + dir_st = (dir == PJMEDIA_DIR_CAPTURE? "capture":"playback"); + pj_set_timestamp32(&ts, 0, 0); + } + + pj_status_t Start() { + if (oboe_stream) + return PJ_SUCCESS; + + int dev_id = 0; + oboe::AudioStreamBuilder sb; + pj_status_t status; + + if (dir == PJMEDIA_DIR_CAPTURE) { + sb.setDirection(oboe::Direction::Input); + if (stream->param.rec_id >= 0 && + stream->param.rec_id < stream->f->dev_count) + { + dev_id = stream->f->dev_info[stream->param.rec_id].id; + } + } else { + sb.setDirection(oboe::Direction::Output); + if (stream->param.play_id >= 0 && + stream->param.play_id < stream->f->dev_count) + { + dev_id = stream->f->dev_info[stream->param.play_id].id; + } + } + sb.setDeviceId(dev_id); + sb.setSampleRate(stream->param.clock_rate); + sb.setChannelCount(stream->param.channel_count); + sb.setPerformanceMode(oboe::PerformanceMode::LowLatency); + sb.setFormat(oboe::AudioFormat::I16); + sb.setDataCallback(this); + sb.setErrorCallback(this); + sb.setFramesPerDataCallback(stream->param.samples_per_frame / + stream->param.channel_count); + + /* Somehow mic does not work on Samsung S10 (get no error and + * low latency, but callback is never invoked) if sample rate + * conversion is specified. If it is not specified (default is None), + * mic does not get low latency on, but it works. + */ + if (dir == PJMEDIA_DIR_PLAYBACK) { + sb.setSampleRateConversionQuality( + oboe::SampleRateConversionQuality::High); + + /* Also if mic is Exclusive, it won't reopen after + * plug/unplug headset (on Samsung S10). + */ + sb.setSharingMode(oboe::SharingMode::Exclusive); + } + + /* Create queue */ + unsigned latency = (dir == PJMEDIA_DIR_CAPTURE? + stream->param.input_latency_ms : + stream->param.output_latency_ms); + unsigned queue_size = latency * stream->param.clock_rate * + stream->param.channel_count / 1000 / + stream->param.samples_per_frame; + + /* Normalize queue size to be in range of 3-10 frames */ + if (queue_size < 3) queue_size = 3; + if (queue_size > 10) queue_size = 10; + + PJ_LOG(3,(THIS_FILE, + "Oboe stream %s queue size=%d frames (latency=%d ms)", + dir_st, queue_size, latency)); + + queue = new AtomicQueue(queue_size, stream->param.samples_per_frame*2, + dir_st); + + /* Create semaphore */ + if (sem_init(&sem, 0, 0) != 0) { + return PJ_RETURN_OS_ERROR(pj_get_native_os_error()); + } + + /* Create thread */ + thread_quit = PJ_FALSE; + status = pj_thread_create(stream->pool, "android_oboe", + AudioThread, this, 0, 0, &thread); + if (status != PJ_SUCCESS) + return status; + + /* Open & start oboe stream */ + oboe::Result result = sb.openStream(&oboe_stream); + if (result != oboe::Result::OK) { + PJ_LOG(3,(THIS_FILE, + "Oboe stream %s open failed (err=%d/%s)", + dir_st, result, oboe::convertToText(result))); + return PJMEDIA_EAUD_SYSERR; + } + + result = oboe_stream->requestStart(); + if (result != oboe::Result::OK) { + PJ_LOG(3,(THIS_FILE, + "Oboe stream %s start failed (err=%d/%s)", + dir_st, result, oboe::convertToText(result))); + return PJMEDIA_EAUD_SYSERR; + } + + PJ_LOG(4, (THIS_FILE, + "Oboe stream %s started, " + "id=%d, clock_rate=%d, channel_count=%d, " + "samples_per_frame=%d (%dms), " + "API=%d/%s, exclusive=%s, low latency=%s, " + "size per callback=%d, buffer capacity=%d, burst size=%d", + dir_st, + stream->param.play_id, + stream->param.clock_rate, + stream->param.channel_count, + stream->param.samples_per_frame, + stream->param.samples_per_frame * 1000 / + stream->param.clock_rate, + oboe_stream->getAudioApi(), + (oboe_stream->usesAAudio()? "AAudio":"other"), + (oboe_stream->getSharingMode()== + oboe::SharingMode::Exclusive? "yes":"no"), + (oboe_stream->getPerformanceMode()== + oboe::PerformanceMode::LowLatency? "yes":"no"), + oboe_stream->getFramesPerDataCallback()* + stream->param.channel_count, + oboe_stream->getBufferCapacityInFrames(), + oboe_stream->getFramesPerBurst() + )); + + return PJ_SUCCESS; + } + + void Stop() { + if (oboe_stream) { + oboe_stream->close(); + delete oboe_stream; + oboe_stream = NULL; + } + + if (thread) { + thread_quit = PJ_TRUE; + sem_post(&sem); + pj_thread_join(thread); + pj_thread_destroy(thread); + thread = NULL; + sem_destroy(&sem); + } + + if (queue) { + delete queue; + queue = NULL; + } + + PJ_LOG(4, (THIS_FILE, "Oboe stream %s stopped.", dir_st)); + } + + /* Oboe callback, here let's just use Android native mutex & semaphore + * so we don't need to register the thread to PJLIB. + */ + oboe::DataCallbackResult onAudioReady(oboe::AudioStream *oboeStream, + void *audioData, + int32_t numFrames) + { + if (dir == PJMEDIA_DIR_CAPTURE) { + /* Put the audio frame to queue */ + queue->put(audioData); + } else { + /* Get audio frame from queue */ + if (!queue->get(audioData)) { + pj_bzero(audioData, stream->param.samples_per_frame*2); + __android_log_write(ANDROID_LOG_WARN, THIS_FILE, + "Oboe playback got an empty queue"); + } + } + + sem_post(&sem); + + return oboe::DataCallbackResult::Continue; + } + + void onErrorAfterClose(oboe::AudioStream *oboeStream, oboe::Result result) + { + /* Register callback thread */ + if (!err_thread_registered || !pj_thread_is_registered()) + { + pj_thread_t* tmp_thread; + pj_bzero(err_thread_desc, sizeof(pj_thread_desc)); + pj_thread_register("oboe_err_thread", err_thread_desc, + &tmp_thread); + err_thread_registered = true; + } + + PJ_LOG(3,(THIS_FILE, + "Oboe stream %s error (%d/%s), trying to restart stream..", + dir_st, result, oboe::convertToText(result))); + + /* Just try to restart */ + Stop(); + Start(); + } + + ~MyOboeEngine() { + Stop(); + } + +private: + + static int AudioThread(void *arg) { + MyOboeEngine *this_ = (MyOboeEngine*)arg; + struct oboe_aud_stream *stream = this_->stream; + pj_int16_t *tmp_buf; + unsigned ts_inc; + pj_status_t status; + + /* Try to bump up the thread priority */ + enum { + THREAD_PRIORITY_AUDIO = -16, + THREAD_PRIORITY_URGENT_AUDIO = -19 + }; + status = pj_thread_set_prio(NULL, THREAD_PRIORITY_URGENT_AUDIO); + if (status != PJ_SUCCESS) { + PJ_PERROR(3,(THIS_FILE, status, + "Warning: Oboe %s failed increasing thread priority", + this_->dir_st)); + } + + tmp_buf = new pj_int16_t[this_->stream->param.samples_per_frame](); + ts_inc = stream->param.samples_per_frame/stream->param.channel_count; + + /* Queue a silent frame to playback buffer */ + if (this_->dir == PJMEDIA_DIR_PLAYBACK) { + this_->queue->put(tmp_buf); + } + + while (1) { + sem_wait(&this_->sem); + if (this_->thread_quit) + break; + + if (this_->dir == PJMEDIA_DIR_CAPTURE) { + unsigned cnt = 0; + bool stop_stream = false; + + /* Read audio frames from Oboe */ + while (this_->queue->get(tmp_buf)) { + /* Send audio frame to app via callback rec_cb() */ + pjmedia_frame frame; + frame.type = PJMEDIA_FRAME_TYPE_AUDIO; + frame.size = stream->param.samples_per_frame * 2; + frame.bit_info = 0; + frame.buf = (void *)tmp_buf; + frame.timestamp = this_->ts; + status = (*stream->rec_cb)(stream->user_data, &frame); + if (status != PJ_SUCCESS) { + /* App wants to stop audio dev stream */ + stop_stream = true; + break; + } + + /* Increment timestamp */ + pj_add_timestamp32(&this_->ts, ts_inc); + ++cnt; + } + + if (stop_stream) + break; + + /* Print log for debugging purpose */ + if (cnt == 0) { + PJ_LOG(5,(THIS_FILE, "Oboe %s got an empty queue", + this_->dir_st)); + } else if (cnt > 1) { + PJ_LOG(5,(THIS_FILE, "Oboe %s got a burst of %d frames", + this_->dir_st, cnt)); + } + } else { + /* Get audio frame from app via callback play_cb() */ + pjmedia_frame frame; + frame.type = PJMEDIA_FRAME_TYPE_AUDIO; + frame.size = stream->param.samples_per_frame * 2; + frame.bit_info = 0; + frame.buf = (void *)tmp_buf; + frame.timestamp = this_->ts; + status = (*stream->play_cb)(stream->user_data, &frame); + + /* Send audio frame to Oboe */ + if (status == PJ_SUCCESS) { + this_->queue->put(tmp_buf); + } else { + /* App wants to stop audio dev stream */ + break; + } + + /* Increment timestamp */ + pj_add_timestamp32(&this_->ts, ts_inc); + } + } + + delete [] tmp_buf; + return 0; + } + +private: + struct oboe_aud_stream *stream; + pjmedia_dir dir; + oboe::AudioStream *oboe_stream; + const char *dir_st; + pj_thread_t *thread; + pj_bool_t thread_quit; + sem_t sem; + AtomicQueue *queue; + pj_timestamp ts; + bool err_thread_registered; + pj_thread_desc err_thread_desc; + +}; + + +/* API: create stream */ +static pj_status_t oboe_create_stream(pjmedia_aud_dev_factory *f, + const pjmedia_aud_param *param, + pjmedia_aud_rec_cb rec_cb, + pjmedia_aud_play_cb play_cb, + void *user_data, + pjmedia_aud_stream **p_aud_strm) +{ + struct oboe_aud_factory *pa = (struct oboe_aud_factory*)f; + pj_pool_t *pool; + struct oboe_aud_stream *stream; + pj_status_t status = PJ_SUCCESS; + + PJ_ASSERT_RETURN(param->channel_count >= 1 && param->channel_count <= 2, + PJ_EINVAL); + PJ_ASSERT_RETURN(param->bits_per_sample==8 || param->bits_per_sample==16, + PJ_EINVAL); + PJ_ASSERT_RETURN(play_cb && rec_cb && p_aud_strm, PJ_EINVAL); + + pool = pj_pool_create(pa->pf, "oboestrm", 1024, 1024, NULL); + if (!pool) + return PJ_ENOMEM; + + PJ_LOG(4, (THIS_FILE, "Creating Oboe stream")); + + stream = PJ_POOL_ZALLOC_T(pool, struct oboe_aud_stream); + stream->pool = pool; + stream->f = pa; + pj_strdup2_with_null(pool, &stream->name, "Oboe stream"); + stream->dir = param->dir; + pj_memcpy(&stream->param, param, sizeof(*param)); + stream->user_data = user_data; + stream->rec_cb = rec_cb; + stream->play_cb = play_cb; + + if (param->dir & PJMEDIA_DIR_CAPTURE) { + stream->rec_engine = new MyOboeEngine(stream, PJMEDIA_DIR_CAPTURE); + if (!stream->rec_engine) { + status = PJ_ENOMEM; + goto on_error; + } + } + + if (stream->dir & PJMEDIA_DIR_PLAYBACK) { + stream->play_engine = new MyOboeEngine(stream, PJMEDIA_DIR_PLAYBACK); + if (!stream->play_engine) { + status = PJ_ENOMEM; + goto on_error; + } + } + + /* Done */ + stream->base.op = &oboe_strm_op; + *p_aud_strm = &stream->base; + + return PJ_SUCCESS; + +on_error: + strm_destroy(&stream->base); + return status; +} + +/* API: Get stream parameters */ +static pj_status_t strm_get_param(pjmedia_aud_stream *s, + pjmedia_aud_param *pi) +{ + struct oboe_aud_stream *strm = (struct oboe_aud_stream*)s; + PJ_ASSERT_RETURN(strm && pi, PJ_EINVAL); + pj_memcpy(pi, &strm->param, sizeof(*pi)); + + return PJ_SUCCESS; +} + +/* API: get capability */ +static pj_status_t strm_get_cap(pjmedia_aud_stream *s, + pjmedia_aud_dev_cap cap, + void *pval) +{ + struct oboe_aud_stream *strm = (struct oboe_aud_stream*)s; + pj_status_t status = PJMEDIA_EAUD_INVCAP; + + PJ_UNUSED_ARG(strm); + + PJ_ASSERT_RETURN(s && pval, PJ_EINVAL); + + return status; +} + +/* API: set capability */ +static pj_status_t strm_set_cap(pjmedia_aud_stream *s, + pjmedia_aud_dev_cap cap, + const void *value) +{ + struct oboe_aud_stream *strm = (struct oboe_aud_stream*)s; + + PJ_UNUSED_ARG(strm); + + PJ_ASSERT_RETURN(s && value, PJ_EINVAL); + + return PJMEDIA_EAUD_INVCAP; +} + +/* API: start stream. */ +static pj_status_t strm_start(pjmedia_aud_stream *s) +{ + struct oboe_aud_stream *stream = (struct oboe_aud_stream*)s; + pj_status_t status; + + if (stream->running) + return PJ_SUCCESS; + + if (stream->rec_engine) { + status = stream->rec_engine->Start(); + if (status != PJ_SUCCESS) + goto on_error; + } + if (stream->play_engine) { + status = stream->play_engine->Start(); + if (status != PJ_SUCCESS) + goto on_error; + } + + stream->running = PJ_TRUE; + PJ_LOG(4, (THIS_FILE, "Oboe stream started")); + + return PJ_SUCCESS; + +on_error: + if (stream->rec_engine) + stream->rec_engine->Stop(); + if (stream->play_engine) + stream->play_engine->Stop(); + + PJ_LOG(4, (THIS_FILE, "Failed starting Oboe stream")); + + return status; +} + +/* API: stop stream. */ +static pj_status_t strm_stop(pjmedia_aud_stream *s) +{ + struct oboe_aud_stream *stream = (struct oboe_aud_stream*)s; + + if (!stream->running) + return PJ_SUCCESS; + + stream->running = PJ_FALSE; + + if (stream->rec_engine) + stream->rec_engine->Stop(); + if (stream->play_engine) + stream->play_engine->Stop(); + + PJ_LOG(4,(THIS_FILE, "Oboe stream stopped")); + + return PJ_SUCCESS; +} + +/* API: destroy stream. */ +static pj_status_t strm_destroy(pjmedia_aud_stream *s) +{ + struct oboe_aud_stream *stream = (struct oboe_aud_stream*)s; + + PJ_LOG(4,(THIS_FILE, "Destroying Oboe stream...")); + + /* Stop the stream */ + strm_stop(s); + + pj_pool_release(stream->pool); + PJ_LOG(4, (THIS_FILE, "Oboe stream destroyed")); + + return PJ_SUCCESS; +} + +#endif /* PJMEDIA_AUDIO_DEV_HAS_OBOE */ diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjmedia/src/pjmedia-codec/and_aud_mediacodec.cpp asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjmedia/src/pjmedia-codec/and_aud_mediacodec.cpp --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjmedia/src/pjmedia-codec/and_aud_mediacodec.cpp 1970-01-01 00:00:00.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjmedia/src/pjmedia-codec/and_aud_mediacodec.cpp 2022-02-24 07:54:38.000000000 +0000 @@ -0,0 +1,1373 @@ +/* + * Copyright (C)2020 Teluu Inc. (http://www.teluu.com) + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +/* + * Only build this file if PJMEDIA_HAS_ANDROID_MEDIACODEC != 0 + */ +#if defined(PJMEDIA_HAS_ANDROID_MEDIACODEC) && \ + PJMEDIA_HAS_ANDROID_MEDIACODEC != 0 + +/* Android AMediaCodec: */ +#include "media/NdkMediaCodec.h" + +#define THIS_FILE "and_aud_mediacodec.cpp" + +#define AND_MEDIA_KEY_PCM_ENCODING "pcm-encoding" +#define AND_MEDIA_KEY_CHANNEL_COUNT "channel-count" +#define AND_MEDIA_KEY_SAMPLE_RATE "sample-rate" +#define AND_MEDIA_KEY_BITRATE "bitrate" +#define AND_MEDIA_KEY_MIME "mime" + +#define CODEC_WAIT_RETRY 10 +#define CODEC_THREAD_WAIT 10 +/* Timeout until the buffer is ready in ms. */ +#define CODEC_DEQUEUE_TIMEOUT 10 + +/* Prototypes for Android MediaCodec codecs factory */ +static pj_status_t and_media_test_alloc(pjmedia_codec_factory *factory, + const pjmedia_codec_info *id ); +static pj_status_t and_media_default_attr(pjmedia_codec_factory *factory, + const pjmedia_codec_info *id, + pjmedia_codec_param *attr ); +static pj_status_t and_media_enum_codecs(pjmedia_codec_factory *factory, + unsigned *count, + pjmedia_codec_info codecs[]); +static pj_status_t and_media_alloc_codec(pjmedia_codec_factory *factory, + const pjmedia_codec_info *id, + pjmedia_codec **p_codec); +static pj_status_t and_media_dealloc_codec(pjmedia_codec_factory *factory, + pjmedia_codec *codec ); + +/* Prototypes for Android MediaCodec codecs implementation. */ +static pj_status_t and_media_codec_init(pjmedia_codec *codec, + pj_pool_t *pool ); +static pj_status_t and_media_codec_open(pjmedia_codec *codec, + pjmedia_codec_param *attr ); +static pj_status_t and_media_codec_close(pjmedia_codec *codec ); +static pj_status_t and_media_codec_modify(pjmedia_codec *codec, + const pjmedia_codec_param *attr ); +static pj_status_t and_media_codec_parse(pjmedia_codec *codec, + void *pkt, + pj_size_t pkt_size, + const pj_timestamp *ts, + unsigned *frame_cnt, + pjmedia_frame frames[]); +static pj_status_t and_media_codec_encode(pjmedia_codec *codec, + const struct pjmedia_frame *input, + unsigned output_buf_len, + struct pjmedia_frame *output); +static pj_status_t and_media_codec_decode(pjmedia_codec *codec, + const struct pjmedia_frame *input, + unsigned output_buf_len, + struct pjmedia_frame *output); +static pj_status_t and_media_codec_recover(pjmedia_codec *codec, + unsigned output_buf_len, + struct pjmedia_frame *output); + +/* Definition for Android MediaCodec codecs operations. */ +static pjmedia_codec_op and_media_op = +{ + &and_media_codec_init, + &and_media_codec_open, + &and_media_codec_close, + &and_media_codec_modify, + &and_media_codec_parse, + &and_media_codec_encode, + &and_media_codec_decode, + &and_media_codec_recover +}; + +/* Definition for Android MediaCodec codecs factory operations. */ +static pjmedia_codec_factory_op and_media_factory_op = +{ + &and_media_test_alloc, + &and_media_default_attr, + &and_media_enum_codecs, + &and_media_alloc_codec, + &and_media_dealloc_codec, + &pjmedia_codec_and_media_aud_deinit +}; + +/* Android MediaCodec codecs factory */ +static struct and_media_factory { + pjmedia_codec_factory base; + pjmedia_endpt *endpt; + pj_pool_t *pool; + pj_mutex_t *mutex; +} and_media_factory; + +typedef enum and_aud_codec_id { + /* AMRNB codec. */ + AND_AUD_CODEC_AMRNB, + + /* AMRWB codec. */ + AND_AUD_CODEC_AMRWB +} and_aud_codec_id; + +/* Android MediaCodec codecs private data. */ +typedef struct and_media_private { + int codec_idx; /**< Codec index. */ + void *codec_setting; /**< Specific codec setting. */ + pj_pool_t *pool; /**< Pool for each instance. */ + AMediaCodec *enc; /**< Encoder state. */ + AMediaCodec *dec; /**< Decoder state. */ + + pj_uint16_t frame_size; /**< Bitstream frame size. */ + + pj_bool_t plc_enabled; /**< PLC enabled flag. */ + pjmedia_plc *plc; /**< PJMEDIA PLC engine, NULL if + codec has internal PLC. */ + + pj_bool_t vad_enabled; /**< VAD enabled flag. */ + pjmedia_silence_det *vad; /**< PJMEDIA VAD engine, NULL if + codec has internal VAD. */ + pj_timestamp last_tx; /**< Timestamp of last transmit.*/ +} and_media_private_t; + +/* CUSTOM CALLBACKS */ + +/* Parse frames from a packet. Default behaviour of frame parsing is + * just separating frames based on calculating frame length derived + * from bitrate. Implement this callback when the default behaviour is + * unapplicable. + */ +typedef pj_status_t (*parse_cb)(and_media_private_t *codec_data, void *pkt, + pj_size_t pkt_size, const pj_timestamp *ts, + unsigned *frame_cnt, pjmedia_frame frames[]); + +/* Pack frames into a packet. Default behaviour of packing frames is + * just stacking the frames with octet aligned without adding any + * payload header. Implement this callback when the default behaviour is + * unapplicable. + */ +typedef pj_status_t (*pack_cb)(and_media_private_t *codec_data, + unsigned nframes, void *pkt, pj_size_t *pkt_size, + pj_size_t max_pkt_size); + +/* This callback is useful for preparing a frame before pass it to decoder. + */ +typedef void (*predecode_cb)(and_media_private_t *codec_data, + const pjmedia_frame *rtp_frame, + pjmedia_frame *out); + +#if PJMEDIA_HAS_AND_MEDIA_AMRNB || PJMEDIA_HAS_AND_MEDIA_AMRWB +/* Custom callback implementations. */ +static pj_status_t parse_amr(and_media_private_t *codec_data, void *pkt, + pj_size_t pkt_size, const pj_timestamp *ts, + unsigned *frame_cnt, pjmedia_frame frames[]); +static pj_status_t pack_amr(and_media_private_t *codec_data, unsigned nframes, + void *pkt, pj_size_t *pkt_size, + pj_size_t max_pkt_size); +static void predecode_amr(and_media_private_t *codec_data, + const pjmedia_frame *input, + pjmedia_frame *out); +#endif + +#if PJMEDIA_HAS_AND_MEDIA_AMRNB + +static pj_str_t AMRNB_encoder[] = {{(char *)"OMX.google.amrnb.encoder\0", 24}, + {(char *)"c2.android.amrnb.encoder\0", 24}}; + +static pj_str_t AMRNB_decoder[] = {{(char *)"OMX.google.amrnb.decoder\0", 24}, + {(char *)"c2.android.amrnb.decoder\0", 24}}; +#endif + +#if PJMEDIA_HAS_AND_MEDIA_AMRWB + +static pj_str_t AMRWB_encoder[] = {{(char *)"OMX.google.amrwb.encoder\0", 24}, + {(char *)"c2.android.amrwb.encoder\0", 24}}; + +static pj_str_t AMRWB_decoder[] = {{(char *)"OMX.google.amrwb.decoder\0", 24}, + {(char *)"c2.android.amrwb.decoder\0", 24}}; +#endif + +/* Android MediaCodec codec implementation descriptions. */ +static struct and_media_codec { + int enabled; /* Is this codec enabled? */ + const char *name; /* Codec name. */ + const char *mime_type; /* Mime type. */ + pj_str_t *encoder_name; /* Encoder name. */ + pj_str_t *decoder_name; /* Decoder name. */ + + pj_uint8_t pt; /* Payload type. */ + and_aud_codec_id codec_id; /* Codec id. */ + unsigned clock_rate; /* Codec's clock rate. */ + unsigned channel_count; /* Codec's channel count. */ + unsigned samples_per_frame; /* Codec's samples count. */ + unsigned def_bitrate; /* Default bitrate of this codec. */ + unsigned max_bitrate; /* Maximum bitrate of this codec. */ + pj_uint8_t frm_per_pkt; /* Default num of frames per packet.*/ + int has_native_vad; /* Codec has internal VAD? */ + int has_native_plc; /* Codec has internal PLC? */ + + parse_cb parse; /* Callback to parse bitstream. */ + pack_cb pack; /* Callback to pack bitstream. */ + predecode_cb predecode; /* Callback to prepare bitstream + before passing it to decoder. */ + + pjmedia_codec_fmtp dec_fmtp; /* Decoder's fmtp params. */ +} + +and_media_codec[] = +{ +# if PJMEDIA_HAS_AND_MEDIA_AMRNB + {0, "AMR", "audio/3gpp", NULL, NULL, + PJMEDIA_RTP_PT_AMR, AND_AUD_CODEC_AMRNB, 8000, 1, 160, 7400, 12200, + 2, 0, 0, &parse_amr, &pack_amr, &predecode_amr, + {1, {{{(char *)"octet-align", 11}, {(char *)"1", 1}}}} + }, +# endif + +# if PJMEDIA_HAS_AND_MEDIA_AMRWB + {0, "AMR-WB", "audio/amr-wb", NULL, NULL, + PJMEDIA_RTP_PT_AMRWB, AND_AUD_CODEC_AMRWB, 16000, 1, 320, 15850, 23850, + 2, 0, 0, &parse_amr, &pack_amr, &predecode_amr, + {1, {{{(char *)"octet-align", 11}, {(char *)"1", 1}}}} + }, +# endif +}; + +#if PJMEDIA_HAS_AND_MEDIA_AMRNB || PJMEDIA_HAS_AND_MEDIA_AMRWB + +#include + +typedef struct amr_settings_t { + pjmedia_codec_amr_pack_setting enc_setting; + pjmedia_codec_amr_pack_setting dec_setting; + pj_int8_t enc_mode; +} amr_settings_t; + +/* Pack AMR payload */ +static pj_status_t pack_amr(and_media_private_t *codec_data, unsigned nframes, + void *pkt, pj_size_t *pkt_size, + pj_size_t max_pkt_size) +{ + enum {MAX_FRAMES_PER_PACKET = PJMEDIA_MAX_FRAME_DURATION_MS / 20}; + + pjmedia_frame frames[MAX_FRAMES_PER_PACKET]; + pj_uint8_t *p; /* Read cursor */ + pjmedia_codec_amr_pack_setting *setting; + unsigned i; + pj_status_t status; + + setting = &((amr_settings_t*)codec_data->codec_setting)->enc_setting; + + /* Align pkt buf right */ + p = (pj_uint8_t*)pkt + max_pkt_size - *pkt_size; + pj_memmove(p, pkt, *pkt_size); + + /* Get frames */ + for (i = 0; i < nframes; ++i) { + pjmedia_codec_amr_bit_info *info = (pjmedia_codec_amr_bit_info*) + &frames[i].bit_info; + pj_bzero(info, sizeof(*info)); + info->frame_type = (pj_uint8_t)((*p >> 3) & 0x0F); + info->good_quality = (pj_uint8_t)((*p >> 2) & 0x01); + info->mode = ((amr_settings_t*)codec_data->codec_setting)->enc_mode; + info->start_bit = 0; + frames[i].buf = p + 1; + if (setting->amr_nb) { + frames[i].size = (info->frame_type <= 8)? + pjmedia_codec_amrnb_framelen[info->frame_type] : 0; + } else { + frames[i].size = (info->frame_type <= 9)? + pjmedia_codec_amrwb_framelen[info->frame_type] : 0; + } + p += frames[i].size + 1; + } + /* Pack */ + *pkt_size = max_pkt_size; + status = pjmedia_codec_amr_pack(frames, nframes, setting, pkt, pkt_size); + + return status; +} + +/* Parse AMR payload into frames. */ +static pj_status_t parse_amr(and_media_private_t *codec_data, void *pkt, + pj_size_t pkt_size, const pj_timestamp *ts, + unsigned *frame_cnt, pjmedia_frame frames[]) +{ + amr_settings_t* s = (amr_settings_t*)codec_data->codec_setting; + pjmedia_codec_amr_pack_setting *setting; + pj_status_t status; + pj_uint8_t cmr; + + setting = &s->dec_setting; + status = pjmedia_codec_amr_parse(pkt, pkt_size, ts, setting, frames, + frame_cnt, &cmr); + if (status != PJ_SUCCESS) + return status; + + /* Check Change Mode Request. */ + if (((setting->amr_nb && cmr <= 7) || (!setting->amr_nb && cmr <= 8)) && + s->enc_mode != cmr) + { + s->enc_mode = cmr; + } + return PJ_SUCCESS; +} + +static void predecode_amr(and_media_private_t *codec_data, + const pjmedia_frame *input, + pjmedia_frame *out) +{ + pjmedia_codec_amr_bit_info *info; + pj_uint8_t *bitstream = (pj_uint8_t *)out->buf; + pjmedia_codec_amr_pack_setting *setting; + + out->buf = &bitstream[1]; + setting = &((amr_settings_t*)codec_data->codec_setting)->dec_setting; + pjmedia_codec_amr_predecode(input, setting, out); + info = (pjmedia_codec_amr_bit_info*)&out->bit_info; + bitstream[0] = (info->frame_type << 3) | (info->good_quality << 2); + out->buf = &bitstream[0]; + ++out->size; +} + +#endif /* PJMEDIA_HAS_AND_MEDIA_AMRNB || PJMEDIA_HAS_AND_MEDIA_AMRWB */ + +static pj_status_t configure_codec(and_media_private_t *and_media_data, + pj_bool_t is_encoder) +{ + media_status_t am_status; + AMediaFormat *aud_fmt; + int idx = and_media_data->codec_idx; + AMediaCodec *codec = (is_encoder?and_media_data->enc:and_media_data->dec); + + aud_fmt = AMediaFormat_new(); + if (!aud_fmt) { + return PJ_ENOMEM; + } + AMediaFormat_setString(aud_fmt, AND_MEDIA_KEY_MIME, + and_media_codec[idx].mime_type); + AMediaFormat_setInt32(aud_fmt, AND_MEDIA_KEY_PCM_ENCODING, 2); + AMediaFormat_setInt32(aud_fmt, AND_MEDIA_KEY_CHANNEL_COUNT, + and_media_codec[idx].channel_count); + AMediaFormat_setInt32(aud_fmt, AND_MEDIA_KEY_SAMPLE_RATE, + and_media_codec[idx].clock_rate); + AMediaFormat_setInt32(aud_fmt, AND_MEDIA_KEY_BITRATE, + and_media_codec[idx].def_bitrate); + + /* Configure and start encoder. */ + am_status = AMediaCodec_configure(codec, aud_fmt, NULL, NULL, is_encoder); + AMediaFormat_delete(aud_fmt); + if (am_status != AMEDIA_OK) { + PJ_LOG(4, (THIS_FILE, "%s [0x%x] configure failed, status=%d", + is_encoder?"Encoder":"Decoder", codec, am_status)); + return PJMEDIA_CODEC_EFAILED; + } + am_status = AMediaCodec_start(codec); + if (am_status != AMEDIA_OK) { + PJ_LOG(4, (THIS_FILE, "%s [0x%x] start failed, status=%d", + is_encoder?"Encoder":"Decoder", codec, am_status)); + return PJMEDIA_CODEC_EFAILED; + } + PJ_LOG(4, (THIS_FILE, "%s [0x%x] started", is_encoder?"Encoder":"Decoder", + codec)); + return PJ_SUCCESS; +} + +/* + * Initialize and register Android MediaCodec codec factory to pjmedia endpoint. + */ +PJ_DEF(pj_status_t) pjmedia_codec_and_media_aud_init( pjmedia_endpt *endpt ) +{ + pjmedia_codec_mgr *codec_mgr; + pj_str_t codec_name; + pj_status_t status; + + if (and_media_factory.pool != NULL) { + /* Already initialized. */ + return PJ_SUCCESS; + } + + PJ_LOG(4, (THIS_FILE, "Initing codec")); + + /* Create Android MediaCodec codec factory. */ + and_media_factory.base.op = &and_media_factory_op; + and_media_factory.base.factory_data = NULL; + and_media_factory.endpt = endpt; + + and_media_factory.pool = pjmedia_endpt_create_pool(endpt, + "Android MediaCodec codecs", + 4000, 4000); + if (!and_media_factory.pool) + return PJ_ENOMEM; + + /* Create mutex. */ + status = pj_mutex_create_simple(and_media_factory.pool, + "Android MediaCodec codecs", + &and_media_factory.mutex); + if (status != PJ_SUCCESS) + goto on_error; + + /* Get the codec manager. */ + codec_mgr = pjmedia_endpt_get_codec_mgr(endpt); + if (!codec_mgr) { + status = PJ_EINVALIDOP; + goto on_error; + } + +#if PJMEDIA_HAS_AND_MEDIA_AMRNB + PJ_LOG(4, (THIS_FILE, "Registering AMRNB codec")); + + pj_cstr(&codec_name, "AMR"); + status = pjmedia_sdp_neg_register_fmt_match_cb( + &codec_name, + &pjmedia_codec_amr_match_sdp); + if (status != PJ_SUCCESS) + goto on_error; +#endif + +#if PJMEDIA_HAS_AND_MEDIA_AMRWB + PJ_LOG(4, (THIS_FILE, "Registering AMRWB codec")); + + pj_cstr(&codec_name, "AMR-WB"); + status = pjmedia_sdp_neg_register_fmt_match_cb( + &codec_name, + &pjmedia_codec_amr_match_sdp); + if (status != PJ_SUCCESS) + goto on_error; +#endif + + /* Suppress compile warning */ + PJ_UNUSED_ARG(codec_name); + + /* Register codec factory to endpoint. */ + status = pjmedia_codec_mgr_register_factory(codec_mgr, + &and_media_factory.base); + if (status != PJ_SUCCESS) + goto on_error; + + /* Done. */ + return PJ_SUCCESS; + +on_error: + pj_pool_release(and_media_factory.pool); + and_media_factory.pool = NULL; + return status; +} + +/* + * Unregister Android MediaCodec codecs factory from pjmedia endpoint. + */ +PJ_DEF(pj_status_t) pjmedia_codec_and_media_aud_deinit(void) +{ + pjmedia_codec_mgr *codec_mgr; + pj_status_t status; + + if (and_media_factory.pool == NULL) { + /* Already deinitialized */ + return PJ_SUCCESS; + } + + pj_mutex_lock(and_media_factory.mutex); + + /* Get the codec manager. */ + codec_mgr = pjmedia_endpt_get_codec_mgr(and_media_factory.endpt); + if (!codec_mgr) { + pj_pool_release(and_media_factory.pool); + and_media_factory.pool = NULL; + pj_mutex_unlock(and_media_factory.mutex); + return PJ_EINVALIDOP; + } + + /* Unregister Android MediaCodec codecs factory. */ + status = pjmedia_codec_mgr_unregister_factory(codec_mgr, + &and_media_factory.base); + + /* Destroy mutex. */ + pj_mutex_unlock(and_media_factory.mutex); + pj_mutex_destroy(and_media_factory.mutex); + and_media_factory.mutex = NULL; + + /* Destroy pool. */ + pj_pool_release(and_media_factory.pool); + and_media_factory.pool = NULL; + + return status; +} + +/* + * Check if factory can allocate the specified codec. + */ +static pj_status_t and_media_test_alloc(pjmedia_codec_factory *factory, + const pjmedia_codec_info *info ) +{ + unsigned i; + + PJ_UNUSED_ARG(factory); + + /* Type MUST be audio. */ + if (info->type != PJMEDIA_TYPE_AUDIO) + return PJMEDIA_CODEC_EUNSUP; + + for (i = 0; i < PJ_ARRAY_SIZE(and_media_codec); ++i) { + pj_str_t name = pj_str((char*)and_media_codec[i].name); + if ((pj_stricmp(&info->encoding_name, &name) == 0) && + (info->clock_rate == (unsigned)and_media_codec[i].clock_rate) && + (info->channel_cnt == (unsigned)and_media_codec[i].channel_count) && + (and_media_codec[i].enabled)) + { + return PJ_SUCCESS; + } + } + + /* Unsupported, or mode is disabled. */ + return PJMEDIA_CODEC_EUNSUP; +} + +/* + * Generate default attribute. + */ +static pj_status_t and_media_default_attr (pjmedia_codec_factory *factory, + const pjmedia_codec_info *id, + pjmedia_codec_param *attr) +{ + unsigned i; + + PJ_ASSERT_RETURN(factory==&and_media_factory.base, PJ_EINVAL); + + pj_bzero(attr, sizeof(pjmedia_codec_param)); + + for (i = 0; i < PJ_ARRAY_SIZE(and_media_codec); ++i) { + pj_str_t name = pj_str((char*)and_media_codec[i].name); + if ((and_media_codec[i].enabled) && + (pj_stricmp(&id->encoding_name, &name) == 0) && + (id->clock_rate == (unsigned)and_media_codec[i].clock_rate) && + (id->channel_cnt == (unsigned)and_media_codec[i].channel_count) && + (id->pt == (unsigned)and_media_codec[i].pt)) + { + attr->info.pt = (pj_uint8_t)id->pt; + attr->info.channel_cnt = and_media_codec[i].channel_count; + attr->info.clock_rate = and_media_codec[i].clock_rate; + attr->info.avg_bps = and_media_codec[i].def_bitrate; + attr->info.max_bps = and_media_codec[i].max_bitrate; + attr->info.pcm_bits_per_sample = 16; + attr->info.frm_ptime = (pj_uint16_t) + (and_media_codec[i].samples_per_frame * 1000 / + and_media_codec[i].channel_count / + and_media_codec[i].clock_rate); + attr->setting.frm_per_pkt = and_media_codec[i].frm_per_pkt; + + /* Default flags. */ + attr->setting.plc = 1; + attr->setting.penh= 0; + attr->setting.vad = 1; + attr->setting.cng = attr->setting.vad; + attr->setting.dec_fmtp = and_media_codec[i].dec_fmtp; + + return PJ_SUCCESS; + } + } + + return PJMEDIA_CODEC_EUNSUP; +} + +static pj_bool_t codec_exists(const pj_str_t *codec_name) +{ + AMediaCodec *codec; + char *codec_txt; + + codec_txt = codec_name->ptr; + + codec = AMediaCodec_createCodecByName(codec_txt); + if (!codec) { + PJ_LOG(4, (THIS_FILE, "Failed creating codec : %.*s", codec_name->slen, + codec_name->ptr)); + return PJ_FALSE; + } + AMediaCodec_delete(codec); + + return PJ_TRUE; +} + +/* + * Enum codecs supported by this factory. + */ +static pj_status_t and_media_enum_codecs(pjmedia_codec_factory *factory, + unsigned *count, + pjmedia_codec_info codecs[]) +{ + unsigned max; + unsigned i; + + PJ_UNUSED_ARG(factory); + PJ_ASSERT_RETURN(codecs && *count > 0, PJ_EINVAL); + + max = *count; + + for (i = 0, *count = 0; i < PJ_ARRAY_SIZE(and_media_codec) && + *count < max; ++i) + { + unsigned enc_idx, dec_idx; + pj_str_t *enc_name = NULL; + unsigned num_enc = 0; + pj_str_t *dec_name = NULL; + unsigned num_dec = 0; + + switch (and_media_codec[i].codec_id) { + + case AND_AUD_CODEC_AMRNB: +#if PJMEDIA_HAS_AND_MEDIA_AMRNB + enc_name = &AMRNB_encoder[0]; + dec_name = &AMRNB_decoder[0]; + num_enc = PJ_ARRAY_SIZE(AMRNB_encoder); + num_dec = PJ_ARRAY_SIZE(AMRNB_decoder); +#endif + break; + case AND_AUD_CODEC_AMRWB: +#if PJMEDIA_HAS_AND_MEDIA_AMRWB + enc_name = &AMRWB_encoder[0]; + dec_name = &AMRWB_decoder[0]; + num_enc = PJ_ARRAY_SIZE(AMRWB_encoder); + num_dec = PJ_ARRAY_SIZE(AMRWB_decoder); +#endif + + break; + default: + continue; + }; + if (!enc_name || !dec_name) { + continue; + } + + for (enc_idx = 0; enc_idx < num_enc ;++enc_idx, ++enc_name) { + if (codec_exists(enc_name)) { + break; + } + } + if (enc_idx == num_enc) + continue; + + for (dec_idx = 0; dec_idx < num_dec ;++dec_idx, ++dec_name) { + if (codec_exists(dec_name)) { + break; + } + } + if (dec_idx == num_dec) + continue; + + and_media_codec[i].encoder_name = enc_name; + and_media_codec[i].decoder_name = dec_name; + pj_bzero(&codecs[*count], sizeof(pjmedia_codec_info)); + codecs[*count].encoding_name = pj_str((char*)and_media_codec[i].name); + codecs[*count].pt = and_media_codec[i].pt; + codecs[*count].type = PJMEDIA_TYPE_AUDIO; + codecs[*count].clock_rate = and_media_codec[i].clock_rate; + codecs[*count].channel_cnt = and_media_codec[i].channel_count; + and_media_codec[i].enabled = PJ_TRUE; + PJ_LOG(4, (THIS_FILE, "Found encoder [%d]: %.*s and decoder: %.*s ", + *count, enc_name->slen, enc_name->ptr, dec_name->slen, + dec_name->ptr)); + ++*count; + } + + return PJ_SUCCESS; +} + +static void create_codec(and_media_private_t *and_media_data) +{ + char const *enc_name = + and_media_codec[and_media_data->codec_idx].encoder_name->ptr; + char const *dec_name = + and_media_codec[and_media_data->codec_idx].decoder_name->ptr; + + if (!and_media_data->enc) { + and_media_data->enc = AMediaCodec_createCodecByName(enc_name); + if (!and_media_data->enc) { + PJ_LOG(4, (THIS_FILE, "Failed creating encoder: %s", enc_name)); + } + PJ_LOG(4, (THIS_FILE, "Done creating encoder: %s [0x%x]", enc_name, + and_media_data->enc)); + } + + if (!and_media_data->dec) { + and_media_data->dec = AMediaCodec_createCodecByName(dec_name); + if (!and_media_data->dec) { + PJ_LOG(4, (THIS_FILE, "Failed creating decoder: %s", dec_name)); + } + PJ_LOG(4, (THIS_FILE, "Done creating decoder: %s [0x%x]", dec_name, + and_media_data->dec)); + } +} + +/* + * Allocate a new codec instance. + */ +static pj_status_t and_media_alloc_codec(pjmedia_codec_factory *factory, + const pjmedia_codec_info *id, + pjmedia_codec **p_codec) +{ + and_media_private_t *codec_data; + pjmedia_codec *codec; + int idx; + pj_pool_t *pool; + unsigned i; + + PJ_ASSERT_RETURN(factory && id && p_codec, PJ_EINVAL); + PJ_ASSERT_RETURN(factory == &and_media_factory.base, PJ_EINVAL); + + pj_mutex_lock(and_media_factory.mutex); + + /* Find codec's index */ + idx = -1; + for (i = 0; i < PJ_ARRAY_SIZE(and_media_codec); ++i) { + pj_str_t name = pj_str((char*)and_media_codec[i].name); + if ((pj_stricmp(&id->encoding_name, &name) == 0) && + (id->clock_rate == (unsigned)and_media_codec[i].clock_rate) && + (id->channel_cnt == (unsigned)and_media_codec[i].channel_count) && + (and_media_codec[i].enabled)) + { + idx = i; + break; + } + } + if (idx == -1) { + *p_codec = NULL; + pj_mutex_unlock(and_media_factory.mutex); + return PJMEDIA_CODEC_EFAILED; + } + + /* Create pool for codec instance */ + pool = pjmedia_endpt_create_pool(and_media_factory.endpt, "andmedaud%p", + 512, 512); + codec = PJ_POOL_ZALLOC_T(pool, pjmedia_codec); + PJ_ASSERT_RETURN(codec != NULL, PJ_ENOMEM); + codec->op = &and_media_op; + codec->factory = factory; + codec->codec_data = PJ_POOL_ZALLOC_T(pool, and_media_private_t); + codec_data = (and_media_private_t*) codec->codec_data; + + /* Create PLC if codec has no internal PLC */ + if (!and_media_codec[idx].has_native_plc) { + pj_status_t status; + status = pjmedia_plc_create(pool, and_media_codec[idx].clock_rate, + and_media_codec[idx].samples_per_frame, 0, + &codec_data->plc); + if (status != PJ_SUCCESS) { + goto on_error; + } + } + + /* Create silence detector if codec has no internal VAD */ + if (!and_media_codec[idx].has_native_vad) { + pj_status_t status; + status = pjmedia_silence_det_create(pool, + and_media_codec[idx].clock_rate, + and_media_codec[idx].samples_per_frame, + &codec_data->vad); + if (status != PJ_SUCCESS) { + goto on_error; + } + } + + codec_data->pool = pool; + codec_data->codec_idx = idx; + + create_codec(codec_data); + if (!codec_data->enc || !codec_data->dec) { + goto on_error; + } + pj_mutex_unlock(and_media_factory.mutex); + + *p_codec = codec; + return PJ_SUCCESS; + +on_error: + pj_mutex_unlock(and_media_factory.mutex); + and_media_dealloc_codec(factory, codec); + return PJMEDIA_CODEC_EFAILED; +} + +/* + * Free codec. + */ +static pj_status_t and_media_dealloc_codec(pjmedia_codec_factory *factory, + pjmedia_codec *codec ) +{ + and_media_private_t *codec_data; + + PJ_ASSERT_RETURN(factory && codec, PJ_EINVAL); + PJ_ASSERT_RETURN(factory == &and_media_factory.base, PJ_EINVAL); + + /* Close codec, if it's not closed. */ + codec_data = (and_media_private_t*) codec->codec_data; + if (codec_data->enc) { + AMediaCodec_stop(codec_data->enc); + AMediaCodec_delete(codec_data->enc); + codec_data->enc = NULL; + } + + if (codec_data->dec) { + AMediaCodec_stop(codec_data->dec); + AMediaCodec_delete(codec_data->dec); + codec_data->dec = NULL; + } + pj_pool_release(codec_data->pool); + + return PJ_SUCCESS; +} + +/* + * Init codec. + */ +static pj_status_t and_media_codec_init(pjmedia_codec *codec, + pj_pool_t *pool ) +{ + PJ_UNUSED_ARG(codec); + PJ_UNUSED_ARG(pool); + return PJ_SUCCESS; +} + +/* + * Open codec. + */ +static pj_status_t and_media_codec_open(pjmedia_codec *codec, + pjmedia_codec_param *attr) +{ + and_media_private_t *codec_data = (and_media_private_t*) codec->codec_data; + struct and_media_codec *and_media_data = + &and_media_codec[codec_data->codec_idx]; + pj_status_t status; + + PJ_ASSERT_RETURN(codec && attr, PJ_EINVAL); + PJ_ASSERT_RETURN(codec_data != NULL, PJ_EINVALIDOP); + + PJ_LOG(5,(THIS_FILE, "Opening codec..")); + + codec_data->vad_enabled = (attr->setting.vad != 0); + codec_data->plc_enabled = (attr->setting.plc != 0); + and_media_data->clock_rate = attr->info.clock_rate; + +#if PJMEDIA_HAS_AND_MEDIA_AMRNB + if (and_media_data->codec_id == AND_AUD_CODEC_AMRNB || + and_media_data->codec_id == AND_AUD_CODEC_AMRWB) + { + amr_settings_t *s; + pj_uint8_t octet_align = 0; + pj_int8_t enc_mode; + unsigned i; + + enc_mode = pjmedia_codec_amr_get_mode(attr->info.avg_bps); + + pj_assert(enc_mode >= 0 && enc_mode <= 8); + + /* Check AMR specific attributes */ + for (i = 0; i < attr->setting.dec_fmtp.cnt; ++i) { + /* octet-align, one of the parameters that must have same value + * in offer & answer (RFC 4867 Section 8.3.1). Just check fmtp + * in the decoder side, since it's value is guaranteed to fulfil + * above requirement (by SDP negotiator). + */ + const pj_str_t STR_FMTP_OCTET_ALIGN = {(char *)"octet-align", 11}; + + if (pj_stricmp(&attr->setting.dec_fmtp.param[i].name, + &STR_FMTP_OCTET_ALIGN) == 0) + { + octet_align=(pj_uint8_t) + pj_strtoul(&attr->setting.dec_fmtp.param[i].val); + break; + } + } + for (i = 0; i < attr->setting.enc_fmtp.cnt; ++i) { + /* mode-set, encoding mode is chosen based on local default mode + * setting: + * - if local default mode is included in the mode-set, use it + * - otherwise, find the closest mode to local default mode; + * if there are two closest modes, prefer to use the higher + * one, e.g: local default mode is 4, the mode-set param + * contains '2,3,5,6', then 5 will be chosen. + */ + const pj_str_t STR_FMTP_MODE_SET = {(char *)"mode-set", 8}; + + if (pj_stricmp(&attr->setting.enc_fmtp.param[i].name, + &STR_FMTP_MODE_SET) == 0) + { + const char *p; + pj_size_t l; + pj_int8_t diff = 99; + + p = pj_strbuf(&attr->setting.enc_fmtp.param[i].val); + l = pj_strlen(&attr->setting.enc_fmtp.param[i].val); + + while (l--) { + if ((and_media_data->codec_id == AND_AUD_CODEC_AMRNB && + *p>='0' && *p<='7') || + (and_media_data->codec_id == AND_AUD_CODEC_AMRWB && + *p>='0' && *p<='8')) + { + pj_int8_t tmp = (pj_int8_t)(*p - '0' - enc_mode); + + if (PJ_ABS(diff) > PJ_ABS(tmp) || + (PJ_ABS(diff) == PJ_ABS(tmp) && tmp > diff)) + { + diff = tmp; + if (diff == 0) break; + } + } + ++p; + } + if (diff == 99) + goto on_error; + + enc_mode = (pj_int8_t)(enc_mode + diff); + + break; + } + } + /* Initialize AMR specific settings */ + s = PJ_POOL_ZALLOC_T(codec_data->pool, amr_settings_t); + codec_data->codec_setting = s; + + s->enc_setting.amr_nb = (pj_uint8_t) + (and_media_data->codec_id == AND_AUD_CODEC_AMRNB); + s->enc_setting.octet_aligned = octet_align; + s->enc_setting.reorder = 0; + s->enc_setting.cmr = 15; + s->dec_setting.amr_nb = (pj_uint8_t) + (and_media_data->codec_id == AND_AUD_CODEC_AMRNB); + s->dec_setting.octet_aligned = octet_align; + s->dec_setting.reorder = 0; + /* Apply encoder mode/bitrate */ + s->enc_mode = enc_mode; + + PJ_LOG(4, (THIS_FILE, "Encoder setting octet_aligned=%d reorder=%d" + " cmr=%d enc_mode=%d", + s->enc_setting.octet_aligned, s->enc_setting.reorder, + s->enc_setting.cmr, enc_mode)); + PJ_LOG(4, (THIS_FILE, "Decoder setting octet_aligned=%d reorder=%d", + s->dec_setting.octet_aligned, s->dec_setting.reorder)); + } +#endif + status = configure_codec(codec_data, PJ_TRUE); + if (status != PJ_SUCCESS) { + goto on_error; + } + status = configure_codec(codec_data, PJ_FALSE); + if (status != PJ_SUCCESS) { + goto on_error; + } + + return PJ_SUCCESS; + +on_error: + return PJMEDIA_CODEC_EFAILED; +} + +/* + * Close codec. + */ +static pj_status_t and_media_codec_close(pjmedia_codec *codec) +{ + PJ_UNUSED_ARG(codec); + + return PJ_SUCCESS; +} + +/* + * Modify codec settings. + */ +static pj_status_t and_media_codec_modify(pjmedia_codec *codec, + const pjmedia_codec_param *attr) +{ + and_media_private_t *codec_data = (and_media_private_t*) codec->codec_data; + + codec_data->vad_enabled = (attr->setting.vad != 0); + codec_data->plc_enabled = (attr->setting.plc != 0); + + return PJ_SUCCESS; +} + +/* + * Get frames in the packet. + */ +static pj_status_t and_media_codec_parse(pjmedia_codec *codec, + void *pkt, + pj_size_t pkt_size, + const pj_timestamp *ts, + unsigned *frame_cnt, + pjmedia_frame frames[]) +{ + and_media_private_t *codec_data = (and_media_private_t*) codec->codec_data; + struct and_media_codec *and_media_data = + &and_media_codec[codec_data->codec_idx]; + unsigned count = 0; + + PJ_ASSERT_RETURN(frame_cnt, PJ_EINVAL); + + if (and_media_data->parse != NULL) { + return and_media_data->parse(codec_data, pkt, pkt_size, ts, frame_cnt, + frames); + } + + while (pkt_size >= codec_data->frame_size && count < *frame_cnt) { + frames[count].type = PJMEDIA_FRAME_TYPE_AUDIO; + frames[count].buf = pkt; + frames[count].size = codec_data->frame_size; + frames[count].timestamp.u64 = ts->u64 + + count*and_media_data->samples_per_frame; + pkt = ((char*)pkt) + codec_data->frame_size; + pkt_size -= codec_data->frame_size; + ++count; + } + + if (pkt_size && count < *frame_cnt) { + frames[count].type = PJMEDIA_FRAME_TYPE_AUDIO; + frames[count].buf = pkt; + frames[count].size = pkt_size; + frames[count].timestamp.u64 = ts->u64 + + count*and_media_data->samples_per_frame; + ++count; + } + + *frame_cnt = count; + return PJ_SUCCESS; +} + +/* + * Encode frames. + */ +static pj_status_t and_media_codec_encode(pjmedia_codec *codec, + const struct pjmedia_frame *input, + unsigned output_buf_len, + struct pjmedia_frame *output) +{ + and_media_private_t *codec_data = (and_media_private_t*) codec->codec_data; + struct and_media_codec *and_media_data = + &and_media_codec[codec_data->codec_idx]; + unsigned samples_per_frame; + unsigned nsamples; + unsigned nframes; + pj_size_t tx = 0; + pj_int16_t *pcm_in = (pj_int16_t*)input->buf; + pj_uint8_t *bits_out = (pj_uint8_t*) output->buf; + + /* Invoke external VAD if codec has no internal VAD */ + if (codec_data->vad && codec_data->vad_enabled) { + pj_bool_t is_silence; + pj_int32_t silence_duration; + + silence_duration = pj_timestamp_diff32(&codec_data->last_tx, + &input->timestamp); + + is_silence = pjmedia_silence_det_detect(codec_data->vad, + (const pj_int16_t*) input->buf, + (input->size >> 1), + NULL); + if (is_silence && + (PJMEDIA_CODEC_MAX_SILENCE_PERIOD == -1 || + silence_duration < (PJMEDIA_CODEC_MAX_SILENCE_PERIOD * + (int)and_media_data->clock_rate / 1000))) + { + output->type = PJMEDIA_FRAME_TYPE_NONE; + output->buf = NULL; + output->size = 0; + output->timestamp = input->timestamp; + return PJ_SUCCESS; + } else { + codec_data->last_tx = input->timestamp; + } + } + nsamples = input->size >> 1; + samples_per_frame = and_media_data->samples_per_frame; + nframes = nsamples / samples_per_frame; + + PJ_ASSERT_RETURN(nsamples % samples_per_frame == 0, + PJMEDIA_CODEC_EPCMFRMINLEN); + + /* Encode the frames */ + while (nsamples >= samples_per_frame) { + pj_ssize_t buf_idx; + unsigned i; + pj_size_t output_size; + pj_uint8_t *output_buf; + AMediaCodecBufferInfo buf_info; + + buf_idx = AMediaCodec_dequeueInputBuffer(codec_data->enc, + CODEC_DEQUEUE_TIMEOUT); + + if (buf_idx >= 0) { + media_status_t am_status; + pj_size_t output_size; + unsigned input_size = samples_per_frame << 1; + + pj_uint8_t *input_buf = AMediaCodec_getInputBuffer(codec_data->enc, + buf_idx, &output_size); + + if (input_buf && output_size >= input_size) { + pj_memcpy(input_buf, pcm_in, input_size); + + am_status = AMediaCodec_queueInputBuffer(codec_data->enc, + buf_idx, 0, input_size, 0, 0); + if (am_status != AMEDIA_OK) { + PJ_LOG(4, (THIS_FILE, "Encoder queueInputBuffer return %d", + am_status)); + goto on_return; + } + } else { + if (!input_buf) { + PJ_LOG(4,(THIS_FILE, "Encoder getInputBuffer " + "returns no input buff")); + } else { + PJ_LOG(4,(THIS_FILE, "Encoder getInputBuffer " + "size: %d, expecting %d.", + input_buf, output_size, input_size)); + } + goto on_return; + } + } else { + PJ_LOG(4,(THIS_FILE, "Encoder dequeueInputBuffer failed[%d]", + buf_idx)); + goto on_return; + } + + for (i = 0; i < CODEC_WAIT_RETRY; ++i) { + buf_idx = AMediaCodec_dequeueOutputBuffer(codec_data->enc, + &buf_info, + CODEC_DEQUEUE_TIMEOUT); + if (buf_idx == -1) { + /* Timeout, wait until output buffer is availble. */ + pj_thread_sleep(CODEC_THREAD_WAIT); + } else { + break; + } + } + + if (buf_idx < 0) { + PJ_LOG(4, (THIS_FILE, "Encoder dequeueOutputBuffer failed %d", + buf_idx)); + goto on_return; + } + + output_buf = AMediaCodec_getOutputBuffer(codec_data->enc, + buf_idx, + &output_size); + if (!output_buf) { + PJ_LOG(4, (THIS_FILE, "Encoder failed getting output buffer, " + "buffer size=%d, flags %d", + buf_info.size, buf_info.flags)); + goto on_return; + } + + pj_memcpy(bits_out, output_buf, buf_info.size); + AMediaCodec_releaseOutputBuffer(codec_data->enc, + buf_idx, + 0); + bits_out += buf_info.size; + tx += buf_info.size; + pcm_in += samples_per_frame; + nsamples -= samples_per_frame; + } + if (and_media_data->pack != NULL) { + and_media_data->pack(codec_data, nframes, output->buf, &tx, + output_buf_len); + } + /* Check if we don't need to transmit the frame (DTX) */ + if (tx == 0) { + output->buf = NULL; + output->size = 0; + output->timestamp.u64 = input->timestamp.u64; + output->type = PJMEDIA_FRAME_TYPE_NONE; + return PJ_SUCCESS; + } + output->size = tx; + output->type = PJMEDIA_FRAME_TYPE_AUDIO; + output->timestamp = input->timestamp; + + return PJ_SUCCESS; + +on_return: + output->size = 0; + output->buf = NULL; + output->type = PJMEDIA_FRAME_TYPE_NONE; + output->timestamp.u64 = input->timestamp.u64; + return PJ_SUCCESS; +} + +/* + * Decode frame. + */ +static pj_status_t and_media_codec_decode(pjmedia_codec *codec, + const struct pjmedia_frame *input, + unsigned output_buf_len, + struct pjmedia_frame *output) +{ + and_media_private_t *codec_data = (and_media_private_t*) codec->codec_data; + struct and_media_codec *and_media_data = + &and_media_codec[codec_data->codec_idx]; + unsigned samples_per_frame; + unsigned i; + + pj_ssize_t buf_idx = -1; + pj_uint8_t *input_buf; + pj_size_t input_size; + pj_size_t output_size; + media_status_t am_status; + AMediaCodecBufferInfo buf_info; + pj_uint8_t *output_buf; + pjmedia_frame input_; + + pj_bzero(&input_, sizeof(pjmedia_frame)); + samples_per_frame = and_media_data->samples_per_frame; + + PJ_ASSERT_RETURN(output_buf_len >= samples_per_frame << 1, + PJMEDIA_CODEC_EPCMTOOSHORT); + + if (input->type != PJMEDIA_FRAME_TYPE_AUDIO) + { + goto on_return; + } + + buf_idx = AMediaCodec_dequeueInputBuffer(codec_data->dec, + CODEC_DEQUEUE_TIMEOUT); + + if (buf_idx < 0) { + PJ_LOG(4,(THIS_FILE, "Decoder dequeueInputBuffer failed return %d", + buf_idx)); + goto on_return; + } + + input_buf = AMediaCodec_getInputBuffer(codec_data->dec, + buf_idx, + &input_size); + if (input_buf == 0) { + PJ_LOG(4,(THIS_FILE, "Decoder getInputBuffer failed " + "return input_buf=%d, size=%d", input_buf, input_size)); + goto on_return; + } + + if (and_media_data->predecode) { + input_.buf = input_buf; + and_media_data->predecode(codec_data, input, &input_); + } else { + input_.size = input->size; + pj_memcpy(input_buf, input->buf, input->size); + } + + am_status = AMediaCodec_queueInputBuffer(codec_data->dec, + buf_idx, + 0, + input_.size, + input->timestamp.u32.lo, + 0); + if (am_status != AMEDIA_OK) { + PJ_LOG(4,(THIS_FILE, "Decoder queueInputBuffer failed return %d", + am_status)); + goto on_return; + } + + for (i = 0; i < CODEC_WAIT_RETRY; ++i) { + buf_idx = AMediaCodec_dequeueOutputBuffer(codec_data->dec, + &buf_info, + CODEC_DEQUEUE_TIMEOUT); + if (buf_idx == -1) { + /* Timeout, wait until output buffer is availble. */ + PJ_LOG(5, (THIS_FILE, "Decoder dequeueOutputBuffer timeout[%d]", + i+1)); + pj_thread_sleep(CODEC_THREAD_WAIT); + } else { + break; + } + } + if (buf_idx < 0) { + PJ_LOG(5, (THIS_FILE, "Decoder dequeueOutputBuffer failed [%d]", + buf_idx)); + goto on_return; + } + + output_buf = AMediaCodec_getOutputBuffer(codec_data->dec, + buf_idx, + &output_size); + if (output_buf == NULL) { + am_status = AMediaCodec_releaseOutputBuffer(codec_data->dec, + buf_idx, + 0); + if (am_status != AMEDIA_OK) { + PJ_LOG(4,(THIS_FILE, "Decoder releaseOutputBuffer failed %d", + am_status)); + } + PJ_LOG(4,(THIS_FILE, "Decoder getOutputBuffer failed")); + goto on_return; + } + pj_memcpy(output->buf, output_buf, buf_info.size); + output->type = PJMEDIA_FRAME_TYPE_AUDIO; + output->size = buf_info.size; + output->timestamp.u64 = input->timestamp.u64; + am_status = AMediaCodec_releaseOutputBuffer(codec_data->dec, + buf_idx, + 0); + + /* Invoke external PLC if codec has no internal PLC */ + if (codec_data->plc && codec_data->plc_enabled) + pjmedia_plc_save(codec_data->plc, (pj_int16_t*)output->buf); + + return PJ_SUCCESS; + +on_return: + pjmedia_zero_samples((pj_int16_t*)output->buf, samples_per_frame); + output->size = samples_per_frame << 1; + output->timestamp.u64 = input->timestamp.u64; + output->type = PJMEDIA_FRAME_TYPE_AUDIO; + return PJ_SUCCESS; +} + +/* + * Recover lost frame. + */ +static pj_status_t and_media_codec_recover(pjmedia_codec *codec, + unsigned output_buf_len, + struct pjmedia_frame *output) +{ + and_media_private_t *codec_data = (and_media_private_t*) codec->codec_data; + struct and_media_codec *and_media_data = + &and_media_codec[codec_data->codec_idx]; + unsigned samples_per_frame; + pj_bool_t generate_plc = (codec_data->plc_enabled && codec_data->plc); + + PJ_UNUSED_ARG(output_buf_len); + + samples_per_frame = and_media_data->samples_per_frame; + output->type = PJMEDIA_FRAME_TYPE_AUDIO; + output->size = samples_per_frame << 1; + + if (generate_plc) + pjmedia_plc_generate(codec_data->plc, (pj_int16_t*)output->buf); + else + pjmedia_zero_samples((pj_int16_t*)output->buf, samples_per_frame); + + return PJ_SUCCESS; +} + + +#endif /* PJMEDIA_HAS_ANDROID_MEDIACODEC */ + diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjmedia/src/pjmedia-codec/and_vid_mediacodec.cpp asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjmedia/src/pjmedia-codec/and_vid_mediacodec.cpp --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjmedia/src/pjmedia-codec/and_vid_mediacodec.cpp 1970-01-01 00:00:00.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjmedia/src/pjmedia-codec/and_vid_mediacodec.cpp 2022-02-24 07:54:38.000000000 +0000 @@ -0,0 +1,1923 @@ +/* + * Copyright (C)2020 Teluu Inc. (http://www.teluu.com) + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#include +#include +#include +#include +#include +#include + +#if defined(PJMEDIA_HAS_ANDROID_MEDIACODEC) && \ + PJMEDIA_HAS_ANDROID_MEDIACODEC != 0 && \ + defined(PJMEDIA_HAS_VIDEO) && (PJMEDIA_HAS_VIDEO != 0) + +/* Android AMediaCodec: */ +#include "media/NdkMediaCodec.h" + +/* + * Constants + */ +#define THIS_FILE "and_vid_mediacodec.cpp" +#define AND_MEDIA_KEY_COLOR_FMT "color-format" +#define AND_MEDIA_KEY_WIDTH "width" +#define AND_MEDIA_KEY_HEIGHT "height" +#define AND_MEDIA_KEY_BIT_RATE "bitrate" +#define AND_MEDIA_KEY_PROFILE "profile" +#define AND_MEDIA_KEY_FRAME_RATE "frame-rate" +#define AND_MEDIA_KEY_IFR_INTTERVAL "i-frame-interval" +#define AND_MEDIA_KEY_MIME "mime" +#define AND_MEDIA_KEY_REQUEST_SYNCF "request-sync" +#define AND_MEDIA_KEY_CSD0 "csd-0" +#define AND_MEDIA_KEY_CSD1 "csd-1" +#define AND_MEDIA_KEY_MAX_INPUT_SZ "max-input-size" +#define AND_MEDIA_KEY_ENCODER "encoder" +#define AND_MEDIA_KEY_PRIORITY "priority" +#define AND_MEDIA_KEY_STRIDE "stride" +#define AND_MEDIA_I420_PLANAR_FMT 0x13 +#define AND_MEDIA_QUEUE_TIMEOUT 2000*100 + +#define DEFAULT_WIDTH 352 +#define DEFAULT_HEIGHT 288 + +#define DEFAULT_FPS 15 +#define DEFAULT_AVG_BITRATE 256000 +#define DEFAULT_MAX_BITRATE 256000 + +#define SPS_PPS_BUF_SIZE 64 + +#define MAX_RX_WIDTH 1200 +#define MAX_RX_HEIGHT 800 + +/* Maximum duration from one key frame to the next (in seconds). */ +#define KEYFRAME_INTERVAL 1 + +#define CODEC_WAIT_RETRY 10 +#define CODEC_THREAD_WAIT 10 +/* Timeout until the buffer is ready in ms. */ +#define CODEC_DEQUEUE_TIMEOUT 20 + +#define AND_MED_H264_PT PJMEDIA_RTP_PT_H264_RSV2 +#define AND_MED_VP8_PT PJMEDIA_RTP_PT_VP8_RSV1 +#define AND_MED_VP9_PT PJMEDIA_RTP_PT_VP9_RSV1 + +/* + * Factory operations. + */ +static pj_status_t and_media_test_alloc(pjmedia_vid_codec_factory *factory, + const pjmedia_vid_codec_info *info ); +static pj_status_t and_media_default_attr(pjmedia_vid_codec_factory *factory, + const pjmedia_vid_codec_info *info, + pjmedia_vid_codec_param *attr ); +static pj_status_t and_media_enum_info(pjmedia_vid_codec_factory *factory, + unsigned *count, + pjmedia_vid_codec_info codecs[]); +static pj_status_t and_media_alloc_codec(pjmedia_vid_codec_factory *factory, + const pjmedia_vid_codec_info *info, + pjmedia_vid_codec **p_codec); +static pj_status_t and_media_dealloc_codec(pjmedia_vid_codec_factory *factory, + pjmedia_vid_codec *codec ); + + +/* + * Codec operations + */ +static pj_status_t and_media_codec_init(pjmedia_vid_codec *codec, + pj_pool_t *pool ); +static pj_status_t and_media_codec_open(pjmedia_vid_codec *codec, + pjmedia_vid_codec_param *param ); +static pj_status_t and_media_codec_close(pjmedia_vid_codec *codec); +static pj_status_t and_media_codec_modify(pjmedia_vid_codec *codec, + const pjmedia_vid_codec_param *param); +static pj_status_t and_media_codec_get_param(pjmedia_vid_codec *codec, + pjmedia_vid_codec_param *param); +static pj_status_t and_media_codec_encode_begin(pjmedia_vid_codec *codec, + const pjmedia_vid_encode_opt *opt, + const pjmedia_frame *input, + unsigned out_size, + pjmedia_frame *output, + pj_bool_t *has_more); +static pj_status_t and_media_codec_encode_more(pjmedia_vid_codec *codec, + unsigned out_size, + pjmedia_frame *output, + pj_bool_t *has_more); +static pj_status_t and_media_codec_decode(pjmedia_vid_codec *codec, + pj_size_t count, + pjmedia_frame packets[], + unsigned out_size, + pjmedia_frame *output); + +/* Definition for Android AMediaCodec operations. */ +static pjmedia_vid_codec_op and_media_codec_op = +{ + &and_media_codec_init, + &and_media_codec_open, + &and_media_codec_close, + &and_media_codec_modify, + &and_media_codec_get_param, + &and_media_codec_encode_begin, + &and_media_codec_encode_more, + &and_media_codec_decode, + NULL +}; + +/* Definition for Android AMediaCodec factory operations. */ +static pjmedia_vid_codec_factory_op and_media_factory_op = +{ + &and_media_test_alloc, + &and_media_default_attr, + &and_media_enum_info, + &and_media_alloc_codec, + &and_media_dealloc_codec +}; + +static struct and_media_factory +{ + pjmedia_vid_codec_factory base; + pjmedia_vid_codec_mgr *mgr; + pj_pool_factory *pf; + pj_pool_t *pool; +} and_media_factory; + +enum and_media_frm_type { + AND_MEDIA_FRM_TYPE_DEFAULT = 0, + AND_MEDIA_FRM_TYPE_KEYFRAME = 1, + AND_MEDIA_FRM_TYPE_CONFIG = 2 +}; + +typedef struct h264_codec_data { + pjmedia_h264_packetizer *pktz; + + pj_uint8_t enc_sps_pps_buf[SPS_PPS_BUF_SIZE]; + unsigned enc_sps_pps_len; + pj_bool_t enc_sps_pps_ex; + + pj_uint8_t *dec_sps_buf; + unsigned dec_sps_len; + pj_uint8_t *dec_pps_buf; + unsigned dec_pps_len; +} h264_codec_data; + +typedef struct vpx_codec_data { + pjmedia_vpx_packetizer *pktz; +} vpx_codec_data; + +typedef struct and_media_codec_data +{ + pj_pool_t *pool; + pj_uint8_t codec_idx; + pjmedia_vid_codec_param *prm; + pj_bool_t whole; + void *ex_data; + + /* Encoder state */ + AMediaCodec *enc; + unsigned enc_input_size; + pj_uint8_t *enc_frame_whole; + unsigned enc_frame_size; + unsigned enc_processed; + AMediaCodecBufferInfo enc_buf_info; + int enc_output_buf_idx; + + /* Decoder state */ + AMediaCodec *dec; + pj_uint8_t *dec_buf; + pj_uint8_t *dec_input_buf; + unsigned dec_input_buf_len; + pj_size_t dec_input_buf_max_size; + pj_ssize_t dec_input_buf_idx; + unsigned dec_has_output_frame; + unsigned dec_stride_len; + unsigned dec_buf_size; + AMediaCodecBufferInfo dec_buf_info; +} and_media_codec_data; + +/* Custom callbacks. */ + +/* This callback is useful when specific method is needed when opening + * the codec (e.g: applying fmtp or setting up the packetizer) + */ +typedef pj_status_t (*open_cb)(and_media_codec_data *and_media_data); + +/* This callback is useful for handling configure frame produced by encoder. + * Output frame might want to be stored the configuration frame and append it + * to a keyframe for sending later (e.g: on H264 codec). The default behavior + * is to send the configuration frame regardless. + */ +typedef pj_status_t (*process_encode_cb)(and_media_codec_data *and_media_data); + +/* This callback is to process more encoded packets/payloads from the codec.*/ +typedef pj_status_t(*encode_more_cb)(and_media_codec_data *and_media_data, + unsigned out_size, + pjmedia_frame *output, + pj_bool_t *has_more); + +/* This callback is to decode packets. */ +typedef pj_status_t(*decode_cb)(pjmedia_vid_codec *codec, + pj_size_t count, + pjmedia_frame packets[], + unsigned out_size, + pjmedia_frame *output); + + +/* Custom callback implementation. */ +#if PJMEDIA_HAS_AND_MEDIA_H264 +static pj_status_t open_h264(and_media_codec_data *and_media_data); +static pj_status_t process_encode_h264(and_media_codec_data *and_media_data); +static pj_status_t encode_more_h264(and_media_codec_data *and_media_data, + unsigned out_size, + pjmedia_frame *output, + pj_bool_t *has_more); +static pj_status_t decode_h264(pjmedia_vid_codec *codec, + pj_size_t count, + pjmedia_frame packets[], + unsigned out_size, + pjmedia_frame *output); +#endif + +#if PJMEDIA_HAS_AND_MEDIA_VP8 || PJMEDIA_HAS_AND_MEDIA_VP9 +static pj_status_t open_vpx(and_media_codec_data *and_media_data); +static pj_status_t encode_more_vpx(and_media_codec_data *and_media_data, + unsigned out_size, + pjmedia_frame *output, + pj_bool_t *has_more); +static pj_status_t decode_vpx(pjmedia_vid_codec *codec, + pj_size_t count, + pjmedia_frame packets[], + unsigned out_size, + pjmedia_frame *output); +#endif + + +#if PJMEDIA_HAS_AND_MEDIA_H264 +static pj_str_t H264_sw_encoder[] = {{(char *)"OMX.google.h264.encoder\0", + 23}}; +static pj_str_t H264_hw_encoder[] = + {{(char *)"OMX.qcom.video.encoder.avc\0", 26}, + {(char *)"OMX.Exynos.avc.Encoder\0", 22}}; +static pj_str_t H264_sw_decoder[] = {{(char *)"OMX.google.h264.decoder\0", + 23}}; +static pj_str_t H264_hw_decoder[] = + {{(char *)"OMX.qcom.video.decoder.avc\0", 26}, + {(char *)"OMX.Exynos.avc.dec\0", 18}}; +#endif + +#if PJMEDIA_HAS_AND_MEDIA_VP8 +static pj_str_t VP8_sw_encoder[] = {{(char *)"OMX.google.vp8.encoder\0", 23}}; +static pj_str_t VP8_hw_encoder[] = + {{(char *)"OMX.qcom.video.encoder.vp8\0", 26}, + {(char *)"OMX.Exynos.vp8.Encoder\0", 22}}; +static pj_str_t VP8_sw_decoder[] = {{(char *)"OMX.google.vp8.decoder\0", 23}}; +static pj_str_t VP8_hw_decoder[] = + {{(char *)"OMX.qcom.video.decoder.vp8\0", 26}, + {(char *)"OMX.Exynos.vp8.dec\0", 18}}; +#endif + +#if PJMEDIA_HAS_AND_MEDIA_VP9 +static pj_str_t VP9_sw_encoder[] = {{(char *)"OMX.google.vp9.encoder\0", 23}}; +static pj_str_t VP9_hw_encoder[] = + {{(char *)"OMX.qcom.video.encoder.vp9\0", 26}, + {(char *)"OMX.Exynos.vp9.Encoder\0", 22}}; +static pj_str_t VP9_sw_decoder[] = {{(char *)"OMX.google.vp9.decoder\0", 23}}; +static pj_str_t VP9_hw_decoder[] = + {{(char *)"OMX.qcom.video.decoder.vp9\0", 26}, + {(char *)"OMX.Exynos.vp9.dec\0", 18}}; +#endif + +static struct and_media_codec { + int enabled; /* Is this codec enabled? */ + const char *name; /* Codec name. */ + const char *description; /* Codec description. */ + const char *mime_type; /* Mime type. */ + pj_str_t *encoder_name; /* Encoder name. */ + pj_str_t *decoder_name; /* Decoder name. */ + pj_uint8_t pt; /* Payload type. */ + pjmedia_format_id fmt_id; /* Format id. */ + pj_uint8_t keyframe_interval; /* Keyframe interval. */ + + open_cb open_codec; + process_encode_cb process_encode; + encode_more_cb encode_more; + decode_cb decode; + + pjmedia_codec_fmtp dec_fmtp; /* Decoder's fmtp params. */ +} +and_media_codec[] = { +#if PJMEDIA_HAS_AND_MEDIA_H264 + {0, "H264", "Android MediaCodec H264 codec", "video/avc", + NULL, NULL, + AND_MED_H264_PT, PJMEDIA_FORMAT_H264, KEYFRAME_INTERVAL, + &open_h264, &process_encode_h264, &encode_more_h264, &decode_h264, + {2, {{{(char *)"profile-level-id", 16}, {(char *)"42e01e", 6}}, + {{(char *)" packetization-mode", 19}, {(char *)"1", 1}}} + } + }, +#endif +#if PJMEDIA_HAS_AND_MEDIA_VP8 + {0, "VP8", "Android MediaCodec VP8 codec", "video/x-vnd.on2.vp8", + NULL, NULL, + AND_MED_VP8_PT, PJMEDIA_FORMAT_VP8, KEYFRAME_INTERVAL, + &open_vpx, NULL, &encode_more_vpx, &decode_vpx, + {2, {{{(char *)"max-fr", 6}, {(char *)"30", 2}}, + {{(char *)" max-fs", 7}, {(char *)"580", 3}}} + } + }, +#endif +#if PJMEDIA_HAS_AND_MEDIA_VP9 + {0, "VP9", "Android MediaCodec VP9 codec", "video/x-vnd.on2.vp9", + NULL, NULL, + AND_MED_VP9_PT, PJMEDIA_FORMAT_VP9, KEYFRAME_INTERVAL, + &open_vpx, NULL, &encode_more_vpx, &decode_vpx, + {2, {{{(char *)"max-fr", 6}, {(char *)"30", 2}}, + {{(char *)" max-fs", 7}, {(char *)"580", 3}}} + } + } +#endif +}; + +static pj_status_t configure_encoder(and_media_codec_data *and_media_data) +{ + media_status_t am_status; + AMediaFormat *vid_fmt; + pjmedia_vid_codec_param *param = and_media_data->prm; + + vid_fmt = AMediaFormat_new(); + if (!vid_fmt) { + PJ_LOG(4, (THIS_FILE, "Encoder failed creating media format")); + return PJ_ENOMEM; + } + + AMediaFormat_setString(vid_fmt, AND_MEDIA_KEY_MIME, + and_media_codec[and_media_data->codec_idx].mime_type); + AMediaFormat_setInt32(vid_fmt, AND_MEDIA_KEY_COLOR_FMT, + AND_MEDIA_I420_PLANAR_FMT); + AMediaFormat_setInt32(vid_fmt, AND_MEDIA_KEY_HEIGHT, + param->enc_fmt.det.vid.size.h); + AMediaFormat_setInt32(vid_fmt, AND_MEDIA_KEY_WIDTH, + param->enc_fmt.det.vid.size.w); + AMediaFormat_setInt32(vid_fmt, AND_MEDIA_KEY_BIT_RATE, + param->enc_fmt.det.vid.avg_bps); + //AMediaFormat_setInt32(vid_fmt, AND_MEDIA_KEY_PROFILE, 1); + AMediaFormat_setInt32(vid_fmt, AND_MEDIA_KEY_IFR_INTTERVAL, + KEYFRAME_INTERVAL); + AMediaFormat_setInt32(vid_fmt, AND_MEDIA_KEY_FRAME_RATE, + (param->enc_fmt.det.vid.fps.num / + param->enc_fmt.det.vid.fps.denum)); + AMediaFormat_setInt32(vid_fmt, AND_MEDIA_KEY_PRIORITY, 0); + + /* Configure and start encoder. */ + am_status = AMediaCodec_configure(and_media_data->enc, vid_fmt, NULL, NULL, + AMEDIACODEC_CONFIGURE_FLAG_ENCODE); + AMediaFormat_delete(vid_fmt); + if (am_status != AMEDIA_OK) { + PJ_LOG(4, (THIS_FILE, "Encoder configure failed, status=%d", + am_status)); + return PJMEDIA_CODEC_EFAILED; + } + am_status = AMediaCodec_start(and_media_data->enc); + if (am_status != AMEDIA_OK) { + PJ_LOG(4, (THIS_FILE, "Encoder start failed, status=%d", + am_status)); + return PJMEDIA_CODEC_EFAILED; + } + return PJ_SUCCESS; +} + +static pj_status_t configure_decoder(and_media_codec_data *and_media_data) { + media_status_t am_status; + AMediaFormat *vid_fmt; + + vid_fmt = AMediaFormat_new(); + if (!vid_fmt) { + PJ_LOG(4, (THIS_FILE, "Decoder failed creating media format")); + return PJ_ENOMEM; + } + AMediaFormat_setString(vid_fmt, AND_MEDIA_KEY_MIME, + and_media_codec[and_media_data->codec_idx].mime_type); + AMediaFormat_setInt32(vid_fmt, AND_MEDIA_KEY_COLOR_FMT, + AND_MEDIA_I420_PLANAR_FMT); + AMediaFormat_setInt32(vid_fmt, AND_MEDIA_KEY_HEIGHT, + and_media_data->prm->dec_fmt.det.vid.size.h); + AMediaFormat_setInt32(vid_fmt, AND_MEDIA_KEY_WIDTH, + and_media_data->prm->dec_fmt.det.vid.size.w); + AMediaFormat_setInt32(vid_fmt, AND_MEDIA_KEY_MAX_INPUT_SZ, 0); + AMediaFormat_setInt32(vid_fmt, AND_MEDIA_KEY_ENCODER, 0); + AMediaFormat_setInt32(vid_fmt, AND_MEDIA_KEY_PRIORITY, 0); + + if (and_media_data->prm->dec_fmt.id == PJMEDIA_FORMAT_H264) { + h264_codec_data *h264_data = (h264_codec_data *)and_media_data->ex_data; + + if (h264_data->dec_sps_len) { + AMediaFormat_setBuffer(vid_fmt, AND_MEDIA_KEY_CSD0, + h264_data->dec_sps_buf, + h264_data->dec_sps_len); + } + if (h264_data->dec_pps_len) { + AMediaFormat_setBuffer(vid_fmt, AND_MEDIA_KEY_CSD1, + h264_data->dec_pps_buf, + h264_data->dec_pps_len); + } + } + am_status = AMediaCodec_configure(and_media_data->dec, vid_fmt, NULL, + NULL, 0); + + AMediaFormat_delete(vid_fmt); + if (am_status != AMEDIA_OK) { + PJ_LOG(4, (THIS_FILE, "Decoder configure failed, status=%d, fmt_id=%d", + am_status, and_media_data->prm->dec_fmt.id)); + return PJMEDIA_CODEC_EFAILED; + } + + am_status = AMediaCodec_start(and_media_data->dec); + if (am_status != AMEDIA_OK) { + PJ_LOG(4, (THIS_FILE, "Decoder start failed, status=%d", + am_status)); + return PJMEDIA_CODEC_EFAILED; + } + return PJ_SUCCESS; +} + +PJ_DEF(pj_status_t) pjmedia_codec_and_media_vid_init( + pjmedia_vid_codec_mgr *mgr, + pj_pool_factory *pf) +{ + const pj_str_t h264_name = { (char*)"H264", 4}; + pj_status_t status; + + if (and_media_factory.pool != NULL) { + /* Already initialized. */ + return PJ_SUCCESS; + } + + if (!mgr) mgr = pjmedia_vid_codec_mgr_instance(); + PJ_ASSERT_RETURN(mgr, PJ_EINVAL); + + /* Create Android AMediaCodec codec factory. */ + and_media_factory.base.op = &and_media_factory_op; + and_media_factory.base.factory_data = NULL; + and_media_factory.mgr = mgr; + and_media_factory.pf = pf; + and_media_factory.pool = pj_pool_create(pf, "and_media_vid_factory", + 256, 256, NULL); + if (!and_media_factory.pool) + return PJ_ENOMEM; + +#if PJMEDIA_HAS_AND_MEDIA_H264 + /* Registering format match for SDP negotiation */ + status = pjmedia_sdp_neg_register_fmt_match_cb( + &h264_name, + &pjmedia_vid_codec_h264_match_sdp); + if (status != PJ_SUCCESS) + goto on_error; +#endif + + /* Register codec factory to codec manager. */ + status = pjmedia_vid_codec_mgr_register_factory(mgr, + &and_media_factory.base); + if (status != PJ_SUCCESS) + goto on_error; + + PJ_LOG(4,(THIS_FILE, "Android AMediaCodec initialized")); + + /* Done. */ + return PJ_SUCCESS; + +on_error: + pj_pool_release(and_media_factory.pool); + and_media_factory.pool = NULL; + return status; +} + +/* + * Unregister Android AMediaCodec factory from pjmedia endpoint. + */ +PJ_DEF(pj_status_t) pjmedia_codec_and_media_vid_deinit(void) +{ + pj_status_t status = PJ_SUCCESS; + + if (and_media_factory.pool == NULL) { + /* Already deinitialized */ + return PJ_SUCCESS; + } + + /* Unregister Android AMediaCodec factory. */ + status = pjmedia_vid_codec_mgr_unregister_factory(and_media_factory.mgr, + &and_media_factory.base); + + /* Destroy pool. */ + pj_pool_release(and_media_factory.pool); + and_media_factory.pool = NULL; + + return status; +} + +static pj_status_t and_media_test_alloc(pjmedia_vid_codec_factory *factory, + const pjmedia_vid_codec_info *info ) +{ + unsigned i; + + PJ_ASSERT_RETURN(factory == &and_media_factory.base, PJ_EINVAL); + + for (i = 0; i < PJ_ARRAY_SIZE(and_media_codec); ++i) { + if (and_media_codec[i].enabled && info->pt == and_media_codec[i].pt && + (info->fmt_id == and_media_codec[i].fmt_id)) + { + return PJ_SUCCESS; + } + } + + return PJMEDIA_CODEC_EUNSUP; +} + +static pj_status_t and_media_default_attr(pjmedia_vid_codec_factory *factory, + const pjmedia_vid_codec_info *info, + pjmedia_vid_codec_param *attr ) +{ + unsigned i; + + PJ_ASSERT_RETURN(factory == &and_media_factory.base, PJ_EINVAL); + PJ_ASSERT_RETURN(info && attr, PJ_EINVAL); + + for (i = 0; i < PJ_ARRAY_SIZE(and_media_codec); ++i) { + if (and_media_codec[i].enabled && info->pt != 0 && + (info->fmt_id == and_media_codec[i].fmt_id)) + { + break; + } + } + + if (i == PJ_ARRAY_SIZE(and_media_codec)) + return PJ_EINVAL; + + pj_bzero(attr, sizeof(pjmedia_vid_codec_param)); + + attr->dir = PJMEDIA_DIR_ENCODING_DECODING; + attr->packing = PJMEDIA_VID_PACKING_PACKETS; + + /* Encoded format */ + pjmedia_format_init_video(&attr->enc_fmt, info->fmt_id, + DEFAULT_WIDTH, DEFAULT_HEIGHT, DEFAULT_FPS, 1); + + /* Decoded format */ + pjmedia_format_init_video(&attr->dec_fmt, PJMEDIA_FORMAT_I420, + DEFAULT_WIDTH, DEFAULT_HEIGHT, DEFAULT_FPS, 1); + + attr->dec_fmtp = and_media_codec[i].dec_fmtp; + + /* Bitrate */ + attr->enc_fmt.det.vid.avg_bps = DEFAULT_AVG_BITRATE; + attr->enc_fmt.det.vid.max_bps = DEFAULT_MAX_BITRATE; + + /* Encoding MTU */ + attr->enc_mtu = PJMEDIA_MAX_VID_PAYLOAD_SIZE; + + return PJ_SUCCESS; +} + +static pj_bool_t codec_exists(const pj_str_t *codec_name) +{ + AMediaCodec *codec; + char *codec_txt; + + codec_txt = codec_name->ptr; + + codec = AMediaCodec_createCodecByName(codec_txt); + if (!codec) { + PJ_LOG(4, (THIS_FILE, "Failed creating codec : %.*s", codec_name->slen, + codec_name->ptr)); + return PJ_FALSE; + } + AMediaCodec_delete(codec); + + return PJ_TRUE; +} + +void add_codec(struct and_media_codec *codec, + unsigned *count, pjmedia_vid_codec_info *info) +{ + info[*count].fmt_id = codec->fmt_id; + info[*count].pt = codec->pt; + info[*count].encoding_name = pj_str((char *)codec->name); + info[*count].encoding_desc = pj_str((char *)codec->description); + + info[*count].clock_rate = 90000; + info[*count].dir = PJMEDIA_DIR_ENCODING_DECODING; + info[*count].dec_fmt_id_cnt = 1; + info[*count].dec_fmt_id[0] = PJMEDIA_FORMAT_I420; + info[*count].packings = PJMEDIA_VID_PACKING_PACKETS; + info[*count].fps_cnt = 3; + info[*count].fps[0].num = 15; + info[*count].fps[0].denum = 1; + info[*count].fps[1].num = 25; + info[*count].fps[1].denum = 1; + info[*count].fps[2].num = 30; + info[*count].fps[2].denum = 1; + ++*count; +} + +static void get_codec_name(pj_bool_t is_enc, + pj_bool_t prio, + pjmedia_format_id fmt_id, + pj_str_t **codec_name, + unsigned *codec_num) +{ + pj_bool_t use_sw_enc = PJMEDIA_AND_MEDIA_PRIO_SW_VID_ENC; + pj_bool_t use_sw_dec = PJMEDIA_AND_MEDIA_PRIO_SW_VID_DEC; + + *codec_num = 0; + + switch (fmt_id) { + +#if PJMEDIA_HAS_AND_MEDIA_H264 + case PJMEDIA_FORMAT_H264: + if (is_enc) { + if ((prio && use_sw_enc) || (!prio && !use_sw_enc)) { + *codec_name = &H264_sw_encoder[0]; + *codec_num = PJ_ARRAY_SIZE(H264_sw_encoder); + } else { + *codec_name = &H264_hw_encoder[0]; + *codec_num = PJ_ARRAY_SIZE(H264_hw_encoder); + } + } else { + if ((prio && use_sw_dec) || (!prio && !use_sw_dec)) { + *codec_name = &H264_sw_decoder[0]; + *codec_num = PJ_ARRAY_SIZE(H264_sw_decoder); + } else { + *codec_name = &H264_hw_decoder[0]; + *codec_num = PJ_ARRAY_SIZE(H264_hw_decoder); + } + } + break; +#endif +#if PJMEDIA_HAS_AND_MEDIA_VP8 + case PJMEDIA_FORMAT_VP8: + if (is_enc) { + if ((prio && use_sw_enc) || (!prio && !use_sw_enc)) { + *codec_name = &VP8_sw_encoder[0]; + *codec_num = PJ_ARRAY_SIZE(VP8_sw_encoder); + } else { + *codec_name = &VP8_hw_encoder[0]; + *codec_num = PJ_ARRAY_SIZE(VP8_hw_encoder); + } + } else { + if ((prio && use_sw_dec) || (!prio && !use_sw_dec)) { + *codec_name = &VP8_sw_decoder[0]; + *codec_num = PJ_ARRAY_SIZE(VP8_sw_decoder); + } else { + *codec_name = &VP8_hw_decoder[0]; + *codec_num = PJ_ARRAY_SIZE(VP8_hw_decoder); + } + } + break; +#endif +#if PJMEDIA_HAS_AND_MEDIA_VP9 + case PJMEDIA_FORMAT_VP9: + if (is_enc) { + if ((prio && use_sw_enc) || (!prio && !use_sw_enc)) { + *codec_name = &VP9_sw_encoder[0]; + *codec_num = PJ_ARRAY_SIZE(VP9_sw_encoder); + } else { + *codec_name = &VP9_hw_encoder[0]; + *codec_num = PJ_ARRAY_SIZE(VP9_hw_encoder); + } + } else { + if ((prio && use_sw_dec) || (!prio && !use_sw_dec)) { + *codec_name = &VP9_sw_decoder[0]; + *codec_num = PJ_ARRAY_SIZE(VP9_sw_decoder); + } else { + *codec_name = &VP9_hw_decoder[0]; + *codec_num = PJ_ARRAY_SIZE(VP9_hw_decoder); + } + } + break; +#endif + default: + break; + } +} + +static pj_status_t and_media_enum_info(pjmedia_vid_codec_factory *factory, + unsigned *count, + pjmedia_vid_codec_info info[]) +{ + unsigned i, max; + + PJ_ASSERT_RETURN(info && *count > 0, PJ_EINVAL); + PJ_ASSERT_RETURN(factory == &and_media_factory.base, PJ_EINVAL); + + max = *count; + + for (i = 0, *count = 0; i < PJ_ARRAY_SIZE(and_media_codec) && *count < max; + ++i) + { + unsigned enc_idx = 0; + unsigned dec_idx = 0; + pj_str_t *enc_name = NULL; + unsigned num_enc; + pj_str_t *dec_name = NULL; + unsigned num_dec; + + get_codec_name(PJ_TRUE, PJ_TRUE, and_media_codec[i].fmt_id, + &enc_name, &num_enc); + + for (enc_idx = 0; enc_idx < num_enc ;++enc_idx, ++enc_name) { + if (codec_exists(enc_name)) { + break; + } + } + if (enc_idx == num_enc) { + get_codec_name(PJ_TRUE, PJ_FALSE, and_media_codec[i].fmt_id, + &enc_name, &num_enc); + + for (enc_idx = 0; enc_idx < num_enc ;++enc_idx, ++enc_name) { + if (codec_exists(enc_name)) { + break; + } + } + if (enc_idx == num_enc) + continue; + } + + get_codec_name(PJ_FALSE, PJ_TRUE, and_media_codec[i].fmt_id, + &dec_name, &num_dec); + for (dec_idx = 0; dec_idx < num_dec ;++dec_idx, ++dec_name) { + if (codec_exists(dec_name)) { + break; + } + } + if (dec_idx == num_dec) { + get_codec_name(PJ_FALSE, PJ_FALSE, and_media_codec[i].fmt_id, + &dec_name, &num_dec); + for (enc_idx = 0; enc_idx < num_enc ;++enc_idx, ++enc_name) { + if (codec_exists(enc_name)) { + break; + } + } + if (dec_idx == num_dec) + continue; + } + + and_media_codec[i].encoder_name = enc_name; + and_media_codec[i].decoder_name = dec_name; + PJ_LOG(4, (THIS_FILE, "Found encoder [%d]: %.*s and decoder: %.*s ", + *count, enc_name->slen, enc_name->ptr, dec_name->slen, + dec_name->ptr)); + add_codec(&and_media_codec[*count], count, info); + and_media_codec[i].enabled = PJ_TRUE; + } + + return PJ_SUCCESS; +} + +static void create_codec(struct and_media_codec_data *and_media_data) +{ + char *enc_name; + char *dec_name; + + if (!and_media_codec[and_media_data->codec_idx].encoder_name || + !and_media_codec[and_media_data->codec_idx].decoder_name) + { + return; + } + + enc_name = and_media_codec[and_media_data->codec_idx].encoder_name->ptr; + dec_name = and_media_codec[and_media_data->codec_idx].decoder_name->ptr; + + if (!and_media_data->enc) { + and_media_data->enc = AMediaCodec_createCodecByName(enc_name); + if (!and_media_data->enc) { + PJ_LOG(4, (THIS_FILE, "Failed creating encoder: %s", enc_name)); + } + } + + if (!and_media_data->dec) { + and_media_data->dec = AMediaCodec_createCodecByName(dec_name); + if (!and_media_data->dec) { + PJ_LOG(4, (THIS_FILE, "Failed creating decoder: %s", dec_name)); + } + } + PJ_LOG(4, (THIS_FILE, "Created encoder: %s, decoder: %s", enc_name, + dec_name)); +} + +static pj_status_t and_media_alloc_codec(pjmedia_vid_codec_factory *factory, + const pjmedia_vid_codec_info *info, + pjmedia_vid_codec **p_codec) +{ + pj_pool_t *pool; + pjmedia_vid_codec *codec; + and_media_codec_data *and_media_data; + int i, idx; + + PJ_ASSERT_RETURN(factory == &and_media_factory.base && info && p_codec, + PJ_EINVAL); + + idx = -1; + for (i = 0; i < PJ_ARRAY_SIZE(and_media_codec); ++i) { + if ((info->fmt_id == and_media_codec[i].fmt_id) && + (and_media_codec[i].enabled)) + { + idx = i; + break; + } + } + if (idx == -1) { + *p_codec = NULL; + return PJMEDIA_CODEC_EFAILED; + } + + *p_codec = NULL; + pool = pj_pool_create(and_media_factory.pf, "anmedvid%p", 512, 512, NULL); + if (!pool) + return PJ_ENOMEM; + + /* codec instance */ + codec = PJ_POOL_ZALLOC_T(pool, pjmedia_vid_codec); + codec->factory = factory; + codec->op = &and_media_codec_op; + + /* codec data */ + and_media_data = PJ_POOL_ZALLOC_T(pool, and_media_codec_data); + and_media_data->pool = pool; + and_media_data->codec_idx = idx; + codec->codec_data = and_media_data; + + create_codec(and_media_data); + if (!and_media_data->enc || !and_media_data->dec) { + goto on_error; + } + + *p_codec = codec; + return PJ_SUCCESS; + +on_error: + and_media_dealloc_codec(factory, codec); + return PJMEDIA_CODEC_EFAILED; +} + +static pj_status_t and_media_dealloc_codec(pjmedia_vid_codec_factory *factory, + pjmedia_vid_codec *codec ) +{ + and_media_codec_data *and_media_data; + + PJ_ASSERT_RETURN(codec, PJ_EINVAL); + + PJ_UNUSED_ARG(factory); + + and_media_data = (and_media_codec_data*) codec->codec_data; + if (and_media_data->enc) { + AMediaCodec_stop(and_media_data->enc); + AMediaCodec_delete(and_media_data->enc); + and_media_data->enc = NULL; + } + + if (and_media_data->dec) { + AMediaCodec_stop(and_media_data->dec); + AMediaCodec_delete(and_media_data->dec); + and_media_data->dec = NULL; + } + pj_pool_release(and_media_data->pool); + return PJ_SUCCESS; +} + +static pj_status_t and_media_codec_init(pjmedia_vid_codec *codec, + pj_pool_t *pool ) +{ + PJ_ASSERT_RETURN(codec && pool, PJ_EINVAL); + PJ_UNUSED_ARG(codec); + PJ_UNUSED_ARG(pool); + return PJ_SUCCESS; +} + +static pj_status_t and_media_codec_open(pjmedia_vid_codec *codec, + pjmedia_vid_codec_param *codec_param) +{ + and_media_codec_data *and_media_data; + pjmedia_vid_codec_param *param; + pj_status_t status = PJ_SUCCESS; + + and_media_data = (and_media_codec_data*) codec->codec_data; + and_media_data->prm = pjmedia_vid_codec_param_clone( and_media_data->pool, + codec_param); + param = and_media_data->prm; + if (and_media_codec[and_media_data->codec_idx].open_codec) { + status = and_media_codec[and_media_data->codec_idx].open_codec( + and_media_data); + if (status != PJ_SUCCESS) + return status; + } + and_media_data->whole = (param->packing == PJMEDIA_VID_PACKING_WHOLE); + status = configure_encoder(and_media_data); + if (status != PJ_SUCCESS) { + return PJMEDIA_CODEC_EFAILED; + } + status = configure_decoder(and_media_data); + if (status != PJ_SUCCESS) { + return PJMEDIA_CODEC_EFAILED; + } + if (and_media_data->dec_buf_size == 0) { + and_media_data->dec_buf_size = (MAX_RX_WIDTH * MAX_RX_HEIGHT * 3 >> 1) + + (MAX_RX_WIDTH); + } + and_media_data->dec_buf = (pj_uint8_t*)pj_pool_alloc(and_media_data->pool, + and_media_data->dec_buf_size); + /* Need to update param back after values are negotiated */ + pj_memcpy(codec_param, param, sizeof(*codec_param)); + + return PJ_SUCCESS; +} + +static pj_status_t and_media_codec_close(pjmedia_vid_codec *codec) +{ + PJ_ASSERT_RETURN(codec, PJ_EINVAL); + PJ_UNUSED_ARG(codec); + return PJ_SUCCESS; +} + +static pj_status_t and_media_codec_modify(pjmedia_vid_codec *codec, + const pjmedia_vid_codec_param *param) +{ + PJ_ASSERT_RETURN(codec && param, PJ_EINVAL); + PJ_UNUSED_ARG(codec); + PJ_UNUSED_ARG(param); + return PJ_EINVALIDOP; +} + +static pj_status_t and_media_codec_get_param(pjmedia_vid_codec *codec, + pjmedia_vid_codec_param *param) +{ + struct and_media_codec_data *and_media_data; + + PJ_ASSERT_RETURN(codec && param, PJ_EINVAL); + + and_media_data = (and_media_codec_data*) codec->codec_data; + pj_memcpy(param, and_media_data->prm, sizeof(*param)); + + return PJ_SUCCESS; +} + +static pj_status_t and_media_codec_encode_begin(pjmedia_vid_codec *codec, + const pjmedia_vid_encode_opt *opt, + const pjmedia_frame *input, + unsigned out_size, + pjmedia_frame *output, + pj_bool_t *has_more) +{ + struct and_media_codec_data *and_media_data; + unsigned i; + pj_ssize_t buf_idx; + + PJ_ASSERT_RETURN(codec && input && out_size && output && has_more, + PJ_EINVAL); + + and_media_data = (and_media_codec_data*) codec->codec_data; + + if (opt && opt->force_keyframe) { +#if __ANDROID_API__ >=26 + AMediaFormat *vid_fmt = NULL; + media_status_t am_status; + + vid_fmt = AMediaFormat_new(); + if (!vid_fmt) { + return PJMEDIA_CODEC_EFAILED; + } + AMediaFormat_setInt32(vid_fmt, AND_MEDIA_KEY_REQUEST_SYNCF, 0); + am_status = AMediaCodec_setParameters(and_media_data->enc, vid_fmt); + + if (am_status != AMEDIA_OK) + PJ_LOG(4,(THIS_FILE, "Encoder setParameters failed %d", am_status)); + + AMediaFormat_delete(vid_fmt); +#else + PJ_LOG(5, (THIS_FILE, "Encoder cannot be forced to send keyframe")); +#endif + } + + buf_idx = AMediaCodec_dequeueInputBuffer(and_media_data->enc, + CODEC_DEQUEUE_TIMEOUT); + if (buf_idx >= 0) { + media_status_t am_status; + pj_size_t output_size; + pj_uint8_t *input_buf = AMediaCodec_getInputBuffer(and_media_data->enc, + buf_idx, &output_size); + if (input_buf && output_size >= input->size) { + pj_memcpy(input_buf, input->buf, input->size); + am_status = AMediaCodec_queueInputBuffer(and_media_data->enc, + buf_idx, 0, input->size, 0, 0); + if (am_status != AMEDIA_OK) { + PJ_LOG(4, (THIS_FILE, "Encoder queueInputBuffer return %d", + am_status)); + goto on_return; + } + } else { + if (!input_buf) { + PJ_LOG(4,(THIS_FILE, "Encoder getInputBuffer " + "returns no input buff")); + } else { + PJ_LOG(4,(THIS_FILE, "Encoder getInputBuffer " + "size: %d, expecting %d.", + input_buf, output_size, input->size)); + } + goto on_return; + } + } else { + PJ_LOG(4,(THIS_FILE, "Encoder dequeueInputBuffer failed[%d]", buf_idx)); + goto on_return; + } + + for (i = 0; i < CODEC_WAIT_RETRY; ++i) { + buf_idx = AMediaCodec_dequeueOutputBuffer(and_media_data->enc, + &and_media_data->enc_buf_info, + CODEC_DEQUEUE_TIMEOUT); + if (buf_idx == -1) { + /* Timeout, wait until output buffer is availble. */ + PJ_LOG(5, (THIS_FILE, "Encoder dequeueOutputBuffer timeout[%d]", + i+1)); + pj_thread_sleep(CODEC_THREAD_WAIT); + } else { + break; + } + } + + if (buf_idx >= 0) { + pj_size_t output_size; + pj_uint8_t *output_buf = AMediaCodec_getOutputBuffer( + and_media_data->enc, + buf_idx, + &output_size); + if (!output_buf) { + PJ_LOG(4, (THIS_FILE, "Encoder failed getting output buffer, " + "buffer size %d, offset %d, flags %d", + and_media_data->enc_buf_info.size, + and_media_data->enc_buf_info.offset, + and_media_data->enc_buf_info.flags)); + goto on_return; + } + and_media_data->enc_processed = 0; + and_media_data->enc_frame_whole = output_buf; + and_media_data->enc_output_buf_idx = buf_idx; + and_media_data->enc_frame_size = and_media_data->enc_buf_info.size; + + if (and_media_codec[and_media_data->codec_idx].process_encode) { + pj_status_t status; + + status = and_media_codec[and_media_data->codec_idx].process_encode( + and_media_data); + + if (status != PJ_SUCCESS) + goto on_return; + } + + if(and_media_data->enc_buf_info.flags & AND_MEDIA_FRM_TYPE_KEYFRAME) { + output->bit_info |= PJMEDIA_VID_FRM_KEYFRAME; + } + + if (and_media_data->whole) { + unsigned payload_size = 0; + unsigned start_data = 0; + + *has_more = PJ_FALSE; + + if ((and_media_data->prm->enc_fmt.id == PJMEDIA_FORMAT_H264) && + (and_media_data->enc_buf_info.flags & + AND_MEDIA_FRM_TYPE_KEYFRAME)) + { + h264_codec_data *h264_data = + (h264_codec_data *)and_media_data->ex_data; + start_data = h264_data->enc_sps_pps_len; + pj_memcpy(output->buf, h264_data->enc_sps_pps_buf, + h264_data->enc_sps_pps_len); + } + + payload_size = and_media_data->enc_buf_info.size + start_data; + + if (payload_size > out_size) + return PJMEDIA_CODEC_EFRMTOOSHORT; + + output->type = PJMEDIA_FRAME_TYPE_VIDEO; + output->size = payload_size; + output->timestamp = input->timestamp; + pj_memcpy((pj_uint8_t*)output->buf+start_data, + and_media_data->enc_frame_whole, + and_media_data->enc_buf_info.size); + + AMediaCodec_releaseOutputBuffer(and_media_data->enc, + buf_idx, + 0); + + return PJ_SUCCESS; + } + } else { + if (buf_idx == -2) { + int width, height, color_fmt, stride; + + /* Format change. */ + AMediaFormat *vid_fmt = AMediaCodec_getOutputFormat( + and_media_data->enc); + + AMediaFormat_getInt32(vid_fmt, AND_MEDIA_KEY_WIDTH, &width); + AMediaFormat_getInt32(vid_fmt, AND_MEDIA_KEY_HEIGHT, &height); + AMediaFormat_getInt32(vid_fmt, AND_MEDIA_KEY_COLOR_FMT, &color_fmt); + AMediaFormat_getInt32(vid_fmt, AND_MEDIA_KEY_STRIDE, &stride); + PJ_LOG(5, (THIS_FILE, "Encoder detect new width %d, height %d, " + "color_fmt 0x%X, stride %d buf_size %d", + width, height, color_fmt, stride, + and_media_data->enc_buf_info.size)); + + AMediaFormat_delete(vid_fmt); + } else { + PJ_LOG(4, (THIS_FILE, "Encoder dequeueOutputBuffer failed[%d]", + buf_idx)); + } + goto on_return; + } + + return and_media_codec_encode_more(codec, out_size, output, has_more); + +on_return: + output->size = 0; + output->type = PJMEDIA_FRAME_TYPE_NONE; + *has_more = PJ_FALSE; + return PJ_SUCCESS; +} + +static pj_status_t and_media_codec_encode_more(pjmedia_vid_codec *codec, + unsigned out_size, + pjmedia_frame *output, + pj_bool_t *has_more) +{ + struct and_media_codec_data *and_media_data; + pj_status_t status = PJ_SUCCESS; + + PJ_ASSERT_RETURN(codec && out_size && output && has_more, PJ_EINVAL); + + and_media_data = (and_media_codec_data*) codec->codec_data; + + status = and_media_codec[and_media_data->codec_idx].encode_more( + and_media_data, + out_size, output, + has_more); + if (!(*has_more)) { + AMediaCodec_releaseOutputBuffer(and_media_data->enc, + and_media_data->enc_output_buf_idx, + 0); + } + + return status; +} + +static int write_yuv(pj_uint8_t *buf, + unsigned dst_len, + unsigned char* input, + int stride_len, + int iWidth, + int iHeight) +{ + unsigned req_size; + pj_uint8_t *dst = buf; + pj_uint8_t *max = dst + dst_len; + int i; + unsigned char* pPtr = NULL; + + req_size = (iWidth * iHeight) + (iWidth / 2 * iHeight / 2) + + (iWidth / 2 * iHeight / 2); + if (dst_len < req_size) + return -1; + + pPtr = input; + for (i = 0; i < iHeight && (dst + iWidth < max); i++) { + pj_memcpy(dst, pPtr, iWidth); + pPtr += stride_len; + dst += iWidth; + } + + if (i < iHeight) + return -1; + + iHeight = iHeight / 2; + iWidth = iWidth / 2; + for (i = 0; i < iHeight && (dst + iWidth <= max); i++) { + pj_memcpy(dst, pPtr, iWidth); + pPtr += stride_len/2; + dst += iWidth; + } + + if (i < iHeight) + return -1; + + for (i = 0; i < iHeight && (dst + iWidth <= max); i++) { + pj_memcpy(dst, pPtr, iWidth); + pPtr += stride_len/2; + dst += iWidth; + } + + if (i < iHeight) + return -1; + + return dst - buf; +} + +static void and_media_get_input_buffer( + struct and_media_codec_data *and_media_data) +{ + pj_ssize_t buf_idx = -1; + + buf_idx = AMediaCodec_dequeueInputBuffer(and_media_data->dec, + CODEC_DEQUEUE_TIMEOUT); + + if (buf_idx < 0) { + PJ_LOG(4,(THIS_FILE, "Decoder dequeueInputBuffer failed return %d", + buf_idx)); + + and_media_data->dec_input_buf = NULL; + + if (buf_idx == -10000) { + PJ_LOG(5, (THIS_FILE, "Resetting decoder")); + AMediaCodec_stop(and_media_data->dec); + AMediaCodec_delete(and_media_data->dec); + and_media_data->dec = NULL; + + create_codec(and_media_data); + if (and_media_data->dec) + configure_decoder(and_media_data); + } + return; + } + + and_media_data->dec_input_buf_len = 0; + and_media_data->dec_input_buf_idx = buf_idx; + and_media_data->dec_input_buf = AMediaCodec_getInputBuffer( + and_media_data->dec, + buf_idx, + &and_media_data->dec_input_buf_max_size); +} + +static pj_status_t and_media_decode(pjmedia_vid_codec *codec, + struct and_media_codec_data *and_media_data, + pj_uint8_t *input_buf, unsigned buf_size, + int buf_flag, pj_timestamp *input_ts, + pj_bool_t write_output, pjmedia_frame *output) +{ + pj_ssize_t buf_idx = 0; + pj_status_t status = PJ_SUCCESS; + media_status_t am_status; + + if ((and_media_data->dec_input_buf_max_size > 0) && + (and_media_data->dec_input_buf_len + buf_size > + and_media_data->dec_input_buf_max_size)) + { + am_status = AMediaCodec_queueInputBuffer(and_media_data->dec, + and_media_data->dec_input_buf_idx, + 0, + and_media_data->dec_input_buf_len, + input_ts->u32.lo, + buf_flag); + if (am_status != AMEDIA_OK) { + PJ_LOG(4,(THIS_FILE, "Decoder queueInputBuffer idx[%d] return %d", + and_media_data->dec_input_buf_idx, am_status)); + return status; + } + and_media_data->dec_input_buf = NULL; + } + + if (and_media_data->dec_input_buf == NULL) + { + and_media_get_input_buffer(and_media_data); + + if (and_media_data->dec_input_buf == NULL) { + PJ_LOG(4,(THIS_FILE, "Decoder failed getting input buffer")); + return status; + } + } + pj_memcpy(and_media_data->dec_input_buf + and_media_data->dec_input_buf_len, + input_buf, buf_size); + + and_media_data->dec_input_buf_len += buf_size; + + if (!write_output) + return status; + + am_status = AMediaCodec_queueInputBuffer(and_media_data->dec, + and_media_data->dec_input_buf_idx, + 0, + and_media_data->dec_input_buf_len, + input_ts->u32.lo, + buf_flag); + if (am_status != AMEDIA_OK) { + PJ_LOG(4,(THIS_FILE, "Decoder queueInputBuffer failed return %d", + am_status)); + and_media_data->dec_input_buf = NULL; + return status; + } + and_media_data->dec_input_buf_len += buf_size; + + buf_idx = AMediaCodec_dequeueOutputBuffer(and_media_data->dec, + &and_media_data->dec_buf_info, + CODEC_DEQUEUE_TIMEOUT); + + if (buf_idx >= 0) { + pj_size_t output_size; + int len; + + pj_uint8_t *output_buf = AMediaCodec_getOutputBuffer( + and_media_data->dec, + buf_idx, + &output_size); + if (output_buf == NULL) { + am_status = AMediaCodec_releaseOutputBuffer(and_media_data->dec, + buf_idx, + 0); + PJ_LOG(4,(THIS_FILE, "Decoder getOutputBuffer failed")); + return status; + } + len = write_yuv((pj_uint8_t *)output->buf, + and_media_data->dec_buf_info.size, + output_buf, + and_media_data->dec_stride_len, + and_media_data->prm->dec_fmt.det.vid.size.w, + and_media_data->prm->dec_fmt.det.vid.size.h); + + am_status = AMediaCodec_releaseOutputBuffer(and_media_data->dec, + buf_idx, + 0); + + if (len > 0) { + if (!and_media_data->dec_has_output_frame) { + output->type = PJMEDIA_FRAME_TYPE_VIDEO; + output->size = len; + output->timestamp = *input_ts; + + and_media_data->dec_has_output_frame = PJ_TRUE; + } + } else { + status = PJMEDIA_CODEC_EFRMTOOSHORT; + } + } else if (buf_idx == -2) { + int width, height, stride; + AMediaFormat *vid_fmt; + /* Get output format */ + vid_fmt = AMediaCodec_getOutputFormat(and_media_data->dec); + + AMediaFormat_getInt32(vid_fmt, AND_MEDIA_KEY_WIDTH, &width); + AMediaFormat_getInt32(vid_fmt, AND_MEDIA_KEY_HEIGHT, &height); + AMediaFormat_getInt32(vid_fmt, AND_MEDIA_KEY_STRIDE, &stride); + + AMediaFormat_delete(vid_fmt); + and_media_data->dec_stride_len = stride; + if (width != and_media_data->prm->dec_fmt.det.vid.size.w || + height != and_media_data->prm->dec_fmt.det.vid.size.h) + { + pjmedia_event event; + + and_media_data->prm->dec_fmt.det.vid.size.w = width; + and_media_data->prm->dec_fmt.det.vid.size.h = height; + + PJ_LOG(4,(THIS_FILE, "Frame size changed to %dx%d", + and_media_data->prm->dec_fmt.det.vid.size.w, + and_media_data->prm->dec_fmt.det.vid.size.h)); + + /* Broadcast format changed event */ + pjmedia_event_init(&event, PJMEDIA_EVENT_FMT_CHANGED, + &output->timestamp, codec); + event.data.fmt_changed.dir = PJMEDIA_DIR_DECODING; + pjmedia_format_copy(&event.data.fmt_changed.new_fmt, + &and_media_data->prm->dec_fmt); + pjmedia_event_publish(NULL, codec, &event, + PJMEDIA_EVENT_PUBLISH_DEFAULT); + } + } else { + PJ_LOG(4,(THIS_FILE, "Decoder dequeueOutputBuffer failed [%d]", + buf_idx)); + } + return status; +} + +static pj_status_t and_media_codec_decode(pjmedia_vid_codec *codec, + pj_size_t count, + pjmedia_frame packets[], + unsigned out_size, + pjmedia_frame *output) +{ + struct and_media_codec_data *and_media_data; + pj_status_t status = PJ_EINVAL; + + PJ_ASSERT_RETURN(codec && count && packets && out_size && output, + PJ_EINVAL); + PJ_ASSERT_RETURN(output->buf, PJ_EINVAL); + + and_media_data = (and_media_codec_data*) codec->codec_data; + and_media_data->dec_has_output_frame = PJ_FALSE; + and_media_data->dec_input_buf = NULL; + and_media_data->dec_input_buf_len = 0; + + if (and_media_codec[and_media_data->codec_idx].decode) { + status = and_media_codec[and_media_data->codec_idx].decode(codec, count, + packets, out_size, + output); + } + if (status != PJ_SUCCESS) { + return status; + } + if (!and_media_data->dec_has_output_frame) { + pjmedia_event event; + + /* Broadcast missing keyframe event */ + pjmedia_event_init(&event, PJMEDIA_EVENT_KEYFRAME_MISSING, + &packets[0].timestamp, codec); + pjmedia_event_publish(NULL, codec, &event, + PJMEDIA_EVENT_PUBLISH_DEFAULT); + + PJ_LOG(4,(THIS_FILE, "Decoder couldn't produce output frame")); + + output->type = PJMEDIA_FRAME_TYPE_NONE; + output->size = 0; + output->timestamp = packets[0].timestamp; + } + return PJ_SUCCESS; +} + +#if PJMEDIA_HAS_AND_MEDIA_H264 + +static pj_status_t open_h264(and_media_codec_data *and_media_data) +{ + pj_status_t status; + pjmedia_vid_codec_param *param = and_media_data->prm; + pjmedia_h264_packetizer_cfg pktz_cfg; + pjmedia_vid_codec_h264_fmtp h264_fmtp; + h264_codec_data *h264_data; + + /* Parse remote fmtp */ + pj_bzero(&h264_fmtp, sizeof(h264_fmtp)); + status = pjmedia_vid_codec_h264_parse_fmtp(¶m->enc_fmtp, + &h264_fmtp); + if (status != PJ_SUCCESS) + return status; + + /* Apply SDP fmtp to format in codec param */ + if (!param->ignore_fmtp) { + status = pjmedia_vid_codec_h264_apply_fmtp(param); + if (status != PJ_SUCCESS) + return status; + } + h264_data = PJ_POOL_ZALLOC_T(and_media_data->pool, h264_codec_data); + if (!h264_data) + return PJ_ENOMEM; + + pj_bzero(&pktz_cfg, sizeof(pktz_cfg)); + pktz_cfg.mtu = param->enc_mtu; + pktz_cfg.unpack_nal_start = 4; + /* Packetization mode */ + if (h264_fmtp.packetization_mode == 0) + pktz_cfg.mode = PJMEDIA_H264_PACKETIZER_MODE_SINGLE_NAL; + else if (h264_fmtp.packetization_mode == 1) + pktz_cfg.mode = PJMEDIA_H264_PACKETIZER_MODE_NON_INTERLEAVED; + else + return PJ_ENOTSUP; + + /* Android H264 only supports Non Interleaved mode. */ + pktz_cfg.mode = PJMEDIA_H264_PACKETIZER_MODE_NON_INTERLEAVED; + status = pjmedia_h264_packetizer_create(and_media_data->pool, &pktz_cfg, + &h264_data->pktz); + if (status != PJ_SUCCESS) + return status; + + and_media_data->ex_data = h264_data; + and_media_data->dec_buf_size = (MAX_RX_WIDTH * MAX_RX_HEIGHT * 3 >> 1) + + (MAX_RX_WIDTH); + + /* If available, use the "sprop-parameter-sets" fmtp from remote SDP + * to create the decoder. + */ + if (h264_fmtp.sprop_param_sets_len) { + const pj_uint8_t start_code[3] = { 0, 0, 1 }; + const int code_size = PJ_ARRAY_SIZE(start_code); + const pj_uint8_t med_start_code[4] = { 0, 0, 0, 1 }; + const int med_code_size = PJ_ARRAY_SIZE(med_start_code); + unsigned i, j; + + for (i = h264_fmtp.sprop_param_sets_len - code_size; + i >= code_size; i--) + { + for (j = 0; j < code_size; j++) { + if (h264_fmtp.sprop_param_sets[i + j] != start_code[j]) { + break; + } + } + } + + if (i >= code_size) { + h264_data->dec_sps_len = i + med_code_size - code_size; + h264_data->dec_pps_len = h264_fmtp.sprop_param_sets_len + + med_code_size - code_size - i; + + h264_data->dec_sps_buf = (pj_uint8_t *)pj_pool_alloc( + and_media_data->pool, h264_data->dec_sps_len); + h264_data->dec_pps_buf = (pj_uint8_t *)pj_pool_alloc( + and_media_data->pool, h264_data->dec_pps_len); + + pj_memcpy(h264_data->dec_sps_buf, med_start_code, + med_code_size); + pj_memcpy(h264_data->dec_sps_buf + med_code_size, + &h264_fmtp.sprop_param_sets[code_size], + h264_data->dec_sps_len - med_code_size); + pj_memcpy(h264_data->dec_pps_buf, med_start_code, + med_code_size); + pj_memcpy(h264_data->dec_pps_buf + med_code_size, + &h264_fmtp.sprop_param_sets[i + code_size], + h264_data->dec_pps_len - med_code_size); + } + } + return status; +} + +static pj_status_t process_encode_h264(and_media_codec_data *and_media_data) +{ + pj_status_t status = PJ_SUCCESS; + h264_codec_data *h264_data; + + h264_data = (h264_codec_data *)and_media_data->ex_data; + if (and_media_data->enc_buf_info.flags & AND_MEDIA_FRM_TYPE_CONFIG) { + + /* + * Config data or SPS+PPS. Update the SPS and PPS buffer, + * this will be sent later when sending Keyframe. + */ + h264_data->enc_sps_pps_len = PJ_MIN(and_media_data->enc_buf_info.size, + sizeof(h264_data->enc_sps_pps_buf)); + pj_memcpy(h264_data->enc_sps_pps_buf, and_media_data->enc_frame_whole, + h264_data->enc_sps_pps_len); + + AMediaCodec_releaseOutputBuffer(and_media_data->enc, + and_media_data->enc_output_buf_idx, + 0); + + return PJ_EIGNORED; + } + if (and_media_data->enc_buf_info.flags & AND_MEDIA_FRM_TYPE_KEYFRAME) { + h264_data->enc_sps_pps_ex = PJ_TRUE; + and_media_data->enc_frame_size = h264_data->enc_sps_pps_len; + } else { + h264_data->enc_sps_pps_ex = PJ_FALSE; + } + + return status; +} + +static pj_status_t encode_more_h264(and_media_codec_data *and_media_data, + unsigned out_size, + pjmedia_frame *output, + pj_bool_t *has_more) +{ + const pj_uint8_t *payload; + pj_size_t payload_len; + pj_status_t status; + pj_uint8_t *data_buf = NULL; + h264_codec_data *h264_data; + + h264_data = (h264_codec_data *)and_media_data->ex_data; + if (h264_data->enc_sps_pps_ex) { + data_buf = h264_data->enc_sps_pps_buf; + } else { + data_buf = and_media_data->enc_frame_whole; + } + /* We have outstanding frame in packetizer */ + status = pjmedia_h264_packetize(h264_data->pktz, + data_buf, + and_media_data->enc_frame_size, + &and_media_data->enc_processed, + &payload, &payload_len); + if (status != PJ_SUCCESS) { + /* Reset */ + and_media_data->enc_frame_size = and_media_data->enc_processed = 0; + *has_more = (and_media_data->enc_processed < + and_media_data->enc_frame_size); + + PJ_PERROR(3,(THIS_FILE, status, "pjmedia_h264_packetize() error")); + return status; + } + + PJ_ASSERT_RETURN(payload_len <= out_size, PJMEDIA_CODEC_EFRMTOOSHORT); + + output->type = PJMEDIA_FRAME_TYPE_VIDEO; + pj_memcpy(output->buf, payload, payload_len); + output->size = payload_len; + + if (and_media_data->enc_processed >= and_media_data->enc_frame_size) { + h264_codec_data *h264_data = (h264_codec_data *)and_media_data->ex_data; + + if (h264_data->enc_sps_pps_ex) { + *has_more = PJ_TRUE; + h264_data->enc_sps_pps_ex = PJ_FALSE; + and_media_data->enc_processed = 0; + and_media_data->enc_frame_size = and_media_data->enc_buf_info.size; + } else { + *has_more = PJ_FALSE; + } + } else { + *has_more = PJ_TRUE; + } + + return PJ_SUCCESS; +} + +static pj_status_t decode_h264(pjmedia_vid_codec *codec, + pj_size_t count, + pjmedia_frame packets[], + unsigned out_size, + pjmedia_frame *output) +{ + struct and_media_codec_data *and_media_data; + const pj_uint8_t start_code[] = { 0, 0, 0, 1 }; + const int code_size = PJ_ARRAY_SIZE(start_code); + unsigned buf_pos, whole_len = 0; + unsigned i, frm_cnt; + pj_status_t status; + + PJ_ASSERT_RETURN(codec && count && packets && out_size && output, + PJ_EINVAL); + PJ_ASSERT_RETURN(output->buf, PJ_EINVAL); + + and_media_data = (and_media_codec_data*) codec->codec_data; + + /* + * Step 1: unpacketize the packets/frames + */ + whole_len = 0; + if (and_media_data->whole) { + for (i=0; i and_media_data->dec_buf_size) { + PJ_LOG(4,(THIS_FILE, "Decoding buffer overflow [1]")); + return PJMEDIA_CODEC_EFRMTOOSHORT; + } + + pj_memcpy( and_media_data->dec_buf + whole_len, + (pj_uint8_t*)packets[i].buf, + packets[i].size); + whole_len += packets[i].size; + } + + } else { + h264_codec_data *h264_data = (h264_codec_data *)and_media_data->ex_data; + + for (i=0; i + and_media_data->dec_buf_size) + { + PJ_LOG(4,(THIS_FILE, "Decoding buffer overflow [2]")); + return PJMEDIA_CODEC_EFRMTOOSHORT; + } + + status = pjmedia_h264_unpacketize( h264_data->pktz, + (pj_uint8_t*)packets[i].buf, + packets[i].size, + and_media_data->dec_buf, + and_media_data->dec_buf_size, + &whole_len); + if (status != PJ_SUCCESS) { + PJ_PERROR(4,(THIS_FILE, status, "Unpacketize error")); + continue; + } + } + } + + if (whole_len + code_size > and_media_data->dec_buf_size || + whole_len <= code_size + 1) + { + PJ_LOG(4,(THIS_FILE, "Decoding buffer overflow or unpacketize error " + "size: %d, buffer: %d", whole_len, + and_media_data->dec_buf_size)); + return PJMEDIA_CODEC_EFRMTOOSHORT; + } + + /* Dummy NAL sentinel */ + pj_memcpy(and_media_data->dec_buf + whole_len, start_code, code_size); + + /* + * Step 2: parse the individual NAL and give to decoder + */ + buf_pos = 0; + for ( frm_cnt=0; ; ++frm_cnt) { + pj_uint32_t frm_size; + pj_bool_t write_output = PJ_FALSE; + unsigned char *start; + + for (i = code_size - 1; buf_pos + i < whole_len; i++) { + if (and_media_data->dec_buf[buf_pos + i] == 0 && + and_media_data->dec_buf[buf_pos + i + 1] == 0 && + and_media_data->dec_buf[buf_pos + i + 2] == 0 && + and_media_data->dec_buf[buf_pos + i + 3] == 1) + { + break; + } + } + + frm_size = i; + start = and_media_data->dec_buf + buf_pos; + write_output = (buf_pos + frm_size >= whole_len); + + status = and_media_decode(codec, and_media_data, start, frm_size, 0, + &packets[0].timestamp, write_output, output); + if (status != PJ_SUCCESS) + return status; + + if (write_output) + break; + + buf_pos += frm_size; + } + + return PJ_SUCCESS; +} + +#endif + +#if PJMEDIA_HAS_AND_MEDIA_VP8 || PJMEDIA_HAS_AND_MEDIA_VP9 + +static pj_status_t open_vpx(and_media_codec_data *and_media_data) +{ + vpx_codec_data *vpx_data; + pjmedia_vid_codec_vpx_fmtp vpx_fmtp; + pjmedia_vpx_packetizer_cfg pktz_cfg; + pj_status_t status = PJ_SUCCESS; + unsigned max_res = MAX_RX_WIDTH; + + if (!and_media_data->prm->ignore_fmtp) { + status = pjmedia_vid_codec_vpx_apply_fmtp(and_media_data->prm); + if (status != PJ_SUCCESS) + return status; + } + + vpx_data = PJ_POOL_ZALLOC_T(and_media_data->pool, vpx_codec_data); + if (!vpx_data) + return PJ_ENOMEM; + + /* Parse local fmtp */ + status = pjmedia_vid_codec_vpx_parse_fmtp(&and_media_data->prm->dec_fmtp, + &vpx_fmtp); + if (status != PJ_SUCCESS) + return status; + + if (vpx_fmtp.max_fs > 0) { + max_res = ((int)pj_isqrt(vpx_fmtp.max_fs * 8)) * 16; + } + and_media_data->dec_buf_size = (max_res * max_res * 3 >> 1) + (max_res); + + pj_bzero(&pktz_cfg, sizeof(pktz_cfg)); + pktz_cfg.mtu = and_media_data->prm->enc_mtu; + pktz_cfg.fmt_id = and_media_data->prm->enc_fmt.id; + + status = pjmedia_vpx_packetizer_create(and_media_data->pool, &pktz_cfg, + &vpx_data->pktz); + if (status != PJ_SUCCESS) + return status; + + and_media_data->ex_data = vpx_data; + + return status; +} + +static pj_status_t encode_more_vpx(and_media_codec_data *and_media_data, + unsigned out_size, + pjmedia_frame *output, + pj_bool_t *has_more) +{ + pj_status_t status = PJ_SUCCESS; + struct vpx_codec_data *vpx_data = (vpx_codec_data *)and_media_data->ex_data; + + PJ_ASSERT_RETURN(and_media_data && out_size && output && has_more, + PJ_EINVAL); + + if ((and_media_data->prm->enc_fmt.id != PJMEDIA_FORMAT_VP8) && + (and_media_data->prm->enc_fmt.id != PJMEDIA_FORMAT_VP9)) + { + *has_more = PJ_FALSE; + output->size = 0; + output->type = PJMEDIA_FRAME_TYPE_NONE; + + return PJ_SUCCESS; + } + + if (and_media_data->enc_processed < and_media_data->enc_frame_size) { + unsigned payload_desc_size = 1; + pj_size_t payload_len = out_size; + pj_uint8_t *p = (pj_uint8_t *)output->buf; + pj_bool_t is_keyframe = and_media_data->enc_buf_info.flags & + AND_MEDIA_FRM_TYPE_KEYFRAME; + + status = pjmedia_vpx_packetize(vpx_data->pktz, + and_media_data->enc_frame_size, + &and_media_data->enc_processed, + is_keyframe, + &p, + &payload_len); + if (status != PJ_SUCCESS) { + return status; + } + pj_memcpy(p + payload_desc_size, + (and_media_data->enc_frame_whole + and_media_data->enc_processed), + payload_len); + output->size = payload_len + payload_desc_size; + if (is_keyframe) { + output->bit_info |= PJMEDIA_VID_FRM_KEYFRAME; + } + and_media_data->enc_processed += payload_len; + *has_more = (and_media_data->enc_processed < + and_media_data->enc_frame_size); + } + + return status; +} + +static pj_status_t decode_vpx(pjmedia_vid_codec *codec, + pj_size_t count, + pjmedia_frame packets[], + unsigned out_size, + pjmedia_frame *output) +{ + unsigned i, whole_len = 0; + pj_status_t status; + and_media_codec_data *and_media_data = + (and_media_codec_data*) codec->codec_data; + struct vpx_codec_data *vpx_data = (vpx_codec_data *)and_media_data->ex_data; + + PJ_ASSERT_RETURN(codec && count && packets && out_size && output, + PJ_EINVAL); + PJ_ASSERT_RETURN(output->buf, PJ_EINVAL); + + whole_len = 0; + if (and_media_data->whole) { + for (i = 0; i < count; ++i) { + if (whole_len + packets[i].size > and_media_data->dec_buf_size) { + PJ_LOG(4,(THIS_FILE, "Decoding buffer overflow [1]")); + return PJMEDIA_CODEC_EFRMTOOSHORT; + } + + pj_memcpy( and_media_data->dec_buf + whole_len, + (pj_uint8_t*)packets[i].buf, + packets[i].size); + whole_len += packets[i].size; + } + status = and_media_decode(codec, and_media_data, + and_media_data->dec_buf, whole_len, 0, + &packets[0].timestamp, PJ_TRUE, output); + + if (status != PJ_SUCCESS) + return status; + + } else { + for (i = 0; i < count; ++i) { + unsigned desc_len; + unsigned packet_size = packets[i].size; + pj_status_t status; + pj_bool_t write_output; + + status = pjmedia_vpx_unpacketize(vpx_data->pktz, + (pj_uint8_t *)packets[i].buf, + packet_size, + &desc_len); + if (status != PJ_SUCCESS) { + PJ_LOG(4,(THIS_FILE, "Unpacketize error packet size[%d]", + packet_size)); + return status; + } + + packet_size -= desc_len; + if (whole_len + packet_size > and_media_data->dec_buf_size) { + PJ_LOG(4,(THIS_FILE, "Decoding buffer overflow [2]")); + return PJMEDIA_CODEC_EFRMTOOSHORT; + } + + write_output = (i == count - 1); + + status = and_media_decode(codec, and_media_data, + (pj_uint8_t *)packets[i].buf + desc_len, + packet_size, 0, &packets[0].timestamp, + write_output, output); + if (status != PJ_SUCCESS) + return status; + + whole_len += packet_size; + } + } + return PJ_SUCCESS; +} + +#endif + +#endif /* PJMEDIA_HAS_ANDROID_MEDIACODEC */ diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjmedia/src/pjmedia-codec/audio_codecs.c asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjmedia/src/pjmedia-codec/audio_codecs.c --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjmedia/src/pjmedia-codec/audio_codecs.c 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjmedia/src/pjmedia-codec/audio_codecs.c 2022-02-24 07:54:38.000000000 +0000 @@ -44,6 +44,14 @@ PJ_ASSERT_RETURN(c->ilbc.mode==20 || c->ilbc.mode==30, PJ_EINVAL); +#if PJMEDIA_HAS_ANDROID_MEDIACODEC + /* Register Android MediaCodec */ + status = pjmedia_codec_and_media_aud_init(endpt); + if (status != PJ_SUCCESS) { + return status; + } +#endif + #if PJMEDIA_HAS_PASSTHROUGH_CODECS status = pjmedia_codec_passthrough_init2(endpt, &c->passthrough.setting); if (status != PJ_SUCCESS) diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjmedia/src/pjmedia-codec/ffmpeg_vid_codecs.c asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjmedia/src/pjmedia-codec/ffmpeg_vid_codecs.c --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjmedia/src/pjmedia-codec/ffmpeg_vid_codecs.c 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjmedia/src/pjmedia-codec/ffmpeg_vid_codecs.c 2022-02-24 07:54:38.000000000 +0000 @@ -19,6 +19,7 @@ #include #include #include +#include #include #include #include @@ -81,6 +82,8 @@ #endif #define AVCODEC_HAS_DECODE(c) (c->decode) +/* AVCodec H264 default PT */ +#define AVC_H264_PT PJMEDIA_RTP_PT_H264_RSV3 /* Prototypes for FFMPEG codecs factory */ static pj_status_t ffmpeg_test_alloc( pjmedia_vid_codec_factory *factory, @@ -208,7 +211,7 @@ #define FUNC_PACKETIZE(name) \ pj_status_t(name)(ffmpeg_private *ff, pj_uint8_t *bits, \ pj_size_t bits_len, unsigned *bits_pos, \ - const pj_uint8_t **payload, pj_size_t *payload_len) + pj_uint8_t *payload, pj_size_t *payload_len, pj_bool_t is_keyframe) #define FUNC_UNPACKETIZE(name) \ pj_status_t(name)(ffmpeg_private *ff, const pj_uint8_t *payload, \ @@ -268,6 +271,13 @@ #define PROFILE_H264_MAIN 77 /* Codec specific functions */ +#if PJMEDIA_HAS_FFMPEG_CODEC_VP8 || PJMEDIA_HAS_FFMPEG_CODEC_VP9 +static pj_status_t vpx_preopen(ffmpeg_private *ff); +static pj_status_t vpx_postopen(ffmpeg_private *ff); +static FUNC_PACKETIZE(vpx_packetize); +static FUNC_UNPACKETIZE(vpx_unpacketize); +#endif + #if PJMEDIA_HAS_FFMPEG_CODEC_H264 static pj_status_t h264_preopen(ffmpeg_private *ff); static pj_status_t h264_postopen(ffmpeg_private *ff); @@ -285,7 +295,7 @@ { #if PJMEDIA_HAS_FFMPEG_CODEC_H264 { - {PJMEDIA_FORMAT_H264, PJMEDIA_RTP_PT_H264, {"H264",4}, + {PJMEDIA_FORMAT_H264, AVC_H264_PT, {"H264",4}, {"Constrained Baseline (level=30, pack=1)", 39}}, 0, {720, 480}, {15, 1}, 256000, 256000, @@ -297,6 +307,30 @@ }, #endif +#if PJMEDIA_HAS_FFMPEG_CODEC_VP8 + { + {PJMEDIA_FORMAT_VP8, PJMEDIA_RTP_PT_VP8_RSV2, {"VP8",3}, + {"FF VP8", 6}}, + 0, + {720, 480}, {15, 1}, 256000, 256000, + &vpx_packetize, &vpx_unpacketize, &vpx_preopen, &vpx_postopen, NULL, + {2, { {{"max-fr",6}, {"30",2}}, + {{" max-fs",7}, {"580",3}}, } }, + }, +#endif + +#if PJMEDIA_HAS_FFMPEG_CODEC_VP9 + { + {PJMEDIA_FORMAT_VP9, PJMEDIA_RTP_PT_VP9_RSV2, {"VP9",3}, + {"FF VP9", 6}}, + 0, + {720, 480}, {15, 1}, 256000, 256000, + &vpx_packetize, &vpx_unpacketize, &vpx_preopen, &vpx_postopen, NULL, + {2, { {{"max-fr",6}, {"30",2}}, + {{" max-fs",7}, {"580",3}}, } }, + }, +#endif + #if PJMEDIA_HAS_FFMPEG_CODEC_H263P { {PJMEDIA_FORMAT_H263P, PJMEDIA_RTP_PT_H263P, {"H263-1998",9}}, @@ -324,6 +358,102 @@ }, }; +#if PJMEDIA_HAS_FFMPEG_CODEC_VP8 || PJMEDIA_HAS_FFMPEG_CODEC_VP9 +typedef struct vpx_data +{ + pjmedia_vpx_packetizer *pktz; +} vpx_data; + +static pj_status_t vpx_preopen(ffmpeg_private *ff) +{ + vpx_data *data; + pjmedia_vpx_packetizer_cfg pktz_cfg; + pj_status_t status; + + data = PJ_POOL_ZALLOC_T(ff->pool, vpx_data); + ff->data = data; + + /* Parse local fmtp */ + if (!ff->param.ignore_fmtp) + { + pjmedia_vid_codec_vpx_fmtp vpx_fmtp; + const unsigned MAX_RX_RES = 1200; + unsigned max_res = MAX_RX_RES; + + status = pjmedia_vid_codec_vpx_parse_fmtp(&ff->param.dec_fmtp, &vpx_fmtp); + if (status != PJ_SUCCESS) + { + PJ_LOG(2, (THIS_FILE, "Parse vpx fmtp fail, status:%d", status)); + return status; + } + if (vpx_fmtp.max_fs > 0) + { + max_res = ((int)pj_isqrt(vpx_fmtp.max_fs * 8)) * 16; + } + ff->dec_buf_size = (max_res * max_res * 3 >> 1) + (max_res); + } + + /* Create packetizer */ + pktz_cfg.fmt_id = ff->desc->info.fmt_id; + pktz_cfg.mtu = ff->param.enc_mtu; + status = pjmedia_vpx_packetizer_create(ff->pool, &pktz_cfg, &data->pktz); + if (status != PJ_SUCCESS) + { + return status; + } + + return PJ_SUCCESS; +} + +static pj_status_t vpx_postopen(ffmpeg_private *ff) +{ + vpx_data *data = (vpx_data *)ff->data; + PJ_UNUSED_ARG(data); + return PJ_SUCCESS; +} + +static FUNC_PACKETIZE(vpx_packetize) +{ + vpx_data *data = (vpx_data *)ff->data; + pj_status_t status; + unsigned payload_desc_size = 1; + pj_uint8_t *outbuf = payload; + pj_size_t out_size = *payload_len; + out_size -= payload_desc_size; + + status = pjmedia_vpx_packetize(data->pktz, bits_len, bits_pos, is_keyframe, + &outbuf, &out_size); + if (status != PJ_SUCCESS) + return status; + pj_memcpy(outbuf + payload_desc_size, bits + *bits_pos, out_size); + *payload_len = out_size + payload_desc_size; + *bits_pos += out_size; + return PJ_SUCCESS; +} + +static FUNC_UNPACKETIZE(vpx_unpacketize) +{ + vpx_data *data = (vpx_data *)ff->data; + unsigned desc_len = 0; + pj_status_t status; + unsigned pos = *bits_pos; + status = pjmedia_vpx_unpacketize(data->pktz, payload, payload_len, &desc_len); + if (status != PJ_SUCCESS) + return status; + payload_len -= desc_len; + if (pos + payload_len > bits_len) + { + PJ_LOG(2, (THIS_FILE, "Vpx unpacketize buffer overflow")); + return PJMEDIA_CODEC_EFRMTOOSHORT; + } + + pj_memcpy(bits + pos, (char *)payload + desc_len, payload_len); + pos += payload_len; + *bits_pos = pos; + return PJ_SUCCESS; +} +#endif // PJMEDIA_HAS_FFMPEG_CODEC_VP8/VP9 + #if PJMEDIA_HAS_FFMPEG_CODEC_H264 typedef struct h264_data @@ -473,8 +603,17 @@ static FUNC_PACKETIZE(h264_packetize) { h264_data *data = (h264_data*)ff->data; - return pjmedia_h264_packetize(data->pktz, bits, bits_len, bits_pos, - payload, payload_len); + pj_status_t status; + pj_uint8_t *outbuf = payload; + pj_size_t out_size = *payload_len; + status = pjmedia_h264_packetize(data->pktz, bits, bits_len, bits_pos, + &payload, payload_len); + if (status != PJ_SUCCESS) + return status; + if (out_size < *payload_len) + return PJMEDIA_CODEC_EFRMTOOSHORT; + pj_memcpy(outbuf, payload, *payload_len); + return PJ_SUCCESS; } static FUNC_UNPACKETIZE(h264_unpacketize) @@ -537,8 +676,17 @@ static FUNC_PACKETIZE(h263_packetize) { h263_data *data = (h263_data*)ff->data; - return pjmedia_h263_packetize(data->pktz, bits, bits_len, bits_pos, - payload, payload_len); + pj_status_t status; + pj_uint8_t *outbuf = payload; + pj_size_t out_size = *payload_len; + status = pjmedia_h263_packetize(data->pktz, bits, bits_len, bits_pos, + &payload, payload_len); + if (status != PJ_SUCCESS) + return status; + if (out_size < *payload_len) + return PJMEDIA_CODEC_EFRMTOOSHORT; + pj_memcpy(outbuf, payload, *payload_len); + return PJ_SUCCESS; } static FUNC_UNPACKETIZE(h263_unpacketize) @@ -1294,7 +1442,7 @@ ff->enc_buf_size = (unsigned)ff->enc_vafp.framebytes; ff->enc_buf = pj_pool_alloc(ff->pool, ff->enc_buf_size); - ff->dec_buf_size = (unsigned)ff->dec_vafp.framebytes; + ff->dec_buf_size = PJ_MAX((unsigned)ff->dec_vafp.framebytes, ff->dec_buf_size); ff->dec_buf = pj_pool_alloc(ff->pool, ff->dec_buf_size); } @@ -1371,14 +1519,14 @@ pj_uint8_t *bits, pj_size_t bits_len, unsigned *bits_pos, - const pj_uint8_t **payload, - pj_size_t *payload_len) + pj_uint8_t *payload, + pj_size_t *payload_len, pj_bool_t is_keyframe) { ffmpeg_private *ff = (ffmpeg_private*)codec->codec_data; if (ff->desc->packetize) { return (*ff->desc->packetize)(ff, bits, bits_len, bits_pos, - payload, payload_len); + payload, payload_len, is_keyframe); } return PJ_ENOTSUP; @@ -1451,6 +1599,12 @@ p += ff->enc_vafp.plane_bytes[i[0]]; } +#if LIBAVCODEC_VER_AT_LEAST(58,134) + avframe.height = ff->enc_ctx->height; + avframe.width = ff->enc_ctx->width; + avframe.format = ff->enc_ctx->pix_fmt; +#endif + /* Force keyframe */ if (opt && opt->force_keyframe) { #if LIBAVCODEC_VER_AT_LEAST(53,20) @@ -1510,9 +1664,6 @@ output); } else { pjmedia_frame whole_frm; - const pj_uint8_t *payload; - pj_size_t payload_len; - pj_bzero(&whole_frm, sizeof(whole_frm)); whole_frm.buf = ff->enc_buf; whole_frm.size = ff->enc_buf_size; @@ -1526,23 +1677,7 @@ PJMEDIA_VID_FRM_KEYFRAME); ff->enc_frame_len = (unsigned)whole_frm.size; ff->enc_processed = 0; - status = ffmpeg_packetize(codec, (pj_uint8_t*)whole_frm.buf, - whole_frm.size, &ff->enc_processed, - &payload, &payload_len); - if (status != PJ_SUCCESS) - return status; - - if (out_size < payload_len) - return PJMEDIA_CODEC_EFRMTOOSHORT; - - output->type = PJMEDIA_FRAME_TYPE_VIDEO; - pj_memcpy(output->buf, payload, payload_len); - output->size = payload_len; - - if (ff->enc_buf_is_keyframe) - output->bit_info |= PJMEDIA_VID_FRM_KEYFRAME; - - *has_more = (ff->enc_processed < ff->enc_frame_len); + status = ffmpeg_codec_encode_more(codec, out_size, output, has_more); } return status; @@ -1554,8 +1689,8 @@ pj_bool_t *has_more) { ffmpeg_private *ff = (ffmpeg_private*)codec->codec_data; - const pj_uint8_t *payload; - pj_size_t payload_len; + pj_uint8_t *payload = (pj_uint8_t *)output->buf; + pj_size_t payload_len = (pj_size_t) out_size; pj_status_t status; *has_more = PJ_FALSE; @@ -1567,15 +1702,11 @@ status = ffmpeg_packetize(codec, (pj_uint8_t*)ff->enc_buf, ff->enc_frame_len, &ff->enc_processed, - &payload, &payload_len); + payload, &payload_len, ff->enc_buf_is_keyframe); if (status != PJ_SUCCESS) return status; - if (out_size < payload_len) - return PJMEDIA_CODEC_EFRMTOOSHORT; - output->type = PJMEDIA_FRAME_TYPE_VIDEO; - pj_memcpy(output->buf, payload, payload_len); output->size = payload_len; if (ff->enc_buf_is_keyframe) @@ -1710,7 +1841,16 @@ * Normally, encoded buffer is allocated more than needed, so lets just * bzero the input buffer end/pad, hope it will be just fine. */ +#if LIBAVCODEC_VER_AT_LEAST(56,35) + /* 2015-07-27 - lavc 56.56.100 / 56.35.0 - avcodec.h + * 29d147c / 059a9348 + * - Rename FF_INPUT_BUFFER_PADDING_SIZE and FF_MIN_BUFFER_SIZE + * to AV_INPUT_BUFFER_PADDING_SIZE and AV_INPUT_BUFFER_MIN_SIZE. + */ + pj_bzero(avpacket.data+avpacket.size, AV_INPUT_BUFFER_PADDING_SIZE); +#else pj_bzero(avpacket.data+avpacket.size, FF_INPUT_BUFFER_PADDING_SIZE); +#endif output->bit_info = 0; output->timestamp = input->timestamp; diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjmedia/src/pjmedia-codec/g722.c asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjmedia/src/pjmedia-codec/g722.c --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjmedia/src/pjmedia-codec/g722.c 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjmedia/src/pjmedia-codec/g722.c 2022-02-24 07:54:38.000000000 +0000 @@ -54,7 +54,6 @@ # define TRACE_(expr) #endif - /* Prototypes for G722 factory */ static pj_status_t g722_test_alloc(pjmedia_codec_factory *factory, const pjmedia_codec_info *id ); @@ -174,8 +173,9 @@ g722_codec_factory.endpt = endpt; g722_codec_factory.pcm_shift = PJMEDIA_G722_DEFAULT_PCM_SHIFT; - g722_codec_factory.pool = pjmedia_endpt_create_pool(endpt, "g722", 1000, - 1000); + g722_codec_factory.pool = pjmedia_endpt_create_pool(endpt, "g722", + PJMEDIA_POOL_LEN_G722_CODEC, + PJMEDIA_POOL_INC_G722_CODEC); if (!g722_codec_factory.pool) return PJ_ENOMEM; diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjmedia/src/pjmedia-codec/ilbc.c asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjmedia/src/pjmedia-codec/ilbc.c --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjmedia/src/pjmedia-codec/ilbc.c 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjmedia/src/pjmedia-codec/ilbc.c 2022-02-24 07:54:38.000000000 +0000 @@ -595,7 +595,7 @@ frames[count].type = PJMEDIA_FRAME_TYPE_AUDIO; frames[count].buf = pkt; frames[count].size = ilbc_codec->dec_frame_size; - frames[count].timestamp.u64 = ts->u64 + count * + frames[count].timestamp.u64 = ts->u64 + (pj_uint64_t)count * ilbc_codec->dec_samples_per_frame; pkt = ((char*)pkt) + ilbc_codec->dec_frame_size; diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjmedia/src/pjmedia-codec/ipp_codecs.c asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjmedia/src/pjmedia-codec/ipp_codecs.c --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjmedia/src/pjmedia-codec/ipp_codecs.c 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjmedia/src/pjmedia-codec/ipp_codecs.c 2022-02-24 07:54:38.000000000 +0000 @@ -939,6 +939,7 @@ } if (idx == -1) { *p_codec = NULL; + pj_mutex_unlock(ipp_factory.mutex); return PJMEDIA_CODEC_EFAILED; } diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjmedia/src/pjmedia-codec/openh264.cpp asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjmedia/src/pjmedia-codec/openh264.cpp --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjmedia/src/pjmedia-codec/openh264.cpp 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjmedia/src/pjmedia-codec/openh264.cpp 2022-02-24 07:54:38.000000000 +0000 @@ -56,6 +56,14 @@ #define MAX_RX_WIDTH 1200 #define MAX_RX_HEIGHT 800 +/* OpenH264 default PT */ +#define OH264_PT PJMEDIA_RTP_PT_H264 + +/* Minimum interval (in msec) between generating two missing keyframe events. + * This is to avoid sending too many events during consecutive decode + * failures. + */ +#define MISSING_KEYFRAME_EV_MIN_INTERVAL 1000 /* * Factory operations. @@ -159,6 +167,8 @@ ISVCDecoder *dec; pj_uint8_t *dec_buf; unsigned dec_buf_size; + unsigned missing_kf_interval; + unsigned last_missing_kf_event; } oh264_codec_data; struct SLayerPEncCtx @@ -248,7 +258,7 @@ PJ_ASSERT_RETURN(factory == &oh264_factory.base, PJ_EINVAL); if (info->fmt_id == PJMEDIA_FORMAT_H264 && - info->pt != 0) + info->pt == OH264_PT) { return PJ_SUCCESS; } @@ -304,7 +314,7 @@ *count = 1; info->fmt_id = PJMEDIA_FORMAT_H264; - info->pt = PJMEDIA_RTP_PT_H264; + info->pt = OH264_PT; info->encoding_name = pj_str((char*)"H264"); info->encoding_desc = pj_str((char*)"OpenH264 codec"); info->clock_rate = 90000; @@ -584,15 +594,17 @@ sDecParam.eEcActiveIdc = ERROR_CON_SLICE_COPY; sDecParam.sVideoProperty.eVideoBsType = VIDEO_BITSTREAM_DEFAULT; + /* Calculate minimum missing keyframe event interval in frames. */ + oh264_data->missing_kf_interval = + (unsigned)((1.0f * param->dec_fmt.det.vid.fps.num / + param->dec_fmt.det.vid.fps.denum) * + MISSING_KEYFRAME_EV_MIN_INTERVAL/1000); + oh264_data->last_missing_kf_event = oh264_data->missing_kf_interval; + //TODO: // Apply "sprop-parameter-sets" here - rc = WelsCreateDecoder(&oh264_data->dec); - if (rc) { - PJ_LOG(4,(THIS_FILE, "Unable to create OpenH264 decoder")); - return PJMEDIA_CODEC_EFAILED; - } - + /* Initialize decoder */ rc = oh264_data->dec->Initialize (&sDecParam); if (rc) { PJ_LOG(4,(THIS_FILE, "Decoder initialization failed, rc=%d", rc)); @@ -890,7 +902,7 @@ if (i < iHeight) return -1; - return dst - buf; + return (int)(dst - buf); } static pj_status_t oh264_got_decoded_frame(pjmedia_vid_codec *codec, @@ -972,6 +984,7 @@ const pj_uint8_t nal_start[] = { 0, 0, 1 }; SBufferInfo sDstBufInfo; pj_bool_t has_frame = PJ_FALSE; + pj_bool_t kf_requested = PJ_FALSE; unsigned buf_pos, whole_len = 0; unsigned i, frm_cnt; pj_status_t status = PJ_SUCCESS; @@ -982,6 +995,10 @@ PJ_ASSERT_RETURN(output->buf, PJ_EINVAL); oh264_data = (oh264_codec_data*) codec->codec_data; + oh264_data->last_missing_kf_event++; + /* Check if we have recently generated missing keyframe event. */ + if (oh264_data->last_missing_kf_event < oh264_data->missing_kf_interval) + kf_requested = PJ_TRUE; /* * Step 1: unpacketize the packets/frames @@ -997,7 +1014,7 @@ pj_memcpy( oh264_data->dec_buf + whole_len, (pj_uint8_t*)packets[i].buf, packets[i].size); - whole_len += packets[i].size; + whole_len += (unsigned)packets[i].size; } } else { @@ -1056,7 +1073,19 @@ start = oh264_data->dec_buf + buf_pos; /* Decode */ - oh264_data->dec->DecodeFrame2( start, frm_size, pData, &sDstBufInfo); + ret = oh264_data->dec->DecodeFrame2( start, frm_size, pData, + &sDstBufInfo); + + if (ret != dsErrorFree && !kf_requested) { + /* Broadcast missing keyframe event */ + pjmedia_event event; + pjmedia_event_init(&event, PJMEDIA_EVENT_KEYFRAME_MISSING, + &packets[0].timestamp, codec); + pjmedia_event_publish(NULL, codec, &event, + PJMEDIA_EVENT_PUBLISH_DEFAULT); + kf_requested = PJ_TRUE; + oh264_data->last_missing_kf_event = 0; + } if (0 && sDstBufInfo.iBufferStatus == 1) { // Better to just get the frame later after all NALs are consumed @@ -1100,13 +1129,15 @@ } if (ret != dsErrorFree) { - pjmedia_event event; - - /* Broadcast missing keyframe event */ - pjmedia_event_init(&event, PJMEDIA_EVENT_KEYFRAME_MISSING, - &packets[0].timestamp, codec); - pjmedia_event_publish(NULL, codec, &event, - PJMEDIA_EVENT_PUBLISH_DEFAULT); + if (!kf_requested) { + /* Broadcast missing keyframe event */ + pjmedia_event event; + pjmedia_event_init(&event, PJMEDIA_EVENT_KEYFRAME_MISSING, + &packets[0].timestamp, codec); + pjmedia_event_publish(NULL, codec, &event, + PJMEDIA_EVENT_PUBLISH_DEFAULT); + oh264_data->last_missing_kf_event = 0; + } if (has_frame) { PJ_LOG(5,(oh264_data->pool->obj_name, diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjmedia/src/pjmedia-codec/opus.c asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjmedia/src/pjmedia-codec/opus.c --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjmedia/src/pjmedia-codec/opus.c 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjmedia/src/pjmedia-codec/opus.c 2022-02-24 07:54:38.000000000 +0000 @@ -723,6 +723,7 @@ OPUS_APPLICATION_VOIP); if (err != OPUS_OK) { PJ_LOG(2, (THIS_FILE, "Unable to create encoder")); + pj_mutex_unlock (opus_data->mutex); return PJMEDIA_CODEC_EFAILED; } @@ -767,6 +768,7 @@ attr->info.channel_cnt); if (err != OPUS_OK) { PJ_LOG(2, (THIS_FILE, "Unable to initialize decoder")); + pj_mutex_unlock (opus_data->mutex); return PJMEDIA_CODEC_EFAILED; } @@ -861,25 +863,43 @@ opus_repacketizer_cat(opus_data->dec_packer, tmp_buf, pkt_size); num_frames = opus_repacketizer_get_nb_frames(opus_data->dec_packer); + if (num_frames == 0) { + PJ_LOG(2, (THIS_FILE, "No frames retrieved (num_frames = 0)")); + pj_mutex_unlock(opus_data->mutex); + return PJMEDIA_CODEC_EFAILED; + } + out_pos = 0; for (i = 0; i < num_frames; ++i) { size = opus_repacketizer_out_range(opus_data->dec_packer, i, i+1, ((unsigned char*)pkt) + out_pos, sizeof(tmp_buf)); if (size < 0) { - PJ_LOG(5, (THIS_FILE, "Parse failed! (%d)", pkt_size)); + PJ_LOG(5, (THIS_FILE, "Parse failed! (pkt_size=%d, err=%d)", + pkt_size, size)); pj_mutex_unlock (opus_data->mutex); return PJMEDIA_CODEC_EFAILED; } frames[i].type = PJMEDIA_FRAME_TYPE_AUDIO; frames[i].buf = ((char*)pkt) + out_pos; frames[i].size = size; - frames[i].bit_info = opus_packet_get_nb_samples(frames[i].buf, - frames[i].size, opus_data->cfg.sample_rate); + frames[i].bit_info = 0; if (i == 0) { - unsigned ptime = frames[i].bit_info * 1000 / - opus_data->cfg.sample_rate; + int nsamples; + unsigned ptime; + + nsamples = opus_packet_get_nb_samples(frames[i].buf, + frames[i].size, + opus_data->cfg.sample_rate); + if (nsamples <= 0) { + PJ_LOG(5, (THIS_FILE, "Parse failed to get samples number! " + "(err=%d)", nsamples)); + pj_mutex_unlock (opus_data->mutex); + return PJMEDIA_CODEC_EFAILED; + } + + ptime = nsamples * 1000 / opus_data->cfg.sample_rate; if (ptime != opus_data->dec_ptime) { PJ_LOG(4, (THIS_FILE, "Opus ptime change detected: %d ms " "--> %d ms", @@ -888,9 +908,9 @@ opus_data->dec_frame_index = -1; /* Signal to the stream about ptime change. */ - frames[i].bit_info |= 0x10000; + frames[i].bit_info = 0x10000 | nsamples; } - samples_per_frame = frames[i].bit_info; + samples_per_frame = nsamples; } frames[i].timestamp.u64 = ts->u64 + i * samples_per_frame; diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjmedia/src/pjmedia-codec/passthrough.c asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjmedia/src/pjmedia-codec/passthrough.c --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjmedia/src/pjmedia-codec/passthrough.c 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjmedia/src/pjmedia-codec/passthrough.c 2022-02-24 07:54:38.000000000 +0000 @@ -625,6 +625,7 @@ } if (idx == -1) { *p_codec = NULL; + pj_mutex_unlock(codec_factory.mutex); return PJMEDIA_CODEC_EUNSUP; } diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjmedia/src/pjmedia-codec/speex_codec.c asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjmedia/src/pjmedia-codec/speex_codec.c --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjmedia/src/pjmedia-codec/speex_codec.c 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjmedia/src/pjmedia-codec/speex_codec.c 2022-02-24 07:54:38.000000000 +0000 @@ -379,6 +379,7 @@ if (!codec_mgr) { pj_pool_release(spx_factory.pool); spx_factory.pool = NULL; + pj_mutex_unlock(spx_factory.mutex); return PJ_EINVALIDOP; } @@ -851,7 +852,8 @@ /* Bit info contains start bit offset of the frame */ frames[count].bit_info = bit_ptr; frames[count].type = PJMEDIA_FRAME_TYPE_AUDIO; - frames[count].timestamp.u64 = ts->u64 + count * samples_per_frame; + frames[count].timestamp.u64 = ts->u64 + + (pj_uint64_t)count * samples_per_frame; frames[count].size = spx->dec_bits.charPtr - char_ptr; if (spx->dec_bits.bitPtr) ++frames[count].size; diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjmedia/src/pjmedia-codec/vid_toolbox.m asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjmedia/src/pjmedia-codec/vid_toolbox.m --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjmedia/src/pjmedia-codec/vid_toolbox.m 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjmedia/src/pjmedia-codec/vid_toolbox.m 2022-02-24 07:54:38.000000000 +0000 @@ -59,8 +59,10 @@ #define DECODE_WHOLE PJ_TRUE /* Maximum duration from one key frame to the next (in seconds). */ -#define KEYFRAME_INTERVAL 5 +#define KEYFRAME_INTERVAL PJMEDIA_CODEC_VID_TOOLBOX_MAX_KEYFRAME_INTERVAL +/* vidtoolbox H264 default PT */ +#define VT_H264_PT PJMEDIA_RTP_PT_H264_RSV1 /* * Factory operations. */ @@ -167,6 +169,7 @@ pj_uint8_t *dec_buf; unsigned dec_buf_size; CMFormatDescriptionRef dec_format; + OSStatus dec_status; unsigned dec_sps_size; unsigned dec_pps_size; @@ -180,6 +183,7 @@ /* Prototypes */ static OSStatus create_decoder(struct vtool_codec_data *vtool_data); +#if TARGET_OS_IPHONE static void dispatch_sync_on_main_queue(void (^block)(void)) { if ([NSThread isMainThread]) { @@ -188,6 +192,7 @@ dispatch_sync(dispatch_get_main_queue(), block); } } +#endif PJ_DEF(pj_status_t) pjmedia_codec_vid_toolbox_init(pjmedia_vid_codec_mgr *mgr, pj_pool_factory *pf) @@ -265,7 +270,7 @@ PJ_ASSERT_RETURN(factory == &vtool_factory.base, PJ_EINVAL); if (info->fmt_id == PJMEDIA_FORMAT_H264 && - info->pt != 0) + info->pt == VT_H264_PT) { return PJ_SUCCESS; } @@ -321,7 +326,7 @@ *count = 1; info->fmt_id = PJMEDIA_FORMAT_H264; - info->pt = PJMEDIA_RTP_PT_H264; + info->pt = VT_H264_PT; info->encoding_name = pj_str((char*)"H264"); info->encoding_desc = pj_str((char*)"Video Toolbox codec"); info->clock_rate = 90000; @@ -1018,10 +1023,10 @@ /* This callback can be called from another, unregistered thread. * So do not call pjlib functions here. */ - - if (status != noErr) return; - vtool_data = (struct vtool_codec_data *)decompressionOutputRefCon; + vtool_data->dec_status = status; + if (vtool_data->dec_status != noErr) + return; CVPixelBufferLockBaseAddress(imageBuffer,0); @@ -1315,10 +1320,13 @@ } } - if (ret != noErr) { + if ((ret != noErr) || (vtool_data->dec_status != noErr)) { + char *ret_err = (ret != noErr)?"decode err":"cb err"; + OSStatus err_code = (ret != noErr)?ret:vtool_data->dec_status; + PJ_LOG(5,(THIS_FILE, "Failed to decode frame %d of size " - "%d: %d", nalu_type, frm_size, - ret)); + "%d %s:%d", nalu_type, frm_size, ret_err, + err_code)); } else { has_frame = PJ_TRUE; output->type = PJMEDIA_FRAME_TYPE_VIDEO; diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjmedia/src/pjmedia-codec/vpx.c asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjmedia/src/pjmedia-codec/vpx.c --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjmedia/src/pjmedia-codec/vpx.c 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjmedia/src/pjmedia-codec/vpx.c 2022-02-24 07:54:38.000000000 +0000 @@ -30,6 +30,8 @@ # pragma comment( lib, "vpx.lib") #endif +#include + /* VPX */ #include #include @@ -56,6 +58,10 @@ #define MAX_RX_RES 1200 +/* VPX VP8 default PT */ +#define VPX_VP8_PT PJMEDIA_RTP_PT_VP8 +/* VPX VP9 default PT */ +#define VPX_VP9_PT PJMEDIA_RTP_PT_VP9 /* * Factory operations. @@ -142,6 +148,7 @@ pj_pool_t *pool; pjmedia_vid_codec_param *prm; pj_bool_t whole; + pjmedia_vpx_packetizer *pktz; /* Encoder */ vpx_codec_iface_t *(*enc_if)(); @@ -229,8 +236,8 @@ { PJ_ASSERT_RETURN(factory == &vpx_factory.base, PJ_EINVAL); - if ((info->fmt_id == PJMEDIA_FORMAT_VP8 || - info->fmt_id == PJMEDIA_FORMAT_VP9) && info->pt != 0) + if (((info->fmt_id == PJMEDIA_FORMAT_VP8) && (info->pt == VPX_VP8_PT)) || + ((info->fmt_id == PJMEDIA_FORMAT_VP9) && (info->pt == VPX_VP9_PT))) { return PJ_SUCCESS; } @@ -291,7 +298,7 @@ #if PJMEDIA_HAS_VPX_CODEC_VP8 info[i].fmt_id = PJMEDIA_FORMAT_VP8; - info[i].pt = PJMEDIA_RTP_PT_VP8; + info[i].pt = VPX_VP8_PT; info[i].encoding_name = pj_str((char*)"VP8"); info[i].encoding_desc = pj_str((char*)"VPX VP8 codec"); i++; @@ -300,7 +307,7 @@ #if PJMEDIA_HAS_VPX_CODEC_VP9 if (i + 1 < *count) { info[i].fmt_id = PJMEDIA_FORMAT_VP9; - info[i].pt = PJMEDIA_RTP_PT_VP9; + info[i].pt = VPX_VP9_PT; info[i].encoding_name = pj_str((char*)"VP9"); info[i].encoding_desc = pj_str((char*)"VPX VP9 codec"); i++; @@ -401,6 +408,7 @@ pjmedia_vid_codec_vpx_fmtp vpx_fmtp; vpx_codec_enc_cfg_t cfg; vpx_codec_err_t res; + pjmedia_vpx_packetizer_cfg pktz_cfg; unsigned max_res = MAX_RX_RES; pj_status_t status; @@ -497,6 +505,15 @@ /* Need to update param back after values are negotiated */ pj_memcpy(codec_param, param, sizeof(*codec_param)); + pj_bzero(&pktz_cfg, sizeof(pktz_cfg)); + pktz_cfg.mtu = param->enc_mtu; + pktz_cfg.fmt_id = param->enc_fmt.id; + + status = pjmedia_vpx_packetizer_create(vpx_data->pool, &pktz_cfg, + &vpx_data->pktz); + if (status != PJ_SUCCESS) + return status; + return PJ_SUCCESS; } @@ -636,6 +653,7 @@ pj_bool_t *has_more) { struct vpx_codec_data *vpx_data; + pj_status_t status = PJ_SUCCESS; PJ_ASSERT_RETURN(codec && out_size && output && has_more, PJ_EINVAL); @@ -644,156 +662,36 @@ if (vpx_data->enc_processed < vpx_data->enc_frame_size) { unsigned payload_desc_size = 1; - unsigned max_size = vpx_data->prm->enc_mtu - payload_desc_size; - unsigned remaining_size = vpx_data->enc_frame_size - - vpx_data->enc_processed; - unsigned payload_len = PJ_MIN(remaining_size, max_size); - pj_uint8_t *p = (pj_uint8_t *)output->buf; + pj_size_t payload_len = out_size; + pj_uint8_t *p = (pj_uint8_t *)output->buf; - if (payload_len + payload_desc_size > out_size) - return PJMEDIA_CODEC_EFRMTOOSHORT; + status = pjmedia_vpx_packetize(vpx_data->pktz, + vpx_data->enc_frame_size, + &vpx_data->enc_processed, + vpx_data->enc_frame_is_keyframe, + &p, + &payload_len); + if (status != PJ_SUCCESS) { + return status; + } + pj_memcpy(p + payload_desc_size, + (vpx_data->enc_frame_whole + vpx_data->enc_processed), + payload_len); + output->size = payload_len + payload_desc_size; output->timestamp = vpx_data->ets; output->type = PJMEDIA_FRAME_TYPE_VIDEO; output->bit_info = 0; if (vpx_data->enc_frame_is_keyframe) { output->bit_info |= PJMEDIA_VID_FRM_KEYFRAME; } - - /* Set payload header */ - p[0] = 0; - if (vpx_data->prm->enc_fmt.id == PJMEDIA_FORMAT_VP8) { - /* Set N: Non-reference frame */ - if (!vpx_data->enc_frame_is_keyframe) p[0] |= 0x20; - /* Set S: Start of VP8 partition. */ - if (vpx_data->enc_processed == 0) p[0] |= 0x10; - } else if (vpx_data->prm->enc_fmt.id == PJMEDIA_FORMAT_VP9) { - /* Set P: Inter-picture predicted frame */ - if (!vpx_data->enc_frame_is_keyframe) p[0] |= 0x40; - /* Set B: Start of a frame */ - if (vpx_data->enc_processed == 0) p[0] |= 0x8; - /* Set E: End of a frame */ - if (vpx_data->enc_processed + payload_len == - vpx_data->enc_frame_size) - { - p[0] |= 0x4; - } - } - - pj_memcpy(p + payload_desc_size, - (vpx_data->enc_frame_whole + vpx_data->enc_processed), - payload_len); - output->size = payload_len + payload_desc_size; - vpx_data->enc_processed += payload_len; *has_more = (vpx_data->enc_processed < vpx_data->enc_frame_size); } - return PJ_SUCCESS; -} - - -static pj_status_t vpx_unpacketize(struct vpx_codec_data *vpx_data, - const pj_uint8_t *buf, - pj_size_t packet_size, - unsigned *p_desc_len) -{ - unsigned desc_len = 1; - pj_uint8_t *p = (pj_uint8_t *)buf; - -#define INC_DESC_LEN() {if (++desc_len >= packet_size) return PJ_ETOOSMALL;} - - if (packet_size <= desc_len) return PJ_ETOOSMALL; - - if (vpx_data->prm->enc_fmt.id == PJMEDIA_FORMAT_VP8) { - /* 0 1 2 3 4 5 6 7 - * +-+-+-+-+-+-+-+-+ - * |X|R|N|S|R| PID | (REQUIRED) - */ - /* X: Extended control bits present. */ - if (p[0] & 0x80) { - INC_DESC_LEN(); - /* |I|L|T|K| RSV | */ - /* I: PictureID present. */ - if (p[1] & 0x80) { - INC_DESC_LEN(); - /* If M bit is set, the PID field MUST contain 15 bits. */ - if (p[2] & 0x80) INC_DESC_LEN(); - } - /* L: TL0PICIDX present. */ - if (p[1] & 0x40) INC_DESC_LEN(); - /* T: TID present or K: KEYIDX present. */ - if ((p[1] & 0x20) || (p[1] & 0x10)) INC_DESC_LEN(); - } - - } else if (vpx_data->prm->enc_fmt.id == PJMEDIA_FORMAT_VP9) { - /* 0 1 2 3 4 5 6 7 - * +-+-+-+-+-+-+-+-+ - * |I|P|L|F|B|E|V|-| (REQUIRED) - */ - /* I: Picture ID (PID) present. */ - if (p[0] & 0x80) { - INC_DESC_LEN(); - /* If M bit is set, the PID field MUST contain 15 bits. */ - if (p[1] & 0x80) INC_DESC_LEN(); - } - /* L: Layer indices present. */ - if (p[0] & 0x20) { - INC_DESC_LEN(); - if (!(p[0] & 0x10)) INC_DESC_LEN(); - } - /* F: Flexible mode. - * I must also be set to 1, and if P is set, there's up to 3 - * reference index. - */ - if ((p[0] & 0x10) && (p[0] & 0x80) && (p[0] & 0x40)) { - unsigned char *q = p + desc_len; - - INC_DESC_LEN(); - if (*q & 0x1) { - q++; - INC_DESC_LEN(); - if (*q & 0x1) { - q++; - INC_DESC_LEN(); - } - } - } - /* V: Scalability structure (SS) data present. */ - if (p[0] & 0x2) { - unsigned char *q = p + desc_len; - unsigned N_S = (*q >> 5) + 1; - - INC_DESC_LEN(); - /* Y: Each spatial layer's frame resolution present. */ - if (*q & 0x10) desc_len += N_S * 4; - - /* G: PG description present flag. */ - if (*q & 0x8) { - unsigned j; - unsigned N_G = *(p + desc_len); - - INC_DESC_LEN(); - for (j = 0; j< N_G; j++) { - unsigned R; - - q = p + desc_len; - INC_DESC_LEN(); - R = (*q & 0x0F) >> 2; - desc_len += R; - if (desc_len >= packet_size) - return PJ_ETOOSMALL; - } - } - } - } -#undef INC_DESC_LEN - - *p_desc_len = desc_len; - return PJ_SUCCESS; + return status; } - static pj_status_t vpx_codec_decode_(pjmedia_vid_codec *codec, pj_size_t count, pjmedia_frame packets[], @@ -837,20 +735,20 @@ unsigned desc_len; unsigned packet_size = packets[i].size; pj_status_t status; - - status = vpx_unpacketize(vpx_data, packets[i].buf, packet_size, - &desc_len); + + status = pjmedia_vpx_unpacketize(vpx_data->pktz, packets[i].buf, + packet_size, &desc_len); if (status != PJ_SUCCESS) { PJ_LOG(4,(THIS_FILE, "Unpacketize error")); return status; } - packet_size -= desc_len; + packet_size -= desc_len; if (whole_len + packet_size > vpx_data->dec_buf_size) { PJ_LOG(4,(THIS_FILE, "Decoding buffer overflow [2]")); return PJMEDIA_CODEC_EFRMTOOSHORT; } - + pj_memcpy(vpx_data->dec_buf + whole_len, (char *)packets[i].buf + desc_len, packet_size); whole_len += packet_size; diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjmedia/src/pjmedia-codec/vpx_packetizer.c asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjmedia/src/pjmedia-codec/vpx_packetizer.c --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjmedia/src/pjmedia-codec/vpx_packetizer.c 1970-01-01 00:00:00.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjmedia/src/pjmedia-codec/vpx_packetizer.c 2022-02-24 07:54:38.000000000 +0000 @@ -0,0 +1,225 @@ +/* + * Copyright (C) 2020 Teluu Inc. (http://www.teluu.com) + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +#if defined(PJMEDIA_HAS_VIDEO) && (PJMEDIA_HAS_VIDEO != 0) + +#define THIS_FILE "vpx_packetizer.c" + +/* VPX packetizer definition */ +struct pjmedia_vpx_packetizer +{ + /* Current settings */ + pjmedia_vpx_packetizer_cfg cfg; +}; + +/* + * Initialize VPX packetizer. + */ +PJ_DEF(void) pjmedia_vpx_packetizer_cfg_default(pjmedia_vpx_packetizer_cfg *cfg) +{ + pj_bzero(cfg, sizeof(*cfg)); + + cfg->fmt_id = PJMEDIA_FORMAT_VP8; + cfg->mtu =PJMEDIA_MAX_VID_PAYLOAD_SIZE; +} + +/* + * Create vpx packetizer. + */ +PJ_DEF(pj_status_t) pjmedia_vpx_packetizer_create( + pj_pool_t *pool, + const pjmedia_vpx_packetizer_cfg *cfg, + pjmedia_vpx_packetizer **p) +{ + pjmedia_vpx_packetizer *p_; + + PJ_ASSERT_RETURN(pool && p, PJ_EINVAL); + + if (cfg && cfg->fmt_id != PJMEDIA_FORMAT_VP8 && + cfg->fmt_id != PJMEDIA_FORMAT_VP9) + { + return PJ_ENOTSUP; + } + + p_ = PJ_POOL_ZALLOC_T(pool, pjmedia_vpx_packetizer); + if (cfg) { + pj_memcpy(&p_->cfg, cfg, sizeof(*cfg)); + } else { + pjmedia_vpx_packetizer_cfg_default(&p_->cfg); + } + *p = p_; + + return PJ_SUCCESS; +} + +/* + * Generate an RTP payload from H.264 frame bitstream, in-place processing. + */ +PJ_DEF(pj_status_t) pjmedia_vpx_packetize(const pjmedia_vpx_packetizer *pktz, + pj_size_t bits_len, + unsigned *bits_pos, + pj_bool_t is_keyframe, + pj_uint8_t **payload, + pj_size_t *payload_len) +{ + unsigned payload_desc_size = 1; + unsigned max_size = pktz->cfg.mtu - payload_desc_size; + unsigned remaining_size = (unsigned)bits_len - *bits_pos; + unsigned out_size = (unsigned)*payload_len; + pj_uint8_t *bits = *payload; + + *payload_len = PJ_MIN(remaining_size, max_size); + if (*payload_len + payload_desc_size > out_size) + return PJMEDIA_CODEC_EFRMTOOSHORT; + + /* Set payload header */ + bits[0] = 0; + if (pktz->cfg.fmt_id == PJMEDIA_FORMAT_VP8) { + /* Set N: Non-reference frame */ + if (!is_keyframe) bits[0] |= 0x20; + /* Set S: Start of VP8 partition. */ + if (*bits_pos == 0) bits[0] |= 0x10; + } else if (pktz->cfg.fmt_id == PJMEDIA_FORMAT_VP9) { + /* Set P: Inter-picture predicted frame */ + if (!is_keyframe) bits[0] |= 0x40; + /* Set B: Start of a frame */ + if (*bits_pos == 0) bits[0] |= 0x8; + /* Set E: End of a frame */ + if (*bits_pos + *payload_len == bits_len) { + bits[0] |= 0x4; + } + } + return PJ_SUCCESS; +} + + +/* + * Append RTP payload to a VPX picture bitstream + */ +PJ_DEF(pj_status_t) pjmedia_vpx_unpacketize(pjmedia_vpx_packetizer *pktz, + const pj_uint8_t *payload, + pj_size_t payload_len, + unsigned *payload_desc_len) +{ + unsigned desc_len = 1; + pj_uint8_t *p = (pj_uint8_t *)payload; + +#define INC_DESC_LEN() {if (++desc_len >= payload_len) return PJ_ETOOSMALL;} + + if (payload_len <= desc_len) return PJ_ETOOSMALL; + + if (pktz->cfg.fmt_id == PJMEDIA_FORMAT_VP8) { + /* 0 1 2 3 4 5 6 7 + * +-+-+-+-+-+-+-+-+ + * |X|R|N|S|R| PID | (REQUIRED) + */ + /* X: Extended control bits present. */ + if (p[0] & 0x80) { + INC_DESC_LEN(); + /* |I|L|T|K| RSV | */ + /* I: PictureID present. */ + if (p[1] & 0x80) { + INC_DESC_LEN(); + /* If M bit is set, the PID field MUST contain 15 bits. */ + if (p[2] & 0x80) INC_DESC_LEN(); + } + /* L: TL0PICIDX present. */ + if (p[1] & 0x40) INC_DESC_LEN(); + /* T: TID present or K: KEYIDX present. */ + if ((p[1] & 0x20) || (p[1] & 0x10)) INC_DESC_LEN(); + } + + } else if (pktz->cfg.fmt_id == PJMEDIA_FORMAT_VP9) { + /* 0 1 2 3 4 5 6 7 + * +-+-+-+-+-+-+-+-+ + * |I|P|L|F|B|E|V|-| (REQUIRED) + */ + /* I: Picture ID (PID) present. */ + if (p[0] & 0x80) { + INC_DESC_LEN(); + /* If M bit is set, the PID field MUST contain 15 bits. */ + if (p[1] & 0x80) INC_DESC_LEN(); + } + /* L: Layer indices present. */ + if (p[0] & 0x20) { + INC_DESC_LEN(); + if (!(p[0] & 0x10)) INC_DESC_LEN(); + } + /* F: Flexible mode. + * I must also be set to 1, and if P is set, there's up to 3 + * reference index. + */ + if ((p[0] & 0x10) && (p[0] & 0x80) && (p[0] & 0x40)) { + unsigned char *q = p + desc_len; + + INC_DESC_LEN(); + if (*q & 0x1) { + q++; + INC_DESC_LEN(); + if (*q & 0x1) { + q++; + INC_DESC_LEN(); + } + } + } + /* V: Scalability structure (SS) data present. */ + if (p[0] & 0x2) { + unsigned char *q = p + desc_len; + unsigned N_S = (*q >> 5) + 1; + + INC_DESC_LEN(); + /* Y: Each spatial layer's frame resolution present. */ + if (*q & 0x10) desc_len += N_S * 4; + + /* G: PG description present flag. */ + if (*q & 0x8) { + unsigned j; + unsigned N_G = *(p + desc_len); + + INC_DESC_LEN(); + for (j = 0; j< N_G; j++) { + unsigned R; + + q = p + desc_len; + INC_DESC_LEN(); + R = (*q & 0x0F) >> 2; + desc_len += R; + if (desc_len >= payload_len) + return PJ_ETOOSMALL; + } + } + } + } +#undef INC_DESC_LEN + + *payload_desc_len = desc_len; + return PJ_SUCCESS; +} + + +#endif /* PJMEDIA_HAS_VIDEO */ diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjmedia/src/pjmedia-videodev/android/PjCamera2.java asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjmedia/src/pjmedia-videodev/android/PjCamera2.java --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjmedia/src/pjmedia-videodev/android/PjCamera2.java 1970-01-01 00:00:00.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjmedia/src/pjmedia-videodev/android/PjCamera2.java 2022-02-24 07:54:38.000000000 +0000 @@ -0,0 +1,305 @@ +/* + * Copyright (C) 2021 Teluu Inc. (http://www.teluu.com) + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ +package org.pjsip; + +import android.hardware.camera2.CameraCaptureSession; +import android.hardware.camera2.CameraDevice; +import android.hardware.camera2.CameraManager; +import android.hardware.camera2.CameraMetadata; +import android.hardware.camera2.CaptureRequest; +import android.media.Image; +import android.media.ImageReader; +import android.os.Handler; +import android.os.HandlerThread; +import android.util.Log; +import android.util.Range; +import android.view.Surface; +import android.view.SurfaceView; +import android.view.SurfaceHolder; + +import java.nio.ByteBuffer; +import java.util.ArrayList; +import java.util.List; + +import org.pjsip.PjCameraInfo2; + +public class PjCamera2 +{ + private final String TAG = "PjCamera2"; + + private CameraDevice camera = null; + private CameraCaptureSession previewSession = null; + + private boolean isRunning = false; + private boolean start_with_fps = true; + private int camIdx; + private final long userData; + private final int fps; + + private final ImageReader imageReader; + private HandlerThread handlerThread = null; + private Handler handler; + + /* For debugging purpose only */ + private final SurfaceView surfaceView; + + native void PushFrame2(long userData_, + ByteBuffer plane0, int rowStride0, int pixStride0, + ByteBuffer plane1, int rowStride1, int pixStride1, + ByteBuffer plane2, int rowStride2, int pixStride2); + + ImageReader.OnImageAvailableListener imageAvailListener = new ImageReader.OnImageAvailableListener() { + @Override + public void onImageAvailable(ImageReader reader) { + if (!isRunning) + return; + + Image image = reader.acquireLatestImage(); + if (image == null) + return; + + /* Get planes buffers. According to the docs, the buffers are always direct buffers */ + Image.Plane[] planes = image.getPlanes(); + ByteBuffer plane0 = planes[0].getBuffer(); + ByteBuffer plane1 = planes.length > 1 ? planes[1].getBuffer() : null; + ByteBuffer plane2 = planes.length > 2 ? planes[2].getBuffer() : null; + assert plane0.isDirect(); + + //for (Image.Plane p: planes) { + // Log.d(TAG, String.format("size=%d bytes, getRowStride()=%d getPixelStride()=%d", p.getBuffer().remaining(), p.getRowStride(), p.getPixelStride())); + //} + + PushFrame2( userData, + plane0, planes[0].getRowStride(), planes[0].getPixelStride(), + plane1, plane1!=null? planes[1].getRowStride():0, plane1!=null? planes[1].getPixelStride():0, + plane2, plane2!=null? planes[2].getRowStride():0, plane2!=null? planes[2].getPixelStride():0); + + image.close(); + } + }; + + private final CameraDevice.StateCallback camStateCallback = new CameraDevice.StateCallback() { + @Override + public void onOpened(CameraDevice c) { + Log.i(TAG, "CameraDevice.StateCallback.onOpened"); + camera = c; + StartPreview(); + } + @Override + public void onClosed(CameraDevice c) { + Log.i(TAG, "CameraDevice.StateCallback.onClosed"); + } + @Override + public void onDisconnected(CameraDevice c) { + Log.i(TAG, "CameraDevice.StateCallback.onDisconnected"); + Stop(); + } + @Override + public void onError(CameraDevice c, int error) { + Log.e(TAG, "CameraDevice.StateCallback.onError: " + error); + + boolean was_with_fps = start_with_fps; + Stop(); + + /* First retry */ + if ((error == CameraDevice.StateCallback.ERROR_CAMERA_DEVICE || + error == CameraDevice.StateCallback.ERROR_CAMERA_SERVICE) && + was_with_fps) + { + Log.i(TAG, "Retrying without enforcing frame rate.."); + start_with_fps = false; + Start(); + } + } + }; + + private final SurfaceHolder.Callback surfaceHolderCallback = new SurfaceHolder.Callback() { + @Override + public void surfaceCreated(SurfaceHolder holder) { + Log.d(TAG, "SurfaceHolder.Callback.surfaceCreated"); + if (camera != null) { + StartPreview(); + } + } + + @Override + public void surfaceChanged(SurfaceHolder holder, + int format, int width, int height) + { + Log.d(TAG, "SurfaceHolder.Callback.surfaceChanged"); + } + + @Override + public void surfaceDestroyed(SurfaceHolder holder) + { + Log.d(TAG, "SurfaceHolder.Callback.surfaceDestroyed"); + } + }; + + public PjCamera2(int idx, int w, int h, int fmt, int fps_, + long userData_, SurfaceView surface) + { + camIdx = idx; + userData = userData_; + fps = fps_; + surfaceView = surface; + + /* Some say to put a larger maxImages to improve FPS */ + imageReader = ImageReader.newInstance(w, h, fmt, 3); + } + + public int SwitchDevice(int idx) + { + boolean isCaptureRunning = isRunning; + int oldIdx = camIdx; + + if (isCaptureRunning) + Stop(); + + camIdx = idx; + + if (isCaptureRunning) { + int ret = Start(); + if (ret != 0) { + /* Try to revert back */ + camIdx = oldIdx; + Start(); + return ret; + } + } + + return 0; + } + + private void StartPreview() + { + try { + List surfaceList = new ArrayList<>(); + surfaceList.add(imageReader.getSurface()); + if (surfaceView != null) + surfaceList.add(surfaceView.getHolder().getSurface()); + + camera.createCaptureSession(surfaceList, + new CameraCaptureSession.StateCallback() { + @Override + public void onConfigured(CameraCaptureSession session) { + Log.d(TAG, "CameraCaptureSession.StateCallback.onConfigured"); + + try { + CaptureRequest.Builder previewBuilder = camera.createCaptureRequest(CameraDevice.TEMPLATE_RECORD); + previewBuilder.addTarget(imageReader.getSurface()); + if (surfaceView != null) + previewBuilder.addTarget(surfaceView.getHolder().getSurface()); + previewBuilder.set(CaptureRequest.CONTROL_MODE, CameraMetadata.CONTROL_MODE_AUTO); + if (start_with_fps) { + Range fpsRange = new Range<>(fps, fps); + previewBuilder.set(CaptureRequest.CONTROL_AE_TARGET_FPS_RANGE, fpsRange); + } + session.setRepeatingRequest(previewBuilder.build(), null, handler); + previewSession = session; + } catch (Exception e) { + Log.d(TAG, e.getMessage()); + Stop(); + } + if (surfaceView!=null) + surfaceView.getHolder().addCallback(surfaceHolderCallback); + } + @Override + public void onConfigureFailed(CameraCaptureSession session) { + Log.e(TAG, "CameraCaptureSession.StateCallback.onConfigureFailed"); + Stop(); + } + }, handler); + } catch (Exception e) { + Log.d(TAG, e.getMessage()); + Stop(); + } + } + + public int Start() + { + PjCameraInfo2 ci = PjCameraInfo2.GetCameraInfo(camIdx); + if (ci == null) { + Log.e(TAG, "Invalid device index: " + camIdx); + return -1; + } + + CameraManager cm = PjCameraInfo2.GetCameraManager(); + if (cm == null) + return -2; + + handlerThread = new HandlerThread("Cam2HandlerThread"); + handlerThread.start(); + handler = new Handler(handlerThread.getLooper()); + imageReader.setOnImageAvailableListener(imageAvailListener, handler); + isRunning = true; + + try { + cm.openCamera(ci.id, camStateCallback, handler); + } catch (Exception e) { + Log.d(TAG, e.getMessage()); + Stop(); + return -10; + } + + return 0; + } + + public void Stop() + { + if (!isRunning) + return; + + isRunning = false; + Log.d(TAG, "Stopping.."); + + if (previewSession != null) { + previewSession.close(); + previewSession = null; + } + + if (camera != null) { + camera.close(); + camera = null; + } + + if (surfaceView != null) + surfaceView.getHolder().removeCallback(surfaceHolderCallback); + + if (handlerThread != null) { + handlerThread.quitSafely(); + try { + if (handlerThread.getId() != Thread.currentThread().getId()) { + Log.d(TAG, "Wait thread.."); + handlerThread.join(); + Log.d(TAG, "Wait thread done"); + } + handlerThread = null; + handler = null; + } catch (InterruptedException e) { + e.printStackTrace(); + } + } + + /* Reset setting */ + start_with_fps = true; + + Log.d(TAG, "Stopped."); + } + +} diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjmedia/src/pjmedia-videodev/android/PjCameraInfo2.java asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjmedia/src/pjmedia-videodev/android/PjCameraInfo2.java --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjmedia/src/pjmedia-videodev/android/PjCameraInfo2.java 1970-01-01 00:00:00.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjmedia/src/pjmedia-videodev/android/PjCameraInfo2.java 2022-02-24 07:54:38.000000000 +0000 @@ -0,0 +1,202 @@ +/* + * Copyright (C) 2021 Teluu Inc. (http://www.teluu.com) + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ +package org.pjsip; + +import java.util.Arrays; +import android.hardware.camera2.CameraAccessException; +import android.hardware.camera2.CameraCharacteristics; +import android.hardware.camera2.CameraManager; +import android.hardware.camera2.params.StreamConfigurationMap; +import android.util.Log; +import android.util.Size; +import android.graphics.ImageFormat; + +public class PjCameraInfo2 { + public String id; + public int facing; // 0: back, 1: front, 2: external + public int orient; + public int[] supportedSize; // [w1, h1, w2, h2, ...] + public int[] supportedFps1000; // [min1, max1, min2, max2, ...] + public int[] supportedFormat; // [fmt1, fmt2, ...] + + private static final String TAG = "PjCameraInfo2"; + + /* The camera2 is a bit tricky with format, for example it reports + * for I420 support (and no NV21 support), however the incoming frame + * buffers are actually in NV21 format (e.g: pixel stride is 2). + * + * For now, we only support I420. + */ + private static final int[] PJ_SUPPORTED_FORMAT = { + ImageFormat.YUV_420_888, // PJMEDIA_FORMAT_I420 + }; + + private static boolean is_inited = false; + private static PjCameraInfo2[] camInfo = null; + private static int camInfoCnt = 0; + private static CameraManager cameraManager = null; + + public static void SetCameraManager(CameraManager cm) { + cameraManager = cm; + } + + public static CameraManager GetCameraManager() { + return cameraManager; + } + + private static int Refresh() { + CameraManager cm = GetCameraManager(); + if (cm==null) { + Log.e(TAG, "Need camera manager instance for enumerating camera"); + return -1; + } + + is_inited = false; + + String[] camIds; + try { + camIds = cm.getCameraIdList(); + } catch (CameraAccessException e) { + Log.d(TAG, e.getMessage()); + e.printStackTrace(); + return -1; + } + + camInfo = new PjCameraInfo2[camIds.length]; + camInfoCnt = 0; + + Log.i(TAG, "Found " + camIds.length + " cameras:"); + for (int i = 0; i < camIds.length; ++i) { + Integer facing; + CameraCharacteristics cc; + StreamConfigurationMap scm; + int[] outFmts; + + /* Query basic info */ + try { + cc = cm.getCameraCharacteristics(camIds[i]); + facing = cc.get(CameraCharacteristics.LENS_FACING); + scm = cc.get(CameraCharacteristics.SCALER_STREAM_CONFIGURATION_MAP); + outFmts = scm.getOutputFormats(); + } catch (Exception e) { + Log.d(TAG, e.getMessage()); + Log.w(TAG, String.format("%3d: id=%s skipped due to failure in querying info", + i, camIds[i])); + continue; + } + + PjCameraInfo2 pjci = new PjCameraInfo2(); + pjci.id = camIds[i]; + switch(facing) { + case CameraCharacteristics.LENS_FACING_BACK: + pjci.facing = 0; + break; + case CameraCharacteristics.LENS_FACING_FRONT: + pjci.facing = 1; + break; + default: + pjci.facing = 2; + break; + } + + int[] fmts = new int[outFmts.length]; + int fmtCnt = 0; + for (int pjFmt : PJ_SUPPORTED_FORMAT) { + for (int outFmt : outFmts) { + if (outFmt == pjFmt) { + fmts[fmtCnt++] = pjFmt; + break; + } + } + } + Log.i(TAG, String.format("%3d: id=%s formats=%s", + i, pjci.id, Arrays.toString(outFmts))); + if (fmtCnt == 0) { + Log.w(TAG, String.format("%3d: id=%s skipped due to no PJSIP compatible format", + i, pjci.id)); + continue; + } + + pjci.supportedFormat = new int[fmtCnt]; + System.arraycopy(fmts, 0, pjci.supportedFormat, 0, fmtCnt); + + /* Query additional info */ + try { + pjci.orient = cc.get(CameraCharacteristics.SENSOR_ORIENTATION); + } catch (Exception e) { + Log.d(TAG, e.getMessage()); + Log.w(TAG, String.format("%3d: id=%s failed in getting orient", + i, camIds[i])); + } + + try { + Size[] suppSize = scm.getOutputSizes(pjci.supportedFormat[0]); + pjci.supportedSize = new int[suppSize.length * 2]; + for (int j = 0; j < suppSize.length; ++j) { + pjci.supportedSize[j*2] = suppSize[j].getWidth(); + pjci.supportedSize[j*2 + 1] = suppSize[j].getHeight(); + } + } catch (Exception e) { + Log.d(TAG, e.getMessage()); + Log.w(TAG, String.format("%3d: id=%s failed in getting sizes", + i, camIds[i])); + + /* Query failed, let's just hardcode the supported sizes */ + pjci.supportedSize = new int[] {176, 144, 320, 240, 352, 288, 640, 480, 1280, 720, 1920, 1080}; + } + + /* FPS info is not really used for now, let's just hardcode it */ + pjci.supportedFps1000 = new int[] { 1000, 30000 }; + + camInfo[camInfoCnt++] = pjci; + + Log.i(TAG, String.format("%3d: id=%s facing=%d orient=%d formats=%s sizes=%s", + i, pjci.id, pjci.facing, pjci.orient, + Arrays.toString(pjci.supportedFormat), + Arrays.toString(pjci.supportedSize))); + } + + is_inited = true; + return 0; + } + + public static int GetCameraCount() + { + /* Always refresh */ + if (Refresh() != 0) { + return -1; + } + return camInfoCnt; + } + + /* Get camera info: facing, orientation, supported size/fps/format. */ + public static PjCameraInfo2 GetCameraInfo(int idx) + { + if (!is_inited) { + Log.e(TAG, "Not initalized"); + return null; + } + + if (idx < 0 || idx >= camInfoCnt) { + Log.e(TAG, "Invalid camera ID"); + return null; + } + + return camInfo[idx]; + } +} diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjmedia/src/pjmedia-videodev/android_dev.c asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjmedia/src/pjmedia-videodev/android_dev.c --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjmedia/src/pjmedia-videodev/android_dev.c 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjmedia/src/pjmedia-videodev/android_dev.c 2022-02-24 07:54:38.000000000 +0000 @@ -130,8 +130,7 @@ pjmedia_vid_dev_conv conv; /** Frame format param for NV21/YV12 -> I420 conversion */ - pjmedia_video_apply_fmt_param - vafp; + pjmedia_video_apply_fmt_param vafp; } and_stream; @@ -197,8 +196,22 @@ * JNI stuff */ extern JavaVM *pj_jni_jvm; -#define PJ_CAMERA_CLASS_PATH "org/pjsip/PjCamera" -#define PJ_CAMERA_INFO_CLASS_PATH "org/pjsip/PjCameraInfo" + +/* Use camera2 (since Android API level 21) */ +#define USE_CAMERA2 1 + +#if USE_CAMERA2 +#define PJ_CAMERA "PjCamera2" +#define PJ_CAMERA_INFO "PjCameraInfo2" +#else +#define PJ_CAMERA "PjCamera" +#define PJ_CAMERA_INFO "PjCameraInfo" +#endif + +#define PJ_CLASS_PATH "org/pjsip/" +#define PJ_CAMERA_CLASS_PATH PJ_CLASS_PATH PJ_CAMERA +#define PJ_CAMERA_INFO_CLASS_PATH PJ_CLASS_PATH PJ_CAMERA_INFO + static struct jni_objs_t { @@ -224,9 +237,17 @@ } jobjs; +#if USE_CAMERA2 +static void JNICALL OnGetFrame2(JNIEnv *env, jobject obj, + jlong user_data, + jobject plane0, jint rowStride0, jint pixStride0, + jobject plane1, jint rowStride1, jint pixStride1, + jobject plane2, jint rowStride2, jint pixStride2); +#else static void JNICALL OnGetFrame(JNIEnv *env, jobject obj, jbyteArray data, jint length, jlong user_data); +#endif static pj_bool_t jni_get_env(JNIEnv **jni_env) @@ -310,33 +331,33 @@ } /* PjCamera class info */ - GET_CLASS(PJ_CAMERA_CLASS_PATH, "PjCamera", jobjs.cam.cls); - GET_METHOD_ID(jobjs.cam.cls, "PjCamera", "", + GET_CLASS(PJ_CAMERA_CLASS_PATH, PJ_CAMERA, jobjs.cam.cls); + GET_METHOD_ID(jobjs.cam.cls, PJ_CAMERA, "", "(IIIIIJLandroid/view/SurfaceView;)V", jobjs.cam.m_init); - GET_METHOD_ID(jobjs.cam.cls, "PjCamera", "Start", "()I", + GET_METHOD_ID(jobjs.cam.cls, PJ_CAMERA, "Start", "()I", jobjs.cam.m_start); - GET_METHOD_ID(jobjs.cam.cls, "PjCamera", "Stop", "()V", + GET_METHOD_ID(jobjs.cam.cls, PJ_CAMERA, "Stop", "()V", jobjs.cam.m_stop); - GET_METHOD_ID(jobjs.cam.cls, "PjCamera", "SwitchDevice", "(I)I", + GET_METHOD_ID(jobjs.cam.cls, PJ_CAMERA, "SwitchDevice", "(I)I", jobjs.cam.m_switch); /* PjCameraInfo class info */ - GET_CLASS(PJ_CAMERA_INFO_CLASS_PATH, "PjCameraInfo", jobjs.cam_info.cls); - GET_SMETHOD_ID(jobjs.cam_info.cls, "PjCameraInfo", "GetCameraCount", "()I", + GET_CLASS(PJ_CAMERA_INFO_CLASS_PATH, PJ_CAMERA_INFO, jobjs.cam_info.cls); + GET_SMETHOD_ID(jobjs.cam_info.cls, PJ_CAMERA_INFO, "GetCameraCount", "()I", jobjs.cam_info.m_get_cnt); - GET_SMETHOD_ID(jobjs.cam_info.cls, "PjCameraInfo", "GetCameraInfo", + GET_SMETHOD_ID(jobjs.cam_info.cls, PJ_CAMERA_INFO, "GetCameraInfo", "(I)L" PJ_CAMERA_INFO_CLASS_PATH ";", jobjs.cam_info.m_get_info); - GET_FIELD_ID(jobjs.cam_info.cls, "PjCameraInfo", "facing", "I", + GET_FIELD_ID(jobjs.cam_info.cls, PJ_CAMERA_INFO, "facing", "I", jobjs.cam_info.f_facing); - GET_FIELD_ID(jobjs.cam_info.cls, "PjCameraInfo", "orient", "I", + GET_FIELD_ID(jobjs.cam_info.cls, PJ_CAMERA_INFO, "orient", "I", jobjs.cam_info.f_orient); - GET_FIELD_ID(jobjs.cam_info.cls, "PjCameraInfo", "supportedSize", "[I", + GET_FIELD_ID(jobjs.cam_info.cls, PJ_CAMERA_INFO, "supportedSize", "[I", jobjs.cam_info.f_sup_size); - GET_FIELD_ID(jobjs.cam_info.cls, "PjCameraInfo", "supportedFormat", "[I", + GET_FIELD_ID(jobjs.cam_info.cls, PJ_CAMERA_INFO, "supportedFormat", "[I", jobjs.cam_info.f_sup_fmt); - GET_FIELD_ID(jobjs.cam_info.cls, "PjCameraInfo", "supportedFps1000", "[I", + GET_FIELD_ID(jobjs.cam_info.cls, PJ_CAMERA_INFO, "supportedFps1000", "[I", jobjs.cam_info.f_sup_fps); #undef GET_CLASS_ID @@ -346,7 +367,11 @@ /* Register native function */ { +#if USE_CAMERA2 + JNINativeMethod m = { "PushFrame2", "(JLjava/nio/ByteBuffer;IILjava/nio/ByteBuffer;IILjava/nio/ByteBuffer;II)V", (void*)&OnGetFrame2 }; +#else JNINativeMethod m = { "PushFrame", "([BIJ)V", (void*)&OnGetFrame }; +#endif if ((*jni_env)->RegisterNatives(jni_env, jobjs.cam.cls, &m, 1)) { PJ_LOG(3, (THIS_FILE, "[JNI] Failed in registering native " "function 'OnGetFrame()'")); @@ -597,6 +622,8 @@ DEFAULT_FPS, 1); } +/* Camera2 supports only I420 for now */ +#if !USE_CAMERA2 /* YV12 */ if (adi->has_yv12) { for (k = 0; k < adi->sup_size_cnt && @@ -636,6 +663,7 @@ DEFAULT_FPS, 1); } } +#endif } else { goto on_skip_dev; @@ -770,6 +798,12 @@ param->dir == PJMEDIA_DIR_CAPTURE, PJ_EINVAL); +/* Camera2 supports only I420 for now */ +#if USE_CAMERA2 + if (param->fmt.id != PJMEDIA_FORMAT_I420) + return PJMEDIA_EVID_BADFORMAT; +#endif + pj_bzero(&vafp, sizeof(vafp)); adi = &f->dev_info[param->cap_id]; vfd = pjmedia_format_get_video_format_detail(¶m->fmt, PJ_TRUE); @@ -808,8 +842,13 @@ pj_memcpy(&strm->vafp, &vafp, sizeof(vafp)); strm->ts_inc = PJMEDIA_SPF2(param->clock_rate, &vfd->fps, 1); - /* Allocate buffer for YV12 -> I420 conversion */ - if (convert_to_i420) { + /* Allocate buffer for YV12 -> I420 conversion. + * The camera2 is a bit tricky with format, for example it reports + * for I420 support (and no NV21 support), however the incoming frame + * buffers are actually in NV21 format (e.g: pixel stride is 2), so + * we should always check and conversion buffer may be needed. + */ + if (USE_CAMERA2 || convert_to_i420) { pj_assert(vfi->plane_cnt > 1); strm->convert_to_i420 = convert_to_i420; strm->convert_buf = pj_pool_alloc(pool, vafp.plane_bytes[1]); @@ -829,7 +868,11 @@ strm->cam_size.w, /* w */ strm->cam_size.h, /* h */ and_fmt, /* fmt */ +#if USE_CAMERA2 + vfd->fps.num/ +#else vfd->fps.num*1000/ +#endif vfd->fps.denum, /* fps */ (jlong)(intptr_t)strm, /* user data */ NULL /* SurfaceView */ @@ -1109,6 +1152,231 @@ return PJ_SUCCESS; } +#if USE_CAMERA2 + +PJ_INLINE(void) strip_padding(void *dst, void *src, int w, int h, int stride) +{ + int i; + for (i = 0; i < h; ++i) { + pj_memmove(dst, src, w); + src += stride; + dst += w; + } +} + +static void JNICALL OnGetFrame2(JNIEnv *env, jobject obj, + jlong user_data, + jobject plane0, jint rowStride0, jint pixStride0, + jobject plane1, jint rowStride1, jint pixStride1, + jobject plane2, jint rowStride2, jint pixStride2) +{ + and_stream *strm = (and_stream*)(intptr_t)user_data; + pjmedia_frame f; + pj_uint8_t *p0, *p1, *p2, *p0_end; + pj_uint8_t *Y, *U, *V; + pj_status_t status; + void *frame_buf, *data_buf; + + strm->frame_ts.u64 += strm->ts_inc; + if (!strm->vid_cb.capture_cb) + return; + + if (strm->thread_initialized == 0 || !pj_thread_is_registered()) { + pj_status_t status; + pj_bzero(strm->thread_desc, sizeof(pj_thread_desc)); + status = pj_thread_register("and_cam", strm->thread_desc, + &strm->thread); + if (status != PJ_SUCCESS) + return; + strm->thread_initialized = 1; + PJ_LOG(5,(THIS_FILE, "Android camera thread registered")); + } + + p0 = (pj_uint8_t*)(*env)->GetDirectBufferAddress(env, plane0); + p1 = (pj_uint8_t*)(*env)->GetDirectBufferAddress(env, plane1); + p2 = (pj_uint8_t*)(*env)->GetDirectBufferAddress(env, plane2); + + /* Assuming the buffers are originally a large contigue buffer, + * minimum check for now: plane 1 or 2 must be after plane 0. + */ + p0_end = p0 + strm->vafp.size.h * rowStride0; + pj_assert(p1 >= p0_end || p2 >= p0_end); + + f.type = PJMEDIA_FRAME_TYPE_VIDEO; + f.size = strm->vafp.framebytes; + f.timestamp.u64 = strm->frame_ts.u64; + f.buf = data_buf = p0; + + /* In this implementation, we only return I420 frames, so here we need to + * convert other formats and strip any padding. + */ + + Y = (pj_uint8_t*)f.buf; + U = Y + strm->vafp.plane_bytes[0]; + V = U + strm->vafp.plane_bytes[1]; + + /* Check if we need conversion here, this is the tricky part of camera2. + * When we request I420, the returned buffer may not be actually I420, + * for example NV21. The camera2 'cheats' us via it's Plane type which + * has pixel stride attribute. For example, NV21 buffer structure will + * be represented as I420 using Plane array with the following attributes: + * - Plane[1], or U plane, points to address of (Plane[0] + Ysize + 1). + * - Plane[2], or V plane, points to address of (Plane[0] + Ysize). + * - Pixel stride is set to 2 for U & V planes, and 1 for Y plane. + */ + + /* Already I420 without padding, nothing to do */ + if (p1 == U && p2 == V) {} + + /* I420 with padding, remove padding */ + else if (pixStride1==1 && pixStride2==1 && p2 > p1 && p1 > p0) + { + /* Strip out Y padding */ + if (rowStride0 > strm->vafp.size.w) { + strip_padding(Y, p0, strm->vafp.size.w, strm->vafp.size.h, + rowStride0); + } + + /* Get U & V planes */ + + if (rowStride1 == strm->vafp.size.w/2) { + /* No padding, simply bulk memmove U & V */ + pj_memmove(U, p1, strm->vafp.plane_bytes[1]); + pj_memmove(V, p2, strm->vafp.plane_bytes[2]); + } else if (rowStride1 > strm->vafp.size.w/2) { + /* Strip padding */ + strip_padding(U, p1, strm->vafp.size.w/2, strm->vafp.size.h/2, + rowStride1); + strip_padding(V, p2, strm->vafp.size.w/2, strm->vafp.size.h/2, + rowStride2); + } + } + + /* The buffer may be originally NV21, i.e: V/U is interleaved */ + else if (p1-p2==1 && pixStride0==1 && pixStride1==2 && pixStride2==2) + { + /* Strip out Y padding */ + if (rowStride0 > strm->vafp.size.w) { + strip_padding(Y, p0, strm->vafp.size.w, strm->vafp.size.h, + rowStride0); + } + + /* Get U & V, and strip if needed */ + { + pj_uint8_t *src = p2; + pj_uint8_t *dst_u = U; + pj_uint8_t *dst_v = strm->convert_buf; + int diff = rowStride1 - strm->vafp.size.w; + int i; + for (i = 0; i < strm->vafp.size.h/2; ++i) { + int j; + for (j = 0; j < strm->vafp.size.w/2; ++j) { + *dst_v++ = *src++; + *dst_u++ = *src++; + } + src += diff; /* stripping any padding */ + } + pj_memcpy(V, strm->convert_buf, strm->vafp.plane_bytes[2]); + } + } + + /* The buffer may be originally YV12, i.e: U & V planes are swapped. + * We also need to strip out padding, if any. + */ + else if (pixStride1==1 && pixStride2==1 && p1 > p2 && p2 > p0) + { + /* Strip out Y padding */ + if (rowStride0 > strm->vafp.size.w) { + strip_padding(Y, p0, strm->vafp.size.w, strm->vafp.size.h, + rowStride0); + } + + /* Swap U & V planes */ + if (rowStride1 == strm->vafp.size.w/2) { + + /* No padding, note Y plane should be no padding too! */ + pj_assert(rowStride0 == strm->vafp.size.w); + pj_memcpy(strm->convert_buf, p1, strm->vafp.plane_bytes[1]); + pj_memmove(U, p1, strm->vafp.plane_bytes[1]); + pj_memcpy(V, strm->convert_buf, strm->vafp.plane_bytes[1]); + + } else if (rowStride1 > strm->vafp.size.w/2) { + + /* Strip padding */ + strip_padding(strm->convert_buf, p1, strm->vafp.size.w/2, + strm->vafp.size.h/2, rowStride1); + strip_padding(V, p2, strm->vafp.size.w/2, strm->vafp.size.h/2, + rowStride2); + + /* Get V plane data from conversion buffer */ + pj_memcpy(V, strm->convert_buf, strm->vafp.plane_bytes[2]); + + } + } + + /* Else, let's just print log for now */ + else { + jlong p0_len, p1_len, p2_len; + + p0_len = (*env)->GetDirectBufferCapacity(env, plane0); + p1_len = (*env)->GetDirectBufferCapacity(env, plane1); + p2_len = (*env)->GetDirectBufferCapacity(env, plane2); + + PJ_LOG(1,(THIS_FILE, "Unrecognized image format from Android camera2, " + "please report the following plane format:")); + PJ_LOG(1,(THIS_FILE, " Planes (buf/len/row_stride/pix_stride):" + " p0=%p/%d/%d/%d p1=%p/%d/%d/%d p2=%p/%d/%d/%d", + p0, p0_len, rowStride0, pixStride0, + p1, p1_len, rowStride1, pixStride1, + p2, p2_len, rowStride2, pixStride2)); + +#if 1 + /* Generic converter to I420, based on row stride & pixel stride */ + + /* Strip out Y padding */ + if (rowStride0 > strm->vafp.size.w) { + strip_padding(Y, p0, strm->vafp.size.w, strm->vafp.size.h, + rowStride0); + } + + /* Get U & V, and strip if needed */ + { + pj_uint8_t *src_u = p1; + pj_uint8_t *src_v = p2; + pj_uint8_t *dst_u = U; + pj_uint8_t *dst_v = strm->convert_buf; + int i; + + /* Note, we use convert buffer for V, just in case U & V are + * swapped. + */ + for (i = 0; i < strm->vafp.size.h/2; ++i) { + int j; + for (j = 0; j < strm->vafp.size.w/2; ++j) { + *dst_v++ = *(src_v + j*pixStride2); + *dst_u++ = *(src_u + j*pixStride1); + } + src_u += rowStride1; + src_v += rowStride2; + } + pj_memcpy(V, strm->convert_buf, strm->vafp.plane_bytes[2]); + } +#endif + + } + + status = pjmedia_vid_dev_conv_resize_and_rotate(&strm->conv, + f.buf, + &frame_buf); + if (status == PJ_SUCCESS) { + f.buf = frame_buf; + } + + (*strm->vid_cb.capture_cb)(&strm->base, strm->user_data, &f); +} + +#else + static void JNICALL OnGetFrame(JNIEnv *env, jobject obj, jbyteArray data, jint length, jlong user_data) @@ -1225,4 +1493,6 @@ (*env)->ReleaseByteArrayElements(env, data, data_buf, JNI_ABORT); } +#endif /* USE_CAMERA2 */ + #endif /* PJMEDIA_VIDEO_DEV_HAS_ANDROID */ diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjmedia/src/pjmedia-videodev/darwin_dev.m asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjmedia/src/pjmedia-videodev/darwin_dev.m --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjmedia/src/pjmedia-videodev/darwin_dev.m 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjmedia/src/pjmedia-videodev/darwin_dev.m 2022-02-24 07:54:38.000000000 +0000 @@ -268,6 +268,24 @@ /* API: init factory */ static pj_status_t darwin_factory_init(pjmedia_vid_dev_factory *f) { + return darwin_factory_refresh(f); +} + +/* API: destroy factory */ +static pj_status_t darwin_factory_destroy(pjmedia_vid_dev_factory *f) +{ + struct darwin_factory *qf = (struct darwin_factory*)f; + pj_pool_t *pool = qf->pool; + + qf->pool = NULL; + pj_pool_release(pool); + + return PJ_SUCCESS; +} + +/* API: refresh the list of devices */ +static pj_status_t darwin_factory_refresh(pjmedia_vid_dev_factory *f) +{ struct darwin_factory *qf = (struct darwin_factory*)f; struct darwin_dev_info *qdi; unsigned i, l, first_idx, front_idx = -1; @@ -305,6 +323,9 @@ AVCaptureDeviceDiscoverySession *dds; NSArray *dev_types = @[AVCaptureDeviceTypeBuiltInWideAngleCamera +#if TARGET_OS_OSX && defined(__MAC_10_15) + , AVCaptureDeviceTypeExternalUnknown +#endif #if TARGET_OS_IPHONE && defined(__IPHONE_10_0) , AVCaptureDeviceTypeBuiltInDuoCamera , AVCaptureDeviceTypeBuiltInTelephotoCamera @@ -433,25 +454,6 @@ return PJ_SUCCESS; } -/* API: destroy factory */ -static pj_status_t darwin_factory_destroy(pjmedia_vid_dev_factory *f) -{ - struct darwin_factory *qf = (struct darwin_factory*)f; - pj_pool_t *pool = qf->pool; - - qf->pool = NULL; - pj_pool_release(pool); - - return PJ_SUCCESS; -} - -/* API: refresh the list of devices */ -static pj_status_t darwin_factory_refresh(pjmedia_vid_dev_factory *f) -{ - PJ_UNUSED_ARG(f); - return PJ_SUCCESS; -} - /* API: get number of devices */ static unsigned darwin_factory_get_dev_count(pjmedia_vid_dev_factory *f) { @@ -530,6 +532,15 @@ - (void)session_runtime_error:(NSNotification *)notification { + // This function is called from NSNotificationCenter. + // Make sure the thread is registered. + if (!pj_thread_is_registered()) { + pj_thread_t *thread; + static pj_thread_desc thread_desc; + pj_bzero(thread_desc, sizeof(pj_thread_desc)); + pj_thread_register("NSNotificationCenter", thread_desc, &thread); + } + NSError *error = notification.userInfo[AVCaptureSessionErrorKey]; PJ_LOG(3, (THIS_FILE, "Capture session runtime error: %s, %s", [error.localizedDescription UTF8String], @@ -1171,10 +1182,10 @@ { pj_memcpy(&strm->param.disp_size, pval, sizeof(strm->param.disp_size)); - CGRect r = strm->render_view.bounds; - r.size = CGSizeMake(strm->param.disp_size.w, - strm->param.disp_size.h); dispatch_sync_on_main_queue(^{ + CGRect r = strm->render_view.bounds; + r.size = CGSizeMake(strm->param.disp_size.w, + strm->param.disp_size.h); strm->render_view.bounds = r; if (strm->prev_layer) strm->prev_layer.frame = r; diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjmedia/src/pjmedia-videodev/dshow_dev.c asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjmedia/src/pjmedia-videodev/dshow_dev.c --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjmedia/src/pjmedia-videodev/dshow_dev.c 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjmedia/src/pjmedia-videodev/dshow_dev.c 2022-02-24 07:54:38.000000000 +0000 @@ -38,6 +38,8 @@ #ifdef _MSC_VER # pragma warning(pop) +#else +#include #endif #pragma comment(lib, "Strmiids.lib") diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjmedia/src/pjmedia-videodev/sdl_dev.c asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjmedia/src/pjmedia-videodev/sdl_dev.c --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjmedia/src/pjmedia-videodev/sdl_dev.c 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjmedia/src/pjmedia-videodev/sdl_dev.c 2022-02-24 07:54:38.000000000 +0000 @@ -704,7 +704,10 @@ if ((strm->param.flags & PJMEDIA_VID_DEV_CAP_OUTPUT_FULLSCREEN) && strm->param.window_fullscreen) { - flags |= SDL_WINDOW_FULLSCREEN; + if (strm->param.window_fullscreen == PJMEDIA_VID_DEV_FULLSCREEN) + flags |= SDL_WINDOW_FULLSCREEN; + else + flags |= SDL_WINDOW_FULLSCREEN_DESKTOP; } #if PJMEDIA_VIDEO_DEV_SDL_HAS_OPENGL @@ -1111,7 +1114,15 @@ return PJ_SUCCESS; } else if (cap == PJMEDIA_VID_DEV_CAP_OUTPUT_FULLSCREEN) { Uint32 flag = SDL_GetWindowFlags(strm->window); - *((pj_bool_t *)pval) = (flag & SDL_WINDOW_FULLSCREEN)? PJ_TRUE: PJ_FALSE; + pjmedia_vid_dev_fullscreen_flag val = PJMEDIA_VID_DEV_WINDOWED; + if ((flag & SDL_WINDOW_FULLSCREEN_DESKTOP) == + SDL_WINDOW_FULLSCREEN_DESKTOP) + { + val = PJMEDIA_VID_DEV_FULLSCREEN_DESKTOP; + } else if ((flag & SDL_WINDOW_FULLSCREEN) == SDL_WINDOW_FULLSCREEN) { + val = PJMEDIA_VID_DEV_FULLSCREEN; + } + *((pjmedia_vid_dev_fullscreen_flag*)pval) = val; return PJ_SUCCESS; } @@ -1191,9 +1202,24 @@ return status; } else if (cap == PJMEDIA_VID_DEV_CAP_OUTPUT_RESIZE) { pjmedia_rect_size *new_size = (pjmedia_rect_size *)pval; + Uint32 flag = SDL_GetWindowFlags(strm->window); + pj_status_t status; + + /** + * Exit full-screen if engaged, since resizing while in full-screen is + * not supported. + */ + if (flag & SDL_WINDOW_FULLSCREEN_DESKTOP) + SDL_SetWindowFullscreen(strm->window, 0); SDL_SetWindowSize(strm->window, new_size->w, new_size->h); - return resize_disp(strm, new_size); + status = resize_disp(strm, new_size); + + /* Restore full-screen if it was engaged. */ + if (flag & SDL_WINDOW_FULLSCREEN_DESKTOP) + SDL_SetWindowFullscreen(strm->window, SDL_WINDOW_FULLSCREEN_DESKTOP); + + return status; } else if (cap == PJMEDIA_VID_DEV_CAP_OUTPUT_WINDOW) { pjmedia_vid_dev_hwnd *hwnd = (pjmedia_vid_dev_hwnd*)pval; pj_status_t status = PJ_SUCCESS; @@ -1210,12 +1236,16 @@ return status; } else if (cap == PJMEDIA_VID_DEV_CAP_OUTPUT_FULLSCREEN) { Uint32 flag; + pjmedia_vid_dev_fullscreen_flag val = + *(pjmedia_vid_dev_fullscreen_flag*)pval; flag = SDL_GetWindowFlags(strm->window); - if (*(pj_bool_t *)pval) + if (val == PJMEDIA_VID_DEV_FULLSCREEN_DESKTOP) + flag |= SDL_WINDOW_FULLSCREEN_DESKTOP; + else if (val == PJMEDIA_VID_DEV_FULLSCREEN) flag |= SDL_WINDOW_FULLSCREEN; else - flag &= (~SDL_WINDOW_FULLSCREEN); + flag &= (~SDL_WINDOW_FULLSCREEN_DESKTOP); SDL_SetWindowFullscreen(strm->window, flag); diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjmedia/src/pjmedia-videodev/util.c asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjmedia/src/pjmedia-videodev/util.c --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjmedia/src/pjmedia-videodev/util.c 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjmedia/src/pjmedia-videodev/util.c 2022-02-24 07:54:38.000000000 +0000 @@ -164,8 +164,8 @@ conv->wxh = conv->dst_size.w * conv->dst_size.h; conv->src_frame_size = dst_size.w * dst_size.h * vfi->bpp / 8; - conv->conv_frame_size = conv->rot_size.w * conv->rot_size.h; - conv->conv_frame_size *= vfi->bpp / 8; + conv->conv_frame_size = conv->rot_size.w * conv->rot_size.h * + vfi->bpp / 8; conv->conv_buf = pj_pool_alloc(pool, conv->src_frame_size); pjmedia_vid_dev_conv_set_rotation(conv, PJMEDIA_ORIENT_NATURAL); diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjmedia/src/pjmedia-videodev/v4l2_dev.c asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjmedia/src/pjmedia-videodev/v4l2_dev.c --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjmedia/src/pjmedia-videodev/v4l2_dev.c 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjmedia/src/pjmedia-videodev/v4l2_dev.c 2022-02-24 07:54:38.000000000 +0000 @@ -115,7 +115,8 @@ { PJMEDIA_FORMAT_RGB32, V4L2_PIX_FMT_BGR32 }, { PJMEDIA_FORMAT_AYUV, V4L2_PIX_FMT_YUV32 }, { PJMEDIA_FORMAT_YUY2, V4L2_PIX_FMT_YUYV }, - { PJMEDIA_FORMAT_UYVY, V4L2_PIX_FMT_UYVY } + { PJMEDIA_FORMAT_UYVY, V4L2_PIX_FMT_UYVY }, + { PJMEDIA_FORMAT_I420, V4L2_PIX_FMT_YUV420 } }; /* Prototypes */ diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjmedia/src/pjmedia-videodev/videodev.c asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjmedia/src/pjmedia-videodev/videodev.c --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjmedia/src/pjmedia-videodev/videodev.c 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjmedia/src/pjmedia-videodev/videodev.c 2022-02-24 07:54:38.000000000 +0000 @@ -225,7 +225,7 @@ pjmedia_vid_driver_deinit(i); } - vid_subsys->pf = NULL; + pj_bzero(vid_subsys, sizeof(pjmedia_vid_subsys)); } return PJ_SUCCESS; } diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjmedia/src/test/audio_tool.c asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjmedia/src/test/audio_tool.c --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjmedia/src/test/audio_tool.c 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjmedia/src/test/audio_tool.c 2022-02-24 07:54:38.000000000 +0000 @@ -179,8 +179,9 @@ info.samples_per_sec = 8000; stream = pj_snd_open_recorder(-1, &info, &rec_callback, NULL); - if (!stream) - return -1; + if (!stream){ + goto on_error; + } status = pj_snd_stream_start(stream); if (status != 0) @@ -199,6 +200,11 @@ return 0; on_error: +#if WRITE_ORIGINAL_PCM + fclose(fhnd_pcm); +#endif + fclose(fhnd); + pj_snd_stream_stop(stream); pj_snd_stream_close(stream); return -1; @@ -226,8 +232,10 @@ info.samples_per_sec = 8000; stream = pj_snd_open_player(-1, &info, &play_callback, NULL); - if (!stream) + if (!stream){ + fclose(fhnd); return -1; + } status = pj_snd_stream_start(stream); if (status != 0) diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjmedia/src/test/codec_vectors.c asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjmedia/src/test/codec_vectors.c --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjmedia/src/test/codec_vectors.c 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjmedia/src/test/codec_vectors.c 2022-02-24 07:54:38.000000000 +0000 @@ -222,7 +222,7 @@ pj_bool_t swap_endian) { enum { MAX_BITS_PER_FRAME = 160*8 }; - short i,j; + int i,j; short nsamp; short packed_word; short bit_count; diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjmedia/src/test/main.c asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjmedia/src/test/main.c --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjmedia/src/test/main.c 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjmedia/src/test/main.c 2022-02-24 07:54:38.000000000 +0000 @@ -31,16 +31,64 @@ # include "../../../pjlib/include/rtems-network-config.h" #endif + +#if PJ_LINUX || PJ_DARWINOS + +#include +#include +#include +#include +#include +static void print_stack(int sig) +{ + void *array[16]; + size_t size; + + size = backtrace(array, 16); + fprintf(stderr, "Error: signal %d:\n", sig); + backtrace_symbols_fd(array, size, STDERR_FILENO); + exit(1); +} + +static void init_signals(void) +{ + signal(SIGSEGV, &print_stack); + signal(SIGABRT, &print_stack); +} + +#else +#define init_signals() +#endif + + static int main_func(int argc, char *argv[]) { int rc; - char s[10]; + int interractive = 0; + int no_trap = 0; + + while (argc > 1) { + char *arg = argv[--argc]; + + if (*arg=='-' && *(arg+1)=='i') { + interractive = 1; + + } else if (*arg=='-' && *(arg+1)=='n') { + no_trap = 1; + } + } + + if (!no_trap) { + init_signals(); + } rc = test_main(); - if (argc == 2 && argv[1][0]=='-' && argv[1][1]=='i') { - puts("\nPress to quit"); - if (fgets(s, sizeof(s), stdin) == NULL) + if (interractive) { + char s[10]; + puts(""); + puts("Press to exit"); + if (!fgets(s, sizeof(s), stdin)) return rc; } diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjmedia/src/test/mips_test.c asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjmedia/src/test/mips_test.c --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjmedia/src/test/mips_test.c 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjmedia/src/test/mips_test.c 2022-02-24 07:54:38.000000000 +0000 @@ -1773,6 +1773,7 @@ si.rx_event_pt = 101; si.ssrc = pj_rand(); si.jb_init = si.jb_min_pre = si.jb_max_pre = si.jb_max = -1; + si.jb_discard_algo = PJMEDIA_JB_DISCARD_PROGRESSIVE; /* Create loop transport */ status = pjmedia_transport_loop_create(sp->endpt, &sp->transport); diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjmedia/src/test/test.c asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjmedia/src/test/test.c --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjmedia/src/test/test.c 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjmedia/src/test/test.c 2022-02-24 07:54:38.000000000 +0000 @@ -64,7 +64,8 @@ pj_caching_pool_init(&caching_pool, &pj_pool_factory_default_policy, 0); pool = pj_pool_create(&caching_pool.factory, "test", 1000, 512, NULL); - pj_log_set_decor(PJ_LOG_HAS_NEWLINE); + pj_log_set_decor(PJ_LOG_HAS_NEWLINE | PJ_LOG_HAS_TIME | + PJ_LOG_HAS_MICRO_SEC | PJ_LOG_HAS_INDENT); pj_log_set_level(3); mem = &caching_pool.factory; diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjmedia/src/test/test.h asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjmedia/src/test/test.h --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjmedia/src/test/test.h 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjmedia/src/test/test.h 2022-02-24 07:54:38.000000000 +0000 @@ -23,12 +23,20 @@ #include #include +#if defined(PJ_EXCLUDE_BENCHMARK_TESTS) && (PJ_EXCLUDE_BENCHMARK_TESTS==1) +# define WITH_BENCHMARK 0 +#else +# define WITH_BENCHMARK 1 +#endif + #define HAS_VID_DEV_TEST PJMEDIA_HAS_VIDEO #define HAS_VID_PORT_TEST PJMEDIA_HAS_VIDEO -#define HAS_VID_CODEC_TEST PJMEDIA_HAS_VIDEO +#ifndef HAS_VID_CODEC_TEST + #define HAS_VID_CODEC_TEST PJMEDIA_HAS_VIDEO +#endif #define HAS_SDP_NEG_TEST 1 #define HAS_JBUF_TEST 1 -#define HAS_MIPS_TEST 1 +#define HAS_MIPS_TEST WITH_BENCHMARK #define HAS_CODEC_VECTOR_TEST 1 int session_test(void); diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjmedia/src/test/vid_codec_test.c asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjmedia/src/test/vid_codec_test.c --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjmedia/src/test/vid_codec_test.c 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjmedia/src/test/vid_codec_test.c 2022-02-24 07:54:38.000000000 +0000 @@ -546,6 +546,9 @@ pj_pool_release(pool); pj_log_set_level(orig_log_level); + /* Avoid compile warning */ + PJ_UNUSED_ARG(encode_decode_test); + return rc; } diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjnath/build/pjnath_test.vcxproj asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjnath/build/pjnath_test.vcxproj --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjnath/build/pjnath_test.vcxproj 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjnath/build/pjnath_test.vcxproj 2022-02-24 07:54:38.000000000 +0000 @@ -1,6 +1,10 @@  + + Debug-Dynamic + ARM64 + Debug-Dynamic Win32 @@ -9,6 +13,10 @@ Debug-Dynamic x64 + + Debug-Static + ARM64 + Debug-Static Win32 @@ -17,6 +25,10 @@ Debug-Static x64 + + Debug + ARM64 + Debug Win32 @@ -25,6 +37,10 @@ Debug x64 + + Release-Dynamic + ARM64 + Release-Dynamic Win32 @@ -33,6 +49,10 @@ Release-Dynamic x64 + + Release-Static + ARM64 + Release-Static Win32 @@ -41,6 +61,10 @@ Release-Static x64 + + Release + ARM64 + Release Win32 @@ -101,110 +125,177 @@ false MultiByte + + Application + v140 + false + MultiByte + Application v140 false MultiByte + + Application + v140 + false + MultiByte + Application v140 false MultiByte + + Application + v140 + false + MultiByte + Application v140 false MultiByte + + Application + v140 + false + MultiByte + Application v140 false MultiByte + + Application + v140 + false + MultiByte + Application v140 false MultiByte + + Application + v140 + false + MultiByte + $(BuildToolset) - + + Application StaticLibrary - + - + - - + + - - + + - - + + - - + + - - + + - - + + - - + + + + + + + - - + + + + + + + - - + + + + + + + - - + + + + + + + - - + + + + + + + - - + + + + + + + <_ProjectFileVersion>14.0.22823.1 - pjnath-test-$(TargetCPU)-$(Platform)-vc$(VSVer)-$(Configuration) + pjnath-test-$(TargetCPU)-$(Platform)-vc$(VSVer)-$(Configuration) @@ -242,6 +333,20 @@ MachineX64 + + + + ../include;../../pjlib/include;../../pjlib-util/include;%(AdditionalIncludeDirectories) + _CONSOLE;%(PreprocessorDefinitions) + + + ProgramDatabase + + + netapi32.lib;ws2_32.lib;odbc32.lib;odbccp32.lib;ole32.lib;%(AdditionalDependencies) + ..\bin\pjnath-test-$(TargetCPU)-$(Platform)-vc$(VSVer)-$(Configuration).exe + + ../include;../../pjlib/include;../../pjlib-util/include;%(AdditionalIncludeDirectories) @@ -268,6 +373,19 @@ MachineX64 + + + + ../include;../../pjlib/include;../../pjlib-util/include;%(AdditionalIncludeDirectories) + _CONSOLE;%(PreprocessorDefinitions) + + + + + netapi32.lib;mswsock.lib;ws2_32.lib;odbc32.lib;odbccp32.lib;ole32.lib;%(AdditionalDependencies) + ..\bin\pjnath-test-$(TargetCPU)-$(Platform)-vc$(VSVer)-$(Configuration).exe + + ../include;../../pjlib/include;../../pjlib-util/include;%(AdditionalIncludeDirectories) @@ -295,6 +413,20 @@ MachineX64 + + + + ../include;../../pjlib/include;../../pjlib-util/include;%(AdditionalIncludeDirectories) + _CONSOLE;%(PreprocessorDefinitions) + + + ProgramDatabase + + + netapi32.lib;ws2_32.lib;odbc32.lib;odbccp32.lib;ole32.lib;%(AdditionalDependencies) + ..\bin\pjnath-test-$(TargetCPU)-$(Platform)-vc$(VSVer)-$(Configuration).exe + + ../include;../../pjlib/include;../../pjlib-util/include;%(AdditionalIncludeDirectories) @@ -321,6 +453,19 @@ MachineX64 + + + + ../include;../../pjlib/include;../../pjlib-util/include;%(AdditionalIncludeDirectories) + _CONSOLE;%(PreprocessorDefinitions) + + + + + netapi32.lib;mswsock.lib;ws2_32.lib;odbc32.lib;odbccp32.lib;ole32.lib;%(AdditionalDependencies) + ..\bin\pjnath-test-$(TargetCPU)-$(Platform)-vc$(VSVer)-$(Configuration).exe + + ../include;../../pjlib/include;../../pjlib-util/include;%(AdditionalIncludeDirectories) @@ -348,6 +493,20 @@ MachineX64 + + + + ../include;../../pjlib/include;../../pjlib-util/include;%(AdditionalIncludeDirectories) + _CONSOLE;%(PreprocessorDefinitions) + + + ProgramDatabase + + + netapi32.lib;ws2_32.lib;odbc32.lib;odbccp32.lib;ole32.lib;%(AdditionalDependencies) + ..\bin\pjnath-test-$(TargetCPU)-$(Platform)-vc$(VSVer)-$(Configuration).exe + + ../include;../../pjlib/include;../../pjlib-util/include;%(AdditionalIncludeDirectories) @@ -374,6 +533,19 @@ MachineX64 + + + + ../include;../../pjlib/include;../../pjlib-util/include;%(AdditionalIncludeDirectories) + _CONSOLE;%(PreprocessorDefinitions) + + + + + netapi32.lib;mswsock.lib;ws2_32.lib;odbc32.lib;odbccp32.lib;ole32.lib;%(AdditionalDependencies) + ..\bin\pjnath-test-$(TargetCPU)-$(Platform)-vc$(VSVer)-$(Configuration).exe + + @@ -381,16 +553,22 @@ true true + true true true + true true true + true true true + true true true + true true true + true diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjnath/build/pjnath.vcxproj asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjnath/build/pjnath.vcxproj --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjnath/build/pjnath.vcxproj 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjnath/build/pjnath.vcxproj 2022-02-24 07:54:38.000000000 +0000 @@ -5,6 +5,10 @@ Debug-Dynamic ARM + + Debug-Dynamic + ARM64 + Debug-Dynamic Win32 @@ -17,6 +21,10 @@ Debug-Static ARM + + Debug-Static + ARM64 + Debug-Static Win32 @@ -29,6 +37,10 @@ Debug ARM + + Debug + ARM64 + Debug Win32 @@ -41,6 +53,10 @@ Release-Dynamic ARM + + Release-Dynamic + ARM64 + Release-Dynamic Win32 @@ -53,6 +69,10 @@ Release-Static ARM + + Release-Static + ARM64 + Release-Static Win32 @@ -65,6 +85,10 @@ Release ARM + + Release + ARM64 + Release Win32 @@ -78,7 +102,7 @@ {A5D9AA24-08ED-48B9-BD65-F0A25E96BFC4} - pjnath + pjnath en-US @@ -161,40 +185,77 @@ false MultiByte + + StaticLibrary + v140 + false + MultiByte + StaticLibrary v140 false MultiByte + + StaticLibrary + v140 + false + MultiByte + StaticLibrary v140 false MultiByte + + StaticLibrary + v140 + false + MultiByte + StaticLibrary v140 false MultiByte + + StaticLibrary + v140 + false + MultiByte + StaticLibrary v140 false MultiByte + + StaticLibrary + v140 + false + MultiByte + StaticLibrary v140 false MultiByte + + StaticLibrary + v140 + false + MultiByte + $(BuildToolset) - + + @@ -264,31 +325,61 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>14.0.22823.1 @@ -314,11 +405,21 @@ + + MinimumRecommendedRules.ruleset + + + MinimumRecommendedRules.ruleset + + MinimumRecommendedRules.ruleset + + + MinimumRecommendedRules.ruleset @@ -344,6 +445,11 @@ + + MinimumRecommendedRules.ruleset + + + MinimumRecommendedRules.ruleset @@ -359,6 +465,11 @@ + + MinimumRecommendedRules.ruleset + + + MinimumRecommendedRules.ruleset @@ -374,11 +485,21 @@ + + MinimumRecommendedRules.ruleset + + + MinimumRecommendedRules.ruleset + + MinimumRecommendedRules.ruleset + + + MinimumRecommendedRules.ruleset @@ -414,6 +535,15 @@ + + + + ../include;../../pjlib/include;../../pjlib-util/include;%(AdditionalIncludeDirectories) + _LIB;%(PreprocessorDefinitions) + + + + ../include;../../pjlib/include;../../pjlib-util/include;%(AdditionalIncludeDirectories) @@ -440,6 +570,16 @@ ProgramDatabase + + + + ../include;../../pjlib/include;../../pjlib-util/include;%(AdditionalIncludeDirectories) + _LIB;%(PreprocessorDefinitions) + + + ProgramDatabase + + ../include;../../pjlib/include;../../pjlib-util/include;%(AdditionalIncludeDirectories) @@ -466,6 +606,16 @@ ProgramDatabase + + + + ../include;../../pjlib/include;../../pjlib-util/include;%(AdditionalIncludeDirectories) + _LIB;%(PreprocessorDefinitions) + + + ProgramDatabase + + ../include;../../pjlib/include;../../pjlib-util/include;%(AdditionalIncludeDirectories) @@ -491,6 +641,15 @@ + + + + ../include;../../pjlib/include;../../pjlib-util/include;%(AdditionalIncludeDirectories) + _LIB;%(PreprocessorDefinitions) + + + + ../include;../../pjlib/include;../../pjlib-util/include;%(AdditionalIncludeDirectories) @@ -517,6 +676,16 @@ ProgramDatabase + + + + ../include;../../pjlib/include;../../pjlib-util/include;%(AdditionalIncludeDirectories) + _LIB;%(PreprocessorDefinitions) + + + ProgramDatabase + + ../include;../../pjlib/include;../../pjlib-util/include;%(AdditionalIncludeDirectories) @@ -542,6 +711,15 @@ + + + + ../include;../../pjlib/include;../../pjlib-util/include;%(AdditionalIncludeDirectories) + _LIB;%(PreprocessorDefinitions) + + + + diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjnath/build/pjnath.vcxproj.filters asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjnath/build/pjnath.vcxproj.filters --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjnath/build/pjnath.vcxproj.filters 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjnath/build/pjnath.vcxproj.filters 2022-02-24 07:54:38.000000000 +0000 @@ -76,9 +76,6 @@ Header Files - - Header Files - Header Files diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjnath/include/pjnath/config.h asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjnath/include/pjnath/config.h --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjnath/include/pjnath/config.h 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjnath/include/pjnath/config.h 2022-02-24 07:54:38.000000000 +0000 @@ -286,7 +286,7 @@ /** * Maximum number of ICE components. */ -#define PJ_ICE_MAX_COMP (2<nominated_check_delay = PJ_ICE_NOMINATED_CHECK_DELAY; opt->controlled_agent_want_nom_timeout = ICE_CONTROLLED_AGENT_WAIT_NOMINATION_TIMEOUT; + opt->trickle = PJ_ICE_SESS_TRICKLE_DISABLED; } /* @@ -450,6 +453,19 @@ { PJ_ASSERT_RETURN(ice && opt, PJ_EINVAL); pj_memcpy(&ice->opt, opt, sizeof(*opt)); + ice->is_trickling = (ice->opt.trickle != PJ_ICE_SESS_TRICKLE_DISABLED); + if (ice->is_trickling) { + LOG5((ice->obj_name, "Trickle ICE is active (%s mode)", + (ice->opt.trickle==PJ_ICE_SESS_TRICKLE_HALF? "half":"full"))); + + if (ice->opt.aggressive) { + /* Disable aggressive when ICE trickle is active */ + ice->opt.aggressive = PJ_FALSE; + LOG4((ice->obj_name, "Warning: aggressive nomination is disabled" + " as trickle ICE is active")); + } + } + LOG5((ice->obj_name, "ICE nomination type set to %s", (ice->opt.aggressive ? "aggressive" : "regular"))); return PJ_SUCCESS; @@ -520,6 +536,22 @@ /* + * Detach ICE session from group lock. + */ +PJ_DEF(pj_status_t) pj_ice_sess_detach_grp_lock(pj_ice_sess *ice, + pj_grp_lock_handler *handler) +{ + PJ_ASSERT_RETURN(ice && handler, PJ_EINVAL); + + pj_grp_lock_acquire(ice->grp_lock); + pj_grp_lock_del_handler(ice->grp_lock, ice, &ice_on_destroy); + *handler = &ice_on_destroy; + pj_grp_lock_release(ice->grp_lock); + return PJ_SUCCESS; +} + + +/* * Change session role. */ PJ_DEF(pj_status_t) pj_ice_sess_change_role(pj_ice_sess *ice, @@ -686,9 +718,9 @@ (((256 - comp_id) & 0xFF) << 0); #else enum { - type_mask = ((2 << PJ_ICE_CAND_TYPE_PREF_BITS) - 1), - local_mask = ((2 << PJ_ICE_LOCAL_PREF_BITS) - 1), - comp_mask = ((2 << PJ_ICE_COMP_BITS) - 1), + type_mask = ((1 << PJ_ICE_CAND_TYPE_PREF_BITS) - 1), + local_mask = ((1 << PJ_ICE_LOCAL_PREF_BITS) - 1), + comp_mask = ((1 << PJ_ICE_COMP_BITS) - 1), comp_shift = 0, local_shift = (PJ_ICE_COMP_BITS), @@ -733,14 +765,38 @@ if (ice->lcand_cnt >= PJ_ARRAY_SIZE(ice->lcand)) { status = PJ_ETOOMANY; - goto on_error; + goto on_return; + } + + if (ice->opt.trickle != PJ_ICE_SESS_TRICKLE_DISABLED) { + /* Trickle ICE: + * Make sure that candidate has not been added + */ + for (i=0; ilcand_cnt; ++i) { + const pj_ice_sess_cand *c = &ice->lcand[i]; + if (c->comp_id==comp_id && c->type == type && + pj_sockaddr_cmp(&c->addr, addr)==0 && + pj_sockaddr_cmp(&c->base_addr, base_addr)==0) + { + break; + } + } + + /* Skip candidate, it has been added */ + if (i < ice->lcand_cnt) { + if (p_cand_id) + *p_cand_id = i; + goto on_return; + } } lcand = &ice->lcand[ice->lcand_cnt]; + lcand->id = ice->lcand_cnt; lcand->comp_id = (pj_uint8_t)comp_id; lcand->transport_id = (pj_uint8_t)transport_id; lcand->type = type; pj_strdup(ice->pool, &lcand->foundation, foundation); + lcand->local_pref = local_pref; lcand->prio = CALC_CAND_PRIO(ice, type, local_pref, lcand->comp_id); pj_sockaddr_cp(&lcand->addr, addr); pj_sockaddr_cp(&lcand->base_addr, base_addr); @@ -768,7 +824,7 @@ LOG4((ice->obj_name, "Candidate %d added: comp_id=%d, type=%s, foundation=%.*s, " "addr=%s:%d, base=%s:%d, prio=0x%x (%u)", - ice->lcand_cnt, + lcand->id, lcand->comp_id, cand_type_names[lcand->type], (int)lcand->foundation.slen, @@ -780,11 +836,11 @@ lcand->prio, lcand->prio)); if (p_cand_id) - *p_cand_id = ice->lcand_cnt; + *p_cand_id = lcand->id; ++ice->lcand_cnt; -on_error: +on_return: pj_grp_lock_release(ice->grp_lock); return status; } @@ -898,6 +954,25 @@ return prio; } +PJ_INLINE(int) CMP_CHECK_STATE(const pj_ice_sess_check *c1, + const pj_ice_sess_check *c2) +{ + /* SUCCEEDED has higher state than FAILED */ + if (c1->state == PJ_ICE_SESS_CHECK_STATE_SUCCEEDED && + c2->state == PJ_ICE_SESS_CHECK_STATE_FAILED) + { + return 1; + } + if (c2->state == PJ_ICE_SESS_CHECK_STATE_SUCCEEDED && + c1->state == PJ_ICE_SESS_CHECK_STATE_FAILED) + { + return -1; + } + + /* Other state, just compare the state value */ + return (c1->state - c2->state); +} + PJ_INLINE(int) CMP_CHECK_PRIO(const pj_ice_sess_check *c1, const pj_ice_sess_check *c2) @@ -961,12 +1036,19 @@ pj_ice_sess_check_state st, pj_status_t err_code) { - pj_assert(check->state < PJ_ICE_SESS_CHECK_STATE_SUCCEEDED); - LOG5((ice->obj_name, "Check %s: state changed from %s to %s", dump_check(ice->tmp.txt, sizeof(ice->tmp.txt), &ice->clist, check), check_state_name[check->state], check_state_name[st])); + + /* Put the assert after printing log for debugging purpose */ + // There is corner case, nomination (in non-aggressive ICE mode) may be + // done using an in-progress pair instead of successful pair, this is + // possible because host candidates actually share a single STUN transport + // and pair selection for nomination compares transport instead of + // candidate. So later the pair will receive double completions. + //pj_assert(check->state < PJ_ICE_SESS_CHECK_STATE_SUCCEEDED); + check->state = st; check->err_code = err_code; } @@ -982,7 +1064,9 @@ } } -/* Sort checklist based on priority */ +/* Sort checklist based on state & priority, we need to put Successful pairs + * on top of the list for pruning. + */ static void sort_checklist(pj_ice_sess *ice, pj_ice_sess_checklist *clist) { unsigned i; @@ -1003,7 +1087,12 @@ unsigned j, highest = i; for (j=i+1; jcount; ++j) { - if (CMP_CHECK_PRIO(&clist->checks[j], &clist->checks[highest]) > 0) { + int cmp_state = CMP_CHECK_STATE(&clist->checks[j], + &clist->checks[highest]); + if (cmp_state > 0 || + (cmp_state==0 && CMP_CHECK_PRIO(&clist->checks[j], + &clist->checks[highest]) > 0)) + { highest = j; } } @@ -1031,6 +1120,21 @@ } } +/* Remove a check pair from checklist */ +static void remove_check(pj_ice_sess *ice, pj_ice_sess_checklist *clist, + unsigned check_idx, + const char *reason) +{ + LOG5((ice->obj_name, "Check %s pruned (%s)", + dump_check(ice->tmp.txt, sizeof(ice->tmp.txt), + clist, &clist->checks[check_idx]), + reason)); + + pj_array_erase(clist->checks, sizeof(clist->checks[0]), + clist->count, check_idx); + --clist->count; +} + /* Prune checklist, this must have been done after the checklist * is sorted. */ @@ -1053,7 +1157,9 @@ for (i=0; icount; ++i) { pj_ice_sess_cand *srflx = clist->checks[i].lcand; - if (clist->checks[i].lcand->type == PJ_ICE_CAND_TYPE_SRFLX) { + if (srflx->type == PJ_ICE_CAND_TYPE_SRFLX || + srflx->type == PJ_ICE_CAND_TYPE_PRFLX) + { /* Find the base for this candidate */ unsigned j; for (j=0; jlcand_cnt; ++j) { @@ -1063,7 +1169,7 @@ continue; if (pj_sockaddr_cmp(&srflx->base_addr, &host->addr) == 0) { - /* Replace this SRFLX with its BASE */ + /* Replace this SRFLX/PRFLX with its BASE */ clist->checks[i].lcand = host; break; } @@ -1077,7 +1183,7 @@ pj_sockaddr_print(&srflx->base_addr, baddr, sizeof(baddr), 2), pj_sockaddr_get_port(&srflx->base_addr), - GET_LCAND_ID(clist->checks[i].lcand))); + GET_LCAND_ID(srflx))); return PJNATH_EICENOHOSTCAND; } } @@ -1101,6 +1207,14 @@ pj_ice_sess_cand *rjcand = clist->checks[j].rcand; const char *reason = NULL; + /* Only discard Frozen/Waiting checks */ + if (clist->checks[j].state != PJ_ICE_SESS_CHECK_STATE_FROZEN && + clist->checks[j].state != PJ_ICE_SESS_CHECK_STATE_WAITING) + { + ++j; + continue; + } + if ((licand == ljcand) && (ricand == rjcand)) { reason = "duplicate found"; } else if ((rjcand == ricand) && @@ -1112,15 +1226,7 @@ if (reason != NULL) { /* Found duplicate, remove it */ - LOG5((ice->obj_name, "Check %s pruned (%s)", - dump_check(ice->tmp.txt, sizeof(ice->tmp.txt), - &ice->clist, &clist->checks[j]), - reason)); - - pj_array_erase(clist->checks, sizeof(clist->checks[0]), - clist->count, j); - --clist->count; - + remove_check(ice, clist, j, reason); } else { ++j; } @@ -1297,7 +1403,23 @@ if (comp->valid_check == NULL) { comp->valid_check = check; } else { - if (CMP_CHECK_PRIO(comp->valid_check, check) < 0) + pj_bool_t update = PJ_FALSE; + + /* Update component's valid check with conditions: + * - it is the first nominated check, or + * - it has higher prio, as long as nomination status is NOT degraded + * (existing is nominated -> new is not-nominated). + */ + if (!comp->nominated_check && check->nominated) + { + update = PJ_TRUE; + } else if (CMP_CHECK_PRIO(comp->valid_check, check) < 0 && + (!comp->nominated_check || check->nominated)) + { + update = PJ_TRUE; + } + + if (update) comp->valid_check = check; } @@ -1312,115 +1434,11 @@ } } -/* This function is called when one check completes */ -static pj_bool_t on_check_complete(pj_ice_sess *ice, - pj_ice_sess_check *check) +/* Check if ICE nego completed */ +static pj_bool_t check_ice_complete(pj_ice_sess *ice) { - pj_ice_sess_comp *comp; unsigned i; - - pj_assert(check->state >= PJ_ICE_SESS_CHECK_STATE_SUCCEEDED); - - comp = find_comp(ice, check->lcand->comp_id); - - /* 7.1.2.2.2. Updating Pair States - * - * The agent sets the state of the pair that generated the check to - * Succeeded. The success of this check might also cause the state of - * other checks to change as well. The agent MUST perform the following - * two steps: - * - * 1. The agent changes the states for all other Frozen pairs for the - * same media stream and same foundation to Waiting. Typically - * these other pairs will have different component IDs but not - * always. - */ - if (check->err_code==PJ_SUCCESS) { - - for (i=0; iclist.count; ++i) { - pj_ice_sess_check *c = &ice->clist.checks[i]; - if (pj_strcmp(&c->lcand->foundation, &check->lcand->foundation)==0 - && c->state == PJ_ICE_SESS_CHECK_STATE_FROZEN) - { - check_set_state(ice, c, PJ_ICE_SESS_CHECK_STATE_WAITING, 0); - } - } - - LOG5((ice->obj_name, "Check %d is successful%s", - GET_CHECK_ID(&ice->clist, check), - (check->nominated ? " and nominated" : ""))); - - /* On the first valid pair, we call the callback, if present */ - if (ice->valid_pair_found == PJ_FALSE) { - ice->valid_pair_found = PJ_TRUE; - - if (ice->cb.on_valid_pair) { - (*ice->cb.on_valid_pair)(ice); - } - } - } - - /* 8.2. Updating States - * - * For both controlling and controlled agents, the state of ICE - * processing depends on the presence of nominated candidate pairs in - * the valid list and on the state of the check list: - * - * o If there are no nominated pairs in the valid list for a media - * stream and the state of the check list is Running, ICE processing - * continues. - * - * o If there is at least one nominated pair in the valid list: - * - * - The agent MUST remove all Waiting and Frozen pairs in the check - * list for the same component as the nominated pairs for that - * media stream - * - * - If an In-Progress pair in the check list is for the same - * component as a nominated pair, the agent SHOULD cease - * retransmissions for its check if its pair priority is lower - * than the lowest priority nominated pair for that component - */ - if (check->err_code==PJ_SUCCESS && check->nominated) { - - for (i=0; iclist.count; ++i) { - - pj_ice_sess_check *c = &ice->clist.checks[i]; - - if (c->lcand->comp_id == check->lcand->comp_id) { - - if (c->state < PJ_ICE_SESS_CHECK_STATE_IN_PROGRESS) { - - /* Just fail Frozen/Waiting check */ - LOG5((ice->obj_name, - "Check %s to be failed because state is %s", - dump_check(ice->tmp.txt, sizeof(ice->tmp.txt), - &ice->clist, c), - check_state_name[c->state])); - check_set_state(ice, c, PJ_ICE_SESS_CHECK_STATE_FAILED, - PJ_ECANCELLED); - - } else if (c->state == PJ_ICE_SESS_CHECK_STATE_IN_PROGRESS - && (PJ_ICE_CANCEL_ALL || - CMP_CHECK_PRIO(c, check) < 0)) { - - /* State is IN_PROGRESS, cancel transaction */ - if (c->tdata) { - LOG5((ice->obj_name, - "Cancelling check %s (In Progress)", - dump_check(ice->tmp.txt, sizeof(ice->tmp.txt), - &ice->clist, c))); - pj_stun_session_cancel_req(comp->stun_sess, - c->tdata, PJ_FALSE, 0); - c->tdata = NULL; - check_set_state(ice, c, PJ_ICE_SESS_CHECK_STATE_FAILED, - PJ_ECANCELLED); - } - } - } - } - } - + pj_bool_t no_pending_check = PJ_FALSE; /* Still in 8.2. Updating States * @@ -1479,14 +1497,17 @@ * See if all checks in the checklist have completed. If we do, * then mark ICE processing as failed. */ - for (i=0; iclist.count; ++i) { - pj_ice_sess_check *c = &ice->clist.checks[i]; - if (c->state < PJ_ICE_SESS_CHECK_STATE_SUCCEEDED) { - break; + if (!ice->is_trickling) { + for (i=0; iclist.count; ++i) { + pj_ice_sess_check *c = &ice->clist.checks[i]; + if (c->state < PJ_ICE_SESS_CHECK_STATE_SUCCEEDED) { + break; + } } + no_pending_check = (i == ice->clist.count); } - if (i == ice->clist.count) { + if (no_pending_check) { /* All checks have completed, but we don't have nominated pair. * If agent's role is controlled, check if all components have * valid pair. If it does, this means the controlled agent has @@ -1571,52 +1592,500 @@ } } - /* If this connectivity check has been successful, scan all components - * and see if they have a valid pair, if we are controlling and we haven't - * started our nominated check yet. + /* If this connectivity check has been successful, scan all components + * and see if they have a valid pair, if we are controlling and we haven't + * started our nominated check yet. + */ + /* Always scan regardless the last connectivity check result */ + if (/*check->err_code == PJ_SUCCESS && */ + ice->role==PJ_ICE_SESS_ROLE_CONTROLLING && + !ice->is_nominating && + ice->timer.id == TIMER_NONE) + { + pj_time_val delay; + + for (i=0; icomp_cnt; ++i) { + if (ice->comp[i].valid_check == NULL) + break; + } + + if (i < ice->comp_cnt) { + /* Some components still don't have valid pair, continue + * processing. + */ + return PJ_FALSE; + } + + LOG4((ice->obj_name, + "Scheduling nominated check in %d ms", + ice->opt.nominated_check_delay)); + + pj_timer_heap_cancel_if_active(ice->stun_cfg.timer_heap, &ice->timer, + TIMER_NONE); + + /* All components have valid pair. Let connectivity checks run for + * a little bit more time, then start our nominated check. + */ + delay.sec = 0; + delay.msec = ice->opt.nominated_check_delay; + pj_time_val_normalize(&delay); + + pj_timer_heap_schedule_w_grp_lock(ice->stun_cfg.timer_heap, + &ice->timer, &delay, + TIMER_START_NOMINATED_CHECK, + ice->grp_lock); + return PJ_FALSE; + } + + /* We still have checks to perform */ + return PJ_FALSE; +} + +/* This function is called when one check completes */ +static pj_bool_t on_check_complete(pj_ice_sess *ice, + pj_ice_sess_check *check) +{ + pj_ice_sess_comp *comp; + unsigned i; + + pj_assert(check->state >= PJ_ICE_SESS_CHECK_STATE_SUCCEEDED); + + comp = find_comp(ice, check->lcand->comp_id); + + /* 7.1.2.2.2. Updating Pair States + * + * The agent sets the state of the pair that generated the check to + * Succeeded. The success of this check might also cause the state of + * other checks to change as well. The agent MUST perform the following + * two steps: + * + * 1. The agent changes the states for all other Frozen pairs for the + * same media stream and same foundation to Waiting. Typically + * these other pairs will have different component IDs but not + * always. + */ + if (check->err_code==PJ_SUCCESS) { + + for (i=0; iclist.count; ++i) { + pj_ice_sess_check *c = &ice->clist.checks[i]; + if (c->foundation_idx == check->foundation_idx && + c->state == PJ_ICE_SESS_CHECK_STATE_FROZEN) + { + check_set_state(ice, c, PJ_ICE_SESS_CHECK_STATE_WAITING, 0); + } + } + + LOG5((ice->obj_name, "Check %d is successful%s", + GET_CHECK_ID(&ice->clist, check), + (check->nominated ? " and nominated" : ""))); + + /* On the first valid pair, we call the callback, if present */ + if (ice->valid_pair_found == PJ_FALSE) { + ice->valid_pair_found = PJ_TRUE; + + if (ice->cb.on_valid_pair) { + (*ice->cb.on_valid_pair)(ice); + } + } + } + + /* 8.2. Updating States + * + * For both controlling and controlled agents, the state of ICE + * processing depends on the presence of nominated candidate pairs in + * the valid list and on the state of the check list: + * + * o If there are no nominated pairs in the valid list for a media + * stream and the state of the check list is Running, ICE processing + * continues. + * + * o If there is at least one nominated pair in the valid list: + * + * - The agent MUST remove all Waiting and Frozen pairs in the check + * list for the same component as the nominated pairs for that + * media stream + * + * - If an In-Progress pair in the check list is for the same + * component as a nominated pair, the agent SHOULD cease + * retransmissions for its check if its pair priority is lower + * than the lowest priority nominated pair for that component + */ + if (check->err_code==PJ_SUCCESS && check->nominated) { + + for (i=0; iclist.count; ++i) { + + pj_ice_sess_check *c = &ice->clist.checks[i]; + + if (c->lcand->comp_id == check->lcand->comp_id) { + + if (c->state < PJ_ICE_SESS_CHECK_STATE_IN_PROGRESS) { + + /* Just fail Frozen/Waiting check */ + LOG5((ice->obj_name, + "Check %s to be failed because state is %s", + dump_check(ice->tmp.txt, sizeof(ice->tmp.txt), + &ice->clist, c), + check_state_name[c->state])); + check_set_state(ice, c, PJ_ICE_SESS_CHECK_STATE_FAILED, + PJ_ECANCELLED); + + } else if (c->state == PJ_ICE_SESS_CHECK_STATE_IN_PROGRESS + && (PJ_ICE_CANCEL_ALL || + CMP_CHECK_PRIO(c, check) < 0)) { + + /* State is IN_PROGRESS, cancel transaction */ + if (c->tdata) { + LOG5((ice->obj_name, + "Cancelling check %s (In Progress)", + dump_check(ice->tmp.txt, sizeof(ice->tmp.txt), + &ice->clist, c))); + pj_stun_session_cancel_req(comp->stun_sess, + c->tdata, PJ_FALSE, 0); + c->tdata = NULL; + check_set_state(ice, c, PJ_ICE_SESS_CHECK_STATE_FAILED, + PJ_ECANCELLED); + } + } + } + } + } + + return check_ice_complete(ice); +} + + +/* Get foundation index of a check pair. This function can also be used for + * adding a new foundation (combination of local & remote cands foundations) + * to checklist. + */ +static int get_check_foundation_idx(pj_ice_sess *ice, + const pj_ice_sess_cand *lcand, + const pj_ice_sess_cand *rcand, + pj_bool_t add_if_not_found) +{ + pj_ice_sess_checklist *clist = &ice->clist; + char fnd_str[65]; + unsigned i; + + pj_ansi_snprintf(fnd_str, sizeof(fnd_str), "%.*s|%.*s", + (int)lcand->foundation.slen, lcand->foundation.ptr, + (int)rcand->foundation.slen, rcand->foundation.ptr); + for (i=0; ifoundation_cnt; ++i) { + if (pj_strcmp2(&clist->foundation[i], fnd_str) == 0) + return i; + } + + if (add_if_not_found && clist->foundation_cnt < PJ_ICE_MAX_CHECKS) { + pj_strdup2(ice->pool, &clist->foundation[i], fnd_str); + ++clist->foundation_cnt; + return i; + } + + return -1; +} + +/* Discard a pair check with Failed state or lowest prio (as long as lower + * than prio_lower_than. + */ +static int discard_check(pj_ice_sess *ice, pj_ice_sess_checklist *clist, + const pj_timestamp *prio_lower_than) +{ + /* Discard any Failed check */ + unsigned k; + for (k=0; k < clist->count; ++k) { + if (clist->checks[k].state==PJ_ICE_SESS_CHECK_STATE_FAILED) { + remove_check(ice, clist, k, "too many, drop Failed"); + return 1; + } + } + + /* If none, discard the lowest prio */ + /* Re-sort before discarding the last */ + sort_checklist(ice, clist); + if (!prio_lower_than || + pj_cmp_timestamp(&clist->checks[k-1].prio, prio_lower_than) < 0) + { + remove_check(ice, clist, k-1, "too many, drop low-prio"); + return 1; + } + + return 0; +} + + +/* Timer callback for end of candidate indication from remote */ +static void end_of_cand_ind_timer(pj_timer_heap_t *th, + pj_timer_entry *te) +{ + pj_ice_sess *ice = (pj_ice_sess*)te->user_data; + PJ_UNUSED_ARG(th); + + pj_grp_lock_acquire(ice->grp_lock); + + if (ice->is_trickling && !ice->is_complete) { + LOG5((ice->obj_name, "End-of-candidate timer timeout, any future " + "remote candidate update will be ignored")); + ice->is_trickling = PJ_FALSE; + + /* ICE checks may have been completed/failed */ + check_ice_complete(ice); + } + + pj_grp_lock_release(ice->grp_lock); +} + + +/* Add remote candidates and create/update checklist */ +static pj_status_t add_rcand_and_update_checklist( + pj_ice_sess *ice, + unsigned rem_cand_cnt, + const pj_ice_sess_cand rem_cand[], + pj_bool_t trickle_done) +{ + pj_ice_sess_checklist *clist; + unsigned i, j, new_pair = 0; + pj_status_t status; + + /* Save remote candidates */ + for (i=0; ircand[ice->rcand_cnt]; + + /* Check component ID */ + if (rem_cand[i].comp_id==0 || rem_cand[i].comp_id > ice->comp_cnt) + { + continue; + } + + if (ice->opt.trickle != PJ_ICE_SESS_TRICKLE_DISABLED) { + /* Trickle ICE: + * Make sure that candidate has not been added + */ + for (j=0; jrcand_cnt; ++j) { + const pj_ice_sess_cand *c1 = &rem_cand[i]; + const pj_ice_sess_cand *c2 = &ice->rcand[j]; + if (c1->comp_id==c2->comp_id && c1->type==c2->type && + pj_sockaddr_cmp(&c1->addr, &c2->addr)==0) + { + break; + } + } + + /* Skip candidate, it has been added */ + if (j < ice->rcand_cnt) + continue; + } + + /* Available cand slot? */ + if (ice->rcand_cnt >= PJ_ICE_MAX_CAND) { + char tmp[PJ_INET6_ADDRSTRLEN + 10]; + PJ_PERROR(3,(ice->obj_name, PJ_ETOOMANY, + "Cannot add remote candidate %s", + pj_sockaddr_print(&rem_cand[i].addr, + tmp, sizeof(tmp), 3))); + continue; + } + + /* Add this candidate */ + pj_memcpy(cn, &rem_cand[i], sizeof(pj_ice_sess_cand)); + pj_strdup(ice->pool, &cn->foundation, &rem_cand[i].foundation); + cn->id = ice->rcand_cnt++; + } + + /* Generate checklist */ + clist = &ice->clist; + for (i=0; ilcand_cnt; ++i) { + /* First index of remote cand to be paired with this local cand */ + unsigned rstart = (i >= ice->lcand_paired)? 0 : ice->rcand_paired; + for (j=rstart; jrcand_cnt; ++j) { + + pj_ice_sess_cand *lcand = &ice->lcand[i]; + pj_ice_sess_cand *rcand = &ice->rcand[j]; + pj_ice_sess_check *chk = NULL; + + if (clist->count >= PJ_ICE_MAX_CHECKS) { + // Instead of returning PJ_ETOOMANY, discard Failed/low-prio. + // If this check is actually the lowest prio, just skip it. + //return PJ_ETOOMANY; + pj_timestamp max_prio = CALC_CHECK_PRIO(ice, lcand, rcand); + if (discard_check(ice, clist, &max_prio) == 0) + continue; + } + + /* A local candidate is paired with a remote candidate if + * and only if the two candidates have the same component ID + * and have the same IP address version. + */ + if ((lcand->comp_id != rcand->comp_id) || + (lcand->addr.addr.sa_family != rcand->addr.addr.sa_family)) + { + continue; + } + +#if 0 + /* Trickle ICE: + * Make sure that pair has not been added to checklist + */ + // Should not happen, paired cands are already marked using + // lcand_paired & rcand_paired. + if (ice->opt.trickle != PJ_ICE_SESS_TRICKLE_DISABLED) { + unsigned k; + for (k=0; kcount; ++k) { + chk = &clist->checks[k]; + if (chk->lcand == lcand && chk->rcand == rcand) + break; + } + + /* Pair already exists */ + if (k < clist->count) + continue; + } +#endif + + + /* Add the pair */ + chk = &clist->checks[clist->count]; + chk->lcand = lcand; + chk->rcand = rcand; + chk->prio = CALC_CHECK_PRIO(ice, lcand, rcand); + chk->state = PJ_ICE_SESS_CHECK_STATE_FROZEN; + chk->foundation_idx = get_check_foundation_idx(ice, lcand, rcand, + PJ_TRUE); + + /* Check if foundation cannot be added (e.g: list is full) */ + if (chk->foundation_idx < 0) + continue; + + /* Check if the check can be unfrozen */ + if (ice->is_trickling) { + unsigned k; + + /* For this foundation, unfreeze if this pair has the lowest + * comp ID, or the highest priority among existing pairs with + * same comp ID, or any other checks in Succeeded. + */ + for (k=0; kcount; ++k) { + if (clist->checks[k].foundation_idx != chk->foundation_idx) + continue; + + /* Unfreeze if there is already check in Succeeded */ + if (clist->checks[k].state==PJ_ICE_SESS_CHECK_STATE_SUCCEEDED) + { + k = clist->count; + break; + } + + /* Don't unfreeze if there is already check in Waiting or + * In Progress. + */ + if (clist->checks[k].state==PJ_ICE_SESS_CHECK_STATE_WAITING || + clist->checks[k].state==PJ_ICE_SESS_CHECK_STATE_IN_PROGRESS) + { + break; + } + + /* Don't unfreeze if this pair does not have the lowest + * comp ID. + */ + if (clist->checks[k].lcand->comp_id < lcand->comp_id) + break; + + /* Don't unfreeze if this pair has the lowest comp ID, but + * does not have the highest prio. + */ + if (clist->checks[k].lcand->comp_id == lcand->comp_id && + pj_cmp_timestamp(&clist->checks[k].prio, &chk->prio) > 0) + { + break; + } + } + + /* Unfreeze */ + if (k == clist->count) + check_set_state(ice, chk, PJ_ICE_SESS_CHECK_STATE_WAITING, 0); + } + + clist->count++; + new_pair++; + } + } + + /* This could happen if candidates have no matching address families */ + if (clist->count==0 && trickle_done) { + LOG4((ice->obj_name, "Error: no checklist can be created")); + return PJ_ENOTFOUND; + } + + /* Update paired candidate counts */ + ice->lcand_paired = ice->lcand_cnt; + ice->rcand_paired = ice->rcand_cnt; + + if (new_pair) { + /* Sort checklist based on priority */ + //dump_checklist("Checklist before sort:", ice, &ice->clist); + sort_checklist(ice, clist); + + /* Prune the checklist */ + //dump_checklist("Checklist before prune:", ice, &ice->clist); + status = prune_checklist(ice, clist); + if (status != PJ_SUCCESS) + return status; + } + + /* Regular ICE or trickle ICE after end-of-candidates indication: + * Disable our components which don't have matching component */ - if (check->err_code == PJ_SUCCESS && - ice->role==PJ_ICE_SESS_ROLE_CONTROLLING && - !ice->is_nominating && - ice->timer.id == TIMER_NONE) - { - pj_time_val delay; + if (trickle_done) { + unsigned highest_comp = 0; - for (i=0; icomp_cnt; ++i) { - if (ice->comp[i].valid_check == NULL) - break; + for (i=0; ircand_cnt; ++i) { + if (ice->rcand[i].comp_id > highest_comp) + highest_comp = ice->rcand[i].comp_id; } - if (i < ice->comp_cnt) { - /* Some components still don't have valid pair, continue - * processing. - */ - return PJ_FALSE; + for (i=highest_comp; icomp_cnt; ++i) { + if (ice->comp[i].stun_sess) { + pj_stun_session_destroy(ice->comp[i].stun_sess); + pj_bzero(&ice->comp[i], sizeof(ice->comp[i])); + } } + ice->comp_cnt = highest_comp; - LOG4((ice->obj_name, - "Scheduling nominated check in %d ms", - ice->opt.nominated_check_delay)); - - pj_timer_heap_cancel_if_active(ice->stun_cfg.timer_heap, &ice->timer, - TIMER_NONE); - - /* All components have valid pair. Let connectivity checks run for - * a little bit more time, then start our nominated check. + /* If using trickle ICE and end-of-candidate has been signalled, + * check for ICE nego completion. */ - delay.sec = 0; - delay.msec = ice->opt.nominated_check_delay; - pj_time_val_normalize(&delay); + if (ice->opt.trickle != PJ_ICE_SESS_TRICKLE_DISABLED) + check_ice_complete(ice); + } - pj_timer_heap_schedule_w_grp_lock(ice->stun_cfg.timer_heap, - &ice->timer, &delay, - TIMER_START_NOMINATED_CHECK, - ice->grp_lock); - return PJ_FALSE; + /* For trickle ICE: resume the periodic check, it may be halted when + * there is no available check pair. + */ + if (ice->opt.trickle != PJ_ICE_SESS_TRICKLE_DISABLED && + clist->count > 0 && !ice->is_complete && + clist->state == PJ_ICE_SESS_CHECKLIST_ST_RUNNING) + { + if (!pj_timer_entry_running(&clist->timer)) { + pj_time_val delay = {0, 0}; + status = pj_timer_heap_schedule_w_grp_lock( + ice->stun_cfg.timer_heap, + &clist->timer, &delay, + PJ_TRUE, + ice->grp_lock); + if (status == PJ_SUCCESS) { + LOG5((ice->obj_name, + "Trickle ICE resumes periodic check because " + "check pair is available")); + } + } } - /* We still have checks to perform */ - return PJ_FALSE; + /* Stop the end-of-candidates indication timer if trickling is done */ + if (trickle_done && pj_timer_entry_running(&ice->timer_end_of_cand)) { + pj_timer_heap_cancel_if_active(ice->stun_cfg.timer_heap, + &ice->timer_end_of_cand, 0); + } + + return PJ_SUCCESS; } @@ -1632,133 +2101,128 @@ char buf[128]; pj_str_t username; timer_data *td; - unsigned i, j; - unsigned highest_comp = 0; pj_status_t status; - PJ_ASSERT_RETURN(ice && rem_ufrag && rem_passwd && rem_cand_cnt && - rem_cand, PJ_EINVAL); - PJ_ASSERT_RETURN(rem_cand_cnt + ice->rcand_cnt <= PJ_ICE_MAX_CAND, - PJ_ETOOMANY); + PJ_ASSERT_RETURN(ice && rem_ufrag && rem_passwd, PJ_EINVAL); pj_grp_lock_acquire(ice->grp_lock); + if (ice->tx_ufrag.slen) { + /* Checklist has been created */ + pj_grp_lock_release(ice->grp_lock); + return PJ_SUCCESS; + } + /* Save credentials */ username.ptr = buf; pj_strcpy(&username, rem_ufrag); pj_strcat2(&username, ":"); pj_strcat(&username, &ice->rx_ufrag); - pj_strdup(ice->pool, &ice->tx_uname, &username); + pj_strdup(ice->pool, &ice->tx_ufrag, rem_ufrag); pj_strdup(ice->pool, &ice->tx_pass, rem_passwd); pj_strcpy(&username, &ice->rx_ufrag); pj_strcat2(&username, ":"); pj_strcat(&username, rem_ufrag); - pj_strdup(ice->pool, &ice->rx_uname, &username); + /* Init timer entry in the checklist. Initially the timer ID is FALSE + * because timer is not running. + */ + clist = &ice->clist; + clist->timer.id = PJ_FALSE; + td = PJ_POOL_ZALLOC_T(ice->pool, timer_data); + td->ice = ice; + td->clist = clist; + clist->timer.user_data = (void*)td; + clist->timer.cb = &periodic_timer; - /* Save remote candidates */ - ice->rcand_cnt = 0; - for (i=0; ircand[ice->rcand_cnt]; + ice->clist.count = 0; + ice->lcand_paired = ice->rcand_paired = 0; - /* Ignore candidate which has no matching component ID */ - if (rem_cand[i].comp_id==0 || rem_cand[i].comp_id > ice->comp_cnt) { - continue; + /* Build checklist only if both sides have candidates already */ + if (ice->lcand_cnt > 0 && rem_cand_cnt > 0) { + status = add_rcand_and_update_checklist(ice, rem_cand_cnt, rem_cand, + !ice->is_trickling); + if (status != PJ_SUCCESS) { + pj_grp_lock_release(ice->grp_lock); + return status; } - if (rem_cand[i].comp_id > highest_comp) - highest_comp = rem_cand[i].comp_id; - - pj_memcpy(cn, &rem_cand[i], sizeof(pj_ice_sess_cand)); - pj_strdup(ice->pool, &cn->foundation, &rem_cand[i].foundation); - ice->rcand_cnt++; + /* Log checklist */ + dump_checklist("Checklist created:", ice, clist); } - /* Generate checklist */ - clist = &ice->clist; - for (i=0; ilcand_cnt; ++i) { - for (j=0; jrcand_cnt; ++j) { - - pj_ice_sess_cand *lcand = &ice->lcand[i]; - pj_ice_sess_cand *rcand = &ice->rcand[j]; - pj_ice_sess_check *chk = NULL; - - if (clist->count >= PJ_ICE_MAX_CHECKS) { - pj_grp_lock_release(ice->grp_lock); - return PJ_ETOOMANY; - } - - chk = &clist->checks[clist->count]; + pj_grp_lock_release(ice->grp_lock); - /* A local candidate is paired with a remote candidate if - * and only if the two candidates have the same component ID - * and have the same IP address version. - */ - if ((lcand->comp_id != rcand->comp_id) || - (lcand->addr.addr.sa_family != rcand->addr.addr.sa_family)) - { - continue; - } + return PJ_SUCCESS; +} - chk->lcand = lcand; - chk->rcand = rcand; - chk->state = PJ_ICE_SESS_CHECK_STATE_FROZEN; +/* Update checklist by pairing local candidates with remote candidates */ +PJ_DEF(pj_status_t) pj_ice_sess_update_check_list( + pj_ice_sess *ice, + const pj_str_t *rem_ufrag, + const pj_str_t *rem_passwd, + unsigned rem_cand_cnt, + const pj_ice_sess_cand rem_cand[], + pj_bool_t trickle_done) +{ + pj_status_t status = PJ_SUCCESS; - chk->prio = CALC_CHECK_PRIO(ice, lcand, rcand); + PJ_ASSERT_RETURN(ice && ((rem_cand_cnt==0) || + (rem_ufrag && rem_passwd && rem_cand)), + PJ_EINVAL); - clist->count++; - } - } + pj_grp_lock_acquire(ice->grp_lock); - /* This could happen if candidates have no matching address families */ - if (clist->count == 0) { - LOG4((ice->obj_name, "Error: no checklist can be created")); + /* Ignore if remote ufrag has not known yet */ + if (ice->tx_ufrag.slen == 0) { + LOG5((ice->obj_name, + "Cannot update ICE checklist when remote ufrag is unknown")); pj_grp_lock_release(ice->grp_lock); - return PJ_ENOTFOUND; + return PJ_EINVALIDOP; } - /* Sort checklist based on priority */ - sort_checklist(ice, clist); - - /* Prune the checklist */ - status = prune_checklist(ice, clist); - if (status != PJ_SUCCESS) { + /* Ignore if trickle has been stopped (e.g: received end-of-candidate) */ + if (!ice->is_trickling && rem_cand_cnt) { + LOG5((ice->obj_name, + "Ignored remote candidate update as ICE trickling has ended")); pj_grp_lock_release(ice->grp_lock); - return status; + return PJ_SUCCESS; } - - /* Disable our components which don't have matching component */ - for (i=highest_comp; icomp_cnt; ++i) { - if (ice->comp[i].stun_sess) { - pj_stun_session_destroy(ice->comp[i].stun_sess); - pj_bzero(&ice->comp[i], sizeof(ice->comp[i])); - } + + /* Verify remote ufrag & passwd, if remote candidate specified */ + if (rem_cand_cnt && (pj_strcmp(&ice->tx_ufrag, rem_ufrag) || + pj_strcmp(&ice->tx_pass, rem_passwd))) + { + LOG5((ice->obj_name, "Ignored remote candidate update due to remote " + "ufrag/pwd mismatch")); + rem_cand_cnt = 0; } - ice->comp_cnt = highest_comp; - - /* Init timer entry in the checklist. Initially the timer ID is FALSE - * because timer is not running. - */ - clist->timer.id = PJ_FALSE; - td = PJ_POOL_ZALLOC_T(ice->pool, timer_data); - td->ice = ice; - td->clist = clist; - clist->timer.user_data = (void*)td; - clist->timer.cb = &periodic_timer; + if (status == PJ_SUCCESS) { + status = add_rcand_and_update_checklist(ice, rem_cand_cnt, rem_cand, + trickle_done); + } /* Log checklist */ - dump_checklist("Checklist created:", ice, clist); + if (status == PJ_SUCCESS) + dump_checklist("Checklist updated:", ice, &ice->clist); + + if (trickle_done && ice->is_trickling) { + LOG5((ice->obj_name, "Remote signalled end-of-candidates " + "and local candidates gathering completed, " + "will ignore any candidate update")); + ice->is_trickling = PJ_FALSE; + } pj_grp_lock_release(ice->grp_lock); - return PJ_SUCCESS; + return status; } /* Perform check on the specified candidate pair. */ @@ -1804,13 +2268,16 @@ msg_data->data.req.ice = ice; msg_data->data.req.clist = clist; msg_data->data.req.ckid = check_id; + msg_data->data.req.lcand = check->lcand; + msg_data->data.req.rcand = check->rcand; /* Add PRIORITY */ #if PJNATH_ICE_PRIO_STD - prio = CALC_CAND_PRIO(ice, PJ_ICE_CAND_TYPE_PRFLX, 65535, + prio = CALC_CAND_PRIO(ice, PJ_ICE_CAND_TYPE_PRFLX, 65535 - lcand->id, lcand->comp_id); #else - prio = CALC_CAND_PRIO(ice, PJ_ICE_CAND_TYPE_PRFLX, 0, + prio = CALC_CAND_PRIO(ice, PJ_ICE_CAND_TYPE_PRFLX, + ((1 << PJ_ICE_LOCAL_PREF_BITS) - 1) - lcand->id, lcand->comp_id); #endif pj_stun_msg_add_uint_attr(check->tdata->pool, check->tdata->msg, @@ -1932,10 +2399,11 @@ } } - /* Cannot start check because there's no suitable candidate pair. + /* Schedule next check for next candidate pair, unless there is no + * suitable candidate pair (all pairs have been checked or empty + * checklist). */ if (start_count!=0) { - /* Schedule for next timer */ pj_time_val timeout = {0, PJ_ICE_TA_VAL}; pj_time_val_normalize(&timeout); @@ -1961,6 +2429,12 @@ pj_assert(ice->is_nominating == PJ_FALSE); + /* Stop trickling if not yet */ + if (ice->is_trickling) { + ice->is_trickling = PJ_FALSE; + LOG5((ice->obj_name, "Trickling stopped as nomination started.")); + } + /* Stop our timer if it's active */ if (ice->timer.id == TIMER_START_NOMINATED_CHECK) { pj_timer_heap_cancel_if_active(ice->stun_cfg.timer_heap, &ice->timer, @@ -2016,19 +2490,6 @@ } -/* Utility: find string in string array */ -static const pj_str_t *find_str(const pj_str_t *strlist[], unsigned count, - const pj_str_t *str) -{ - unsigned i; - for (i=0; iclist.count > 0, PJ_EINVALIDOP); + if (ice->clist.count == 0 && !ice->is_trickling) + return PJ_EINVALIDOP; /* Lock session */ pj_grp_lock_acquire(ice->grp_lock); @@ -2072,48 +2531,42 @@ */ clist = &ice->clist; + for (i=0; i < clist->foundation_cnt; ++i) { + unsigned k; + pj_ice_sess_check *chk = NULL; + + for (k=0; k < clist->count; ++k) { + pj_ice_sess_check *c = &clist->checks[k]; + if (c->foundation_idx != (int)i || + c->state != PJ_ICE_SESS_CHECK_STATE_FROZEN) + { + continue; + } - /* Pickup the first pair for component 1. */ - for (i=0; icount; ++i) { - if (clist->checks[i].lcand->comp_id == 1) - break; - } - if (i == clist->count) { - pj_assert(!"Unable to find checklist for component 1"); - pj_grp_lock_release(ice->grp_lock); - pj_log_pop_indent(); - return PJNATH_EICEINCOMPID; - } - - /* Set this check to WAITING only if state is frozen. It may be possible - * that this check has already been started by a trigger check - */ - if (clist->checks[i].state == PJ_ICE_SESS_CHECK_STATE_FROZEN) { - check_set_state(ice, &clist->checks[i], - PJ_ICE_SESS_CHECK_STATE_WAITING, PJ_SUCCESS); - } - - cand0 = clist->checks[i].lcand; - flist[flist_cnt++] = &clist->checks[i].lcand->foundation; - - /* Find all of the other pairs in that check list with the same - * component ID, but different foundations, and sets all of their - * states to Waiting as well. - */ - for (++i; icount; ++i) { - const pj_ice_sess_cand *cand1; + /* First pair of this foundation */ + if (chk == NULL) { + chk = c; + continue; + } - cand1 = clist->checks[i].lcand; + /* Found the lowest comp ID so far */ + if (c->lcand->comp_id < chk->lcand->comp_id) { + chk = c; + continue; + } - if (cand1->comp_id==cand0->comp_id && - find_str(flist, flist_cnt, &cand1->foundation)==NULL) - { - if (clist->checks[i].state == PJ_ICE_SESS_CHECK_STATE_FROZEN) { - check_set_state(ice, &clist->checks[i], - PJ_ICE_SESS_CHECK_STATE_WAITING, PJ_SUCCESS); + /* Found the lowest comp ID and the highest prio so far */ + if (c->lcand->comp_id == chk->lcand->comp_id && + pj_cmp_timestamp(&c->prio, &chk->prio) > 0) + { + chk = c; + continue; } - flist[flist_cnt++] = &cand1->foundation; } + + /* Unfreeze */ + if (chk) + check_set_state(ice, chk, PJ_ICE_SESS_CHECK_STATE_WAITING, 0); } /* First, perform all pending triggered checks, simultaneously. */ @@ -2134,12 +2587,30 @@ * instead to reduce stack usage: * return start_periodic_check(ice->stun_cfg.timer_heap, &clist->timer); */ - delay.sec = delay.msec = 0; - status = pj_timer_heap_schedule_w_grp_lock(ice->stun_cfg.timer_heap, - &clist->timer, &delay, - PJ_TRUE, ice->grp_lock); - if (status != PJ_SUCCESS) { - clist->timer.id = PJ_FALSE; + if (!pj_timer_entry_running(&clist->timer)) { + pj_time_val delay = {0, 0}; + status = pj_timer_heap_schedule_w_grp_lock(ice->stun_cfg.timer_heap, + &clist->timer, &delay, + PJ_TRUE, ice->grp_lock); + } + + /* For trickle ICE, start timer for end-of-candidates indication from + * remote. + */ + if (ice->is_trickling && !pj_timer_entry_running(&ice->timer_end_of_cand)) + { + pj_time_val delay = {PJ_TRICKLE_ICE_END_OF_CAND_TIMEOUT, 0}; + pj_timer_entry_init(&ice->timer_end_of_cand, 0, ice, + &end_of_cand_ind_timer); + status = pj_timer_heap_schedule_w_grp_lock( + ice->stun_cfg.timer_heap, + &ice->timer_end_of_cand, + &delay, PJ_TRUE, + ice->grp_lock); + if (status != PJ_SUCCESS) { + LOG4((ice->obj_name, + "Failed to schedule end-of-candidate indication timer")); + } } pj_grp_lock_release(ice->grp_lock); @@ -2198,7 +2669,7 @@ pj_ice_sess_checklist *clist; pj_stun_xor_mapped_addr_attr *xaddr; const pj_sockaddr_t *source_addr = src_addr; - unsigned i; + unsigned i, ckid; PJ_UNUSED_ARG(stun_sess); PJ_UNUSED_ARG(src_addr_len); @@ -2207,12 +2678,8 @@ ice = msg_data->data.req.ice; clist = msg_data->data.req.clist; - check = &clist->checks[msg_data->data.req.ckid]; - - - /* Mark STUN transaction as complete */ - pj_assert(tdata == check->tdata); - check->tdata = NULL; + ckid = msg_data->data.req.ckid; + check = &clist->checks[ckid]; pj_grp_lock_acquire(ice->grp_lock); @@ -2222,6 +2689,31 @@ return; } + /* Verify check (check ID may change as trickle ICE re-sort the list */ + if (tdata != check->tdata) { + /* Okay, it was re-sorted, lookup using lcand & rcand */ + for (i = 0; i < clist->count; ++i) { + if (clist->checks[i].lcand == msg_data->data.req.lcand && + clist->checks[i].rcand == msg_data->data.req.rcand) + { + check = &clist->checks[i]; + ckid = i; + break; + } + } + if (i == clist->count) { + /* The check may have been pruned (due to low prio) */ + check->tdata = NULL; + pj_grp_lock_release(ice->grp_lock); + return; + } + } + + /* Mark STUN transaction as complete */ + // Find 'corner case ...'. + //pj_assert(tdata == check->tdata); + check->tdata = NULL; + /* Init lcand to NULL. lcand will be found from the mapped address * found in the response. */ @@ -2268,7 +2760,7 @@ LOG4((ice->obj_name, "Resending check because of role conflict")); pj_log_push_indent(); check_set_state(ice, check, PJ_ICE_SESS_CHECK_STATE_WAITING, 0); - perform_check(ice, clist, msg_data->data.req.ckid, + perform_check(ice, clist, ckid, check->nominated || ice->is_nominating); pj_log_pop_indent(); pj_grp_lock_release(ice->grp_lock); @@ -2377,6 +2869,54 @@ { /* Match */ lcand = &ice->lcand[i]; + +#if 0 + // The following code tries to verify if the STUN request belongs + // to the correct ICE check (so if it doesn't, it will set current + // ICE check state to FAILED (why?) and try to find the correct + // check). However, ICE check verification has been added in + // the beginning of this function, so the following block should + // not be needed anymore. + + /* Verify lcand==check->lcand, this may happen when a STUN socket + * corresponds to multiple host candidates. + */ + if (lcand != check->lcand) { + unsigned j; + + pj_log_push_indent(); + LOG4((ice->obj_name, + "Check %s%s: local candidate mismatch", + dump_check(ice->tmp.txt, sizeof(ice->tmp.txt), + &ice->clist, check), + (check->nominated ? " (nominated)" : " (not nominated)"))); + + + /* Local candidate does not belong to this check! Set current + * check state to Failed. + */ + check_set_state(ice, check, PJ_ICE_SESS_CHECK_STATE_FAILED, + PJNATH_ESTUNNOMAPPEDADDR); + + /* Find the matching check */ + for (j = 0; j < clist->count; ++j) { + if (clist->checks[j].lcand == lcand && + clist->checks[j].rcand == check->rcand) + { + check = &clist->checks[j]; + break; + } + } + if (j == clist->count) { + on_check_complete(ice, check); + pj_log_pop_indent(); + pj_grp_lock_release(ice->grp_lock); + return; + } + + pj_log_pop_indent(); + } +#endif break; } } @@ -2406,7 +2946,13 @@ status = pj_ice_sess_add_cand(ice, check->lcand->comp_id, msg_data->transport_id, PJ_ICE_CAND_TYPE_PRFLX, - 65535, &foundation, +#if PJNATH_ICE_PRIO_STD + 65535 - (pj_uint16_t)ice->lcand_cnt, +#else + ((1 << PJ_ICE_LOCAL_PREF_BITS) - 1) - + ice->lcand_cnt, +#endif + &foundation, &xaddr->sockaddr, &check->lcand->base_addr, &check->lcand->base_addr, @@ -2422,7 +2968,6 @@ /* Update local candidate */ lcand = &ice->lcand[cand_id]; - } /* 7.1.2.2.3. Constructing a Valid Pair @@ -2560,11 +3105,11 @@ pj_stun_msg_find_attr(msg, PJ_STUN_ATTR_ICE_CONTROLLED, 0); } - /* Handle the case when request comes before answer is received. + /* Handle the case when request comes before SDP answer is received. * We need to put credential in the response, and since we haven't - * got the response, copy the username from the request. + * got the SDP answer, copy the username from the request. */ - if (ice->rcand_cnt == 0) { + if (ice->tx_ufrag.slen == 0) { pj_stun_string_attr *uname_attr; uname_attr = (pj_stun_string_attr*) @@ -2685,7 +3230,7 @@ * don't have checklist yet, so just save this check in a pending * triggered check array to be acted upon later. */ - if (ice->rcand_cnt == 0) { + if (ice->tx_ufrag.slen == 0) { rcheck = PJ_POOL_ZALLOC_T(ice->pool, pj_ice_rx_check); } else { rcheck = &tmp_rcheck; @@ -2700,7 +3245,7 @@ rcheck->priority = prio_attr->value; rcheck->role_attr = role_attr; - if (ice->rcand_cnt == 0) { + if (ice->tx_ufrag.slen == 0) { /* We don't have answer yet, so keep this request for later */ LOG4((ice->obj_name, "Received an early check for comp %d", rcheck->comp_id)); @@ -2853,14 +3398,22 @@ if (c->state == PJ_ICE_SESS_CHECK_STATE_FROZEN || c->state == PJ_ICE_SESS_CHECK_STATE_WAITING) { - /* See if we shall nominate this check */ - pj_bool_t nominate = (c->nominated || ice->is_nominating); - - LOG5((ice->obj_name, "Performing triggered check for check %d",i)); - pj_log_push_indent(); - perform_check(ice, &ice->clist, i, nominate); - pj_log_pop_indent(); + /* If we are nominating in regular nomination, don't nominate this + * triggered check immediately, just wait for its scheduled check. + */ + if (ice->is_nominating && !ice->opt.aggressive) { + LOG5((ice->obj_name, "Triggered check for check %d not " + "performed because nomination is in progress", i)); + } else { + /* See if we shall nominate this check */ + pj_bool_t nominate = (c->nominated || ice->is_nominating); + LOG5((ice->obj_name, "Performing triggered check for " + "check %d",i)); + pj_log_push_indent(); + perform_check(ice, &ice->clist, i, nominate); + pj_log_pop_indent(); + } } else if (c->state == PJ_ICE_SESS_CHECK_STATE_IN_PROGRESS) { /* Should retransmit immediately */ @@ -2920,7 +3473,7 @@ else if (ice->clist.count < PJ_ICE_MAX_CHECKS) { pj_ice_sess_check *c = &ice->clist.checks[ice->clist.count]; - pj_bool_t nominate; + unsigned check_id = ice->clist.count; c->lcand = lcand; c->rcand = rcand; @@ -2928,14 +3481,37 @@ c->state = PJ_ICE_SESS_CHECK_STATE_WAITING; c->nominated = rcheck->use_candidate; c->err_code = PJ_SUCCESS; + ++ice->clist.count; - nominate = (c->nominated || ice->is_nominating); + LOG4((ice->obj_name, "New triggered check added: %d", check_id)); - LOG4((ice->obj_name, "New triggered check added: %d", - ice->clist.count)); - pj_log_push_indent(); - perform_check(ice, &ice->clist, ice->clist.count++, nominate); - pj_log_pop_indent(); + /* If we are nominating in regular nomination, don't nominate this + * newly found pair. + */ + if (ice->is_nominating && !ice->opt.aggressive) { + LOG5((ice->obj_name, "Triggered check for check %d not " + "performed because nomination is in progress", check_id)); + + /* Just in case the periodic check has been stopped (due to no more + * pair to check), let's restart it for this pair. + */ + if (!pj_timer_entry_running(&ice->clist.timer)) { + pj_time_val delay = {0, 0}; + pj_timer_heap_schedule_w_grp_lock(ice->stun_cfg.timer_heap, + &ice->clist.timer, &delay, + PJ_TRUE, ice->grp_lock); + } + } else { + pj_bool_t nominate; + nominate = (c->nominated || ice->is_nominating); + + pj_log_push_indent(); + perform_check(ice, &ice->clist, check_id, nominate); + pj_log_pop_indent(); + } + + /* Re-sort the list because of the newly added pair. */ + sort_checklist(ice, &ice->clist); } else { LOG4((ice->obj_name, "Error: unable to perform triggered check: " diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjnath/src/pjnath/ice_strans.c asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjnath/src/pjnath/ice_strans.c --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjnath/src/pjnath/ice_strans.c 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjnath/src/pjnath/ice_strans.c 2022-02-24 07:54:38.000000000 +0000 @@ -64,9 +64,9 @@ # define HOST_PREF 65535 # define RELAY_PREF 65535 #else -# define SRFLX_PREF 0 -# define HOST_PREF 0 -# define RELAY_PREF 0 +# define SRFLX_PREF ((1 << PJ_ICE_LOCAL_PREF_BITS) - 1) +# define HOST_PREF ((1 << PJ_ICE_LOCAL_PREF_BITS) - 1) +# define RELAY_PREF ((1 << PJ_ICE_LOCAL_PREF_BITS) - 1) #endif @@ -89,6 +89,7 @@ /* ICE callbacks */ +static void on_valid_pair(pj_ice_sess *ice); static void on_ice_complete(pj_ice_sess *ice, pj_status_t status); static pj_status_t ice_tx_pkt(pj_ice_sess *ice, unsigned comp_id, @@ -207,6 +208,8 @@ pj_ice_strans_state state; /**< Session state. */ pj_ice_sess *ice; /**< ICE session. */ + pj_ice_sess *ice_prev; /**< Previous ICE session. */ + pj_grp_lock_handler ice_prev_hndlr; /**< Handler of prev ICE */ pj_time_val start_time;/**< Time when ICE was started */ unsigned comp_cnt; /**< Number of components. */ @@ -225,6 +228,11 @@ pj_bool_t destroy_req;/**< Destroy has been called? */ pj_bool_t cb_called; /**< Init error callback called?*/ pj_bool_t call_send_cb;/**< Need to call send cb? */ + + pj_bool_t rem_cand_end;/**< Trickle ICE: remote has + signalled end of candidate? */ + pj_bool_t loc_cand_end;/**< Trickle ICE: local has + signalled end of candidate? */ }; @@ -417,7 +425,7 @@ cand = &comp->cand_list[comp->cand_cnt]; cand->type = PJ_ICE_CAND_TYPE_RELAYED; cand->status = PJ_EPENDING; - cand->local_pref = RELAY_PREF; + cand->local_pref = (pj_uint16_t)(RELAY_PREF - idx); cand->transport_id = tp_id; cand->comp_id = (pj_uint8_t) comp->comp_id; new_cand = PJ_TRUE; @@ -437,6 +445,14 @@ return status; } + if (new_cand) { + /* Commit the relayed candidate before pj_turn_sock_alloc(), as + * otherwise there can be race condition, please check + * https://github.com/pjsip/pjproject/pull/2525 for more info. + */ + comp->cand_cnt++; + } + /* Add pending job */ ///sess_add_ref(ice_st); @@ -449,14 +465,10 @@ &turn_cfg->alloc_param); if (status != PJ_SUCCESS) { ///sess_dec_ref(ice_st); + cand->status = status; return status; } - if (new_cand) { - /* Commit the relayed candidate. */ - comp->cand_cnt++; - } - PJ_LOG(4,(ice_st->obj_name, "Comp %d/%d: TURN relay candidate (tpid=%d) " "waiting for allocation", @@ -479,7 +491,8 @@ || lcand->status != rcand->status || lcand->comp_id != rcand->comp_id || lcand->transport_id != rcand->transport_id - || lcand->local_pref != rcand->local_pref + // local pref is no longer a constant, so it may be different + //|| lcand->local_pref != rcand->local_pref || lcand->prio != rcand->prio || pj_sockaddr_cmp(&lcand->addr, &rcand->addr) != 0 || pj_sockaddr_cmp(&lcand->base_addr, &rcand->base_addr) != 0) @@ -538,7 +551,7 @@ cand = &comp->cand_list[comp->cand_cnt]; cand->type = PJ_ICE_CAND_TYPE_SRFLX; cand->status = PJ_EPENDING; - cand->local_pref = SRFLX_PREF; + cand->local_pref = (pj_uint16_t)(SRFLX_PREF - idx); cand->transport_id = CREATE_TP_ID(TP_STUN, idx); cand->comp_id = (pj_uint8_t) comp->comp_id; @@ -655,7 +668,7 @@ continue; } else if (stun_cfg->af == pj_AF_INET6()) { - pj_in6_addr in6addr = {{0}}; + pj_in6_addr in6addr = {{{0}}}; in6addr.s6_addr[15] = 1; if (pj_memcmp(&in6addr, &addr->ipv6.sin6_addr, sizeof(in6addr))==0) @@ -678,7 +691,7 @@ cand->type = PJ_ICE_CAND_TYPE_HOST; cand->status = PJ_SUCCESS; - cand->local_pref = HOST_PREF; + cand->local_pref = (pj_uint16_t)(HOST_PREF - cand_cnt); cand->transport_id = CREATE_TP_ID(TP_STUN, idx); cand->comp_id = (pj_uint8_t) comp->comp_id; pj_sockaddr_cp(&cand->addr, addr); @@ -955,6 +968,15 @@ /* Check if all candidates are ready (this may call callback) */ sess_init_update(ice_st); + /* If ICE init done, notify app about end of candidate gathering via + * on_new_candidate() callback. + */ + if (ice_st->state==PJ_ICE_STRANS_STATE_READY && + ice_st->cb.on_new_candidate) + { + (*ice_st->cb.on_new_candidate)(ice_st, NULL, PJ_TRUE); + } + pj_log_pop_indent(); return PJ_SUCCESS; @@ -965,6 +987,12 @@ { pj_ice_strans *ice_st = (pj_ice_strans*)obj; + /* Destroy any previous ICE session */ + if (ice_st->ice_prev) { + (*ice_st->ice_prev_hndlr)(ice_st->ice_prev); + ice_st->ice_prev = NULL; + } + PJ_LOG(4,(ice_st->obj_name, "ICE stream transport %p destroyed", obj)); /* Done */ @@ -996,8 +1024,9 @@ /* Destroy ICE if we have ICE */ if (ice_st->ice) { - pj_ice_sess_destroy(ice_st->ice); + pj_ice_sess *ice = ice_st->ice; ice_st->ice = NULL; + pj_ice_sess_destroy(ice); } /* Destroy all components */ @@ -1127,6 +1156,13 @@ if (ice_st->cb.on_ice_complete) (*ice_st->cb.on_ice_complete)(ice_st, PJ_ICE_STRANS_OP_INIT, status); + + /* Tell ICE session that trickling is done */ + ice_st->loc_cand_end = PJ_TRUE; + if (ice_st->ice && ice_st->ice->is_trickling && ice_st->rem_cand_end) { + pj_ice_sess_update_check_list(ice_st->ice, NULL, NULL, 0, NULL, + PJ_TRUE); + } } /* @@ -1173,6 +1209,49 @@ return PJ_SUCCESS; } +/* + * Update number of components of the ICE stream transport. + */ +PJ_DEF(pj_status_t) pj_ice_strans_update_comp_cnt( pj_ice_strans *ice_st, + unsigned comp_cnt) +{ + unsigned i; + + PJ_ASSERT_RETURN(ice_st && comp_cnt < ice_st->comp_cnt, PJ_EINVAL); + PJ_ASSERT_RETURN(ice_st->ice == NULL, PJ_EINVALIDOP); + + pj_grp_lock_acquire(ice_st->grp_lock); + + for (i=comp_cnt; icomp_cnt; ++i) { + pj_ice_strans_comp *comp = ice_st->comp[i]; + unsigned j; + + /* Destroy the component */ + for (j = 0; j < ice_st->cfg.stun_tp_cnt; ++j) { + if (comp->stun[j].sock) { + pj_stun_sock_destroy(comp->stun[j].sock); + comp->stun[j].sock = NULL; + } + } + for (j = 0; j < ice_st->cfg.turn_tp_cnt; ++j) { + if (comp->turn[j].sock) { + pj_turn_sock_destroy(comp->turn[j].sock); + comp->turn[j].sock = NULL; + } + } + comp->cand_cnt = 0; + ice_st->comp[i] = NULL; + } + ice_st->comp_cnt = comp_cnt; + pj_grp_lock_release(ice_st->grp_lock); + + PJ_LOG(4,(ice_st->obj_name, + "Updated ICE stream transport components number to %d", + comp_cnt)); + + return PJ_SUCCESS; +} + /** * Get the group lock for this ICE stream transport. */ @@ -1204,10 +1283,20 @@ /* Init callback */ pj_bzero(&ice_cb, sizeof(ice_cb)); + ice_cb.on_valid_pair = &on_valid_pair; ice_cb.on_ice_complete = &on_ice_complete; ice_cb.on_rx_data = &ice_rx_data; ice_cb.on_tx_pkt = &ice_tx_pkt; + /* Release the pool of previous ICE session to avoid memory bloat, + * as otherwise it will only be released after ICE strans is destroyed + * (due to group lock). + */ + if (ice_st->ice_prev) { + (*ice_st->ice_prev_hndlr)(ice_st->ice_prev); + ice_st->ice_prev = NULL; + } + /* Create! */ status = pj_ice_sess_create(&ice_st->cfg.stun_cfg, ice_st->obj_name, role, ice_st->comp_cnt, &ice_cb, @@ -1312,7 +1401,9 @@ */ PJ_DEF(pj_bool_t) pj_ice_strans_sess_is_running(pj_ice_strans *ice_st) { - return ice_st && ice_st->ice && ice_st->ice->rcand_cnt && + // Trickle ICE can start ICE before remote candidate list is received + return ice_st && ice_st->ice && /* ice_st->ice->rcand_cnt && */ + ice_st->ice->clist.state == PJ_ICE_SESS_CHECKLIST_ST_RUNNING && !pj_ice_strans_sess_is_complete(ice_st); } @@ -1356,7 +1447,8 @@ if (loc_pwd) *loc_pwd = ice_st->ice->rx_pass; if (rem_ufrag || rem_pwd) { - PJ_ASSERT_RETURN(ice_st->ice->rcand_cnt != 0, PJ_EINVALIDOP); + // In trickle ICE, remote may send initial SDP with empty candidates + //PJ_ASSERT_RETURN(ice_st->ice->rcand_cnt != 0, PJ_EINVALIDOP); if (rem_ufrag) *rem_ufrag = ice_st->ice->tx_ufrag; if (rem_pwd) *rem_pwd = ice_st->ice->tx_pass; } @@ -1454,43 +1546,36 @@ return pj_ice_sess_change_role(ice_st->ice, new_role); } -/* - * Start ICE processing ! - */ -PJ_DEF(pj_status_t) pj_ice_strans_start_ice( pj_ice_strans *ice_st, - const pj_str_t *rem_ufrag, - const pj_str_t *rem_passwd, - unsigned rem_cand_cnt, - const pj_ice_sess_cand rem_cand[]) +static pj_status_t setup_turn_perm( pj_ice_strans *ice_st) { unsigned n; pj_status_t status; - PJ_ASSERT_RETURN(ice_st && rem_ufrag && rem_passwd && - rem_cand_cnt && rem_cand, PJ_EINVAL); - - /* Mark start time */ - pj_gettimeofday(&ice_st->start_time); - - /* Build check list */ - status = pj_ice_sess_create_check_list(ice_st->ice, rem_ufrag, rem_passwd, - rem_cand_cnt, rem_cand); - if (status != PJ_SUCCESS) - return status; - - /* If we have TURN candidate, now is the time to create the permissions */ for (n = 0; n < ice_st->cfg.turn_tp_cnt; ++n) { - unsigned i; + unsigned i, comp_cnt; - for (i=0; icomp_cnt; ++i) { + comp_cnt = pj_ice_strans_get_running_comp_cnt(ice_st); + for (i=0; icomp[i]; + pj_turn_session_info info; pj_sockaddr addrs[PJ_ICE_ST_MAX_CAND]; unsigned j, count=0; + unsigned rem_cand_cnt; + const pj_ice_sess_cand *rem_cand; if (!comp->turn[n].sock) continue; + status = pj_turn_sock_get_info(comp->turn[n].sock, &info); + if (status != PJ_SUCCESS || info.state != PJ_TURN_STATE_READY) + continue; + /* Gather remote addresses for this component */ + rem_cand_cnt = ice_st->ice->rcand_cnt; + rem_cand = ice_st->ice->rcand; + if (status != PJ_SUCCESS) + continue; + for (j=0; jturn[n].err_cnt && comp->turn[n].sock) { - status = pj_turn_sock_set_perm(comp->turn[n].sock, count, - addrs, 0); + status = pj_turn_sock_set_perm( + comp->turn[n].sock, count, + addrs, PJ_ICE_ST_USE_TURN_PERMANENT_PERM); if (status != PJ_SUCCESS) { pj_ice_strans_stop_ice(ice_st); return status; @@ -1511,6 +1597,40 @@ } } + return PJ_SUCCESS; +} + +/* + * Start ICE processing ! + */ +PJ_DEF(pj_status_t) pj_ice_strans_start_ice( pj_ice_strans *ice_st, + const pj_str_t *rem_ufrag, + const pj_str_t *rem_passwd, + unsigned rem_cand_cnt, + const pj_ice_sess_cand rem_cand[]) +{ + pj_status_t status; + + PJ_ASSERT_RETURN(ice_st, PJ_EINVAL); + PJ_ASSERT_RETURN(ice_st->ice, PJ_EINVALIDOP); + + /* Mark start time */ + pj_gettimeofday(&ice_st->start_time); + + /* Update check list */ + status = pj_ice_strans_update_check_list(ice_st, rem_ufrag, rem_passwd, + rem_cand_cnt, rem_cand, + !ice_st->ice->is_trickling); + if (status != PJ_SUCCESS) + return status; + + /* If we have TURN candidate, now is the time to create the permissions */ + status = setup_turn_perm(ice_st); + if (status != PJ_SUCCESS) { + pj_ice_strans_stop_ice(ice_st); + return status; + } + /* Start ICE negotiation! */ status = pj_ice_sess_start_check(ice_st->ice); if (status != PJ_SUCCESS) { @@ -1522,6 +1642,78 @@ return status; } + +/* + * Update check list after discovering and conveying new local ICE candidate, + * or receiving update of remote ICE candidates in trickle ICE. + */ +PJ_DEF(pj_status_t) pj_ice_strans_update_check_list( + pj_ice_strans *ice_st, + const pj_str_t *rem_ufrag, + const pj_str_t *rem_passwd, + unsigned rem_cand_cnt, + const pj_ice_sess_cand rem_cand[], + pj_bool_t rcand_end) +{ + pj_bool_t checklist_created; + pj_status_t status; + + PJ_ASSERT_RETURN(ice_st && ((rem_cand_cnt==0) || + (rem_ufrag && rem_passwd && rem_cand)), + PJ_EINVAL); + PJ_ASSERT_RETURN(ice_st->ice, PJ_EINVALIDOP); + + pj_grp_lock_acquire(ice_st->grp_lock); + + checklist_created = ice_st->ice->tx_ufrag.slen > 0; + + /* Create checklist (if not yet) */ + if (rem_ufrag && !checklist_created) { + status = pj_ice_sess_create_check_list(ice_st->ice, rem_ufrag, + rem_passwd, rem_cand_cnt, + rem_cand); + if (status != PJ_SUCCESS) { + PJ_PERROR(4,(ice_st->obj_name, status, + "Failed setting up remote ufrag")); + pj_grp_lock_release(ice_st->grp_lock); + return status; + } + } + + /* Update checklist for trickling ICE */ + if (ice_st->ice->is_trickling) { + if (rcand_end && !ice_st->rem_cand_end) + ice_st->rem_cand_end = PJ_TRUE; + + status = pj_ice_sess_update_check_list( + ice_st->ice, rem_ufrag, rem_passwd, + (checklist_created? rem_cand_cnt:0), rem_cand, + (ice_st->rem_cand_end && ice_st->loc_cand_end)); + if (status != PJ_SUCCESS) { + PJ_PERROR(4,(ice_st->obj_name, status, + "Failed updating checklist")); + pj_grp_lock_release(ice_st->grp_lock); + return status; + } + } + + /* Update TURN permissions if periodic check has been started. */ + if (pj_ice_strans_sess_is_running(ice_st)) { + status = setup_turn_perm(ice_st); + if (status != PJ_SUCCESS) { + PJ_PERROR(4,(ice_st->obj_name, status, + "Failed setting up TURN permission")); + pj_grp_lock_release(ice_st->grp_lock); + return status; + } + } + + pj_grp_lock_release(ice_st->grp_lock); + + return PJ_SUCCESS; +} + + /* * Get valid pair. */ @@ -1552,8 +1744,10 @@ pj_grp_lock_acquire(ice_st->grp_lock); if (ice_st->ice) { - pj_ice_sess_destroy(ice_st->ice); + ice_st->ice_prev = ice_st->ice; ice_st->ice = NULL; + pj_ice_sess_detach_grp_lock(ice_st->ice_prev, &ice_st->ice_prev_hndlr); + pj_ice_sess_destroy(ice_st->ice_prev); } ice_st->state = PJ_ICE_STRANS_STATE_INIT; @@ -1575,7 +1769,7 @@ pj_status_t status; /* Allocate send buffer, if necessary. */ - status = alloc_send_buf(ice_st, data_len); + status = alloc_send_buf(ice_st, (unsigned)data_len); if (status != PJ_SUCCESS) return status; @@ -1651,18 +1845,20 @@ } } - /* If ICE is available, send data with ICE, otherwise send with the - * default candidate selected during initialization. + /* If ICE is available, send data with ICE. If ICE nego is not completed + * yet, ICE will try to send using any valid candidate pair. For any + * failure, it will fallback to sending with the default candidate + * selected during initialization. * * https://trac.pjsip.org/repos/ticket/1416: * Once ICE has failed, also send data with the default candidate. */ - if (ice_st->ice && ice_st->state == PJ_ICE_STRANS_STATE_RUNNING) { + if (ice_st->ice && ice_st->state <= PJ_ICE_STRANS_STATE_RUNNING) { status = pj_ice_sess_send_data(ice_st->ice, comp_id, buf, data_len); - - pj_grp_lock_release(ice_st->grp_lock); - - goto on_return; + if (status == PJ_SUCCESS || status == PJ_EPENDING) { + pj_grp_lock_release(ice_st->grp_lock); + goto on_return; + } } pj_grp_lock_release(ice_st->grp_lock); @@ -1792,6 +1988,86 @@ dst_addr_len, PJ_TRUE, PJ_FALSE); } +static void on_valid_pair(pj_ice_sess *ice) +{ + pj_time_val t; + unsigned msec; + pj_ice_strans *ice_st = (pj_ice_strans *)ice->user_data; + pj_ice_strans_cb cb = ice_st->cb; + pj_status_t status = PJ_SUCCESS; + + pj_grp_lock_add_ref(ice_st->grp_lock); + + pj_gettimeofday(&t); + PJ_TIME_VAL_SUB(t, ice_st->start_time); + msec = PJ_TIME_VAL_MSEC(t); + + if (cb.on_valid_pair) { + unsigned i; + enum { + msg_disable_ind = 0xFFFF & ~(PJ_STUN_SESS_LOG_TX_IND | + PJ_STUN_SESS_LOG_RX_IND) + }; + + PJ_LOG(4, + (ice_st->obj_name, "First ICE candidate nominated in %ds:%03d", + msec / 1000, msec % 1000)); + + for (i = 0; i < ice_st->comp_cnt; ++i) { + const pj_ice_sess_check *check; + pj_ice_strans_comp *comp = ice_st->comp[i]; + + check = pj_ice_strans_get_valid_pair(ice_st, i + 1); + if (check) { + char lip[PJ_INET6_ADDRSTRLEN + 10]; + char rip[PJ_INET6_ADDRSTRLEN + 10]; + unsigned tp_idx = GET_TP_IDX(check->lcand->transport_id); + unsigned tp_typ = GET_TP_TYPE(check->lcand->transport_id); + + pj_sockaddr_print(&check->lcand->addr, lip, sizeof(lip), 3); + pj_sockaddr_print(&check->rcand->addr, rip, sizeof(rip), 3); + + if (tp_typ == TP_TURN) { + /* Activate channel binding for the remote address + * for more efficient data transfer using TURN. + */ + status = pj_turn_sock_bind_channel( + comp->turn[tp_idx].sock, &check->rcand->addr, + sizeof(check->rcand->addr)); + + /* Disable logging for Send/Data indications */ + PJ_LOG(5, (ice_st->obj_name, + "Disabling STUN Indication logging for " + "component %d", + i + 1)); + pj_turn_sock_set_log(comp->turn[tp_idx].sock, + msg_disable_ind); + comp->turn[tp_idx].log_off = PJ_TRUE; + } + + PJ_LOG(4, (ice_st->obj_name, + " Comp %d: " + "sending from %s candidate %s to " + "%s candidate %s", + i + 1, pj_ice_get_cand_type_name(check->lcand->type), + lip, pj_ice_get_cand_type_name(check->rcand->type), + rip)); + + } else { + PJ_LOG(4, (ice_st->obj_name, "Comp %d: disabled", i + 1)); + } + } + + ice_st->state = (status == PJ_SUCCESS) ? PJ_ICE_STRANS_STATE_RUNNING : + PJ_ICE_STRANS_STATE_FAILED; + + pj_log_push_indent(); + (*cb.on_valid_pair)(ice_st); + pj_log_pop_indent(); + } + + pj_grp_lock_dec_ref(ice_st->grp_lock); +} /* * Callback called by ICE session when ICE processing is complete, either @@ -2190,6 +2466,7 @@ "Binding discovery complete" : "srflx address changed"; pj_bool_t dup = PJ_FALSE; + pj_bool_t init_done; if (info.mapped_addr.addr.sa_family == pj_AF_INET() && cand->base_addr.addr.sa_family == pj_AF_INET6()) @@ -2258,6 +2535,22 @@ /* Otherwise update the address */ pj_sockaddr_cp(&cand->addr, &info.mapped_addr); cand->status = PJ_SUCCESS; + + /* Add the candidate (for trickle ICE) */ + if (pj_ice_strans_has_sess(ice_st)) { + status = pj_ice_sess_add_cand( + ice_st->ice, + comp->comp_id, + cand->transport_id, + cand->type, + cand->local_pref, + &cand->foundation, + &cand->addr, + &cand->base_addr, + &cand->rel_addr, + pj_sockaddr_get_len(&cand->addr), + NULL); + } } PJ_LOG(4,(comp->ice_st->obj_name, @@ -2268,7 +2561,16 @@ sizeof(ipaddr), 3))); sess_init_update(ice_st); - + + /* Invoke on_new_candidate() callback */ + init_done = (ice_st->state==PJ_ICE_STRANS_STATE_READY); + if (op == PJ_STUN_SOCK_BINDING_OP && status == PJ_SUCCESS && + ice_st->cb.on_new_candidate && (!dup || init_done)) + { + (*ice_st->cb.on_new_candidate) + (ice_st, (dup? NULL:cand), init_done); + } + if (op == PJ_STUN_SOCK_MAPPED_ADDR_CHANGE && ice_st->cb.on_ice_complete) { @@ -2289,6 +2591,8 @@ sess_fail(ice_st, PJ_ICE_STRANS_OP_INIT, "STUN binding request failed", status); } else { + pj_bool_t init_done; + PJ_LOG(4,(ice_st->obj_name, "STUN error is ignored for comp %d", comp->comp_id)); @@ -2303,6 +2607,14 @@ } sess_init_update(ice_st); + + /* Invoke on_new_candidate() callback */ + init_done = (ice_st->state==PJ_ICE_STRANS_STATE_READY); + if (op == PJ_STUN_SOCK_BINDING_OP && + ice_st->cb.on_new_candidate && init_done) + { + (*ice_st->cb.on_new_candidate) (ice_st, NULL, PJ_TRUE); + } } } break; @@ -2435,10 +2747,12 @@ break; } } - pj_assert(cand != NULL); pj_grp_lock_release(comp->ice_st->grp_lock); + if (cand == NULL) + goto on_return; + /* Update candidate */ pj_sockaddr_cp(&cand->addr, &rel_info.relay_addr); pj_sockaddr_cp(&cand->base_addr, &rel_info.relay_addr); @@ -2481,8 +2795,67 @@ pj_sockaddr_print(&rel_info.relay_addr, ipaddr, sizeof(ipaddr), 3))); + /* For trickle ICE, add the candidate to ICE session and setup TURN + * permission for remote candidates. + */ + if (comp->ice_st->cfg.opt.trickle != PJ_ICE_SESS_TRICKLE_DISABLED && + pj_ice_strans_has_sess(comp->ice_st)) + { + pj_sockaddr addrs[PJ_ICE_ST_MAX_CAND]; + pj_ice_sess *sess = comp->ice_st->ice; + unsigned j, count=0; + pj_status_t status; + + /* Add the candidate */ + status = pj_ice_sess_add_cand(comp->ice_st->ice, + comp->comp_id, + cand->transport_id, + cand->type, + cand->local_pref, + &cand->foundation, + &cand->addr, + &cand->base_addr, + &cand->rel_addr, + pj_sockaddr_get_len(&cand->addr), + NULL); + if (status != PJ_SUCCESS) { + PJ_PERROR(4,(comp->ice_st->obj_name, status, + "Comp %d/%d: failed to add TURN (tpid=%d) to ICE", + comp->comp_id, cand_idx, cand->transport_id)); + sess_fail(comp->ice_st, PJ_ICE_STRANS_OP_INIT, + "adding TURN candidate failed", status); + } + + /* Gather remote addresses for this component */ + for (j=0; jrcand_cnt && countrcand[j].addr.addr.sa_family== + rel_info.relay_addr.addr.sa_family) + { + pj_sockaddr_cp(&addrs[count++], &sess->rcand[j].addr); + } + } + + if (count) { + status = pj_turn_sock_set_perm(turn_sock, count, addrs, 0); + if (status != PJ_SUCCESS) { + PJ_PERROR(4,(comp->ice_st->obj_name, status, + "Comp %d/%d: TURN set perm (tpid=%d) failed", + comp->comp_id, cand_idx, cand->transport_id)); + sess_fail(comp->ice_st, PJ_ICE_STRANS_OP_INIT, + "TURN set permission failed", status); + } + } + } + sess_init_update(comp->ice_st); + /* Invoke on_new_candidate() callback */ + if (comp->ice_st->cb.on_new_candidate) { + (*comp->ice_st->cb.on_new_candidate) + (comp->ice_st, cand, + (comp->ice_st->state==PJ_ICE_STRANS_STATE_READY)); + } + } else if ((old_state == PJ_TURN_STATE_RESOLVING || old_state == PJ_TURN_STATE_RESOLVED || old_state == PJ_TURN_STATE_ALLOCATING) && @@ -2534,6 +2907,13 @@ sess_init_update(comp->ice_st); + /* Invoke on_new_candidate() callback */ + if (comp->ice_st->cb.on_new_candidate && + comp->ice_st->state==PJ_ICE_STRANS_STATE_READY) + { + (*comp->ice_st->cb.on_new_candidate)(comp->ice_st, NULL, PJ_TRUE); + } + } else if (new_state >= PJ_TURN_STATE_DEALLOCATING) { pj_turn_session_info info; @@ -2566,6 +2946,7 @@ } } +on_return: pj_grp_lock_dec_ref(comp->ice_st->grp_lock); pj_log_pop_indent(); diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjnath/src/pjnath/stun_msg.c asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjnath/src/pjnath/stun_msg.c --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjnath/src/pjnath/stun_msg.c 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjnath/src/pjnath/stun_msg.c 2022-02-24 07:54:38.000000000 +0000 @@ -1763,6 +1763,9 @@ /* Get pointer to the string in the message */ value.ptr = ((char*)buf + ATTR_HDR_LEN + 4); value.slen = attr->hdr.length - 4; + /* Make sure the length is never negative */ + if (value.slen < 0) + value.slen = 0; /* Copy the string to the attribute */ pj_strdup(pool, &attr->reason, &value); diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjnath/src/pjnath/stun_session.c asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjnath/src/pjnath/stun_session.c --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjnath/src/pjnath/stun_session.c 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjnath/src/pjnath/stun_session.c 2022-02-24 07:54:38.000000000 +0000 @@ -167,16 +167,27 @@ { pj_stun_tx_data *tdata = (pj_stun_tx_data*)arg; + if (tdata->grp_lock) { + pj_grp_lock_dec_ref(tdata->sess->grp_lock); + } + pj_pool_safe_release(&tdata->pool); } static void destroy_tdata(pj_stun_tx_data *tdata, pj_bool_t force) { - TRACE_((THIS_FILE, "tdata %p destroy request, force=%d, tsx=%p", tdata, - force, tdata->client_tsx)); + TRACE_((THIS_FILE, + "tdata %p destroy request, force=%d, tsx=%p, destroying=%d", + tdata, force, tdata->client_tsx, tdata->is_destroying)); + + /* Just return if destroy has been requested before */ + if (tdata->is_destroying) + return; /* STUN session may have been destroyed, except when tdata is cached. */ + tdata->is_destroying = PJ_TRUE; + if (tdata->res_timer.id != PJ_FALSE) { pj_timer_heap_cancel_if_active(tdata->sess->cfg->timer_heap, &tdata->res_timer, PJ_FALSE); @@ -189,7 +200,6 @@ pj_stun_client_tsx_set_data(tdata->client_tsx, NULL); } if (tdata->grp_lock) { - pj_grp_lock_dec_ref(tdata->sess->grp_lock); pj_grp_lock_dec_ref(tdata->grp_lock); } else { tdata_on_destroy(tdata); @@ -200,11 +210,11 @@ /* "Probably" this is to absorb retransmission */ pj_time_val delay = {0, 300}; pj_stun_client_tsx_schedule_destroy(tdata->client_tsx, &delay); + tdata->is_destroying = PJ_FALSE; } else { pj_list_erase(tdata); if (tdata->grp_lock) { - pj_grp_lock_dec_ref(tdata->sess->grp_lock); pj_grp_lock_dec_ref(tdata->grp_lock); } else { tdata_on_destroy(tdata); @@ -238,7 +248,7 @@ sess = tdata->sess; pj_grp_lock_acquire(sess->grp_lock); - if (sess->is_destroying) { + if (sess->is_destroying || tdata->is_destroying) { pj_grp_lock_release(sess->grp_lock); return; } diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjnath/src/pjnath/turn_session.c asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjnath/src/pjnath/turn_session.c --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjnath/src/pjnath/turn_session.c 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjnath/src/pjnath/turn_session.c 2022-02-24 07:54:38.000000000 +0000 @@ -886,7 +886,12 @@ } } - pj_assert(attr_added != 0); + /* No address to set */ + if (attr_added == 0) { + pj_stun_msg_destroy_tdata(sess->stun, tdata); + pj_grp_lock_release(sess->grp_lock); + return PJ_SUCCESS; + } /* Send the request */ status = pj_stun_session_send_msg(sess->stun, req_token, PJ_FALSE, @@ -1201,6 +1206,41 @@ return status; } +/** + * Send Connect request. + */ +PJ_DEF(pj_status_t) pj_turn_session_connect(pj_turn_session *sess, + const pj_sockaddr_t *peer_addr, + unsigned addr_len) +{ + pj_stun_tx_data *tdata; + pj_status_t status; + + PJ_ASSERT_RETURN(sess && peer_addr && addr_len, PJ_EINVAL); + PJ_ASSERT_RETURN(sess->state == PJ_TURN_STATE_READY, PJ_EINVALIDOP); + + pj_grp_lock_acquire(sess->grp_lock); + + /* Create blank Connect request */ + status = pj_stun_session_create_req(sess->stun, PJ_STUN_CONNECT_REQUEST, + PJ_STUN_MAGIC, NULL, &tdata); + if (status != PJ_SUCCESS) + goto on_return; + + status = pj_stun_msg_add_sockaddr_attr(tdata->pool, tdata->msg, + PJ_STUN_ATTR_XOR_PEER_ADDR, + PJ_TRUE, peer_addr, addr_len); + if (status != PJ_SUCCESS) goto on_return; + status = pj_stun_session_send_msg(sess->stun, (void *)peer_addr, PJ_FALSE, + PJ_FALSE, sess->srv_addr, + pj_sockaddr_get_len(sess->srv_addr), + tdata); + +on_return: + pj_grp_lock_release(sess->grp_lock); + return status; +} + PJ_DEF(pj_status_t) pj_turn_session_on_rx_pkt(pj_turn_session *sess, void *pkt, pj_size_t pkt_len, @@ -1757,6 +1797,49 @@ (sess, status, conn_bind->id, &conn_bind->peer_addr, conn_bind->peer_addr_len); } + } else if (method == PJ_STUN_CONNECT_METHOD) { + /* Handle Connct response */ + struct pj_sockaddr_t *peer_addr = (struct pj_sockaddr_t*)token; + pj_uint32_t conn_id = 0; + + if (status != PJ_SUCCESS || + !PJ_STUN_IS_SUCCESS_RESPONSE(response->hdr.type)) + { + pj_str_t reason = {0}; + if (status == PJ_SUCCESS) { + const pj_stun_errcode_attr *err_attr; + err_attr = (const pj_stun_errcode_attr*) + pj_stun_msg_find_attr(response, + PJ_STUN_ATTR_ERROR_CODE, 0); + if (err_attr) { + status = PJ_STATUS_FROM_STUN_CODE(err_attr->err_code); + reason = err_attr->reason; + } else { + status = PJNATH_EINSTUNMSG; + } + } + pj_perror(1, sess->obj_name, status, "Connect failed: %.*s", + (int)reason.slen, reason.ptr); + } else { + const pj_stun_uint_attr *conn_id_attr; + conn_id_attr = (const pj_stun_uint_attr*) + pj_stun_msg_find_attr(response, PJ_STUN_ATTR_CONNECTION_ID, 0); + if (conn_id_attr == NULL) { + status = PJNATH_EINSTUNMSG; + pj_perror(1, sess->obj_name, status, + "Error: Missing CONNECTION-ID attribute"); + } + else { + conn_id = conn_id_attr->value; + } + } + + /* Notify app */ + if (sess->cb.on_connect_complete) { + (*sess->cb.on_connect_complete) + (sess, status, conn_id, + peer_addr, pj_sockaddr_get_len(peer_addr)); + } } else { PJ_LOG(4,(sess->obj_name, "Unexpected STUN %s response", pj_stun_get_method_name(response->hdr.type))); diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjnath/src/pjnath/turn_sock.c asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjnath/src/pjnath/turn_sock.c --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjnath/src/pjnath/turn_sock.c 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjnath/src/pjnath/turn_sock.c 2022-02-24 07:54:38.000000000 +0000 @@ -137,6 +137,11 @@ pj_uint32_t conn_id, const pj_sockaddr_t *peer_addr, unsigned addr_len); +static void turn_on_connect_complete(pj_turn_session *sess, + pj_status_t status, + pj_uint32_t conn_id, + const pj_sockaddr_t *peer_addr, + unsigned addr_len); static pj_bool_t on_data_read(pj_turn_sock *turn_sock, void *data, @@ -348,6 +353,7 @@ sess_cb.on_channel_bound = &turn_on_channel_bound; sess_cb.on_rx_data = &turn_on_rx_data; sess_cb.on_state = &turn_on_state; + sess_cb.on_connect_complete = &turn_on_connect_complete; sess_cb.on_connection_attempt = &turn_on_connection_attempt; sess_cb.on_connection_bind_status = &turn_on_connection_bind_status; status = pj_turn_session_create(cfg, pool->obj_name, af, conn_type, @@ -666,6 +672,53 @@ return pj_turn_session_bind_channel(turn_sock->sess, peer, addr_len); } +/** + * Send Connect request for the specified a peer address. + */ +PJ_DEF(pj_status_t) pj_turn_sock_connect( pj_turn_sock *turn_sock, + const pj_sockaddr_t *peer_addr, + unsigned addr_len) +{ + PJ_ASSERT_RETURN(turn_sock && peer_addr && addr_len, PJ_EINVAL); + PJ_ASSERT_RETURN(turn_sock->sess != NULL, PJ_EINVALIDOP); + + return pj_turn_session_connect(turn_sock->sess, peer_addr, addr_len); +} + +/** + * Close existing connection to the peer address. + */ +PJ_DEF(pj_status_t) pj_turn_sock_disconnect( pj_turn_sock *turn_sock, + const pj_sockaddr_t *peer_addr, + unsigned addr_len) + +{ + unsigned i; + char addrtxt[PJ_INET6_ADDRSTRLEN+8]; + + PJ_ASSERT_RETURN(turn_sock && peer_addr && addr_len, PJ_EINVAL); + PJ_ASSERT_RETURN(turn_sock->sess != NULL, PJ_EINVALIDOP); + + pj_grp_lock_acquire(turn_sock->grp_lock); + for (i=0; i < PJ_TURN_MAX_TCP_CONN_CNT; ++i) { + tcp_data_conn_t *conn = &turn_sock->data_conn[i]; + if (conn->state < DATACONN_STATE_CONN_BINDING) + continue; + if (pj_sockaddr_cmp(&conn->peer_addr, peer_addr) == 0) { + dataconn_cleanup(conn); + --turn_sock->data_conn_cnt; + pj_grp_lock_release(turn_sock->grp_lock); + return PJ_SUCCESS; + } + } + + PJ_LOG(4, (turn_sock->obj_name, "Connection for peer %s is not exist", + pj_sockaddr_print(peer_addr, addrtxt, sizeof(addrtxt), 3))); + + pj_grp_lock_release(turn_sock->grp_lock); + return PJ_ENOTFOUND; +} + /* * Notification when outgoing TCP socket has been connected. @@ -1195,6 +1248,7 @@ turn_sock->setting.port_range, max_bind_retry); if (status != PJ_SUCCESS) { + pj_sock_close(sock); pj_turn_sock_destroy(turn_sock); return; } @@ -1205,6 +1259,7 @@ turn_sock->pool->obj_name, NULL); if (status != PJ_SUCCESS && !turn_sock->setting.qos_ignore_error) { + pj_sock_close(sock); pj_turn_sock_destroy(turn_sock); return; } @@ -1261,7 +1316,9 @@ sock_type, &asock_cfg, turn_sock->cfg.ioqueue, &asock_cb, turn_sock, - &turn_sock->active_sock); + &turn_sock->active_sock); + if (status != PJ_SUCCESS) + pj_sock_close(sock); } #if PJ_HAS_SSL_SOCK else { @@ -1449,7 +1506,7 @@ if (conn->state == DATACONN_STATE_READY) { /* Application data */ if (turn_sock->cb.on_rx_data) { - (*turn_sock->cb.on_rx_data)(turn_sock, data, *remainder, + (*turn_sock->cb.on_rx_data)(turn_sock, data, (unsigned)*remainder, &conn->peer_addr, conn->peer_addr_len); } @@ -1553,7 +1610,7 @@ return); PJ_LOG(5,(turn_sock->pool->obj_name, "Connection attempt from peer %s", - pj_sockaddr_print(&peer_addr, addrtxt, sizeof(addrtxt), 3))); + pj_sockaddr_print(peer_addr, addrtxt, sizeof(addrtxt), 3))); if (turn_sock == NULL) { /* We've been destroyed */ @@ -1766,3 +1823,193 @@ peer_addr, addr_len); } } + +static void turn_on_connect_complete(pj_turn_session *sess, + pj_status_t status, + pj_uint32_t conn_id, + const pj_sockaddr_t *peer_addr, + unsigned addr_len) +{ + pj_turn_sock *turn_sock = (pj_turn_sock*) + pj_turn_session_get_user_data(sess); + pj_pool_t *pool; + tcp_data_conn_t *new_conn; + pj_turn_session_info info; + pj_sock_t sock = PJ_INVALID_SOCKET; + pj_activesock_cfg asock_cfg; + pj_activesock_cb asock_cb; + pj_sockaddr bound_addr, *cfg_bind_addr; + pj_uint16_t max_bind_retry; + char addrtxt[PJ_INET6_ADDRSTRLEN+8]; + unsigned i; + + if (turn_sock == NULL) { + /* We've been destroyed */ + return; + } + + PJ_ASSERT_ON_FAIL(turn_sock->conn_type == PJ_TURN_TP_TCP && + turn_sock->alloc_param.peer_conn_type == PJ_TURN_TP_TCP, + return); + PJ_LOG(5,(turn_sock->pool->obj_name, "Trying to connect to peer %s", + pj_sockaddr_print(peer_addr, addrtxt, sizeof(addrtxt), 3))); + + pj_grp_lock_acquire(turn_sock->grp_lock); + + if (turn_sock->data_conn_cnt == PJ_TURN_MAX_TCP_CONN_CNT) { + /* Data connection has reached limit */ + + status = PJ_ETOOMANY; + pj_perror(4, turn_sock->pool->obj_name, status, + "Failed in connect to peer %s", + pj_sockaddr_print(peer_addr, addrtxt, sizeof(addrtxt), 3)); + + /* Notify app for failure */ + if (turn_sock->cb.on_connection_status) { + (*turn_sock->cb.on_connection_status)(turn_sock, status, conn_id, + peer_addr, addr_len); + } + + pj_grp_lock_release(turn_sock->grp_lock); + return; + } + + /* Find free data connection slot */ + for (i=0; i < PJ_TURN_MAX_TCP_CONN_CNT; ++i) { + if (turn_sock->data_conn[i].state == DATACONN_STATE_NULL) + break; + } + + /* Verify that a free slot is found */ + pj_assert(i < PJ_TURN_MAX_TCP_CONN_CNT); + ++turn_sock->data_conn_cnt; + + /* Init new data connection */ + new_conn = &turn_sock->data_conn[i]; + pj_bzero(new_conn, sizeof(*new_conn)); + pool = pj_pool_create(turn_sock->cfg.pf, "dataconn", 128, 128, NULL); + new_conn->pool = pool; + new_conn->id = conn_id; + new_conn->turn_sock = turn_sock; + pj_sockaddr_cp(&new_conn->peer_addr, peer_addr); + new_conn->peer_addr_len = addr_len; + pj_ioqueue_op_key_init(&new_conn->send_key, sizeof(new_conn->send_key)); + new_conn->state = DATACONN_STATE_INITSOCK; + + /* Init socket */ + status = pj_sock_socket(turn_sock->af, pj_SOCK_STREAM(), 0, &sock); + if (status != PJ_SUCCESS) + goto on_return; + + /* Bind socket */ + cfg_bind_addr = &turn_sock->setting.bound_addr; + max_bind_retry = MAX_BIND_RETRY; + if (turn_sock->setting.port_range && + turn_sock->setting.port_range < max_bind_retry) + { + max_bind_retry = turn_sock->setting.port_range; + } + pj_sockaddr_init(turn_sock->af, &bound_addr, NULL, 0); + if (cfg_bind_addr->addr.sa_family == pj_AF_INET() || + cfg_bind_addr->addr.sa_family == pj_AF_INET6()) + { + pj_sockaddr_cp(&bound_addr, cfg_bind_addr); + } + status = pj_sock_bind_random(sock, &bound_addr, + turn_sock->setting.port_range, + max_bind_retry); + if (status != PJ_SUCCESS) + goto on_return; + + /* Apply socket buffer size */ + if (turn_sock->setting.so_rcvbuf_size > 0) { + unsigned sobuf_size = turn_sock->setting.so_rcvbuf_size; + status = pj_sock_setsockopt_sobuf(sock, pj_SO_RCVBUF(), PJ_TRUE, + &sobuf_size); + if (status != PJ_SUCCESS) { + pj_perror(3, turn_sock->obj_name, status, + "Failed setting SO_RCVBUF"); + } else { + if (sobuf_size < turn_sock->setting.so_rcvbuf_size) { + PJ_LOG(4, (turn_sock->obj_name, + "Warning! Cannot set SO_RCVBUF as configured," + " now=%d, configured=%d", sobuf_size, + turn_sock->setting.so_rcvbuf_size)); + } else { + PJ_LOG(5, (turn_sock->obj_name, "SO_RCVBUF set to %d", + sobuf_size)); + } + } + } + if (turn_sock->setting.so_sndbuf_size > 0) { + unsigned sobuf_size = turn_sock->setting.so_sndbuf_size; + status = pj_sock_setsockopt_sobuf(sock, pj_SO_SNDBUF(), PJ_TRUE, + &sobuf_size); + if (status != PJ_SUCCESS) { + pj_perror(3, turn_sock->obj_name, status, + "Failed setting SO_SNDBUF"); + } else { + if (sobuf_size < turn_sock->setting.so_sndbuf_size) { + PJ_LOG(4, (turn_sock->obj_name, + "Warning! Cannot set SO_SNDBUF as configured," + " now=%d, configured=%d", sobuf_size, + turn_sock->setting.so_sndbuf_size)); + } else { + PJ_LOG(5, (turn_sock->obj_name, "SO_SNDBUF set to %d", + sobuf_size)); + } + } + } + + /* Create active socket */ + pj_activesock_cfg_default(&asock_cfg); + asock_cfg.grp_lock = turn_sock->grp_lock; + + pj_bzero(&asock_cb, sizeof(asock_cb)); + asock_cb.on_data_read = &dataconn_on_data_read; + asock_cb.on_data_sent = &dataconn_on_data_sent; + asock_cb.on_connect_complete = &dataconn_on_connect_complete; + status = pj_activesock_create(pool, sock, + pj_SOCK_STREAM(), &asock_cfg, + turn_sock->cfg.ioqueue, &asock_cb, + new_conn, &new_conn->asock); + if (status != PJ_SUCCESS) + goto on_return; + + /* Connect to TURN server for data connection */ + pj_turn_session_get_info(turn_sock->sess, &info); + status = pj_activesock_start_connect(new_conn->asock, + pool, + &info.server, + pj_sockaddr_get_len(&info.server)); + if (status == PJ_SUCCESS) { + dataconn_on_connect_complete(new_conn->asock, PJ_SUCCESS); + pj_grp_lock_release(turn_sock->grp_lock); + return; + } + +on_return: + if (status == PJ_EPENDING) { + PJ_LOG(5,(pool->obj_name, + "Connecting to peer %s", + pj_sockaddr_print(peer_addr, addrtxt, sizeof(addrtxt), 3))); + } else { + /* not PJ_SUCCESS */ + pj_perror(4, pool->obj_name, status, + "Failed in connect to peer %s", + pj_sockaddr_print(peer_addr, addrtxt, sizeof(addrtxt), 3)); + + if (!new_conn->asock && sock != PJ_INVALID_SOCKET) + pj_sock_close(sock); + + dataconn_cleanup(new_conn); + --turn_sock->data_conn_cnt; + + /* Notify app for failure */ + if (turn_sock->cb.on_connection_status) { + (*turn_sock->cb.on_connection_status)(turn_sock, status, conn_id, + peer_addr, addr_len); + } + } + pj_grp_lock_release(turn_sock->grp_lock); +} diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjnath/src/pjnath-test/ice_test.c asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjnath/src/pjnath-test/ice_test.c --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjnath/src/pjnath-test/ice_test.c 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjnath/src/pjnath-test/ice_test.c 2022-02-24 07:54:38.000000000 +0000 @@ -70,6 +70,7 @@ struct test_result expected;/* Expected result */ pj_bool_t nom_regular; /* Use regular nomination? */ + pj_ice_sess_trickle trickle; /* Trickle ICE mode */ }; /* ICE endpoint state */ @@ -81,6 +82,9 @@ pj_str_t ufrag; /* username fragment. */ pj_str_t pass; /* password */ + + /* Trickle ICE */ + pj_bool_t last_cand; /* Got last candidate? */ }; /* Session param */ @@ -122,6 +126,10 @@ static void ice_on_ice_complete(pj_ice_strans *ice_st, pj_ice_strans_op op, pj_status_t status); +static void ice_on_new_candidate(pj_ice_strans *ice_st, + const pj_ice_sess_cand *cand, + pj_bool_t last); + static void destroy_sess(struct test_sess *sess, unsigned wait_msec); #if USE_IPV6 @@ -235,9 +243,11 @@ pj_bzero(&ice_cb, sizeof(ice_cb)); ice_cb.on_rx_data = &ice_on_rx_data; ice_cb.on_ice_complete = &ice_on_ice_complete; + ice_cb.on_new_candidate = &ice_on_new_candidate; /* Init ICE stream transport configuration structure */ pj_ice_strans_cfg_default(&ice_cfg); + ice_cfg.opt.trickle = ept->cfg.trickle; pj_memcpy(&ice_cfg.stun_cfg, test_sess->stun_cfg, sizeof(pj_stun_config)); if ((ept->cfg.enable_stun & SRV)==SRV || (ept->cfg.enable_turn & SRV)==SRV) ice_cfg.resolver = test_sess->resolver; @@ -452,6 +462,32 @@ } } +static void ice_on_new_candidate(pj_ice_strans *ice_st, + const pj_ice_sess_cand *cand, + pj_bool_t last) +{ + struct ice_ept *ept; + char buf1[PJ_INET6_ADDRSTRLEN+10]; + char buf2[PJ_INET6_ADDRSTRLEN+10]; + + ept = (struct ice_ept*) pj_ice_strans_get_user_data(ice_st); + if (!ept) + return; + + ept->last_cand = last; + + if (cand) { + PJ_LOG(4,(THIS_FILE, INDENT "%p: discovered a new candidate " + "comp=%d, type=%s, addr=%s, baseaddr=%s, end=%d", + ept->ice, cand->comp_id, + pj_ice_get_cand_type_name(cand->type), + pj_sockaddr_print(&cand->addr, buf1, sizeof(buf1), 3), + pj_sockaddr_print(&cand->base_addr, buf2, sizeof(buf2), 3), + last)); + } else if (ept->ice && last) { + PJ_LOG(4,(THIS_FILE, INDENT "%p: end of candidate", ept->ice)); + } +} /* Start ICE negotiation on the endpoint, based on parameter from * the other endpoint. @@ -459,18 +495,21 @@ static pj_status_t start_ice(struct ice_ept *ept, const struct ice_ept *remote) { pj_ice_sess_cand rcand[32]; - unsigned i, rcand_cnt = 0; + unsigned rcand_cnt = 0; pj_status_t status; /* Enum remote candidates */ - for (i=0; icfg.comp_cnt; ++i) { - unsigned cnt = PJ_ARRAY_SIZE(rcand) - rcand_cnt; - status = pj_ice_strans_enum_cands(remote->ice, i+1, &cnt, rcand+rcand_cnt); - if (status != PJ_SUCCESS) { - app_perror(INDENT "err: pj_ice_strans_enum_cands()", status); - return status; + if (ept->cfg.trickle == PJ_ICE_SESS_TRICKLE_DISABLED) { + unsigned i; + for (i=0; icfg.comp_cnt; ++i) { + unsigned cnt = PJ_ARRAY_SIZE(rcand) - rcand_cnt; + status = pj_ice_strans_enum_cands(remote->ice, i+1, &cnt, rcand+rcand_cnt); + if (status != PJ_SUCCESS) { + app_perror(INDENT "err: pj_ice_strans_enum_cands()", status); + return status; + } + rcand_cnt += cnt; } - rcand_cnt += cnt; } status = pj_ice_strans_start_ice(ept->ice, &remote->ufrag, &remote->pass, @@ -1228,3 +1267,338 @@ return rc; } + +struct timer_data +{ + struct test_sess *sess; + unsigned caller_last_cand_cnt[PJ_ICE_MAX_COMP]; + unsigned callee_last_cand_cnt[PJ_ICE_MAX_COMP]; +}; + + +/* Timer callback to check & signal new candidates */ +static void timer_new_cand(pj_timer_heap_t *th, pj_timer_entry *te) +{ + struct timer_data *data = (struct timer_data*)te->user_data; + struct test_sess *sess = data->sess; + struct ice_ept *caller = &sess->caller; + struct ice_ept *callee = &sess->callee; + pj_bool_t caller_last_cand, callee_last_cand; + unsigned i, ncomp; + pj_status_t rc; + + /* ICE transport may have been destroyed */ + if (!caller->ice || !callee->ice) + return; + + caller_last_cand = caller->last_cand; + callee_last_cand = callee->last_cand; + //PJ_LOG(3,(THIS_FILE, INDENT "End-of-cand status: caller=%d callee=%d", + // caller_last_cand, callee_last_cand)); + + ncomp = PJ_MIN(caller->cfg.comp_cnt, callee->cfg.comp_cnt); + for (i = 0; i < ncomp; ++i) { + pj_ice_sess_cand cand[PJ_ICE_ST_MAX_CAND]; + unsigned j, cnt; + + /* Check caller candidates */ + cnt = PJ_ICE_ST_MAX_CAND; + rc = pj_ice_strans_enum_cands(caller->ice, i+1, &cnt, cand); + if (rc != PJ_SUCCESS) { + app_perror(INDENT "err: caller pj_ice_strans_enum_cands()", rc); + continue; + } + + if (cnt > data->caller_last_cand_cnt[i]) { + unsigned new_cnt = cnt - data->caller_last_cand_cnt[i]; + + /* Update remote with new candidates */ + rc = pj_ice_strans_update_check_list(callee->ice, + &caller->ufrag, + &caller->pass, + new_cnt, &cand[cnt - new_cnt], + caller_last_cand && (i==ncomp-1)); + if (rc != PJ_SUCCESS) { + app_perror(INDENT "err: callee pj_ice_strans_update_check_list()", rc); + continue; + } + + data->caller_last_cand_cnt[i] = cnt; + PJ_LOG(4,(THIS_FILE, INDENT "Updated callee with %d new candidates %s", + new_cnt, (caller_last_cand?"(last)":""))); + + for (j = 0; j < new_cnt; ++j) { + pj_ice_sess_cand *c = &cand[cnt - new_cnt + j]; + char buf1[PJ_INET6_ADDRSTRLEN+10]; + char buf2[PJ_INET6_ADDRSTRLEN+10]; + PJ_LOG(4,(THIS_FILE, INDENT + "%d: comp=%d, type=%s, addr=%s, baseaddr=%s", + j+1, c->comp_id, + pj_ice_get_cand_type_name(c->type), + pj_sockaddr_print(&c->addr, buf1, sizeof(buf1), 3), + pj_sockaddr_print(&c->base_addr, buf2, sizeof(buf2), 3) + )); + } + } + + /* Check callee candidates */ + cnt = PJ_ICE_ST_MAX_CAND; + rc = pj_ice_strans_enum_cands(callee->ice, i+1, &cnt, cand); + if (rc != PJ_SUCCESS) { + app_perror(INDENT "err: caller pj_ice_strans_enum_cands()", rc); + continue; + } + + if (cnt > data->callee_last_cand_cnt[i]) { + unsigned new_cnt = cnt - data->callee_last_cand_cnt[i]; + + /* Update remote with new candidates */ + rc = pj_ice_strans_update_check_list(caller->ice, + &callee->ufrag, + &callee->pass, + new_cnt, &cand[cnt - new_cnt], + callee_last_cand && (i==ncomp-1)); + if (rc != PJ_SUCCESS) { + app_perror(INDENT "err: caller pj_ice_strans_update_check_list()", rc); + continue; + } + + data->callee_last_cand_cnt[i] = cnt; + PJ_LOG(4,(THIS_FILE, INDENT "Updated caller with %d new candidates %s", + new_cnt, (callee_last_cand?"(last)":""))); + + for (j = 0; j < new_cnt; ++j) { + pj_ice_sess_cand *c = &cand[cnt - new_cnt + j]; + char buf1[PJ_INET6_ADDRSTRLEN+10]; + char buf2[PJ_INET6_ADDRSTRLEN+10]; + PJ_LOG(4,(THIS_FILE, INDENT + "%d: comp=%d, type=%s, addr=%s, baseaddr=%s", + j+1, c->comp_id, + pj_ice_get_cand_type_name(c->type), + pj_sockaddr_print(&c->addr, buf1, sizeof(buf1), 3), + pj_sockaddr_print(&c->base_addr, buf2, sizeof(buf2), 3) + )); + } + } + } + + if (!caller_last_cand || !callee_last_cand) { + /* Reschedule until all candidates are gathered */ + pj_time_val timeout = {0, 10}; + pj_time_val_normalize(&timeout); + pj_timer_heap_schedule(th, te, &timeout); + //PJ_LOG(3,(THIS_FILE, INDENT "Rescheduled new candidate check")); + } +} + + +static int perform_trickle_test(const char *title, + pj_stun_config *stun_cfg, + unsigned server_flag, + struct test_cfg *caller_cfg, + struct test_cfg *callee_cfg, + struct sess_param *test_param) +{ + pjlib_state pjlib_state; + struct test_sess *sess; + struct timer_data timer_data; + pj_timer_entry te_new_cand; + int rc; + + PJ_LOG(3,(THIS_FILE, "%s, %d vs %d components", + title, caller_cfg->comp_cnt, callee_cfg->comp_cnt)); + + capture_pjlib_state(stun_cfg, &pjlib_state); + + rc = create_sess(stun_cfg, server_flag, caller_cfg, callee_cfg, + test_param, &sess); + if (rc != 0) + return rc; + + /* Init ICE on caller */ + rc = pj_ice_strans_init_ice(sess->caller.ice, sess->caller.cfg.role, + &sess->caller.ufrag, &sess->caller.pass); + if (rc != PJ_SUCCESS) { + app_perror(INDENT "err: caller pj_ice_strans_init_ice()", rc); + rc = -100; + goto on_return; + } + + /* Init ICE on callee */ + rc = pj_ice_strans_init_ice(sess->callee.ice, sess->callee.cfg.role, + &sess->callee.ufrag, &sess->callee.pass); + if (rc != PJ_SUCCESS) { + app_perror(INDENT "err: callee pj_ice_strans_init_ice()", rc); + rc = -110; + goto on_return; + } + + /* Start ICE on callee */ + rc = start_ice(&sess->callee, &sess->caller); + if (rc != PJ_SUCCESS) { + int retval = (rc == sess->callee.cfg.expected.start_status)?0:-120; + rc = retval; + goto on_return; + } + + /* Start ICE on caller */ + rc = start_ice(&sess->caller, &sess->callee); + if (rc != PJ_SUCCESS) { + int retval = (rc == sess->caller.cfg.expected.start_status)?0:-130; + rc = retval; + goto on_return; + } + + /* Start polling new candidate */ + //if (!sess->caller.last_cand || !sess->callee.last_cand) + { + pj_time_val timeout = {0, 10}; + + pj_bzero(&timer_data, sizeof(timer_data)); + timer_data.sess = sess; + + pj_time_val_normalize(&timeout); + pj_timer_entry_init(&te_new_cand, 0, &timer_data, &timer_new_cand); + pj_timer_heap_schedule(stun_cfg->timer_heap, &te_new_cand, &timeout); + } + + WAIT_UNTIL(30000, ALL_DONE, rc); + if (!ALL_DONE) { + PJ_LOG(3,(THIS_FILE, INDENT "err: negotiation timed-out")); + rc = -140; + goto on_return; + } + + if (rc != 0) + goto on_return; + + if (sess->caller.result.nego_status != sess->caller.cfg.expected.nego_status) { + app_perror(INDENT "err: caller negotiation failed", sess->caller.result.nego_status); + rc = -150; + goto on_return; + } + + if (sess->callee.result.nego_status != sess->callee.cfg.expected.nego_status) { + app_perror(INDENT "err: callee negotiation failed", sess->callee.result.nego_status); + rc = -160; + goto on_return; + } + + /* Verify that both agents have agreed on the same pair */ + rc = check_pair(&sess->caller, &sess->callee, -170); + if (rc != 0) { + goto on_return; + } + rc = check_pair(&sess->callee, &sess->caller, -180); + if (rc != 0) { + goto on_return; + } + + /* Looks like everything is okay */ + + /* Destroy ICE stream transports first to let it de-allocate + * TURN relay (otherwise there'll be timer/memory leak, unless + * we wait for long time in the last poll_events() below). + */ + if (sess->caller.ice) { + pj_ice_strans_destroy(sess->caller.ice); + sess->caller.ice = NULL; + } + + if (sess->callee.ice) { + pj_ice_strans_destroy(sess->callee.ice); + sess->callee.ice = NULL; + } + +on_return: + /* Wait.. */ + poll_events(stun_cfg, 200, PJ_FALSE); + + /* Now destroy everything */ + destroy_sess(sess, 500); + + /* Flush events */ + poll_events(stun_cfg, 100, PJ_FALSE); + + if (rc == 0) + rc = check_pjlib_state(stun_cfg, &pjlib_state); + + return rc; +} + + +/* Simple trickle ICE test */ +int trickle_ice_test(void) +{ + pj_pool_t *pool; + pj_stun_config stun_cfg; + struct sess_param test_param; + unsigned i; + int rc; + + struct sess_cfg_t { + const char *title; + unsigned server_flag; + struct test_cfg ua1; + struct test_cfg ua2; + } cfg[] = { + { + "With host-only", + 0x1FFF, + /*Role comp# host? stun? turn? flag? ans_del snd_del des_del */ + {ROLE1, 1, YES, NO, NO, CLIENT_IPV4, 0, 0, 0, {PJ_SUCCESS, PJ_SUCCESS, PJ_SUCCESS}}, + {ROLE2, 1, YES, NO, NO, CLIENT_IPV4, 0, 0, 0, {PJ_SUCCESS, PJ_SUCCESS, PJ_SUCCESS}} + }, + { + "With turn-only", + 0x1FFF, + /*Role comp# host? stun? turn? flag? ans_del snd_del des_del */ + {ROLE1, 1, NO, NO, YES, CLIENT_IPV4, 0, 0, 0, {PJ_SUCCESS, PJ_SUCCESS, PJ_SUCCESS}}, + {ROLE2, 1, NO, NO, YES, CLIENT_IPV4, 0, 0, 0, {PJ_SUCCESS, PJ_SUCCESS, PJ_SUCCESS}} + }, + { + /* STUN candidates will be pruned */ + "With host+turn", + 0x1FFF, + /*Role comp# host? stun? turn? flag? ans_del snd_del des_del */ + {ROLE1, 1, YES, YES, YES, CLIENT_IPV4, 0, 0, 0, {PJ_SUCCESS, PJ_SUCCESS, PJ_SUCCESS}}, + {ROLE2, 1, YES, YES, YES, CLIENT_IPV4, 0, 0, 0, {PJ_SUCCESS, PJ_SUCCESS, PJ_SUCCESS}} + }}; + + PJ_LOG(3,(THIS_FILE, "Trickle ICE")); + pj_log_push_indent(); + + pool = pj_pool_create(mem, NULL, 512, 512, NULL); + + rc = create_stun_config(pool, &stun_cfg); + if (rc != PJ_SUCCESS) { + pj_pool_release(pool); + pj_log_pop_indent(); + return -10; + } + + for (i = 0; i < PJ_ARRAY_SIZE(cfg) && !rc; ++i) { + unsigned c1, c2; + cfg[i].ua1.trickle = PJ_ICE_SESS_TRICKLE_FULL; + cfg[i].ua2.trickle = PJ_ICE_SESS_TRICKLE_FULL; + for (c1 = 1; c1 <= 2 && !rc; ++c1) { + for (c2 = 1; c2 <= 2 && !rc; ++c2) { + pj_bzero(&test_param, sizeof(test_param)); + cfg[i].ua1.comp_cnt = c1; + cfg[i].ua2.comp_cnt = c2; + rc = perform_trickle_test(cfg[i].title, + &stun_cfg, + cfg[i].server_flag, + &cfg[i].ua1, + &cfg[i].ua2, + &test_param); + } + } + } + + destroy_stun_config(&stun_cfg); + pj_pool_release(pool); + pj_log_pop_indent(); + + return rc; +} diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjnath/src/pjnath-test/main.c asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjnath/src/pjnath-test/main.c --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjnath/src/pjnath-test/main.c 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjnath/src/pjnath-test/main.c 2022-02-24 07:54:38.000000000 +0000 @@ -20,6 +20,7 @@ #include "test.h" #if defined(PJ_SUNOS) && PJ_SUNOS!=0 + #include static void init_signals() { @@ -31,6 +32,30 @@ sigaction(SIGALRM, &act, NULL); } +#elif PJ_LINUX || PJ_DARWINOS + +#include +#include +#include +#include +#include +static void print_stack(int sig) +{ + void *array[16]; + size_t size; + + size = backtrace(array, 16); + fprintf(stderr, "Error: signal %d:\n", sig); + backtrace_symbols_fd(array, size, STDERR_FILENO); + exit(1); +} + +static void init_signals(void) +{ + signal(SIGSEGV, &print_stack); + signal(SIGABRT, &print_stack); +} + #else #define init_signals() #endif @@ -40,20 +65,33 @@ int main(int argc, char *argv[]) { int rc; - - PJ_UNUSED_ARG(argc); - PJ_UNUSED_ARG(argv); + int interractive = 0; + int no_trap = 0; boost(); - init_signals(); - rc = test_main(); + while (argc > 1) { + char *arg = argv[--argc]; + + if (*arg=='-' && *(arg+1)=='i') { + interractive = 1; + + } else if (*arg=='-' && *(arg+1)=='n') { + no_trap = 1; + } + } + + if (!no_trap) { + init_signals(); + } - if (argc == 2 && pj_ansi_strcmp(argv[1], "-i")==0) { - char buf[10]; + rc = test_main(); + if (interractive) { + char s[10]; + puts(""); puts("Press to exit"); - if (fgets(buf, sizeof(buf), stdin) == NULL) + if (!fgets(s, sizeof(s), stdin)) return rc; } diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjnath/src/pjnath-test/server.c asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjnath/src/pjnath-test/server.c --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjnath/src/pjnath-test/server.c 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjnath/src/pjnath-test/server.c 2022-02-24 07:54:38.000000000 +0000 @@ -27,7 +27,9 @@ #define CERT_CA_FILE CERT_DIR "cacert.pem" #define CERT_FILE CERT_DIR "cacert.pem" #define CERT_PRIVKEY_FILE CERT_DIR "privkey.pem" -#define CERT_PRIVKEY_PASS "" +#define CERT_PRIVKEY_PASS "privkeypass" + +#define RETURN_ERROR(rc) {app_perror("", rc);return rc;} static pj_bool_t stun_on_data_recvfrom(pj_activesock_t *asock, void *data, @@ -101,7 +103,7 @@ } else { status = pj_gethostip(GET_AF(use_ipv6), &hostip); if (status != PJ_SUCCESS) - return status; + RETURN_ERROR(status); } pool = pj_pool_create(mem, THIS_FILE, 512, 512, NULL); @@ -122,7 +124,7 @@ 0, &test_srv->dns_server); if (status != PJ_SUCCESS) { destroy_test_server(test_srv); - return status; + RETURN_ERROR(status); } /* Add DNS A record for the domain, for fallback */ @@ -161,14 +163,14 @@ &test_srv->stun_sock, NULL); if (status != PJ_SUCCESS) { destroy_test_server(test_srv); - return status; + RETURN_ERROR(status); } status = pj_activesock_start_recvfrom(test_srv->stun_sock, pool, MAX_STUN_PKT, 0); if (status != PJ_SUCCESS) { destroy_test_server(test_srv); - return status; + RETURN_ERROR(status); } if (test_srv->dns_server && (flags & CREATE_STUN_SERVER_DNS_SRV)) { @@ -222,7 +224,7 @@ if (status != PJ_SUCCESS) { destroy_test_server(test_srv); - return status; + RETURN_ERROR(status); } status = pj_activesock_start_recvfrom(test_srv->turn_sock, pool, @@ -236,20 +238,26 @@ status = pj_sock_socket(GET_AF(use_ipv6), pj_SOCK_STREAM(), 0, &sock_fd); if (status != PJ_SUCCESS) { - return status; + RETURN_ERROR(status); + } + + { + int val = 1; + pj_sock_setsockopt(sock_fd, pj_SOL_SOCKET(), pj_SO_REUSEADDR(), + &val, sizeof(val)); } status = pj_sock_bind(sock_fd, &bound_addr, pj_sockaddr_get_len(&bound_addr)); if (status != PJ_SUCCESS) { pj_sock_close(sock_fd); - return status; + RETURN_ERROR(status); } status = pj_sock_listen(sock_fd, 4); if (status != PJ_SUCCESS) { pj_sock_close(sock_fd); - return status; + RETURN_ERROR(status); } status = pj_activesock_create(pool, sock_fd, pj_SOCK_STREAM(), @@ -259,7 +267,7 @@ &test_srv->turn_sock); if (status != PJ_SUCCESS) { pj_sock_close(sock_fd); - return status; + RETURN_ERROR(status); } status = pj_activesock_start_accept(test_srv->turn_sock, @@ -309,7 +317,7 @@ #endif if (status != PJ_SUCCESS) { destroy_test_server(test_srv); - return status; + RETURN_ERROR(status); } if (test_srv->dns_server && (flags & CREATE_TURN_SERVER_DNS_SRV)) { @@ -576,7 +584,9 @@ /* Not STUN message, this probably is a ChannelData */ pj_turn_channel_data cd; const pj_turn_channel_data *pcd = (const pj_turn_channel_data*)data; + char peer_info[PJ_INET6_ADDRSTRLEN]; pj_ssize_t sent; + unsigned j; if (i==test_srv->turn_alloc_cnt) { /* Invalid data */ @@ -598,23 +608,26 @@ } /* Lookup peer */ - for (i=0; iperm_cnt; ++i) { - if (alloc->chnum[i] == cd.ch_number) + for (j=0; jperm_cnt; ++j) { + if (alloc->chnum[j] == cd.ch_number) break; } - if (i==alloc->perm_cnt) { + if (j==alloc->perm_cnt) { PJ_LOG(1,(THIS_FILE, "TURN Server: ChannelData discarded: invalid channel number")); goto on_return; } /* Relay the data to peer */ + pj_sockaddr_print(&alloc->perm[j], peer_info, sizeof(peer_info), 3); + PJ_LOG(5,(THIS_FILE, "Relaying %d bytes data from client %s to peer %s", + cd.length, client_info, peer_info)); sent = cd.length; pj_activesock_sendto(alloc->sock, &alloc->send_key, pcd+1, &sent, 0, - &alloc->perm[i], - pj_sockaddr_get_len(&alloc->perm[i])); + &alloc->perm[j], + pj_sockaddr_get_len(&alloc->perm[j])); /* Done */ goto on_return; @@ -871,15 +884,15 @@ break; } - if (i==alloc->perm_cnt) { + if (j==alloc->perm_cnt) { if (alloc->perm_cnt==MAX_TURN_PERM) { pj_stun_msg_create_response(pool, req, PJ_STUN_SC_INSUFFICIENT_CAPACITY, NULL, &resp); goto send_pkt; } - pj_sockaddr_cp(&alloc->perm[i], &pa->sockaddr); + pj_sockaddr_cp(&alloc->perm[j], &pa->sockaddr); ++alloc->perm_cnt; } - alloc->chnum[i] = cn; + alloc->chnum[j] = cn; resp = create_success_response(test_srv, alloc, req, pool, 0, &auth_key); diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjnath/src/pjnath-test/stun_sock_test.c asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjnath/src/pjnath-test/stun_sock_test.c --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjnath/src/pjnath-test/stun_sock_test.c 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjnath/src/pjnath-test/stun_sock_test.c 2022-02-24 07:54:38.000000000 +0000 @@ -25,7 +25,6 @@ RESPOND_STUN = 1, WITH_MAPPED = 2, WITH_XOR_MAPPED = 4, - ECHO = 8 }; diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjnath/src/pjnath-test/test.c asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjnath/src/pjnath-test/test.c --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjnath/src/pjnath-test/test.c 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjnath/src/pjnath-test/test.c 2022-02-24 07:54:38.000000000 +0000 @@ -21,14 +21,16 @@ #include #include -void app_perror(const char *msg, pj_status_t rc) +void app_perror_dbg(const char *msg, pj_status_t rc, + const char *file, int line) { char errbuf[256]; PJ_CHECK_STACK(); pj_strerror(rc, errbuf, sizeof(errbuf)); - PJ_LOG(1,("test", "%s: [pj_status_t=%d] %s", msg, rc, errbuf)); + PJ_LOG(1,("test", "%s:%d: %s: [pj_status_t=%d] %s", file, line, msg, + rc, errbuf)); } /* Set socket to nonblocking. */ @@ -168,7 +170,7 @@ pj_pool_factory *mem; -int param_log_decor = PJ_LOG_HAS_NEWLINE | PJ_LOG_HAS_TIME | +int param_log_decor = PJ_LOG_HAS_NEWLINE | PJ_LOG_HAS_TIME | PJ_LOG_HAS_SENDER | PJ_LOG_HAS_MICRO_SEC; pj_log_func *orig_log_func; @@ -204,7 +206,7 @@ rc = pj_init(); if (rc != 0) { app_perror("pj_init() error!!", rc); - return rc; + goto on_return; } pj_dump_config(); @@ -222,6 +224,10 @@ DO_TEST(ice_test()); #endif +#if INCLUDE_TRICKLE_ICE_TEST + DO_TEST(trickle_ice_test()); +#endif + #if INCLUDE_STUN_SOCK_TEST DO_TEST(stun_sock_test()); #endif diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjnath/src/pjnath-test/test.h asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjnath/src/pjnath-test/test.h --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjnath/src/pjnath-test/test.h 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjnath/src/pjnath-test/test.h 2022-02-24 07:54:38.000000000 +0000 @@ -21,8 +21,15 @@ #include #include +#if defined(PJ_EXCLUDE_BENCHMARK_TESTS) && (PJ_EXCLUDE_BENCHMARK_TESTS==1) +# define WITH_BENCHMARK 0 +#else +# define WITH_BENCHMARK 1 +#endif + #define INCLUDE_STUN_TEST 1 #define INCLUDE_ICE_TEST 1 +#define INCLUDE_TRICKLE_ICE_TEST 1 #define INCLUDE_STUN_SOCK_TEST 1 #define INCLUDE_TURN_SOCK_TEST 1 #define INCLUDE_CONCUR_TEST 1 @@ -46,10 +53,13 @@ int stun_sock_test(void); int turn_sock_test(void); int ice_test(void); +int trickle_ice_test(void); int concur_test(void); int test_main(void); -extern void app_perror(const char *title, pj_status_t rc); +#define app_perror(msg, rc) app_perror_dbg(msg, rc, __FILE__, __LINE__) +extern void app_perror_dbg(const char *msg, pj_status_t rc, + const char *file, int line); extern void app_set_sock_nb(pj_sock_t sock); extern pj_pool_factory *mem; diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjproject-vs14.sln asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjproject-vs14.sln --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjproject-vs14.sln 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjproject-vs14.sln 2022-02-24 07:54:38.000000000 +0000 @@ -1,7 +1,7 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 14 -VisualStudioVersion = 14.0.25420.1 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.31515.178 MinimumVisualStudioVersion = 10.0.40219.1 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{1DFF1CF3-DBD7-4DA4-A36D-663D695EB678}" ProjectSection(SolutionItems) = preProject @@ -114,35 +114,42 @@ EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "swig_java_pjsua2", "pjsip-apps\build\swig_java_pjsua2.vcxproj", "{63AC6D7A-5D97-40C2-9AF2-E13AA1F9567C}" EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libwebrtc_aec3", "third_party\build\webrtc_aec3\libwebrtc_aec3.vcxproj", "{D738A812-CE37-40A4-B2FA-D81488C12C87}" +EndProject Global GlobalSection(SharedMSBuildProjectFiles) = preSolution pjsip-apps\src\pjsua\winrt\cli\comp\pjsua_cli_shared_comp.vcxitems*{207e7bd4-7b11-4a40-ba3a-cc627762a7b6}*SharedItemsImports = 4 pjsip-apps\src\pjsua\winrt\cli\comp\pjsua_cli_shared_comp.vcxitems*{45d41acc-2c3c-43d2-bc10-02aa73ffc7c7}*SharedItemsImports = 9 - pjsip-apps\src\pjsua\winrt\cli\comp\pjsua_cli_shared_comp.vcxitems*{e75efd41-c7f5-44c8-8ff1-a310d920989d}*SharedItemsImports = 4 EndGlobalSection GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU Debug|ARM = Debug|ARM + Debug|ARM64 = Debug|ARM64 Debug|Win32 = Debug|Win32 Debug|x64 = Debug|x64 Debug-Dynamic|Any CPU = Debug-Dynamic|Any CPU Debug-Dynamic|ARM = Debug-Dynamic|ARM + Debug-Dynamic|ARM64 = Debug-Dynamic|ARM64 Debug-Dynamic|Win32 = Debug-Dynamic|Win32 Debug-Dynamic|x64 = Debug-Dynamic|x64 Debug-Static|Any CPU = Debug-Static|Any CPU Debug-Static|ARM = Debug-Static|ARM + Debug-Static|ARM64 = Debug-Static|ARM64 Debug-Static|Win32 = Debug-Static|Win32 Debug-Static|x64 = Debug-Static|x64 Release|Any CPU = Release|Any CPU Release|ARM = Release|ARM + Release|ARM64 = Release|ARM64 Release|Win32 = Release|Win32 Release|x64 = Release|x64 Release-Dynamic|Any CPU = Release-Dynamic|Any CPU Release-Dynamic|ARM = Release-Dynamic|ARM + Release-Dynamic|ARM64 = Release-Dynamic|ARM64 Release-Dynamic|Win32 = Release-Dynamic|Win32 Release-Dynamic|x64 = Release-Dynamic|x64 Release-Static|Any CPU = Release-Static|Any CPU Release-Static|ARM = Release-Static|ARM + Release-Static|ARM64 = Release-Static|ARM64 Release-Static|Win32 = Release-Static|Win32 Release-Static|x64 = Release-Static|x64 EndGlobalSection @@ -150,6 +157,8 @@ {DA0E03ED-53A7-4050-8A85-90541C5509F8}.Debug|Any CPU.ActiveCfg = Debug|Win32 {DA0E03ED-53A7-4050-8A85-90541C5509F8}.Debug|ARM.ActiveCfg = Debug|ARM {DA0E03ED-53A7-4050-8A85-90541C5509F8}.Debug|ARM.Build.0 = Debug|ARM + {DA0E03ED-53A7-4050-8A85-90541C5509F8}.Debug|ARM64.ActiveCfg = Debug|ARM64 + {DA0E03ED-53A7-4050-8A85-90541C5509F8}.Debug|ARM64.Build.0 = Debug|ARM64 {DA0E03ED-53A7-4050-8A85-90541C5509F8}.Debug|Win32.ActiveCfg = Debug|Win32 {DA0E03ED-53A7-4050-8A85-90541C5509F8}.Debug|Win32.Build.0 = Debug|Win32 {DA0E03ED-53A7-4050-8A85-90541C5509F8}.Debug|x64.ActiveCfg = Debug|x64 @@ -157,6 +166,8 @@ {DA0E03ED-53A7-4050-8A85-90541C5509F8}.Debug-Dynamic|Any CPU.ActiveCfg = Debug-Dynamic|Win32 {DA0E03ED-53A7-4050-8A85-90541C5509F8}.Debug-Dynamic|ARM.ActiveCfg = Debug-Dynamic|ARM {DA0E03ED-53A7-4050-8A85-90541C5509F8}.Debug-Dynamic|ARM.Build.0 = Debug-Dynamic|ARM + {DA0E03ED-53A7-4050-8A85-90541C5509F8}.Debug-Dynamic|ARM64.ActiveCfg = Debug-Dynamic|ARM64 + {DA0E03ED-53A7-4050-8A85-90541C5509F8}.Debug-Dynamic|ARM64.Build.0 = Debug-Dynamic|ARM64 {DA0E03ED-53A7-4050-8A85-90541C5509F8}.Debug-Dynamic|Win32.ActiveCfg = Debug-Dynamic|Win32 {DA0E03ED-53A7-4050-8A85-90541C5509F8}.Debug-Dynamic|Win32.Build.0 = Debug-Dynamic|Win32 {DA0E03ED-53A7-4050-8A85-90541C5509F8}.Debug-Dynamic|x64.ActiveCfg = Debug-Dynamic|x64 @@ -164,6 +175,8 @@ {DA0E03ED-53A7-4050-8A85-90541C5509F8}.Debug-Static|Any CPU.ActiveCfg = Debug-Static|Win32 {DA0E03ED-53A7-4050-8A85-90541C5509F8}.Debug-Static|ARM.ActiveCfg = Debug-Static|ARM {DA0E03ED-53A7-4050-8A85-90541C5509F8}.Debug-Static|ARM.Build.0 = Debug-Static|ARM + {DA0E03ED-53A7-4050-8A85-90541C5509F8}.Debug-Static|ARM64.ActiveCfg = Debug-Static|ARM64 + {DA0E03ED-53A7-4050-8A85-90541C5509F8}.Debug-Static|ARM64.Build.0 = Debug-Static|ARM64 {DA0E03ED-53A7-4050-8A85-90541C5509F8}.Debug-Static|Win32.ActiveCfg = Debug-Static|Win32 {DA0E03ED-53A7-4050-8A85-90541C5509F8}.Debug-Static|Win32.Build.0 = Debug-Static|Win32 {DA0E03ED-53A7-4050-8A85-90541C5509F8}.Debug-Static|x64.ActiveCfg = Debug-Static|x64 @@ -171,6 +184,8 @@ {DA0E03ED-53A7-4050-8A85-90541C5509F8}.Release|Any CPU.ActiveCfg = Release|Win32 {DA0E03ED-53A7-4050-8A85-90541C5509F8}.Release|ARM.ActiveCfg = Release|ARM {DA0E03ED-53A7-4050-8A85-90541C5509F8}.Release|ARM.Build.0 = Release|ARM + {DA0E03ED-53A7-4050-8A85-90541C5509F8}.Release|ARM64.ActiveCfg = Release|ARM64 + {DA0E03ED-53A7-4050-8A85-90541C5509F8}.Release|ARM64.Build.0 = Release|ARM64 {DA0E03ED-53A7-4050-8A85-90541C5509F8}.Release|Win32.ActiveCfg = Release|Win32 {DA0E03ED-53A7-4050-8A85-90541C5509F8}.Release|Win32.Build.0 = Release|Win32 {DA0E03ED-53A7-4050-8A85-90541C5509F8}.Release|x64.ActiveCfg = Release|x64 @@ -178,6 +193,8 @@ {DA0E03ED-53A7-4050-8A85-90541C5509F8}.Release-Dynamic|Any CPU.ActiveCfg = Release-Dynamic|Win32 {DA0E03ED-53A7-4050-8A85-90541C5509F8}.Release-Dynamic|ARM.ActiveCfg = Release-Dynamic|ARM {DA0E03ED-53A7-4050-8A85-90541C5509F8}.Release-Dynamic|ARM.Build.0 = Release-Dynamic|ARM + {DA0E03ED-53A7-4050-8A85-90541C5509F8}.Release-Dynamic|ARM64.ActiveCfg = Release-Dynamic|ARM64 + {DA0E03ED-53A7-4050-8A85-90541C5509F8}.Release-Dynamic|ARM64.Build.0 = Release-Dynamic|ARM64 {DA0E03ED-53A7-4050-8A85-90541C5509F8}.Release-Dynamic|Win32.ActiveCfg = Release-Dynamic|Win32 {DA0E03ED-53A7-4050-8A85-90541C5509F8}.Release-Dynamic|Win32.Build.0 = Release-Dynamic|Win32 {DA0E03ED-53A7-4050-8A85-90541C5509F8}.Release-Dynamic|x64.ActiveCfg = Release-Dynamic|x64 @@ -185,6 +202,8 @@ {DA0E03ED-53A7-4050-8A85-90541C5509F8}.Release-Static|Any CPU.ActiveCfg = Release-Static|Win32 {DA0E03ED-53A7-4050-8A85-90541C5509F8}.Release-Static|ARM.ActiveCfg = Release-Static|ARM {DA0E03ED-53A7-4050-8A85-90541C5509F8}.Release-Static|ARM.Build.0 = Release-Static|ARM + {DA0E03ED-53A7-4050-8A85-90541C5509F8}.Release-Static|ARM64.ActiveCfg = Release-Static|ARM64 + {DA0E03ED-53A7-4050-8A85-90541C5509F8}.Release-Static|ARM64.Build.0 = Release-Static|ARM64 {DA0E03ED-53A7-4050-8A85-90541C5509F8}.Release-Static|Win32.ActiveCfg = Release-Static|Win32 {DA0E03ED-53A7-4050-8A85-90541C5509F8}.Release-Static|Win32.Build.0 = Release-Static|Win32 {DA0E03ED-53A7-4050-8A85-90541C5509F8}.Release-Static|x64.ActiveCfg = Release-Static|x64 @@ -192,36 +211,48 @@ {6AC3EF61-5A9E-4F43-A809-5B2FD1A43B16}.Debug|Any CPU.ActiveCfg = Debug|Win32 {6AC3EF61-5A9E-4F43-A809-5B2FD1A43B16}.Debug|ARM.ActiveCfg = Debug|ARM {6AC3EF61-5A9E-4F43-A809-5B2FD1A43B16}.Debug|ARM.Build.0 = Debug|ARM + {6AC3EF61-5A9E-4F43-A809-5B2FD1A43B16}.Debug|ARM64.ActiveCfg = Debug|ARM64 + {6AC3EF61-5A9E-4F43-A809-5B2FD1A43B16}.Debug|ARM64.Build.0 = Debug|ARM64 {6AC3EF61-5A9E-4F43-A809-5B2FD1A43B16}.Debug|Win32.ActiveCfg = Debug|Win32 {6AC3EF61-5A9E-4F43-A809-5B2FD1A43B16}.Debug|Win32.Build.0 = Debug|Win32 {6AC3EF61-5A9E-4F43-A809-5B2FD1A43B16}.Debug|x64.ActiveCfg = Debug|x64 {6AC3EF61-5A9E-4F43-A809-5B2FD1A43B16}.Debug|x64.Build.0 = Debug|x64 {6AC3EF61-5A9E-4F43-A809-5B2FD1A43B16}.Debug-Dynamic|Any CPU.ActiveCfg = Debug-Dynamic|Win32 {6AC3EF61-5A9E-4F43-A809-5B2FD1A43B16}.Debug-Dynamic|ARM.ActiveCfg = Debug-Dynamic|Win32 + {6AC3EF61-5A9E-4F43-A809-5B2FD1A43B16}.Debug-Dynamic|ARM64.ActiveCfg = Debug-Dynamic|ARM64 + {6AC3EF61-5A9E-4F43-A809-5B2FD1A43B16}.Debug-Dynamic|ARM64.Build.0 = Debug-Dynamic|ARM64 {6AC3EF61-5A9E-4F43-A809-5B2FD1A43B16}.Debug-Dynamic|Win32.ActiveCfg = Debug-Dynamic|Win32 {6AC3EF61-5A9E-4F43-A809-5B2FD1A43B16}.Debug-Dynamic|Win32.Build.0 = Debug-Dynamic|Win32 {6AC3EF61-5A9E-4F43-A809-5B2FD1A43B16}.Debug-Dynamic|x64.ActiveCfg = Debug-Dynamic|x64 {6AC3EF61-5A9E-4F43-A809-5B2FD1A43B16}.Debug-Dynamic|x64.Build.0 = Debug-Dynamic|x64 {6AC3EF61-5A9E-4F43-A809-5B2FD1A43B16}.Debug-Static|Any CPU.ActiveCfg = Debug-Static|Win32 {6AC3EF61-5A9E-4F43-A809-5B2FD1A43B16}.Debug-Static|ARM.ActiveCfg = Debug-Static|Win32 + {6AC3EF61-5A9E-4F43-A809-5B2FD1A43B16}.Debug-Static|ARM64.ActiveCfg = Debug-Static|ARM64 + {6AC3EF61-5A9E-4F43-A809-5B2FD1A43B16}.Debug-Static|ARM64.Build.0 = Debug-Static|ARM64 {6AC3EF61-5A9E-4F43-A809-5B2FD1A43B16}.Debug-Static|Win32.ActiveCfg = Debug-Static|Win32 {6AC3EF61-5A9E-4F43-A809-5B2FD1A43B16}.Debug-Static|Win32.Build.0 = Debug-Static|Win32 {6AC3EF61-5A9E-4F43-A809-5B2FD1A43B16}.Debug-Static|x64.ActiveCfg = Debug-Static|x64 {6AC3EF61-5A9E-4F43-A809-5B2FD1A43B16}.Debug-Static|x64.Build.0 = Debug-Static|x64 {6AC3EF61-5A9E-4F43-A809-5B2FD1A43B16}.Release|Any CPU.ActiveCfg = Release|Win32 {6AC3EF61-5A9E-4F43-A809-5B2FD1A43B16}.Release|ARM.ActiveCfg = Release|Win32 + {6AC3EF61-5A9E-4F43-A809-5B2FD1A43B16}.Release|ARM64.ActiveCfg = Release|ARM64 + {6AC3EF61-5A9E-4F43-A809-5B2FD1A43B16}.Release|ARM64.Build.0 = Release|ARM64 {6AC3EF61-5A9E-4F43-A809-5B2FD1A43B16}.Release|Win32.ActiveCfg = Release|Win32 {6AC3EF61-5A9E-4F43-A809-5B2FD1A43B16}.Release|Win32.Build.0 = Release|Win32 {6AC3EF61-5A9E-4F43-A809-5B2FD1A43B16}.Release|x64.ActiveCfg = Release|x64 {6AC3EF61-5A9E-4F43-A809-5B2FD1A43B16}.Release|x64.Build.0 = Release|x64 {6AC3EF61-5A9E-4F43-A809-5B2FD1A43B16}.Release-Dynamic|Any CPU.ActiveCfg = Release-Dynamic|Win32 {6AC3EF61-5A9E-4F43-A809-5B2FD1A43B16}.Release-Dynamic|ARM.ActiveCfg = Release-Dynamic|Win32 + {6AC3EF61-5A9E-4F43-A809-5B2FD1A43B16}.Release-Dynamic|ARM64.ActiveCfg = Release-Dynamic|ARM64 + {6AC3EF61-5A9E-4F43-A809-5B2FD1A43B16}.Release-Dynamic|ARM64.Build.0 = Release-Dynamic|ARM64 {6AC3EF61-5A9E-4F43-A809-5B2FD1A43B16}.Release-Dynamic|Win32.ActiveCfg = Release-Dynamic|Win32 {6AC3EF61-5A9E-4F43-A809-5B2FD1A43B16}.Release-Dynamic|Win32.Build.0 = Release-Dynamic|Win32 {6AC3EF61-5A9E-4F43-A809-5B2FD1A43B16}.Release-Dynamic|x64.ActiveCfg = Release-Dynamic|x64 {6AC3EF61-5A9E-4F43-A809-5B2FD1A43B16}.Release-Dynamic|x64.Build.0 = Release-Dynamic|x64 {6AC3EF61-5A9E-4F43-A809-5B2FD1A43B16}.Release-Static|Any CPU.ActiveCfg = Release-Static|Win32 {6AC3EF61-5A9E-4F43-A809-5B2FD1A43B16}.Release-Static|ARM.ActiveCfg = Release-Static|Win32 + {6AC3EF61-5A9E-4F43-A809-5B2FD1A43B16}.Release-Static|ARM64.ActiveCfg = Release-Static|ARM64 + {6AC3EF61-5A9E-4F43-A809-5B2FD1A43B16}.Release-Static|ARM64.Build.0 = Release-Static|ARM64 {6AC3EF61-5A9E-4F43-A809-5B2FD1A43B16}.Release-Static|Win32.ActiveCfg = Release-Static|Win32 {6AC3EF61-5A9E-4F43-A809-5B2FD1A43B16}.Release-Static|Win32.Build.0 = Release-Static|Win32 {6AC3EF61-5A9E-4F43-A809-5B2FD1A43B16}.Release-Static|x64.ActiveCfg = Release-Static|x64 @@ -229,6 +260,8 @@ {FE07F272-AE7F-4549-9E9F-EF9B80CB1693}.Debug|Any CPU.ActiveCfg = Debug|Win32 {FE07F272-AE7F-4549-9E9F-EF9B80CB1693}.Debug|ARM.ActiveCfg = Debug|ARM {FE07F272-AE7F-4549-9E9F-EF9B80CB1693}.Debug|ARM.Build.0 = Debug|ARM + {FE07F272-AE7F-4549-9E9F-EF9B80CB1693}.Debug|ARM64.ActiveCfg = Debug|ARM64 + {FE07F272-AE7F-4549-9E9F-EF9B80CB1693}.Debug|ARM64.Build.0 = Debug|ARM64 {FE07F272-AE7F-4549-9E9F-EF9B80CB1693}.Debug|Win32.ActiveCfg = Debug|Win32 {FE07F272-AE7F-4549-9E9F-EF9B80CB1693}.Debug|Win32.Build.0 = Debug|Win32 {FE07F272-AE7F-4549-9E9F-EF9B80CB1693}.Debug|x64.ActiveCfg = Debug|x64 @@ -236,6 +269,8 @@ {FE07F272-AE7F-4549-9E9F-EF9B80CB1693}.Debug-Dynamic|Any CPU.ActiveCfg = Debug-Dynamic|Win32 {FE07F272-AE7F-4549-9E9F-EF9B80CB1693}.Debug-Dynamic|ARM.ActiveCfg = Debug-Dynamic|ARM {FE07F272-AE7F-4549-9E9F-EF9B80CB1693}.Debug-Dynamic|ARM.Build.0 = Debug-Dynamic|ARM + {FE07F272-AE7F-4549-9E9F-EF9B80CB1693}.Debug-Dynamic|ARM64.ActiveCfg = Debug-Dynamic|ARM64 + {FE07F272-AE7F-4549-9E9F-EF9B80CB1693}.Debug-Dynamic|ARM64.Build.0 = Debug-Dynamic|ARM64 {FE07F272-AE7F-4549-9E9F-EF9B80CB1693}.Debug-Dynamic|Win32.ActiveCfg = Debug-Dynamic|Win32 {FE07F272-AE7F-4549-9E9F-EF9B80CB1693}.Debug-Dynamic|Win32.Build.0 = Debug-Dynamic|Win32 {FE07F272-AE7F-4549-9E9F-EF9B80CB1693}.Debug-Dynamic|x64.ActiveCfg = Debug-Dynamic|x64 @@ -243,6 +278,8 @@ {FE07F272-AE7F-4549-9E9F-EF9B80CB1693}.Debug-Static|Any CPU.ActiveCfg = Debug-Static|Win32 {FE07F272-AE7F-4549-9E9F-EF9B80CB1693}.Debug-Static|ARM.ActiveCfg = Debug-Static|ARM {FE07F272-AE7F-4549-9E9F-EF9B80CB1693}.Debug-Static|ARM.Build.0 = Debug-Static|ARM + {FE07F272-AE7F-4549-9E9F-EF9B80CB1693}.Debug-Static|ARM64.ActiveCfg = Debug-Static|ARM64 + {FE07F272-AE7F-4549-9E9F-EF9B80CB1693}.Debug-Static|ARM64.Build.0 = Debug-Static|ARM64 {FE07F272-AE7F-4549-9E9F-EF9B80CB1693}.Debug-Static|Win32.ActiveCfg = Debug-Static|Win32 {FE07F272-AE7F-4549-9E9F-EF9B80CB1693}.Debug-Static|Win32.Build.0 = Debug-Static|Win32 {FE07F272-AE7F-4549-9E9F-EF9B80CB1693}.Debug-Static|x64.ActiveCfg = Debug-Static|x64 @@ -250,6 +287,8 @@ {FE07F272-AE7F-4549-9E9F-EF9B80CB1693}.Release|Any CPU.ActiveCfg = Release|Win32 {FE07F272-AE7F-4549-9E9F-EF9B80CB1693}.Release|ARM.ActiveCfg = Release|ARM {FE07F272-AE7F-4549-9E9F-EF9B80CB1693}.Release|ARM.Build.0 = Release|ARM + {FE07F272-AE7F-4549-9E9F-EF9B80CB1693}.Release|ARM64.ActiveCfg = Release|ARM64 + {FE07F272-AE7F-4549-9E9F-EF9B80CB1693}.Release|ARM64.Build.0 = Release|ARM64 {FE07F272-AE7F-4549-9E9F-EF9B80CB1693}.Release|Win32.ActiveCfg = Release|Win32 {FE07F272-AE7F-4549-9E9F-EF9B80CB1693}.Release|Win32.Build.0 = Release|Win32 {FE07F272-AE7F-4549-9E9F-EF9B80CB1693}.Release|x64.ActiveCfg = Release|x64 @@ -257,6 +296,8 @@ {FE07F272-AE7F-4549-9E9F-EF9B80CB1693}.Release-Dynamic|Any CPU.ActiveCfg = Release-Dynamic|Win32 {FE07F272-AE7F-4549-9E9F-EF9B80CB1693}.Release-Dynamic|ARM.ActiveCfg = Release-Dynamic|ARM {FE07F272-AE7F-4549-9E9F-EF9B80CB1693}.Release-Dynamic|ARM.Build.0 = Release-Dynamic|ARM + {FE07F272-AE7F-4549-9E9F-EF9B80CB1693}.Release-Dynamic|ARM64.ActiveCfg = Release-Dynamic|ARM64 + {FE07F272-AE7F-4549-9E9F-EF9B80CB1693}.Release-Dynamic|ARM64.Build.0 = Release-Dynamic|ARM64 {FE07F272-AE7F-4549-9E9F-EF9B80CB1693}.Release-Dynamic|Win32.ActiveCfg = Release-Dynamic|Win32 {FE07F272-AE7F-4549-9E9F-EF9B80CB1693}.Release-Dynamic|Win32.Build.0 = Release-Dynamic|Win32 {FE07F272-AE7F-4549-9E9F-EF9B80CB1693}.Release-Dynamic|x64.ActiveCfg = Release-Dynamic|x64 @@ -264,42 +305,56 @@ {FE07F272-AE7F-4549-9E9F-EF9B80CB1693}.Release-Static|Any CPU.ActiveCfg = Release-Static|Win32 {FE07F272-AE7F-4549-9E9F-EF9B80CB1693}.Release-Static|ARM.ActiveCfg = Release-Static|ARM {FE07F272-AE7F-4549-9E9F-EF9B80CB1693}.Release-Static|ARM.Build.0 = Release-Static|ARM + {FE07F272-AE7F-4549-9E9F-EF9B80CB1693}.Release-Static|ARM64.ActiveCfg = Release-Static|ARM64 + {FE07F272-AE7F-4549-9E9F-EF9B80CB1693}.Release-Static|ARM64.Build.0 = Release-Static|ARM64 {FE07F272-AE7F-4549-9E9F-EF9B80CB1693}.Release-Static|Win32.ActiveCfg = Release-Static|Win32 {FE07F272-AE7F-4549-9E9F-EF9B80CB1693}.Release-Static|Win32.Build.0 = Release-Static|Win32 {FE07F272-AE7F-4549-9E9F-EF9B80CB1693}.Release-Static|x64.ActiveCfg = Release-Static|x64 {FE07F272-AE7F-4549-9E9F-EF9B80CB1693}.Release-Static|x64.Build.0 = Release-Static|x64 {ED02BE13-8297-4770-8097-27DC2CCABF9A}.Debug|Any CPU.ActiveCfg = Debug|Win32 {ED02BE13-8297-4770-8097-27DC2CCABF9A}.Debug|ARM.ActiveCfg = Debug|Win32 + {ED02BE13-8297-4770-8097-27DC2CCABF9A}.Debug|ARM64.ActiveCfg = Debug|ARM64 + {ED02BE13-8297-4770-8097-27DC2CCABF9A}.Debug|ARM64.Build.0 = Debug|ARM64 {ED02BE13-8297-4770-8097-27DC2CCABF9A}.Debug|Win32.ActiveCfg = Debug|Win32 {ED02BE13-8297-4770-8097-27DC2CCABF9A}.Debug|Win32.Build.0 = Debug|Win32 {ED02BE13-8297-4770-8097-27DC2CCABF9A}.Debug|x64.ActiveCfg = Debug|x64 {ED02BE13-8297-4770-8097-27DC2CCABF9A}.Debug|x64.Build.0 = Debug|x64 {ED02BE13-8297-4770-8097-27DC2CCABF9A}.Debug-Dynamic|Any CPU.ActiveCfg = Debug-Dynamic|Win32 {ED02BE13-8297-4770-8097-27DC2CCABF9A}.Debug-Dynamic|ARM.ActiveCfg = Debug-Dynamic|Win32 + {ED02BE13-8297-4770-8097-27DC2CCABF9A}.Debug-Dynamic|ARM64.ActiveCfg = Debug-Dynamic|ARM64 + {ED02BE13-8297-4770-8097-27DC2CCABF9A}.Debug-Dynamic|ARM64.Build.0 = Debug-Dynamic|ARM64 {ED02BE13-8297-4770-8097-27DC2CCABF9A}.Debug-Dynamic|Win32.ActiveCfg = Debug-Dynamic|Win32 {ED02BE13-8297-4770-8097-27DC2CCABF9A}.Debug-Dynamic|Win32.Build.0 = Debug-Dynamic|Win32 {ED02BE13-8297-4770-8097-27DC2CCABF9A}.Debug-Dynamic|x64.ActiveCfg = Debug-Dynamic|x64 {ED02BE13-8297-4770-8097-27DC2CCABF9A}.Debug-Dynamic|x64.Build.0 = Debug-Dynamic|x64 {ED02BE13-8297-4770-8097-27DC2CCABF9A}.Debug-Static|Any CPU.ActiveCfg = Debug-Static|Win32 {ED02BE13-8297-4770-8097-27DC2CCABF9A}.Debug-Static|ARM.ActiveCfg = Debug-Static|Win32 + {ED02BE13-8297-4770-8097-27DC2CCABF9A}.Debug-Static|ARM64.ActiveCfg = Debug-Static|ARM64 + {ED02BE13-8297-4770-8097-27DC2CCABF9A}.Debug-Static|ARM64.Build.0 = Debug-Static|ARM64 {ED02BE13-8297-4770-8097-27DC2CCABF9A}.Debug-Static|Win32.ActiveCfg = Debug-Static|Win32 {ED02BE13-8297-4770-8097-27DC2CCABF9A}.Debug-Static|Win32.Build.0 = Debug-Static|Win32 {ED02BE13-8297-4770-8097-27DC2CCABF9A}.Debug-Static|x64.ActiveCfg = Debug-Static|x64 {ED02BE13-8297-4770-8097-27DC2CCABF9A}.Debug-Static|x64.Build.0 = Debug-Static|x64 {ED02BE13-8297-4770-8097-27DC2CCABF9A}.Release|Any CPU.ActiveCfg = Release|Win32 {ED02BE13-8297-4770-8097-27DC2CCABF9A}.Release|ARM.ActiveCfg = Release|Win32 + {ED02BE13-8297-4770-8097-27DC2CCABF9A}.Release|ARM64.ActiveCfg = Release|ARM64 + {ED02BE13-8297-4770-8097-27DC2CCABF9A}.Release|ARM64.Build.0 = Release|ARM64 {ED02BE13-8297-4770-8097-27DC2CCABF9A}.Release|Win32.ActiveCfg = Release|Win32 {ED02BE13-8297-4770-8097-27DC2CCABF9A}.Release|Win32.Build.0 = Release|Win32 {ED02BE13-8297-4770-8097-27DC2CCABF9A}.Release|x64.ActiveCfg = Release|x64 {ED02BE13-8297-4770-8097-27DC2CCABF9A}.Release|x64.Build.0 = Release|x64 {ED02BE13-8297-4770-8097-27DC2CCABF9A}.Release-Dynamic|Any CPU.ActiveCfg = Release-Dynamic|Win32 {ED02BE13-8297-4770-8097-27DC2CCABF9A}.Release-Dynamic|ARM.ActiveCfg = Release-Dynamic|Win32 + {ED02BE13-8297-4770-8097-27DC2CCABF9A}.Release-Dynamic|ARM64.ActiveCfg = Release-Dynamic|ARM64 + {ED02BE13-8297-4770-8097-27DC2CCABF9A}.Release-Dynamic|ARM64.Build.0 = Release-Dynamic|ARM64 {ED02BE13-8297-4770-8097-27DC2CCABF9A}.Release-Dynamic|Win32.ActiveCfg = Release-Dynamic|Win32 {ED02BE13-8297-4770-8097-27DC2CCABF9A}.Release-Dynamic|Win32.Build.0 = Release-Dynamic|Win32 {ED02BE13-8297-4770-8097-27DC2CCABF9A}.Release-Dynamic|x64.ActiveCfg = Release-Dynamic|x64 {ED02BE13-8297-4770-8097-27DC2CCABF9A}.Release-Dynamic|x64.Build.0 = Release-Dynamic|x64 {ED02BE13-8297-4770-8097-27DC2CCABF9A}.Release-Static|Any CPU.ActiveCfg = Release-Static|Win32 {ED02BE13-8297-4770-8097-27DC2CCABF9A}.Release-Static|ARM.ActiveCfg = Release-Static|Win32 + {ED02BE13-8297-4770-8097-27DC2CCABF9A}.Release-Static|ARM64.ActiveCfg = Release-Static|ARM64 + {ED02BE13-8297-4770-8097-27DC2CCABF9A}.Release-Static|ARM64.Build.0 = Release-Static|ARM64 {ED02BE13-8297-4770-8097-27DC2CCABF9A}.Release-Static|Win32.ActiveCfg = Release-Static|Win32 {ED02BE13-8297-4770-8097-27DC2CCABF9A}.Release-Static|Win32.Build.0 = Release-Static|Win32 {ED02BE13-8297-4770-8097-27DC2CCABF9A}.Release-Static|x64.ActiveCfg = Release-Static|x64 @@ -307,6 +362,8 @@ {7FDE3880-A4AB-49E3-B439-EBEF0A0C7A65}.Debug|Any CPU.ActiveCfg = Debug|Win32 {7FDE3880-A4AB-49E3-B439-EBEF0A0C7A65}.Debug|ARM.ActiveCfg = Debug|ARM {7FDE3880-A4AB-49E3-B439-EBEF0A0C7A65}.Debug|ARM.Build.0 = Debug|ARM + {7FDE3880-A4AB-49E3-B439-EBEF0A0C7A65}.Debug|ARM64.ActiveCfg = Debug|ARM64 + {7FDE3880-A4AB-49E3-B439-EBEF0A0C7A65}.Debug|ARM64.Build.0 = Debug|ARM64 {7FDE3880-A4AB-49E3-B439-EBEF0A0C7A65}.Debug|Win32.ActiveCfg = Debug|Win32 {7FDE3880-A4AB-49E3-B439-EBEF0A0C7A65}.Debug|Win32.Build.0 = Debug|Win32 {7FDE3880-A4AB-49E3-B439-EBEF0A0C7A65}.Debug|x64.ActiveCfg = Debug|x64 @@ -314,6 +371,8 @@ {7FDE3880-A4AB-49E3-B439-EBEF0A0C7A65}.Debug-Dynamic|Any CPU.ActiveCfg = Debug-Dynamic|Win32 {7FDE3880-A4AB-49E3-B439-EBEF0A0C7A65}.Debug-Dynamic|ARM.ActiveCfg = Debug-Dynamic|ARM {7FDE3880-A4AB-49E3-B439-EBEF0A0C7A65}.Debug-Dynamic|ARM.Build.0 = Debug-Dynamic|ARM + {7FDE3880-A4AB-49E3-B439-EBEF0A0C7A65}.Debug-Dynamic|ARM64.ActiveCfg = Debug-Dynamic|ARM64 + {7FDE3880-A4AB-49E3-B439-EBEF0A0C7A65}.Debug-Dynamic|ARM64.Build.0 = Debug-Dynamic|ARM64 {7FDE3880-A4AB-49E3-B439-EBEF0A0C7A65}.Debug-Dynamic|Win32.ActiveCfg = Debug-Dynamic|Win32 {7FDE3880-A4AB-49E3-B439-EBEF0A0C7A65}.Debug-Dynamic|Win32.Build.0 = Debug-Dynamic|Win32 {7FDE3880-A4AB-49E3-B439-EBEF0A0C7A65}.Debug-Dynamic|x64.ActiveCfg = Debug-Dynamic|x64 @@ -321,6 +380,8 @@ {7FDE3880-A4AB-49E3-B439-EBEF0A0C7A65}.Debug-Static|Any CPU.ActiveCfg = Debug-Static|Win32 {7FDE3880-A4AB-49E3-B439-EBEF0A0C7A65}.Debug-Static|ARM.ActiveCfg = Debug-Static|ARM {7FDE3880-A4AB-49E3-B439-EBEF0A0C7A65}.Debug-Static|ARM.Build.0 = Debug-Static|ARM + {7FDE3880-A4AB-49E3-B439-EBEF0A0C7A65}.Debug-Static|ARM64.ActiveCfg = Debug-Static|ARM64 + {7FDE3880-A4AB-49E3-B439-EBEF0A0C7A65}.Debug-Static|ARM64.Build.0 = Debug-Static|ARM64 {7FDE3880-A4AB-49E3-B439-EBEF0A0C7A65}.Debug-Static|Win32.ActiveCfg = Debug-Static|Win32 {7FDE3880-A4AB-49E3-B439-EBEF0A0C7A65}.Debug-Static|Win32.Build.0 = Debug-Static|Win32 {7FDE3880-A4AB-49E3-B439-EBEF0A0C7A65}.Debug-Static|x64.ActiveCfg = Debug-Static|x64 @@ -328,6 +389,8 @@ {7FDE3880-A4AB-49E3-B439-EBEF0A0C7A65}.Release|Any CPU.ActiveCfg = Release|Win32 {7FDE3880-A4AB-49E3-B439-EBEF0A0C7A65}.Release|ARM.ActiveCfg = Release|ARM {7FDE3880-A4AB-49E3-B439-EBEF0A0C7A65}.Release|ARM.Build.0 = Release|ARM + {7FDE3880-A4AB-49E3-B439-EBEF0A0C7A65}.Release|ARM64.ActiveCfg = Release|ARM64 + {7FDE3880-A4AB-49E3-B439-EBEF0A0C7A65}.Release|ARM64.Build.0 = Release|ARM64 {7FDE3880-A4AB-49E3-B439-EBEF0A0C7A65}.Release|Win32.ActiveCfg = Release|Win32 {7FDE3880-A4AB-49E3-B439-EBEF0A0C7A65}.Release|Win32.Build.0 = Release|Win32 {7FDE3880-A4AB-49E3-B439-EBEF0A0C7A65}.Release|x64.ActiveCfg = Release|x64 @@ -335,6 +398,8 @@ {7FDE3880-A4AB-49E3-B439-EBEF0A0C7A65}.Release-Dynamic|Any CPU.ActiveCfg = Release-Dynamic|Win32 {7FDE3880-A4AB-49E3-B439-EBEF0A0C7A65}.Release-Dynamic|ARM.ActiveCfg = Release-Dynamic|ARM {7FDE3880-A4AB-49E3-B439-EBEF0A0C7A65}.Release-Dynamic|ARM.Build.0 = Release-Dynamic|ARM + {7FDE3880-A4AB-49E3-B439-EBEF0A0C7A65}.Release-Dynamic|ARM64.ActiveCfg = Release-Dynamic|ARM64 + {7FDE3880-A4AB-49E3-B439-EBEF0A0C7A65}.Release-Dynamic|ARM64.Build.0 = Release-Dynamic|ARM64 {7FDE3880-A4AB-49E3-B439-EBEF0A0C7A65}.Release-Dynamic|Win32.ActiveCfg = Release-Dynamic|Win32 {7FDE3880-A4AB-49E3-B439-EBEF0A0C7A65}.Release-Dynamic|Win32.Build.0 = Release-Dynamic|Win32 {7FDE3880-A4AB-49E3-B439-EBEF0A0C7A65}.Release-Dynamic|x64.ActiveCfg = Release-Dynamic|x64 @@ -342,6 +407,8 @@ {7FDE3880-A4AB-49E3-B439-EBEF0A0C7A65}.Release-Static|Any CPU.ActiveCfg = Release-Static|Win32 {7FDE3880-A4AB-49E3-B439-EBEF0A0C7A65}.Release-Static|ARM.ActiveCfg = Release-Static|ARM {7FDE3880-A4AB-49E3-B439-EBEF0A0C7A65}.Release-Static|ARM.Build.0 = Release-Static|ARM + {7FDE3880-A4AB-49E3-B439-EBEF0A0C7A65}.Release-Static|ARM64.ActiveCfg = Release-Static|ARM64 + {7FDE3880-A4AB-49E3-B439-EBEF0A0C7A65}.Release-Static|ARM64.Build.0 = Release-Static|ARM64 {7FDE3880-A4AB-49E3-B439-EBEF0A0C7A65}.Release-Static|Win32.ActiveCfg = Release-Static|Win32 {7FDE3880-A4AB-49E3-B439-EBEF0A0C7A65}.Release-Static|Win32.Build.0 = Release-Static|Win32 {7FDE3880-A4AB-49E3-B439-EBEF0A0C7A65}.Release-Static|x64.ActiveCfg = Release-Static|x64 @@ -349,6 +416,8 @@ {855DC8C0-D3E9-4A2E-AE47-116605A7BC9B}.Debug|Any CPU.ActiveCfg = Debug|Win32 {855DC8C0-D3E9-4A2E-AE47-116605A7BC9B}.Debug|ARM.ActiveCfg = Debug|ARM {855DC8C0-D3E9-4A2E-AE47-116605A7BC9B}.Debug|ARM.Build.0 = Debug|ARM + {855DC8C0-D3E9-4A2E-AE47-116605A7BC9B}.Debug|ARM64.ActiveCfg = Debug|ARM64 + {855DC8C0-D3E9-4A2E-AE47-116605A7BC9B}.Debug|ARM64.Build.0 = Debug|ARM64 {855DC8C0-D3E9-4A2E-AE47-116605A7BC9B}.Debug|Win32.ActiveCfg = Debug|Win32 {855DC8C0-D3E9-4A2E-AE47-116605A7BC9B}.Debug|Win32.Build.0 = Debug|Win32 {855DC8C0-D3E9-4A2E-AE47-116605A7BC9B}.Debug|x64.ActiveCfg = Debug|x64 @@ -356,6 +425,8 @@ {855DC8C0-D3E9-4A2E-AE47-116605A7BC9B}.Debug-Dynamic|Any CPU.ActiveCfg = Debug-Dynamic|Win32 {855DC8C0-D3E9-4A2E-AE47-116605A7BC9B}.Debug-Dynamic|ARM.ActiveCfg = Debug-Dynamic|ARM {855DC8C0-D3E9-4A2E-AE47-116605A7BC9B}.Debug-Dynamic|ARM.Build.0 = Debug-Dynamic|ARM + {855DC8C0-D3E9-4A2E-AE47-116605A7BC9B}.Debug-Dynamic|ARM64.ActiveCfg = Debug-Dynamic|ARM64 + {855DC8C0-D3E9-4A2E-AE47-116605A7BC9B}.Debug-Dynamic|ARM64.Build.0 = Debug-Dynamic|ARM64 {855DC8C0-D3E9-4A2E-AE47-116605A7BC9B}.Debug-Dynamic|Win32.ActiveCfg = Debug-Dynamic|Win32 {855DC8C0-D3E9-4A2E-AE47-116605A7BC9B}.Debug-Dynamic|Win32.Build.0 = Debug-Dynamic|Win32 {855DC8C0-D3E9-4A2E-AE47-116605A7BC9B}.Debug-Dynamic|x64.ActiveCfg = Debug-Dynamic|x64 @@ -363,6 +434,8 @@ {855DC8C0-D3E9-4A2E-AE47-116605A7BC9B}.Debug-Static|Any CPU.ActiveCfg = Debug-Static|Win32 {855DC8C0-D3E9-4A2E-AE47-116605A7BC9B}.Debug-Static|ARM.ActiveCfg = Debug-Static|ARM {855DC8C0-D3E9-4A2E-AE47-116605A7BC9B}.Debug-Static|ARM.Build.0 = Debug-Static|ARM + {855DC8C0-D3E9-4A2E-AE47-116605A7BC9B}.Debug-Static|ARM64.ActiveCfg = Debug-Static|ARM64 + {855DC8C0-D3E9-4A2E-AE47-116605A7BC9B}.Debug-Static|ARM64.Build.0 = Debug-Static|ARM64 {855DC8C0-D3E9-4A2E-AE47-116605A7BC9B}.Debug-Static|Win32.ActiveCfg = Debug-Static|Win32 {855DC8C0-D3E9-4A2E-AE47-116605A7BC9B}.Debug-Static|Win32.Build.0 = Debug-Static|Win32 {855DC8C0-D3E9-4A2E-AE47-116605A7BC9B}.Debug-Static|x64.ActiveCfg = Debug-Static|x64 @@ -370,6 +443,8 @@ {855DC8C0-D3E9-4A2E-AE47-116605A7BC9B}.Release|Any CPU.ActiveCfg = Release|Win32 {855DC8C0-D3E9-4A2E-AE47-116605A7BC9B}.Release|ARM.ActiveCfg = Release|ARM {855DC8C0-D3E9-4A2E-AE47-116605A7BC9B}.Release|ARM.Build.0 = Release|ARM + {855DC8C0-D3E9-4A2E-AE47-116605A7BC9B}.Release|ARM64.ActiveCfg = Release|ARM64 + {855DC8C0-D3E9-4A2E-AE47-116605A7BC9B}.Release|ARM64.Build.0 = Release|ARM64 {855DC8C0-D3E9-4A2E-AE47-116605A7BC9B}.Release|Win32.ActiveCfg = Release|Win32 {855DC8C0-D3E9-4A2E-AE47-116605A7BC9B}.Release|Win32.Build.0 = Release|Win32 {855DC8C0-D3E9-4A2E-AE47-116605A7BC9B}.Release|x64.ActiveCfg = Release|x64 @@ -377,6 +452,8 @@ {855DC8C0-D3E9-4A2E-AE47-116605A7BC9B}.Release-Dynamic|Any CPU.ActiveCfg = Release-Dynamic|Win32 {855DC8C0-D3E9-4A2E-AE47-116605A7BC9B}.Release-Dynamic|ARM.ActiveCfg = Release-Dynamic|ARM {855DC8C0-D3E9-4A2E-AE47-116605A7BC9B}.Release-Dynamic|ARM.Build.0 = Release-Dynamic|ARM + {855DC8C0-D3E9-4A2E-AE47-116605A7BC9B}.Release-Dynamic|ARM64.ActiveCfg = Release-Dynamic|ARM64 + {855DC8C0-D3E9-4A2E-AE47-116605A7BC9B}.Release-Dynamic|ARM64.Build.0 = Release-Dynamic|ARM64 {855DC8C0-D3E9-4A2E-AE47-116605A7BC9B}.Release-Dynamic|Win32.ActiveCfg = Release-Dynamic|Win32 {855DC8C0-D3E9-4A2E-AE47-116605A7BC9B}.Release-Dynamic|Win32.Build.0 = Release-Dynamic|Win32 {855DC8C0-D3E9-4A2E-AE47-116605A7BC9B}.Release-Dynamic|x64.ActiveCfg = Release-Dynamic|x64 @@ -384,6 +461,8 @@ {855DC8C0-D3E9-4A2E-AE47-116605A7BC9B}.Release-Static|Any CPU.ActiveCfg = Release-Static|Win32 {855DC8C0-D3E9-4A2E-AE47-116605A7BC9B}.Release-Static|ARM.ActiveCfg = Release-Static|ARM {855DC8C0-D3E9-4A2E-AE47-116605A7BC9B}.Release-Static|ARM.Build.0 = Release-Static|ARM + {855DC8C0-D3E9-4A2E-AE47-116605A7BC9B}.Release-Static|ARM64.ActiveCfg = Release-Static|ARM64 + {855DC8C0-D3E9-4A2E-AE47-116605A7BC9B}.Release-Static|ARM64.Build.0 = Release-Static|ARM64 {855DC8C0-D3E9-4A2E-AE47-116605A7BC9B}.Release-Static|Win32.ActiveCfg = Release-Static|Win32 {855DC8C0-D3E9-4A2E-AE47-116605A7BC9B}.Release-Static|Win32.Build.0 = Release-Static|Win32 {855DC8C0-D3E9-4A2E-AE47-116605A7BC9B}.Release-Static|x64.ActiveCfg = Release-Static|x64 @@ -391,6 +470,8 @@ {2BB84911-C1B4-4747-B93D-36AA82CC5031}.Debug|Any CPU.ActiveCfg = Debug|Win32 {2BB84911-C1B4-4747-B93D-36AA82CC5031}.Debug|ARM.ActiveCfg = Debug|ARM {2BB84911-C1B4-4747-B93D-36AA82CC5031}.Debug|ARM.Build.0 = Debug|ARM + {2BB84911-C1B4-4747-B93D-36AA82CC5031}.Debug|ARM64.ActiveCfg = Debug|ARM64 + {2BB84911-C1B4-4747-B93D-36AA82CC5031}.Debug|ARM64.Build.0 = Debug|ARM64 {2BB84911-C1B4-4747-B93D-36AA82CC5031}.Debug|Win32.ActiveCfg = Debug|Win32 {2BB84911-C1B4-4747-B93D-36AA82CC5031}.Debug|Win32.Build.0 = Debug|Win32 {2BB84911-C1B4-4747-B93D-36AA82CC5031}.Debug|x64.ActiveCfg = Debug|x64 @@ -398,12 +479,16 @@ {2BB84911-C1B4-4747-B93D-36AA82CC5031}.Debug-Dynamic|Any CPU.ActiveCfg = Debug-Dynamic|Win32 {2BB84911-C1B4-4747-B93D-36AA82CC5031}.Debug-Dynamic|ARM.ActiveCfg = Debug-Dynamic|ARM {2BB84911-C1B4-4747-B93D-36AA82CC5031}.Debug-Dynamic|ARM.Build.0 = Debug-Dynamic|ARM + {2BB84911-C1B4-4747-B93D-36AA82CC5031}.Debug-Dynamic|ARM64.ActiveCfg = Debug-Dynamic|ARM64 + {2BB84911-C1B4-4747-B93D-36AA82CC5031}.Debug-Dynamic|ARM64.Build.0 = Debug-Dynamic|ARM64 {2BB84911-C1B4-4747-B93D-36AA82CC5031}.Debug-Dynamic|Win32.ActiveCfg = Debug-Dynamic|Win32 {2BB84911-C1B4-4747-B93D-36AA82CC5031}.Debug-Dynamic|Win32.Build.0 = Debug-Dynamic|Win32 {2BB84911-C1B4-4747-B93D-36AA82CC5031}.Debug-Dynamic|x64.ActiveCfg = Debug-Dynamic|x64 {2BB84911-C1B4-4747-B93D-36AA82CC5031}.Debug-Dynamic|x64.Build.0 = Debug-Dynamic|x64 {2BB84911-C1B4-4747-B93D-36AA82CC5031}.Debug-Static|Any CPU.ActiveCfg = Debug-Static|Win32 {2BB84911-C1B4-4747-B93D-36AA82CC5031}.Debug-Static|ARM.ActiveCfg = Debug-Static|ARM + {2BB84911-C1B4-4747-B93D-36AA82CC5031}.Debug-Static|ARM64.ActiveCfg = Debug-Static|ARM64 + {2BB84911-C1B4-4747-B93D-36AA82CC5031}.Debug-Static|ARM64.Build.0 = Debug-Static|ARM64 {2BB84911-C1B4-4747-B93D-36AA82CC5031}.Debug-Static|Win32.ActiveCfg = Debug-Static|Win32 {2BB84911-C1B4-4747-B93D-36AA82CC5031}.Debug-Static|Win32.Build.0 = Debug-Static|Win32 {2BB84911-C1B4-4747-B93D-36AA82CC5031}.Debug-Static|x64.ActiveCfg = Debug-Static|x64 @@ -411,6 +496,8 @@ {2BB84911-C1B4-4747-B93D-36AA82CC5031}.Release|Any CPU.ActiveCfg = Release|Win32 {2BB84911-C1B4-4747-B93D-36AA82CC5031}.Release|ARM.ActiveCfg = Release|ARM {2BB84911-C1B4-4747-B93D-36AA82CC5031}.Release|ARM.Build.0 = Release|ARM + {2BB84911-C1B4-4747-B93D-36AA82CC5031}.Release|ARM64.ActiveCfg = Release|ARM64 + {2BB84911-C1B4-4747-B93D-36AA82CC5031}.Release|ARM64.Build.0 = Release|ARM64 {2BB84911-C1B4-4747-B93D-36AA82CC5031}.Release|Win32.ActiveCfg = Release|Win32 {2BB84911-C1B4-4747-B93D-36AA82CC5031}.Release|Win32.Build.0 = Release|Win32 {2BB84911-C1B4-4747-B93D-36AA82CC5031}.Release|x64.ActiveCfg = Release|x64 @@ -418,6 +505,8 @@ {2BB84911-C1B4-4747-B93D-36AA82CC5031}.Release-Dynamic|Any CPU.ActiveCfg = Release-Dynamic|Win32 {2BB84911-C1B4-4747-B93D-36AA82CC5031}.Release-Dynamic|ARM.ActiveCfg = Release-Dynamic|ARM {2BB84911-C1B4-4747-B93D-36AA82CC5031}.Release-Dynamic|ARM.Build.0 = Release-Dynamic|ARM + {2BB84911-C1B4-4747-B93D-36AA82CC5031}.Release-Dynamic|ARM64.ActiveCfg = Release-Dynamic|ARM64 + {2BB84911-C1B4-4747-B93D-36AA82CC5031}.Release-Dynamic|ARM64.Build.0 = Release-Dynamic|ARM64 {2BB84911-C1B4-4747-B93D-36AA82CC5031}.Release-Dynamic|Win32.ActiveCfg = Release-Dynamic|Win32 {2BB84911-C1B4-4747-B93D-36AA82CC5031}.Release-Dynamic|Win32.Build.0 = Release-Dynamic|Win32 {2BB84911-C1B4-4747-B93D-36AA82CC5031}.Release-Dynamic|x64.ActiveCfg = Release-Dynamic|x64 @@ -425,6 +514,8 @@ {2BB84911-C1B4-4747-B93D-36AA82CC5031}.Release-Static|Any CPU.ActiveCfg = Release-Static|Win32 {2BB84911-C1B4-4747-B93D-36AA82CC5031}.Release-Static|ARM.ActiveCfg = Release-Static|ARM {2BB84911-C1B4-4747-B93D-36AA82CC5031}.Release-Static|ARM.Build.0 = Release-Static|ARM + {2BB84911-C1B4-4747-B93D-36AA82CC5031}.Release-Static|ARM64.ActiveCfg = Release-Static|ARM64 + {2BB84911-C1B4-4747-B93D-36AA82CC5031}.Release-Static|ARM64.Build.0 = Release-Static|ARM64 {2BB84911-C1B4-4747-B93D-36AA82CC5031}.Release-Static|Win32.ActiveCfg = Release-Static|Win32 {2BB84911-C1B4-4747-B93D-36AA82CC5031}.Release-Static|Win32.Build.0 = Release-Static|Win32 {2BB84911-C1B4-4747-B93D-36AA82CC5031}.Release-Static|x64.ActiveCfg = Release-Static|x64 @@ -432,6 +523,8 @@ {4B5945CD-0CB3-49AA-A7FF-7612D93F82C0}.Debug|Any CPU.ActiveCfg = Debug|Win32 {4B5945CD-0CB3-49AA-A7FF-7612D93F82C0}.Debug|ARM.ActiveCfg = Debug|ARM {4B5945CD-0CB3-49AA-A7FF-7612D93F82C0}.Debug|ARM.Build.0 = Debug|ARM + {4B5945CD-0CB3-49AA-A7FF-7612D93F82C0}.Debug|ARM64.ActiveCfg = Debug|ARM64 + {4B5945CD-0CB3-49AA-A7FF-7612D93F82C0}.Debug|ARM64.Build.0 = Debug|ARM64 {4B5945CD-0CB3-49AA-A7FF-7612D93F82C0}.Debug|Win32.ActiveCfg = Debug|Win32 {4B5945CD-0CB3-49AA-A7FF-7612D93F82C0}.Debug|Win32.Build.0 = Debug|Win32 {4B5945CD-0CB3-49AA-A7FF-7612D93F82C0}.Debug|x64.ActiveCfg = Debug|x64 @@ -439,6 +532,8 @@ {4B5945CD-0CB3-49AA-A7FF-7612D93F82C0}.Debug-Dynamic|Any CPU.ActiveCfg = Debug-Dynamic|Win32 {4B5945CD-0CB3-49AA-A7FF-7612D93F82C0}.Debug-Dynamic|ARM.ActiveCfg = Debug-Dynamic|ARM {4B5945CD-0CB3-49AA-A7FF-7612D93F82C0}.Debug-Dynamic|ARM.Build.0 = Debug-Dynamic|ARM + {4B5945CD-0CB3-49AA-A7FF-7612D93F82C0}.Debug-Dynamic|ARM64.ActiveCfg = Debug-Dynamic|ARM64 + {4B5945CD-0CB3-49AA-A7FF-7612D93F82C0}.Debug-Dynamic|ARM64.Build.0 = Debug-Dynamic|ARM64 {4B5945CD-0CB3-49AA-A7FF-7612D93F82C0}.Debug-Dynamic|Win32.ActiveCfg = Debug-Dynamic|Win32 {4B5945CD-0CB3-49AA-A7FF-7612D93F82C0}.Debug-Dynamic|Win32.Build.0 = Debug-Dynamic|Win32 {4B5945CD-0CB3-49AA-A7FF-7612D93F82C0}.Debug-Dynamic|x64.ActiveCfg = Debug-Dynamic|x64 @@ -446,6 +541,8 @@ {4B5945CD-0CB3-49AA-A7FF-7612D93F82C0}.Debug-Static|Any CPU.ActiveCfg = Debug-Static|Win32 {4B5945CD-0CB3-49AA-A7FF-7612D93F82C0}.Debug-Static|ARM.ActiveCfg = Debug-Static|ARM {4B5945CD-0CB3-49AA-A7FF-7612D93F82C0}.Debug-Static|ARM.Build.0 = Debug-Static|ARM + {4B5945CD-0CB3-49AA-A7FF-7612D93F82C0}.Debug-Static|ARM64.ActiveCfg = Debug-Static|ARM64 + {4B5945CD-0CB3-49AA-A7FF-7612D93F82C0}.Debug-Static|ARM64.Build.0 = Debug-Static|ARM64 {4B5945CD-0CB3-49AA-A7FF-7612D93F82C0}.Debug-Static|Win32.ActiveCfg = Debug-Static|Win32 {4B5945CD-0CB3-49AA-A7FF-7612D93F82C0}.Debug-Static|Win32.Build.0 = Debug-Static|Win32 {4B5945CD-0CB3-49AA-A7FF-7612D93F82C0}.Debug-Static|x64.ActiveCfg = Debug-Static|x64 @@ -453,6 +550,8 @@ {4B5945CD-0CB3-49AA-A7FF-7612D93F82C0}.Release|Any CPU.ActiveCfg = Release|Win32 {4B5945CD-0CB3-49AA-A7FF-7612D93F82C0}.Release|ARM.ActiveCfg = Release|ARM {4B5945CD-0CB3-49AA-A7FF-7612D93F82C0}.Release|ARM.Build.0 = Release|ARM + {4B5945CD-0CB3-49AA-A7FF-7612D93F82C0}.Release|ARM64.ActiveCfg = Release|ARM64 + {4B5945CD-0CB3-49AA-A7FF-7612D93F82C0}.Release|ARM64.Build.0 = Release|ARM64 {4B5945CD-0CB3-49AA-A7FF-7612D93F82C0}.Release|Win32.ActiveCfg = Release|Win32 {4B5945CD-0CB3-49AA-A7FF-7612D93F82C0}.Release|Win32.Build.0 = Release|Win32 {4B5945CD-0CB3-49AA-A7FF-7612D93F82C0}.Release|x64.ActiveCfg = Release|x64 @@ -460,6 +559,8 @@ {4B5945CD-0CB3-49AA-A7FF-7612D93F82C0}.Release-Dynamic|Any CPU.ActiveCfg = Release-Dynamic|Win32 {4B5945CD-0CB3-49AA-A7FF-7612D93F82C0}.Release-Dynamic|ARM.ActiveCfg = Release-Dynamic|ARM {4B5945CD-0CB3-49AA-A7FF-7612D93F82C0}.Release-Dynamic|ARM.Build.0 = Release-Dynamic|ARM + {4B5945CD-0CB3-49AA-A7FF-7612D93F82C0}.Release-Dynamic|ARM64.ActiveCfg = Release-Dynamic|ARM64 + {4B5945CD-0CB3-49AA-A7FF-7612D93F82C0}.Release-Dynamic|ARM64.Build.0 = Release-Dynamic|ARM64 {4B5945CD-0CB3-49AA-A7FF-7612D93F82C0}.Release-Dynamic|Win32.ActiveCfg = Release-Dynamic|Win32 {4B5945CD-0CB3-49AA-A7FF-7612D93F82C0}.Release-Dynamic|Win32.Build.0 = Release-Dynamic|Win32 {4B5945CD-0CB3-49AA-A7FF-7612D93F82C0}.Release-Dynamic|x64.ActiveCfg = Release-Dynamic|x64 @@ -467,6 +568,8 @@ {4B5945CD-0CB3-49AA-A7FF-7612D93F82C0}.Release-Static|Any CPU.ActiveCfg = Release-Static|Win32 {4B5945CD-0CB3-49AA-A7FF-7612D93F82C0}.Release-Static|ARM.ActiveCfg = Release-Static|ARM {4B5945CD-0CB3-49AA-A7FF-7612D93F82C0}.Release-Static|ARM.Build.0 = Release-Static|ARM + {4B5945CD-0CB3-49AA-A7FF-7612D93F82C0}.Release-Static|ARM64.ActiveCfg = Release-Static|ARM64 + {4B5945CD-0CB3-49AA-A7FF-7612D93F82C0}.Release-Static|ARM64.Build.0 = Release-Static|ARM64 {4B5945CD-0CB3-49AA-A7FF-7612D93F82C0}.Release-Static|Win32.ActiveCfg = Release-Static|Win32 {4B5945CD-0CB3-49AA-A7FF-7612D93F82C0}.Release-Static|Win32.Build.0 = Release-Static|Win32 {4B5945CD-0CB3-49AA-A7FF-7612D93F82C0}.Release-Static|x64.ActiveCfg = Release-Static|x64 @@ -474,6 +577,8 @@ {B8719FD5-E8A6-4A36-943C-891D07F5DD21}.Debug|Any CPU.ActiveCfg = Debug|Win32 {B8719FD5-E8A6-4A36-943C-891D07F5DD21}.Debug|ARM.ActiveCfg = Debug|ARM {B8719FD5-E8A6-4A36-943C-891D07F5DD21}.Debug|ARM.Build.0 = Debug|ARM + {B8719FD5-E8A6-4A36-943C-891D07F5DD21}.Debug|ARM64.ActiveCfg = Debug|ARM64 + {B8719FD5-E8A6-4A36-943C-891D07F5DD21}.Debug|ARM64.Build.0 = Debug|ARM64 {B8719FD5-E8A6-4A36-943C-891D07F5DD21}.Debug|Win32.ActiveCfg = Debug|Win32 {B8719FD5-E8A6-4A36-943C-891D07F5DD21}.Debug|Win32.Build.0 = Debug|Win32 {B8719FD5-E8A6-4A36-943C-891D07F5DD21}.Debug|x64.ActiveCfg = Debug|x64 @@ -481,6 +586,8 @@ {B8719FD5-E8A6-4A36-943C-891D07F5DD21}.Debug-Dynamic|Any CPU.ActiveCfg = Debug-Dynamic|Win32 {B8719FD5-E8A6-4A36-943C-891D07F5DD21}.Debug-Dynamic|ARM.ActiveCfg = Debug-Dynamic|ARM {B8719FD5-E8A6-4A36-943C-891D07F5DD21}.Debug-Dynamic|ARM.Build.0 = Debug-Dynamic|ARM + {B8719FD5-E8A6-4A36-943C-891D07F5DD21}.Debug-Dynamic|ARM64.ActiveCfg = Debug-Dynamic|ARM64 + {B8719FD5-E8A6-4A36-943C-891D07F5DD21}.Debug-Dynamic|ARM64.Build.0 = Debug-Dynamic|ARM64 {B8719FD5-E8A6-4A36-943C-891D07F5DD21}.Debug-Dynamic|Win32.ActiveCfg = Debug-Dynamic|Win32 {B8719FD5-E8A6-4A36-943C-891D07F5DD21}.Debug-Dynamic|Win32.Build.0 = Debug-Dynamic|Win32 {B8719FD5-E8A6-4A36-943C-891D07F5DD21}.Debug-Dynamic|x64.ActiveCfg = Debug-Dynamic|x64 @@ -488,6 +595,8 @@ {B8719FD5-E8A6-4A36-943C-891D07F5DD21}.Debug-Static|Any CPU.ActiveCfg = Debug-Static|Win32 {B8719FD5-E8A6-4A36-943C-891D07F5DD21}.Debug-Static|ARM.ActiveCfg = Debug-Static|ARM {B8719FD5-E8A6-4A36-943C-891D07F5DD21}.Debug-Static|ARM.Build.0 = Debug-Static|ARM + {B8719FD5-E8A6-4A36-943C-891D07F5DD21}.Debug-Static|ARM64.ActiveCfg = Debug-Static|ARM64 + {B8719FD5-E8A6-4A36-943C-891D07F5DD21}.Debug-Static|ARM64.Build.0 = Debug-Static|ARM64 {B8719FD5-E8A6-4A36-943C-891D07F5DD21}.Debug-Static|Win32.ActiveCfg = Debug-Static|Win32 {B8719FD5-E8A6-4A36-943C-891D07F5DD21}.Debug-Static|Win32.Build.0 = Debug-Static|Win32 {B8719FD5-E8A6-4A36-943C-891D07F5DD21}.Debug-Static|x64.ActiveCfg = Debug-Static|x64 @@ -495,6 +604,8 @@ {B8719FD5-E8A6-4A36-943C-891D07F5DD21}.Release|Any CPU.ActiveCfg = Release|Win32 {B8719FD5-E8A6-4A36-943C-891D07F5DD21}.Release|ARM.ActiveCfg = Release|ARM {B8719FD5-E8A6-4A36-943C-891D07F5DD21}.Release|ARM.Build.0 = Release|ARM + {B8719FD5-E8A6-4A36-943C-891D07F5DD21}.Release|ARM64.ActiveCfg = Release|ARM64 + {B8719FD5-E8A6-4A36-943C-891D07F5DD21}.Release|ARM64.Build.0 = Release|ARM64 {B8719FD5-E8A6-4A36-943C-891D07F5DD21}.Release|Win32.ActiveCfg = Release|Win32 {B8719FD5-E8A6-4A36-943C-891D07F5DD21}.Release|Win32.Build.0 = Release|Win32 {B8719FD5-E8A6-4A36-943C-891D07F5DD21}.Release|x64.ActiveCfg = Release|x64 @@ -502,6 +613,8 @@ {B8719FD5-E8A6-4A36-943C-891D07F5DD21}.Release-Dynamic|Any CPU.ActiveCfg = Release-Dynamic|Win32 {B8719FD5-E8A6-4A36-943C-891D07F5DD21}.Release-Dynamic|ARM.ActiveCfg = Release-Dynamic|ARM {B8719FD5-E8A6-4A36-943C-891D07F5DD21}.Release-Dynamic|ARM.Build.0 = Release-Dynamic|ARM + {B8719FD5-E8A6-4A36-943C-891D07F5DD21}.Release-Dynamic|ARM64.ActiveCfg = Release-Dynamic|ARM64 + {B8719FD5-E8A6-4A36-943C-891D07F5DD21}.Release-Dynamic|ARM64.Build.0 = Release-Dynamic|ARM64 {B8719FD5-E8A6-4A36-943C-891D07F5DD21}.Release-Dynamic|Win32.ActiveCfg = Release-Dynamic|Win32 {B8719FD5-E8A6-4A36-943C-891D07F5DD21}.Release-Dynamic|Win32.Build.0 = Release-Dynamic|Win32 {B8719FD5-E8A6-4A36-943C-891D07F5DD21}.Release-Dynamic|x64.ActiveCfg = Release-Dynamic|x64 @@ -509,6 +622,8 @@ {B8719FD5-E8A6-4A36-943C-891D07F5DD21}.Release-Static|Any CPU.ActiveCfg = Release-Static|Win32 {B8719FD5-E8A6-4A36-943C-891D07F5DD21}.Release-Static|ARM.ActiveCfg = Release-Static|ARM {B8719FD5-E8A6-4A36-943C-891D07F5DD21}.Release-Static|ARM.Build.0 = Release-Static|ARM + {B8719FD5-E8A6-4A36-943C-891D07F5DD21}.Release-Static|ARM64.ActiveCfg = Release-Static|ARM64 + {B8719FD5-E8A6-4A36-943C-891D07F5DD21}.Release-Static|ARM64.Build.0 = Release-Static|ARM64 {B8719FD5-E8A6-4A36-943C-891D07F5DD21}.Release-Static|Win32.ActiveCfg = Release-Static|Win32 {B8719FD5-E8A6-4A36-943C-891D07F5DD21}.Release-Static|Win32.Build.0 = Release-Static|Win32 {B8719FD5-E8A6-4A36-943C-891D07F5DD21}.Release-Static|x64.ActiveCfg = Release-Static|x64 @@ -516,6 +631,8 @@ {8310649E-A25E-4AF0-91E8-9E3CC659BB89}.Debug|Any CPU.ActiveCfg = Debug|Win32 {8310649E-A25E-4AF0-91E8-9E3CC659BB89}.Debug|ARM.ActiveCfg = Debug|ARM {8310649E-A25E-4AF0-91E8-9E3CC659BB89}.Debug|ARM.Build.0 = Debug|ARM + {8310649E-A25E-4AF0-91E8-9E3CC659BB89}.Debug|ARM64.ActiveCfg = Debug|ARM64 + {8310649E-A25E-4AF0-91E8-9E3CC659BB89}.Debug|ARM64.Build.0 = Debug|ARM64 {8310649E-A25E-4AF0-91E8-9E3CC659BB89}.Debug|Win32.ActiveCfg = Debug|Win32 {8310649E-A25E-4AF0-91E8-9E3CC659BB89}.Debug|Win32.Build.0 = Debug|Win32 {8310649E-A25E-4AF0-91E8-9E3CC659BB89}.Debug|x64.ActiveCfg = Debug|x64 @@ -523,6 +640,8 @@ {8310649E-A25E-4AF0-91E8-9E3CC659BB89}.Debug-Dynamic|Any CPU.ActiveCfg = Debug-Dynamic|Win32 {8310649E-A25E-4AF0-91E8-9E3CC659BB89}.Debug-Dynamic|ARM.ActiveCfg = Debug-Dynamic|ARM {8310649E-A25E-4AF0-91E8-9E3CC659BB89}.Debug-Dynamic|ARM.Build.0 = Debug-Dynamic|ARM + {8310649E-A25E-4AF0-91E8-9E3CC659BB89}.Debug-Dynamic|ARM64.ActiveCfg = Debug-Dynamic|ARM64 + {8310649E-A25E-4AF0-91E8-9E3CC659BB89}.Debug-Dynamic|ARM64.Build.0 = Debug-Dynamic|ARM64 {8310649E-A25E-4AF0-91E8-9E3CC659BB89}.Debug-Dynamic|Win32.ActiveCfg = Debug-Dynamic|Win32 {8310649E-A25E-4AF0-91E8-9E3CC659BB89}.Debug-Dynamic|Win32.Build.0 = Debug-Dynamic|Win32 {8310649E-A25E-4AF0-91E8-9E3CC659BB89}.Debug-Dynamic|x64.ActiveCfg = Debug-Dynamic|x64 @@ -530,6 +649,8 @@ {8310649E-A25E-4AF0-91E8-9E3CC659BB89}.Debug-Static|Any CPU.ActiveCfg = Debug-Static|Win32 {8310649E-A25E-4AF0-91E8-9E3CC659BB89}.Debug-Static|ARM.ActiveCfg = Debug-Static|ARM {8310649E-A25E-4AF0-91E8-9E3CC659BB89}.Debug-Static|ARM.Build.0 = Debug-Static|ARM + {8310649E-A25E-4AF0-91E8-9E3CC659BB89}.Debug-Static|ARM64.ActiveCfg = Debug-Static|ARM64 + {8310649E-A25E-4AF0-91E8-9E3CC659BB89}.Debug-Static|ARM64.Build.0 = Debug-Static|ARM64 {8310649E-A25E-4AF0-91E8-9E3CC659BB89}.Debug-Static|Win32.ActiveCfg = Debug-Static|Win32 {8310649E-A25E-4AF0-91E8-9E3CC659BB89}.Debug-Static|Win32.Build.0 = Debug-Static|Win32 {8310649E-A25E-4AF0-91E8-9E3CC659BB89}.Debug-Static|x64.ActiveCfg = Debug-Static|x64 @@ -537,6 +658,8 @@ {8310649E-A25E-4AF0-91E8-9E3CC659BB89}.Release|Any CPU.ActiveCfg = Release|Win32 {8310649E-A25E-4AF0-91E8-9E3CC659BB89}.Release|ARM.ActiveCfg = Release|ARM {8310649E-A25E-4AF0-91E8-9E3CC659BB89}.Release|ARM.Build.0 = Release|ARM + {8310649E-A25E-4AF0-91E8-9E3CC659BB89}.Release|ARM64.ActiveCfg = Release|ARM64 + {8310649E-A25E-4AF0-91E8-9E3CC659BB89}.Release|ARM64.Build.0 = Release|ARM64 {8310649E-A25E-4AF0-91E8-9E3CC659BB89}.Release|Win32.ActiveCfg = Release|Win32 {8310649E-A25E-4AF0-91E8-9E3CC659BB89}.Release|Win32.Build.0 = Release|Win32 {8310649E-A25E-4AF0-91E8-9E3CC659BB89}.Release|x64.ActiveCfg = Release|x64 @@ -544,6 +667,8 @@ {8310649E-A25E-4AF0-91E8-9E3CC659BB89}.Release-Dynamic|Any CPU.ActiveCfg = Release-Dynamic|Win32 {8310649E-A25E-4AF0-91E8-9E3CC659BB89}.Release-Dynamic|ARM.ActiveCfg = Release-Dynamic|ARM {8310649E-A25E-4AF0-91E8-9E3CC659BB89}.Release-Dynamic|ARM.Build.0 = Release-Dynamic|ARM + {8310649E-A25E-4AF0-91E8-9E3CC659BB89}.Release-Dynamic|ARM64.ActiveCfg = Release-Dynamic|ARM64 + {8310649E-A25E-4AF0-91E8-9E3CC659BB89}.Release-Dynamic|ARM64.Build.0 = Release-Dynamic|ARM64 {8310649E-A25E-4AF0-91E8-9E3CC659BB89}.Release-Dynamic|Win32.ActiveCfg = Release-Dynamic|Win32 {8310649E-A25E-4AF0-91E8-9E3CC659BB89}.Release-Dynamic|Win32.Build.0 = Release-Dynamic|Win32 {8310649E-A25E-4AF0-91E8-9E3CC659BB89}.Release-Dynamic|x64.ActiveCfg = Release-Dynamic|x64 @@ -551,6 +676,8 @@ {8310649E-A25E-4AF0-91E8-9E3CC659BB89}.Release-Static|Any CPU.ActiveCfg = Release-Static|Win32 {8310649E-A25E-4AF0-91E8-9E3CC659BB89}.Release-Static|ARM.ActiveCfg = Release-Static|ARM {8310649E-A25E-4AF0-91E8-9E3CC659BB89}.Release-Static|ARM.Build.0 = Release-Static|ARM + {8310649E-A25E-4AF0-91E8-9E3CC659BB89}.Release-Static|ARM64.ActiveCfg = Release-Static|ARM64 + {8310649E-A25E-4AF0-91E8-9E3CC659BB89}.Release-Static|ARM64.Build.0 = Release-Static|ARM64 {8310649E-A25E-4AF0-91E8-9E3CC659BB89}.Release-Static|Win32.ActiveCfg = Release-Static|Win32 {8310649E-A25E-4AF0-91E8-9E3CC659BB89}.Release-Static|Win32.Build.0 = Release-Static|Win32 {8310649E-A25E-4AF0-91E8-9E3CC659BB89}.Release-Static|x64.ActiveCfg = Release-Static|x64 @@ -558,6 +685,8 @@ {9CA0FDFB-2172-41FC-B7F1-5CE915EDCB37}.Debug|Any CPU.ActiveCfg = Debug|Win32 {9CA0FDFB-2172-41FC-B7F1-5CE915EDCB37}.Debug|ARM.ActiveCfg = Debug|ARM {9CA0FDFB-2172-41FC-B7F1-5CE915EDCB37}.Debug|ARM.Build.0 = Debug|ARM + {9CA0FDFB-2172-41FC-B7F1-5CE915EDCB37}.Debug|ARM64.ActiveCfg = Debug|ARM64 + {9CA0FDFB-2172-41FC-B7F1-5CE915EDCB37}.Debug|ARM64.Build.0 = Debug|ARM64 {9CA0FDFB-2172-41FC-B7F1-5CE915EDCB37}.Debug|Win32.ActiveCfg = Debug|Win32 {9CA0FDFB-2172-41FC-B7F1-5CE915EDCB37}.Debug|Win32.Build.0 = Debug|Win32 {9CA0FDFB-2172-41FC-B7F1-5CE915EDCB37}.Debug|x64.ActiveCfg = Debug|x64 @@ -565,6 +694,8 @@ {9CA0FDFB-2172-41FC-B7F1-5CE915EDCB37}.Debug-Dynamic|Any CPU.ActiveCfg = Debug-Dynamic|Win32 {9CA0FDFB-2172-41FC-B7F1-5CE915EDCB37}.Debug-Dynamic|ARM.ActiveCfg = Debug-Dynamic|ARM {9CA0FDFB-2172-41FC-B7F1-5CE915EDCB37}.Debug-Dynamic|ARM.Build.0 = Debug-Dynamic|ARM + {9CA0FDFB-2172-41FC-B7F1-5CE915EDCB37}.Debug-Dynamic|ARM64.ActiveCfg = Debug-Dynamic|ARM64 + {9CA0FDFB-2172-41FC-B7F1-5CE915EDCB37}.Debug-Dynamic|ARM64.Build.0 = Debug-Dynamic|ARM64 {9CA0FDFB-2172-41FC-B7F1-5CE915EDCB37}.Debug-Dynamic|Win32.ActiveCfg = Debug-Dynamic|Win32 {9CA0FDFB-2172-41FC-B7F1-5CE915EDCB37}.Debug-Dynamic|Win32.Build.0 = Debug-Dynamic|Win32 {9CA0FDFB-2172-41FC-B7F1-5CE915EDCB37}.Debug-Dynamic|x64.ActiveCfg = Debug-Dynamic|x64 @@ -572,6 +703,8 @@ {9CA0FDFB-2172-41FC-B7F1-5CE915EDCB37}.Debug-Static|Any CPU.ActiveCfg = Debug-Static|Win32 {9CA0FDFB-2172-41FC-B7F1-5CE915EDCB37}.Debug-Static|ARM.ActiveCfg = Debug-Static|ARM {9CA0FDFB-2172-41FC-B7F1-5CE915EDCB37}.Debug-Static|ARM.Build.0 = Debug-Static|ARM + {9CA0FDFB-2172-41FC-B7F1-5CE915EDCB37}.Debug-Static|ARM64.ActiveCfg = Debug-Static|ARM64 + {9CA0FDFB-2172-41FC-B7F1-5CE915EDCB37}.Debug-Static|ARM64.Build.0 = Debug-Static|ARM64 {9CA0FDFB-2172-41FC-B7F1-5CE915EDCB37}.Debug-Static|Win32.ActiveCfg = Debug-Static|Win32 {9CA0FDFB-2172-41FC-B7F1-5CE915EDCB37}.Debug-Static|Win32.Build.0 = Debug-Static|Win32 {9CA0FDFB-2172-41FC-B7F1-5CE915EDCB37}.Debug-Static|x64.ActiveCfg = Debug-Static|x64 @@ -579,6 +712,8 @@ {9CA0FDFB-2172-41FC-B7F1-5CE915EDCB37}.Release|Any CPU.ActiveCfg = Release|Win32 {9CA0FDFB-2172-41FC-B7F1-5CE915EDCB37}.Release|ARM.ActiveCfg = Release|ARM {9CA0FDFB-2172-41FC-B7F1-5CE915EDCB37}.Release|ARM.Build.0 = Release|ARM + {9CA0FDFB-2172-41FC-B7F1-5CE915EDCB37}.Release|ARM64.ActiveCfg = Release|ARM64 + {9CA0FDFB-2172-41FC-B7F1-5CE915EDCB37}.Release|ARM64.Build.0 = Release|ARM64 {9CA0FDFB-2172-41FC-B7F1-5CE915EDCB37}.Release|Win32.ActiveCfg = Release|Win32 {9CA0FDFB-2172-41FC-B7F1-5CE915EDCB37}.Release|Win32.Build.0 = Release|Win32 {9CA0FDFB-2172-41FC-B7F1-5CE915EDCB37}.Release|x64.ActiveCfg = Release|x64 @@ -586,6 +721,8 @@ {9CA0FDFB-2172-41FC-B7F1-5CE915EDCB37}.Release-Dynamic|Any CPU.ActiveCfg = Release-Dynamic|Win32 {9CA0FDFB-2172-41FC-B7F1-5CE915EDCB37}.Release-Dynamic|ARM.ActiveCfg = Release-Dynamic|ARM {9CA0FDFB-2172-41FC-B7F1-5CE915EDCB37}.Release-Dynamic|ARM.Build.0 = Release-Dynamic|ARM + {9CA0FDFB-2172-41FC-B7F1-5CE915EDCB37}.Release-Dynamic|ARM64.ActiveCfg = Release-Dynamic|ARM64 + {9CA0FDFB-2172-41FC-B7F1-5CE915EDCB37}.Release-Dynamic|ARM64.Build.0 = Release-Dynamic|ARM64 {9CA0FDFB-2172-41FC-B7F1-5CE915EDCB37}.Release-Dynamic|Win32.ActiveCfg = Release-Dynamic|Win32 {9CA0FDFB-2172-41FC-B7F1-5CE915EDCB37}.Release-Dynamic|Win32.Build.0 = Release-Dynamic|Win32 {9CA0FDFB-2172-41FC-B7F1-5CE915EDCB37}.Release-Dynamic|x64.ActiveCfg = Release-Dynamic|x64 @@ -593,42 +730,56 @@ {9CA0FDFB-2172-41FC-B7F1-5CE915EDCB37}.Release-Static|Any CPU.ActiveCfg = Release-Static|Win32 {9CA0FDFB-2172-41FC-B7F1-5CE915EDCB37}.Release-Static|ARM.ActiveCfg = Release-Static|ARM {9CA0FDFB-2172-41FC-B7F1-5CE915EDCB37}.Release-Static|ARM.Build.0 = Release-Static|ARM + {9CA0FDFB-2172-41FC-B7F1-5CE915EDCB37}.Release-Static|ARM64.ActiveCfg = Release-Static|ARM64 + {9CA0FDFB-2172-41FC-B7F1-5CE915EDCB37}.Release-Static|ARM64.Build.0 = Release-Static|ARM64 {9CA0FDFB-2172-41FC-B7F1-5CE915EDCB37}.Release-Static|Win32.ActiveCfg = Release-Static|Win32 {9CA0FDFB-2172-41FC-B7F1-5CE915EDCB37}.Release-Static|Win32.Build.0 = Release-Static|Win32 {9CA0FDFB-2172-41FC-B7F1-5CE915EDCB37}.Release-Static|x64.ActiveCfg = Release-Static|x64 {9CA0FDFB-2172-41FC-B7F1-5CE915EDCB37}.Release-Static|x64.Build.0 = Release-Static|x64 {A0F1AA62-0F6F-420D-B09A-AC04B6862821}.Debug|Any CPU.ActiveCfg = Debug|Win32 {A0F1AA62-0F6F-420D-B09A-AC04B6862821}.Debug|ARM.ActiveCfg = Debug|Win32 + {A0F1AA62-0F6F-420D-B09A-AC04B6862821}.Debug|ARM64.ActiveCfg = Debug|ARM64 + {A0F1AA62-0F6F-420D-B09A-AC04B6862821}.Debug|ARM64.Build.0 = Debug|ARM64 {A0F1AA62-0F6F-420D-B09A-AC04B6862821}.Debug|Win32.ActiveCfg = Debug|Win32 {A0F1AA62-0F6F-420D-B09A-AC04B6862821}.Debug|Win32.Build.0 = Debug|Win32 {A0F1AA62-0F6F-420D-B09A-AC04B6862821}.Debug|x64.ActiveCfg = Debug|x64 {A0F1AA62-0F6F-420D-B09A-AC04B6862821}.Debug|x64.Build.0 = Debug|x64 {A0F1AA62-0F6F-420D-B09A-AC04B6862821}.Debug-Dynamic|Any CPU.ActiveCfg = Debug-Dynamic|Win32 {A0F1AA62-0F6F-420D-B09A-AC04B6862821}.Debug-Dynamic|ARM.ActiveCfg = Debug-Dynamic|Win32 + {A0F1AA62-0F6F-420D-B09A-AC04B6862821}.Debug-Dynamic|ARM64.ActiveCfg = Debug-Dynamic|ARM64 + {A0F1AA62-0F6F-420D-B09A-AC04B6862821}.Debug-Dynamic|ARM64.Build.0 = Debug-Dynamic|ARM64 {A0F1AA62-0F6F-420D-B09A-AC04B6862821}.Debug-Dynamic|Win32.ActiveCfg = Debug-Dynamic|Win32 {A0F1AA62-0F6F-420D-B09A-AC04B6862821}.Debug-Dynamic|Win32.Build.0 = Debug-Dynamic|Win32 {A0F1AA62-0F6F-420D-B09A-AC04B6862821}.Debug-Dynamic|x64.ActiveCfg = Debug-Dynamic|x64 {A0F1AA62-0F6F-420D-B09A-AC04B6862821}.Debug-Dynamic|x64.Build.0 = Debug-Dynamic|x64 {A0F1AA62-0F6F-420D-B09A-AC04B6862821}.Debug-Static|Any CPU.ActiveCfg = Debug-Static|Win32 {A0F1AA62-0F6F-420D-B09A-AC04B6862821}.Debug-Static|ARM.ActiveCfg = Debug-Static|Win32 + {A0F1AA62-0F6F-420D-B09A-AC04B6862821}.Debug-Static|ARM64.ActiveCfg = Debug-Static|ARM64 + {A0F1AA62-0F6F-420D-B09A-AC04B6862821}.Debug-Static|ARM64.Build.0 = Debug-Static|ARM64 {A0F1AA62-0F6F-420D-B09A-AC04B6862821}.Debug-Static|Win32.ActiveCfg = Debug-Static|Win32 {A0F1AA62-0F6F-420D-B09A-AC04B6862821}.Debug-Static|Win32.Build.0 = Debug-Static|Win32 {A0F1AA62-0F6F-420D-B09A-AC04B6862821}.Debug-Static|x64.ActiveCfg = Debug-Static|x64 {A0F1AA62-0F6F-420D-B09A-AC04B6862821}.Debug-Static|x64.Build.0 = Debug-Static|x64 {A0F1AA62-0F6F-420D-B09A-AC04B6862821}.Release|Any CPU.ActiveCfg = Release|Win32 {A0F1AA62-0F6F-420D-B09A-AC04B6862821}.Release|ARM.ActiveCfg = Release|Win32 + {A0F1AA62-0F6F-420D-B09A-AC04B6862821}.Release|ARM64.ActiveCfg = Release|ARM64 + {A0F1AA62-0F6F-420D-B09A-AC04B6862821}.Release|ARM64.Build.0 = Release|ARM64 {A0F1AA62-0F6F-420D-B09A-AC04B6862821}.Release|Win32.ActiveCfg = Release|Win32 {A0F1AA62-0F6F-420D-B09A-AC04B6862821}.Release|Win32.Build.0 = Release|Win32 {A0F1AA62-0F6F-420D-B09A-AC04B6862821}.Release|x64.ActiveCfg = Release|x64 {A0F1AA62-0F6F-420D-B09A-AC04B6862821}.Release|x64.Build.0 = Release|x64 {A0F1AA62-0F6F-420D-B09A-AC04B6862821}.Release-Dynamic|Any CPU.ActiveCfg = Release-Dynamic|Win32 {A0F1AA62-0F6F-420D-B09A-AC04B6862821}.Release-Dynamic|ARM.ActiveCfg = Release-Dynamic|Win32 + {A0F1AA62-0F6F-420D-B09A-AC04B6862821}.Release-Dynamic|ARM64.ActiveCfg = Release-Dynamic|ARM64 + {A0F1AA62-0F6F-420D-B09A-AC04B6862821}.Release-Dynamic|ARM64.Build.0 = Release-Dynamic|ARM64 {A0F1AA62-0F6F-420D-B09A-AC04B6862821}.Release-Dynamic|Win32.ActiveCfg = Release-Dynamic|Win32 {A0F1AA62-0F6F-420D-B09A-AC04B6862821}.Release-Dynamic|Win32.Build.0 = Release-Dynamic|Win32 {A0F1AA62-0F6F-420D-B09A-AC04B6862821}.Release-Dynamic|x64.ActiveCfg = Release-Dynamic|x64 {A0F1AA62-0F6F-420D-B09A-AC04B6862821}.Release-Dynamic|x64.Build.0 = Release-Dynamic|x64 {A0F1AA62-0F6F-420D-B09A-AC04B6862821}.Release-Static|Any CPU.ActiveCfg = Release-Static|Win32 {A0F1AA62-0F6F-420D-B09A-AC04B6862821}.Release-Static|ARM.ActiveCfg = Release-Static|Win32 + {A0F1AA62-0F6F-420D-B09A-AC04B6862821}.Release-Static|ARM64.ActiveCfg = Release-Static|ARM64 + {A0F1AA62-0F6F-420D-B09A-AC04B6862821}.Release-Static|ARM64.Build.0 = Release-Static|ARM64 {A0F1AA62-0F6F-420D-B09A-AC04B6862821}.Release-Static|Win32.ActiveCfg = Release-Static|Win32 {A0F1AA62-0F6F-420D-B09A-AC04B6862821}.Release-Static|Win32.Build.0 = Release-Static|Win32 {A0F1AA62-0F6F-420D-B09A-AC04B6862821}.Release-Static|x64.ActiveCfg = Release-Static|x64 @@ -636,6 +787,8 @@ {A5D9AA24-08ED-48B9-BD65-F0A25E96BFC4}.Debug|Any CPU.ActiveCfg = Debug|Win32 {A5D9AA24-08ED-48B9-BD65-F0A25E96BFC4}.Debug|ARM.ActiveCfg = Debug|ARM {A5D9AA24-08ED-48B9-BD65-F0A25E96BFC4}.Debug|ARM.Build.0 = Debug|ARM + {A5D9AA24-08ED-48B9-BD65-F0A25E96BFC4}.Debug|ARM64.ActiveCfg = Debug|ARM64 + {A5D9AA24-08ED-48B9-BD65-F0A25E96BFC4}.Debug|ARM64.Build.0 = Debug|ARM64 {A5D9AA24-08ED-48B9-BD65-F0A25E96BFC4}.Debug|Win32.ActiveCfg = Debug|Win32 {A5D9AA24-08ED-48B9-BD65-F0A25E96BFC4}.Debug|Win32.Build.0 = Debug|Win32 {A5D9AA24-08ED-48B9-BD65-F0A25E96BFC4}.Debug|x64.ActiveCfg = Debug|x64 @@ -643,6 +796,8 @@ {A5D9AA24-08ED-48B9-BD65-F0A25E96BFC4}.Debug-Dynamic|Any CPU.ActiveCfg = Debug-Dynamic|Win32 {A5D9AA24-08ED-48B9-BD65-F0A25E96BFC4}.Debug-Dynamic|ARM.ActiveCfg = Debug-Dynamic|ARM {A5D9AA24-08ED-48B9-BD65-F0A25E96BFC4}.Debug-Dynamic|ARM.Build.0 = Debug-Dynamic|ARM + {A5D9AA24-08ED-48B9-BD65-F0A25E96BFC4}.Debug-Dynamic|ARM64.ActiveCfg = Debug-Dynamic|ARM64 + {A5D9AA24-08ED-48B9-BD65-F0A25E96BFC4}.Debug-Dynamic|ARM64.Build.0 = Debug-Dynamic|ARM64 {A5D9AA24-08ED-48B9-BD65-F0A25E96BFC4}.Debug-Dynamic|Win32.ActiveCfg = Debug-Dynamic|Win32 {A5D9AA24-08ED-48B9-BD65-F0A25E96BFC4}.Debug-Dynamic|Win32.Build.0 = Debug-Dynamic|Win32 {A5D9AA24-08ED-48B9-BD65-F0A25E96BFC4}.Debug-Dynamic|x64.ActiveCfg = Debug-Dynamic|x64 @@ -650,6 +805,8 @@ {A5D9AA24-08ED-48B9-BD65-F0A25E96BFC4}.Debug-Static|Any CPU.ActiveCfg = Debug-Static|Win32 {A5D9AA24-08ED-48B9-BD65-F0A25E96BFC4}.Debug-Static|ARM.ActiveCfg = Debug-Static|ARM {A5D9AA24-08ED-48B9-BD65-F0A25E96BFC4}.Debug-Static|ARM.Build.0 = Debug-Static|ARM + {A5D9AA24-08ED-48B9-BD65-F0A25E96BFC4}.Debug-Static|ARM64.ActiveCfg = Debug-Static|ARM64 + {A5D9AA24-08ED-48B9-BD65-F0A25E96BFC4}.Debug-Static|ARM64.Build.0 = Debug-Static|ARM64 {A5D9AA24-08ED-48B9-BD65-F0A25E96BFC4}.Debug-Static|Win32.ActiveCfg = Debug-Static|Win32 {A5D9AA24-08ED-48B9-BD65-F0A25E96BFC4}.Debug-Static|Win32.Build.0 = Debug-Static|Win32 {A5D9AA24-08ED-48B9-BD65-F0A25E96BFC4}.Debug-Static|x64.ActiveCfg = Debug-Static|x64 @@ -657,6 +814,8 @@ {A5D9AA24-08ED-48B9-BD65-F0A25E96BFC4}.Release|Any CPU.ActiveCfg = Release|Win32 {A5D9AA24-08ED-48B9-BD65-F0A25E96BFC4}.Release|ARM.ActiveCfg = Release|ARM {A5D9AA24-08ED-48B9-BD65-F0A25E96BFC4}.Release|ARM.Build.0 = Release|ARM + {A5D9AA24-08ED-48B9-BD65-F0A25E96BFC4}.Release|ARM64.ActiveCfg = Release|ARM64 + {A5D9AA24-08ED-48B9-BD65-F0A25E96BFC4}.Release|ARM64.Build.0 = Release|ARM64 {A5D9AA24-08ED-48B9-BD65-F0A25E96BFC4}.Release|Win32.ActiveCfg = Release|Win32 {A5D9AA24-08ED-48B9-BD65-F0A25E96BFC4}.Release|Win32.Build.0 = Release|Win32 {A5D9AA24-08ED-48B9-BD65-F0A25E96BFC4}.Release|x64.ActiveCfg = Release|x64 @@ -664,6 +823,8 @@ {A5D9AA24-08ED-48B9-BD65-F0A25E96BFC4}.Release-Dynamic|Any CPU.ActiveCfg = Release-Dynamic|Win32 {A5D9AA24-08ED-48B9-BD65-F0A25E96BFC4}.Release-Dynamic|ARM.ActiveCfg = Release-Dynamic|ARM {A5D9AA24-08ED-48B9-BD65-F0A25E96BFC4}.Release-Dynamic|ARM.Build.0 = Release-Dynamic|ARM + {A5D9AA24-08ED-48B9-BD65-F0A25E96BFC4}.Release-Dynamic|ARM64.ActiveCfg = Release-Dynamic|ARM64 + {A5D9AA24-08ED-48B9-BD65-F0A25E96BFC4}.Release-Dynamic|ARM64.Build.0 = Release-Dynamic|ARM64 {A5D9AA24-08ED-48B9-BD65-F0A25E96BFC4}.Release-Dynamic|Win32.ActiveCfg = Release-Dynamic|Win32 {A5D9AA24-08ED-48B9-BD65-F0A25E96BFC4}.Release-Dynamic|Win32.Build.0 = Release-Dynamic|Win32 {A5D9AA24-08ED-48B9-BD65-F0A25E96BFC4}.Release-Dynamic|x64.ActiveCfg = Release-Dynamic|x64 @@ -671,6 +832,8 @@ {A5D9AA24-08ED-48B9-BD65-F0A25E96BFC4}.Release-Static|Any CPU.ActiveCfg = Release-Static|Win32 {A5D9AA24-08ED-48B9-BD65-F0A25E96BFC4}.Release-Static|ARM.ActiveCfg = Release-Static|ARM {A5D9AA24-08ED-48B9-BD65-F0A25E96BFC4}.Release-Static|ARM.Build.0 = Release-Static|ARM + {A5D9AA24-08ED-48B9-BD65-F0A25E96BFC4}.Release-Static|ARM64.ActiveCfg = Release-Static|ARM64 + {A5D9AA24-08ED-48B9-BD65-F0A25E96BFC4}.Release-Static|ARM64.Build.0 = Release-Static|ARM64 {A5D9AA24-08ED-48B9-BD65-F0A25E96BFC4}.Release-Static|Win32.ActiveCfg = Release-Static|Win32 {A5D9AA24-08ED-48B9-BD65-F0A25E96BFC4}.Release-Static|Win32.Build.0 = Release-Static|Win32 {A5D9AA24-08ED-48B9-BD65-F0A25E96BFC4}.Release-Static|x64.ActiveCfg = Release-Static|x64 @@ -678,6 +841,8 @@ {E53AA5FF-B737-40AA-BD13-387EFA99023D}.Debug|Any CPU.ActiveCfg = Debug|Win32 {E53AA5FF-B737-40AA-BD13-387EFA99023D}.Debug|ARM.ActiveCfg = Debug|ARM {E53AA5FF-B737-40AA-BD13-387EFA99023D}.Debug|ARM.Build.0 = Debug|ARM + {E53AA5FF-B737-40AA-BD13-387EFA99023D}.Debug|ARM64.ActiveCfg = Debug|ARM64 + {E53AA5FF-B737-40AA-BD13-387EFA99023D}.Debug|ARM64.Build.0 = Debug|ARM64 {E53AA5FF-B737-40AA-BD13-387EFA99023D}.Debug|Win32.ActiveCfg = Debug|Win32 {E53AA5FF-B737-40AA-BD13-387EFA99023D}.Debug|Win32.Build.0 = Debug|Win32 {E53AA5FF-B737-40AA-BD13-387EFA99023D}.Debug|x64.ActiveCfg = Debug|x64 @@ -685,6 +850,8 @@ {E53AA5FF-B737-40AA-BD13-387EFA99023D}.Debug-Dynamic|Any CPU.ActiveCfg = Debug-Dynamic|Win32 {E53AA5FF-B737-40AA-BD13-387EFA99023D}.Debug-Dynamic|ARM.ActiveCfg = Debug-Dynamic|ARM {E53AA5FF-B737-40AA-BD13-387EFA99023D}.Debug-Dynamic|ARM.Build.0 = Debug-Dynamic|ARM + {E53AA5FF-B737-40AA-BD13-387EFA99023D}.Debug-Dynamic|ARM64.ActiveCfg = Debug-Dynamic|ARM64 + {E53AA5FF-B737-40AA-BD13-387EFA99023D}.Debug-Dynamic|ARM64.Build.0 = Debug-Dynamic|ARM64 {E53AA5FF-B737-40AA-BD13-387EFA99023D}.Debug-Dynamic|Win32.ActiveCfg = Debug-Dynamic|Win32 {E53AA5FF-B737-40AA-BD13-387EFA99023D}.Debug-Dynamic|Win32.Build.0 = Debug-Dynamic|Win32 {E53AA5FF-B737-40AA-BD13-387EFA99023D}.Debug-Dynamic|x64.ActiveCfg = Debug-Dynamic|x64 @@ -692,6 +859,8 @@ {E53AA5FF-B737-40AA-BD13-387EFA99023D}.Debug-Static|Any CPU.ActiveCfg = Debug-Static|Win32 {E53AA5FF-B737-40AA-BD13-387EFA99023D}.Debug-Static|ARM.ActiveCfg = Debug-Static|ARM {E53AA5FF-B737-40AA-BD13-387EFA99023D}.Debug-Static|ARM.Build.0 = Debug-Static|ARM + {E53AA5FF-B737-40AA-BD13-387EFA99023D}.Debug-Static|ARM64.ActiveCfg = Debug-Static|ARM64 + {E53AA5FF-B737-40AA-BD13-387EFA99023D}.Debug-Static|ARM64.Build.0 = Debug-Static|ARM64 {E53AA5FF-B737-40AA-BD13-387EFA99023D}.Debug-Static|Win32.ActiveCfg = Debug-Static|Win32 {E53AA5FF-B737-40AA-BD13-387EFA99023D}.Debug-Static|Win32.Build.0 = Debug-Static|Win32 {E53AA5FF-B737-40AA-BD13-387EFA99023D}.Debug-Static|x64.ActiveCfg = Debug-Static|x64 @@ -699,6 +868,8 @@ {E53AA5FF-B737-40AA-BD13-387EFA99023D}.Release|Any CPU.ActiveCfg = Release|Win32 {E53AA5FF-B737-40AA-BD13-387EFA99023D}.Release|ARM.ActiveCfg = Release|ARM {E53AA5FF-B737-40AA-BD13-387EFA99023D}.Release|ARM.Build.0 = Release|ARM + {E53AA5FF-B737-40AA-BD13-387EFA99023D}.Release|ARM64.ActiveCfg = Release|ARM64 + {E53AA5FF-B737-40AA-BD13-387EFA99023D}.Release|ARM64.Build.0 = Release|ARM64 {E53AA5FF-B737-40AA-BD13-387EFA99023D}.Release|Win32.ActiveCfg = Release|Win32 {E53AA5FF-B737-40AA-BD13-387EFA99023D}.Release|Win32.Build.0 = Release|Win32 {E53AA5FF-B737-40AA-BD13-387EFA99023D}.Release|x64.ActiveCfg = Release|x64 @@ -706,6 +877,8 @@ {E53AA5FF-B737-40AA-BD13-387EFA99023D}.Release-Dynamic|Any CPU.ActiveCfg = Release-Dynamic|Win32 {E53AA5FF-B737-40AA-BD13-387EFA99023D}.Release-Dynamic|ARM.ActiveCfg = Release-Dynamic|ARM {E53AA5FF-B737-40AA-BD13-387EFA99023D}.Release-Dynamic|ARM.Build.0 = Release-Dynamic|ARM + {E53AA5FF-B737-40AA-BD13-387EFA99023D}.Release-Dynamic|ARM64.ActiveCfg = Release-Dynamic|ARM64 + {E53AA5FF-B737-40AA-BD13-387EFA99023D}.Release-Dynamic|ARM64.Build.0 = Release-Dynamic|ARM64 {E53AA5FF-B737-40AA-BD13-387EFA99023D}.Release-Dynamic|Win32.ActiveCfg = Release-Dynamic|Win32 {E53AA5FF-B737-40AA-BD13-387EFA99023D}.Release-Dynamic|Win32.Build.0 = Release-Dynamic|Win32 {E53AA5FF-B737-40AA-BD13-387EFA99023D}.Release-Dynamic|x64.ActiveCfg = Release-Dynamic|x64 @@ -713,6 +886,8 @@ {E53AA5FF-B737-40AA-BD13-387EFA99023D}.Release-Static|Any CPU.ActiveCfg = Release-Static|Win32 {E53AA5FF-B737-40AA-BD13-387EFA99023D}.Release-Static|ARM.ActiveCfg = Release-Static|ARM {E53AA5FF-B737-40AA-BD13-387EFA99023D}.Release-Static|ARM.Build.0 = Release-Static|ARM + {E53AA5FF-B737-40AA-BD13-387EFA99023D}.Release-Static|ARM64.ActiveCfg = Release-Static|ARM64 + {E53AA5FF-B737-40AA-BD13-387EFA99023D}.Release-Static|ARM64.Build.0 = Release-Static|ARM64 {E53AA5FF-B737-40AA-BD13-387EFA99023D}.Release-Static|Win32.ActiveCfg = Release-Static|Win32 {E53AA5FF-B737-40AA-BD13-387EFA99023D}.Release-Static|Win32.Build.0 = Release-Static|Win32 {E53AA5FF-B737-40AA-BD13-387EFA99023D}.Release-Static|x64.ActiveCfg = Release-Static|x64 @@ -720,6 +895,8 @@ {B5FE16F8-3EDB-4110-BD80-B4238CC01E8D}.Debug|Any CPU.ActiveCfg = Debug|Win32 {B5FE16F8-3EDB-4110-BD80-B4238CC01E8D}.Debug|ARM.ActiveCfg = Debug|ARM {B5FE16F8-3EDB-4110-BD80-B4238CC01E8D}.Debug|ARM.Build.0 = Debug|ARM + {B5FE16F8-3EDB-4110-BD80-B4238CC01E8D}.Debug|ARM64.ActiveCfg = Debug|ARM64 + {B5FE16F8-3EDB-4110-BD80-B4238CC01E8D}.Debug|ARM64.Build.0 = Debug|ARM64 {B5FE16F8-3EDB-4110-BD80-B4238CC01E8D}.Debug|Win32.ActiveCfg = Debug|Win32 {B5FE16F8-3EDB-4110-BD80-B4238CC01E8D}.Debug|Win32.Build.0 = Debug|Win32 {B5FE16F8-3EDB-4110-BD80-B4238CC01E8D}.Debug|x64.ActiveCfg = Debug|x64 @@ -727,6 +904,8 @@ {B5FE16F8-3EDB-4110-BD80-B4238CC01E8D}.Debug-Dynamic|Any CPU.ActiveCfg = Debug-Dynamic|Win32 {B5FE16F8-3EDB-4110-BD80-B4238CC01E8D}.Debug-Dynamic|ARM.ActiveCfg = Debug-Dynamic|ARM {B5FE16F8-3EDB-4110-BD80-B4238CC01E8D}.Debug-Dynamic|ARM.Build.0 = Debug-Dynamic|ARM + {B5FE16F8-3EDB-4110-BD80-B4238CC01E8D}.Debug-Dynamic|ARM64.ActiveCfg = Debug-Dynamic|ARM64 + {B5FE16F8-3EDB-4110-BD80-B4238CC01E8D}.Debug-Dynamic|ARM64.Build.0 = Debug-Dynamic|ARM64 {B5FE16F8-3EDB-4110-BD80-B4238CC01E8D}.Debug-Dynamic|Win32.ActiveCfg = Debug-Dynamic|Win32 {B5FE16F8-3EDB-4110-BD80-B4238CC01E8D}.Debug-Dynamic|Win32.Build.0 = Debug-Dynamic|Win32 {B5FE16F8-3EDB-4110-BD80-B4238CC01E8D}.Debug-Dynamic|x64.ActiveCfg = Debug-Dynamic|x64 @@ -734,6 +913,8 @@ {B5FE16F8-3EDB-4110-BD80-B4238CC01E8D}.Debug-Static|Any CPU.ActiveCfg = Debug-Static|Win32 {B5FE16F8-3EDB-4110-BD80-B4238CC01E8D}.Debug-Static|ARM.ActiveCfg = Debug-Static|ARM {B5FE16F8-3EDB-4110-BD80-B4238CC01E8D}.Debug-Static|ARM.Build.0 = Debug-Static|ARM + {B5FE16F8-3EDB-4110-BD80-B4238CC01E8D}.Debug-Static|ARM64.ActiveCfg = Debug-Static|ARM64 + {B5FE16F8-3EDB-4110-BD80-B4238CC01E8D}.Debug-Static|ARM64.Build.0 = Debug-Static|ARM64 {B5FE16F8-3EDB-4110-BD80-B4238CC01E8D}.Debug-Static|Win32.ActiveCfg = Debug-Static|Win32 {B5FE16F8-3EDB-4110-BD80-B4238CC01E8D}.Debug-Static|Win32.Build.0 = Debug-Static|Win32 {B5FE16F8-3EDB-4110-BD80-B4238CC01E8D}.Debug-Static|x64.ActiveCfg = Debug-Static|x64 @@ -741,6 +922,8 @@ {B5FE16F8-3EDB-4110-BD80-B4238CC01E8D}.Release|Any CPU.ActiveCfg = Release|Win32 {B5FE16F8-3EDB-4110-BD80-B4238CC01E8D}.Release|ARM.ActiveCfg = Release|ARM {B5FE16F8-3EDB-4110-BD80-B4238CC01E8D}.Release|ARM.Build.0 = Release|ARM + {B5FE16F8-3EDB-4110-BD80-B4238CC01E8D}.Release|ARM64.ActiveCfg = Release|ARM64 + {B5FE16F8-3EDB-4110-BD80-B4238CC01E8D}.Release|ARM64.Build.0 = Release|ARM64 {B5FE16F8-3EDB-4110-BD80-B4238CC01E8D}.Release|Win32.ActiveCfg = Release|Win32 {B5FE16F8-3EDB-4110-BD80-B4238CC01E8D}.Release|Win32.Build.0 = Release|Win32 {B5FE16F8-3EDB-4110-BD80-B4238CC01E8D}.Release|x64.ActiveCfg = Release|x64 @@ -748,6 +931,8 @@ {B5FE16F8-3EDB-4110-BD80-B4238CC01E8D}.Release-Dynamic|Any CPU.ActiveCfg = Release-Dynamic|Win32 {B5FE16F8-3EDB-4110-BD80-B4238CC01E8D}.Release-Dynamic|ARM.ActiveCfg = Release-Dynamic|ARM {B5FE16F8-3EDB-4110-BD80-B4238CC01E8D}.Release-Dynamic|ARM.Build.0 = Release-Dynamic|ARM + {B5FE16F8-3EDB-4110-BD80-B4238CC01E8D}.Release-Dynamic|ARM64.ActiveCfg = Release-Dynamic|ARM64 + {B5FE16F8-3EDB-4110-BD80-B4238CC01E8D}.Release-Dynamic|ARM64.Build.0 = Release-Dynamic|ARM64 {B5FE16F8-3EDB-4110-BD80-B4238CC01E8D}.Release-Dynamic|Win32.ActiveCfg = Release-Dynamic|Win32 {B5FE16F8-3EDB-4110-BD80-B4238CC01E8D}.Release-Dynamic|Win32.Build.0 = Release-Dynamic|Win32 {B5FE16F8-3EDB-4110-BD80-B4238CC01E8D}.Release-Dynamic|x64.ActiveCfg = Release-Dynamic|x64 @@ -755,6 +940,8 @@ {B5FE16F8-3EDB-4110-BD80-B4238CC01E8D}.Release-Static|Any CPU.ActiveCfg = Release-Static|Win32 {B5FE16F8-3EDB-4110-BD80-B4238CC01E8D}.Release-Static|ARM.ActiveCfg = Release-Static|ARM {B5FE16F8-3EDB-4110-BD80-B4238CC01E8D}.Release-Static|ARM.Build.0 = Release-Static|ARM + {B5FE16F8-3EDB-4110-BD80-B4238CC01E8D}.Release-Static|ARM64.ActiveCfg = Release-Static|ARM64 + {B5FE16F8-3EDB-4110-BD80-B4238CC01E8D}.Release-Static|ARM64.Build.0 = Release-Static|ARM64 {B5FE16F8-3EDB-4110-BD80-B4238CC01E8D}.Release-Static|Win32.ActiveCfg = Release-Static|Win32 {B5FE16F8-3EDB-4110-BD80-B4238CC01E8D}.Release-Static|Win32.Build.0 = Release-Static|Win32 {B5FE16F8-3EDB-4110-BD80-B4238CC01E8D}.Release-Static|x64.ActiveCfg = Release-Static|x64 @@ -762,6 +949,8 @@ {6794B975-4E84-4F49-B2DC-C31F2224E03E}.Debug|Any CPU.ActiveCfg = Debug|Win32 {6794B975-4E84-4F49-B2DC-C31F2224E03E}.Debug|ARM.ActiveCfg = Debug|ARM {6794B975-4E84-4F49-B2DC-C31F2224E03E}.Debug|ARM.Build.0 = Debug|ARM + {6794B975-4E84-4F49-B2DC-C31F2224E03E}.Debug|ARM64.ActiveCfg = Debug|ARM64 + {6794B975-4E84-4F49-B2DC-C31F2224E03E}.Debug|ARM64.Build.0 = Debug|ARM64 {6794B975-4E84-4F49-B2DC-C31F2224E03E}.Debug|Win32.ActiveCfg = Debug|Win32 {6794B975-4E84-4F49-B2DC-C31F2224E03E}.Debug|Win32.Build.0 = Debug|Win32 {6794B975-4E84-4F49-B2DC-C31F2224E03E}.Debug|x64.ActiveCfg = Debug|x64 @@ -769,6 +958,8 @@ {6794B975-4E84-4F49-B2DC-C31F2224E03E}.Debug-Dynamic|Any CPU.ActiveCfg = Debug-Dynamic|Win32 {6794B975-4E84-4F49-B2DC-C31F2224E03E}.Debug-Dynamic|ARM.ActiveCfg = Debug-Dynamic|ARM {6794B975-4E84-4F49-B2DC-C31F2224E03E}.Debug-Dynamic|ARM.Build.0 = Debug-Dynamic|ARM + {6794B975-4E84-4F49-B2DC-C31F2224E03E}.Debug-Dynamic|ARM64.ActiveCfg = Debug-Dynamic|ARM64 + {6794B975-4E84-4F49-B2DC-C31F2224E03E}.Debug-Dynamic|ARM64.Build.0 = Debug-Dynamic|ARM64 {6794B975-4E84-4F49-B2DC-C31F2224E03E}.Debug-Dynamic|Win32.ActiveCfg = Debug-Dynamic|Win32 {6794B975-4E84-4F49-B2DC-C31F2224E03E}.Debug-Dynamic|Win32.Build.0 = Debug-Dynamic|Win32 {6794B975-4E84-4F49-B2DC-C31F2224E03E}.Debug-Dynamic|x64.ActiveCfg = Debug-Dynamic|x64 @@ -776,6 +967,8 @@ {6794B975-4E84-4F49-B2DC-C31F2224E03E}.Debug-Static|Any CPU.ActiveCfg = Debug-Static|Win32 {6794B975-4E84-4F49-B2DC-C31F2224E03E}.Debug-Static|ARM.ActiveCfg = Debug-Static|ARM {6794B975-4E84-4F49-B2DC-C31F2224E03E}.Debug-Static|ARM.Build.0 = Debug-Static|ARM + {6794B975-4E84-4F49-B2DC-C31F2224E03E}.Debug-Static|ARM64.ActiveCfg = Debug-Static|ARM64 + {6794B975-4E84-4F49-B2DC-C31F2224E03E}.Debug-Static|ARM64.Build.0 = Debug-Static|ARM64 {6794B975-4E84-4F49-B2DC-C31F2224E03E}.Debug-Static|Win32.ActiveCfg = Debug-Static|Win32 {6794B975-4E84-4F49-B2DC-C31F2224E03E}.Debug-Static|Win32.Build.0 = Debug-Static|Win32 {6794B975-4E84-4F49-B2DC-C31F2224E03E}.Debug-Static|x64.ActiveCfg = Debug-Static|x64 @@ -783,6 +976,8 @@ {6794B975-4E84-4F49-B2DC-C31F2224E03E}.Release|Any CPU.ActiveCfg = Release|Win32 {6794B975-4E84-4F49-B2DC-C31F2224E03E}.Release|ARM.ActiveCfg = Release|ARM {6794B975-4E84-4F49-B2DC-C31F2224E03E}.Release|ARM.Build.0 = Release|ARM + {6794B975-4E84-4F49-B2DC-C31F2224E03E}.Release|ARM64.ActiveCfg = Release|ARM64 + {6794B975-4E84-4F49-B2DC-C31F2224E03E}.Release|ARM64.Build.0 = Release|ARM64 {6794B975-4E84-4F49-B2DC-C31F2224E03E}.Release|Win32.ActiveCfg = Release|Win32 {6794B975-4E84-4F49-B2DC-C31F2224E03E}.Release|Win32.Build.0 = Release|Win32 {6794B975-4E84-4F49-B2DC-C31F2224E03E}.Release|x64.ActiveCfg = Release|x64 @@ -790,6 +985,8 @@ {6794B975-4E84-4F49-B2DC-C31F2224E03E}.Release-Dynamic|Any CPU.ActiveCfg = Release-Dynamic|Win32 {6794B975-4E84-4F49-B2DC-C31F2224E03E}.Release-Dynamic|ARM.ActiveCfg = Release-Dynamic|ARM {6794B975-4E84-4F49-B2DC-C31F2224E03E}.Release-Dynamic|ARM.Build.0 = Release-Dynamic|ARM + {6794B975-4E84-4F49-B2DC-C31F2224E03E}.Release-Dynamic|ARM64.ActiveCfg = Release-Dynamic|ARM64 + {6794B975-4E84-4F49-B2DC-C31F2224E03E}.Release-Dynamic|ARM64.Build.0 = Release-Dynamic|ARM64 {6794B975-4E84-4F49-B2DC-C31F2224E03E}.Release-Dynamic|Win32.ActiveCfg = Release-Dynamic|Win32 {6794B975-4E84-4F49-B2DC-C31F2224E03E}.Release-Dynamic|Win32.Build.0 = Release-Dynamic|Win32 {6794B975-4E84-4F49-B2DC-C31F2224E03E}.Release-Dynamic|x64.ActiveCfg = Release-Dynamic|x64 @@ -797,6 +994,8 @@ {6794B975-4E84-4F49-B2DC-C31F2224E03E}.Release-Static|Any CPU.ActiveCfg = Release-Static|Win32 {6794B975-4E84-4F49-B2DC-C31F2224E03E}.Release-Static|ARM.ActiveCfg = Release-Static|ARM {6794B975-4E84-4F49-B2DC-C31F2224E03E}.Release-Static|ARM.Build.0 = Release-Static|ARM + {6794B975-4E84-4F49-B2DC-C31F2224E03E}.Release-Static|ARM64.ActiveCfg = Release-Static|ARM64 + {6794B975-4E84-4F49-B2DC-C31F2224E03E}.Release-Static|ARM64.Build.0 = Release-Static|ARM64 {6794B975-4E84-4F49-B2DC-C31F2224E03E}.Release-Static|Win32.ActiveCfg = Release-Static|Win32 {6794B975-4E84-4F49-B2DC-C31F2224E03E}.Release-Static|Win32.Build.0 = Release-Static|Win32 {6794B975-4E84-4F49-B2DC-C31F2224E03E}.Release-Static|x64.ActiveCfg = Release-Static|x64 @@ -804,6 +1003,8 @@ {4B059DBA-CD9C-4D0F-BE8C-FFB4EFD498E9}.Debug|Any CPU.ActiveCfg = Debug|Win32 {4B059DBA-CD9C-4D0F-BE8C-FFB4EFD498E9}.Debug|ARM.ActiveCfg = Debug|ARM {4B059DBA-CD9C-4D0F-BE8C-FFB4EFD498E9}.Debug|ARM.Build.0 = Debug|ARM + {4B059DBA-CD9C-4D0F-BE8C-FFB4EFD498E9}.Debug|ARM64.ActiveCfg = Debug|ARM64 + {4B059DBA-CD9C-4D0F-BE8C-FFB4EFD498E9}.Debug|ARM64.Build.0 = Debug|ARM64 {4B059DBA-CD9C-4D0F-BE8C-FFB4EFD498E9}.Debug|Win32.ActiveCfg = Debug|Win32 {4B059DBA-CD9C-4D0F-BE8C-FFB4EFD498E9}.Debug|Win32.Build.0 = Debug|Win32 {4B059DBA-CD9C-4D0F-BE8C-FFB4EFD498E9}.Debug|x64.ActiveCfg = Debug|x64 @@ -811,6 +1012,8 @@ {4B059DBA-CD9C-4D0F-BE8C-FFB4EFD498E9}.Debug-Dynamic|Any CPU.ActiveCfg = Debug-Dynamic|Win32 {4B059DBA-CD9C-4D0F-BE8C-FFB4EFD498E9}.Debug-Dynamic|ARM.ActiveCfg = Debug-Dynamic|ARM {4B059DBA-CD9C-4D0F-BE8C-FFB4EFD498E9}.Debug-Dynamic|ARM.Build.0 = Debug-Dynamic|ARM + {4B059DBA-CD9C-4D0F-BE8C-FFB4EFD498E9}.Debug-Dynamic|ARM64.ActiveCfg = Debug-Dynamic|ARM64 + {4B059DBA-CD9C-4D0F-BE8C-FFB4EFD498E9}.Debug-Dynamic|ARM64.Build.0 = Debug-Dynamic|ARM64 {4B059DBA-CD9C-4D0F-BE8C-FFB4EFD498E9}.Debug-Dynamic|Win32.ActiveCfg = Debug-Dynamic|Win32 {4B059DBA-CD9C-4D0F-BE8C-FFB4EFD498E9}.Debug-Dynamic|Win32.Build.0 = Debug-Dynamic|Win32 {4B059DBA-CD9C-4D0F-BE8C-FFB4EFD498E9}.Debug-Dynamic|x64.ActiveCfg = Debug-Dynamic|x64 @@ -818,6 +1021,8 @@ {4B059DBA-CD9C-4D0F-BE8C-FFB4EFD498E9}.Debug-Static|Any CPU.ActiveCfg = Debug-Static|Win32 {4B059DBA-CD9C-4D0F-BE8C-FFB4EFD498E9}.Debug-Static|ARM.ActiveCfg = Debug-Static|ARM {4B059DBA-CD9C-4D0F-BE8C-FFB4EFD498E9}.Debug-Static|ARM.Build.0 = Debug-Static|ARM + {4B059DBA-CD9C-4D0F-BE8C-FFB4EFD498E9}.Debug-Static|ARM64.ActiveCfg = Debug-Static|ARM64 + {4B059DBA-CD9C-4D0F-BE8C-FFB4EFD498E9}.Debug-Static|ARM64.Build.0 = Debug-Static|ARM64 {4B059DBA-CD9C-4D0F-BE8C-FFB4EFD498E9}.Debug-Static|Win32.ActiveCfg = Debug-Static|Win32 {4B059DBA-CD9C-4D0F-BE8C-FFB4EFD498E9}.Debug-Static|Win32.Build.0 = Debug-Static|Win32 {4B059DBA-CD9C-4D0F-BE8C-FFB4EFD498E9}.Debug-Static|x64.ActiveCfg = Debug-Static|x64 @@ -825,6 +1030,8 @@ {4B059DBA-CD9C-4D0F-BE8C-FFB4EFD498E9}.Release|Any CPU.ActiveCfg = Release|Win32 {4B059DBA-CD9C-4D0F-BE8C-FFB4EFD498E9}.Release|ARM.ActiveCfg = Release|ARM {4B059DBA-CD9C-4D0F-BE8C-FFB4EFD498E9}.Release|ARM.Build.0 = Release|ARM + {4B059DBA-CD9C-4D0F-BE8C-FFB4EFD498E9}.Release|ARM64.ActiveCfg = Release|ARM64 + {4B059DBA-CD9C-4D0F-BE8C-FFB4EFD498E9}.Release|ARM64.Build.0 = Release|ARM64 {4B059DBA-CD9C-4D0F-BE8C-FFB4EFD498E9}.Release|Win32.ActiveCfg = Release|Win32 {4B059DBA-CD9C-4D0F-BE8C-FFB4EFD498E9}.Release|Win32.Build.0 = Release|Win32 {4B059DBA-CD9C-4D0F-BE8C-FFB4EFD498E9}.Release|x64.ActiveCfg = Release|x64 @@ -832,6 +1039,8 @@ {4B059DBA-CD9C-4D0F-BE8C-FFB4EFD498E9}.Release-Dynamic|Any CPU.ActiveCfg = Release-Dynamic|Win32 {4B059DBA-CD9C-4D0F-BE8C-FFB4EFD498E9}.Release-Dynamic|ARM.ActiveCfg = Release-Dynamic|ARM {4B059DBA-CD9C-4D0F-BE8C-FFB4EFD498E9}.Release-Dynamic|ARM.Build.0 = Release-Dynamic|ARM + {4B059DBA-CD9C-4D0F-BE8C-FFB4EFD498E9}.Release-Dynamic|ARM64.ActiveCfg = Release-Dynamic|ARM64 + {4B059DBA-CD9C-4D0F-BE8C-FFB4EFD498E9}.Release-Dynamic|ARM64.Build.0 = Release-Dynamic|ARM64 {4B059DBA-CD9C-4D0F-BE8C-FFB4EFD498E9}.Release-Dynamic|Win32.ActiveCfg = Release-Dynamic|Win32 {4B059DBA-CD9C-4D0F-BE8C-FFB4EFD498E9}.Release-Dynamic|Win32.Build.0 = Release-Dynamic|Win32 {4B059DBA-CD9C-4D0F-BE8C-FFB4EFD498E9}.Release-Dynamic|x64.ActiveCfg = Release-Dynamic|x64 @@ -839,6 +1048,8 @@ {4B059DBA-CD9C-4D0F-BE8C-FFB4EFD498E9}.Release-Static|Any CPU.ActiveCfg = Release-Static|Win32 {4B059DBA-CD9C-4D0F-BE8C-FFB4EFD498E9}.Release-Static|ARM.ActiveCfg = Release-Static|ARM {4B059DBA-CD9C-4D0F-BE8C-FFB4EFD498E9}.Release-Static|ARM.Build.0 = Release-Static|ARM + {4B059DBA-CD9C-4D0F-BE8C-FFB4EFD498E9}.Release-Static|ARM64.ActiveCfg = Release-Static|ARM64 + {4B059DBA-CD9C-4D0F-BE8C-FFB4EFD498E9}.Release-Static|ARM64.Build.0 = Release-Static|ARM64 {4B059DBA-CD9C-4D0F-BE8C-FFB4EFD498E9}.Release-Static|Win32.ActiveCfg = Release-Static|Win32 {4B059DBA-CD9C-4D0F-BE8C-FFB4EFD498E9}.Release-Static|Win32.Build.0 = Release-Static|Win32 {4B059DBA-CD9C-4D0F-BE8C-FFB4EFD498E9}.Release-Static|x64.ActiveCfg = Release-Static|x64 @@ -846,6 +1057,8 @@ {4BF51C21-5A30-423B-82FE-1ED410E5769D}.Debug|Any CPU.ActiveCfg = Debug|Win32 {4BF51C21-5A30-423B-82FE-1ED410E5769D}.Debug|ARM.ActiveCfg = Debug|ARM {4BF51C21-5A30-423B-82FE-1ED410E5769D}.Debug|ARM.Build.0 = Debug|ARM + {4BF51C21-5A30-423B-82FE-1ED410E5769D}.Debug|ARM64.ActiveCfg = Debug|ARM64 + {4BF51C21-5A30-423B-82FE-1ED410E5769D}.Debug|ARM64.Build.0 = Debug|ARM64 {4BF51C21-5A30-423B-82FE-1ED410E5769D}.Debug|Win32.ActiveCfg = Debug|Win32 {4BF51C21-5A30-423B-82FE-1ED410E5769D}.Debug|Win32.Build.0 = Debug|Win32 {4BF51C21-5A30-423B-82FE-1ED410E5769D}.Debug|x64.ActiveCfg = Debug|x64 @@ -853,6 +1066,8 @@ {4BF51C21-5A30-423B-82FE-1ED410E5769D}.Debug-Dynamic|Any CPU.ActiveCfg = Debug-Dynamic|Win32 {4BF51C21-5A30-423B-82FE-1ED410E5769D}.Debug-Dynamic|ARM.ActiveCfg = Debug-Dynamic|ARM {4BF51C21-5A30-423B-82FE-1ED410E5769D}.Debug-Dynamic|ARM.Build.0 = Debug-Dynamic|ARM + {4BF51C21-5A30-423B-82FE-1ED410E5769D}.Debug-Dynamic|ARM64.ActiveCfg = Debug-Dynamic|ARM64 + {4BF51C21-5A30-423B-82FE-1ED410E5769D}.Debug-Dynamic|ARM64.Build.0 = Debug-Dynamic|ARM64 {4BF51C21-5A30-423B-82FE-1ED410E5769D}.Debug-Dynamic|Win32.ActiveCfg = Debug-Dynamic|Win32 {4BF51C21-5A30-423B-82FE-1ED410E5769D}.Debug-Dynamic|Win32.Build.0 = Debug-Dynamic|Win32 {4BF51C21-5A30-423B-82FE-1ED410E5769D}.Debug-Dynamic|x64.ActiveCfg = Debug-Dynamic|x64 @@ -860,6 +1075,8 @@ {4BF51C21-5A30-423B-82FE-1ED410E5769D}.Debug-Static|Any CPU.ActiveCfg = Debug-Static|Win32 {4BF51C21-5A30-423B-82FE-1ED410E5769D}.Debug-Static|ARM.ActiveCfg = Debug-Static|ARM {4BF51C21-5A30-423B-82FE-1ED410E5769D}.Debug-Static|ARM.Build.0 = Debug-Static|ARM + {4BF51C21-5A30-423B-82FE-1ED410E5769D}.Debug-Static|ARM64.ActiveCfg = Debug-Static|ARM64 + {4BF51C21-5A30-423B-82FE-1ED410E5769D}.Debug-Static|ARM64.Build.0 = Debug-Static|ARM64 {4BF51C21-5A30-423B-82FE-1ED410E5769D}.Debug-Static|Win32.ActiveCfg = Debug-Static|Win32 {4BF51C21-5A30-423B-82FE-1ED410E5769D}.Debug-Static|Win32.Build.0 = Debug-Static|Win32 {4BF51C21-5A30-423B-82FE-1ED410E5769D}.Debug-Static|x64.ActiveCfg = Debug-Static|x64 @@ -867,6 +1084,8 @@ {4BF51C21-5A30-423B-82FE-1ED410E5769D}.Release|Any CPU.ActiveCfg = Release|Win32 {4BF51C21-5A30-423B-82FE-1ED410E5769D}.Release|ARM.ActiveCfg = Release|ARM {4BF51C21-5A30-423B-82FE-1ED410E5769D}.Release|ARM.Build.0 = Release|ARM + {4BF51C21-5A30-423B-82FE-1ED410E5769D}.Release|ARM64.ActiveCfg = Release|ARM64 + {4BF51C21-5A30-423B-82FE-1ED410E5769D}.Release|ARM64.Build.0 = Release|ARM64 {4BF51C21-5A30-423B-82FE-1ED410E5769D}.Release|Win32.ActiveCfg = Release|Win32 {4BF51C21-5A30-423B-82FE-1ED410E5769D}.Release|Win32.Build.0 = Release|Win32 {4BF51C21-5A30-423B-82FE-1ED410E5769D}.Release|x64.ActiveCfg = Release|x64 @@ -874,6 +1093,8 @@ {4BF51C21-5A30-423B-82FE-1ED410E5769D}.Release-Dynamic|Any CPU.ActiveCfg = Release-Dynamic|Win32 {4BF51C21-5A30-423B-82FE-1ED410E5769D}.Release-Dynamic|ARM.ActiveCfg = Release-Dynamic|ARM {4BF51C21-5A30-423B-82FE-1ED410E5769D}.Release-Dynamic|ARM.Build.0 = Release-Dynamic|ARM + {4BF51C21-5A30-423B-82FE-1ED410E5769D}.Release-Dynamic|ARM64.ActiveCfg = Release-Dynamic|ARM64 + {4BF51C21-5A30-423B-82FE-1ED410E5769D}.Release-Dynamic|ARM64.Build.0 = Release-Dynamic|ARM64 {4BF51C21-5A30-423B-82FE-1ED410E5769D}.Release-Dynamic|Win32.ActiveCfg = Release-Dynamic|Win32 {4BF51C21-5A30-423B-82FE-1ED410E5769D}.Release-Dynamic|Win32.Build.0 = Release-Dynamic|Win32 {4BF51C21-5A30-423B-82FE-1ED410E5769D}.Release-Dynamic|x64.ActiveCfg = Release-Dynamic|x64 @@ -881,6 +1102,8 @@ {4BF51C21-5A30-423B-82FE-1ED410E5769D}.Release-Static|Any CPU.ActiveCfg = Release-Static|Win32 {4BF51C21-5A30-423B-82FE-1ED410E5769D}.Release-Static|ARM.ActiveCfg = Release-Static|ARM {4BF51C21-5A30-423B-82FE-1ED410E5769D}.Release-Static|ARM.Build.0 = Release-Static|ARM + {4BF51C21-5A30-423B-82FE-1ED410E5769D}.Release-Static|ARM64.ActiveCfg = Release-Static|ARM64 + {4BF51C21-5A30-423B-82FE-1ED410E5769D}.Release-Static|ARM64.Build.0 = Release-Static|ARM64 {4BF51C21-5A30-423B-82FE-1ED410E5769D}.Release-Static|Win32.ActiveCfg = Release-Static|Win32 {4BF51C21-5A30-423B-82FE-1ED410E5769D}.Release-Static|Win32.Build.0 = Release-Static|Win32 {4BF51C21-5A30-423B-82FE-1ED410E5769D}.Release-Static|x64.ActiveCfg = Release-Static|x64 @@ -888,6 +1111,8 @@ {F0DBAA03-1BA3-4E3B-A2CA-727E3D3AB858}.Debug|Any CPU.ActiveCfg = Debug|Win32 {F0DBAA03-1BA3-4E3B-A2CA-727E3D3AB858}.Debug|ARM.ActiveCfg = Debug|ARM {F0DBAA03-1BA3-4E3B-A2CA-727E3D3AB858}.Debug|ARM.Build.0 = Debug|ARM + {F0DBAA03-1BA3-4E3B-A2CA-727E3D3AB858}.Debug|ARM64.ActiveCfg = Debug|ARM64 + {F0DBAA03-1BA3-4E3B-A2CA-727E3D3AB858}.Debug|ARM64.Build.0 = Debug|ARM64 {F0DBAA03-1BA3-4E3B-A2CA-727E3D3AB858}.Debug|Win32.ActiveCfg = Debug|Win32 {F0DBAA03-1BA3-4E3B-A2CA-727E3D3AB858}.Debug|Win32.Build.0 = Debug|Win32 {F0DBAA03-1BA3-4E3B-A2CA-727E3D3AB858}.Debug|x64.ActiveCfg = Debug|x64 @@ -895,6 +1120,8 @@ {F0DBAA03-1BA3-4E3B-A2CA-727E3D3AB858}.Debug-Dynamic|Any CPU.ActiveCfg = Debug-Dynamic|Win32 {F0DBAA03-1BA3-4E3B-A2CA-727E3D3AB858}.Debug-Dynamic|ARM.ActiveCfg = Debug-Dynamic|ARM {F0DBAA03-1BA3-4E3B-A2CA-727E3D3AB858}.Debug-Dynamic|ARM.Build.0 = Debug-Dynamic|ARM + {F0DBAA03-1BA3-4E3B-A2CA-727E3D3AB858}.Debug-Dynamic|ARM64.ActiveCfg = Debug-Dynamic|ARM64 + {F0DBAA03-1BA3-4E3B-A2CA-727E3D3AB858}.Debug-Dynamic|ARM64.Build.0 = Debug-Dynamic|ARM64 {F0DBAA03-1BA3-4E3B-A2CA-727E3D3AB858}.Debug-Dynamic|Win32.ActiveCfg = Debug-Dynamic|Win32 {F0DBAA03-1BA3-4E3B-A2CA-727E3D3AB858}.Debug-Dynamic|Win32.Build.0 = Debug-Dynamic|Win32 {F0DBAA03-1BA3-4E3B-A2CA-727E3D3AB858}.Debug-Dynamic|x64.ActiveCfg = Debug-Dynamic|x64 @@ -902,6 +1129,8 @@ {F0DBAA03-1BA3-4E3B-A2CA-727E3D3AB858}.Debug-Static|Any CPU.ActiveCfg = Debug-Static|Win32 {F0DBAA03-1BA3-4E3B-A2CA-727E3D3AB858}.Debug-Static|ARM.ActiveCfg = Debug-Static|ARM {F0DBAA03-1BA3-4E3B-A2CA-727E3D3AB858}.Debug-Static|ARM.Build.0 = Debug-Static|ARM + {F0DBAA03-1BA3-4E3B-A2CA-727E3D3AB858}.Debug-Static|ARM64.ActiveCfg = Debug-Static|ARM64 + {F0DBAA03-1BA3-4E3B-A2CA-727E3D3AB858}.Debug-Static|ARM64.Build.0 = Debug-Static|ARM64 {F0DBAA03-1BA3-4E3B-A2CA-727E3D3AB858}.Debug-Static|Win32.ActiveCfg = Debug-Static|Win32 {F0DBAA03-1BA3-4E3B-A2CA-727E3D3AB858}.Debug-Static|Win32.Build.0 = Debug-Static|Win32 {F0DBAA03-1BA3-4E3B-A2CA-727E3D3AB858}.Debug-Static|x64.ActiveCfg = Debug-Static|x64 @@ -909,6 +1138,8 @@ {F0DBAA03-1BA3-4E3B-A2CA-727E3D3AB858}.Release|Any CPU.ActiveCfg = Release|Win32 {F0DBAA03-1BA3-4E3B-A2CA-727E3D3AB858}.Release|ARM.ActiveCfg = Release|ARM {F0DBAA03-1BA3-4E3B-A2CA-727E3D3AB858}.Release|ARM.Build.0 = Release|ARM + {F0DBAA03-1BA3-4E3B-A2CA-727E3D3AB858}.Release|ARM64.ActiveCfg = Release|ARM64 + {F0DBAA03-1BA3-4E3B-A2CA-727E3D3AB858}.Release|ARM64.Build.0 = Release|ARM64 {F0DBAA03-1BA3-4E3B-A2CA-727E3D3AB858}.Release|Win32.ActiveCfg = Release|Win32 {F0DBAA03-1BA3-4E3B-A2CA-727E3D3AB858}.Release|Win32.Build.0 = Release|Win32 {F0DBAA03-1BA3-4E3B-A2CA-727E3D3AB858}.Release|x64.ActiveCfg = Release|x64 @@ -916,6 +1147,8 @@ {F0DBAA03-1BA3-4E3B-A2CA-727E3D3AB858}.Release-Dynamic|Any CPU.ActiveCfg = Release-Dynamic|Win32 {F0DBAA03-1BA3-4E3B-A2CA-727E3D3AB858}.Release-Dynamic|ARM.ActiveCfg = Release-Dynamic|ARM {F0DBAA03-1BA3-4E3B-A2CA-727E3D3AB858}.Release-Dynamic|ARM.Build.0 = Release-Dynamic|ARM + {F0DBAA03-1BA3-4E3B-A2CA-727E3D3AB858}.Release-Dynamic|ARM64.ActiveCfg = Release-Dynamic|ARM64 + {F0DBAA03-1BA3-4E3B-A2CA-727E3D3AB858}.Release-Dynamic|ARM64.Build.0 = Release-Dynamic|ARM64 {F0DBAA03-1BA3-4E3B-A2CA-727E3D3AB858}.Release-Dynamic|Win32.ActiveCfg = Release-Dynamic|Win32 {F0DBAA03-1BA3-4E3B-A2CA-727E3D3AB858}.Release-Dynamic|Win32.Build.0 = Release-Dynamic|Win32 {F0DBAA03-1BA3-4E3B-A2CA-727E3D3AB858}.Release-Dynamic|x64.ActiveCfg = Release-Dynamic|x64 @@ -923,78 +1156,104 @@ {F0DBAA03-1BA3-4E3B-A2CA-727E3D3AB858}.Release-Static|Any CPU.ActiveCfg = Release-Static|Win32 {F0DBAA03-1BA3-4E3B-A2CA-727E3D3AB858}.Release-Static|ARM.ActiveCfg = Release-Static|ARM {F0DBAA03-1BA3-4E3B-A2CA-727E3D3AB858}.Release-Static|ARM.Build.0 = Release-Static|ARM + {F0DBAA03-1BA3-4E3B-A2CA-727E3D3AB858}.Release-Static|ARM64.ActiveCfg = Release-Static|ARM64 + {F0DBAA03-1BA3-4E3B-A2CA-727E3D3AB858}.Release-Static|ARM64.Build.0 = Release-Static|ARM64 {F0DBAA03-1BA3-4E3B-A2CA-727E3D3AB858}.Release-Static|Win32.ActiveCfg = Release-Static|Win32 {F0DBAA03-1BA3-4E3B-A2CA-727E3D3AB858}.Release-Static|Win32.Build.0 = Release-Static|Win32 {F0DBAA03-1BA3-4E3B-A2CA-727E3D3AB858}.Release-Static|x64.ActiveCfg = Release-Static|x64 {F0DBAA03-1BA3-4E3B-A2CA-727E3D3AB858}.Release-Static|x64.Build.0 = Release-Static|x64 {553C094C-F581-4A80-9540-D5D7B398A2C6}.Debug|Any CPU.ActiveCfg = Debug|Win32 {553C094C-F581-4A80-9540-D5D7B398A2C6}.Debug|ARM.ActiveCfg = Debug|Win32 + {553C094C-F581-4A80-9540-D5D7B398A2C6}.Debug|ARM64.ActiveCfg = Debug|ARM64 + {553C094C-F581-4A80-9540-D5D7B398A2C6}.Debug|ARM64.Build.0 = Debug|ARM64 {553C094C-F581-4A80-9540-D5D7B398A2C6}.Debug|Win32.ActiveCfg = Debug|Win32 {553C094C-F581-4A80-9540-D5D7B398A2C6}.Debug|Win32.Build.0 = Debug|Win32 {553C094C-F581-4A80-9540-D5D7B398A2C6}.Debug|x64.ActiveCfg = Debug|x64 {553C094C-F581-4A80-9540-D5D7B398A2C6}.Debug|x64.Build.0 = Debug|x64 {553C094C-F581-4A80-9540-D5D7B398A2C6}.Debug-Dynamic|Any CPU.ActiveCfg = Debug-Dynamic|Win32 {553C094C-F581-4A80-9540-D5D7B398A2C6}.Debug-Dynamic|ARM.ActiveCfg = Debug-Dynamic|Win32 + {553C094C-F581-4A80-9540-D5D7B398A2C6}.Debug-Dynamic|ARM64.ActiveCfg = Debug-Dynamic|ARM64 + {553C094C-F581-4A80-9540-D5D7B398A2C6}.Debug-Dynamic|ARM64.Build.0 = Debug-Dynamic|ARM64 {553C094C-F581-4A80-9540-D5D7B398A2C6}.Debug-Dynamic|Win32.ActiveCfg = Debug-Dynamic|Win32 {553C094C-F581-4A80-9540-D5D7B398A2C6}.Debug-Dynamic|Win32.Build.0 = Debug-Dynamic|Win32 {553C094C-F581-4A80-9540-D5D7B398A2C6}.Debug-Dynamic|x64.ActiveCfg = Debug-Dynamic|x64 {553C094C-F581-4A80-9540-D5D7B398A2C6}.Debug-Dynamic|x64.Build.0 = Debug-Dynamic|x64 {553C094C-F581-4A80-9540-D5D7B398A2C6}.Debug-Static|Any CPU.ActiveCfg = Debug-Static|Win32 {553C094C-F581-4A80-9540-D5D7B398A2C6}.Debug-Static|ARM.ActiveCfg = Debug-Static|Win32 + {553C094C-F581-4A80-9540-D5D7B398A2C6}.Debug-Static|ARM64.ActiveCfg = Debug-Static|ARM64 + {553C094C-F581-4A80-9540-D5D7B398A2C6}.Debug-Static|ARM64.Build.0 = Debug-Static|ARM64 {553C094C-F581-4A80-9540-D5D7B398A2C6}.Debug-Static|Win32.ActiveCfg = Debug-Static|Win32 {553C094C-F581-4A80-9540-D5D7B398A2C6}.Debug-Static|Win32.Build.0 = Debug-Static|Win32 {553C094C-F581-4A80-9540-D5D7B398A2C6}.Debug-Static|x64.ActiveCfg = Debug-Static|x64 {553C094C-F581-4A80-9540-D5D7B398A2C6}.Debug-Static|x64.Build.0 = Debug-Static|x64 {553C094C-F581-4A80-9540-D5D7B398A2C6}.Release|Any CPU.ActiveCfg = Release|Win32 {553C094C-F581-4A80-9540-D5D7B398A2C6}.Release|ARM.ActiveCfg = Release|Win32 + {553C094C-F581-4A80-9540-D5D7B398A2C6}.Release|ARM64.ActiveCfg = Release|ARM64 + {553C094C-F581-4A80-9540-D5D7B398A2C6}.Release|ARM64.Build.0 = Release|ARM64 {553C094C-F581-4A80-9540-D5D7B398A2C6}.Release|Win32.ActiveCfg = Release|Win32 {553C094C-F581-4A80-9540-D5D7B398A2C6}.Release|Win32.Build.0 = Release|Win32 {553C094C-F581-4A80-9540-D5D7B398A2C6}.Release|x64.ActiveCfg = Release|x64 {553C094C-F581-4A80-9540-D5D7B398A2C6}.Release|x64.Build.0 = Release|x64 {553C094C-F581-4A80-9540-D5D7B398A2C6}.Release-Dynamic|Any CPU.ActiveCfg = Release-Dynamic|Win32 {553C094C-F581-4A80-9540-D5D7B398A2C6}.Release-Dynamic|ARM.ActiveCfg = Release-Dynamic|Win32 + {553C094C-F581-4A80-9540-D5D7B398A2C6}.Release-Dynamic|ARM64.ActiveCfg = Release-Dynamic|ARM64 + {553C094C-F581-4A80-9540-D5D7B398A2C6}.Release-Dynamic|ARM64.Build.0 = Release-Dynamic|ARM64 {553C094C-F581-4A80-9540-D5D7B398A2C6}.Release-Dynamic|Win32.ActiveCfg = Release-Dynamic|Win32 {553C094C-F581-4A80-9540-D5D7B398A2C6}.Release-Dynamic|Win32.Build.0 = Release-Dynamic|Win32 {553C094C-F581-4A80-9540-D5D7B398A2C6}.Release-Dynamic|x64.ActiveCfg = Release-Dynamic|x64 {553C094C-F581-4A80-9540-D5D7B398A2C6}.Release-Dynamic|x64.Build.0 = Release-Dynamic|x64 {553C094C-F581-4A80-9540-D5D7B398A2C6}.Release-Static|Any CPU.ActiveCfg = Release-Static|Win32 {553C094C-F581-4A80-9540-D5D7B398A2C6}.Release-Static|ARM.ActiveCfg = Release-Static|Win32 + {553C094C-F581-4A80-9540-D5D7B398A2C6}.Release-Static|ARM64.ActiveCfg = Release-Static|ARM64 + {553C094C-F581-4A80-9540-D5D7B398A2C6}.Release-Static|ARM64.Build.0 = Release-Static|ARM64 {553C094C-F581-4A80-9540-D5D7B398A2C6}.Release-Static|Win32.ActiveCfg = Release-Static|Win32 {553C094C-F581-4A80-9540-D5D7B398A2C6}.Release-Static|Win32.Build.0 = Release-Static|Win32 {553C094C-F581-4A80-9540-D5D7B398A2C6}.Release-Static|x64.ActiveCfg = Release-Static|x64 {553C094C-F581-4A80-9540-D5D7B398A2C6}.Release-Static|x64.Build.0 = Release-Static|x64 {21C0CECF-69DD-4F70-BC2B-9B4DE7F15277}.Debug|Any CPU.ActiveCfg = Debug|Win32 {21C0CECF-69DD-4F70-BC2B-9B4DE7F15277}.Debug|ARM.ActiveCfg = Debug|Win32 + {21C0CECF-69DD-4F70-BC2B-9B4DE7F15277}.Debug|ARM64.ActiveCfg = Debug|ARM64 + {21C0CECF-69DD-4F70-BC2B-9B4DE7F15277}.Debug|ARM64.Build.0 = Debug|ARM64 {21C0CECF-69DD-4F70-BC2B-9B4DE7F15277}.Debug|Win32.ActiveCfg = Debug|Win32 {21C0CECF-69DD-4F70-BC2B-9B4DE7F15277}.Debug|Win32.Build.0 = Debug|Win32 {21C0CECF-69DD-4F70-BC2B-9B4DE7F15277}.Debug|x64.ActiveCfg = Debug|x64 {21C0CECF-69DD-4F70-BC2B-9B4DE7F15277}.Debug|x64.Build.0 = Debug|x64 {21C0CECF-69DD-4F70-BC2B-9B4DE7F15277}.Debug-Dynamic|Any CPU.ActiveCfg = Debug-Dynamic|Win32 {21C0CECF-69DD-4F70-BC2B-9B4DE7F15277}.Debug-Dynamic|ARM.ActiveCfg = Debug-Dynamic|Win32 + {21C0CECF-69DD-4F70-BC2B-9B4DE7F15277}.Debug-Dynamic|ARM64.ActiveCfg = Debug-Dynamic|ARM64 + {21C0CECF-69DD-4F70-BC2B-9B4DE7F15277}.Debug-Dynamic|ARM64.Build.0 = Debug-Dynamic|ARM64 {21C0CECF-69DD-4F70-BC2B-9B4DE7F15277}.Debug-Dynamic|Win32.ActiveCfg = Debug-Dynamic|Win32 {21C0CECF-69DD-4F70-BC2B-9B4DE7F15277}.Debug-Dynamic|Win32.Build.0 = Debug-Dynamic|Win32 {21C0CECF-69DD-4F70-BC2B-9B4DE7F15277}.Debug-Dynamic|x64.ActiveCfg = Debug-Dynamic|x64 {21C0CECF-69DD-4F70-BC2B-9B4DE7F15277}.Debug-Dynamic|x64.Build.0 = Debug-Dynamic|x64 {21C0CECF-69DD-4F70-BC2B-9B4DE7F15277}.Debug-Static|Any CPU.ActiveCfg = Debug-Static|Win32 {21C0CECF-69DD-4F70-BC2B-9B4DE7F15277}.Debug-Static|ARM.ActiveCfg = Debug-Static|Win32 + {21C0CECF-69DD-4F70-BC2B-9B4DE7F15277}.Debug-Static|ARM64.ActiveCfg = Debug-Static|ARM64 + {21C0CECF-69DD-4F70-BC2B-9B4DE7F15277}.Debug-Static|ARM64.Build.0 = Debug-Static|ARM64 {21C0CECF-69DD-4F70-BC2B-9B4DE7F15277}.Debug-Static|Win32.ActiveCfg = Debug-Static|Win32 {21C0CECF-69DD-4F70-BC2B-9B4DE7F15277}.Debug-Static|Win32.Build.0 = Debug-Static|Win32 {21C0CECF-69DD-4F70-BC2B-9B4DE7F15277}.Debug-Static|x64.ActiveCfg = Debug-Static|x64 {21C0CECF-69DD-4F70-BC2B-9B4DE7F15277}.Debug-Static|x64.Build.0 = Debug-Static|x64 {21C0CECF-69DD-4F70-BC2B-9B4DE7F15277}.Release|Any CPU.ActiveCfg = Release|Win32 {21C0CECF-69DD-4F70-BC2B-9B4DE7F15277}.Release|ARM.ActiveCfg = Release|Win32 + {21C0CECF-69DD-4F70-BC2B-9B4DE7F15277}.Release|ARM64.ActiveCfg = Release|ARM64 + {21C0CECF-69DD-4F70-BC2B-9B4DE7F15277}.Release|ARM64.Build.0 = Release|ARM64 {21C0CECF-69DD-4F70-BC2B-9B4DE7F15277}.Release|Win32.ActiveCfg = Release|Win32 {21C0CECF-69DD-4F70-BC2B-9B4DE7F15277}.Release|Win32.Build.0 = Release|Win32 {21C0CECF-69DD-4F70-BC2B-9B4DE7F15277}.Release|x64.ActiveCfg = Release|x64 {21C0CECF-69DD-4F70-BC2B-9B4DE7F15277}.Release|x64.Build.0 = Release|x64 {21C0CECF-69DD-4F70-BC2B-9B4DE7F15277}.Release-Dynamic|Any CPU.ActiveCfg = Release-Dynamic|Win32 {21C0CECF-69DD-4F70-BC2B-9B4DE7F15277}.Release-Dynamic|ARM.ActiveCfg = Release-Dynamic|Win32 + {21C0CECF-69DD-4F70-BC2B-9B4DE7F15277}.Release-Dynamic|ARM64.ActiveCfg = Release-Dynamic|ARM64 + {21C0CECF-69DD-4F70-BC2B-9B4DE7F15277}.Release-Dynamic|ARM64.Build.0 = Release-Dynamic|ARM64 {21C0CECF-69DD-4F70-BC2B-9B4DE7F15277}.Release-Dynamic|Win32.ActiveCfg = Release-Dynamic|Win32 {21C0CECF-69DD-4F70-BC2B-9B4DE7F15277}.Release-Dynamic|Win32.Build.0 = Release-Dynamic|Win32 {21C0CECF-69DD-4F70-BC2B-9B4DE7F15277}.Release-Dynamic|x64.ActiveCfg = Release-Dynamic|x64 {21C0CECF-69DD-4F70-BC2B-9B4DE7F15277}.Release-Dynamic|x64.Build.0 = Release-Dynamic|x64 {21C0CECF-69DD-4F70-BC2B-9B4DE7F15277}.Release-Static|Any CPU.ActiveCfg = Release-Static|Win32 {21C0CECF-69DD-4F70-BC2B-9B4DE7F15277}.Release-Static|ARM.ActiveCfg = Release-Static|Win32 + {21C0CECF-69DD-4F70-BC2B-9B4DE7F15277}.Release-Static|ARM64.ActiveCfg = Release-Static|ARM64 + {21C0CECF-69DD-4F70-BC2B-9B4DE7F15277}.Release-Static|ARM64.Build.0 = Release-Static|ARM64 {21C0CECF-69DD-4F70-BC2B-9B4DE7F15277}.Release-Static|Win32.ActiveCfg = Release-Static|Win32 {21C0CECF-69DD-4F70-BC2B-9B4DE7F15277}.Release-Static|Win32.Build.0 = Release-Static|Win32 {21C0CECF-69DD-4F70-BC2B-9B4DE7F15277}.Release-Static|x64.ActiveCfg = Release-Static|x64 @@ -1002,6 +1261,8 @@ {4281CA5E-1D48-45D4-A991-2718A454B4BA}.Debug|Any CPU.ActiveCfg = Debug|Win32 {4281CA5E-1D48-45D4-A991-2718A454B4BA}.Debug|ARM.ActiveCfg = Debug|ARM {4281CA5E-1D48-45D4-A991-2718A454B4BA}.Debug|ARM.Build.0 = Debug|ARM + {4281CA5E-1D48-45D4-A991-2718A454B4BA}.Debug|ARM64.ActiveCfg = Debug|ARM64 + {4281CA5E-1D48-45D4-A991-2718A454B4BA}.Debug|ARM64.Build.0 = Debug|ARM64 {4281CA5E-1D48-45D4-A991-2718A454B4BA}.Debug|Win32.ActiveCfg = Debug|Win32 {4281CA5E-1D48-45D4-A991-2718A454B4BA}.Debug|Win32.Build.0 = Debug|Win32 {4281CA5E-1D48-45D4-A991-2718A454B4BA}.Debug|x64.ActiveCfg = Debug|x64 @@ -1009,6 +1270,8 @@ {4281CA5E-1D48-45D4-A991-2718A454B4BA}.Debug-Dynamic|Any CPU.ActiveCfg = Debug-Dynamic|Win32 {4281CA5E-1D48-45D4-A991-2718A454B4BA}.Debug-Dynamic|ARM.ActiveCfg = Debug-Dynamic|ARM {4281CA5E-1D48-45D4-A991-2718A454B4BA}.Debug-Dynamic|ARM.Build.0 = Debug-Dynamic|ARM + {4281CA5E-1D48-45D4-A991-2718A454B4BA}.Debug-Dynamic|ARM64.ActiveCfg = Debug-Dynamic|ARM64 + {4281CA5E-1D48-45D4-A991-2718A454B4BA}.Debug-Dynamic|ARM64.Build.0 = Debug-Dynamic|ARM64 {4281CA5E-1D48-45D4-A991-2718A454B4BA}.Debug-Dynamic|Win32.ActiveCfg = Debug-Dynamic|Win32 {4281CA5E-1D48-45D4-A991-2718A454B4BA}.Debug-Dynamic|Win32.Build.0 = Debug-Dynamic|Win32 {4281CA5E-1D48-45D4-A991-2718A454B4BA}.Debug-Dynamic|x64.ActiveCfg = Debug-Dynamic|x64 @@ -1016,6 +1279,8 @@ {4281CA5E-1D48-45D4-A991-2718A454B4BA}.Debug-Static|Any CPU.ActiveCfg = Debug-Static|Win32 {4281CA5E-1D48-45D4-A991-2718A454B4BA}.Debug-Static|ARM.ActiveCfg = Debug-Static|ARM {4281CA5E-1D48-45D4-A991-2718A454B4BA}.Debug-Static|ARM.Build.0 = Debug-Static|ARM + {4281CA5E-1D48-45D4-A991-2718A454B4BA}.Debug-Static|ARM64.ActiveCfg = Debug-Static|ARM64 + {4281CA5E-1D48-45D4-A991-2718A454B4BA}.Debug-Static|ARM64.Build.0 = Debug-Static|ARM64 {4281CA5E-1D48-45D4-A991-2718A454B4BA}.Debug-Static|Win32.ActiveCfg = Debug-Static|Win32 {4281CA5E-1D48-45D4-A991-2718A454B4BA}.Debug-Static|Win32.Build.0 = Debug-Static|Win32 {4281CA5E-1D48-45D4-A991-2718A454B4BA}.Debug-Static|x64.ActiveCfg = Debug-Static|x64 @@ -1023,6 +1288,8 @@ {4281CA5E-1D48-45D4-A991-2718A454B4BA}.Release|Any CPU.ActiveCfg = Release|Win32 {4281CA5E-1D48-45D4-A991-2718A454B4BA}.Release|ARM.ActiveCfg = Release|ARM {4281CA5E-1D48-45D4-A991-2718A454B4BA}.Release|ARM.Build.0 = Release|ARM + {4281CA5E-1D48-45D4-A991-2718A454B4BA}.Release|ARM64.ActiveCfg = Release|ARM64 + {4281CA5E-1D48-45D4-A991-2718A454B4BA}.Release|ARM64.Build.0 = Release|ARM64 {4281CA5E-1D48-45D4-A991-2718A454B4BA}.Release|Win32.ActiveCfg = Release|Win32 {4281CA5E-1D48-45D4-A991-2718A454B4BA}.Release|Win32.Build.0 = Release|Win32 {4281CA5E-1D48-45D4-A991-2718A454B4BA}.Release|x64.ActiveCfg = Release|x64 @@ -1030,6 +1297,8 @@ {4281CA5E-1D48-45D4-A991-2718A454B4BA}.Release-Dynamic|Any CPU.ActiveCfg = Release-Dynamic|Win32 {4281CA5E-1D48-45D4-A991-2718A454B4BA}.Release-Dynamic|ARM.ActiveCfg = Release-Dynamic|ARM {4281CA5E-1D48-45D4-A991-2718A454B4BA}.Release-Dynamic|ARM.Build.0 = Release-Dynamic|ARM + {4281CA5E-1D48-45D4-A991-2718A454B4BA}.Release-Dynamic|ARM64.ActiveCfg = Release-Dynamic|ARM64 + {4281CA5E-1D48-45D4-A991-2718A454B4BA}.Release-Dynamic|ARM64.Build.0 = Release-Dynamic|ARM64 {4281CA5E-1D48-45D4-A991-2718A454B4BA}.Release-Dynamic|Win32.ActiveCfg = Release-Dynamic|Win32 {4281CA5E-1D48-45D4-A991-2718A454B4BA}.Release-Dynamic|Win32.Build.0 = Release-Dynamic|Win32 {4281CA5E-1D48-45D4-A991-2718A454B4BA}.Release-Dynamic|x64.ActiveCfg = Release-Dynamic|x64 @@ -1037,6 +1306,8 @@ {4281CA5E-1D48-45D4-A991-2718A454B4BA}.Release-Static|Any CPU.ActiveCfg = Release-Static|Win32 {4281CA5E-1D48-45D4-A991-2718A454B4BA}.Release-Static|ARM.ActiveCfg = Release-Static|ARM {4281CA5E-1D48-45D4-A991-2718A454B4BA}.Release-Static|ARM.Build.0 = Release-Static|ARM + {4281CA5E-1D48-45D4-A991-2718A454B4BA}.Release-Static|ARM64.ActiveCfg = Release-Static|ARM64 + {4281CA5E-1D48-45D4-A991-2718A454B4BA}.Release-Static|ARM64.Build.0 = Release-Static|ARM64 {4281CA5E-1D48-45D4-A991-2718A454B4BA}.Release-Static|Win32.ActiveCfg = Release-Static|Win32 {4281CA5E-1D48-45D4-A991-2718A454B4BA}.Release-Static|Win32.Build.0 = Release-Static|Win32 {4281CA5E-1D48-45D4-A991-2718A454B4BA}.Release-Static|x64.ActiveCfg = Release-Static|x64 @@ -1044,6 +1315,8 @@ {2A3F241E-682C-47E1-9543-DC28708B406A}.Debug|Any CPU.ActiveCfg = Debug|Win32 {2A3F241E-682C-47E1-9543-DC28708B406A}.Debug|ARM.ActiveCfg = Debug|ARM {2A3F241E-682C-47E1-9543-DC28708B406A}.Debug|ARM.Build.0 = Debug|ARM + {2A3F241E-682C-47E1-9543-DC28708B406A}.Debug|ARM64.ActiveCfg = Debug|ARM64 + {2A3F241E-682C-47E1-9543-DC28708B406A}.Debug|ARM64.Build.0 = Debug|ARM64 {2A3F241E-682C-47E1-9543-DC28708B406A}.Debug|Win32.ActiveCfg = Debug|Win32 {2A3F241E-682C-47E1-9543-DC28708B406A}.Debug|Win32.Build.0 = Debug|Win32 {2A3F241E-682C-47E1-9543-DC28708B406A}.Debug|x64.ActiveCfg = Debug|x64 @@ -1051,6 +1324,8 @@ {2A3F241E-682C-47E1-9543-DC28708B406A}.Debug-Dynamic|Any CPU.ActiveCfg = Debug-Dynamic|Win32 {2A3F241E-682C-47E1-9543-DC28708B406A}.Debug-Dynamic|ARM.ActiveCfg = Debug-Dynamic|ARM {2A3F241E-682C-47E1-9543-DC28708B406A}.Debug-Dynamic|ARM.Build.0 = Debug-Dynamic|ARM + {2A3F241E-682C-47E1-9543-DC28708B406A}.Debug-Dynamic|ARM64.ActiveCfg = Debug-Dynamic|ARM64 + {2A3F241E-682C-47E1-9543-DC28708B406A}.Debug-Dynamic|ARM64.Build.0 = Debug-Dynamic|ARM64 {2A3F241E-682C-47E1-9543-DC28708B406A}.Debug-Dynamic|Win32.ActiveCfg = Debug-Dynamic|Win32 {2A3F241E-682C-47E1-9543-DC28708B406A}.Debug-Dynamic|Win32.Build.0 = Debug-Dynamic|Win32 {2A3F241E-682C-47E1-9543-DC28708B406A}.Debug-Dynamic|x64.ActiveCfg = Debug-Dynamic|x64 @@ -1058,6 +1333,8 @@ {2A3F241E-682C-47E1-9543-DC28708B406A}.Debug-Static|Any CPU.ActiveCfg = Debug-Static|Win32 {2A3F241E-682C-47E1-9543-DC28708B406A}.Debug-Static|ARM.ActiveCfg = Debug-Static|ARM {2A3F241E-682C-47E1-9543-DC28708B406A}.Debug-Static|ARM.Build.0 = Debug-Static|ARM + {2A3F241E-682C-47E1-9543-DC28708B406A}.Debug-Static|ARM64.ActiveCfg = Debug-Static|ARM64 + {2A3F241E-682C-47E1-9543-DC28708B406A}.Debug-Static|ARM64.Build.0 = Debug-Static|ARM64 {2A3F241E-682C-47E1-9543-DC28708B406A}.Debug-Static|Win32.ActiveCfg = Debug-Static|Win32 {2A3F241E-682C-47E1-9543-DC28708B406A}.Debug-Static|Win32.Build.0 = Debug-Static|Win32 {2A3F241E-682C-47E1-9543-DC28708B406A}.Debug-Static|x64.ActiveCfg = Debug-Static|x64 @@ -1065,6 +1342,8 @@ {2A3F241E-682C-47E1-9543-DC28708B406A}.Release|Any CPU.ActiveCfg = Release|Win32 {2A3F241E-682C-47E1-9543-DC28708B406A}.Release|ARM.ActiveCfg = Release|ARM {2A3F241E-682C-47E1-9543-DC28708B406A}.Release|ARM.Build.0 = Release|ARM + {2A3F241E-682C-47E1-9543-DC28708B406A}.Release|ARM64.ActiveCfg = Release|ARM64 + {2A3F241E-682C-47E1-9543-DC28708B406A}.Release|ARM64.Build.0 = Release|ARM64 {2A3F241E-682C-47E1-9543-DC28708B406A}.Release|Win32.ActiveCfg = Release|Win32 {2A3F241E-682C-47E1-9543-DC28708B406A}.Release|Win32.Build.0 = Release|Win32 {2A3F241E-682C-47E1-9543-DC28708B406A}.Release|x64.ActiveCfg = Release|x64 @@ -1072,6 +1351,8 @@ {2A3F241E-682C-47E1-9543-DC28708B406A}.Release-Dynamic|Any CPU.ActiveCfg = Release-Dynamic|Win32 {2A3F241E-682C-47E1-9543-DC28708B406A}.Release-Dynamic|ARM.ActiveCfg = Release-Dynamic|ARM {2A3F241E-682C-47E1-9543-DC28708B406A}.Release-Dynamic|ARM.Build.0 = Release-Dynamic|ARM + {2A3F241E-682C-47E1-9543-DC28708B406A}.Release-Dynamic|ARM64.ActiveCfg = Release-Dynamic|ARM64 + {2A3F241E-682C-47E1-9543-DC28708B406A}.Release-Dynamic|ARM64.Build.0 = Release-Dynamic|ARM64 {2A3F241E-682C-47E1-9543-DC28708B406A}.Release-Dynamic|Win32.ActiveCfg = Release-Dynamic|Win32 {2A3F241E-682C-47E1-9543-DC28708B406A}.Release-Dynamic|Win32.Build.0 = Release-Dynamic|Win32 {2A3F241E-682C-47E1-9543-DC28708B406A}.Release-Dynamic|x64.ActiveCfg = Release-Dynamic|x64 @@ -1079,78 +1360,104 @@ {2A3F241E-682C-47E1-9543-DC28708B406A}.Release-Static|Any CPU.ActiveCfg = Release-Static|Win32 {2A3F241E-682C-47E1-9543-DC28708B406A}.Release-Static|ARM.ActiveCfg = Release-Static|ARM {2A3F241E-682C-47E1-9543-DC28708B406A}.Release-Static|ARM.Build.0 = Release-Static|ARM + {2A3F241E-682C-47E1-9543-DC28708B406A}.Release-Static|ARM64.ActiveCfg = Release-Static|ARM64 + {2A3F241E-682C-47E1-9543-DC28708B406A}.Release-Static|ARM64.Build.0 = Release-Static|ARM64 {2A3F241E-682C-47E1-9543-DC28708B406A}.Release-Static|Win32.ActiveCfg = Release-Static|Win32 {2A3F241E-682C-47E1-9543-DC28708B406A}.Release-Static|Win32.Build.0 = Release-Static|Win32 {2A3F241E-682C-47E1-9543-DC28708B406A}.Release-Static|x64.ActiveCfg = Release-Static|x64 {2A3F241E-682C-47E1-9543-DC28708B406A}.Release-Static|x64.Build.0 = Release-Static|x64 {E378A1FC-0C9C-4462-860F-7E60BC1BF84E}.Debug|Any CPU.ActiveCfg = Debug|Win32 {E378A1FC-0C9C-4462-860F-7E60BC1BF84E}.Debug|ARM.ActiveCfg = Debug|Win32 + {E378A1FC-0C9C-4462-860F-7E60BC1BF84E}.Debug|ARM64.ActiveCfg = Debug|ARM64 + {E378A1FC-0C9C-4462-860F-7E60BC1BF84E}.Debug|ARM64.Build.0 = Debug|ARM64 {E378A1FC-0C9C-4462-860F-7E60BC1BF84E}.Debug|Win32.ActiveCfg = Debug|Win32 {E378A1FC-0C9C-4462-860F-7E60BC1BF84E}.Debug|Win32.Build.0 = Debug|Win32 {E378A1FC-0C9C-4462-860F-7E60BC1BF84E}.Debug|x64.ActiveCfg = Debug|x64 {E378A1FC-0C9C-4462-860F-7E60BC1BF84E}.Debug|x64.Build.0 = Debug|x64 {E378A1FC-0C9C-4462-860F-7E60BC1BF84E}.Debug-Dynamic|Any CPU.ActiveCfg = Debug-Dynamic|Win32 {E378A1FC-0C9C-4462-860F-7E60BC1BF84E}.Debug-Dynamic|ARM.ActiveCfg = Debug-Dynamic|Win32 + {E378A1FC-0C9C-4462-860F-7E60BC1BF84E}.Debug-Dynamic|ARM64.ActiveCfg = Debug-Dynamic|ARM64 + {E378A1FC-0C9C-4462-860F-7E60BC1BF84E}.Debug-Dynamic|ARM64.Build.0 = Debug-Dynamic|ARM64 {E378A1FC-0C9C-4462-860F-7E60BC1BF84E}.Debug-Dynamic|Win32.ActiveCfg = Debug-Dynamic|Win32 {E378A1FC-0C9C-4462-860F-7E60BC1BF84E}.Debug-Dynamic|Win32.Build.0 = Debug-Dynamic|Win32 {E378A1FC-0C9C-4462-860F-7E60BC1BF84E}.Debug-Dynamic|x64.ActiveCfg = Debug-Dynamic|x64 {E378A1FC-0C9C-4462-860F-7E60BC1BF84E}.Debug-Dynamic|x64.Build.0 = Debug-Dynamic|x64 {E378A1FC-0C9C-4462-860F-7E60BC1BF84E}.Debug-Static|Any CPU.ActiveCfg = Debug-Static|Win32 {E378A1FC-0C9C-4462-860F-7E60BC1BF84E}.Debug-Static|ARM.ActiveCfg = Debug-Static|Win32 + {E378A1FC-0C9C-4462-860F-7E60BC1BF84E}.Debug-Static|ARM64.ActiveCfg = Debug-Static|ARM64 + {E378A1FC-0C9C-4462-860F-7E60BC1BF84E}.Debug-Static|ARM64.Build.0 = Debug-Static|ARM64 {E378A1FC-0C9C-4462-860F-7E60BC1BF84E}.Debug-Static|Win32.ActiveCfg = Debug-Static|Win32 {E378A1FC-0C9C-4462-860F-7E60BC1BF84E}.Debug-Static|Win32.Build.0 = Debug-Static|Win32 {E378A1FC-0C9C-4462-860F-7E60BC1BF84E}.Debug-Static|x64.ActiveCfg = Debug-Static|x64 {E378A1FC-0C9C-4462-860F-7E60BC1BF84E}.Debug-Static|x64.Build.0 = Debug-Static|x64 {E378A1FC-0C9C-4462-860F-7E60BC1BF84E}.Release|Any CPU.ActiveCfg = Release|Win32 {E378A1FC-0C9C-4462-860F-7E60BC1BF84E}.Release|ARM.ActiveCfg = Release|Win32 + {E378A1FC-0C9C-4462-860F-7E60BC1BF84E}.Release|ARM64.ActiveCfg = Release|ARM64 + {E378A1FC-0C9C-4462-860F-7E60BC1BF84E}.Release|ARM64.Build.0 = Release|ARM64 {E378A1FC-0C9C-4462-860F-7E60BC1BF84E}.Release|Win32.ActiveCfg = Release|Win32 {E378A1FC-0C9C-4462-860F-7E60BC1BF84E}.Release|Win32.Build.0 = Release|Win32 {E378A1FC-0C9C-4462-860F-7E60BC1BF84E}.Release|x64.ActiveCfg = Release|x64 {E378A1FC-0C9C-4462-860F-7E60BC1BF84E}.Release|x64.Build.0 = Release|x64 {E378A1FC-0C9C-4462-860F-7E60BC1BF84E}.Release-Dynamic|Any CPU.ActiveCfg = Release-Dynamic|Win32 {E378A1FC-0C9C-4462-860F-7E60BC1BF84E}.Release-Dynamic|ARM.ActiveCfg = Release-Dynamic|Win32 + {E378A1FC-0C9C-4462-860F-7E60BC1BF84E}.Release-Dynamic|ARM64.ActiveCfg = Release-Dynamic|ARM64 + {E378A1FC-0C9C-4462-860F-7E60BC1BF84E}.Release-Dynamic|ARM64.Build.0 = Release-Dynamic|ARM64 {E378A1FC-0C9C-4462-860F-7E60BC1BF84E}.Release-Dynamic|Win32.ActiveCfg = Release-Dynamic|Win32 {E378A1FC-0C9C-4462-860F-7E60BC1BF84E}.Release-Dynamic|Win32.Build.0 = Release-Dynamic|Win32 {E378A1FC-0C9C-4462-860F-7E60BC1BF84E}.Release-Dynamic|x64.ActiveCfg = Release-Dynamic|x64 {E378A1FC-0C9C-4462-860F-7E60BC1BF84E}.Release-Dynamic|x64.Build.0 = Release-Dynamic|x64 {E378A1FC-0C9C-4462-860F-7E60BC1BF84E}.Release-Static|Any CPU.ActiveCfg = Release-Static|Win32 {E378A1FC-0C9C-4462-860F-7E60BC1BF84E}.Release-Static|ARM.ActiveCfg = Release-Static|Win32 + {E378A1FC-0C9C-4462-860F-7E60BC1BF84E}.Release-Static|ARM64.ActiveCfg = Release-Static|ARM64 + {E378A1FC-0C9C-4462-860F-7E60BC1BF84E}.Release-Static|ARM64.Build.0 = Release-Static|ARM64 {E378A1FC-0C9C-4462-860F-7E60BC1BF84E}.Release-Static|Win32.ActiveCfg = Release-Static|Win32 {E378A1FC-0C9C-4462-860F-7E60BC1BF84E}.Release-Static|Win32.Build.0 = Release-Static|Win32 {E378A1FC-0C9C-4462-860F-7E60BC1BF84E}.Release-Static|x64.ActiveCfg = Release-Static|x64 {E378A1FC-0C9C-4462-860F-7E60BC1BF84E}.Release-Static|x64.Build.0 = Release-Static|x64 {B3F7D4E9-702F-4EB4-ADA8-098D0A83D770}.Debug|Any CPU.ActiveCfg = Debug|Win32 {B3F7D4E9-702F-4EB4-ADA8-098D0A83D770}.Debug|ARM.ActiveCfg = Debug|Win32 + {B3F7D4E9-702F-4EB4-ADA8-098D0A83D770}.Debug|ARM64.ActiveCfg = Debug|ARM64 + {B3F7D4E9-702F-4EB4-ADA8-098D0A83D770}.Debug|ARM64.Build.0 = Debug|ARM64 {B3F7D4E9-702F-4EB4-ADA8-098D0A83D770}.Debug|Win32.ActiveCfg = Debug|Win32 {B3F7D4E9-702F-4EB4-ADA8-098D0A83D770}.Debug|Win32.Build.0 = Debug|Win32 {B3F7D4E9-702F-4EB4-ADA8-098D0A83D770}.Debug|x64.ActiveCfg = Debug|x64 {B3F7D4E9-702F-4EB4-ADA8-098D0A83D770}.Debug|x64.Build.0 = Debug|x64 {B3F7D4E9-702F-4EB4-ADA8-098D0A83D770}.Debug-Dynamic|Any CPU.ActiveCfg = Debug-Dynamic|Win32 {B3F7D4E9-702F-4EB4-ADA8-098D0A83D770}.Debug-Dynamic|ARM.ActiveCfg = Debug-Dynamic|Win32 + {B3F7D4E9-702F-4EB4-ADA8-098D0A83D770}.Debug-Dynamic|ARM64.ActiveCfg = Debug-Dynamic|ARM64 + {B3F7D4E9-702F-4EB4-ADA8-098D0A83D770}.Debug-Dynamic|ARM64.Build.0 = Debug-Dynamic|ARM64 {B3F7D4E9-702F-4EB4-ADA8-098D0A83D770}.Debug-Dynamic|Win32.ActiveCfg = Debug-Dynamic|Win32 {B3F7D4E9-702F-4EB4-ADA8-098D0A83D770}.Debug-Dynamic|Win32.Build.0 = Debug-Dynamic|Win32 {B3F7D4E9-702F-4EB4-ADA8-098D0A83D770}.Debug-Dynamic|x64.ActiveCfg = Debug-Dynamic|x64 {B3F7D4E9-702F-4EB4-ADA8-098D0A83D770}.Debug-Dynamic|x64.Build.0 = Debug-Dynamic|x64 {B3F7D4E9-702F-4EB4-ADA8-098D0A83D770}.Debug-Static|Any CPU.ActiveCfg = Debug-Static|Win32 {B3F7D4E9-702F-4EB4-ADA8-098D0A83D770}.Debug-Static|ARM.ActiveCfg = Debug-Static|Win32 + {B3F7D4E9-702F-4EB4-ADA8-098D0A83D770}.Debug-Static|ARM64.ActiveCfg = Debug-Static|ARM64 + {B3F7D4E9-702F-4EB4-ADA8-098D0A83D770}.Debug-Static|ARM64.Build.0 = Debug-Static|ARM64 {B3F7D4E9-702F-4EB4-ADA8-098D0A83D770}.Debug-Static|Win32.ActiveCfg = Debug-Static|Win32 {B3F7D4E9-702F-4EB4-ADA8-098D0A83D770}.Debug-Static|Win32.Build.0 = Debug-Static|Win32 {B3F7D4E9-702F-4EB4-ADA8-098D0A83D770}.Debug-Static|x64.ActiveCfg = Debug-Static|x64 {B3F7D4E9-702F-4EB4-ADA8-098D0A83D770}.Debug-Static|x64.Build.0 = Debug-Static|x64 {B3F7D4E9-702F-4EB4-ADA8-098D0A83D770}.Release|Any CPU.ActiveCfg = Release|Win32 {B3F7D4E9-702F-4EB4-ADA8-098D0A83D770}.Release|ARM.ActiveCfg = Release|Win32 + {B3F7D4E9-702F-4EB4-ADA8-098D0A83D770}.Release|ARM64.ActiveCfg = Release|ARM64 + {B3F7D4E9-702F-4EB4-ADA8-098D0A83D770}.Release|ARM64.Build.0 = Release|ARM64 {B3F7D4E9-702F-4EB4-ADA8-098D0A83D770}.Release|Win32.ActiveCfg = Release|Win32 {B3F7D4E9-702F-4EB4-ADA8-098D0A83D770}.Release|Win32.Build.0 = Release|Win32 {B3F7D4E9-702F-4EB4-ADA8-098D0A83D770}.Release|x64.ActiveCfg = Release|x64 {B3F7D4E9-702F-4EB4-ADA8-098D0A83D770}.Release|x64.Build.0 = Release|x64 {B3F7D4E9-702F-4EB4-ADA8-098D0A83D770}.Release-Dynamic|Any CPU.ActiveCfg = Release-Dynamic|Win32 {B3F7D4E9-702F-4EB4-ADA8-098D0A83D770}.Release-Dynamic|ARM.ActiveCfg = Release-Dynamic|Win32 + {B3F7D4E9-702F-4EB4-ADA8-098D0A83D770}.Release-Dynamic|ARM64.ActiveCfg = Release-Dynamic|ARM64 + {B3F7D4E9-702F-4EB4-ADA8-098D0A83D770}.Release-Dynamic|ARM64.Build.0 = Release-Dynamic|ARM64 {B3F7D4E9-702F-4EB4-ADA8-098D0A83D770}.Release-Dynamic|Win32.ActiveCfg = Release-Dynamic|Win32 {B3F7D4E9-702F-4EB4-ADA8-098D0A83D770}.Release-Dynamic|Win32.Build.0 = Release-Dynamic|Win32 {B3F7D4E9-702F-4EB4-ADA8-098D0A83D770}.Release-Dynamic|x64.ActiveCfg = Release-Dynamic|x64 {B3F7D4E9-702F-4EB4-ADA8-098D0A83D770}.Release-Dynamic|x64.Build.0 = Release-Dynamic|x64 {B3F7D4E9-702F-4EB4-ADA8-098D0A83D770}.Release-Static|Any CPU.ActiveCfg = Release-Static|Win32 {B3F7D4E9-702F-4EB4-ADA8-098D0A83D770}.Release-Static|ARM.ActiveCfg = Release-Static|Win32 + {B3F7D4E9-702F-4EB4-ADA8-098D0A83D770}.Release-Static|ARM64.ActiveCfg = Release-Static|ARM64 + {B3F7D4E9-702F-4EB4-ADA8-098D0A83D770}.Release-Static|ARM64.Build.0 = Release-Static|ARM64 {B3F7D4E9-702F-4EB4-ADA8-098D0A83D770}.Release-Static|Win32.ActiveCfg = Release-Static|Win32 {B3F7D4E9-702F-4EB4-ADA8-098D0A83D770}.Release-Static|Win32.Build.0 = Release-Static|Win32 {B3F7D4E9-702F-4EB4-ADA8-098D0A83D770}.Release-Static|x64.ActiveCfg = Release-Static|x64 @@ -1158,6 +1465,8 @@ {23D7679C-764C-4E02-8B29-BB882CEEEFE2}.Debug|Any CPU.ActiveCfg = Debug|Win32 {23D7679C-764C-4E02-8B29-BB882CEEEFE2}.Debug|ARM.ActiveCfg = Debug|ARM {23D7679C-764C-4E02-8B29-BB882CEEEFE2}.Debug|ARM.Build.0 = Debug|ARM + {23D7679C-764C-4E02-8B29-BB882CEEEFE2}.Debug|ARM64.ActiveCfg = Debug|ARM64 + {23D7679C-764C-4E02-8B29-BB882CEEEFE2}.Debug|ARM64.Build.0 = Debug|ARM64 {23D7679C-764C-4E02-8B29-BB882CEEEFE2}.Debug|Win32.ActiveCfg = Debug|Win32 {23D7679C-764C-4E02-8B29-BB882CEEEFE2}.Debug|Win32.Build.0 = Debug|Win32 {23D7679C-764C-4E02-8B29-BB882CEEEFE2}.Debug|x64.ActiveCfg = Debug|x64 @@ -1165,6 +1474,8 @@ {23D7679C-764C-4E02-8B29-BB882CEEEFE2}.Debug-Dynamic|Any CPU.ActiveCfg = Debug-Dynamic|Win32 {23D7679C-764C-4E02-8B29-BB882CEEEFE2}.Debug-Dynamic|ARM.ActiveCfg = Debug-Dynamic|ARM {23D7679C-764C-4E02-8B29-BB882CEEEFE2}.Debug-Dynamic|ARM.Build.0 = Debug-Dynamic|ARM + {23D7679C-764C-4E02-8B29-BB882CEEEFE2}.Debug-Dynamic|ARM64.ActiveCfg = Debug-Dynamic|ARM64 + {23D7679C-764C-4E02-8B29-BB882CEEEFE2}.Debug-Dynamic|ARM64.Build.0 = Debug-Dynamic|ARM64 {23D7679C-764C-4E02-8B29-BB882CEEEFE2}.Debug-Dynamic|Win32.ActiveCfg = Debug-Dynamic|Win32 {23D7679C-764C-4E02-8B29-BB882CEEEFE2}.Debug-Dynamic|Win32.Build.0 = Debug-Dynamic|Win32 {23D7679C-764C-4E02-8B29-BB882CEEEFE2}.Debug-Dynamic|x64.ActiveCfg = Debug-Dynamic|x64 @@ -1172,6 +1483,8 @@ {23D7679C-764C-4E02-8B29-BB882CEEEFE2}.Debug-Static|Any CPU.ActiveCfg = Debug-Static|Win32 {23D7679C-764C-4E02-8B29-BB882CEEEFE2}.Debug-Static|ARM.ActiveCfg = Debug-Static|ARM {23D7679C-764C-4E02-8B29-BB882CEEEFE2}.Debug-Static|ARM.Build.0 = Debug-Static|ARM + {23D7679C-764C-4E02-8B29-BB882CEEEFE2}.Debug-Static|ARM64.ActiveCfg = Debug-Static|ARM64 + {23D7679C-764C-4E02-8B29-BB882CEEEFE2}.Debug-Static|ARM64.Build.0 = Debug-Static|ARM64 {23D7679C-764C-4E02-8B29-BB882CEEEFE2}.Debug-Static|Win32.ActiveCfg = Debug-Static|Win32 {23D7679C-764C-4E02-8B29-BB882CEEEFE2}.Debug-Static|Win32.Build.0 = Debug-Static|Win32 {23D7679C-764C-4E02-8B29-BB882CEEEFE2}.Debug-Static|x64.ActiveCfg = Debug-Static|x64 @@ -1179,6 +1492,8 @@ {23D7679C-764C-4E02-8B29-BB882CEEEFE2}.Release|Any CPU.ActiveCfg = Release|Win32 {23D7679C-764C-4E02-8B29-BB882CEEEFE2}.Release|ARM.ActiveCfg = Release|ARM {23D7679C-764C-4E02-8B29-BB882CEEEFE2}.Release|ARM.Build.0 = Release|ARM + {23D7679C-764C-4E02-8B29-BB882CEEEFE2}.Release|ARM64.ActiveCfg = Release|ARM64 + {23D7679C-764C-4E02-8B29-BB882CEEEFE2}.Release|ARM64.Build.0 = Release|ARM64 {23D7679C-764C-4E02-8B29-BB882CEEEFE2}.Release|Win32.ActiveCfg = Release|Win32 {23D7679C-764C-4E02-8B29-BB882CEEEFE2}.Release|Win32.Build.0 = Release|Win32 {23D7679C-764C-4E02-8B29-BB882CEEEFE2}.Release|x64.ActiveCfg = Release|x64 @@ -1186,6 +1501,8 @@ {23D7679C-764C-4E02-8B29-BB882CEEEFE2}.Release-Dynamic|Any CPU.ActiveCfg = Release-Dynamic|Win32 {23D7679C-764C-4E02-8B29-BB882CEEEFE2}.Release-Dynamic|ARM.ActiveCfg = Release-Dynamic|ARM {23D7679C-764C-4E02-8B29-BB882CEEEFE2}.Release-Dynamic|ARM.Build.0 = Release-Dynamic|ARM + {23D7679C-764C-4E02-8B29-BB882CEEEFE2}.Release-Dynamic|ARM64.ActiveCfg = Release-Dynamic|ARM64 + {23D7679C-764C-4E02-8B29-BB882CEEEFE2}.Release-Dynamic|ARM64.Build.0 = Release-Dynamic|ARM64 {23D7679C-764C-4E02-8B29-BB882CEEEFE2}.Release-Dynamic|Win32.ActiveCfg = Release-Dynamic|Win32 {23D7679C-764C-4E02-8B29-BB882CEEEFE2}.Release-Dynamic|Win32.Build.0 = Release-Dynamic|Win32 {23D7679C-764C-4E02-8B29-BB882CEEEFE2}.Release-Dynamic|x64.ActiveCfg = Release-Dynamic|x64 @@ -1193,40 +1510,54 @@ {23D7679C-764C-4E02-8B29-BB882CEEEFE2}.Release-Static|Any CPU.ActiveCfg = Release-Static|Win32 {23D7679C-764C-4E02-8B29-BB882CEEEFE2}.Release-Static|ARM.ActiveCfg = Release-Static|ARM {23D7679C-764C-4E02-8B29-BB882CEEEFE2}.Release-Static|ARM.Build.0 = Release-Static|ARM + {23D7679C-764C-4E02-8B29-BB882CEEEFE2}.Release-Static|ARM64.ActiveCfg = Release-Static|ARM64 + {23D7679C-764C-4E02-8B29-BB882CEEEFE2}.Release-Static|ARM64.Build.0 = Release-Static|ARM64 {23D7679C-764C-4E02-8B29-BB882CEEEFE2}.Release-Static|Win32.ActiveCfg = Release-Static|Win32 {23D7679C-764C-4E02-8B29-BB882CEEEFE2}.Release-Static|Win32.Build.0 = Release-Static|Win32 {23D7679C-764C-4E02-8B29-BB882CEEEFE2}.Release-Static|x64.ActiveCfg = Release-Static|x64 {23D7679C-764C-4E02-8B29-BB882CEEEFE2}.Release-Static|x64.Build.0 = Release-Static|x64 {0C91838B-3372-40B4-A764-DE075A4BC94B}.Debug|Any CPU.ActiveCfg = Debug|Win32 {0C91838B-3372-40B4-A764-DE075A4BC94B}.Debug|ARM.ActiveCfg = Debug|Win32 + {0C91838B-3372-40B4-A764-DE075A4BC94B}.Debug|ARM64.ActiveCfg = Debug|ARM64 {0C91838B-3372-40B4-A764-DE075A4BC94B}.Debug|Win32.ActiveCfg = Debug|Win32 {0C91838B-3372-40B4-A764-DE075A4BC94B}.Debug|x64.ActiveCfg = Debug|Win32 {0C91838B-3372-40B4-A764-DE075A4BC94B}.Debug-Dynamic|Any CPU.ActiveCfg = Release|Win32 {0C91838B-3372-40B4-A764-DE075A4BC94B}.Debug-Dynamic|Any CPU.Build.0 = Release|Win32 {0C91838B-3372-40B4-A764-DE075A4BC94B}.Debug-Dynamic|ARM.ActiveCfg = Debug|Win32 + {0C91838B-3372-40B4-A764-DE075A4BC94B}.Debug-Dynamic|ARM64.ActiveCfg = Debug|ARM64 + {0C91838B-3372-40B4-A764-DE075A4BC94B}.Debug-Dynamic|ARM64.Build.0 = Debug|ARM64 {0C91838B-3372-40B4-A764-DE075A4BC94B}.Debug-Dynamic|Win32.ActiveCfg = Debug|Win32 {0C91838B-3372-40B4-A764-DE075A4BC94B}.Debug-Dynamic|x64.ActiveCfg = Release|Win32 {0C91838B-3372-40B4-A764-DE075A4BC94B}.Debug-Static|Any CPU.ActiveCfg = Release|Win32 {0C91838B-3372-40B4-A764-DE075A4BC94B}.Debug-Static|Any CPU.Build.0 = Release|Win32 {0C91838B-3372-40B4-A764-DE075A4BC94B}.Debug-Static|ARM.ActiveCfg = Debug|Win32 + {0C91838B-3372-40B4-A764-DE075A4BC94B}.Debug-Static|ARM64.ActiveCfg = Debug|ARM64 + {0C91838B-3372-40B4-A764-DE075A4BC94B}.Debug-Static|ARM64.Build.0 = Debug|ARM64 {0C91838B-3372-40B4-A764-DE075A4BC94B}.Debug-Static|Win32.ActiveCfg = Debug|Win32 {0C91838B-3372-40B4-A764-DE075A4BC94B}.Debug-Static|x64.ActiveCfg = Debug|Win32 {0C91838B-3372-40B4-A764-DE075A4BC94B}.Release|Any CPU.ActiveCfg = Release|Win32 {0C91838B-3372-40B4-A764-DE075A4BC94B}.Release|ARM.ActiveCfg = Release|Win32 + {0C91838B-3372-40B4-A764-DE075A4BC94B}.Release|ARM64.ActiveCfg = Release|ARM64 {0C91838B-3372-40B4-A764-DE075A4BC94B}.Release|Win32.ActiveCfg = Release|Win32 {0C91838B-3372-40B4-A764-DE075A4BC94B}.Release|x64.ActiveCfg = Release|Win32 {0C91838B-3372-40B4-A764-DE075A4BC94B}.Release-Dynamic|Any CPU.ActiveCfg = Release|Win32 {0C91838B-3372-40B4-A764-DE075A4BC94B}.Release-Dynamic|Any CPU.Build.0 = Release|Win32 {0C91838B-3372-40B4-A764-DE075A4BC94B}.Release-Dynamic|ARM.ActiveCfg = Release|Win32 + {0C91838B-3372-40B4-A764-DE075A4BC94B}.Release-Dynamic|ARM64.ActiveCfg = Release|ARM64 + {0C91838B-3372-40B4-A764-DE075A4BC94B}.Release-Dynamic|ARM64.Build.0 = Release|ARM64 {0C91838B-3372-40B4-A764-DE075A4BC94B}.Release-Dynamic|Win32.ActiveCfg = Release|Win32 {0C91838B-3372-40B4-A764-DE075A4BC94B}.Release-Dynamic|x64.ActiveCfg = Release|Win32 {0C91838B-3372-40B4-A764-DE075A4BC94B}.Release-Static|Any CPU.ActiveCfg = Release|Win32 {0C91838B-3372-40B4-A764-DE075A4BC94B}.Release-Static|Any CPU.Build.0 = Release|Win32 {0C91838B-3372-40B4-A764-DE075A4BC94B}.Release-Static|ARM.ActiveCfg = Release|Win32 + {0C91838B-3372-40B4-A764-DE075A4BC94B}.Release-Static|ARM64.ActiveCfg = Release|ARM64 + {0C91838B-3372-40B4-A764-DE075A4BC94B}.Release-Static|ARM64.Build.0 = Release|ARM64 {0C91838B-3372-40B4-A764-DE075A4BC94B}.Release-Static|Win32.ActiveCfg = Release|Win32 {0C91838B-3372-40B4-A764-DE075A4BC94B}.Release-Static|x64.ActiveCfg = Release|Win32 {5E507EA2-CB39-47CA-BD39-49EB58D7A0BB}.Debug|Any CPU.ActiveCfg = Debug|Win32 {5E507EA2-CB39-47CA-BD39-49EB58D7A0BB}.Debug|ARM.ActiveCfg = Debug|Win32 + {5E507EA2-CB39-47CA-BD39-49EB58D7A0BB}.Debug|ARM64.ActiveCfg = Debug|ARM64 + {5E507EA2-CB39-47CA-BD39-49EB58D7A0BB}.Debug|ARM64.Build.0 = Debug|ARM64 {5E507EA2-CB39-47CA-BD39-49EB58D7A0BB}.Debug|Win32.ActiveCfg = Debug|Win32 {5E507EA2-CB39-47CA-BD39-49EB58D7A0BB}.Debug|Win32.Build.0 = Debug|Win32 {5E507EA2-CB39-47CA-BD39-49EB58D7A0BB}.Debug|x64.ActiveCfg = Debug|x64 @@ -1234,6 +1565,8 @@ {5E507EA2-CB39-47CA-BD39-49EB58D7A0BB}.Debug-Dynamic|Any CPU.ActiveCfg = Release|x64 {5E507EA2-CB39-47CA-BD39-49EB58D7A0BB}.Debug-Dynamic|Any CPU.Build.0 = Release|x64 {5E507EA2-CB39-47CA-BD39-49EB58D7A0BB}.Debug-Dynamic|ARM.ActiveCfg = Debug|Win32 + {5E507EA2-CB39-47CA-BD39-49EB58D7A0BB}.Debug-Dynamic|ARM64.ActiveCfg = Debug|ARM64 + {5E507EA2-CB39-47CA-BD39-49EB58D7A0BB}.Debug-Dynamic|ARM64.Build.0 = Debug|ARM64 {5E507EA2-CB39-47CA-BD39-49EB58D7A0BB}.Debug-Dynamic|Win32.ActiveCfg = Debug|Win32 {5E507EA2-CB39-47CA-BD39-49EB58D7A0BB}.Debug-Dynamic|Win32.Build.0 = Debug|Win32 {5E507EA2-CB39-47CA-BD39-49EB58D7A0BB}.Debug-Dynamic|x64.ActiveCfg = Debug|x64 @@ -1241,12 +1574,16 @@ {5E507EA2-CB39-47CA-BD39-49EB58D7A0BB}.Debug-Static|Any CPU.ActiveCfg = Release|x64 {5E507EA2-CB39-47CA-BD39-49EB58D7A0BB}.Debug-Static|Any CPU.Build.0 = Release|x64 {5E507EA2-CB39-47CA-BD39-49EB58D7A0BB}.Debug-Static|ARM.ActiveCfg = Debug|Win32 + {5E507EA2-CB39-47CA-BD39-49EB58D7A0BB}.Debug-Static|ARM64.ActiveCfg = Debug|ARM64 + {5E507EA2-CB39-47CA-BD39-49EB58D7A0BB}.Debug-Static|ARM64.Build.0 = Debug|ARM64 {5E507EA2-CB39-47CA-BD39-49EB58D7A0BB}.Debug-Static|Win32.ActiveCfg = Debug|Win32 {5E507EA2-CB39-47CA-BD39-49EB58D7A0BB}.Debug-Static|Win32.Build.0 = Debug|Win32 {5E507EA2-CB39-47CA-BD39-49EB58D7A0BB}.Debug-Static|x64.ActiveCfg = Debug|x64 {5E507EA2-CB39-47CA-BD39-49EB58D7A0BB}.Debug-Static|x64.Build.0 = Debug|x64 {5E507EA2-CB39-47CA-BD39-49EB58D7A0BB}.Release|Any CPU.ActiveCfg = Release|Win32 {5E507EA2-CB39-47CA-BD39-49EB58D7A0BB}.Release|ARM.ActiveCfg = Release|Win32 + {5E507EA2-CB39-47CA-BD39-49EB58D7A0BB}.Release|ARM64.ActiveCfg = Release|ARM64 + {5E507EA2-CB39-47CA-BD39-49EB58D7A0BB}.Release|ARM64.Build.0 = Release|ARM64 {5E507EA2-CB39-47CA-BD39-49EB58D7A0BB}.Release|Win32.ActiveCfg = Release|Win32 {5E507EA2-CB39-47CA-BD39-49EB58D7A0BB}.Release|Win32.Build.0 = Release|Win32 {5E507EA2-CB39-47CA-BD39-49EB58D7A0BB}.Release|x64.ActiveCfg = Release|x64 @@ -1254,6 +1591,8 @@ {5E507EA2-CB39-47CA-BD39-49EB58D7A0BB}.Release-Dynamic|Any CPU.ActiveCfg = Release|x64 {5E507EA2-CB39-47CA-BD39-49EB58D7A0BB}.Release-Dynamic|Any CPU.Build.0 = Release|x64 {5E507EA2-CB39-47CA-BD39-49EB58D7A0BB}.Release-Dynamic|ARM.ActiveCfg = Release|Win32 + {5E507EA2-CB39-47CA-BD39-49EB58D7A0BB}.Release-Dynamic|ARM64.ActiveCfg = Release|ARM64 + {5E507EA2-CB39-47CA-BD39-49EB58D7A0BB}.Release-Dynamic|ARM64.Build.0 = Release|ARM64 {5E507EA2-CB39-47CA-BD39-49EB58D7A0BB}.Release-Dynamic|Win32.ActiveCfg = Release|Win32 {5E507EA2-CB39-47CA-BD39-49EB58D7A0BB}.Release-Dynamic|Win32.Build.0 = Release|Win32 {5E507EA2-CB39-47CA-BD39-49EB58D7A0BB}.Release-Dynamic|x64.ActiveCfg = Release|x64 @@ -1261,6 +1600,8 @@ {5E507EA2-CB39-47CA-BD39-49EB58D7A0BB}.Release-Static|Any CPU.ActiveCfg = Release|x64 {5E507EA2-CB39-47CA-BD39-49EB58D7A0BB}.Release-Static|Any CPU.Build.0 = Release|x64 {5E507EA2-CB39-47CA-BD39-49EB58D7A0BB}.Release-Static|ARM.ActiveCfg = Release|Win32 + {5E507EA2-CB39-47CA-BD39-49EB58D7A0BB}.Release-Static|ARM64.ActiveCfg = Release|ARM64 + {5E507EA2-CB39-47CA-BD39-49EB58D7A0BB}.Release-Static|ARM64.Build.0 = Release|ARM64 {5E507EA2-CB39-47CA-BD39-49EB58D7A0BB}.Release-Static|Win32.ActiveCfg = Release|Win32 {5E507EA2-CB39-47CA-BD39-49EB58D7A0BB}.Release-Static|Win32.Build.0 = Release|Win32 {5E507EA2-CB39-47CA-BD39-49EB58D7A0BB}.Release-Static|x64.ActiveCfg = Release|x64 @@ -1268,6 +1609,8 @@ {A1989FF3-9894-40F4-B5A6-6EA364476E45}.Debug|Any CPU.ActiveCfg = Debug|Win32 {A1989FF3-9894-40F4-B5A6-6EA364476E45}.Debug|ARM.ActiveCfg = Debug|ARM {A1989FF3-9894-40F4-B5A6-6EA364476E45}.Debug|ARM.Build.0 = Debug|ARM + {A1989FF3-9894-40F4-B5A6-6EA364476E45}.Debug|ARM64.ActiveCfg = Debug|ARM64 + {A1989FF3-9894-40F4-B5A6-6EA364476E45}.Debug|ARM64.Build.0 = Debug|ARM64 {A1989FF3-9894-40F4-B5A6-6EA364476E45}.Debug|Win32.ActiveCfg = Debug|Win32 {A1989FF3-9894-40F4-B5A6-6EA364476E45}.Debug|Win32.Build.0 = Debug|Win32 {A1989FF3-9894-40F4-B5A6-6EA364476E45}.Debug|x64.ActiveCfg = Debug|x64 @@ -1275,6 +1618,8 @@ {A1989FF3-9894-40F4-B5A6-6EA364476E45}.Debug-Dynamic|Any CPU.ActiveCfg = Debug-Dynamic|Win32 {A1989FF3-9894-40F4-B5A6-6EA364476E45}.Debug-Dynamic|ARM.ActiveCfg = Debug-Dynamic|ARM {A1989FF3-9894-40F4-B5A6-6EA364476E45}.Debug-Dynamic|ARM.Build.0 = Debug-Dynamic|ARM + {A1989FF3-9894-40F4-B5A6-6EA364476E45}.Debug-Dynamic|ARM64.ActiveCfg = Debug-Dynamic|ARM64 + {A1989FF3-9894-40F4-B5A6-6EA364476E45}.Debug-Dynamic|ARM64.Build.0 = Debug-Dynamic|ARM64 {A1989FF3-9894-40F4-B5A6-6EA364476E45}.Debug-Dynamic|Win32.ActiveCfg = Debug-Dynamic|Win32 {A1989FF3-9894-40F4-B5A6-6EA364476E45}.Debug-Dynamic|Win32.Build.0 = Debug-Dynamic|Win32 {A1989FF3-9894-40F4-B5A6-6EA364476E45}.Debug-Dynamic|x64.ActiveCfg = Debug-Dynamic|x64 @@ -1282,6 +1627,8 @@ {A1989FF3-9894-40F4-B5A6-6EA364476E45}.Debug-Static|Any CPU.ActiveCfg = Debug-Static|Win32 {A1989FF3-9894-40F4-B5A6-6EA364476E45}.Debug-Static|ARM.ActiveCfg = Debug-Static|ARM {A1989FF3-9894-40F4-B5A6-6EA364476E45}.Debug-Static|ARM.Build.0 = Debug-Static|ARM + {A1989FF3-9894-40F4-B5A6-6EA364476E45}.Debug-Static|ARM64.ActiveCfg = Debug-Static|ARM64 + {A1989FF3-9894-40F4-B5A6-6EA364476E45}.Debug-Static|ARM64.Build.0 = Debug-Static|ARM64 {A1989FF3-9894-40F4-B5A6-6EA364476E45}.Debug-Static|Win32.ActiveCfg = Debug-Static|Win32 {A1989FF3-9894-40F4-B5A6-6EA364476E45}.Debug-Static|Win32.Build.0 = Debug-Static|Win32 {A1989FF3-9894-40F4-B5A6-6EA364476E45}.Debug-Static|x64.ActiveCfg = Debug-Static|x64 @@ -1289,6 +1636,8 @@ {A1989FF3-9894-40F4-B5A6-6EA364476E45}.Release|Any CPU.ActiveCfg = Release|Win32 {A1989FF3-9894-40F4-B5A6-6EA364476E45}.Release|ARM.ActiveCfg = Release|ARM {A1989FF3-9894-40F4-B5A6-6EA364476E45}.Release|ARM.Build.0 = Release|ARM + {A1989FF3-9894-40F4-B5A6-6EA364476E45}.Release|ARM64.ActiveCfg = Release|ARM64 + {A1989FF3-9894-40F4-B5A6-6EA364476E45}.Release|ARM64.Build.0 = Release|ARM64 {A1989FF3-9894-40F4-B5A6-6EA364476E45}.Release|Win32.ActiveCfg = Release|Win32 {A1989FF3-9894-40F4-B5A6-6EA364476E45}.Release|Win32.Build.0 = Release|Win32 {A1989FF3-9894-40F4-B5A6-6EA364476E45}.Release|x64.ActiveCfg = Release|x64 @@ -1296,6 +1645,8 @@ {A1989FF3-9894-40F4-B5A6-6EA364476E45}.Release-Dynamic|Any CPU.ActiveCfg = Release-Dynamic|Win32 {A1989FF3-9894-40F4-B5A6-6EA364476E45}.Release-Dynamic|ARM.ActiveCfg = Release-Dynamic|ARM {A1989FF3-9894-40F4-B5A6-6EA364476E45}.Release-Dynamic|ARM.Build.0 = Release-Dynamic|ARM + {A1989FF3-9894-40F4-B5A6-6EA364476E45}.Release-Dynamic|ARM64.ActiveCfg = Release-Dynamic|ARM64 + {A1989FF3-9894-40F4-B5A6-6EA364476E45}.Release-Dynamic|ARM64.Build.0 = Release-Dynamic|ARM64 {A1989FF3-9894-40F4-B5A6-6EA364476E45}.Release-Dynamic|Win32.ActiveCfg = Release-Dynamic|Win32 {A1989FF3-9894-40F4-B5A6-6EA364476E45}.Release-Dynamic|Win32.Build.0 = Release-Dynamic|Win32 {A1989FF3-9894-40F4-B5A6-6EA364476E45}.Release-Dynamic|x64.ActiveCfg = Release-Dynamic|x64 @@ -1303,6 +1654,8 @@ {A1989FF3-9894-40F4-B5A6-6EA364476E45}.Release-Static|Any CPU.ActiveCfg = Release-Static|Win32 {A1989FF3-9894-40F4-B5A6-6EA364476E45}.Release-Static|ARM.ActiveCfg = Release-Static|ARM {A1989FF3-9894-40F4-B5A6-6EA364476E45}.Release-Static|ARM.Build.0 = Release-Static|ARM + {A1989FF3-9894-40F4-B5A6-6EA364476E45}.Release-Static|ARM64.ActiveCfg = Release-Static|ARM64 + {A1989FF3-9894-40F4-B5A6-6EA364476E45}.Release-Static|ARM64.Build.0 = Release-Static|ARM64 {A1989FF3-9894-40F4-B5A6-6EA364476E45}.Release-Static|Win32.ActiveCfg = Release-Static|Win32 {A1989FF3-9894-40F4-B5A6-6EA364476E45}.Release-Static|Win32.Build.0 = Release-Static|Win32 {A1989FF3-9894-40F4-B5A6-6EA364476E45}.Release-Static|x64.ActiveCfg = Release-Static|x64 @@ -1310,6 +1663,8 @@ {E8A3F6FA-AE1C-4C8E-A0B6-9C8480324EAA}.Debug|Any CPU.ActiveCfg = Debug|Win32 {E8A3F6FA-AE1C-4C8E-A0B6-9C8480324EAA}.Debug|ARM.ActiveCfg = Debug|ARM {E8A3F6FA-AE1C-4C8E-A0B6-9C8480324EAA}.Debug|ARM.Build.0 = Debug|ARM + {E8A3F6FA-AE1C-4C8E-A0B6-9C8480324EAA}.Debug|ARM64.ActiveCfg = Debug|ARM64 + {E8A3F6FA-AE1C-4C8E-A0B6-9C8480324EAA}.Debug|ARM64.Build.0 = Debug|ARM64 {E8A3F6FA-AE1C-4C8E-A0B6-9C8480324EAA}.Debug|Win32.ActiveCfg = Debug|Win32 {E8A3F6FA-AE1C-4C8E-A0B6-9C8480324EAA}.Debug|Win32.Build.0 = Debug|Win32 {E8A3F6FA-AE1C-4C8E-A0B6-9C8480324EAA}.Debug|x64.ActiveCfg = Debug|x64 @@ -1317,6 +1672,8 @@ {E8A3F6FA-AE1C-4C8E-A0B6-9C8480324EAA}.Debug-Dynamic|Any CPU.ActiveCfg = Debug-Dynamic|Win32 {E8A3F6FA-AE1C-4C8E-A0B6-9C8480324EAA}.Debug-Dynamic|ARM.ActiveCfg = Debug-Dynamic|ARM {E8A3F6FA-AE1C-4C8E-A0B6-9C8480324EAA}.Debug-Dynamic|ARM.Build.0 = Debug-Dynamic|ARM + {E8A3F6FA-AE1C-4C8E-A0B6-9C8480324EAA}.Debug-Dynamic|ARM64.ActiveCfg = Debug-Dynamic|ARM64 + {E8A3F6FA-AE1C-4C8E-A0B6-9C8480324EAA}.Debug-Dynamic|ARM64.Build.0 = Debug-Dynamic|ARM64 {E8A3F6FA-AE1C-4C8E-A0B6-9C8480324EAA}.Debug-Dynamic|Win32.ActiveCfg = Debug-Dynamic|Win32 {E8A3F6FA-AE1C-4C8E-A0B6-9C8480324EAA}.Debug-Dynamic|Win32.Build.0 = Debug-Dynamic|Win32 {E8A3F6FA-AE1C-4C8E-A0B6-9C8480324EAA}.Debug-Dynamic|x64.ActiveCfg = Debug-Dynamic|x64 @@ -1324,6 +1681,8 @@ {E8A3F6FA-AE1C-4C8E-A0B6-9C8480324EAA}.Debug-Static|Any CPU.ActiveCfg = Debug-Static|Win32 {E8A3F6FA-AE1C-4C8E-A0B6-9C8480324EAA}.Debug-Static|ARM.ActiveCfg = Debug-Static|ARM {E8A3F6FA-AE1C-4C8E-A0B6-9C8480324EAA}.Debug-Static|ARM.Build.0 = Debug-Static|ARM + {E8A3F6FA-AE1C-4C8E-A0B6-9C8480324EAA}.Debug-Static|ARM64.ActiveCfg = Debug-Static|ARM64 + {E8A3F6FA-AE1C-4C8E-A0B6-9C8480324EAA}.Debug-Static|ARM64.Build.0 = Debug-Static|ARM64 {E8A3F6FA-AE1C-4C8E-A0B6-9C8480324EAA}.Debug-Static|Win32.ActiveCfg = Debug-Static|Win32 {E8A3F6FA-AE1C-4C8E-A0B6-9C8480324EAA}.Debug-Static|Win32.Build.0 = Debug-Static|Win32 {E8A3F6FA-AE1C-4C8E-A0B6-9C8480324EAA}.Debug-Static|x64.ActiveCfg = Debug-Static|x64 @@ -1331,6 +1690,8 @@ {E8A3F6FA-AE1C-4C8E-A0B6-9C8480324EAA}.Release|Any CPU.ActiveCfg = Release|Win32 {E8A3F6FA-AE1C-4C8E-A0B6-9C8480324EAA}.Release|ARM.ActiveCfg = Release|ARM {E8A3F6FA-AE1C-4C8E-A0B6-9C8480324EAA}.Release|ARM.Build.0 = Release|ARM + {E8A3F6FA-AE1C-4C8E-A0B6-9C8480324EAA}.Release|ARM64.ActiveCfg = Release|ARM64 + {E8A3F6FA-AE1C-4C8E-A0B6-9C8480324EAA}.Release|ARM64.Build.0 = Release|ARM64 {E8A3F6FA-AE1C-4C8E-A0B6-9C8480324EAA}.Release|Win32.ActiveCfg = Release|Win32 {E8A3F6FA-AE1C-4C8E-A0B6-9C8480324EAA}.Release|Win32.Build.0 = Release|Win32 {E8A3F6FA-AE1C-4C8E-A0B6-9C8480324EAA}.Release|x64.ActiveCfg = Release|x64 @@ -1338,6 +1699,8 @@ {E8A3F6FA-AE1C-4C8E-A0B6-9C8480324EAA}.Release-Dynamic|Any CPU.ActiveCfg = Release-Dynamic|Win32 {E8A3F6FA-AE1C-4C8E-A0B6-9C8480324EAA}.Release-Dynamic|ARM.ActiveCfg = Release-Dynamic|ARM {E8A3F6FA-AE1C-4C8E-A0B6-9C8480324EAA}.Release-Dynamic|ARM.Build.0 = Release-Dynamic|ARM + {E8A3F6FA-AE1C-4C8E-A0B6-9C8480324EAA}.Release-Dynamic|ARM64.ActiveCfg = Release-Dynamic|ARM64 + {E8A3F6FA-AE1C-4C8E-A0B6-9C8480324EAA}.Release-Dynamic|ARM64.Build.0 = Release-Dynamic|ARM64 {E8A3F6FA-AE1C-4C8E-A0B6-9C8480324EAA}.Release-Dynamic|Win32.ActiveCfg = Release-Dynamic|Win32 {E8A3F6FA-AE1C-4C8E-A0B6-9C8480324EAA}.Release-Dynamic|Win32.Build.0 = Release-Dynamic|Win32 {E8A3F6FA-AE1C-4C8E-A0B6-9C8480324EAA}.Release-Dynamic|x64.ActiveCfg = Release-Dynamic|x64 @@ -1345,6 +1708,8 @@ {E8A3F6FA-AE1C-4C8E-A0B6-9C8480324EAA}.Release-Static|Any CPU.ActiveCfg = Release-Static|Win32 {E8A3F6FA-AE1C-4C8E-A0B6-9C8480324EAA}.Release-Static|ARM.ActiveCfg = Release-Static|ARM {E8A3F6FA-AE1C-4C8E-A0B6-9C8480324EAA}.Release-Static|ARM.Build.0 = Release-Static|ARM + {E8A3F6FA-AE1C-4C8E-A0B6-9C8480324EAA}.Release-Static|ARM64.ActiveCfg = Release-Static|ARM64 + {E8A3F6FA-AE1C-4C8E-A0B6-9C8480324EAA}.Release-Static|ARM64.Build.0 = Release-Static|ARM64 {E8A3F6FA-AE1C-4C8E-A0B6-9C8480324EAA}.Release-Static|Win32.ActiveCfg = Release-Static|Win32 {E8A3F6FA-AE1C-4C8E-A0B6-9C8480324EAA}.Release-Static|Win32.Build.0 = Release-Static|Win32 {E8A3F6FA-AE1C-4C8E-A0B6-9C8480324EAA}.Release-Static|x64.ActiveCfg = Release-Static|x64 @@ -1352,6 +1717,8 @@ {B82CDD25-6903-430E-BD38-D8129A2015C1}.Debug|Any CPU.ActiveCfg = Debug|Win32 {B82CDD25-6903-430E-BD38-D8129A2015C1}.Debug|ARM.ActiveCfg = Debug|ARM {B82CDD25-6903-430E-BD38-D8129A2015C1}.Debug|ARM.Build.0 = Debug|ARM + {B82CDD25-6903-430E-BD38-D8129A2015C1}.Debug|ARM64.ActiveCfg = Debug|ARM64 + {B82CDD25-6903-430E-BD38-D8129A2015C1}.Debug|ARM64.Build.0 = Debug|ARM64 {B82CDD25-6903-430E-BD38-D8129A2015C1}.Debug|Win32.ActiveCfg = Debug|Win32 {B82CDD25-6903-430E-BD38-D8129A2015C1}.Debug|Win32.Build.0 = Debug|Win32 {B82CDD25-6903-430E-BD38-D8129A2015C1}.Debug|x64.ActiveCfg = Debug|x64 @@ -1359,6 +1726,8 @@ {B82CDD25-6903-430E-BD38-D8129A2015C1}.Debug-Dynamic|Any CPU.ActiveCfg = Debug-Dynamic|Win32 {B82CDD25-6903-430E-BD38-D8129A2015C1}.Debug-Dynamic|ARM.ActiveCfg = Debug-Dynamic|ARM {B82CDD25-6903-430E-BD38-D8129A2015C1}.Debug-Dynamic|ARM.Build.0 = Debug-Dynamic|ARM + {B82CDD25-6903-430E-BD38-D8129A2015C1}.Debug-Dynamic|ARM64.ActiveCfg = Debug-Dynamic|ARM64 + {B82CDD25-6903-430E-BD38-D8129A2015C1}.Debug-Dynamic|ARM64.Build.0 = Debug-Dynamic|ARM64 {B82CDD25-6903-430E-BD38-D8129A2015C1}.Debug-Dynamic|Win32.ActiveCfg = Debug-Dynamic|Win32 {B82CDD25-6903-430E-BD38-D8129A2015C1}.Debug-Dynamic|Win32.Build.0 = Debug-Dynamic|Win32 {B82CDD25-6903-430E-BD38-D8129A2015C1}.Debug-Dynamic|x64.ActiveCfg = Debug-Dynamic|x64 @@ -1366,6 +1735,8 @@ {B82CDD25-6903-430E-BD38-D8129A2015C1}.Debug-Static|Any CPU.ActiveCfg = Debug-Static|Win32 {B82CDD25-6903-430E-BD38-D8129A2015C1}.Debug-Static|ARM.ActiveCfg = Debug-Static|ARM {B82CDD25-6903-430E-BD38-D8129A2015C1}.Debug-Static|ARM.Build.0 = Debug-Static|ARM + {B82CDD25-6903-430E-BD38-D8129A2015C1}.Debug-Static|ARM64.ActiveCfg = Debug-Static|ARM64 + {B82CDD25-6903-430E-BD38-D8129A2015C1}.Debug-Static|ARM64.Build.0 = Debug-Static|ARM64 {B82CDD25-6903-430E-BD38-D8129A2015C1}.Debug-Static|Win32.ActiveCfg = Debug-Static|Win32 {B82CDD25-6903-430E-BD38-D8129A2015C1}.Debug-Static|Win32.Build.0 = Debug-Static|Win32 {B82CDD25-6903-430E-BD38-D8129A2015C1}.Debug-Static|x64.ActiveCfg = Debug-Static|x64 @@ -1373,6 +1744,8 @@ {B82CDD25-6903-430E-BD38-D8129A2015C1}.Release|Any CPU.ActiveCfg = Release|Win32 {B82CDD25-6903-430E-BD38-D8129A2015C1}.Release|ARM.ActiveCfg = Release|ARM {B82CDD25-6903-430E-BD38-D8129A2015C1}.Release|ARM.Build.0 = Release|ARM + {B82CDD25-6903-430E-BD38-D8129A2015C1}.Release|ARM64.ActiveCfg = Release|ARM64 + {B82CDD25-6903-430E-BD38-D8129A2015C1}.Release|ARM64.Build.0 = Release|ARM64 {B82CDD25-6903-430E-BD38-D8129A2015C1}.Release|Win32.ActiveCfg = Release|Win32 {B82CDD25-6903-430E-BD38-D8129A2015C1}.Release|Win32.Build.0 = Release|Win32 {B82CDD25-6903-430E-BD38-D8129A2015C1}.Release|x64.ActiveCfg = Release|x64 @@ -1380,6 +1753,8 @@ {B82CDD25-6903-430E-BD38-D8129A2015C1}.Release-Dynamic|Any CPU.ActiveCfg = Release-Dynamic|Win32 {B82CDD25-6903-430E-BD38-D8129A2015C1}.Release-Dynamic|ARM.ActiveCfg = Release-Dynamic|ARM {B82CDD25-6903-430E-BD38-D8129A2015C1}.Release-Dynamic|ARM.Build.0 = Release-Dynamic|ARM + {B82CDD25-6903-430E-BD38-D8129A2015C1}.Release-Dynamic|ARM64.ActiveCfg = Release-Dynamic|ARM64 + {B82CDD25-6903-430E-BD38-D8129A2015C1}.Release-Dynamic|ARM64.Build.0 = Release-Dynamic|ARM64 {B82CDD25-6903-430E-BD38-D8129A2015C1}.Release-Dynamic|Win32.ActiveCfg = Release-Dynamic|Win32 {B82CDD25-6903-430E-BD38-D8129A2015C1}.Release-Dynamic|Win32.Build.0 = Release-Dynamic|Win32 {B82CDD25-6903-430E-BD38-D8129A2015C1}.Release-Dynamic|x64.ActiveCfg = Release-Dynamic|x64 @@ -1387,6 +1762,8 @@ {B82CDD25-6903-430E-BD38-D8129A2015C1}.Release-Static|Any CPU.ActiveCfg = Release-Static|Win32 {B82CDD25-6903-430E-BD38-D8129A2015C1}.Release-Static|ARM.ActiveCfg = Release-Static|ARM {B82CDD25-6903-430E-BD38-D8129A2015C1}.Release-Static|ARM.Build.0 = Release-Static|ARM + {B82CDD25-6903-430E-BD38-D8129A2015C1}.Release-Static|ARM64.ActiveCfg = Release-Static|ARM64 + {B82CDD25-6903-430E-BD38-D8129A2015C1}.Release-Static|ARM64.Build.0 = Release-Static|ARM64 {B82CDD25-6903-430E-BD38-D8129A2015C1}.Release-Static|Win32.ActiveCfg = Release-Static|Win32 {B82CDD25-6903-430E-BD38-D8129A2015C1}.Release-Static|Win32.Build.0 = Release-Static|Win32 {B82CDD25-6903-430E-BD38-D8129A2015C1}.Release-Static|x64.ActiveCfg = Release-Static|x64 @@ -1395,6 +1772,7 @@ {D26DD1D3-C631-4A56-BBE5-D42F1ACFD53A}.Debug|ARM.ActiveCfg = Debug|ARM {D26DD1D3-C631-4A56-BBE5-D42F1ACFD53A}.Debug|ARM.Build.0 = Debug|ARM {D26DD1D3-C631-4A56-BBE5-D42F1ACFD53A}.Debug|ARM.Deploy.0 = Debug|ARM + {D26DD1D3-C631-4A56-BBE5-D42F1ACFD53A}.Debug|ARM64.ActiveCfg = Debug|x86 {D26DD1D3-C631-4A56-BBE5-D42F1ACFD53A}.Debug|Win32.ActiveCfg = Debug|Win32 {D26DD1D3-C631-4A56-BBE5-D42F1ACFD53A}.Debug|Win32.Build.0 = Debug|Win32 {D26DD1D3-C631-4A56-BBE5-D42F1ACFD53A}.Debug|Win32.Deploy.0 = Debug|Win32 @@ -1407,6 +1785,7 @@ {D26DD1D3-C631-4A56-BBE5-D42F1ACFD53A}.Debug-Dynamic|ARM.ActiveCfg = Debug|ARM {D26DD1D3-C631-4A56-BBE5-D42F1ACFD53A}.Debug-Dynamic|ARM.Build.0 = Debug|ARM {D26DD1D3-C631-4A56-BBE5-D42F1ACFD53A}.Debug-Dynamic|ARM.Deploy.0 = Debug|ARM + {D26DD1D3-C631-4A56-BBE5-D42F1ACFD53A}.Debug-Dynamic|ARM64.ActiveCfg = Release|x64 {D26DD1D3-C631-4A56-BBE5-D42F1ACFD53A}.Debug-Dynamic|Win32.ActiveCfg = Debug|Win32 {D26DD1D3-C631-4A56-BBE5-D42F1ACFD53A}.Debug-Dynamic|Win32.Build.0 = Debug|Win32 {D26DD1D3-C631-4A56-BBE5-D42F1ACFD53A}.Debug-Dynamic|Win32.Deploy.0 = Debug|Win32 @@ -1419,6 +1798,7 @@ {D26DD1D3-C631-4A56-BBE5-D42F1ACFD53A}.Debug-Static|ARM.ActiveCfg = Debug|ARM {D26DD1D3-C631-4A56-BBE5-D42F1ACFD53A}.Debug-Static|ARM.Build.0 = Debug|ARM {D26DD1D3-C631-4A56-BBE5-D42F1ACFD53A}.Debug-Static|ARM.Deploy.0 = Debug|ARM + {D26DD1D3-C631-4A56-BBE5-D42F1ACFD53A}.Debug-Static|ARM64.ActiveCfg = Release|x64 {D26DD1D3-C631-4A56-BBE5-D42F1ACFD53A}.Debug-Static|Win32.ActiveCfg = Debug|Win32 {D26DD1D3-C631-4A56-BBE5-D42F1ACFD53A}.Debug-Static|Win32.Build.0 = Debug|Win32 {D26DD1D3-C631-4A56-BBE5-D42F1ACFD53A}.Debug-Static|Win32.Deploy.0 = Debug|Win32 @@ -1429,6 +1809,7 @@ {D26DD1D3-C631-4A56-BBE5-D42F1ACFD53A}.Release|ARM.ActiveCfg = Release|ARM {D26DD1D3-C631-4A56-BBE5-D42F1ACFD53A}.Release|ARM.Build.0 = Release|ARM {D26DD1D3-C631-4A56-BBE5-D42F1ACFD53A}.Release|ARM.Deploy.0 = Release|ARM + {D26DD1D3-C631-4A56-BBE5-D42F1ACFD53A}.Release|ARM64.ActiveCfg = Release|x86 {D26DD1D3-C631-4A56-BBE5-D42F1ACFD53A}.Release|Win32.ActiveCfg = Release|Win32 {D26DD1D3-C631-4A56-BBE5-D42F1ACFD53A}.Release|Win32.Build.0 = Release|Win32 {D26DD1D3-C631-4A56-BBE5-D42F1ACFD53A}.Release|Win32.Deploy.0 = Release|Win32 @@ -1441,6 +1822,7 @@ {D26DD1D3-C631-4A56-BBE5-D42F1ACFD53A}.Release-Dynamic|ARM.ActiveCfg = Release|ARM {D26DD1D3-C631-4A56-BBE5-D42F1ACFD53A}.Release-Dynamic|ARM.Build.0 = Release|ARM {D26DD1D3-C631-4A56-BBE5-D42F1ACFD53A}.Release-Dynamic|ARM.Deploy.0 = Release|ARM + {D26DD1D3-C631-4A56-BBE5-D42F1ACFD53A}.Release-Dynamic|ARM64.ActiveCfg = Release|x64 {D26DD1D3-C631-4A56-BBE5-D42F1ACFD53A}.Release-Dynamic|Win32.ActiveCfg = Release|Win32 {D26DD1D3-C631-4A56-BBE5-D42F1ACFD53A}.Release-Dynamic|Win32.Build.0 = Release|Win32 {D26DD1D3-C631-4A56-BBE5-D42F1ACFD53A}.Release-Dynamic|Win32.Deploy.0 = Release|Win32 @@ -1453,6 +1835,7 @@ {D26DD1D3-C631-4A56-BBE5-D42F1ACFD53A}.Release-Static|ARM.ActiveCfg = Release|ARM {D26DD1D3-C631-4A56-BBE5-D42F1ACFD53A}.Release-Static|ARM.Build.0 = Release|ARM {D26DD1D3-C631-4A56-BBE5-D42F1ACFD53A}.Release-Static|ARM.Deploy.0 = Release|ARM + {D26DD1D3-C631-4A56-BBE5-D42F1ACFD53A}.Release-Static|ARM64.ActiveCfg = Release|x64 {D26DD1D3-C631-4A56-BBE5-D42F1ACFD53A}.Release-Static|Win32.ActiveCfg = Release|Win32 {D26DD1D3-C631-4A56-BBE5-D42F1ACFD53A}.Release-Static|Win32.Build.0 = Release|Win32 {D26DD1D3-C631-4A56-BBE5-D42F1ACFD53A}.Release-Static|Win32.Deploy.0 = Release|Win32 @@ -1465,6 +1848,7 @@ {B3BA00A5-4F68-4F52-8081-395124F141AB}.Debug|ARM.ActiveCfg = Debug|ARM {B3BA00A5-4F68-4F52-8081-395124F141AB}.Debug|ARM.Build.0 = Debug|ARM {B3BA00A5-4F68-4F52-8081-395124F141AB}.Debug|ARM.Deploy.0 = Debug|ARM + {B3BA00A5-4F68-4F52-8081-395124F141AB}.Debug|ARM64.ActiveCfg = Debug|Any CPU {B3BA00A5-4F68-4F52-8081-395124F141AB}.Debug|Win32.ActiveCfg = Debug|Win32 {B3BA00A5-4F68-4F52-8081-395124F141AB}.Debug|Win32.Build.0 = Debug|Win32 {B3BA00A5-4F68-4F52-8081-395124F141AB}.Debug|Win32.Deploy.0 = Debug|Win32 @@ -1477,6 +1861,7 @@ {B3BA00A5-4F68-4F52-8081-395124F141AB}.Debug-Dynamic|ARM.ActiveCfg = Debug|ARM {B3BA00A5-4F68-4F52-8081-395124F141AB}.Debug-Dynamic|ARM.Build.0 = Debug|ARM {B3BA00A5-4F68-4F52-8081-395124F141AB}.Debug-Dynamic|ARM.Deploy.0 = Debug|ARM + {B3BA00A5-4F68-4F52-8081-395124F141AB}.Debug-Dynamic|ARM64.ActiveCfg = Debug|Any CPU {B3BA00A5-4F68-4F52-8081-395124F141AB}.Debug-Dynamic|Win32.ActiveCfg = Debug|Win32 {B3BA00A5-4F68-4F52-8081-395124F141AB}.Debug-Dynamic|Win32.Build.0 = Debug|Win32 {B3BA00A5-4F68-4F52-8081-395124F141AB}.Debug-Dynamic|Win32.Deploy.0 = Debug|Win32 @@ -1489,6 +1874,7 @@ {B3BA00A5-4F68-4F52-8081-395124F141AB}.Debug-Static|ARM.ActiveCfg = Debug|ARM {B3BA00A5-4F68-4F52-8081-395124F141AB}.Debug-Static|ARM.Build.0 = Debug|ARM {B3BA00A5-4F68-4F52-8081-395124F141AB}.Debug-Static|ARM.Deploy.0 = Debug|ARM + {B3BA00A5-4F68-4F52-8081-395124F141AB}.Debug-Static|ARM64.ActiveCfg = Debug|Any CPU {B3BA00A5-4F68-4F52-8081-395124F141AB}.Debug-Static|Win32.ActiveCfg = Debug|Win32 {B3BA00A5-4F68-4F52-8081-395124F141AB}.Debug-Static|Win32.Build.0 = Debug|Win32 {B3BA00A5-4F68-4F52-8081-395124F141AB}.Debug-Static|Win32.Deploy.0 = Debug|Win32 @@ -1501,6 +1887,7 @@ {B3BA00A5-4F68-4F52-8081-395124F141AB}.Release|ARM.ActiveCfg = Release|ARM {B3BA00A5-4F68-4F52-8081-395124F141AB}.Release|ARM.Build.0 = Release|ARM {B3BA00A5-4F68-4F52-8081-395124F141AB}.Release|ARM.Deploy.0 = Release|ARM + {B3BA00A5-4F68-4F52-8081-395124F141AB}.Release|ARM64.ActiveCfg = Release|Any CPU {B3BA00A5-4F68-4F52-8081-395124F141AB}.Release|Win32.ActiveCfg = Release|Win32 {B3BA00A5-4F68-4F52-8081-395124F141AB}.Release|Win32.Build.0 = Release|Win32 {B3BA00A5-4F68-4F52-8081-395124F141AB}.Release|Win32.Deploy.0 = Release|Win32 @@ -1513,6 +1900,7 @@ {B3BA00A5-4F68-4F52-8081-395124F141AB}.Release-Dynamic|ARM.ActiveCfg = Release|ARM {B3BA00A5-4F68-4F52-8081-395124F141AB}.Release-Dynamic|ARM.Build.0 = Release|ARM {B3BA00A5-4F68-4F52-8081-395124F141AB}.Release-Dynamic|ARM.Deploy.0 = Release|ARM + {B3BA00A5-4F68-4F52-8081-395124F141AB}.Release-Dynamic|ARM64.ActiveCfg = Release|Any CPU {B3BA00A5-4F68-4F52-8081-395124F141AB}.Release-Dynamic|Win32.ActiveCfg = Release|Win32 {B3BA00A5-4F68-4F52-8081-395124F141AB}.Release-Dynamic|Win32.Build.0 = Release|Win32 {B3BA00A5-4F68-4F52-8081-395124F141AB}.Release-Dynamic|Win32.Deploy.0 = Release|Win32 @@ -1525,6 +1913,7 @@ {B3BA00A5-4F68-4F52-8081-395124F141AB}.Release-Static|ARM.ActiveCfg = Release|ARM {B3BA00A5-4F68-4F52-8081-395124F141AB}.Release-Static|ARM.Build.0 = Release|ARM {B3BA00A5-4F68-4F52-8081-395124F141AB}.Release-Static|ARM.Deploy.0 = Release|ARM + {B3BA00A5-4F68-4F52-8081-395124F141AB}.Release-Static|ARM64.ActiveCfg = Release|Any CPU {B3BA00A5-4F68-4F52-8081-395124F141AB}.Release-Static|Win32.ActiveCfg = Release|Win32 {B3BA00A5-4F68-4F52-8081-395124F141AB}.Release-Static|Win32.Build.0 = Release|Win32 {B3BA00A5-4F68-4F52-8081-395124F141AB}.Release-Static|Win32.Deploy.0 = Release|Win32 @@ -1534,6 +1923,7 @@ {207E7BD4-7B11-4A40-BA3A-CC627762A7B6}.Debug|Any CPU.ActiveCfg = Debug|Win32 {207E7BD4-7B11-4A40-BA3A-CC627762A7B6}.Debug|ARM.ActiveCfg = Debug|ARM {207E7BD4-7B11-4A40-BA3A-CC627762A7B6}.Debug|ARM.Build.0 = Debug|ARM + {207E7BD4-7B11-4A40-BA3A-CC627762A7B6}.Debug|ARM64.ActiveCfg = Debug|Win32 {207E7BD4-7B11-4A40-BA3A-CC627762A7B6}.Debug|Win32.ActiveCfg = Debug|Win32 {207E7BD4-7B11-4A40-BA3A-CC627762A7B6}.Debug|Win32.Build.0 = Debug|Win32 {207E7BD4-7B11-4A40-BA3A-CC627762A7B6}.Debug|x64.ActiveCfg = Debug|x64 @@ -1542,6 +1932,7 @@ {207E7BD4-7B11-4A40-BA3A-CC627762A7B6}.Debug-Dynamic|Any CPU.Build.0 = Release|x64 {207E7BD4-7B11-4A40-BA3A-CC627762A7B6}.Debug-Dynamic|ARM.ActiveCfg = Debug|ARM {207E7BD4-7B11-4A40-BA3A-CC627762A7B6}.Debug-Dynamic|ARM.Build.0 = Debug|ARM + {207E7BD4-7B11-4A40-BA3A-CC627762A7B6}.Debug-Dynamic|ARM64.ActiveCfg = Release|ARM {207E7BD4-7B11-4A40-BA3A-CC627762A7B6}.Debug-Dynamic|Win32.ActiveCfg = Debug|Win32 {207E7BD4-7B11-4A40-BA3A-CC627762A7B6}.Debug-Dynamic|Win32.Build.0 = Debug|Win32 {207E7BD4-7B11-4A40-BA3A-CC627762A7B6}.Debug-Dynamic|x64.ActiveCfg = Debug|x64 @@ -1550,6 +1941,7 @@ {207E7BD4-7B11-4A40-BA3A-CC627762A7B6}.Debug-Static|Any CPU.Build.0 = Release|x64 {207E7BD4-7B11-4A40-BA3A-CC627762A7B6}.Debug-Static|ARM.ActiveCfg = Debug|ARM {207E7BD4-7B11-4A40-BA3A-CC627762A7B6}.Debug-Static|ARM.Build.0 = Debug|ARM + {207E7BD4-7B11-4A40-BA3A-CC627762A7B6}.Debug-Static|ARM64.ActiveCfg = Release|ARM {207E7BD4-7B11-4A40-BA3A-CC627762A7B6}.Debug-Static|Win32.ActiveCfg = Debug|Win32 {207E7BD4-7B11-4A40-BA3A-CC627762A7B6}.Debug-Static|Win32.Build.0 = Debug|Win32 {207E7BD4-7B11-4A40-BA3A-CC627762A7B6}.Debug-Static|x64.ActiveCfg = Debug|x64 @@ -1557,6 +1949,7 @@ {207E7BD4-7B11-4A40-BA3A-CC627762A7B6}.Release|Any CPU.ActiveCfg = Release|Win32 {207E7BD4-7B11-4A40-BA3A-CC627762A7B6}.Release|ARM.ActiveCfg = Release|ARM {207E7BD4-7B11-4A40-BA3A-CC627762A7B6}.Release|ARM.Build.0 = Release|ARM + {207E7BD4-7B11-4A40-BA3A-CC627762A7B6}.Release|ARM64.ActiveCfg = Release|Win32 {207E7BD4-7B11-4A40-BA3A-CC627762A7B6}.Release|Win32.ActiveCfg = Release|Win32 {207E7BD4-7B11-4A40-BA3A-CC627762A7B6}.Release|Win32.Build.0 = Release|Win32 {207E7BD4-7B11-4A40-BA3A-CC627762A7B6}.Release|x64.ActiveCfg = Release|x64 @@ -1565,6 +1958,7 @@ {207E7BD4-7B11-4A40-BA3A-CC627762A7B6}.Release-Dynamic|Any CPU.Build.0 = Release|x64 {207E7BD4-7B11-4A40-BA3A-CC627762A7B6}.Release-Dynamic|ARM.ActiveCfg = Release|ARM {207E7BD4-7B11-4A40-BA3A-CC627762A7B6}.Release-Dynamic|ARM.Build.0 = Release|ARM + {207E7BD4-7B11-4A40-BA3A-CC627762A7B6}.Release-Dynamic|ARM64.ActiveCfg = Release|ARM {207E7BD4-7B11-4A40-BA3A-CC627762A7B6}.Release-Dynamic|Win32.ActiveCfg = Release|Win32 {207E7BD4-7B11-4A40-BA3A-CC627762A7B6}.Release-Dynamic|Win32.Build.0 = Release|Win32 {207E7BD4-7B11-4A40-BA3A-CC627762A7B6}.Release-Dynamic|x64.ActiveCfg = Release|x64 @@ -1573,6 +1967,7 @@ {207E7BD4-7B11-4A40-BA3A-CC627762A7B6}.Release-Static|Any CPU.Build.0 = Release|x64 {207E7BD4-7B11-4A40-BA3A-CC627762A7B6}.Release-Static|ARM.ActiveCfg = Release|ARM {207E7BD4-7B11-4A40-BA3A-CC627762A7B6}.Release-Static|ARM.Build.0 = Release|ARM + {207E7BD4-7B11-4A40-BA3A-CC627762A7B6}.Release-Static|ARM64.ActiveCfg = Release|ARM {207E7BD4-7B11-4A40-BA3A-CC627762A7B6}.Release-Static|Win32.ActiveCfg = Release|Win32 {207E7BD4-7B11-4A40-BA3A-CC627762A7B6}.Release-Static|Win32.Build.0 = Release|Win32 {207E7BD4-7B11-4A40-BA3A-CC627762A7B6}.Release-Static|x64.ActiveCfg = Release|x64 @@ -1580,6 +1975,7 @@ {E75EFD41-C7F5-44C8-8FF1-A310D920989D}.Debug|Any CPU.ActiveCfg = Debug|Win32 {E75EFD41-C7F5-44C8-8FF1-A310D920989D}.Debug|ARM.ActiveCfg = Debug|ARM {E75EFD41-C7F5-44C8-8FF1-A310D920989D}.Debug|ARM.Build.0 = Debug|ARM + {E75EFD41-C7F5-44C8-8FF1-A310D920989D}.Debug|ARM64.ActiveCfg = Debug|Win32 {E75EFD41-C7F5-44C8-8FF1-A310D920989D}.Debug|Win32.ActiveCfg = Debug|Win32 {E75EFD41-C7F5-44C8-8FF1-A310D920989D}.Debug|Win32.Build.0 = Debug|Win32 {E75EFD41-C7F5-44C8-8FF1-A310D920989D}.Debug|x64.ActiveCfg = Debug|Win32 @@ -1587,6 +1983,7 @@ {E75EFD41-C7F5-44C8-8FF1-A310D920989D}.Debug-Dynamic|Any CPU.Build.0 = Release|ARM {E75EFD41-C7F5-44C8-8FF1-A310D920989D}.Debug-Dynamic|ARM.ActiveCfg = Debug|ARM {E75EFD41-C7F5-44C8-8FF1-A310D920989D}.Debug-Dynamic|ARM.Build.0 = Debug|ARM + {E75EFD41-C7F5-44C8-8FF1-A310D920989D}.Debug-Dynamic|ARM64.ActiveCfg = Release|Win32 {E75EFD41-C7F5-44C8-8FF1-A310D920989D}.Debug-Dynamic|Win32.ActiveCfg = Debug|Win32 {E75EFD41-C7F5-44C8-8FF1-A310D920989D}.Debug-Dynamic|Win32.Build.0 = Debug|Win32 {E75EFD41-C7F5-44C8-8FF1-A310D920989D}.Debug-Dynamic|x64.ActiveCfg = Release|ARM @@ -1595,6 +1992,7 @@ {E75EFD41-C7F5-44C8-8FF1-A310D920989D}.Debug-Static|Any CPU.Build.0 = Release|ARM {E75EFD41-C7F5-44C8-8FF1-A310D920989D}.Debug-Static|ARM.ActiveCfg = Debug|ARM {E75EFD41-C7F5-44C8-8FF1-A310D920989D}.Debug-Static|ARM.Build.0 = Debug|ARM + {E75EFD41-C7F5-44C8-8FF1-A310D920989D}.Debug-Static|ARM64.ActiveCfg = Release|Win32 {E75EFD41-C7F5-44C8-8FF1-A310D920989D}.Debug-Static|Win32.ActiveCfg = Debug|Win32 {E75EFD41-C7F5-44C8-8FF1-A310D920989D}.Debug-Static|Win32.Build.0 = Debug|Win32 {E75EFD41-C7F5-44C8-8FF1-A310D920989D}.Debug-Static|x64.ActiveCfg = Release|ARM @@ -1602,6 +2000,7 @@ {E75EFD41-C7F5-44C8-8FF1-A310D920989D}.Release|Any CPU.ActiveCfg = Release|Win32 {E75EFD41-C7F5-44C8-8FF1-A310D920989D}.Release|ARM.ActiveCfg = Release|ARM {E75EFD41-C7F5-44C8-8FF1-A310D920989D}.Release|ARM.Build.0 = Release|ARM + {E75EFD41-C7F5-44C8-8FF1-A310D920989D}.Release|ARM64.ActiveCfg = Release|Win32 {E75EFD41-C7F5-44C8-8FF1-A310D920989D}.Release|Win32.ActiveCfg = Release|Win32 {E75EFD41-C7F5-44C8-8FF1-A310D920989D}.Release|Win32.Build.0 = Release|Win32 {E75EFD41-C7F5-44C8-8FF1-A310D920989D}.Release|x64.ActiveCfg = Release|Win32 @@ -1609,6 +2008,7 @@ {E75EFD41-C7F5-44C8-8FF1-A310D920989D}.Release-Dynamic|Any CPU.Build.0 = Release|ARM {E75EFD41-C7F5-44C8-8FF1-A310D920989D}.Release-Dynamic|ARM.ActiveCfg = Release|ARM {E75EFD41-C7F5-44C8-8FF1-A310D920989D}.Release-Dynamic|ARM.Build.0 = Release|ARM + {E75EFD41-C7F5-44C8-8FF1-A310D920989D}.Release-Dynamic|ARM64.ActiveCfg = Release|Win32 {E75EFD41-C7F5-44C8-8FF1-A310D920989D}.Release-Dynamic|Win32.ActiveCfg = Release|Win32 {E75EFD41-C7F5-44C8-8FF1-A310D920989D}.Release-Dynamic|Win32.Build.0 = Release|Win32 {E75EFD41-C7F5-44C8-8FF1-A310D920989D}.Release-Dynamic|x64.ActiveCfg = Release|ARM @@ -1617,6 +2017,7 @@ {E75EFD41-C7F5-44C8-8FF1-A310D920989D}.Release-Static|Any CPU.Build.0 = Release|ARM {E75EFD41-C7F5-44C8-8FF1-A310D920989D}.Release-Static|ARM.ActiveCfg = Release|ARM {E75EFD41-C7F5-44C8-8FF1-A310D920989D}.Release-Static|ARM.Build.0 = Release|ARM + {E75EFD41-C7F5-44C8-8FF1-A310D920989D}.Release-Static|ARM64.ActiveCfg = Release|Win32 {E75EFD41-C7F5-44C8-8FF1-A310D920989D}.Release-Static|Win32.ActiveCfg = Release|Win32 {E75EFD41-C7F5-44C8-8FF1-A310D920989D}.Release-Static|Win32.Build.0 = Release|Win32 {E75EFD41-C7F5-44C8-8FF1-A310D920989D}.Release-Static|x64.ActiveCfg = Release|ARM @@ -1625,6 +2026,7 @@ {B11B5672-B1E8-4C77-BDA1-4E6620F96BF9}.Debug|ARM.ActiveCfg = Debug|ARM {B11B5672-B1E8-4C77-BDA1-4E6620F96BF9}.Debug|ARM.Build.0 = Debug|ARM {B11B5672-B1E8-4C77-BDA1-4E6620F96BF9}.Debug|ARM.Deploy.0 = Debug|ARM + {B11B5672-B1E8-4C77-BDA1-4E6620F96BF9}.Debug|ARM64.ActiveCfg = Debug|x86 {B11B5672-B1E8-4C77-BDA1-4E6620F96BF9}.Debug|Win32.ActiveCfg = Debug|x86 {B11B5672-B1E8-4C77-BDA1-4E6620F96BF9}.Debug|Win32.Build.0 = Debug|x86 {B11B5672-B1E8-4C77-BDA1-4E6620F96BF9}.Debug|Win32.Deploy.0 = Debug|x86 @@ -1637,6 +2039,7 @@ {B11B5672-B1E8-4C77-BDA1-4E6620F96BF9}.Debug-Dynamic|ARM.ActiveCfg = Debug|ARM {B11B5672-B1E8-4C77-BDA1-4E6620F96BF9}.Debug-Dynamic|ARM.Build.0 = Debug|ARM {B11B5672-B1E8-4C77-BDA1-4E6620F96BF9}.Debug-Dynamic|ARM.Deploy.0 = Debug|ARM + {B11B5672-B1E8-4C77-BDA1-4E6620F96BF9}.Debug-Dynamic|ARM64.ActiveCfg = Release|x64 {B11B5672-B1E8-4C77-BDA1-4E6620F96BF9}.Debug-Dynamic|Win32.ActiveCfg = Debug|x86 {B11B5672-B1E8-4C77-BDA1-4E6620F96BF9}.Debug-Dynamic|Win32.Build.0 = Debug|x86 {B11B5672-B1E8-4C77-BDA1-4E6620F96BF9}.Debug-Dynamic|Win32.Deploy.0 = Debug|x86 @@ -1649,6 +2052,7 @@ {B11B5672-B1E8-4C77-BDA1-4E6620F96BF9}.Debug-Static|ARM.ActiveCfg = Debug|ARM {B11B5672-B1E8-4C77-BDA1-4E6620F96BF9}.Debug-Static|ARM.Build.0 = Debug|ARM {B11B5672-B1E8-4C77-BDA1-4E6620F96BF9}.Debug-Static|ARM.Deploy.0 = Debug|ARM + {B11B5672-B1E8-4C77-BDA1-4E6620F96BF9}.Debug-Static|ARM64.ActiveCfg = Release|x64 {B11B5672-B1E8-4C77-BDA1-4E6620F96BF9}.Debug-Static|Win32.ActiveCfg = Debug|x86 {B11B5672-B1E8-4C77-BDA1-4E6620F96BF9}.Debug-Static|Win32.Build.0 = Debug|x86 {B11B5672-B1E8-4C77-BDA1-4E6620F96BF9}.Debug-Static|Win32.Deploy.0 = Debug|x86 @@ -1659,6 +2063,7 @@ {B11B5672-B1E8-4C77-BDA1-4E6620F96BF9}.Release|ARM.ActiveCfg = Release|ARM {B11B5672-B1E8-4C77-BDA1-4E6620F96BF9}.Release|ARM.Build.0 = Release|ARM {B11B5672-B1E8-4C77-BDA1-4E6620F96BF9}.Release|ARM.Deploy.0 = Release|ARM + {B11B5672-B1E8-4C77-BDA1-4E6620F96BF9}.Release|ARM64.ActiveCfg = Release|x86 {B11B5672-B1E8-4C77-BDA1-4E6620F96BF9}.Release|Win32.ActiveCfg = Release|x86 {B11B5672-B1E8-4C77-BDA1-4E6620F96BF9}.Release|Win32.Build.0 = Release|x86 {B11B5672-B1E8-4C77-BDA1-4E6620F96BF9}.Release|Win32.Deploy.0 = Release|x86 @@ -1671,6 +2076,7 @@ {B11B5672-B1E8-4C77-BDA1-4E6620F96BF9}.Release-Dynamic|ARM.ActiveCfg = Release|ARM {B11B5672-B1E8-4C77-BDA1-4E6620F96BF9}.Release-Dynamic|ARM.Build.0 = Release|ARM {B11B5672-B1E8-4C77-BDA1-4E6620F96BF9}.Release-Dynamic|ARM.Deploy.0 = Release|ARM + {B11B5672-B1E8-4C77-BDA1-4E6620F96BF9}.Release-Dynamic|ARM64.ActiveCfg = Release|x64 {B11B5672-B1E8-4C77-BDA1-4E6620F96BF9}.Release-Dynamic|Win32.ActiveCfg = Release|x86 {B11B5672-B1E8-4C77-BDA1-4E6620F96BF9}.Release-Dynamic|Win32.Build.0 = Release|x86 {B11B5672-B1E8-4C77-BDA1-4E6620F96BF9}.Release-Dynamic|Win32.Deploy.0 = Release|x86 @@ -1683,6 +2089,7 @@ {B11B5672-B1E8-4C77-BDA1-4E6620F96BF9}.Release-Static|ARM.ActiveCfg = Release|ARM {B11B5672-B1E8-4C77-BDA1-4E6620F96BF9}.Release-Static|ARM.Build.0 = Release|ARM {B11B5672-B1E8-4C77-BDA1-4E6620F96BF9}.Release-Static|ARM.Deploy.0 = Release|ARM + {B11B5672-B1E8-4C77-BDA1-4E6620F96BF9}.Release-Static|ARM64.ActiveCfg = Release|x64 {B11B5672-B1E8-4C77-BDA1-4E6620F96BF9}.Release-Static|Win32.ActiveCfg = Release|x86 {B11B5672-B1E8-4C77-BDA1-4E6620F96BF9}.Release-Static|Win32.Build.0 = Release|x86 {B11B5672-B1E8-4C77-BDA1-4E6620F96BF9}.Release-Static|Win32.Deploy.0 = Release|x86 @@ -1692,6 +2099,7 @@ {FC9CBB95-624C-4CE8-86A8-3AB5A415AA65}.Debug|Any CPU.ActiveCfg = Debug|Win32 {FC9CBB95-624C-4CE8-86A8-3AB5A415AA65}.Debug|ARM.ActiveCfg = Debug|ARM {FC9CBB95-624C-4CE8-86A8-3AB5A415AA65}.Debug|ARM.Build.0 = Debug|ARM + {FC9CBB95-624C-4CE8-86A8-3AB5A415AA65}.Debug|ARM64.ActiveCfg = Debug|Win32 {FC9CBB95-624C-4CE8-86A8-3AB5A415AA65}.Debug|Win32.ActiveCfg = Debug|Win32 {FC9CBB95-624C-4CE8-86A8-3AB5A415AA65}.Debug|Win32.Build.0 = Debug|Win32 {FC9CBB95-624C-4CE8-86A8-3AB5A415AA65}.Debug|x64.ActiveCfg = Debug|x64 @@ -1700,6 +2108,7 @@ {FC9CBB95-624C-4CE8-86A8-3AB5A415AA65}.Debug-Dynamic|Any CPU.Build.0 = Release|x64 {FC9CBB95-624C-4CE8-86A8-3AB5A415AA65}.Debug-Dynamic|ARM.ActiveCfg = Debug|ARM {FC9CBB95-624C-4CE8-86A8-3AB5A415AA65}.Debug-Dynamic|ARM.Build.0 = Debug|ARM + {FC9CBB95-624C-4CE8-86A8-3AB5A415AA65}.Debug-Dynamic|ARM64.ActiveCfg = Release|ARM {FC9CBB95-624C-4CE8-86A8-3AB5A415AA65}.Debug-Dynamic|Win32.ActiveCfg = Debug|Win32 {FC9CBB95-624C-4CE8-86A8-3AB5A415AA65}.Debug-Dynamic|Win32.Build.0 = Debug|Win32 {FC9CBB95-624C-4CE8-86A8-3AB5A415AA65}.Debug-Dynamic|x64.ActiveCfg = Debug|x64 @@ -1708,6 +2117,7 @@ {FC9CBB95-624C-4CE8-86A8-3AB5A415AA65}.Debug-Static|Any CPU.Build.0 = Release|x64 {FC9CBB95-624C-4CE8-86A8-3AB5A415AA65}.Debug-Static|ARM.ActiveCfg = Debug|ARM {FC9CBB95-624C-4CE8-86A8-3AB5A415AA65}.Debug-Static|ARM.Build.0 = Debug|ARM + {FC9CBB95-624C-4CE8-86A8-3AB5A415AA65}.Debug-Static|ARM64.ActiveCfg = Release|ARM {FC9CBB95-624C-4CE8-86A8-3AB5A415AA65}.Debug-Static|Win32.ActiveCfg = Debug|Win32 {FC9CBB95-624C-4CE8-86A8-3AB5A415AA65}.Debug-Static|Win32.Build.0 = Debug|Win32 {FC9CBB95-624C-4CE8-86A8-3AB5A415AA65}.Debug-Static|x64.ActiveCfg = Debug|x64 @@ -1715,6 +2125,7 @@ {FC9CBB95-624C-4CE8-86A8-3AB5A415AA65}.Release|Any CPU.ActiveCfg = Release|Win32 {FC9CBB95-624C-4CE8-86A8-3AB5A415AA65}.Release|ARM.ActiveCfg = Release|ARM {FC9CBB95-624C-4CE8-86A8-3AB5A415AA65}.Release|ARM.Build.0 = Release|ARM + {FC9CBB95-624C-4CE8-86A8-3AB5A415AA65}.Release|ARM64.ActiveCfg = Release|Win32 {FC9CBB95-624C-4CE8-86A8-3AB5A415AA65}.Release|Win32.ActiveCfg = Release|Win32 {FC9CBB95-624C-4CE8-86A8-3AB5A415AA65}.Release|Win32.Build.0 = Release|Win32 {FC9CBB95-624C-4CE8-86A8-3AB5A415AA65}.Release|x64.ActiveCfg = Release|x64 @@ -1723,6 +2134,7 @@ {FC9CBB95-624C-4CE8-86A8-3AB5A415AA65}.Release-Dynamic|Any CPU.Build.0 = Release|x64 {FC9CBB95-624C-4CE8-86A8-3AB5A415AA65}.Release-Dynamic|ARM.ActiveCfg = Release|ARM {FC9CBB95-624C-4CE8-86A8-3AB5A415AA65}.Release-Dynamic|ARM.Build.0 = Release|ARM + {FC9CBB95-624C-4CE8-86A8-3AB5A415AA65}.Release-Dynamic|ARM64.ActiveCfg = Release|ARM {FC9CBB95-624C-4CE8-86A8-3AB5A415AA65}.Release-Dynamic|Win32.ActiveCfg = Release|Win32 {FC9CBB95-624C-4CE8-86A8-3AB5A415AA65}.Release-Dynamic|Win32.Build.0 = Release|Win32 {FC9CBB95-624C-4CE8-86A8-3AB5A415AA65}.Release-Dynamic|x64.ActiveCfg = Release|x64 @@ -1731,6 +2143,7 @@ {FC9CBB95-624C-4CE8-86A8-3AB5A415AA65}.Release-Static|Any CPU.Build.0 = Release|x64 {FC9CBB95-624C-4CE8-86A8-3AB5A415AA65}.Release-Static|ARM.ActiveCfg = Release|ARM {FC9CBB95-624C-4CE8-86A8-3AB5A415AA65}.Release-Static|ARM.Build.0 = Release|ARM + {FC9CBB95-624C-4CE8-86A8-3AB5A415AA65}.Release-Static|ARM64.ActiveCfg = Release|ARM {FC9CBB95-624C-4CE8-86A8-3AB5A415AA65}.Release-Static|Win32.ActiveCfg = Release|Win32 {FC9CBB95-624C-4CE8-86A8-3AB5A415AA65}.Release-Static|Win32.Build.0 = Release|Win32 {FC9CBB95-624C-4CE8-86A8-3AB5A415AA65}.Release-Static|x64.ActiveCfg = Release|x64 @@ -1738,6 +2151,7 @@ {016D497F-0EE0-449E-89F5-BD63F7F9A8A6}.Debug|Any CPU.ActiveCfg = Debug|Win32 {016D497F-0EE0-449E-89F5-BD63F7F9A8A6}.Debug|ARM.ActiveCfg = Debug|ARM {016D497F-0EE0-449E-89F5-BD63F7F9A8A6}.Debug|ARM.Build.0 = Debug|ARM + {016D497F-0EE0-449E-89F5-BD63F7F9A8A6}.Debug|ARM64.ActiveCfg = Debug|Win32 {016D497F-0EE0-449E-89F5-BD63F7F9A8A6}.Debug|Win32.ActiveCfg = Debug|Win32 {016D497F-0EE0-449E-89F5-BD63F7F9A8A6}.Debug|Win32.Build.0 = Debug|Win32 {016D497F-0EE0-449E-89F5-BD63F7F9A8A6}.Debug|x64.ActiveCfg = Debug|x64 @@ -1749,6 +2163,7 @@ {016D497F-0EE0-449E-89F5-BD63F7F9A8A6}.Debug-Dynamic|ARM.ActiveCfg = Debug|ARM {016D497F-0EE0-449E-89F5-BD63F7F9A8A6}.Debug-Dynamic|ARM.Build.0 = Debug|ARM {016D497F-0EE0-449E-89F5-BD63F7F9A8A6}.Debug-Dynamic|ARM.Deploy.0 = Debug|ARM + {016D497F-0EE0-449E-89F5-BD63F7F9A8A6}.Debug-Dynamic|ARM64.ActiveCfg = Release|ARM {016D497F-0EE0-449E-89F5-BD63F7F9A8A6}.Debug-Dynamic|Win32.ActiveCfg = Debug|Win32 {016D497F-0EE0-449E-89F5-BD63F7F9A8A6}.Debug-Dynamic|Win32.Build.0 = Debug|Win32 {016D497F-0EE0-449E-89F5-BD63F7F9A8A6}.Debug-Dynamic|Win32.Deploy.0 = Debug|Win32 @@ -1761,6 +2176,7 @@ {016D497F-0EE0-449E-89F5-BD63F7F9A8A6}.Debug-Static|ARM.ActiveCfg = Debug|ARM {016D497F-0EE0-449E-89F5-BD63F7F9A8A6}.Debug-Static|ARM.Build.0 = Debug|ARM {016D497F-0EE0-449E-89F5-BD63F7F9A8A6}.Debug-Static|ARM.Deploy.0 = Debug|ARM + {016D497F-0EE0-449E-89F5-BD63F7F9A8A6}.Debug-Static|ARM64.ActiveCfg = Release|ARM {016D497F-0EE0-449E-89F5-BD63F7F9A8A6}.Debug-Static|Win32.ActiveCfg = Debug|Win32 {016D497F-0EE0-449E-89F5-BD63F7F9A8A6}.Debug-Static|Win32.Build.0 = Debug|Win32 {016D497F-0EE0-449E-89F5-BD63F7F9A8A6}.Debug-Static|Win32.Deploy.0 = Debug|Win32 @@ -1771,6 +2187,7 @@ {016D497F-0EE0-449E-89F5-BD63F7F9A8A6}.Release|ARM.ActiveCfg = Release|ARM {016D497F-0EE0-449E-89F5-BD63F7F9A8A6}.Release|ARM.Build.0 = Release|ARM {016D497F-0EE0-449E-89F5-BD63F7F9A8A6}.Release|ARM.Deploy.0 = Release|ARM + {016D497F-0EE0-449E-89F5-BD63F7F9A8A6}.Release|ARM64.ActiveCfg = Release|Win32 {016D497F-0EE0-449E-89F5-BD63F7F9A8A6}.Release|Win32.ActiveCfg = Release|Win32 {016D497F-0EE0-449E-89F5-BD63F7F9A8A6}.Release|Win32.Build.0 = Release|Win32 {016D497F-0EE0-449E-89F5-BD63F7F9A8A6}.Release|Win32.Deploy.0 = Release|Win32 @@ -1783,6 +2200,7 @@ {016D497F-0EE0-449E-89F5-BD63F7F9A8A6}.Release-Dynamic|ARM.ActiveCfg = Release|ARM {016D497F-0EE0-449E-89F5-BD63F7F9A8A6}.Release-Dynamic|ARM.Build.0 = Release|ARM {016D497F-0EE0-449E-89F5-BD63F7F9A8A6}.Release-Dynamic|ARM.Deploy.0 = Release|ARM + {016D497F-0EE0-449E-89F5-BD63F7F9A8A6}.Release-Dynamic|ARM64.ActiveCfg = Release|ARM {016D497F-0EE0-449E-89F5-BD63F7F9A8A6}.Release-Dynamic|Win32.ActiveCfg = Release|Win32 {016D497F-0EE0-449E-89F5-BD63F7F9A8A6}.Release-Dynamic|Win32.Build.0 = Release|Win32 {016D497F-0EE0-449E-89F5-BD63F7F9A8A6}.Release-Dynamic|Win32.Deploy.0 = Release|Win32 @@ -1795,6 +2213,7 @@ {016D497F-0EE0-449E-89F5-BD63F7F9A8A6}.Release-Static|ARM.ActiveCfg = Release|ARM {016D497F-0EE0-449E-89F5-BD63F7F9A8A6}.Release-Static|ARM.Build.0 = Release|ARM {016D497F-0EE0-449E-89F5-BD63F7F9A8A6}.Release-Static|ARM.Deploy.0 = Release|ARM + {016D497F-0EE0-449E-89F5-BD63F7F9A8A6}.Release-Static|ARM64.ActiveCfg = Release|ARM {016D497F-0EE0-449E-89F5-BD63F7F9A8A6}.Release-Static|Win32.ActiveCfg = Release|Win32 {016D497F-0EE0-449E-89F5-BD63F7F9A8A6}.Release-Static|Win32.Build.0 = Release|Win32 {016D497F-0EE0-449E-89F5-BD63F7F9A8A6}.Release-Static|Win32.Deploy.0 = Release|Win32 @@ -1805,6 +2224,7 @@ {9FDF5E33-D15D-409F-876E-4E77727936B9}.Debug|Any CPU.Build.0 = Debug|Any CPU {9FDF5E33-D15D-409F-876E-4E77727936B9}.Debug|ARM.ActiveCfg = Debug|ARM {9FDF5E33-D15D-409F-876E-4E77727936B9}.Debug|ARM.Build.0 = Debug|ARM + {9FDF5E33-D15D-409F-876E-4E77727936B9}.Debug|ARM64.ActiveCfg = Debug|Any CPU {9FDF5E33-D15D-409F-876E-4E77727936B9}.Debug|Win32.ActiveCfg = Debug|x86 {9FDF5E33-D15D-409F-876E-4E77727936B9}.Debug|Win32.Build.0 = Debug|x86 {9FDF5E33-D15D-409F-876E-4E77727936B9}.Debug|x64.ActiveCfg = Debug|x64 @@ -1813,6 +2233,7 @@ {9FDF5E33-D15D-409F-876E-4E77727936B9}.Debug-Dynamic|Any CPU.Build.0 = Debug|Any CPU {9FDF5E33-D15D-409F-876E-4E77727936B9}.Debug-Dynamic|ARM.ActiveCfg = Debug|ARM {9FDF5E33-D15D-409F-876E-4E77727936B9}.Debug-Dynamic|ARM.Build.0 = Debug|ARM + {9FDF5E33-D15D-409F-876E-4E77727936B9}.Debug-Dynamic|ARM64.ActiveCfg = Debug|Any CPU {9FDF5E33-D15D-409F-876E-4E77727936B9}.Debug-Dynamic|Win32.ActiveCfg = Debug|x86 {9FDF5E33-D15D-409F-876E-4E77727936B9}.Debug-Dynamic|Win32.Build.0 = Debug|x86 {9FDF5E33-D15D-409F-876E-4E77727936B9}.Debug-Dynamic|x64.ActiveCfg = Debug|x64 @@ -1821,6 +2242,7 @@ {9FDF5E33-D15D-409F-876E-4E77727936B9}.Debug-Static|Any CPU.Build.0 = Debug|Any CPU {9FDF5E33-D15D-409F-876E-4E77727936B9}.Debug-Static|ARM.ActiveCfg = Debug|ARM {9FDF5E33-D15D-409F-876E-4E77727936B9}.Debug-Static|ARM.Build.0 = Debug|ARM + {9FDF5E33-D15D-409F-876E-4E77727936B9}.Debug-Static|ARM64.ActiveCfg = Debug|Any CPU {9FDF5E33-D15D-409F-876E-4E77727936B9}.Debug-Static|Win32.ActiveCfg = Debug|x86 {9FDF5E33-D15D-409F-876E-4E77727936B9}.Debug-Static|Win32.Build.0 = Debug|x86 {9FDF5E33-D15D-409F-876E-4E77727936B9}.Debug-Static|x64.ActiveCfg = Debug|x64 @@ -1829,6 +2251,7 @@ {9FDF5E33-D15D-409F-876E-4E77727936B9}.Release|Any CPU.Build.0 = Release|Any CPU {9FDF5E33-D15D-409F-876E-4E77727936B9}.Release|ARM.ActiveCfg = Release|ARM {9FDF5E33-D15D-409F-876E-4E77727936B9}.Release|ARM.Build.0 = Release|ARM + {9FDF5E33-D15D-409F-876E-4E77727936B9}.Release|ARM64.ActiveCfg = Release|Any CPU {9FDF5E33-D15D-409F-876E-4E77727936B9}.Release|Win32.ActiveCfg = Release|x86 {9FDF5E33-D15D-409F-876E-4E77727936B9}.Release|Win32.Build.0 = Release|x86 {9FDF5E33-D15D-409F-876E-4E77727936B9}.Release|x64.ActiveCfg = Release|x64 @@ -1837,6 +2260,7 @@ {9FDF5E33-D15D-409F-876E-4E77727936B9}.Release-Dynamic|Any CPU.Build.0 = Release|Any CPU {9FDF5E33-D15D-409F-876E-4E77727936B9}.Release-Dynamic|ARM.ActiveCfg = Release|ARM {9FDF5E33-D15D-409F-876E-4E77727936B9}.Release-Dynamic|ARM.Build.0 = Release|ARM + {9FDF5E33-D15D-409F-876E-4E77727936B9}.Release-Dynamic|ARM64.ActiveCfg = Release|Any CPU {9FDF5E33-D15D-409F-876E-4E77727936B9}.Release-Dynamic|Win32.ActiveCfg = Release|x86 {9FDF5E33-D15D-409F-876E-4E77727936B9}.Release-Dynamic|Win32.Build.0 = Release|x86 {9FDF5E33-D15D-409F-876E-4E77727936B9}.Release-Dynamic|x64.ActiveCfg = Release|x64 @@ -1845,6 +2269,7 @@ {9FDF5E33-D15D-409F-876E-4E77727936B9}.Release-Static|Any CPU.Build.0 = Release|Any CPU {9FDF5E33-D15D-409F-876E-4E77727936B9}.Release-Static|ARM.ActiveCfg = Release|ARM {9FDF5E33-D15D-409F-876E-4E77727936B9}.Release-Static|ARM.Build.0 = Release|ARM + {9FDF5E33-D15D-409F-876E-4E77727936B9}.Release-Static|ARM64.ActiveCfg = Release|Any CPU {9FDF5E33-D15D-409F-876E-4E77727936B9}.Release-Static|Win32.ActiveCfg = Release|x86 {9FDF5E33-D15D-409F-876E-4E77727936B9}.Release-Static|Win32.Build.0 = Release|x86 {9FDF5E33-D15D-409F-876E-4E77727936B9}.Release-Static|x64.ActiveCfg = Release|x64 @@ -1852,6 +2277,8 @@ {6AC9B65F-0862-4A5C-8A9D-141516993130}.Debug|Any CPU.ActiveCfg = Debug|Win32 {6AC9B65F-0862-4A5C-8A9D-141516993130}.Debug|ARM.ActiveCfg = Debug|ARM {6AC9B65F-0862-4A5C-8A9D-141516993130}.Debug|ARM.Build.0 = Debug|ARM + {6AC9B65F-0862-4A5C-8A9D-141516993130}.Debug|ARM64.ActiveCfg = Debug|ARM64 + {6AC9B65F-0862-4A5C-8A9D-141516993130}.Debug|ARM64.Build.0 = Debug|ARM64 {6AC9B65F-0862-4A5C-8A9D-141516993130}.Debug|Win32.ActiveCfg = Debug|Win32 {6AC9B65F-0862-4A5C-8A9D-141516993130}.Debug|Win32.Build.0 = Debug|Win32 {6AC9B65F-0862-4A5C-8A9D-141516993130}.Debug|x64.ActiveCfg = Debug|x64 @@ -1859,6 +2286,8 @@ {6AC9B65F-0862-4A5C-8A9D-141516993130}.Debug-Dynamic|Any CPU.ActiveCfg = Debug-Dynamic|Win32 {6AC9B65F-0862-4A5C-8A9D-141516993130}.Debug-Dynamic|ARM.ActiveCfg = Debug-Dynamic|ARM {6AC9B65F-0862-4A5C-8A9D-141516993130}.Debug-Dynamic|ARM.Build.0 = Debug-Dynamic|ARM + {6AC9B65F-0862-4A5C-8A9D-141516993130}.Debug-Dynamic|ARM64.ActiveCfg = Debug-Dynamic|ARM64 + {6AC9B65F-0862-4A5C-8A9D-141516993130}.Debug-Dynamic|ARM64.Build.0 = Debug-Dynamic|ARM64 {6AC9B65F-0862-4A5C-8A9D-141516993130}.Debug-Dynamic|Win32.ActiveCfg = Debug-Dynamic|Win32 {6AC9B65F-0862-4A5C-8A9D-141516993130}.Debug-Dynamic|Win32.Build.0 = Debug-Dynamic|Win32 {6AC9B65F-0862-4A5C-8A9D-141516993130}.Debug-Dynamic|x64.ActiveCfg = Debug-Dynamic|x64 @@ -1866,6 +2295,8 @@ {6AC9B65F-0862-4A5C-8A9D-141516993130}.Debug-Static|Any CPU.ActiveCfg = Debug-Static|Win32 {6AC9B65F-0862-4A5C-8A9D-141516993130}.Debug-Static|ARM.ActiveCfg = Debug-Static|ARM {6AC9B65F-0862-4A5C-8A9D-141516993130}.Debug-Static|ARM.Build.0 = Debug-Static|ARM + {6AC9B65F-0862-4A5C-8A9D-141516993130}.Debug-Static|ARM64.ActiveCfg = Debug-Static|ARM64 + {6AC9B65F-0862-4A5C-8A9D-141516993130}.Debug-Static|ARM64.Build.0 = Debug-Static|ARM64 {6AC9B65F-0862-4A5C-8A9D-141516993130}.Debug-Static|Win32.ActiveCfg = Debug-Static|Win32 {6AC9B65F-0862-4A5C-8A9D-141516993130}.Debug-Static|Win32.Build.0 = Debug-Static|Win32 {6AC9B65F-0862-4A5C-8A9D-141516993130}.Debug-Static|x64.ActiveCfg = Debug-Static|x64 @@ -1873,6 +2304,8 @@ {6AC9B65F-0862-4A5C-8A9D-141516993130}.Release|Any CPU.ActiveCfg = Release|Win32 {6AC9B65F-0862-4A5C-8A9D-141516993130}.Release|ARM.ActiveCfg = Release|ARM {6AC9B65F-0862-4A5C-8A9D-141516993130}.Release|ARM.Build.0 = Release|ARM + {6AC9B65F-0862-4A5C-8A9D-141516993130}.Release|ARM64.ActiveCfg = Release|ARM64 + {6AC9B65F-0862-4A5C-8A9D-141516993130}.Release|ARM64.Build.0 = Release|ARM64 {6AC9B65F-0862-4A5C-8A9D-141516993130}.Release|Win32.ActiveCfg = Release|Win32 {6AC9B65F-0862-4A5C-8A9D-141516993130}.Release|Win32.Build.0 = Release|Win32 {6AC9B65F-0862-4A5C-8A9D-141516993130}.Release|x64.ActiveCfg = Release|x64 @@ -1880,6 +2313,8 @@ {6AC9B65F-0862-4A5C-8A9D-141516993130}.Release-Dynamic|Any CPU.ActiveCfg = Release-Dynamic|Win32 {6AC9B65F-0862-4A5C-8A9D-141516993130}.Release-Dynamic|ARM.ActiveCfg = Release-Dynamic|ARM {6AC9B65F-0862-4A5C-8A9D-141516993130}.Release-Dynamic|ARM.Build.0 = Release-Dynamic|ARM + {6AC9B65F-0862-4A5C-8A9D-141516993130}.Release-Dynamic|ARM64.ActiveCfg = Release-Dynamic|ARM64 + {6AC9B65F-0862-4A5C-8A9D-141516993130}.Release-Dynamic|ARM64.Build.0 = Release-Dynamic|ARM64 {6AC9B65F-0862-4A5C-8A9D-141516993130}.Release-Dynamic|Win32.ActiveCfg = Release-Dynamic|Win32 {6AC9B65F-0862-4A5C-8A9D-141516993130}.Release-Dynamic|Win32.Build.0 = Release-Dynamic|Win32 {6AC9B65F-0862-4A5C-8A9D-141516993130}.Release-Dynamic|x64.ActiveCfg = Release-Dynamic|x64 @@ -1887,6 +2322,8 @@ {6AC9B65F-0862-4A5C-8A9D-141516993130}.Release-Static|Any CPU.ActiveCfg = Release-Static|Win32 {6AC9B65F-0862-4A5C-8A9D-141516993130}.Release-Static|ARM.ActiveCfg = Release-Static|ARM {6AC9B65F-0862-4A5C-8A9D-141516993130}.Release-Static|ARM.Build.0 = Release-Static|ARM + {6AC9B65F-0862-4A5C-8A9D-141516993130}.Release-Static|ARM64.ActiveCfg = Release-Static|ARM64 + {6AC9B65F-0862-4A5C-8A9D-141516993130}.Release-Static|ARM64.Build.0 = Release-Static|ARM64 {6AC9B65F-0862-4A5C-8A9D-141516993130}.Release-Static|Win32.ActiveCfg = Release-Static|Win32 {6AC9B65F-0862-4A5C-8A9D-141516993130}.Release-Static|Win32.Build.0 = Release-Static|Win32 {6AC9B65F-0862-4A5C-8A9D-141516993130}.Release-Static|x64.ActiveCfg = Release-Static|x64 @@ -1894,6 +2331,8 @@ {5BCF2773-3825-4D91-9D72-3E2F650DF1DB}.Debug|Any CPU.ActiveCfg = Debug|Win32 {5BCF2773-3825-4D91-9D72-3E2F650DF1DB}.Debug|ARM.ActiveCfg = Debug|ARM {5BCF2773-3825-4D91-9D72-3E2F650DF1DB}.Debug|ARM.Build.0 = Debug|ARM + {5BCF2773-3825-4D91-9D72-3E2F650DF1DB}.Debug|ARM64.ActiveCfg = Debug|ARM64 + {5BCF2773-3825-4D91-9D72-3E2F650DF1DB}.Debug|ARM64.Build.0 = Debug|ARM64 {5BCF2773-3825-4D91-9D72-3E2F650DF1DB}.Debug|Win32.ActiveCfg = Debug|Win32 {5BCF2773-3825-4D91-9D72-3E2F650DF1DB}.Debug|Win32.Build.0 = Debug|Win32 {5BCF2773-3825-4D91-9D72-3E2F650DF1DB}.Debug|x64.ActiveCfg = Debug|x64 @@ -1901,6 +2340,8 @@ {5BCF2773-3825-4D91-9D72-3E2F650DF1DB}.Debug-Dynamic|Any CPU.ActiveCfg = Debug-Dynamic|Win32 {5BCF2773-3825-4D91-9D72-3E2F650DF1DB}.Debug-Dynamic|ARM.ActiveCfg = Debug-Dynamic|ARM {5BCF2773-3825-4D91-9D72-3E2F650DF1DB}.Debug-Dynamic|ARM.Build.0 = Debug-Dynamic|ARM + {5BCF2773-3825-4D91-9D72-3E2F650DF1DB}.Debug-Dynamic|ARM64.ActiveCfg = Debug-Dynamic|ARM64 + {5BCF2773-3825-4D91-9D72-3E2F650DF1DB}.Debug-Dynamic|ARM64.Build.0 = Debug-Dynamic|ARM64 {5BCF2773-3825-4D91-9D72-3E2F650DF1DB}.Debug-Dynamic|Win32.ActiveCfg = Debug-Dynamic|Win32 {5BCF2773-3825-4D91-9D72-3E2F650DF1DB}.Debug-Dynamic|Win32.Build.0 = Debug-Dynamic|Win32 {5BCF2773-3825-4D91-9D72-3E2F650DF1DB}.Debug-Dynamic|x64.ActiveCfg = Debug-Dynamic|x64 @@ -1908,6 +2349,8 @@ {5BCF2773-3825-4D91-9D72-3E2F650DF1DB}.Debug-Static|Any CPU.ActiveCfg = Debug-Static|Win32 {5BCF2773-3825-4D91-9D72-3E2F650DF1DB}.Debug-Static|ARM.ActiveCfg = Debug-Static|ARM {5BCF2773-3825-4D91-9D72-3E2F650DF1DB}.Debug-Static|ARM.Build.0 = Debug-Static|ARM + {5BCF2773-3825-4D91-9D72-3E2F650DF1DB}.Debug-Static|ARM64.ActiveCfg = Debug-Static|ARM64 + {5BCF2773-3825-4D91-9D72-3E2F650DF1DB}.Debug-Static|ARM64.Build.0 = Debug-Static|ARM64 {5BCF2773-3825-4D91-9D72-3E2F650DF1DB}.Debug-Static|Win32.ActiveCfg = Debug-Static|Win32 {5BCF2773-3825-4D91-9D72-3E2F650DF1DB}.Debug-Static|Win32.Build.0 = Debug-Static|Win32 {5BCF2773-3825-4D91-9D72-3E2F650DF1DB}.Debug-Static|x64.ActiveCfg = Debug-Static|x64 @@ -1915,6 +2358,8 @@ {5BCF2773-3825-4D91-9D72-3E2F650DF1DB}.Release|Any CPU.ActiveCfg = Release|Win32 {5BCF2773-3825-4D91-9D72-3E2F650DF1DB}.Release|ARM.ActiveCfg = Release|ARM {5BCF2773-3825-4D91-9D72-3E2F650DF1DB}.Release|ARM.Build.0 = Release|ARM + {5BCF2773-3825-4D91-9D72-3E2F650DF1DB}.Release|ARM64.ActiveCfg = Release|ARM64 + {5BCF2773-3825-4D91-9D72-3E2F650DF1DB}.Release|ARM64.Build.0 = Release|ARM64 {5BCF2773-3825-4D91-9D72-3E2F650DF1DB}.Release|Win32.ActiveCfg = Release|Win32 {5BCF2773-3825-4D91-9D72-3E2F650DF1DB}.Release|Win32.Build.0 = Release|Win32 {5BCF2773-3825-4D91-9D72-3E2F650DF1DB}.Release|x64.ActiveCfg = Release|x64 @@ -1922,6 +2367,8 @@ {5BCF2773-3825-4D91-9D72-3E2F650DF1DB}.Release-Dynamic|Any CPU.ActiveCfg = Release-Dynamic|Win32 {5BCF2773-3825-4D91-9D72-3E2F650DF1DB}.Release-Dynamic|ARM.ActiveCfg = Release-Dynamic|ARM {5BCF2773-3825-4D91-9D72-3E2F650DF1DB}.Release-Dynamic|ARM.Build.0 = Release-Dynamic|ARM + {5BCF2773-3825-4D91-9D72-3E2F650DF1DB}.Release-Dynamic|ARM64.ActiveCfg = Release-Dynamic|ARM64 + {5BCF2773-3825-4D91-9D72-3E2F650DF1DB}.Release-Dynamic|ARM64.Build.0 = Release-Dynamic|ARM64 {5BCF2773-3825-4D91-9D72-3E2F650DF1DB}.Release-Dynamic|Win32.ActiveCfg = Release-Dynamic|Win32 {5BCF2773-3825-4D91-9D72-3E2F650DF1DB}.Release-Dynamic|Win32.Build.0 = Release-Dynamic|Win32 {5BCF2773-3825-4D91-9D72-3E2F650DF1DB}.Release-Dynamic|x64.ActiveCfg = Release-Dynamic|x64 @@ -1929,34 +2376,76 @@ {5BCF2773-3825-4D91-9D72-3E2F650DF1DB}.Release-Static|Any CPU.ActiveCfg = Release-Static|Win32 {5BCF2773-3825-4D91-9D72-3E2F650DF1DB}.Release-Static|ARM.ActiveCfg = Release-Static|ARM {5BCF2773-3825-4D91-9D72-3E2F650DF1DB}.Release-Static|ARM.Build.0 = Release-Static|ARM + {5BCF2773-3825-4D91-9D72-3E2F650DF1DB}.Release-Static|ARM64.ActiveCfg = Release-Static|ARM64 + {5BCF2773-3825-4D91-9D72-3E2F650DF1DB}.Release-Static|ARM64.Build.0 = Release-Static|ARM64 {5BCF2773-3825-4D91-9D72-3E2F650DF1DB}.Release-Static|Win32.ActiveCfg = Release-Static|Win32 {5BCF2773-3825-4D91-9D72-3E2F650DF1DB}.Release-Static|Win32.Build.0 = Release-Static|Win32 {5BCF2773-3825-4D91-9D72-3E2F650DF1DB}.Release-Static|x64.ActiveCfg = Release-Static|x64 {5BCF2773-3825-4D91-9D72-3E2F650DF1DB}.Release-Static|x64.Build.0 = Release-Static|x64 {63AC6D7A-5D97-40C2-9AF2-E13AA1F9567C}.Debug|Any CPU.ActiveCfg = Debug|Win32 {63AC6D7A-5D97-40C2-9AF2-E13AA1F9567C}.Debug|ARM.ActiveCfg = Debug|Win32 + {63AC6D7A-5D97-40C2-9AF2-E13AA1F9567C}.Debug|ARM64.ActiveCfg = Debug|ARM64 {63AC6D7A-5D97-40C2-9AF2-E13AA1F9567C}.Debug|Win32.ActiveCfg = Debug|Win32 {63AC6D7A-5D97-40C2-9AF2-E13AA1F9567C}.Debug|x64.ActiveCfg = Debug|x64 {63AC6D7A-5D97-40C2-9AF2-E13AA1F9567C}.Debug-Dynamic|Any CPU.ActiveCfg = Debug|Win32 {63AC6D7A-5D97-40C2-9AF2-E13AA1F9567C}.Debug-Dynamic|ARM.ActiveCfg = Debug|Win32 + {63AC6D7A-5D97-40C2-9AF2-E13AA1F9567C}.Debug-Dynamic|ARM64.ActiveCfg = Debug|ARM64 + {63AC6D7A-5D97-40C2-9AF2-E13AA1F9567C}.Debug-Dynamic|ARM64.Build.0 = Debug|ARM64 {63AC6D7A-5D97-40C2-9AF2-E13AA1F9567C}.Debug-Dynamic|Win32.ActiveCfg = Debug|Win32 {63AC6D7A-5D97-40C2-9AF2-E13AA1F9567C}.Debug-Dynamic|x64.ActiveCfg = Debug|x64 {63AC6D7A-5D97-40C2-9AF2-E13AA1F9567C}.Debug-Static|Any CPU.ActiveCfg = Debug|Win32 {63AC6D7A-5D97-40C2-9AF2-E13AA1F9567C}.Debug-Static|ARM.ActiveCfg = Debug|Win32 + {63AC6D7A-5D97-40C2-9AF2-E13AA1F9567C}.Debug-Static|ARM64.ActiveCfg = Debug|ARM64 + {63AC6D7A-5D97-40C2-9AF2-E13AA1F9567C}.Debug-Static|ARM64.Build.0 = Debug|ARM64 {63AC6D7A-5D97-40C2-9AF2-E13AA1F9567C}.Debug-Static|Win32.ActiveCfg = Debug|Win32 {63AC6D7A-5D97-40C2-9AF2-E13AA1F9567C}.Debug-Static|x64.ActiveCfg = Debug|x64 {63AC6D7A-5D97-40C2-9AF2-E13AA1F9567C}.Release|Any CPU.ActiveCfg = Release|Win32 {63AC6D7A-5D97-40C2-9AF2-E13AA1F9567C}.Release|ARM.ActiveCfg = Release|Win32 + {63AC6D7A-5D97-40C2-9AF2-E13AA1F9567C}.Release|ARM64.ActiveCfg = Release|ARM64 {63AC6D7A-5D97-40C2-9AF2-E13AA1F9567C}.Release|Win32.ActiveCfg = Release|Win32 {63AC6D7A-5D97-40C2-9AF2-E13AA1F9567C}.Release|x64.ActiveCfg = Release|x64 {63AC6D7A-5D97-40C2-9AF2-E13AA1F9567C}.Release-Dynamic|Any CPU.ActiveCfg = Release|Win32 {63AC6D7A-5D97-40C2-9AF2-E13AA1F9567C}.Release-Dynamic|ARM.ActiveCfg = Release|Win32 + {63AC6D7A-5D97-40C2-9AF2-E13AA1F9567C}.Release-Dynamic|ARM64.ActiveCfg = Release|ARM64 + {63AC6D7A-5D97-40C2-9AF2-E13AA1F9567C}.Release-Dynamic|ARM64.Build.0 = Release|ARM64 {63AC6D7A-5D97-40C2-9AF2-E13AA1F9567C}.Release-Dynamic|Win32.ActiveCfg = Release|Win32 {63AC6D7A-5D97-40C2-9AF2-E13AA1F9567C}.Release-Dynamic|x64.ActiveCfg = Release|x64 {63AC6D7A-5D97-40C2-9AF2-E13AA1F9567C}.Release-Static|Any CPU.ActiveCfg = Release|Win32 {63AC6D7A-5D97-40C2-9AF2-E13AA1F9567C}.Release-Static|ARM.ActiveCfg = Release|Win32 + {63AC6D7A-5D97-40C2-9AF2-E13AA1F9567C}.Release-Static|ARM64.ActiveCfg = Release|ARM64 + {63AC6D7A-5D97-40C2-9AF2-E13AA1F9567C}.Release-Static|ARM64.Build.0 = Release|ARM64 {63AC6D7A-5D97-40C2-9AF2-E13AA1F9567C}.Release-Static|Win32.ActiveCfg = Release|Win32 {63AC6D7A-5D97-40C2-9AF2-E13AA1F9567C}.Release-Static|x64.ActiveCfg = Release|x64 + {D738A812-CE37-40A4-B2FA-D81488C12C87}.Debug|Any CPU.ActiveCfg = Debug|Win32 + {D738A812-CE37-40A4-B2FA-D81488C12C87}.Debug|ARM.ActiveCfg = Debug|ARM + {D738A812-CE37-40A4-B2FA-D81488C12C87}.Debug|ARM64.ActiveCfg = Debug|ARM64 + {D738A812-CE37-40A4-B2FA-D81488C12C87}.Debug|Win32.ActiveCfg = Debug|Win32 + {D738A812-CE37-40A4-B2FA-D81488C12C87}.Debug|x64.ActiveCfg = Debug|x64 + {D738A812-CE37-40A4-B2FA-D81488C12C87}.Debug-Dynamic|Any CPU.ActiveCfg = Debug-Dynamic|Win32 + {D738A812-CE37-40A4-B2FA-D81488C12C87}.Debug-Dynamic|ARM.ActiveCfg = Debug-Dynamic|ARM + {D738A812-CE37-40A4-B2FA-D81488C12C87}.Debug-Dynamic|ARM64.ActiveCfg = Debug-Dynamic|ARM64 + {D738A812-CE37-40A4-B2FA-D81488C12C87}.Debug-Dynamic|Win32.ActiveCfg = Debug-Dynamic|Win32 + {D738A812-CE37-40A4-B2FA-D81488C12C87}.Debug-Dynamic|x64.ActiveCfg = Debug-Dynamic|x64 + {D738A812-CE37-40A4-B2FA-D81488C12C87}.Debug-Static|Any CPU.ActiveCfg = Debug-Static|Win32 + {D738A812-CE37-40A4-B2FA-D81488C12C87}.Debug-Static|ARM.ActiveCfg = Debug-Static|ARM + {D738A812-CE37-40A4-B2FA-D81488C12C87}.Debug-Static|ARM64.ActiveCfg = Debug-Static|ARM64 + {D738A812-CE37-40A4-B2FA-D81488C12C87}.Debug-Static|Win32.ActiveCfg = Debug-Static|Win32 + {D738A812-CE37-40A4-B2FA-D81488C12C87}.Debug-Static|x64.ActiveCfg = Debug-Static|x64 + {D738A812-CE37-40A4-B2FA-D81488C12C87}.Release|Any CPU.ActiveCfg = Release|Win32 + {D738A812-CE37-40A4-B2FA-D81488C12C87}.Release|ARM.ActiveCfg = Release|ARM + {D738A812-CE37-40A4-B2FA-D81488C12C87}.Release|ARM64.ActiveCfg = Release|ARM64 + {D738A812-CE37-40A4-B2FA-D81488C12C87}.Release|Win32.ActiveCfg = Release|Win32 + {D738A812-CE37-40A4-B2FA-D81488C12C87}.Release|x64.ActiveCfg = Release|x64 + {D738A812-CE37-40A4-B2FA-D81488C12C87}.Release-Dynamic|Any CPU.ActiveCfg = Release-Dynamic|Win32 + {D738A812-CE37-40A4-B2FA-D81488C12C87}.Release-Dynamic|ARM.ActiveCfg = Release-Dynamic|ARM + {D738A812-CE37-40A4-B2FA-D81488C12C87}.Release-Dynamic|ARM64.ActiveCfg = Release-Dynamic|ARM64 + {D738A812-CE37-40A4-B2FA-D81488C12C87}.Release-Dynamic|Win32.ActiveCfg = Release-Dynamic|Win32 + {D738A812-CE37-40A4-B2FA-D81488C12C87}.Release-Dynamic|x64.ActiveCfg = Release-Dynamic|x64 + {D738A812-CE37-40A4-B2FA-D81488C12C87}.Release-Static|Any CPU.ActiveCfg = Release-Static|Win32 + {D738A812-CE37-40A4-B2FA-D81488C12C87}.Release-Static|ARM.ActiveCfg = Release-Static|ARM + {D738A812-CE37-40A4-B2FA-D81488C12C87}.Release-Static|ARM64.ActiveCfg = Release-Static|ARM64 + {D738A812-CE37-40A4-B2FA-D81488C12C87}.Release-Static|Win32.ActiveCfg = Release-Static|Win32 + {D738A812-CE37-40A4-B2FA-D81488C12C87}.Release-Static|x64.ActiveCfg = Release-Static|x64 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -1973,4 +2462,7 @@ {016D497F-0EE0-449E-89F5-BD63F7F9A8A6} = {87D83489-039E-4123-BE01-CB62EE932A29} {9FDF5E33-D15D-409F-876E-4E77727936B9} = {87D83489-039E-4123-BE01-CB62EE932A29} EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {9D1363FE-B481-479E-82A2-290F6C4DB91B} + EndGlobalSection EndGlobal diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip/build/Makefile asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip/build/Makefile --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip/build/Makefile 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip/build/Makefile 2022-02-24 07:54:38.000000000 +0000 @@ -163,7 +163,7 @@ export PJSUA2_TEST_OBJS += $(OS_OBJS) $(M_OBJS) $(CC_OBJS) $(HOST_OBJS) \ main.o export PJSUA2_TEST_CFLAGS += $(_CFLAGS) $(PJ_VIDEO_CFLAGS) -export PJSUA2_TEST_CXXFLAGS = $(_CXXFLAGS) $(PJSUA2_LIB_CFLAGS) +export PJSUA2_TEST_CXXFLAGS = $(_CXXFLAGS) $(PJSUA2_LIB_CFLAGS) $(PJ_VIDEO_CFLAGS) export PJSUA2_TEST_LDFLAGS += $(PJ_LDXXFLAGS) $(PJ_LDXXLIBS) $(LDFLAGS) ifeq ($(EXCLUDE_APP),0) export PJSUA2_TEST_EXE := pjsua2-test-$(TARGET_NAME)$(HOST_EXE) @@ -182,7 +182,7 @@ tsx_basic_test.o tsx_bench.o tsx_uac_test.o \ tsx_uas_test.o txdata_test.o uri_test.o \ inv_offer_answer_test.o -export TEST_CFLAGS += $(_CFLAGS) +export TEST_CFLAGS += $(_CFLAGS) $(PJ_VIDEO_CFLAGS) export TEST_CXXFLAGS += $(_CXXFLAGS) export TEST_LDFLAGS += $(PJSIP_LDLIB) \ $(PJSIP_UA_LDLIB) \ @@ -208,9 +208,13 @@ TARGETS := $(PJSIP_LIB) $(PJSIP_SONAME) \ $(PJSIP_SIMPLE_LIB) $(PJSIP_SIMPLE_SONAME) \ $(PJSIP_UA_LIB) $(PJSIP_UA_SONAME) \ - $(PJSUA_LIB_LIB) $(PJSUA_LIB_SONAME) \ - $(PJSUA2_LIB_LIB) $(PJSUA2_LIB_SONAME) -TARGETS_EXE := $(TEST_EXE) $(PJSUA2_TEST_EXE) + $(PJSUA_LIB_LIB) $(PJSUA_LIB_SONAME) +TARGETS_EXE := $(TEST_EXE) + +ifeq ($(PJ_EXCLUDE_PJSUA2),) +TARGETS += $(PJSUA2_LIB_LIB) $(PJSUA2_LIB_SONAME) +TARGETS_EXE += $(PJSUA2_TEST_EXE) +endif all: $(TARGETS) $(TARGETS_EXE) @@ -262,7 +266,7 @@ pjsua2-lib: $(PJSUA2_LIB_LIB) $(PJSUA2_LIB_SONAME): $(PJSUA2_LIB_LIB) -$(PJSUA2_LIB_LIB) $(PJSUA2_LIB_SONAME): $(PJSUA_LIB) $(PSJUA_LIB_SONAME) $(PJSIP_LIB) $(PJSIP_SONAME) $(PJSIP_SIMPLE_LIB) $(PJSIP_SIMPLE_SONAME) $(PJSIP_UA_LIB) $(PJSIP_UA_SONAME) +$(PJSUA2_LIB_LIB) $(PJSUA2_LIB_SONAME): $(PJSUA_LIB_LIB) $(PJSUA_LIB_SONAME) $(PJSIP_LIB) $(PJSIP_SONAME) $(PJSIP_SIMPLE_LIB) $(PJSIP_SIMPLE_SONAME) $(PJSIP_UA_LIB) $(PJSIP_UA_SONAME) $(MAKE) -f $(RULES_MAK) APP=PJSUA2_LIB app=pjsua2-lib $(subst /,$(HOST_PSEP),$(LIBDIR)/$@) pjsip-test: $(TEST_EXE) diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip/build/pjsip_core.vcxproj asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip/build/pjsip_core.vcxproj --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip/build/pjsip_core.vcxproj 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip/build/pjsip_core.vcxproj 2022-02-24 07:54:38.000000000 +0000 @@ -5,6 +5,10 @@ Debug-Dynamic ARM + + Debug-Dynamic + ARM64 + Debug-Dynamic Win32 @@ -17,6 +21,10 @@ Debug-Static ARM + + Debug-Static + ARM64 + Debug-Static Win32 @@ -29,6 +37,10 @@ Debug ARM + + Debug + ARM64 + Debug Win32 @@ -41,6 +53,10 @@ Release-Dynamic ARM + + Release-Dynamic + ARM64 + Release-Dynamic Win32 @@ -53,6 +69,10 @@ Release-Static ARM + + Release-Static + ARM64 + Release-Static Win32 @@ -65,6 +85,10 @@ Release ARM + + Release + ARM64 + Release Win32 @@ -78,7 +102,7 @@ {2BB84911-C1B4-4747-B93D-36AA82CC5031} - pjsip_core + pjsip_core en-US @@ -161,41 +185,78 @@ false MultiByte + + StaticLibrary + v140 + false + MultiByte + StaticLibrary v140 false MultiByte + + StaticLibrary + v140 + false + MultiByte + StaticLibrary v140 false MultiByte + + StaticLibrary + v140 + false + MultiByte + StaticLibrary v140 false MultiByte + + StaticLibrary + v140 + false + MultiByte + StaticLibrary v140 false MultiByte + + StaticLibrary + v140 + false + MultiByte + StaticLibrary v140 false MultiByte + + StaticLibrary + v140 + false + MultiByte + $(BuildToolset) - - + + + @@ -264,31 +325,61 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>14.0.22823.1 @@ -334,6 +425,18 @@ ..\lib\pjsip-core-$(TargetCPU)-$(Platform)-vc$(VSVer)-$(Configuration).lib + + + + ../include;../../pjlib/include;../../pjlib-util/include;%(AdditionalIncludeDirectories) + _LIB;%(PreprocessorDefinitions) + + + + + ..\lib\pjsip-core-$(TargetCPU)-$(Platform)-vc$(VSVer)-$(Configuration).lib + + ../include;../../pjlib/include;../../pjlib-util/include;%(AdditionalIncludeDirectories) @@ -369,6 +472,19 @@ ..\lib\pjsip-core-$(TargetCPU)-$(Platform)-vc$(VSVer)-$(Configuration).lib + + + + ../include;../../pjlib/include;../../pjlib-util/include;%(AdditionalIncludeDirectories) + _LIB;%(PreprocessorDefinitions) + + + ProgramDatabase + + + ..\lib\pjsip-core-$(TargetCPU)-$(Platform)-vc$(VSVer)-$(Configuration).lib + + ../include;../../pjlib/include;../../pjlib-util/include;%(AdditionalIncludeDirectories) @@ -404,6 +520,19 @@ ..\lib\pjsip-core-$(TargetCPU)-$(Platform)-vc$(VSVer)-$(Configuration).lib + + + + ../include;../../pjlib/include;../../pjlib-util/include;%(AdditionalIncludeDirectories) + _LIB;%(PreprocessorDefinitions) + + + ProgramDatabase + + + ..\lib\pjsip-core-$(TargetCPU)-$(Platform)-vc$(VSVer)-$(Configuration).lib + + ../include;../../pjlib/include;../../pjlib-util/include;%(AdditionalIncludeDirectories) @@ -438,6 +567,18 @@ ..\lib\pjsip-core-$(TargetCPU)-$(Platform)-vc$(VSVer)-$(Configuration).lib + + + + ../include;../../pjlib/include;../../pjlib-util/include;%(AdditionalIncludeDirectories) + _LIB;%(PreprocessorDefinitions) + + + + + ..\lib\pjsip-core-$(TargetCPU)-$(Platform)-vc$(VSVer)-$(Configuration).lib + + ../include;../../pjlib/include;../../pjlib-util/include;%(AdditionalIncludeDirectories) @@ -473,6 +614,19 @@ ..\lib\pjsip-core-$(TargetCPU)-$(Platform)-vc$(VSVer)-$(Configuration).lib + + + + ../include;../../pjlib/include;../../pjlib-util/include;%(AdditionalIncludeDirectories) + _LIB;%(PreprocessorDefinitions) + + + ProgramDatabase + + + ..\lib\pjsip-core-$(TargetCPU)-$(Platform)-vc$(VSVer)-$(Configuration).lib + + ../include;../../pjlib/include;../../pjlib-util/include;%(AdditionalIncludeDirectories) @@ -505,6 +659,18 @@ ..\lib\pjsip-core-$(TargetCPU)-$(Platform)-vc$(VSVer)-$(Configuration).lib + + + + + + ../include;../../pjlib/include;../../pjlib-util/include;%(AdditionalIncludeDirectories) + _LIB;%(PreprocessorDefinitions) + + + + + ..\lib\pjsip-core-$(TargetCPU)-$(Platform)-vc$(VSVer)-$(Configuration).lib diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip/build/pjsip_core.vcxproj.filters asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip/build/pjsip_core.vcxproj.filters --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip/build/pjsip_core.vcxproj.filters 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip/build/pjsip_core.vcxproj.filters 2022-02-24 07:54:38.000000000 +0000 @@ -223,6 +223,5 @@ - \ No newline at end of file diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip/build/pjsip_simple.vcxproj asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip/build/pjsip_simple.vcxproj --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip/build/pjsip_simple.vcxproj 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip/build/pjsip_simple.vcxproj 2022-02-24 07:54:38.000000000 +0000 @@ -5,6 +5,10 @@ Debug-Dynamic ARM + + Debug-Dynamic + ARM64 + Debug-Dynamic Win32 @@ -17,6 +21,10 @@ Debug-Static ARM + + Debug-Static + ARM64 + Debug-Static Win32 @@ -29,6 +37,10 @@ Debug ARM + + Debug + ARM64 + Debug Win32 @@ -41,6 +53,10 @@ Release-Dynamic ARM + + Release-Dynamic + ARM64 + Release-Dynamic Win32 @@ -53,6 +69,10 @@ Release-Static ARM + + Release-Static + ARM64 + Release-Static Win32 @@ -65,6 +85,10 @@ Release ARM + + Release + ARM64 + Release Win32 @@ -161,41 +185,78 @@ false MultiByte + + StaticLibrary + v140 + false + MultiByte + StaticLibrary v140 false MultiByte + + StaticLibrary + v140 + false + MultiByte + StaticLibrary v140 false MultiByte + + StaticLibrary + v140 + false + MultiByte + StaticLibrary v140 false MultiByte + + StaticLibrary + v140 + false + MultiByte + StaticLibrary v140 false MultiByte + + StaticLibrary + v140 + false + MultiByte + StaticLibrary v140 false MultiByte + + StaticLibrary + v140 + false + MultiByte + $(BuildToolset) - - + + + @@ -264,31 +325,61 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>14.0.22823.1 @@ -335,6 +426,19 @@ ..\lib\pjsip-simple-$(TargetCPU)-$(Platform)-vc$(VSVer)-$(Configuration).lib + + + + ../include;../../pjlib-util/include;../../pjlib/include;%(AdditionalIncludeDirectories) + _LIB;%(PreprocessorDefinitions) + + + ProgramDatabase + + + ..\lib\pjsip-simple-$(TargetCPU)-$(Platform)-vc$(VSVer)-$(Configuration).lib + + ../include;../../pjlib-util/include;../../pjlib/include;%(AdditionalIncludeDirectories) @@ -369,6 +473,18 @@ ..\lib\pjsip-simple-$(TargetCPU)-$(Platform)-vc$(VSVer)-$(Configuration).lib + + + + ../include;../../pjlib-util/include;../../pjlib/include;%(AdditionalIncludeDirectories) + _LIB;%(PreprocessorDefinitions) + + + + + ..\lib\pjsip-simple-$(TargetCPU)-$(Platform)-vc$(VSVer)-$(Configuration).lib + + ../include;../../pjlib-util/include;../../pjlib/include;%(AdditionalIncludeDirectories) @@ -404,6 +520,19 @@ ..\lib\pjsip-simple-$(TargetCPU)-$(Platform)-vc$(VSVer)-$(Configuration).lib + + + + ../include;../../pjlib-util/include;../../pjlib/include;%(AdditionalIncludeDirectories) + _LIB;%(PreprocessorDefinitions) + + + ProgramDatabase + + + ..\lib\pjsip-simple-$(TargetCPU)-$(Platform)-vc$(VSVer)-$(Configuration).lib + + ../include;../../pjlib-util/include;../../pjlib/include;%(AdditionalIncludeDirectories) @@ -438,6 +567,18 @@ ..\lib\pjsip-simple-$(TargetCPU)-$(Platform)-vc$(VSVer)-$(Configuration).lib + + + + ../include;../../pjlib-util/include;../../pjlib/include;%(AdditionalIncludeDirectories) + _LIB;%(PreprocessorDefinitions) + + + + + ..\lib\pjsip-simple-$(TargetCPU)-$(Platform)-vc$(VSVer)-$(Configuration).lib + + ../include;../../pjlib-util/include;../../pjlib/include;%(AdditionalIncludeDirectories) @@ -473,6 +614,19 @@ ..\lib\pjsip-simple-$(TargetCPU)-$(Platform)-vc$(VSVer)-$(Configuration).lib + + + + ../include;../../pjlib-util/include;../../pjlib/include;%(AdditionalIncludeDirectories) + _LIB;%(PreprocessorDefinitions) + + + ProgramDatabase + + + ..\lib\pjsip-simple-$(TargetCPU)-$(Platform)-vc$(VSVer)-$(Configuration).lib + + ../include;../../pjlib-util/include;../../pjlib/include;%(AdditionalIncludeDirectories) @@ -505,6 +659,18 @@ ..\lib\pjsip-simple-$(TargetCPU)-$(Platform)-vc$(VSVer)-$(Configuration).lib + + + + + + ../include;../../pjlib-util/include;../../pjlib/include;%(AdditionalIncludeDirectories) + _LIB;%(PreprocessorDefinitions) + + + + + ..\lib\pjsip-simple-$(TargetCPU)-$(Platform)-vc$(VSVer)-$(Configuration).lib diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip/build/pjsip_test.vcxproj asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip/build/pjsip_test.vcxproj --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip/build/pjsip_test.vcxproj 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip/build/pjsip_test.vcxproj 2022-02-24 07:54:38.000000000 +0000 @@ -1,6 +1,10 @@  + + Debug-Dynamic + ARM64 + Debug-Dynamic Win32 @@ -9,6 +13,10 @@ Debug-Dynamic x64 + + Debug-Static + ARM64 + Debug-Static Win32 @@ -17,6 +25,10 @@ Debug-Static x64 + + Debug + ARM64 + Debug Win32 @@ -25,6 +37,10 @@ Debug x64 + + Release-Dynamic + ARM64 + Release-Dynamic Win32 @@ -33,6 +49,10 @@ Release-Dynamic x64 + + Release-Static + ARM64 + Release-Static Win32 @@ -41,6 +61,10 @@ Release-Static x64 + + Release + ARM64 + Release Win32 @@ -101,40 +125,77 @@ false MultiByte + + Application + v140 + false + MultiByte + Application v140 false MultiByte + + Application + v140 + false + MultiByte + Application v140 false MultiByte + + Application + v140 + false + MultiByte + Application v140 false MultiByte + + Application + v140 + false + MultiByte + Application v140 false MultiByte + + Application + v140 + false + MultiByte + Application v140 false MultiByte + + Application + v140 + false + MultiByte + $(BuildToolset) - + + Application StaticLibrary @@ -143,68 +204,98 @@ - - + + - - + + - - + + - - + + - - + + - - + + - - + + + + + + + - - + + + + + + + - - + + + + + + + - - + + + + + + + - - + + + + + + + - - + + + + + + + - <_ProjectFileVersion>14.0.22823.1 - pjsip-test-$(TargetCPU)-$(Platform)-vc$(VSVer)-$(Configuration) + <_ProjectFileVersion>14.0.22823.1 + pjsip-test-$(TargetCPU)-$(Platform)-vc$(VSVer)-$(Configuration) @@ -241,6 +332,19 @@ MachineX64 + + + + ../include;../../pjlib/include;../../pjlib-util/include;../../pjmedia/include;%(AdditionalIncludeDirectories) + _CONSOLE;%(PreprocessorDefinitions) + + + + + dsound.lib;dxguid.lib;netapi32.lib;mswsock.lib;ws2_32.lib;odbc32.lib;odbccp32.lib;ole32.lib;%(AdditionalDependencies) + ..\bin\pjsip-test-$(TargetCPU)-$(Platform)-vc$(VSVer)-$(Configuration).exe + + ../include;../../pjlib/include;../../pjlib-util/include;../../pjmedia/include;%(AdditionalIncludeDirectories) @@ -268,6 +372,20 @@ MachineX64 + + + + ../include;../../pjlib/include;../../pjlib-util/include;../../pjmedia/include;%(AdditionalIncludeDirectories) + _CONSOLE;%(PreprocessorDefinitions) + + + ProgramDatabase + + + dsound.lib;dxguid.lib;netapi32.lib;mswsock.lib;ws2_32.lib;odbc32.lib;odbccp32.lib;ole32.lib;%(AdditionalDependencies) + ..\bin\pjsip-test-$(TargetCPU)-$(Platform)-vc$(VSVer)-$(Configuration).exe + + ../include;../../pjlib/include;../../pjlib-util/include;../../pjmedia/include;%(AdditionalIncludeDirectories) @@ -295,6 +413,20 @@ MachineX64 + + + + ../include;../../pjlib/include;../../pjlib-util/include;../../pjmedia/include;%(AdditionalIncludeDirectories) + _CONSOLE;%(PreprocessorDefinitions) + + + ProgramDatabase + + + dsound.lib;dxguid.lib;netapi32.lib;mswsock.lib;ws2_32.lib;odbc32.lib;odbccp32.lib;ole32.lib;%(AdditionalDependencies) + ..\bin\pjsip-test-$(TargetCPU)-$(Platform)-vc$(VSVer)-$(Configuration).exe + + ../include;../../pjlib/include;../../pjlib-util/include;../../pjmedia/include;%(AdditionalIncludeDirectories) @@ -321,6 +453,19 @@ MachineX64 + + + + ../include;../../pjlib/include;../../pjlib-util/include;../../pjmedia/include;%(AdditionalIncludeDirectories) + _CONSOLE;%(PreprocessorDefinitions) + + + + + dsound.lib;dxguid.lib;netapi32.lib;mswsock.lib;ws2_32.lib;odbc32.lib;odbccp32.lib;ole32.lib;%(AdditionalDependencies) + ..\bin\pjsip-test-$(TargetCPU)-$(Platform)-vc$(VSVer)-$(Configuration).exe + + ../include;../../pjlib/include;../../pjlib-util/include;../../pjmedia/include;%(AdditionalIncludeDirectories) @@ -348,6 +493,20 @@ MachineX64 + + + + ../include;../../pjlib/include;../../pjlib-util/include;../../pjmedia/include;%(AdditionalIncludeDirectories) + _CONSOLE;%(PreprocessorDefinitions) + + + ProgramDatabase + + + dsound.lib;dxguid.lib;netapi32.lib;mswsock.lib;ws2_32.lib;odbc32.lib;odbccp32.lib;ole32.lib;%(AdditionalDependencies) + ..\bin\pjsip-test-$(TargetCPU)-$(Platform)-vc$(VSVer)-$(Configuration).exe + + ../include;../../pjlib/include;../../pjlib-util/include;../../pjmedia/include;%(AdditionalIncludeDirectories) @@ -374,6 +533,19 @@ MachineX64 + + + + ../include;../../pjlib/include;../../pjlib-util/include;../../pjmedia/include;%(AdditionalIncludeDirectories) + _CONSOLE;%(PreprocessorDefinitions) + + + + + dsound.lib;dxguid.lib;netapi32.lib;mswsock.lib;ws2_32.lib;odbc32.lib;odbccp32.lib;ole32.lib;%(AdditionalDependencies) + ..\bin\pjsip-test-$(TargetCPU)-$(Platform)-vc$(VSVer)-$(Configuration).exe + + @@ -382,16 +554,22 @@ true true + true true true + true true true + true true true + true true true + true true true + true diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip/build/pjsip_ua.vcxproj asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip/build/pjsip_ua.vcxproj --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip/build/pjsip_ua.vcxproj 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip/build/pjsip_ua.vcxproj 2022-02-24 07:54:38.000000000 +0000 @@ -5,6 +5,10 @@ Debug-Dynamic ARM + + Debug-Dynamic + ARM64 + Debug-Dynamic Win32 @@ -17,6 +21,10 @@ Debug-Static ARM + + Debug-Static + ARM64 + Debug-Static Win32 @@ -29,6 +37,10 @@ Debug ARM + + Debug + ARM64 + Debug Win32 @@ -41,6 +53,10 @@ Release-Dynamic ARM + + Release-Dynamic + ARM64 + Release-Dynamic Win32 @@ -53,6 +69,10 @@ Release-Static ARM + + Release-Static + ARM64 + Release-Static Win32 @@ -65,6 +85,10 @@ Release ARM + + Release + ARM64 + Release Win32 @@ -78,7 +102,7 @@ {B8719FD5-E8A6-4A36-943C-891D07F5DD21} - pjsip_ua + pjsip_ua en-US @@ -161,40 +185,77 @@ false MultiByte + + StaticLibrary + v140 + false + MultiByte + StaticLibrary v140 false MultiByte + + StaticLibrary + v140 + false + MultiByte + StaticLibrary v140 false MultiByte + + StaticLibrary + v140 + false + MultiByte + StaticLibrary v140 false MultiByte + + StaticLibrary + v140 + false + MultiByte + StaticLibrary v140 false MultiByte + + StaticLibrary + v140 + false + MultiByte + StaticLibrary v140 false MultiByte + + StaticLibrary + v140 + false + MultiByte + $(BuildToolset) - + + @@ -264,35 +325,65 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>14.0.22823.1 - pjsip-ua-$(TargetCPU)-$(Platform)-vc$(VSVer)-$(Configuration) + pjsip-ua-$(TargetCPU)-$(Platform)-vc$(VSVer)-$(Configuration) @@ -334,6 +425,18 @@ ..\lib\pjsip-ua-$(TargetCPU)-$(Platform)-vc$(VSVer)-$(Configuration).lib + + + + ../include;../../pjlib/include;../../pjlib-util/include;../../pjmedia/include;%(AdditionalIncludeDirectories) + _LIB;%(PreprocessorDefinitions) + + + + + ..\lib\pjsip-ua-$(TargetCPU)-$(Platform)-vc$(VSVer)-$(Configuration).lib + + ../include;../../pjlib/include;../../pjlib-util/include;../../pjmedia/include;%(AdditionalIncludeDirectories) @@ -369,6 +472,19 @@ ..\lib\pjsip-ua-$(TargetCPU)-$(Platform)-vc$(VSVer)-$(Configuration).lib + + + + ../include;../../pjlib/include;../../pjlib-util/include;../../pjmedia/include;%(AdditionalIncludeDirectories) + _LIB;%(PreprocessorDefinitions) + + + ProgramDatabase + + + ..\lib\pjsip-ua-$(TargetCPU)-$(Platform)-vc$(VSVer)-$(Configuration).lib + + ../include;../../pjlib/include;../../pjlib-util/include;../../pjmedia/include;%(AdditionalIncludeDirectories) @@ -404,6 +520,19 @@ ..\lib\pjsip-ua-$(TargetCPU)-$(Platform)-vc$(VSVer)-$(Configuration).lib + + + + ../include;../../pjlib/include;../../pjlib-util/include;../../pjmedia/include;%(AdditionalIncludeDirectories) + _LIB;%(PreprocessorDefinitions) + + + ProgramDatabase + + + ..\lib\pjsip-ua-$(TargetCPU)-$(Platform)-vc$(VSVer)-$(Configuration).lib + + ../include;../../pjlib/include;../../pjlib-util/include;../../pjmedia/include;%(AdditionalIncludeDirectories) @@ -438,6 +567,18 @@ ..\lib\pjsip-ua-$(TargetCPU)-$(Platform)-vc$(VSVer)-$(Configuration).lib + + + + ../include;../../pjlib/include;../../pjlib-util/include;../../pjmedia/include;%(AdditionalIncludeDirectories) + _LIB;%(PreprocessorDefinitions) + + + + + ..\lib\pjsip-ua-$(TargetCPU)-$(Platform)-vc$(VSVer)-$(Configuration).lib + + ../include;../../pjlib/include;../../pjlib-util/include;../../pjmedia/include;%(AdditionalIncludeDirectories) @@ -473,6 +614,19 @@ ..\lib\pjsip-ua-$(TargetCPU)-$(Platform)-vc$(VSVer)-$(Configuration).lib + + + + ../include;../../pjlib/include;../../pjlib-util/include;../../pjmedia/include;%(AdditionalIncludeDirectories) + _LIB;%(PreprocessorDefinitions) + + + ProgramDatabase + + + ..\lib\pjsip-ua-$(TargetCPU)-$(Platform)-vc$(VSVer)-$(Configuration).lib + + ../include;../../pjlib/include;../../pjlib-util/include;../../pjmedia/include;%(AdditionalIncludeDirectories) @@ -505,6 +659,18 @@ ..\lib\pjsip-ua-$(TargetCPU)-$(Platform)-vc$(VSVer)-$(Configuration).lib + + + + + + ../include;../../pjlib/include;../../pjlib-util/include;../../pjmedia/include;%(AdditionalIncludeDirectories) + _LIB;%(PreprocessorDefinitions) + + + + + ..\lib\pjsip-ua-$(TargetCPU)-$(Platform)-vc$(VSVer)-$(Configuration).lib diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip/build/pjsua2_lib.vcxproj asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip/build/pjsua2_lib.vcxproj --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip/build/pjsua2_lib.vcxproj 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip/build/pjsua2_lib.vcxproj 2022-02-24 07:54:38.000000000 +0000 @@ -5,6 +5,10 @@ Debug-Dynamic ARM + + Debug-Dynamic + ARM64 + Debug-Dynamic Win32 @@ -17,6 +21,10 @@ Debug-Static ARM + + Debug-Static + ARM64 + Debug-Static Win32 @@ -29,6 +37,10 @@ Debug ARM + + Debug + ARM64 + Debug Win32 @@ -41,6 +53,10 @@ Release-Dynamic ARM + + Release-Dynamic + ARM64 + Release-Dynamic Win32 @@ -53,6 +69,10 @@ Release-Static ARM + + Release-Static + ARM64 + Release-Static Win32 @@ -65,6 +85,10 @@ Release ARM + + Release + ARM64 + Release Win32 @@ -161,36 +185,72 @@ false MultiByte + + StaticLibrary + v140 + false + MultiByte + StaticLibrary v140 false MultiByte + + StaticLibrary + v140 + false + MultiByte + StaticLibrary v140 false MultiByte + + StaticLibrary + v140 + false + MultiByte + StaticLibrary v140 false MultiByte + + StaticLibrary + v140 + false + MultiByte + StaticLibrary v140 false MultiByte + + StaticLibrary + v140 + false + MultiByte + StaticLibrary v140 false MultiByte + + StaticLibrary + v140 + false + MultiByte + $(BuildToolset) @@ -265,31 +325,61 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>14.0.22823.1 @@ -337,6 +427,19 @@ ..\lib\pjsua2-lib-$(TargetCPU)-$(Platform)-vc$(VSVer)-$(Configuration).lib + + + + ../include;../../pjmedia/include;../../pjlib-util/include;../../pjlib/include;../../pjnath/include;%(AdditionalIncludeDirectories) + _LIB;%(PreprocessorDefinitions) + + + ProgramDatabase + + + ..\lib\pjsua2-lib-$(TargetCPU)-$(Platform)-vc$(VSVer)-$(Configuration).lib + + ../include;../../pjmedia/include;../../pjlib-util/include;../../pjlib/include;../../pjnath/include;%(AdditionalIncludeDirectories) @@ -371,6 +474,18 @@ ..\lib\pjsua2-lib-$(TargetCPU)-$(Platform)-vc$(VSVer)-$(Configuration).lib + + + + ../include;../../pjmedia/include;../../pjlib-util/include;../../pjlib/include;../../pjnath/include;%(AdditionalIncludeDirectories) + _LIB;%(PreprocessorDefinitions) + + + + + ..\lib\pjsua2-lib-$(TargetCPU)-$(Platform)-vc$(VSVer)-$(Configuration).lib + + ../include;../../pjmedia/include;../../pjlib-util/include;../../pjlib/include;../../pjnath/include;%(AdditionalIncludeDirectories) @@ -406,6 +521,19 @@ ..\lib\pjsua2-lib-$(TargetCPU)-$(Platform)-vc$(VSVer)-$(Configuration).lib + + + + ../include;../../pjmedia/include;../../pjlib-util/include;../../pjlib/include;../../pjnath/include;%(AdditionalIncludeDirectories) + _LIB;%(PreprocessorDefinitions) + + + ProgramDatabase + + + ..\lib\pjsua2-lib-$(TargetCPU)-$(Platform)-vc$(VSVer)-$(Configuration).lib + + ../include;../../pjmedia/include;../../pjlib-util/include;../../pjlib/include;../../pjnath/include;%(AdditionalIncludeDirectories) @@ -440,6 +568,18 @@ ..\lib\pjsua2-lib-$(TargetCPU)-$(Platform)-vc$(VSVer)-$(Configuration).lib + + + + ../include;../../pjmedia/include;../../pjlib-util/include;../../pjlib/include;../../pjnath/include;%(AdditionalIncludeDirectories) + _LIB;%(PreprocessorDefinitions) + + + + + ..\lib\pjsua2-lib-$(TargetCPU)-$(Platform)-vc$(VSVer)-$(Configuration).lib + + ../include;../../pjmedia/include;../../pjlib-util/include;../../pjlib/include;../../pjnath/include;%(AdditionalIncludeDirectories) @@ -475,6 +615,19 @@ ..\lib\pjsua2-lib-$(TargetCPU)-$(Platform)-vc$(VSVer)-$(Configuration).lib + + + + ../include;../../pjmedia/include;../../pjlib-util/include;../../pjlib/include;../../pjnath/include;%(AdditionalIncludeDirectories) + _LIB;%(PreprocessorDefinitions) + + + ProgramDatabase + + + ..\lib\pjsua2-lib-$(TargetCPU)-$(Platform)-vc$(VSVer)-$(Configuration).lib + + ../include;../../pjmedia/include;../../pjlib-util/include;../../pjlib/include;../../pjnath/include;%(AdditionalIncludeDirectories) @@ -507,6 +660,18 @@ ..\lib\pjsua2-lib-$(TargetCPU)-$(Platform)-vc$(VSVer)-$(Configuration).lib + + + + + + ../include;../../pjmedia/include;../../pjlib-util/include;../../pjlib/include;../../pjnath/include;%(AdditionalIncludeDirectories) + _LIB;%(PreprocessorDefinitions) + + + + + ..\lib\pjsua2-lib-$(TargetCPU)-$(Platform)-vc$(VSVer)-$(Configuration).lib diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip/build/pjsua_lib.vcxproj asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip/build/pjsua_lib.vcxproj --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip/build/pjsua_lib.vcxproj 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip/build/pjsua_lib.vcxproj 2022-02-24 07:54:38.000000000 +0000 @@ -5,6 +5,10 @@ Debug-Dynamic ARM + + Debug-Dynamic + ARM64 + Debug-Dynamic Win32 @@ -17,6 +21,10 @@ Debug-Static ARM + + Debug-Static + ARM64 + Debug-Static Win32 @@ -29,6 +37,10 @@ Debug ARM + + Debug + ARM64 + Debug Win32 @@ -41,6 +53,10 @@ Release-Dynamic ARM + + Release-Dynamic + ARM64 + Release-Dynamic Win32 @@ -53,6 +69,10 @@ Release-Static ARM + + Release-Static + ARM64 + Release-Static Win32 @@ -65,6 +85,10 @@ Release ARM + + Release + ARM64 + Release Win32 @@ -78,7 +102,7 @@ {9CA0FDFB-2172-41FC-B7F1-5CE915EDCB37} - pjsua_lib + pjsua_lib en-US @@ -161,40 +185,77 @@ false MultiByte + + StaticLibrary + v140 + false + MultiByte + StaticLibrary v140 false MultiByte + + StaticLibrary + v140 + false + MultiByte + StaticLibrary v140 false MultiByte + + StaticLibrary + v140 + false + MultiByte + StaticLibrary v140 false MultiByte + + StaticLibrary + v140 + false + MultiByte + StaticLibrary v140 false MultiByte + + StaticLibrary + v140 + false + MultiByte + StaticLibrary v140 false MultiByte + + StaticLibrary + v140 + false + MultiByte + $(BuildToolset) - + + @@ -264,31 +325,61 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>14.0.22823.1 @@ -335,6 +426,19 @@ ..\lib\pjsua-lib-$(TargetCPU)-$(Platform)-vc$(VSVer)-$(Configuration).lib + + + + ../include;../../pjmedia/include;../../pjlib-util/include;../../pjlib/include;../../pjnath/include;%(AdditionalIncludeDirectories) + _LIB;%(PreprocessorDefinitions) + + + ProgramDatabase + + + ..\lib\pjsua-lib-$(TargetCPU)-$(Platform)-vc$(VSVer)-$(Configuration).lib + + ../include;../../pjmedia/include;../../pjlib-util/include;../../pjlib/include;../../pjnath/include;%(AdditionalIncludeDirectories) @@ -369,6 +473,18 @@ ..\lib\pjsua-lib-$(TargetCPU)-$(Platform)-vc$(VSVer)-$(Configuration).lib + + + + ../include;../../pjmedia/include;../../pjlib-util/include;../../pjlib/include;../../pjnath/include;%(AdditionalIncludeDirectories) + _LIB;%(PreprocessorDefinitions) + + + + + ..\lib\pjsua-lib-$(TargetCPU)-$(Platform)-vc$(VSVer)-$(Configuration).lib + + ../include;../../pjmedia/include;../../pjlib-util/include;../../pjlib/include;../../pjnath/include;%(AdditionalIncludeDirectories) @@ -404,6 +520,19 @@ ..\lib\pjsua-lib-$(TargetCPU)-$(Platform)-vc$(VSVer)-$(Configuration).lib + + + + ../include;../../pjmedia/include;../../pjlib-util/include;../../pjlib/include;../../pjnath/include;%(AdditionalIncludeDirectories) + _LIB;%(PreprocessorDefinitions) + + + ProgramDatabase + + + ..\lib\pjsua-lib-$(TargetCPU)-$(Platform)-vc$(VSVer)-$(Configuration).lib + + ../include;../../pjmedia/include;../../pjlib-util/include;../../pjlib/include;../../pjnath/include;%(AdditionalIncludeDirectories) @@ -438,6 +567,18 @@ ..\lib\pjsua-lib-$(TargetCPU)-$(Platform)-vc$(VSVer)-$(Configuration).lib + + + + ../include;../../pjmedia/include;../../pjlib-util/include;../../pjlib/include;../../pjnath/include;%(AdditionalIncludeDirectories) + _LIB;%(PreprocessorDefinitions) + + + + + ..\lib\pjsua-lib-$(TargetCPU)-$(Platform)-vc$(VSVer)-$(Configuration).lib + + ../include;../../pjmedia/include;../../pjlib-util/include;../../pjlib/include;../../pjnath/include;%(AdditionalIncludeDirectories) @@ -473,6 +614,19 @@ ..\lib\pjsua-lib-$(TargetCPU)-$(Platform)-vc$(VSVer)-$(Configuration).lib + + + + ../include;../../pjmedia/include;../../pjlib-util/include;../../pjlib/include;../../pjnath/include;%(AdditionalIncludeDirectories) + _LIB;%(PreprocessorDefinitions) + + + ProgramDatabase + + + ..\lib\pjsua-lib-$(TargetCPU)-$(Platform)-vc$(VSVer)-$(Configuration).lib + + ../include;../../pjmedia/include;../../pjlib-util/include;../../pjlib/include;../../pjnath/include;%(AdditionalIncludeDirectories) @@ -505,6 +659,18 @@ ..\lib\pjsua-lib-$(TargetCPU)-$(Platform)-vc$(VSVer)-$(Configuration).lib + + + + + + ../include;../../pjmedia/include;../../pjlib-util/include;../../pjlib/include;../../pjnath/include;%(AdditionalIncludeDirectories) + _LIB;%(PreprocessorDefinitions) + + + + + ..\lib\pjsua-lib-$(TargetCPU)-$(Platform)-vc$(VSVer)-$(Configuration).lib diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip/include/pjsip/sip_auth.h asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip/include/pjsip/sip_auth.h --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip/include/pjsip/sip_auth.h 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip/include/pjsip/sip_auth.h 2022-02-24 07:54:38.000000000 +0000 @@ -43,8 +43,11 @@ * @{ */ -/** Length of digest string. */ -#define PJSIP_MD5STRLEN 32 +/** Length of digest MD5 string. */ +#define PJSIP_MD5STRLEN 32 + +/** Length of digest SHA256 string. */ +#define PJSIP_SHA256STRLEN 64 /** Type of data in the credential information in #pjsip_cred_info. */ diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip/include/pjsip/sip_auth_parser.h asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip/include/pjsip/sip_auth_parser.h --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip/include/pjsip/sip_auth_parser.h 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip/include/pjsip/sip_auth_parser.h 2022-02-24 07:54:38.000000000 +0000 @@ -44,7 +44,7 @@ /** * DeInitialize authorization parser module. */ -PJ_DECL(void) pjsip_auth_deinit_parser(); +PJ_DECL(void) pjsip_auth_deinit_parser(void); @@ -65,7 +65,8 @@ pjsip_DIGEST_STR, /**< "digest" string const. */ pjsip_PGP_STR, /**< "pgp" string const. */ pjsip_BEARER_STR, /**< "bearer" string const. */ - pjsip_MD5_STR, /**< "md5" string const. */ + pjsip_MD5_STR, /**< "MD5" string const. */ + pjsip_SHA256_STR, /**< "SHA-256" string const. */ pjsip_AUTH_STR; /**< "auth" string const. */ PJ_END_DECL diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip/include/pjsip/sip_config.h asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip/include/pjsip/sip_config.h --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip/include/pjsip/sip_config.h 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip/include/pjsip/sip_config.h 2022-02-24 07:54:38.000000000 +0000 @@ -181,6 +181,14 @@ */ pj_bool_t accept_multiple_sdp_answers; + /** + * Don't disconnect the INVITE session after an outgoing request + * gets timed out or responded with 408 (request timeout). + * + * Default is PJ_FALSE. + */ + pj_bool_t keep_inv_after_tsx_timeout; + } endpt; /** Transaction layer settings. */ @@ -208,6 +216,9 @@ /** Transaction completed timer for INVITE, in msec. Default value is * PJSIP_TD_TIMEOUT. + * + * This setting is also used for transaction timeout timer for both + * INVITE and non-INVITE. */ unsigned td; @@ -937,8 +948,19 @@ # define PJSIP_POOL_RDATA_INC 4000 #endif -#define PJSIP_POOL_LEN_TRANSPORT 512 -#define PJSIP_POOL_INC_TRANSPORT 512 +/** + * Initial memory block for SIP transport. + */ +#ifndef PJSIP_POOL_LEN_TRANSPORT +# define PJSIP_POOL_LEN_TRANSPORT 512 +#endif + +/** + * Memory increment for SIP transport. + */ +#ifndef PJSIP_POOL_INC_TRANSPORT +# define PJSIP_POOL_INC_TRANSPORT 512 +#endif /** * Initial memory block size for tdata. @@ -968,6 +990,21 @@ # define PJSIP_POOL_INC_UA 512 #endif +/** + * Initial memory block for event subscription module. + */ +#ifndef PJSIP_POOL_EVSUB_LEN +# define PJSIP_POOL_EVSUB_LEN 512 +#endif + +/** + * Memory increment for event subscription module. + */ +#ifndef PJSIP_POOL_EVSUB_INC +# define PJSIP_POOL_EVSUB_INC 512 +#endif + + #define PJSIP_MAX_FORWARDS_VALUE 70 #define PJSIP_RFC3261_BRANCH_ID "z9hG4bK" @@ -1019,6 +1056,19 @@ # define PJSIP_TSX_1XX_RETRANS_DELAY 60 #endif +/** + * Setting to determine if certain SIP UAS transaction, such as + * INVITE UAS tsx that hasn't been confirmed, is allowed to continue + * upon transport error. If disabled, the transaction will always be + * terminated, which is the default behavior prior to the introduction + * of this setting. + * + * Default: 1 (transaction will continue) + */ +#ifndef PJSIP_TSX_UAS_CONTINUE_ON_TP_ERROR +# define PJSIP_TSX_UAS_CONTINUE_ON_TP_ERROR 1 +#endif + #define PJSIP_MAX_TSX_KEY_LEN (PJSIP_MAX_URL_SIZE*2) /* User agent. */ @@ -1060,7 +1110,12 @@ # define PJSIP_T4_TIMEOUT 5000 #endif -/** Transaction completed timer for INVITE */ +/** + * Transaction completed timer for INVITE. + * + * This setting is also used for transaction timeout timer for both + * INVITE and non-INVITE. + */ #if !defined(PJSIP_TD_TIMEOUT) # define PJSIP_TD_TIMEOUT 32000 #endif @@ -1187,6 +1242,19 @@ # define PJSIP_REGISTER_CLIENT_ADD_XUID_PARAM 0 #endif + +/** + * Allow client to send refresh registration when the registrar sent a Contact + * header with expire parameter 0 in the 200/OK REGISTER response. + * Refer to https://github.com/pjsip/pjproject/pull/2809 for more info. + * + * Default is 1. + */ +#ifndef PJSIP_REGISTER_ALLOW_EXP_REFRESH +# define PJSIP_REGISTER_ALLOW_EXP_REFRESH 1 +#endif + + /** * Maximum size of pool allowed for auth client session in pjsip_regc. * After the size exceeds because of Digest authentication processing, diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip/include/pjsip/sip_dialog.h asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip/include/pjsip/sip_dialog.h --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip/include/pjsip/sip_dialog.h 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip/include/pjsip/sip_dialog.h 2022-02-24 07:54:38.000000000 +0000 @@ -165,6 +165,7 @@ pjsip_route_hdr route_set; /**< Route set. */ pj_bool_t route_set_frozen; /**< Route set has been set. */ pjsip_auth_clt_sess auth_sess; /**< Client authentication session. */ + pj_str_t initial_dest;/**< Initial destination host. */ /** Session counter. */ int sess_count; /**< Number of sessions. */ @@ -301,7 +302,7 @@ * * See \a pjsip_dlg_create_uac() for general info about this function. * - * @param param The parameter, refer to + * @param create_param The parameter, refer to * \a pjsip_dlg_create_uac_param * @param p_dlg Pointer to receive the dialog. * diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip/include/pjsip/sip_endpoint.h asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip/include/pjsip/sip_endpoint.h --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip/include/pjsip/sip_endpoint.h 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip/include/pjsip/sip_endpoint.h 2022-02-24 07:54:38.000000000 +0000 @@ -437,7 +437,7 @@ * PJLIB-UTIL DNS resolver if any (e.g: set using #pjsip_endpt_set_resolver()). * Application that needs it, still be able create its own instance. * - * @param res The SIP resolver engine. + * @param endpt The SIP resolver engine. * @param ext_res The external resolver implementation callback. This argument * can be NULL to reset the whole external implementation. * However, it is prohibited to reset individual callback. diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip/include/pjsip/sip_msg.h asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip/include/pjsip/sip_msg.h --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip/include/pjsip/sip_msg.h 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip/include/pjsip/sip_msg.h 2022-02-24 07:54:38.000000000 +0000 @@ -363,6 +363,59 @@ PJ_DECL(int) pjsip_hdr_print_on( void *hdr, char *buf, pj_size_t len); /** + * Find a header in a header list by the header type. + * + * @param hdr_list The "head" of the header list. + * @param type The header type to find. + * @param start The first header field where the search should begin. + * If NULL is specified, then the search will begin from the + * first header, otherwise the search will begin at the + * specified header. + * + * @return The header field, or NULL if no header with the specified + * type is found. + */ +PJ_DECL(void*) pjsip_hdr_find( const void *hdr_list, + pjsip_hdr_e type, + const void *start); + +/** + * Find a header in a header list by its name. + * + * @param hdr_list The "head" of the header list. + * @param name The header name to find. + * @param start The first header field where the search should begin. + * If NULL is specified, then the search will begin from the + * first header, otherwise the search will begin at the + * specified header. + * + * @return The header field, or NULL if no header with the specified + * type is found. + */ +PJ_DECL(void*) pjsip_hdr_find_by_name( const void *hdr_list, + const pj_str_t *name, + const void *start); + +/** + * Find a header in a header list by its name and short name version. + * + * @param hdr_list The "head" of the header list. + * @param name The header name to find. + * @param sname The short name version of the header name. + * @param start The first header field where the search should begin. + * If NULL is specified, then the search will begin from the + * first header, otherwise the search will begin at the + * specified header. + * + * @return The header field, or NULL if no header with the specified + * type is found. + */ +PJ_DECL(void*) pjsip_hdr_find_by_names( const void *hdr_list, + const pj_str_t *name, + const pj_str_t *sname, + const void *start); + +/** * @} */ @@ -409,9 +462,11 @@ PJSIP_SC_CALL_BEING_FORWARDED = 181, PJSIP_SC_QUEUED = 182, PJSIP_SC_PROGRESS = 183, + PJSIP_SC_EARLY_DIALOG_TERMINATED = 199, PJSIP_SC_OK = 200, PJSIP_SC_ACCEPTED = 202, + PJSIP_SC_NO_NOTIFICATION = 204, PJSIP_SC_MULTIPLE_CHOICES = 300, PJSIP_SC_MOVED_PERMANENTLY = 301, @@ -428,15 +483,31 @@ PJSIP_SC_NOT_ACCEPTABLE = 406, PJSIP_SC_PROXY_AUTHENTICATION_REQUIRED = 407, PJSIP_SC_REQUEST_TIMEOUT = 408, + PJSIP_SC_CONFLICT = 409, PJSIP_SC_GONE = 410, + PJSIP_SC_LENGTH_REQUIRED = 411, + PJSIP_SC_CONDITIONAL_REQUEST_FAILED = 412, PJSIP_SC_REQUEST_ENTITY_TOO_LARGE = 413, PJSIP_SC_REQUEST_URI_TOO_LONG = 414, PJSIP_SC_UNSUPPORTED_MEDIA_TYPE = 415, PJSIP_SC_UNSUPPORTED_URI_SCHEME = 416, + PJSIP_SC_UNKNOWN_RESOURCE_PRIORITY = 417, PJSIP_SC_BAD_EXTENSION = 420, PJSIP_SC_EXTENSION_REQUIRED = 421, PJSIP_SC_SESSION_TIMER_TOO_SMALL = 422, PJSIP_SC_INTERVAL_TOO_BRIEF = 423, + PJSIP_SC_BAD_LOCATION_INFORMATION = 424, + PJSIP_SC_USE_IDENTITY_HEADER = 428, + PJSIP_SC_PROVIDE_REFERRER_HEADER = 429, + PJSIP_SC_FLOW_FAILED = 430, + PJSIP_SC_ANONIMITY_DISALLOWED = 433, + PJSIP_SC_BAD_IDENTITY_INFO = 436, + PJSIP_SC_UNSUPPORTED_CERTIFICATE = 437, + PJSIP_SC_INVALID_IDENTITY_HEADER = 438, + PJSIP_SC_FIRST_HOP_LACKS_OUTBOUND_SUPPORT = 439, + PJSIP_SC_MAX_BREADTH_EXCEEDED = 440, + PJSIP_SC_BAD_INFO_PACKAGE = 469, + PJSIP_SC_CONSENT_NEEDED = 470, PJSIP_SC_TEMPORARILY_UNAVAILABLE = 480, PJSIP_SC_CALL_TSX_DOES_NOT_EXIST = 481, PJSIP_SC_LOOP_DETECTED = 482, @@ -450,6 +521,7 @@ PJSIP_SC_REQUEST_UPDATED = 490, PJSIP_SC_REQUEST_PENDING = 491, PJSIP_SC_UNDECIPHERABLE = 493, + PJSIP_SC_SECURITY_AGREEMENT_NEEDED = 494, PJSIP_SC_INTERNAL_SERVER_ERROR = 500, PJSIP_SC_NOT_IMPLEMENTED = 501, @@ -458,12 +530,15 @@ PJSIP_SC_SERVER_TIMEOUT = 504, PJSIP_SC_VERSION_NOT_SUPPORTED = 505, PJSIP_SC_MESSAGE_TOO_LARGE = 513, + PJSIP_SC_PUSH_NOTIFICATION_SERVICE_NOT_SUPPORTED = 555, PJSIP_SC_PRECONDITION_FAILURE = 580, PJSIP_SC_BUSY_EVERYWHERE = 600, PJSIP_SC_DECLINE = 603, PJSIP_SC_DOES_NOT_EXIST_ANYWHERE = 604, PJSIP_SC_NOT_ACCEPTABLE_ANYWHERE = 606, + PJSIP_SC_UNWANTED = 607, + PJSIP_SC_REJECTED = 608, PJSIP_SC_TSX_TIMEOUT = PJSIP_SC_REQUEST_TIMEOUT, /*PJSIP_SC_TSX_RESOLVE_ERROR = 702,*/ @@ -1053,7 +1128,6 @@ * assign the header name with some string. * @param hvalue Optional string to be assigned as the value. * - * @return The header, or THROW exception. */ PJ_DECL(void) pjsip_generic_string_hdr_init2(pjsip_generic_string_hdr *h, pj_str_t *hname, diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip/include/pjsip/sip_multipart.h asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip/include/pjsip/sip_multipart.h --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip/include/pjsip/sip_multipart.h 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip/include/pjsip/sip_multipart.h 2022-02-24 07:54:38.000000000 +0000 @@ -154,6 +154,89 @@ const pjsip_multipart_part *start); /** + * Find a body inside multipart bodies which has a header matching the + * supplied one. Most useful for finding a part with a specific Content-ID. + * + * @param pool Memory pool to use for temp space. + * @param mp The multipart body. + * @param search_hdr Header to search for. + * @param start If specified, the search will begin at + * start->next part. Otherwise it will begin at + * the first part in the multipart bodies. + * + * @return The first part which has a header matching the + * specified one, or NULL if not found. + */ +PJ_DECL(pjsip_multipart_part*) +pjsip_multipart_find_part_by_header(pj_pool_t *pool, + const pjsip_msg_body *mp, + void *search_hdr, + const pjsip_multipart_part *start); + +/** + * Find a body inside multipart bodies which has a header matching the + * supplied name and value. Most useful for finding a part with a specific + * Content-ID. + * + * @param pool Memory pool to use for temp space. + * @param mp The multipart body. + * @param hdr_name Header name to search for. + * @param hdr_value Header value search for. + * @param start If specified, the search will begin at + * start->next part. Otherwise it will begin at + * the first part in the multipart bodies. + * + * @return The first part which has a header matching the + * specified one, or NULL if not found. + */ +PJ_DECL(pjsip_multipart_part*) +pjsip_multipart_find_part_by_header_str(pj_pool_t *pool, + const pjsip_msg_body *mp, + const pj_str_t *hdr_name, + const pj_str_t *hdr_value, + const pjsip_multipart_part *start); + + + +/** + * Find a body inside multipart bodies which has a Content-ID value matching the + * supplied "cid" URI in pj_str form. The "cid:" scheme will be assumed if the + * URL doesn't start with it. Enclosing angle brackets will also be handled + * correctly if they exist. + * + * @see RFC2392 Content-ID and Message-ID Uniform Resource Locators + * + * @param pool Memory pool to use for temp space. + * @param mp The multipart body. + * @param cid The "cid" URI to search for in pj_str form. + * + * @return The first part which has a Content-ID header matching the + * specified "cid" URI. or NULL if not found. + */ +PJ_DECL(pjsip_multipart_part*) +pjsip_multipart_find_part_by_cid_str(pj_pool_t *pool, + const pjsip_msg_body *mp, + pj_str_t *cid); + +/** + * Find a body inside multipart bodies which has a Content-ID value matching the + * supplied "cid" URI. + * + * @see RFC2392 Content-ID and Message-ID Uniform Resource Locators + * + * @param pool Memory pool to use for temp space. + * @param mp The multipart body. + * @param cid The "cid" URI to search for. + * + * @return The first part which had a Content-ID header matching the + * specified "cid" URI. or NULL if not found. + */ +PJ_DECL(pjsip_multipart_part*) +pjsip_multipart_find_part_by_cid_uri(pj_pool_t *pool, + const pjsip_msg_body *mp, + pjsip_other_uri *cid_uri); + +/** * Parse multipart message. * * @param pool Memory pool. diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip/include/pjsip/sip_transaction.h asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip/include/pjsip/sip_transaction.h --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip/include/pjsip/sip_transaction.h 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip/include/pjsip/sip_transaction.h 2022-02-24 07:54:38.000000000 +0000 @@ -435,6 +435,22 @@ PJ_DECL(pj_status_t) pjsip_tsx_set_timeout(pjsip_transaction *tsx, unsigned millisec); +/* + * Change timer values used by transaction layer. Currently scheduled + * timers will not be changed. Any value set to 0 will be left + * unchanged. + * + * @param t1 - Transaction T1 timeout, in msec + * @param t2 - Transaction T2 timeout, in msec + * @param t4 - Transaction completed timer for non-INVITE, in msec + * @param td - Transaction completed timer for INVITE, in msec + */ +PJ_DECL(void) pjsip_tsx_set_timers(unsigned t1, unsigned t2, unsigned t4, unsigned td); + +/* + * (Re)Initializes timer values from `pjsip_cfg()`. + */ +PJ_DECL(void) pjsip_tsx_initialize_timer_values(void); /** * Get the transaction instance in the incoming message. If the message diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip/include/pjsip/sip_transport.h asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip/include/pjsip/sip_transport.h --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip/include/pjsip/sip_transport.h 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip/include/pjsip/sip_transport.h 2022-02-24 07:54:38.000000000 +0000 @@ -1247,7 +1247,7 @@ * * @param tpmgr The transport manager. * @param pool Pool to allocate memory for the IP address. - * @param param Function input and output parameters. + * @param prm Function input and output parameters. * * @return PJ_SUCCESS, or the appropriate error code. */ diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip/include/pjsip/sip_transport_tls.h asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip/include/pjsip/sip_transport_tls.h --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip/include/pjsip/sip_transport_tls.h 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip/include/pjsip/sip_transport_tls.h 2022-02-24 07:54:38.000000000 +0000 @@ -61,6 +61,7 @@ PJSIP_TLSV1_METHOD = 31, /**< Use TLSv1 method. */ PJSIP_TLSV1_1_METHOD = 32, /**< Use TLSv1_1 method. */ PJSIP_TLSV1_2_METHOD = 33, /**< Use TLSv1_2 method. */ + PJSIP_TLSV1_3_METHOD = 34, /**< Use TLSv1_3 method. */ PJSIP_SSLV23_METHOD = 23, /**< Use SSLv23 method. */ } pjsip_ssl_method; @@ -104,6 +105,38 @@ /** + * This structure describe the parameter passed from #on_verify_cb(). + */ +typedef struct pjsip_tls_on_verify_param { + /** + * Describes local address. + */ + const pj_sockaddr_t *local_addr; + + /** + * Describes remote address. + */ + const pj_sockaddr_t *remote_addr; + + /** + * Describes transport direction. + */ + pjsip_transport_dir tp_dir; + + /** + * Describes active local certificate info. + */ + pj_ssl_cert_info *local_cert_info; + + /** + * Describes active remote certificate info. + */ + pj_ssl_cert_info *remote_cert_info; + +} pjsip_tls_on_verify_param; + + +/** * TLS transport settings. */ typedef struct pjsip_tls_setting @@ -343,6 +376,19 @@ */ void(*on_accept_fail_cb)(const pjsip_tls_on_accept_fail_param *param); + /** + * Callback to be called to verify a new connection. Currently it's only + * implemented for OpenSSL backend. + * + * @param param The parameter to the callback. + * + * @return Return PJ_TRUE if succesfully verified. + * If verification failed, connection will be dropped + * immediately. + * + */ + pj_bool_t(*on_verify_cb)(const pjsip_tls_on_verify_param *param); + } pjsip_tls_setting; diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip/include/pjsip/sip_transport_udp.h asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip/include/pjsip/sip_transport_udp.h --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip/include/pjsip/sip_transport_udp.h 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip/include/pjsip/sip_transport_udp.h 2022-02-24 07:54:38.000000000 +0000 @@ -294,6 +294,14 @@ * and set the \a local argument to NULL. In both cases, application * may specify the published address of the socket in \a a_name * argument. + * + * Note that prior to calling this method, any locks acquired need to + * be released temporarily to avoid any deadlock scenario. + * This method will loop to wait for read operation to finish before actually + * restart the transport. This might lead to deadlock if any other thread with + * the read operation tries to acquire the same lock held by the thread calling + * this method. + * Please see https://github.com/pjsip/pjproject/pull/2731 for more details. * * @param transport The UDP transport. * @param option Restart option. @@ -339,6 +347,14 @@ * may specify the published address of the socket in \a a_name * argument. This is another version of pjsip_udp_transport_restart() * able to restart IPv6 transport. + * + * Note that prior to calling this method, any locks acquired need to + * be released temporarily to avoid any deadlock scenario. + * This method will loop to wait for read operation to finish before actually + * restart the transport. This might lead to deadlock if any other thread with + * the read operation tries to acquire the same lock held by the thread calling + * this method. + * Please see https://github.com/pjsip/pjproject/pull/2731 for more details. * * @param transport The UDP transport. * @param option Restart option. diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip/include/pjsip/sip_uri.h asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip/include/pjsip/sip_uri.h --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip/include/pjsip/sip_uri.h 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip/include/pjsip/sip_uri.h 2022-02-24 07:54:38.000000000 +0000 @@ -27,6 +27,7 @@ #include #include +#include #include #include @@ -269,6 +270,7 @@ */ PJ_INLINE(void*) pjsip_uri_get_uri(const void *uri) { + PJ_ASSERT_RETURN(uri, NULL); return (*((pjsip_uri*)uri)->vptr->p_get_uri)((void*)uri); } diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip/include/pjsip/sip_util.h asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip/include/pjsip/sip_util.h --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip/include/pjsip/sip_util.h 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip/include/pjsip/sip_util.h 2022-02-24 07:54:38.000000000 +0000 @@ -207,7 +207,7 @@ * * @param target The target. * @param pool The memory pool to be used to duplicate the reason phrase. - * @param code The SIP status code to be set to the target. + * @param status_code The SIP status code to be set to the target. * @param reason The reason phrase to be set to the target. * * @return PJ_SUCCESS on successful operation or the appropriate @@ -322,7 +322,7 @@ * will construct all the Via, Record-Route, Call-ID, From, To, CSeq, and * Call-ID headers from the request. * - * Note: the txdata reference counter is set to ZERO!. + * Once a transmit data is created, the reference counter is initialized to 1. * * @param endpt The endpoint. * @param rdata The request receive data. @@ -344,6 +344,8 @@ * an ACK request to 3xx-6xx final response. * The generation of ACK message for 2xx final response is different than * this one. + * + * Once a transmit data is created, the reference counter is initialized to 1. * * @param endpt The endpoint. * @param tdata This contains the original INVITE request @@ -361,6 +363,8 @@ /** * Construct CANCEL request for the previously sent request. * + * Once a transmit data is created, the reference counter is initialized to 1. + * * @param endpt The endpoint. * @param tdata The transmit buffer for the request being cancelled. * @param p_tdata Pointer to receive the transmit data. diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip/include/pjsip.h asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip/include/pjsip.h --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip/include/pjsip.h 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip/include/pjsip.h 2022-02-24 07:54:38.000000000 +0000 @@ -48,6 +48,7 @@ /* Authentication. */ #include #include +#include /* Transaction layer. */ #include diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip/include/pjsip-simple/rpid.h asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip/include/pjsip-simple/rpid.h --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip/include/pjsip-simple/rpid.h 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip/include/pjsip-simple/rpid.h 2022-02-24 07:54:38.000000000 +0000 @@ -42,7 +42,7 @@ /** * This enumeration describes subset of standard activities as - * described by RFC 4880, RPID: Rich Presence Extensions to the + * described by RFC 4480, RPID: Rich Presence Extensions to the * Presence Information Data Format (PIDF). */ typedef enum pjrpid_activity @@ -107,7 +107,8 @@ * Add RPID element information into existing PIDF document. This will also * add the appropriate XML namespace attributes into the presence's XML * node, if the attributes are not already present, and also a element - * to the first element of the PIDF document. + * to the first element of the PIDF document, if a element + * is not present. * * @param pres The PIDF presence document. * @param pool Pool. diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip/include/pjsip-ua/sip_inv.h asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip/include/pjsip-ua/sip_inv.h --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip/include/pjsip-ua/sip_inv.h 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip/include/pjsip-ua/sip_inv.h 2022-02-24 07:54:38.000000000 +0000 @@ -131,7 +131,8 @@ * This callback is called when the invite usage module has created * a new dialog and invite because of forked outgoing request. * - * This callback is mandatory. + * Currently the invite session does not create a new dialog in + * forking scenario, so this callback will never be invoked. * * @param inv The new invite session. * @param e The event which has caused the dialog to fork. @@ -255,7 +256,8 @@ * sending of the ACK request (for example, when it needs to * wait for answer from the other call leg, in 3PCC scenarios). * - * Application creates the ACK request + * Application MUST create the ACK request using pjsip_inv_create_ack() + * and send it using pjsip_inv_send_msg(). * * Once it has sent the ACK request, the framework will keep * this ACK request in the cache. Subsequent receipt of 2xx response @@ -375,7 +377,17 @@ * Session timer extension will always be used even when peer doesn't * support/want session timer. */ - PJSIP_INV_ALWAYS_USE_TIMER = 128 + PJSIP_INV_ALWAYS_USE_TIMER = 128, + + /** + * Indicate support for trickle ICE + */ + PJSIP_INV_SUPPORT_TRICKLE_ICE = 256, + + /** + * Require trickle ICE support. + */ + PJSIP_INV_REQUIRE_TRICKLE_ICE = 512, }; @@ -451,11 +463,11 @@ /** - * This structure represents SDP information in a pjsip_rx_data. Application - * retrieve this information by calling #pjsip_rdata_get_sdp_info(). This + * This structure represents SDP information in a pjsip_(rx|tx)_data. Application + * retrieve this information by calling #pjsip_get_sdp_info(). This * mechanism supports multipart message body. */ -typedef struct pjsip_rdata_sdp_info +typedef struct pjsip_sdp_info { /** * Pointer and length of the text body in the incoming message. If @@ -475,7 +487,15 @@ */ pjmedia_sdp_session *sdp; -} pjsip_rdata_sdp_info; +} pjsip_sdp_info; + +/** + * For backwards compatibility and completeness, + * pjsip_rdata_sdp_info and pjsip_tdata_sdp_info + * are typedef'd to pjsip_sdp_info. + */ +typedef pjsip_sdp_info pjsip_rdata_sdp_info; +typedef pjsip_sdp_info pjsip_tdata_sdp_info; /** @@ -965,7 +985,7 @@ * * Note that if the invite session has a pending offer to be answered * (for example when the last 2xx response to INVITE contains an offer), - * application MUST have set the SDP answer with #pjsip_create_sdp_body() + * application MUST have set the SDP answer with #pjsip_inv_set_sdp_answer() * prior to creating the ACK request. In this case, the ACK request * will be added with SDP message body. * @@ -1046,6 +1066,44 @@ pjsip_msg_body **p_body); /** + * This is a utility function to create a multipart body with the + * SIP body as the first part. + * + * @param pool Pool to allocate memory. + * @param sdp SDP session to be put in the SIP message body. + * @param p_body Pointer to receive SIP message body containing + * the SDP session. + * + * @return PJ_SUCCESS on success. + */ +PJ_DECL(pj_status_t) pjsip_create_multipart_sdp_body( pj_pool_t *pool, + pjmedia_sdp_session *sdp, + pjsip_msg_body **p_body); + +/** + * Retrieve SDP information from a message body. Application should + * prefer to use this function rather than parsing the SDP manually since + * this function supports multipart message body. + * + * This function will only parse the SDP once, the first time it is called + * on the same message. Subsequent call on the same message will just pick + * up the already parsed SDP from the message. + * + * @param pool Pool to allocate memory. + * @param body The message body. + * @param msg_media_type From the rdata or tdata Content-Type header, if available. + * If NULL, the content_type from the body will be used. + * @param search_media_type The media type to search for. + * If NULL, "application/sdp" will be used. + * + * @return The SDP info. + */ +PJ_DECL(pjsip_sdp_info*) pjsip_get_sdp_info(pj_pool_t *pool, + pjsip_msg_body *body, + pjsip_media_type *msg_media_type, + const pjsip_media_type *search_media_type); + +/** * Retrieve SDP information from an incoming message. Application should * prefer to use this function rather than parsing the SDP manually since * this function supports multipart message body. @@ -1061,6 +1119,60 @@ PJ_DECL(pjsip_rdata_sdp_info*) pjsip_rdata_get_sdp_info(pjsip_rx_data *rdata); +/** + * Retrieve SDP information from an incoming message. Application should + * prefer to use this function rather than parsing the SDP manually since + * this function supports multipart message body. + * + * This function will only parse the SDP once, the first time it is called + * on the same message. Subsequent call on the same message will just pick + * up the already parsed SDP from the message. + * + * @param rdata The incoming message. + * @param search_media_type The SDP media type to search for. + * If NULL, "application/sdp" will be used. + * + * @return The SDP info. + */ +PJ_DECL(pjsip_rdata_sdp_info*) pjsip_rdata_get_sdp_info2( + pjsip_rx_data *rdata, + const pjsip_media_type *search_media_type); + +/** + * Retrieve SDP information from an outgoing message. Application should + * prefer to use this function rather than parsing the SDP manually since + * this function supports multipart message body. + * + * This function will only parse the SDP once, the first time it is called + * on the same message. Subsequent call on the same message will just pick + * up the already parsed SDP from the message. + * + * @param tdata The outgoing message. + * + * @return The SDP info. + */ +PJ_DECL(pjsip_tdata_sdp_info*) pjsip_tdata_get_sdp_info(pjsip_tx_data *tdata); + +/** + * Retrieve SDP information from an outgoing message. Application should + * prefer to use this function rather than parsing the SDP manually since + * this function supports multipart message body. + * + * This function will only parse the SDP once, the first time it is called + * on the same message. Subsequent call on the same message will just pick + * up the already parsed SDP from the message. + * + * @param tdata The outgoing message. + * @param search_media_type The SDP media type to search for. + * If NULL, "application/sdp" will be used. + * + * @return The SDP info. + */ +PJ_DECL(pjsip_tdata_sdp_info*) pjsip_tdata_get_sdp_info2( + pjsip_tx_data *tdata, + const pjsip_media_type *search_media_type); + + PJ_END_DECL /** diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip/include/pjsip-ua/sip_regc.h asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip/include/pjsip-ua/sip_regc.h --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip/include/pjsip-ua/sip_regc.h 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip/include/pjsip-ua/sip_regc.h 2022-02-24 07:54:38.000000000 +0000 @@ -156,6 +156,24 @@ */ PJ_DECL(pj_status_t) pjsip_regc_destroy(pjsip_regc *regc); + +/** + * Destroy client registration structure. If a registration transaction is + * in progress: + * - if force is PJ_TRUE, then the structure will be deleted only after + * a final response has been received, and in this case, the callback + * won't be called (this behavior is the same as calling + * pjsip_regc_destroye()). + * - if force is PJ_FALSE, the function will return PJ_EBUSY + * + * @param regc The client registration structure. + * @param force Specify if the function must destroy the structure. + * + * @return PJ_SUCCESS on success, or PJ_EBUSY. + */ +PJ_DECL(pj_status_t) pjsip_regc_destroy2(pjsip_regc *regc, pj_bool_t force); + + /** * Get registration info. * diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip/include/pjsip-ua/sip_replaces.h asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip/include/pjsip-ua/sip_replaces.h --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip/include/pjsip-ua/sip_replaces.h 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip/include/pjsip-ua/sip_replaces.h 2022-02-24 07:54:38.000000000 +0000 @@ -128,11 +128,14 @@ if (status != PJ_SUCCESS) { // Something wrong with Replaces request. // + pj_status_t status; if (response) { - pjsip_endpt_send_response(endpt, rdata, response, NULL, NULL); + status = pjsip_endpt_send_response(endpt, rdata, response, NULL, NULL); + if (status != PJ_SUCCESS) pjsip_tx_data_dec_ref(tdata); } else { // Respond with 500 (Internal Server Error) - pjsip_endpt_respond_stateless(endpt, rdata, 500, NULL, NULL, NULL); + status = pjsip_endpt_respond_stateless(endpt, rdata, 500, NULL, NULL, NULL); + if (status != PJ_SUCCESS) pjsip_tx_data_dec_ref(tdata); } } diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip/include/pjsua2/account.hpp asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip/include/pjsua2/account.hpp --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip/include/pjsua2/account.hpp 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip/include/pjsua2/account.hpp 2022-02-24 07:54:38.000000000 +0000 @@ -81,6 +81,17 @@ string contactParams; /** + * Additional parameters that will be appended in the Contact URI + * of the registration requests. This will be appended after + * \a AccountSipConfig.contactUriParams; + * + * The parameters should be preceeded by semicolon, and all strings must + * be properly escaped. Example: + * ";my-param=X;another-param=Hi%20there" + */ + string contactUriParams; + + /** * Optional interval for registration, in seconds. If the value is zero, * default interval will be used (PJSUA_REG_INTERVAL, 300 seconds). */ @@ -491,6 +502,13 @@ bool iceEnabled; /** + * Set trickle ICE mode for ICE media transport. + * + * Default: PJ_ICE_SESS_TRICKLE_DISABLED + */ + pj_ice_sess_trickle iceTrickle; + + /** * Set the maximum number of ICE host candidates. * * Default: -1 (maximum not set) @@ -591,7 +609,7 @@ * * See also contactRewriteMethod field. * - * Default: TRUE + * Default: 1 (PJ_TRUE / yes) */ int contactRewriteUse; @@ -616,7 +634,7 @@ * TCP socket when it is still connecting. In these cases, this * feature will also be turned off. * - * Default: 1 (yes). + * Default: 1 (PJ_TRUE / yes). */ int contactUseSrcPort; @@ -626,7 +644,7 @@ * the REGISTER request, as long as the request uses the same transport * instance as the previous REGISTER request. * - * Default: TRUE + * Default: 1 (PJ_TRUE / yes) */ int viaRewriteUse; @@ -653,7 +671,7 @@ * transports. If UDP is used for the registration, the SIP outbound * feature will be silently ignored for the account. * - * Default: TRUE + * Default: 1 (PJ_TRUE / yes) */ int sipOutboundUse; @@ -699,9 +717,25 @@ * Default constructor */ AccountNatConfig() : sipStunUse(PJSUA_STUN_USE_DEFAULT), - mediaStunUse(PJSUA_STUN_USE_DEFAULT), - nat64Opt(PJSUA_NAT64_DISABLED), - turnConnType(PJ_TURN_TP_UDP) + mediaStunUse(PJSUA_STUN_USE_DEFAULT), + nat64Opt(PJSUA_NAT64_DISABLED), + iceEnabled(false), + iceTrickle(PJ_ICE_SESS_TRICKLE_DISABLED), + iceMaxHostCands(-1), + iceAggressiveNomination(true), + iceNominatedCheckDelayMsec(PJ_ICE_NOMINATED_CHECK_DELAY), + iceWaitNominationTimeoutMsec(ICE_CONTROLLED_AGENT_WAIT_NOMINATION_TIMEOUT), + iceNoRtcp(false), + iceAlwaysUpdate(true), + turnConnType(PJ_TURN_TP_UDP), + contactRewriteUse(PJ_TRUE), + contactRewriteMethod(PJSUA_CONTACT_REWRITE_METHOD), + contactUseSrcPort(PJ_TRUE), + viaRewriteUse(PJ_TRUE), + sdpNatRewriteUse(PJ_FALSE), + sipOutboundUse(PJ_TRUE), + udpKaIntervalSec(15), + udpKaData("\r\n") {} /** @@ -919,6 +953,12 @@ { /** * Media transport (RTP) configuration. + * + * For \a port and \a portRange settings, RTCP port is selected as + * RTP port+1. + * Example: \a port=5000, \a portRange=4 + * - Available ports: 5000, 5002, 5004 (Media/RTP transport) + * 5001, 5003, 5005 (Media/RTCP transport) */ TransportConfig transportConfig; @@ -982,6 +1022,24 @@ */ RtcpFbConfig rtcpFbConfig; + /** + * Use loopback media transport. This may be useful if application + * doesn't want PJSUA2 to create real media transports/sockets, such as + * when using third party media. + * + * Default: false + */ + bool useLoopMedTp; + + /** + * Enable local loopback when useLoopMedTp is set to TRUE. + * If enabled, packets sent to the transport will be sent back to + * the streams attached to the transport. + * + * Default: false + */ + bool enableLoopback; + public: /** * Default constructor @@ -1951,7 +2009,6 @@ virtual void onMwiInfo(OnMwiInfoParam &prm) { PJ_UNUSED_ARG(prm); } - private: friend class Endpoint; friend class Buddy; @@ -1968,7 +2025,6 @@ */ void removeBuddy(Buddy *buddy); - private: pjsua_acc_id id; string tmpReason; // for saving response's reason diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip/include/pjsua2/call.hpp asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip/include/pjsua2/call.hpp --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip/include/pjsua2/call.hpp 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip/include/pjsua2/call.hpp 2022-02-24 07:54:38.000000000 +0000 @@ -270,6 +270,10 @@ ////////////////////////////////////////////////////////////////////////////// +/** Array of media direction */ +typedef IntVector MediaDirVector; + + /** * Call settings. */ @@ -306,6 +310,30 @@ * Default: 1 (if video feature is enabled, otherwise it is zero) */ unsigned videoCount; + + /** + * Media direction. This setting will only be used if the flag + * PJSUA_CALL_SET_MEDIA_DIR is set, and it will persist for subsequent + * offers or answers. + * For example, a media that is set as PJMEDIA_DIR_ENCODING can only + * mark the stream in the SDP as sendonly or inactive, but will not + * become sendrecv in subsequent offers and answers. + * Application can update the media direction in any API or callback + * that accepts CallSetting as a parameter, such as via + * Call::reinvite/update() or in onCallRxOffer/Reinvite() + * callback. + * + * The index of the media dir will correspond to the provisional media + * in CallInfo.provMedia. + * For offers that involve adding new medias (such as initial offer), + * the index will correspond to all new audio media first, then video. + * For example, for a new call with 2 audios and 1 video, mediaDir[0] + * and mediaDir[1] will be for the audios, and mediaDir[2] video. + * + * Default: empty vector + */ + MediaDirVector mediaDir; + public: /** @@ -589,6 +617,44 @@ */ VidCodecParam vidCodecParam; + /** + * Jitter buffer init delay in msec. + */ + int jbInit; + + /** + * Jitter buffer minimum prefetch delay in msec. + */ + int jbMinPre; + + /** + * Jitter buffer maximum prefetch delay in msec. + */ + int jbMaxPre; + + /** + * Jitter buffer max delay in msec. + */ + int jbMax; + + /** + * Jitter buffer discard algorithm. + */ + pjmedia_jb_discard_algo jbDiscardAlgo; + +#if defined(PJMEDIA_STREAM_ENABLE_KA) && PJMEDIA_STREAM_ENABLE_KA!=0 + /** + * Stream keep-alive and NAT hole punch (see #PJMEDIA_STREAM_ENABLE_KA) is + * enabled? + */ + bool useKa; +#endif + + /** + * Disable automatic sending of RTCP SDES and BYE. + */ + bool rtcpSdesByeDisabled; + public: /** * Default constructor @@ -672,6 +738,23 @@ }; /** + * This structure contains parameters for Call::onStreamPreCreate() + * callback. + */ +struct OnStreamPreCreateParam +{ + /** + * Stream index in the media session, read-only. + */ + unsigned streamIdx; + + /** + * Parameters that the stream will be created from. + */ + StreamInfo streamInfo; +}; + +/** * This structure contains parameters for Call::onStreamCreated() * callback. */ @@ -739,13 +822,63 @@ string digit; /** - * DTMF signal duration which might be included when sending DTMF using - * SIP INFO. + * DTMF signal duration. If the duration is unknown, this value is set to + * PJSUA_UNKNOWN_DTMF_DURATION. */ unsigned duration; }; /** + * This structure contains parameters for Call::onDtmfEvent() + * callback. + */ +struct OnDtmfEventParam +{ + /** + * DTMF sending method. + */ + pjsua_dtmf_method method; + + /** + * The timestamp identifying the begin of the event. Timestamp units are + * expressed in milliseconds. + * Note that this value should only be used to compare multiple events + * received via the same method relatively to each other, as the time-base + * is randomized. + */ + unsigned timestamp; + + /** + * DTMF ASCII digit. + */ + string digit; + + /** + * DTMF signal duration in milliseconds. Interpretation of the duration + * depends on the flag PJMEDIA_STREAM_DTMF_IS_END. + * depends on the method. + * If the method is PJSUA_DTMF_METHOD_SIP_INFO, this contains the total + * duration of the DTMF signal or PJSUA_UNKNOWN_DTMF_DURATION if no signal + * duration was indicated. + * If the method is PJSUA_DTMF_METHOD_RFC2833, this contains the total + * duration of the DTMF signal received up to this point in time. + */ + unsigned duration; + + /** + * Flags indicating additional information about the DTMF event. + * If PJMEDIA_STREAM_DTMF_IS_UPDATE is set, the event was already + * indicated earlier. The new indication contains an updated event + * duration. + * If PJMEDIA_STREAM_DTMF_IS_END is set, the event has ended and this + * indication contains the final event duration. Note that end + * indications might get lost. Hence it is not guaranteed to receive + * an event with PJMEDIA_STREAM_DTMF_IS_END for every event. + */ + unsigned flags; +}; + +/** * This structure contains parameters for Call::onCallTransferRequest() * callback. */ @@ -1709,7 +1842,20 @@ */ virtual void onCallSdpCreated(OnCallSdpCreatedParam &prm) { PJ_UNUSED_ARG(prm); } - + + /** + * Notify application when an audio media session is about to be created + * (as opposed to #on_stream_created() and #on_stream_created2() which are + * called *after* the session has been created). The application may change + * some stream info parameter values, i.e: jbInit, jbMinPre, jbMaxPre, + * jbMax, useKa, rtcpSdesByeDisabled, jbDiscardAlgo (audio), + * vidCodecParam.encFmt (video). + * + * @param prm Callback parameter. + */ + virtual void onStreamPreCreate(OnStreamPreCreateParam &prm) + { PJ_UNUSED_ARG(prm); } + /** * Notify application when audio media session is created and before it is * registered to the conference bridge. Application may return different @@ -1737,7 +1883,15 @@ */ virtual void onDtmfDigit(OnDtmfDigitParam &prm) { PJ_UNUSED_ARG(prm); } - + + /** + * Notify application upon incoming DTMF events. + * + * @param prm Callback parameter. + */ + virtual void onDtmfEvent(OnDtmfEventParam &prm) + { PJ_UNUSED_ARG(prm); } + /** * Notify application on call being transferred (i.e. REFER is received). * Application can decide to accept/reject transfer request by setting diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip/include/pjsua2/endpoint.hpp asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip/include/pjsua2/endpoint.hpp --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip/include/pjsua2/endpoint.hpp 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip/include/pjsua2/endpoint.hpp 2022-02-24 07:54:38.000000000 +0000 @@ -437,6 +437,150 @@ MediaEvent ev; }; +/** + * This structure describes authentication challenge used in Proxy-Authenticate + * or WWW-Authenticate for digest authentication scheme. + */ +struct DigestChallenge +{ + /** + * Realm for the challenge. + * */ + std::string realm; + + /* + * Other parameters. + * */ + StringToStringMap otherParam; + + /** + * Domain. + */ + std::string domain; + + /** + * Nonce challenge. + */ + std::string nonce; + + /** + * Opaque value. + */ + std::string opaque; + + /** + * Stale parameter. + */ + int stale; + + /** + * Algorithm parameter. + */ + std::string algorithm; + + /** + * Quality of protection. + */ + std::string qop; + + /** + * Convert from pjsip + */ + void fromPj(const pjsip_digest_challenge &prm); + + /** + * Convert to pjsip + */ + pjsip_digest_challenge toPj() const; +}; + +/** + * This structure describe credential used in Authorization and + * Proxy-Authorization header for digest authentication scheme. + */ +struct DigestCredential +{ + /** + *Realm of the credential + */ + std::string realm; + + /** + *Other parameters. + */ + StringToStringMap otherParam; + + /** + *Username parameter. + */ + std::string username; + + /** + *Nonce parameter. + */ + std::string nonce; + + /** + *URI parameter. + */ + std::string uri; + + /** + *Response digest. + */ + std::string response; + + /** + *Algorithm. + */ + std::string algorithm; + + /** + *Cnonce. + */ + std::string cnonce; + + /** + *Opaque value. + */ + std::string opaque; + + /** + *Quality of protection. + */ + std::string qop; + + /** + *Nonce count. + */ + std::string nc; + + /** + * Convert from pjsip + */ + void fromPj(const pjsip_digest_credential &prm); + + /** + * Convert to pjsip + */ + pjsip_digest_credential toPj() const; +}; + + +/** + * Parameters for onCredAuth account method. + */ +struct OnCredAuthParam +{ + DigestChallenge digestChallenge; + + AuthCredInfo credentialInfo; + + std::string method; + + DigestCredential digestCredential; +}; + ////////////////////////////////////////////////////////////////////////////// /** * SIP User Agent related settings. @@ -867,6 +1011,14 @@ int jbMax; /** + * Set the algorithm the jitter buffer uses to discard frames in order to + * adjust the latency. + * + * Default: PJMEDIA_JB_DISCARD_PROGRESSIVE + */ + pjmedia_jb_discard_algo jbDiscardAlgo; + + /** * Specify idle time of sound device before it is automatically closed, * in seconds. Use value -1 to disable the auto-close feature of sound * device @@ -1598,8 +1750,6 @@ * (configurable via \a AccountConfig.ipChangeConfig.reinviteFlags). * * @param param The IP change parameter, have a look at #IpChangeParam. - * - * @return PJ_SUCCESS on success, other on error. */ void handleIpChange(const IpChangeParam ¶m) PJSUA2_THROW(Error); @@ -1688,6 +1838,39 @@ virtual void onMediaEvent(OnMediaEventParam &prm) { PJ_UNUSED_ARG(prm); } + /** + * Callback for computation of the digest credential. + * + * Usually, an application does not need to implement (overload) this callback. + * Use it, if your application needs to support Digest AKA authentication without + * the default digest computation back-end (i.e: using libmilenage). + * + * To use Digest AKA authentication, add \a PJSIP_CRED_DATA_EXT_AKA flag in the + * AuthCredInfo's \a dataType field of the AccountConfig, and fill up other + * AKA specific information in AuthCredInfo: + * - If PJSIP_HAS_DIGEST_AKA_AUTH is disabled, you have to overload this callback + * to provide your own digest computation back-end. + * - If PJSIP_HAS_DIGEST_AKA_AUTH is enabled, libmilenage library from + * \a third_party directory is linked, and this callback returns PJ_ENOTSUP, + * then the default digest computation back-end is used. + * + * @param prm.digestChallenge The authentication challenge sent by server in 401 + * or 401 response, as either Proxy-Authenticate or + * WWW-Authenticate header. + * @param prm.credentialInfo The credential to be used. + * @param method The request method. + * @param prm.digestCredential The digest credential where the digest response + * will be placed to. Upon calling this function, the + * nonce, nc, cnonce, qop, uri, and realm fields of + * this structure must have been set by caller. Upon + * return, the \a response field will be initialized + * by this function. + * + * @return PJ_ENOTSUP is the default. If you overload this callback, + * return PJ_SUCCESS on success. + */ + virtual pj_status_t onCredAuth(OnCredAuthParam &prm); + private: static Endpoint *instance_; // static instance LogWriter *writer; // Custom writer, if any @@ -1787,6 +1970,8 @@ pjmedia_sdp_session *sdp, pj_pool_t *pool, const pjmedia_sdp_session *rem_sdp); + static void on_stream_precreate(pjsua_call_id call_id, + pjsua_on_stream_precreate_param *param); static void on_stream_created2(pjsua_call_id call_id, pjsua_on_stream_created_param *param); static void on_stream_destroyed(pjsua_call_id call_id, @@ -1795,6 +1980,8 @@ static void on_dtmf_digit(pjsua_call_id call_id, int digit); static void on_dtmf_digit2(pjsua_call_id call_id, const pjsua_dtmf_info *info); + static void on_dtmf_event(pjsua_call_id call_id, + const pjsua_dtmf_event *event); static void on_call_transfer_request(pjsua_call_id call_id, const pj_str_t *dst, pjsip_status_code *code); @@ -1858,6 +2045,15 @@ pj_status_t status, const pjsua_ip_change_op_info *info); + static pj_status_t on_auth_create_aka_response_callback( + pj_pool_t *pool, + const pjsip_digest_challenge*chal, + const pjsip_cred_info *cred, + const pj_str_t *method, + pjsip_digest_credential *auth); + friend class Account; + + private: void clearCodecInfoList(CodecInfoVector &codec_list); void updateCodecInfoList(pjsua_codec_info pj_codec[], unsigned count, diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip/include/pjsua2/media.hpp asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip/include/pjsua2/media.hpp --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip/include/pjsua2/media.hpp 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip/include/pjsua2/media.hpp 2022-02-24 07:54:38.000000000 +0000 @@ -911,7 +911,6 @@ * Select or change capture sound device. Application may call this * function at any time to replace current sound device. Calling this * method will not change the state of the sound device (opened/closed). - * Note that this method will override the mode set by setSndDevMode(). * * @param capture_dev Device ID of the capture device. */ @@ -921,7 +920,6 @@ * Select or change playback sound device. Application may call this * function at any time to replace current sound device. Calling this * method will not change the state of the sound device (opened/closed). - * Note that this method will override the mode set by setSndDevMode(). * * @param playback_dev Device ID of the playback device. */ @@ -967,6 +965,10 @@ /** * Set sound device mode. + * + * Note that this method will open the sound device, using current + * active IDs set via setCaptureDev() or setPlaybackDev(), if the flag + * PJSUA_SND_DEV_NO_IMMEDIATE_OPEN is not specified. * * @param mode The sound device mode, as bitmask combination * of #pjsua_snd_dev_mode @@ -1682,6 +1684,16 @@ void stopTransmit(const VideoMedia &sink) const PJSUA2_THROW(Error); /** + * Update or refresh port states from video port info. Some port may + * change its port info in the middle of a session, for example when + * a video stream decoder learns that incoming video size or frame rate + * has changed, video conference needs to be informed to update its + * internal states. + * + */ + void update() const PJSUA2_THROW(Error); + + /** * Default Constructor. * * Normally application will not create VideoMedia object directly, @@ -1879,6 +1891,17 @@ */ void setFullScreen(bool enabled) PJSUA2_THROW(Error); + /** + * Set video window full-screen. This operation is valid only when the + * underlying video device supports PJMEDIA_VID_DEV_CAP_OUTPUT_FULLSCREEN + * capability. Currently it is only supported on SDL backend. + * + * @param mode Fullscreen mode, see + * pjmedia_vid_dev_fullscreen_flag. + */ + void setFullScreen2(pjmedia_vid_dev_fullscreen_flag mode) + PJSUA2_THROW(Error); + private: pjsua_vid_win_id winId; }; @@ -1987,6 +2010,8 @@ private: pjmedia_vid_dev_index devId; + pjsua_vid_win_id winId; + void updateDevId(); }; /** @@ -2073,6 +2098,19 @@ */ class VidDevManager { public: + + /** + * Initialize the video device subsystem. This will register all supported + * video device factories to the video device subsystem. + * + * By default, library will initialize video device subsystem automatically + * on library initialization, so application will never need to invoke this + * function. However, when PJSUA_DONT_INIT_VID_DEV_SUBSYS is set to + * non-zero, application should invoke this function before accessing + * video device. + */ + void initSubsys() PJSUA2_THROW(Error); + /** * Refresh the list of video devices installed in the system. This function * will only refresh the list of video device so all active video streams diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip/include/pjsua2/presence.hpp asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip/include/pjsua2/presence.hpp --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip/include/pjsua2/presence.hpp 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip/include/pjsua2/presence.hpp 2022-02-24 07:54:38.000000000 +0000 @@ -250,6 +250,13 @@ bool isValid() const; /** + * Get PJSUA-LIB buddy ID or index associated with this buddy. + * + * @return Integer greater than or equal to zero. + */ + int getId() const; + + /** * Get detailed buddy info. * * @return Buddy info. diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip/include/pjsua2/siptypes.hpp asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip/include/pjsua2/siptypes.hpp --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip/include/pjsua2/siptypes.hpp 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip/include/pjsua2/siptypes.hpp 2022-02-24 07:54:38.000000000 +0000 @@ -100,6 +100,16 @@ const string data); /** + * Convert from pjsip + */ + void fromPj(const pjsip_cred_info &prm); + + /** + * Convert to pjsip + */ + pjsip_cred_info toPj() const; + + /** * Read this object from a container node. * * @param node Container to read values from. @@ -315,6 +325,11 @@ * Specify the port range for socket binding, relative to the start * port number specified in \a port. Note that this setting is only * applicable when the start port number is non zero. + * + * Example: \a port=5000, \a portRange=4 + * - Available ports: 5000, 5001, 5002, 5003, 5004 (SIP transport) + * + * Available ports are in the range of [\a port, \a port + \a portRange]. * * Default value is zero. */ diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip/include/pjsua2/types.hpp asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip/include/pjsua2/types.hpp --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip/include/pjsua2/types.hpp 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip/include/pjsua2/types.hpp 2022-02-24 07:54:38.000000000 +0000 @@ -32,6 +32,7 @@ #include #include +#include /** PJSUA2 API is inside pj namespace */ namespace pj @@ -52,6 +53,9 @@ /** Array of integers */ typedef std::vector IntVector; +/** Map string to string */ +typedef std::map StringToStringMap; + /** * Type of token, i.e. arbitrary application user data */ diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip/include/pjsua-lib/pjsua.h asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip/include/pjsua-lib/pjsua.h --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip/include/pjsua-lib/pjsua.h 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip/include/pjsua-lib/pjsua.h 2022-02-24 07:54:38.000000000 +0000 @@ -286,6 +286,33 @@ /** Forward declaration for pj_stun_resolve_result */ typedef struct pj_stun_resolve_result pj_stun_resolve_result; +/** + * Initial memory block for PJSUA. + */ +#ifndef PJSUA_POOL_LEN +# define PJSUA_POOL_LEN 1000 +#endif + +/** + * Memory increment for PJSUA. + */ +#ifndef PJSUA_POOL_INC +# define PJSUA_POOL_INC 1000 +#endif + +/** + * Initial memory block for PJSUA account. + */ +#ifndef PJSUA_POOL_LEN_ACC +# define PJSUA_POOL_LEN_ACC 512 +#endif + +/** + * Memory increment for PJSUA account. + */ +#ifndef PJSUA_POOL_INC_ACC +# define PJSUA_POOL_INC_ACC 256 +#endif /** * Maximum proxies in account. @@ -368,6 +395,40 @@ /** + * Specify whether pjsua should disable automatically sending initial + * answer 100/Trying for incoming calls. If disabled, application can + * later send 100/Trying if it wishes using pjsua_call_answer(). + * + * Default: 0 (automatic sending enabled) + */ +#ifndef PJSUA_DISABLE_AUTO_SEND_100 +# define PJSUA_DISABLE_AUTO_SEND_100 0 +#endif + + +/** + * Default options that will be passed when creating ice transport. + * See #pjmedia_transport_ice_options. + */ +#ifndef PJSUA_ICE_TRANSPORT_OPTION +# define PJSUA_ICE_TRANSPORT_OPTION 0 +#endif + +/** + * Interval of checking for any new ICE candidate when trickle ICE is active. + * Trickle ICE gathers local ICE candidates, such as STUN and TURN candidates, + * in the background, while SDP offer/answer negotiation is being performed. + * Later, when any new ICE candidate is found, the endpoint will convey + * the candidate to the remote endpoint via SIP INFO. + * + * Default: 100 ms + */ +#ifndef PJSUA_TRICKLE_ICE_NEW_CAND_CHECK_INTERVAL +# define PJSUA_TRICKLE_ICE_NEW_CAND_CHECK_INTERVAL 100 +#endif + + +/** * This enumeration represents pjsua state. */ typedef enum pjsua_state @@ -504,6 +565,58 @@ /** + * Media stream info. + */ +typedef struct pjsua_stream_info +{ + /** Media type of this stream. */ + pjmedia_type type; + + /** Stream info (union). */ + union { + /** Audio stream info */ + pjmedia_stream_info aud; + + /** Video stream info */ + pjmedia_vid_stream_info vid; + } info; + +} pjsua_stream_info; + + +/** + * Media stream statistic. + */ +typedef struct pjsua_stream_stat +{ + /** RTCP statistic. */ + pjmedia_rtcp_stat rtcp; + + /** Jitter buffer statistic. */ + pjmedia_jb_state jbuf; + +} pjsua_stream_stat; + + +/** + * Structure to be passed to on stream precreate callback. + * See #on_stream_precreate(). + */ +typedef struct pjsua_on_stream_precreate_param +{ + /** + * Stream index in the media session, read-only. + */ + unsigned stream_idx; + + /** + * Parameters that the stream will be created from. + */ + pjsua_stream_info stream_info; +} pjsua_on_stream_precreate_param; + + +/** * Structure to be passed to on stream created callback. * See #on_stream_created2(). */ @@ -827,6 +940,13 @@ /** + * Constant to specify unknown duration in \a pjsua_dtmf_info and + * \a pjsua_dtmf_event. + */ +#define PJSUA_UNKNOWN_DTMF_DURATION ((unsigned)-1) + + +/** * This will contain the information of the callback \a on_dtmf_digit2. */ typedef struct pjsua_dtmf_info { @@ -836,13 +956,13 @@ pjsua_dtmf_method method; /** - * DTMF ASCII digit + * DTMF ASCII digit. */ unsigned digit; /** - * DTMF signal duration which might be included when sending DTMF using - * SIP INFO. + * DTMF signal duration. If the duration is unknown, this value is set to + * PJSUA_UNKNOWN_DTMF_DURATION. */ unsigned duration; @@ -850,6 +970,55 @@ /** + * This will contain the information of the callback \a on_dtmf_event. + */ +typedef struct pjsua_dtmf_event { + /** + * The method used to send DTMF. + */ + pjsua_dtmf_method method; + + /** + * The timestamp identifying the begin of the event. Timestamp units are + * expressed in milliseconds. + * Note that this value should only be used to compare multiple events + * received via the same method relatively to each other, as the time-base + * is randomized. + */ + unsigned timestamp; + + /** + * DTMF ASCII digit. + */ + unsigned digit; + + /** + * DTMF signal duration in milliseconds. Interpretation of the duration + * depends on the flag PJMEDIA_STREAM_DTMF_IS_END. + * If PJMEDIA_STREAM_DTMF_IS_END is set, this contains the total duration + * of the DTMF signal or PJSUA_UNKNOWN_DTMF_DURATION if the duration is + * unknown. + * If PJMEDIA_STREAM_DTMF_IS_END is not set, this contains the duration + * of the DTMF signal received up to this point in time. + * A duration of "0" indicates an infinitely long duration. + */ + unsigned duration; + + /** + * Flags indicating additional information about the DTMF event. + * If PJMEDIA_STREAM_DTMF_IS_UPDATE is set, the event was already + * indicated earlier. The new indication contains an updated event + * duration. + * If PJMEDIA_STREAM_DTMF_IS_END is set, the event has ended and this + * indication contains the final event duration. Note that end + * indications might get lost. Hence it is not guaranteed to receive + * an event with PJMEDIA_STREAM_DTMF_IS_END for every event. + */ + unsigned flags; +} pjsua_dtmf_event; + + +/** * Call settings. */ typedef struct pjsua_call_setting @@ -886,6 +1055,29 @@ */ unsigned vid_cnt; + /** + * Media direction. This setting will only be used if the flag + * PJSUA_CALL_SET_MEDIA_DIR is set, and it will persist for subsequent + * offers or answers. + * For example, a media that is set as PJMEDIA_DIR_ENCODING can only + * mark the stream in the SDP as sendonly or inactive, but will not + * become sendrecv in subsequent offers and answers. + * Application can update the media direction in any API or callback + * that accepts pjsua_call_setting as a parameter, such as via + * pjsua_call_reinvite/update() or in on_call_rx_offer/reinvite() + * callback. + * + * The index of the media dir will correspond to the provisional media + * in pjsua_call_info.prov_media. + * For offers that involve adding new medias (such as initial offer), + * the index will correspond to all new audio media first, then video. + * For example, for a new call with 2 audios and 1 video, media_dir[0] + * and media_dir[1] will be for the audios, and media_dir[2] video. + * + * Default: PJMEDIA_DIR_ENCODING_DECODING + */ + pjmedia_dir media_dir[PJMEDIA_MAX_SDP_MEDIA]; + } pjsua_call_setting; @@ -964,6 +1156,19 @@ pj_pool_t *pool, const pjmedia_sdp_session *rem_sdp); + /** + * Notify application when an audio media session is about to be created + * (as opposed to #on_stream_created() and #on_stream_created2() which are + * called *after* the session has been created). The application may change + * some stream info parameter values, i.e: jb_init, jb_min_pre, jb_max_pre, + * jb_max, use_ka, rtcp_sdes_bye_disabled, jb_discard_algo (audio), + * codec_param->enc_fmt (video). + * + * @param call_id Call identification. + * @param param The on stream precreate callback parameter. + */ + void (*on_stream_precreate)(pjsua_call_id call_id, + pjsua_on_stream_precreate_param *param); /** * Notify application when audio media session is created and before it is @@ -1014,7 +1219,7 @@ /** * Notify application upon incoming DTMF digits using RFC 2833 payload * formats. This callback will not be called if app implements \a - * on_dtmf_digit2(). + * on_dtmf_digit2() or \a on_dtmf_event(). * * @param call_id The call index. * @param digit DTMF ASCII digit. @@ -1023,7 +1228,8 @@ /** * Notify application upon incoming DTMF digits using the method specified - * in \a pjsua_dtmf_method. + * in \a pjsua_dtmf_method. This callback will not be called if app + * implements \a on_dtmf_event(). * * @param call_id The call index. * @param info The DTMF info. @@ -1031,6 +1237,17 @@ void (*on_dtmf_digit2)(pjsua_call_id call_id, const pjsua_dtmf_info *info); /** + * Notify application upon incoming DTMF digits using the method specified + * in \a pjsua_dtmf_method. Includes additional information about events + * received via RTP. + * + * @param call_id The call index. + * @param event The DTMF event. + */ + void (*on_dtmf_event)(pjsua_call_id call_id, + const pjsua_dtmf_event *event); + + /** * Notify application on call being transferred (i.e. REFER is received). * Application can decide to accept/reject transfer request * by setting the code (default is 202). When this callback @@ -1825,10 +2042,9 @@ /** * Maximum calls to support (default: 4). The value specified here - * must be smaller than the compile time maximum settings - * PJSUA_MAX_CALLS, which by default is 32. To increase this - * limit, the library must be recompiled with new PJSUA_MAX_CALLS - * value. + * must be smaller than or equal to the compile time maximum settings + * PJSUA_MAX_CALLS. To increase this limit, the library must be + * recompiled with new PJSUA_MAX_CALLS value. */ unsigned max_calls; @@ -2785,6 +3001,11 @@ * port number specified in \a port. Note that this setting is only * applicable when the start port number is non zero. * + * Example: \a port=5000, \a port_range=4 + * - Available ports: 5000, 5001, 5002, 5003, 5004 (SIP transport) + * + * Available ports are in the range of [\a port, \a port + \a port_range]. + * * Default value is zero. */ unsigned port_range; @@ -2962,7 +3183,7 @@ * * @return PJ_SUCCESS on success, or the appropriate error code. */ -PJ_DEF(pj_status_t) pjsua_tpfactory_register( pjsip_tpfactory *tf, +PJ_DECL(pj_status_t) pjsua_tpfactory_register( pjsip_tpfactory *tf, pjsua_transport_id *p_id); /** @@ -3009,16 +3230,18 @@ /** - * Close the transport. If transport is forcefully closed, it will be - * immediately closed, and any pending transactions that are using the - * transport may not terminate properly (it may even crash). Otherwise, - * the system will wait until all transactions are closed while preventing - * new users from using the transport, and will close the transport when - * it is safe to do so. + * Close the transport. The system will wait until all transactions are + * closed while preventing new users from using the transport, and will + * close the transport when it is safe to do so. + * + * NOTE: Forcefully closing transport (force = PJ_TRUE) is deprecated, + * since any pending transactions that are using the transport may not + * terminate properly and can even crash. Application wishing to immediately + * close the transport for the purpose of restarting it should use + * #pjsua_handle_ip_change() instead. * * @param id Transport ID. - * @param force Non-zero to immediately close the transport. This - * is not recommended! + * @param force Must be PJ_FALSE. force = PJ_TRUE is deprecated. * * @return PJ_SUCCESS on success, or the appropriate error code. */ @@ -3162,6 +3385,19 @@ # define PJSUA_REG_RETRY_INTERVAL 300 #endif +/** + * When the registration is successfull, the auto registration refresh will + * be sent before it expires. Setting this to 0 will disable it. + * This is useful for app that uses Push Notification and doesn't require auto + * registration refresh. App can periodically send refresh registration or + * send it before making a call.= + * See https://github.com/pjsip/pjproject/pull/2652 for more info. + * + * Default: 1 (enabled) + */ +#ifndef PJSUA_REG_AUTO_REG_REFRESH +# define PJSUA_REG_AUTO_REG_REFRESH 1 +#endif /** * This macro specifies the default value for \a contact_rewrite_method @@ -3462,6 +3698,17 @@ */ pj_str_t reg_contact_params; + /** + * Additional URI parameters that will be appended in the Contact URI + * for this account. This will only affect REGISTER requests and + * will be appended after \a contact_uri_params; + * + * The parameters should be preceeded by semicolon, and all strings must + * be properly escaped. Example: + * ";my-param=X;another-param=Hi%20there" + */ + pj_str_t reg_contact_uri_params; + /** * The optional custom SIP headers to be put in the presence * subscription request. @@ -3840,6 +4087,12 @@ /** * Media transport config. + * + * For \a port and \a port_range settings, RTCP port is selected as + * RTP port+1. + * Example: \a port=5000, \a port_range=4 + * - Available ports: 5000, 5002, 5004 (Media/RTP transport) + * 5001, 5003, 5005 (Media/RTCP transport) */ pjsua_transport_config rtp_cfg; @@ -4023,6 +4276,13 @@ * Default: PJ_FALSE (disabled) */ pj_bool_t use_stream_ka; + + /** + * Specify the keepalive configuration for stream. + * + * Default: see #pjmedia_stream_ka_config + */ + pjmedia_stream_ka_config stream_ka_cfg; #endif /** @@ -4605,7 +4865,7 @@ * Maximum simultaneous calls. */ #ifndef PJSUA_MAX_CALLS -# define PJSUA_MAX_CALLS 32 +# define PJSUA_MAX_CALLS 4 #endif /** @@ -4670,7 +4930,6 @@ /** * Requesting keyframe via Picture Loss Indication of RTCP feedback. - * This is currently not supported. */ PJSUA_VID_REQ_KEYFRAME_RTCP_PLI = 2 @@ -4917,43 +5176,14 @@ * useful in IP address change scenario where IP version has been changed * and application needs to update target IP address. */ - PJSUA_CALL_UPDATE_TARGET = 64 - -} pjsua_call_flag; - - -/** - * Media stream info. - */ -typedef struct pjsua_stream_info -{ - /** Media type of this stream. */ - pjmedia_type type; - - /** Stream info (union). */ - union { - /** Audio stream info */ - pjmedia_stream_info aud; + PJSUA_CALL_UPDATE_TARGET = 64, - /** Video stream info */ - pjmedia_vid_stream_info vid; - } info; - -} pjsua_stream_info; - - -/** - * Media stream statistic. - */ -typedef struct pjsua_stream_stat -{ - /** RTCP statistic. */ - pjmedia_rtcp_stat rtcp; - - /** Jitter buffer statistic. */ - pjmedia_jb_state jbuf; + /** + * Set media direction as specified in pjsua_call_setting.media_dir. + */ + PJSUA_CALL_SET_MEDIA_DIR = 128 -} pjsua_stream_stat; +} pjsua_call_flag; /** * This enumeration represents video stream operation on a call. @@ -5137,9 +5367,11 @@ PJ_DECL(unsigned) pjsua_call_get_max_count(void); /** - * Get number of currently active calls. + * Get the number of current calls. The number includes active calls + * (pjsua_call_is_active(call_id) == PJ_TRUE), as well as calls that + * are no longer active but still in the process of hanging up. * - * @return Number of currently active calls. + * @return Number of current calls. */ PJ_DECL(unsigned) pjsua_call_get_count(void); @@ -5417,6 +5649,19 @@ * while #pjsua_call_answer() only works with incoming calls on EARLY * state. * + * After calling this function, media will be deinitialized (call media + * callbacks, if any, will still be received) and then, on_call_state() + * will be immediately called with state DISCONNECTED. No further + * call callbacks will be received after this. The call hangup process + * itself (sending BYE, waiting for the response, and resource cleanup) + * will continue in the background and the call slot can be reused only + * after this process is completed. If application has limited call slots + * and would like to check if there are any free slots remaining, it can + * query the number of free slots using the APIs: + * pjsua_call_get_max_count()-pjsua_call_get_count() + * + * Note that on_call_tsx_state() will not be called when using this API. + * * @param call_id Call identification. * @param code Optional status code to be sent when we're rejecting * incoming call. If the value is zero, "603/Decline" @@ -5664,10 +5909,11 @@ * @param call_id Call identification. * @param mime_type Optional MIME type. If NULL, then "text/plain" is * assumed. - * @param content The message content. + * @param content The message content. Can be NULL if msg_data specifies + * body and/or multipart. * @param msg_data Optional list of headers etc to be included in outgoing * request. The body descriptor in the msg_data is - * ignored. + * ignored if parameter 'content' is set. * @param user_data Optional user data, which will be given back when * the IM callback is called. * @@ -5806,7 +6052,7 @@ * * @param call_id The call identification. * @param med_idx Media stream index. - * @param psi To be filled with the stream statistic. + * @param stat To be filled with the stream statistic. * * @return PJ_SUCCESS on success or the appropriate error. */ @@ -6214,10 +6460,11 @@ * @param to Remote URI. * @param mime_type Optional MIME type. If NULL, then "text/plain" is * assumed. - * @param content The message content. + * @param content The message content. Can be NULL if msg_data specifies + * body and/or multipart. * @param msg_data Optional list of headers etc to be included in outgoing * request. The body descriptor in the msg_data is - * ignored. + * ignored if parameter 'content' is set. * @param user_data Optional user data, which will be given back when * the IM callback is called. * @@ -6606,11 +6853,19 @@ /** * Set maximum delay that can be accomodated by the jitter buffer msec. * - * Default: -1 (to use default stream settings, currently 360 msec) + * Default: -1 (to use default stream settings, currently 500 msec) */ int jb_max; /** + * Set the algorithm the jitter buffer uses to discard frames in order to + * adjust the latency. + * + * Default: PJMEDIA_JB_DISCARD_PROGRESSIVE + */ + pjmedia_jb_discard_algo jb_discard_algo; + + /** * Enable ICE */ pj_bool_t enable_ice; @@ -7157,6 +7412,7 @@ * WAV files are supported, and the WAV file MUST be * formatted as 16bit PCM mono/single channel (any * clock rate is supported). + * Filename's length must be smaller than PJ_MAXPATH. * @param options Optional option flag. Application may specify * PJMEDIA_FILE_NO_LOOP to prevent playback loop. * @param p_id Pointer to receive player ID. @@ -7175,6 +7431,8 @@ * @param file_names Array of file names to be added to the play list. * Note that the files must have the same clock rate, * number of channels, and number of bits per sample. + * Each filename's length must be smaller than + * PJ_MAXPATH. * @param file_count Number of files in the array. * @param label Optional label to be set for the media port. * @param options Optional option flag. Application may specify @@ -7214,7 +7472,7 @@ * Get additional info about the file player. This operation is not valid * for playlist. * - * @param port The file player ID. + * @param id The file player ID. * @param info The info. * * @return PJ_SUCCESS on success or the appropriate error code. @@ -7269,6 +7527,7 @@ * @param filename Output file name. The function will determine the * default format to be used based on the file extension. * Currently ".wav" is supported on all platforms. + * Filename's length must be smaller than PJ_MAXPATH. * @param enc_type Optionally specify the type of encoder to be used to * compress the media, if the file can support different * encodings. This value must be zero for now. @@ -7373,6 +7632,10 @@ * Select or change sound device. Application may call this function at * any time to replace current sound device. * + * Note that this function will always try to open the sound device + * immediately. If immediate open is not preferred, use pjsua_set_snd_dev2() + * with PJSUA_SND_DEV_NO_IMMEDIATE_OPEN flag. + * * @param capture_dev Device ID of the capture device. * @param playback_dev Device ID of the playback device. * @@ -7382,13 +7645,23 @@ int playback_dev); /** + * Get sound device parameters such as playback & capture device IDs and mode. + * + * @param snd_param On return, it is set with sound device param. + * + * @return PJ_SUCCESS on success, or the appropriate error code. + */ +PJ_DECL(pj_status_t) pjsua_get_snd_dev2(pjsua_snd_dev_param *snd_param); + + +/** * Select or change sound device according to the specified param. * * @param snd_param Sound device param. * * @return PJ_SUCCESS on success, or the appropriate error code. */ -PJ_DECL(pj_status_t) pjsua_set_snd_dev2(pjsua_snd_dev_param *snd_param); +PJ_DECL(pj_status_t) pjsua_set_snd_dev2(const pjsua_snd_dev_param *snd_param); /** @@ -7551,7 +7824,7 @@ /** * Create an extra sound device and register it to conference bridge. * - * @param snd_param Sound device port param. Currently this only supports + * @param param Sound device port param. Currently this only supports * mono channel, so channel count must be set to 1. * @param p_snd The extra sound device instance. * @@ -7564,7 +7837,7 @@ /** * Destroy an extra sound device and unregister it from conference bridge. * - * @param p_snd The extra sound device instance. + * @param snd The extra sound device instance. * * @return PJ_SUCCESS on success or the appropriate error code. */ @@ -7707,6 +7980,31 @@ * Video devices API */ + +/** + * Controls whether PJSUA-LIB should not initialize video device subsystem + * in the PJSUA initialization. The video device subsystem initialization + * may need to open cameras to enumerates available cameras and their + * capabilities, which may not be preferable for some applications because + * it may trigger privacy-alert/permission notification on application startup + * (e.g: on Android app). + * + * If this is set, later application should manually initialize video device + * subsystem when it needs to use any video devices (camera and renderer), + * i.e: by invoking pjmedia_vid_dev_subsys_init() for PJSUA or + * VidDevManager::initSubsys() for PJSUA2. + * + * Note that pjmedia_vid_dev_subsys_init() should not be called multiple + * times (unless each has corresponding pjmedia_vid_dev_subsys_shutdown()), + * while VidDevManager::initSubsys() is safe to be called multiple times. + * + * Default: 0 (no) + */ +#ifndef PJSUA_DONT_INIT_VID_DEV_SUBSYS +# define PJSUA_DONT_INIT_VID_DEV_SUBSYS 0 +#endif + + /** * Get the number of video devices installed in the system. * @@ -7977,7 +8275,7 @@ /** * Enumerates all video windows. * - * @param id Array of window ID to be initialized. + * @param wids Array of window ID to be initialized. * @param count On input, specifies max elements in the array. * On return, it contains actual number of elements * that have been initialized. @@ -8076,13 +8374,14 @@ * capability. Currently it is only supported on SDL backend. * * @param wid The video window ID. - * @param enabled Set to PJ_TRUE if full screen is desired, PJ_FALSE - * otherwise. + * @param mode Fullscreen mode, see pjmedia_vid_dev_fullscreen_flag. * * @return PJ_SUCCESS on success, or the appropriate error code. */ -PJ_DECL(pj_status_t) pjsua_vid_win_set_fullscreen(pjsua_vid_win_id wid, - pj_bool_t enabled); +PJ_DECL(pj_status_t) pjsua_vid_win_set_fullscreen( + pjsua_vid_win_id wid, + pjmedia_vid_dev_fullscreen_flag mode); + /* * Video codecs API @@ -8285,6 +8584,20 @@ pjsua_conf_port_id sink); +/** + * Update or refresh port states from video port info. Some port may + * change its port info in the middle of a session, for example when + * a video stream decoder learns that incoming video size or frame rate + * has changed, video conference needs to be informed to update its + * internal states. + * + * @param port_id The slot id of the port to be updated. + * + * @return PJ_SUCCESS on success, or the appropriate error + * code. + */ +PJ_DECL(pj_status_t) pjsua_vid_conf_update_port(pjsua_conf_port_id port_id); + /* end of VIDEO API */ /** diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip/include/pjsua-lib/pjsua_internal.h asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip/include/pjsua-lib/pjsua_internal.h --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip/include/pjsua-lib/pjsua_internal.h 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip/include/pjsua-lib/pjsua_internal.h 2022-02-24 07:54:38.000000000 +0000 @@ -42,9 +42,11 @@ pjsua_call *call; /**< Parent call. */ pjmedia_type type; /**< Media type. */ unsigned idx; /**< This media index in parent call. */ + pj_str_t rem_mid; /**< Remote SDP "a=mid" attribute. */ pjsua_call_media_status state; /**< Media state. */ pjsua_call_media_status prev_state;/**< Previous media state. */ - pjmedia_dir dir; /**< Media direction. */ + pjmedia_dir def_dir; /**< Default media direction. */ + pjmedia_dir dir; /**< Current media direction. */ /** The stream */ struct { @@ -78,6 +80,14 @@ bit 0/LSB : sequence flag bit 1 : timestamp flag */ + pjmedia_type prev_type; /**< Previous media type */ + pjmedia_stream_info prev_aud_si; /**< Prev audio stream info */ + pjmedia_vid_stream_info prev_vid_si; /**< Prev video stream info */ + pj_bool_t prev_srtp_use; /**< Prev SRTP use */ + pjmedia_srtp_info prev_srtp_info;/**< Prev SRTP transport info*/ + pj_bool_t prev_ice_use; /**< Prev ICE use */ + pjmedia_ice_transport_info prev_ice_info; /**< Prev ICE transport info */ + pjmedia_transport *tp; /**< Current media transport (can be 0) */ pj_status_t tp_ready; /**< Media transport status. */ pj_status_t tp_result; /**< Media transport creation result. */ @@ -117,6 +127,14 @@ } call_answer; +/* Generic states */ +typedef enum pjsua_op_state { + PJSUA_OP_STATE_NULL, + PJSUA_OP_STATE_READY, + PJSUA_OP_STATE_RUNNING, + PJSUA_OP_STATE_DONE, +} pjsua_op_state; + /** * Structure to be attached to invite dialog. * Given a dialog "dlg", application can retrieve this structure @@ -205,6 +223,22 @@ created yet. This temporary variable is used to handle such case, see ticket #1916. */ + + struct { + pj_bool_t enabled; + pj_bool_t remote_sup; + pj_bool_t remote_dlg_est; + pjsua_op_state trickling; + int retrans18x_count; + pj_bool_t pending_info; + pj_timer_entry timer; + } trickle_ice; + + pj_timer_entry hangup_timer; /**< Hangup retry timer. */ + unsigned hangup_retry; /**< Number of hangup retries. */ + unsigned hangup_code; /**< Hangup code. */ + pj_str_t hangup_reason; /**< Hangup reason. */ + pjsua_msg_data *hangup_msg_data;/**< Hangup message data. */ }; @@ -279,6 +313,7 @@ 2: acknowledged by servers */ pj_str_t rfc5626_instprm;/**< SIP outbound instance param. */ pj_str_t rfc5626_regprm;/**< SIP outbound reg param. */ + unsigned rfc5626_flowtmr;/**< SIP outbound flow timer. */ unsigned cred_cnt; /**< Number of credentials. */ pjsip_cred_info cred[PJSUA_ACC_MAX_PROXIES]; /**< Complete creds. */ @@ -425,6 +460,15 @@ } pjsua_timer_list; +typedef struct pjsua_event_list +{ + PJ_DECL_LIST_MEMBER(struct pjsua_event_list); + pjmedia_event event; + pjsua_call_id call_id; + unsigned med_idx; +} pjsua_event_list; + + /** * Global pjsua application data. */ @@ -434,6 +478,7 @@ /* Control: */ pj_caching_pool cp; /**< Global pool factory. */ pj_pool_t *pool; /**< pjsua's private pool. */ + pj_pool_t *timer_pool;/**< pjsua's timer pool. */ pj_mutex_t *mutex; /**< Mutex protection for this data */ unsigned mutex_nesting_level; /**< Mutex nesting level. */ pj_thread_t *mutex_owner; /**< Mutex owner. */ @@ -536,8 +581,10 @@ pjsua_vid_win win[PJSUA_MAX_VID_WINS]; /**< Array of windows */ #endif - /* Timer entry list */ + /* Timer entry and event list */ + pjsua_timer_list active_timer_list; pjsua_timer_list timer_list; + pjsua_event_list event_list; pj_mutex_t *timer_mutex; }; @@ -618,6 +665,24 @@ return pjsua_var.mutex_owner == pj_thread_this(); } +/* Release all locks currently held by this thread. */ +PJ_INLINE(unsigned) PJSUA_RELEASE_LOCK() +{ + unsigned num_locks = 0; + while (PJSUA_LOCK_IS_LOCKED()) { + num_locks++; + PJSUA_UNLOCK(); + } + return num_locks; +} + +/* Re-acquire all the locks released by PJSUA_RELEASE_LOCK(). */ +PJ_INLINE(void) PJSUA_RELOCK(unsigned num_locks) +{ + for (; num_locks > 0; num_locks--) + PJSUA_LOCK(); +} + #else #define PJSUA_LOCK() #define PJSUA_TRY_LOCK() PJ_SUCCESS @@ -685,6 +750,10 @@ const pjmedia_sdp_session *remote_sdp); pj_status_t pjsua_media_channel_deinit(pjsua_call_id call_id); +void pjsua_ice_check_start_trickling(pjsua_call *call, + pj_bool_t forceful, + pjsip_event *e); + /* * Error message when media operation is requested while another is in progress */ @@ -702,16 +771,18 @@ void pjsua_set_media_tp_state(pjsua_call_media *call_med, pjsua_med_tp_st tp_st); void pjsua_media_prov_clean_up(pjsua_call_id call_id); +void pjsua_media_prov_revert(pjsua_call_id call_id); /* Callback to receive media events */ pj_status_t on_media_event(pjmedia_event *event, void *user_data); +void call_med_event_cb(void *user_data); pj_status_t call_media_on_event(pjmedia_event *event, void *user_data); /** * Init presence. */ -pj_status_t pjsua_pres_init(); +pj_status_t pjsua_pres_init(void); /* * Start presence subsystem. @@ -860,7 +931,7 @@ pjmedia_stream_info *si, const pjmedia_sdp_session *local_sdp, const pjmedia_sdp_session *remote_sdp); -void pjsua_check_snd_dev_idle(); +void pjsua_check_snd_dev_idle(void); /* * Video diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip/src/pjsip/sip_auth_aka.c asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip/src/pjsip/sip_auth_aka.c --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip/src/pjsip/sip_auth_aka.c 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip/src/pjsip/sip_auth_aka.c 2022-02-24 07:54:38.000000000 +0000 @@ -36,7 +36,7 @@ */ PJ_DEF(pj_status_t) pjsip_auth_create_aka_response( pj_pool_t *pool, - const pjsip_digest_challenge*chal, + const pjsip_digest_challenge *chal, const pjsip_cred_info *cred, const pj_str_t *method, pjsip_digest_credential *auth) diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip/src/pjsip/sip_auth_client.c asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip/src/pjsip/sip_auth_client.c --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip/src/pjsip/sip_auth_client.c 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip/src/pjsip/sip_auth_client.c 2022-02-24 07:54:38.000000000 +0000 @@ -34,6 +34,27 @@ #include +#if PJ_HAS_SSL_SOCK && PJ_SSL_SOCK_IMP==PJ_SSL_SOCK_IMP_OPENSSL +# if !defined(PJSIP_AUTH_HAS_DIGEST_SHA256) +# define PJSIP_AUTH_HAS_DIGEST_SHA256 1 +# endif +#else +# undef PJSIP_AUTH_HAS_DIGEST_SHA256 +# define PJSIP_AUTH_HAS_DIGEST_SHA256 0 +#endif + +#if PJSIP_AUTH_HAS_DIGEST_SHA256 +# include +# ifdef _MSC_VER +# include +# if OPENSSL_VERSION_NUMBER >= 0x10100000L +# pragma comment(lib, "libcrypto") +# else +# pragma comment(lib, "libeay32") +# pragma comment(lib, "ssleay32") +# endif +# endif +#endif /* A macro just to get rid of type mismatch between char and unsigned char */ #define MD5_APPEND(pms,buf,len) pj_md5_update(pms, (const pj_uint8_t*)buf, \ @@ -125,12 +146,12 @@ * * NOTE: THE OUTPUT STRING IS NOT NULL TERMINATED! */ -static void digest2str(const unsigned char digest[], char *output) +static void digestNtoStr(const unsigned char digest[], int n, char *output) { int i; - for (i = 0; i<16; ++i) { - pj_val_to_hex_digit(digest[i], output); - output += 2; + for (i = 0; idata.ptr, cred_info->data.slen); pj_md5_final(&pms, digest); - digest2str(digest, ha1); + digestNtoStr(digest, 16, ha1); } else if ((cred_info->data_type & PASSWD_MASK) == PJSIP_CRED_DATA_DIGEST) { pj_assert(cred_info->data.slen == 32); @@ -189,7 +210,7 @@ MD5_APPEND( &pms, ":", 1); MD5_APPEND( &pms, uri->ptr, uri->slen); pj_md5_final(&pms, digest); - digest2str(digest, ha2); + digestNtoStr(digest, 16, ha2); AUTH_TRACE_((THIS_FILE, " ha2=%.32s", ha2)); @@ -220,12 +241,122 @@ /* Convert digest to string and store in chal->response. */ result->slen = PJSIP_MD5STRLEN; - digest2str(digest, result->ptr); + digestNtoStr(digest, 16, result->ptr); AUTH_TRACE_((THIS_FILE, " digest=%.32s", result->ptr)); AUTH_TRACE_((THIS_FILE, "Digest created")); } + +/* + * Create response SHA-256 digest based on the parameters and store the + * digest ASCII in 'result'. + */ +PJ_DEF(void) pjsip_auth_create_digestSHA256(pj_str_t *result, + const pj_str_t *nonce, + const pj_str_t *nc, + const pj_str_t *cnonce, + const pj_str_t *qop, + const pj_str_t *uri, + const pj_str_t *realm, + const pjsip_cred_info *cred_info, + const pj_str_t *method) +{ +#if PJSIP_AUTH_HAS_DIGEST_SHA256 + + char ha1[PJSIP_SHA256STRLEN]; + char ha2[PJSIP_SHA256STRLEN]; + unsigned char digest[32]; + SHA256_CTX pms; + + pj_assert(result->slen >= PJSIP_SHA256STRLEN); + + AUTH_TRACE_((THIS_FILE, "Begin creating digest")); + + if ((cred_info->data_type & PASSWD_MASK) == PJSIP_CRED_DATA_PLAIN_PASSWD) + { + /*** + *** ha1 = SHA256(username ":" realm ":" password) + ***/ + SHA256_Init(&pms); + SHA256_Update( &pms, cred_info->username.ptr, + cred_info->username.slen); + SHA256_Update( &pms, ":", 1); + SHA256_Update( &pms, realm->ptr, realm->slen); + SHA256_Update( &pms, ":", 1); + SHA256_Update( &pms, cred_info->data.ptr, cred_info->data.slen); + SHA256_Final(digest, &pms); + + digestNtoStr(digest, 32, ha1); + + } else if ((cred_info->data_type & PASSWD_MASK) == PJSIP_CRED_DATA_DIGEST) + { + pj_assert(cred_info->data.slen == 32); + pj_memcpy( ha1, cred_info->data.ptr, cred_info->data.slen ); + } else { + pj_assert(!"Invalid data_type"); + } + + AUTH_TRACE_((THIS_FILE, " ha1=%.64s", ha1)); + + /*** + *** ha2 = SHA256(method ":" req_uri) + ***/ + SHA256_Init(&pms); + SHA256_Update( &pms, method->ptr, method->slen); + SHA256_Update( &pms, ":", 1); + SHA256_Update( &pms, uri->ptr, uri->slen); + SHA256_Final( digest, &pms); + digestNtoStr(digest, 32, ha2); + + AUTH_TRACE_((THIS_FILE, " ha2=%.64s", ha2)); + + /*** + *** When qop is not used: + *** response = SHA256(ha1 ":" nonce ":" ha2) + *** + *** When qop=auth is used: + *** response = SHA256(ha1 ":" nonce ":" nc ":" cnonce ":" qop ":" ha2) + ***/ + SHA256_Init(&pms); + SHA256_Update( &pms, ha1, PJSIP_SHA256STRLEN); + SHA256_Update( &pms, ":", 1); + SHA256_Update( &pms, nonce->ptr, nonce->slen); + if (qop && qop->slen != 0) { + SHA256_Update( &pms, ":", 1); + SHA256_Update( &pms, nc->ptr, nc->slen); + SHA256_Update( &pms, ":", 1); + SHA256_Update( &pms, cnonce->ptr, cnonce->slen); + SHA256_Update( &pms, ":", 1); + SHA256_Update( &pms, qop->ptr, qop->slen); + } + SHA256_Update( &pms, ":", 1); + SHA256_Update( &pms, ha2, PJSIP_SHA256STRLEN); + + /* This is the final response digest. */ + SHA256_Final(digest, &pms); + + /* Convert digest to string and store in chal->response. */ + result->slen = PJSIP_SHA256STRLEN; + digestNtoStr(digest, 32, result->ptr); + + AUTH_TRACE_((THIS_FILE, " digest=%.64s", result->ptr)); + AUTH_TRACE_((THIS_FILE, "Digest created")); + +#else + PJ_UNUSED_ARG(result); + PJ_UNUSED_ARG(nonce); + PJ_UNUSED_ARG(nc); + PJ_UNUSED_ARG(cnonce); + PJ_UNUSED_ARG(qop); + PJ_UNUSED_ARG(uri); + PJ_UNUSED_ARG(realm); + PJ_UNUSED_ARG(cred_info); + PJ_UNUSED_ARG(method); +#endif +} + + /* * Finds out if qop offer contains "auth" token. */ @@ -276,13 +407,21 @@ const pj_str_t *method) { const pj_str_t pjsip_AKAv1_MD5_STR = { "AKAv1-MD5", 9 }; + pj_bool_t algo_sha256 = PJ_FALSE; + + /* Check if algo is sha256 */ +#if PJSIP_AUTH_HAS_DIGEST_SHA256 + algo_sha256 = (pj_stricmp(&chal->algorithm, &pjsip_SHA256_STR)==0); +#endif - /* Check algorithm is supported. We support MD5 and AKAv1-MD5. */ + /* Check algorithm is supported. We support MD5, AKAv1-MD5, and SHA256. */ if (chal->algorithm.slen==0 || - (pj_stricmp(&chal->algorithm, &pjsip_MD5_STR)==0 || - pj_stricmp(&chal->algorithm, &pjsip_AKAv1_MD5_STR)==0)) + (algo_sha256 || + pj_stricmp(&chal->algorithm, &pjsip_MD5_STR)==0 || + pj_stricmp(&chal->algorithm, &pjsip_AKAv1_MD5_STR)==0)) { - ; + PJ_LOG(4,(THIS_FILE, "Digest algorithm is \"%.*s\"", + chal->algorithm.slen, chal->algorithm.ptr)); } else { PJ_LOG(4,(THIS_FILE, "Unsupported digest algorithm \"%.*s\"", @@ -299,8 +438,8 @@ pj_strdup(pool, &cred->opaque, &chal->opaque); /* Allocate memory. */ - cred->response.ptr = (char*) pj_pool_alloc(pool, PJSIP_MD5STRLEN); - cred->response.slen = PJSIP_MD5STRLEN; + cred->response.slen = algo_sha256? PJSIP_SHA256STRLEN : PJSIP_MD5STRLEN; + cred->response.ptr = (char*) pj_pool_alloc(pool, cred->response.slen); if (chal->qop.slen == 0) { /* Server doesn't require quality of protection. */ @@ -312,9 +451,16 @@ } else { /* Convert digest to string and store in chal->response. */ - pjsip_auth_create_digest( &cred->response, &cred->nonce, NULL, - NULL, NULL, uri, &chal->realm, - cred_info, method); + if (algo_sha256) { + pjsip_auth_create_digestSHA256( + &cred->response, &cred->nonce, NULL, + NULL, NULL, uri, &chal->realm, + cred_info, method); + } else { + pjsip_auth_create_digest( &cred->response, &cred->nonce, NULL, + NULL, NULL, uri, &chal->realm, + cred_info, method); + } } } else if (has_auth_qop(pool, &chal->qop)) { @@ -338,9 +484,21 @@ method, cred); } else { - pjsip_auth_create_digest( &cred->response, &cred->nonce, - &cred->nc, &cred->cnonce, &pjsip_AUTH_STR, - uri, &chal->realm, cred_info, method ); + /* Convert digest to string and store in chal->response. */ + if (algo_sha256) { + pjsip_auth_create_digestSHA256( + &cred->response, &cred->nonce, + &cred->nc, &cred->cnonce, + &pjsip_AUTH_STR, uri, + &chal->realm, cred_info, + method); + } else { + pjsip_auth_create_digest( &cred->response, &cred->nonce, + &cred->nc, &cred->cnonce, + &pjsip_AUTH_STR, uri, + &chal->realm, cred_info, + method); + } } } else { @@ -400,7 +558,7 @@ PJSIP_AUTH_CNONCE_USE_DIGITS_ONLY!=0 if (pj_strchr(&cached_auth->cnonce, '-')) { /* remove hyphen character. */ - int w, r, len = pj_strlen(&cached_auth->cnonce); + pj_size_t w, r, len = pj_strlen(&cached_auth->cnonce); char *s = cached_auth->cnonce.ptr; w = r = 0; @@ -644,7 +802,7 @@ pj_memcpy(&sess->pref, p, sizeof(*p)); pj_strdup(sess->pool, &sess->pref.algorithm, &p->algorithm); //if (sess->pref.algorithm.slen == 0) - // sess->pref.algorithm = pj_str("md5"); + // sess->pref.algorithm = pj_str("MD5"); return PJ_SUCCESS; } @@ -1042,7 +1200,7 @@ pjsip_hdr *hdr; pj_status_t status; - /* See if we have sent authorization header for this realm */ + /* See if we have sent authorization header for this realm (and scheme) */ hdr = tdata->msg->hdr.next; while (hdr != &tdata->msg->hdr) { if ((hchal->type == PJSIP_H_WWW_AUTHENTICATE && @@ -1052,7 +1210,8 @@ { sent_auth = (pjsip_authorization_hdr*) hdr; if (pj_stricmp(&hchal->challenge.common.realm, - &sent_auth->credential.common.realm )==0) + &sent_auth->credential.common.realm)==0 && + pj_stricmp(&hchal->scheme, &sent_auth->scheme)==0) { /* If this authorization has empty response, remove it. */ if (pj_stricmp(&sent_auth->scheme, &pjsip_DIGEST_STR)==0 && @@ -1062,6 +1221,14 @@ hdr = hdr->next; pj_list_erase(sent_auth); continue; + } else + if (pj_stricmp(&sent_auth->scheme, &pjsip_DIGEST_STR)==0 && + pj_stricmp(&sent_auth->credential.digest.algorithm, + &hchal->challenge.digest.algorithm)!=0) + { + /* Same 'digest' scheme but different algo */ + hdr = hdr->next; + continue; } else { /* Found previous authorization attempt */ break; @@ -1155,9 +1322,10 @@ { pjsip_tx_data *tdata; const pjsip_hdr *hdr; - unsigned chal_cnt; + unsigned chal_cnt, auth_cnt; pjsip_via_hdr *via; pj_status_t status; + pj_status_t last_auth_err; PJ_ASSERT_RETURN(sess && rdata && old_request && new_request, PJ_EINVAL); @@ -1178,7 +1346,9 @@ */ hdr = rdata->msg_info.msg->hdr.next; chal_cnt = 0; - while (hdr != &rdata->msg_info.msg->hdr) { + auth_cnt = 0; + last_auth_err = PJSIP_EAUTHNOAUTH; + while (hdr != &rdata->msg_info.msg->hdr && auth_cnt == 0) { pjsip_cached_auth *cached_auth; const pjsip_www_authenticate_hdr *hchal; pjsip_authorization_hdr *hauth; @@ -1222,8 +1392,13 @@ */ status = process_auth(tdata->pool, hchal, tdata->msg->line.req.uri, tdata, sess, cached_auth, &hauth); - if (status != PJ_SUCCESS) - return status; + if (status != PJ_SUCCESS) { + last_auth_err = status; + + /* Process next header. */ + hdr = hdr->next; + continue; + } if (pj_pool_get_used_size(cached_auth->pool) > PJSIP_AUTH_CACHED_POOL_MAX_SIZE) @@ -1236,12 +1411,17 @@ /* Process next header. */ hdr = hdr->next; + auth_cnt++; } /* Check if challenge is present */ if (chal_cnt == 0) return PJSIP_EAUTHNOCHAL; + /* Check if any authorization header has been created */ + if (auth_cnt == 0) + return last_auth_err; + /* Remove branch param in Via header. */ via = (pjsip_via_hdr*) pjsip_msg_find_hdr(tdata->msg, PJSIP_H_VIA, NULL); via->branch_param.slen = 0; diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip/src/pjsip/sip_auth_parser.c asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip/src/pjsip/sip_auth_parser.c --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip/src/pjsip/sip_auth_parser.c 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip/src/pjsip/sip_auth_parser.c 2022-02-24 07:54:38.000000000 +0000 @@ -60,8 +60,10 @@ pjsip_PGP_STR = { "PGP", 3 }, pjsip_QUOTED_PGP_STR = { "\"PGP\"", 5 }, pjsip_BEARER_STR = { "Bearer", 6 }, - pjsip_MD5_STR = { "md5", 3 }, - pjsip_QUOTED_MD5_STR = { "\"md5\"", 5}, + pjsip_MD5_STR = { "MD5", 3 }, + pjsip_QUOTED_MD5_STR = { "\"MD5\"", 5}, + pjsip_SHA256_STR = { "SHA-256", 7 }, + pjsip_QUOTED_SHA256_STR = { "\"SHA-256\"", 9}, pjsip_AUTH_STR = { "auth", 4}, pjsip_QUOTED_AUTH_STR = { "\"auth\"", 6 }; diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip/src/pjsip/sip_config.c asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip/src/pjsip/sip_config.c --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip/src/pjsip/sip_config.c 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip/src/pjsip/sip_config.c 2022-02-24 07:54:38.000000000 +0000 @@ -36,7 +36,8 @@ PJSIP_RESOLVE_HOSTNAME_TO_GET_INTERFACE, 0, PJSIP_ENCODE_SHORT_HNAME, - PJSIP_ACCEPT_MULTIPLE_SDP_ANSWERS + PJSIP_ACCEPT_MULTIPLE_SDP_ANSWERS, + 0 }, /* Transaction settings */ diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip/src/pjsip/sip_dialog.c asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip/src/pjsip/sip_dialog.c --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip/src/pjsip/sip_dialog.c 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip/src/pjsip/sip_dialog.c 2022-02-24 07:54:38.000000000 +0000 @@ -467,6 +467,10 @@ /* Save the remote info. */ pj_strdup(dlg->pool, &dlg->remote.info_str, &tmp); + + /* Save initial destination host from transport's info */ + pj_strdup(dlg->pool, &dlg->initial_dest, + &rdata->tp_info.transport->remote_name.host); /* Init remote's contact from Contact header. @@ -1192,6 +1196,12 @@ return status; } + /* Copy the initial destination host to tdata. This information can be + * used later by transport for transport selection. + */ + if (dlg->initial_dest.slen) + pj_strdup(tdata->pool, &tdata->dest_info.name, &dlg->initial_dest); + /* Done. */ *p_tdata = tdata; @@ -1217,9 +1227,9 @@ /* Lock dialog. */ pjsip_dlg_inc_lock(dlg); - /* Use outgoing CSeq and increment it by one. */ + /* Use outgoing CSeq, if set to -1 (other than ACK/CANCEL). */ if (cseq < 0) - cseq = dlg->local.cseq + 1; + cseq = dlg->local.cseq; /* Keep compiler happy */ status = PJ_EBUG; @@ -1822,6 +1832,11 @@ * transaction as the initial transaction that establishes dialog. */ if (dlg->role == PJSIP_ROLE_UAC) { + /* Save initial destination host from transport's info. */ + if (!dlg->initial_dest.slen) { + pj_strdup(dlg->pool, &dlg->initial_dest, + &rdata->tp_info.transport->remote_name.host); + } /* Ignore subsequent request from remote */ if (msg->type != PJSIP_RESPONSE_MSG) diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip/src/pjsip/sip_msg.c asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip/src/pjsip/sip_msg.c --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip/src/pjsip/sip_msg.c 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip/src/pjsip/sip_msg.c 2022-02-24 07:54:38.000000000 +0000 @@ -162,9 +162,11 @@ pj_strset2( &status_phrase[181], "Call Is Being Forwarded"); pj_strset2( &status_phrase[182], "Queued"); pj_strset2( &status_phrase[183], "Session Progress"); + pj_strset2( &status_phrase[199], "Early Dialog Terminated"); pj_strset2( &status_phrase[200], "OK"); pj_strset2( &status_phrase[202], "Accepted"); + pj_strset2( &status_phrase[204], "No Notification"); pj_strset2( &status_phrase[300], "Multiple Choices"); pj_strset2( &status_phrase[301], "Moved Permanently"); @@ -181,15 +183,31 @@ pj_strset2( &status_phrase[406], "Not Acceptable"); pj_strset2( &status_phrase[407], "Proxy Authentication Required"); pj_strset2( &status_phrase[408], "Request Timeout"); + pj_strset2( &status_phrase[409], "Conflict"); pj_strset2( &status_phrase[410], "Gone"); + pj_strset2( &status_phrase[411], "Length Required"); + pj_strset2( &status_phrase[412], "Conditional Request Failed"); pj_strset2( &status_phrase[413], "Request Entity Too Large"); - pj_strset2( &status_phrase[414], "Request URI Too Long"); + pj_strset2( &status_phrase[414], "Request-URI Too Long"); pj_strset2( &status_phrase[415], "Unsupported Media Type"); pj_strset2( &status_phrase[416], "Unsupported URI Scheme"); + pj_strset2( &status_phrase[417], "Unknown Resource-Priority"); pj_strset2( &status_phrase[420], "Bad Extension"); pj_strset2( &status_phrase[421], "Extension Required"); - pj_strset2( &status_phrase[422], "Session Timer Too Small"); + pj_strset2( &status_phrase[422], "Session Interval Too Small"); pj_strset2( &status_phrase[423], "Interval Too Brief"); + pj_strset2( &status_phrase[424], "Bad Location Information"); + pj_strset2( &status_phrase[428], "Use Identity Header"); + pj_strset2( &status_phrase[429], "Provide Referrer Identity"); + pj_strset2( &status_phrase[430], "Flow Failed"); + pj_strset2( &status_phrase[433], "Anonymity Disallowed"); + pj_strset2( &status_phrase[436], "Bad Identity-Info"); + pj_strset2( &status_phrase[437], "Unsupported Certificate"); + pj_strset2( &status_phrase[438], "Invalid Identity Header"); + pj_strset2( &status_phrase[439], "First Hop Lacks Outbound Support"); + pj_strset2( &status_phrase[440], "Max-Breadth Exceeded"); + pj_strset2( &status_phrase[469], "Bad Info Package"); + pj_strset2( &status_phrase[470], "Consent Needed"); pj_strset2( &status_phrase[480], "Temporarily Unavailable"); pj_strset2( &status_phrase[481], "Call/Transaction Does Not Exist"); pj_strset2( &status_phrase[482], "Loop Detected"); @@ -203,20 +221,24 @@ pj_strset2( &status_phrase[490], "Request Updated"); pj_strset2( &status_phrase[491], "Request Pending"); pj_strset2( &status_phrase[493], "Undecipherable"); + pj_strset2( &status_phrase[494], "Security Agreement Required"); - pj_strset2( &status_phrase[500], "Internal Server Error"); + pj_strset2( &status_phrase[500], "Server Internal Error"); pj_strset2( &status_phrase[501], "Not Implemented"); pj_strset2( &status_phrase[502], "Bad Gateway"); pj_strset2( &status_phrase[503], "Service Unavailable"); - pj_strset2( &status_phrase[504], "Server Timeout"); + pj_strset2( &status_phrase[504], "Server Time-out"); pj_strset2( &status_phrase[505], "Version Not Supported"); pj_strset2( &status_phrase[513], "Message Too Large"); + pj_strset2( &status_phrase[555], "Push Notification Service Not Supported"); pj_strset2( &status_phrase[580], "Precondition Failure"); pj_strset2( &status_phrase[600], "Busy Everywhere"); pj_strset2( &status_phrase[603], "Decline"); pj_strset2( &status_phrase[604], "Does Not Exist Anywhere"); pj_strset2( &status_phrase[606], "Not Acceptable"); + pj_strset2( &status_phrase[607], "Unwanted"); + pj_strset2( &status_phrase[608], "Rejected"); pj_strset2( &status_phrase[701], "No response from destination server"); pj_strset2( &status_phrase[702], "Unable to resolve destination server"); @@ -334,13 +356,13 @@ return dst; } -PJ_DEF(void*) pjsip_msg_find_hdr( const pjsip_msg *msg, - pjsip_hdr_e hdr_type, const void *start) +PJ_DEF(void*) pjsip_hdr_find( const void *hdr_list, + pjsip_hdr_e hdr_type, const void *start) { - const pjsip_hdr *hdr=(const pjsip_hdr*) start, *end=&msg->hdr; + const pjsip_hdr *hdr=(const pjsip_hdr*) start, *end=hdr_list; if (hdr == NULL) { - hdr = msg->hdr.next; + hdr = end->next; } for (; hdr!=end; hdr = hdr->next) { if (hdr->type == hdr_type) @@ -349,14 +371,14 @@ return NULL; } -PJ_DEF(void*) pjsip_msg_find_hdr_by_name( const pjsip_msg *msg, - const pj_str_t *name, - const void *start) +PJ_DEF(void*) pjsip_hdr_find_by_name( const void *hdr_list, + const pj_str_t *name, + const void *start) { - const pjsip_hdr *hdr=(const pjsip_hdr*)start, *end=&msg->hdr; + const pjsip_hdr *hdr=(const pjsip_hdr*) start, *end=hdr_list; if (hdr == NULL) { - hdr = msg->hdr.next; + hdr = end->next; } for (; hdr!=end; hdr = hdr->next) { if (pj_stricmp(&hdr->name, name) == 0) @@ -365,15 +387,15 @@ return NULL; } -PJ_DEF(void*) pjsip_msg_find_hdr_by_names( const pjsip_msg *msg, - const pj_str_t *name, - const pj_str_t *sname, - const void *start) +PJ_DEF(void*) pjsip_hdr_find_by_names( const void *hdr_list, + const pj_str_t *name, + const pj_str_t *sname, + const void *start) { - const pjsip_hdr *hdr=(const pjsip_hdr*)start, *end=&msg->hdr; + const pjsip_hdr *hdr=(const pjsip_hdr*) start, *end=hdr_list; if (hdr == NULL) { - hdr = msg->hdr.next; + hdr = end->next; } for (; hdr!=end; hdr = hdr->next) { if (pj_stricmp(&hdr->name, name) == 0) @@ -384,6 +406,27 @@ return NULL; } +PJ_DEF(void*) pjsip_msg_find_hdr( const pjsip_msg *msg, + pjsip_hdr_e hdr_type, const void *start) +{ + return pjsip_hdr_find(&msg->hdr, hdr_type, start); +} + +PJ_DEF(void*) pjsip_msg_find_hdr_by_name( const pjsip_msg *msg, + const pj_str_t *name, + const void *start) +{ + return pjsip_hdr_find_by_name(&msg->hdr, name, start); +} + +PJ_DEF(void*) pjsip_msg_find_hdr_by_names( const pjsip_msg *msg, + const pj_str_t *name, + const pj_str_t *sname, + const void *start) +{ + return pjsip_hdr_find_by_names(&msg->hdr, name, sname, start); +} + PJ_DEF(void*) pjsip_msg_find_remove_hdr( pjsip_msg *msg, pjsip_hdr_e hdr_type, void *start) { diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip/src/pjsip/sip_multipart.c asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip/src/pjsip/sip_multipart.c --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip/src/pjsip/sip_multipart.c 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip/src/pjsip/sip_multipart.c 2022-02-24 07:54:38.000000000 +0000 @@ -19,6 +19,7 @@ #include #include #include +#include #include #include #include @@ -416,6 +417,218 @@ return NULL; } +/* + * Find a body inside multipart bodies which has the header and value. + */ +PJ_DEF(pjsip_multipart_part*) +pjsip_multipart_find_part_by_header_str(pj_pool_t *pool, + const pjsip_msg_body *mp, + const pj_str_t *hdr_name, + const pj_str_t *hdr_value, + const pjsip_multipart_part *start) +{ + struct multipart_data *m_data; + pjsip_multipart_part *part; + pjsip_hdr *found_hdr; + pj_str_t found_hdr_str; + pj_str_t found_hdr_value; + pj_size_t expected_hdr_slen; + pj_size_t buf_size; + pj_ssize_t hdr_name_len; +#define REASONABLE_PADDING 32 +#define SEPARATOR_LEN 2 + /* Must specify mandatory params */ + PJ_ASSERT_RETURN(mp && hdr_name && hdr_value, NULL); + + /* mp must really point to an actual multipart msg body */ + PJ_ASSERT_RETURN(mp->print_body==&multipart_print_body, NULL); + + /* + * We'll need to "print" each header we find to test it but + * allocating a buffer of PJSIP_MAX_URL_SIZE is overkill. + * Instead, we'll allocate one large enough to hold the search + * header name, the ": " separator, the search hdr value, and + * the NULL terminator. If we can't print the found header + * into that buffer then it can't be a match. + * + * Some header print functions such as generic_int require enough + * space to print the maximum possible header length so we'll + * add a reasonable amount to the print buffer size. + */ + expected_hdr_slen = hdr_name->slen + SEPARATOR_LEN + hdr_value->slen; + buf_size = expected_hdr_slen + REASONABLE_PADDING; + found_hdr_str.ptr = pj_pool_alloc(pool, buf_size); + found_hdr_str.slen = 0; + hdr_name_len = hdr_name->slen + SEPARATOR_LEN; + + m_data = (struct multipart_data*)mp->data; + + if (start) + part = start->next; + else + part = m_data->part_head.next; + + while (part != &m_data->part_head) { + found_hdr = NULL; + while ((found_hdr = pjsip_hdr_find_by_name(&part->hdr, hdr_name, + (found_hdr ? found_hdr->next : NULL))) != NULL) { + + found_hdr_str.slen = pjsip_hdr_print_on((void*) found_hdr, found_hdr_str.ptr, buf_size); + /* + * If the buffer was too small (slen = -1) or the result wasn't + * the same length as the search header, it can't be a match. + */ + if (found_hdr_str.slen != (pj_ssize_t)expected_hdr_slen) { + continue; + } + /* + * Set the value overlay to start at the found header value... + */ + found_hdr_value.ptr = found_hdr_str.ptr + hdr_name_len; + found_hdr_value.slen = found_hdr_str.slen - hdr_name_len; + /* ...and compare it to the supplied header value. */ + if (pj_strcmp(hdr_value, &found_hdr_value) == 0) { + return part; + } + } + part = part->next; + } + return NULL; +#undef SEPARATOR_LEN +#undef REASONABLE_PADDING +} + +PJ_DEF(pjsip_multipart_part*) +pjsip_multipart_find_part_by_header(pj_pool_t *pool, + const pjsip_msg_body *mp, + void *search_for, + const pjsip_multipart_part *start) +{ + pjsip_hdr *search_hdr = search_for; + pj_str_t search_buf; + + /* Must specify mandatory params */ + PJ_ASSERT_RETURN(mp && search_hdr, NULL); + + /* mp must really point to an actual multipart msg body */ + PJ_ASSERT_RETURN(mp->print_body==&multipart_print_body, NULL); + + /* + * Unfortunately, there isn't enough information to determine + * the maximum printed size of search_hdr at this point so we + * have to allocate a reasonable max. + */ + search_buf.ptr = pj_pool_alloc(pool, PJSIP_MAX_URL_SIZE); + search_buf.slen = pjsip_hdr_print_on(search_hdr, search_buf.ptr, PJSIP_MAX_URL_SIZE - 1); + if (search_buf.slen <= 0) { + return NULL; + } + /* + * Set the header value to start after the header name plus the ":", then + * strip leading and trailing whitespace. + */ + search_buf.ptr += (search_hdr->name.slen + 1); + search_buf.slen -= (search_hdr->name.slen + 1); + pj_strtrim(&search_buf); + + return pjsip_multipart_find_part_by_header_str(pool, mp, &search_hdr->name, &search_buf, start); +} + +/* + * Convert a Content-ID URI to it's corresponding header value. + * RFC2392 says... + * A "cid" URL is converted to the corresponding Content-ID message + * header by removing the "cid:" prefix, converting the % encoded + * character(s) to their equivalent US-ASCII characters, and enclosing + * the remaining parts with an angle bracket pair, "<" and ">". + * + * This implementation will accept URIs with or without the "cid:" + * scheme and optional angle brackets. + */ +static pj_str_t cid_uri_to_hdr_value(pj_pool_t *pool, pj_str_t *cid_uri) +{ + pj_size_t cid_len = pj_strlen(cid_uri); + pj_size_t alloc_len = cid_len + 2 /* for the leading and trailing angle brackets */; + pj_str_t uri_overlay; + pj_str_t cid_hdr; + pj_str_t hdr_overlay; + + pj_strassign(&uri_overlay, cid_uri); + /* If the URI is already enclosed in angle brackets, remove them. */ + if (uri_overlay.ptr[0] == '<') { + uri_overlay.ptr++; + uri_overlay.slen -= 2; + } + /* If the URI starts with the "cid:" scheme, skip over it. */ + if (pj_strncmp2(&uri_overlay, "cid:", 4) == 0) { + uri_overlay.ptr += 4; + uri_overlay.slen -= 4; + } + /* Start building */ + cid_hdr.ptr = pj_pool_alloc(pool, alloc_len); + cid_hdr.ptr[0] = '<'; + cid_hdr.slen = 1; + hdr_overlay.ptr = cid_hdr.ptr + 1; + hdr_overlay.slen = 0; + pj_strcpy_unescape(&hdr_overlay, &uri_overlay); + cid_hdr.slen += hdr_overlay.slen; + cid_hdr.ptr[cid_hdr.slen] = '>'; + cid_hdr.slen++; + + return cid_hdr; +} + +PJ_DEF(pjsip_multipart_part*) +pjsip_multipart_find_part_by_cid_str(pj_pool_t *pool, + const pjsip_msg_body *mp, + pj_str_t *cid) +{ + struct multipart_data *m_data; + pjsip_multipart_part *part; + pjsip_generic_string_hdr *found_hdr; + static pj_str_t hdr_name = { "Content-ID", 10}; + pj_str_t hdr_value; + + PJ_ASSERT_RETURN(pool && mp && cid && (pj_strlen(cid) > 0), NULL); + + hdr_value = cid_uri_to_hdr_value(pool, cid); + if (pj_strlen(&hdr_value) == 0) { + return NULL; + } + + m_data = (struct multipart_data*)mp->data; + part = m_data->part_head.next; + + while (part != &m_data->part_head) { + found_hdr = NULL; + while ((found_hdr = pjsip_hdr_find_by_name(&part->hdr, &hdr_name, + (found_hdr ? found_hdr->next : NULL))) != NULL) { + if (pj_strcmp(&hdr_value, &found_hdr->hvalue) == 0) { + return part; + } + } + part = part->next; + } + return NULL; +} + +PJ_DEF(pjsip_multipart_part*) +pjsip_multipart_find_part_by_cid_uri(pj_pool_t *pool, + const pjsip_msg_body *mp, + pjsip_other_uri *cid_uri) +{ + PJ_ASSERT_RETURN(pool && mp && cid_uri, NULL); + + if (pj_strcmp2(&cid_uri->scheme, "cid") != 0) { + return NULL; + } + /* + * We only need to pass the URI content so we + * can do that directly. + */ + return pjsip_multipart_find_part_by_cid_str(pool, mp, &cid_uri->content); +} + /* Parse a multipart part. "pct" is parent content-type */ static pjsip_multipart_part *parse_multipart_part(pj_pool_t *pool, char *start, @@ -584,6 +797,7 @@ (int)boundary.slen, boundary.ptr)); } + /* Build the delimiter: * delimiter = "--" boundary */ @@ -630,6 +844,8 @@ if (*curptr=='\r') ++curptr; if (*curptr!='\n') { /* Expecting a newline here */ + PJ_LOG(2, (THIS_FILE, "Failed to find newline")); + return NULL; } ++curptr; @@ -645,6 +861,7 @@ curptr = pj_strstr(&subbody, &delim); if (!curptr) { /* We're really expecting end delimiter to be found. */ + PJ_LOG(2, (THIS_FILE, "Failed to find end-delimiter")); return NULL; } } @@ -670,9 +887,13 @@ part = parse_multipart_part(pool, start_body, end_body - start_body, ctype); if (part) { + TRACE_((THIS_FILE, "Adding part")); pjsip_multipart_add_part(pool, body, part); + } else { + PJ_LOG(2, (THIS_FILE, "Failed to add part")); } } + TRACE_((THIS_FILE, "pjsip_multipart_parse finished: %p", body)); return body; } diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip/src/pjsip/sip_parser.c asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip/src/pjsip/sip_parser.c --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip/src/pjsip/sip_parser.c 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip/src/pjsip/sip_parser.c 2022-02-24 07:54:38.000000000 +0000 @@ -378,17 +378,23 @@ PJ_ASSERT_RETURN(status == PJ_SUCCESS, status); pj_cis_add_str( &pconst.pjsip_TOKEN_SPEC, TOKEN); + /* Token is allowed to have '%' so we do not need this. */ + /* status = pj_cis_dup(&pconst.pjsip_TOKEN_SPEC_ESC, &pconst.pjsip_TOKEN_SPEC); PJ_ASSERT_RETURN(status == PJ_SUCCESS, status); pj_cis_del_str(&pconst.pjsip_TOKEN_SPEC_ESC, "%"); + */ status = pj_cis_dup(&pconst.pjsip_VIA_PARAM_SPEC, &pconst.pjsip_TOKEN_SPEC); PJ_ASSERT_RETURN(status == PJ_SUCCESS, status); pj_cis_add_str(&pconst.pjsip_VIA_PARAM_SPEC, "[:]"); + /* Token is allowed to have '%' */ + /* status = pj_cis_dup(&pconst.pjsip_VIA_PARAM_SPEC_ESC, &pconst.pjsip_TOKEN_SPEC_ESC); PJ_ASSERT_RETURN(status == PJ_SUCCESS, status); pj_cis_add_str(&pconst.pjsip_VIA_PARAM_SPEC_ESC, "[:]"); + */ status = pj_cis_dup(&pconst.pjsip_HOST_SPEC, &pconst.pjsip_ALNUM_SPEC); PJ_ASSERT_RETURN(status == PJ_SUCCESS, status); @@ -1210,7 +1216,11 @@ unsigned option) { /* pname */ - parser_get_and_unescape(scanner, pool, spec, esc_spec, pname); + if (!esc_spec) { + pj_scan_get(scanner, spec, pname); + } else { + parser_get_and_unescape(scanner, pool, spec, esc_spec, pname); + } /* init pvalue */ pvalue->ptr = NULL; @@ -1240,7 +1250,12 @@ // pj_scan_get_until_ch(scanner, ']', pvalue); // pj_scan_get_char(scanner); } else if(pj_cis_match(spec, *scanner->curptr)) { - parser_get_and_unescape(scanner, pool, spec, esc_spec, pvalue); + if (!esc_spec) { + pj_scan_get(scanner, spec, pvalue); + } else { + parser_get_and_unescape(scanner, pool, spec, esc_spec, + pvalue); + } } } } @@ -1252,7 +1267,10 @@ unsigned option) { parse_param_imp(scanner, pool, pname, pvalue, &pconst.pjsip_TOKEN_SPEC, - &pconst.pjsip_TOKEN_SPEC_ESC, option); + // Token does not need to be unescaped. + // Refer to PR #2933. + // &pconst.pjsip_TOKEN_SPEC_ESC, + NULL, option); } @@ -2168,7 +2186,10 @@ pj_scan_get_char(scanner); parse_param_imp(scanner, pool, &pname, &pvalue, &pconst.pjsip_VIA_PARAM_SPEC, - &pconst.pjsip_VIA_PARAM_SPEC_ESC, + // Token does not need to be unescaped. + // Refer to PR #2933. + // &pconst.pjsip_VIA_PARAM_SPEC_ESC, + NULL, 0); if (!parser_stricmp(pname, pconst.pjsip_BRANCH_STR) && pvalue.slen) { diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip/src/pjsip/sip_transaction.c asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip/src/pjsip/sip_transaction.c --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip/src/pjsip/sip_transaction.c 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip/src/pjsip/sip_transaction.c 2022-02-24 07:54:38.000000000 +0000 @@ -137,6 +137,7 @@ #define RETRANSMIT_TIMER 1 #define TIMEOUT_TIMER 2 #define TRANSPORT_ERR_TIMER 3 +#define TRANSPORT_DISC_TIMER 4 /* Flags for tsx_set_state() */ enum @@ -420,6 +421,58 @@ } } +/* + * Change timer values used by transaction layer. Currently scheduled + * timers will not be changed. Any value set to 0 will be left + * unchanged. + * t1 - Transaction T1 timeout, in msec. Default value is PJSIP_T1_TIMEOUT + * t2 - Transaction T2 timeout, in msec. Default value is PJSIP_T2_TIMEOUT + * t4 - Transaction completed timer for non-INVITE, in msec. + * Default value is PJSIP_T4_TIMEOUT + * td - Transaction completed timer for INVITE, in msec. + * Default value is PJSIP_TD_TIMEOUT + */ +PJ_DEF(void) pjsip_tsx_set_timers(unsigned t1, unsigned t2, unsigned t4, unsigned td) +{ + if(t1!=0) { + t1_timer_val.sec = t1 / 1000; + t1_timer_val.msec = t1 % 1000; + pjsip_cfg()->tsx.t1=t1; + } + if(t2!=0) { + t2_timer_val.sec = t2 / 1000; + t2_timer_val.msec = t2 % 1000; + pjsip_cfg()->tsx.t2=t2; + } + if(t4!=0) { + t4_timer_val.sec = t4 / 1000; + t4_timer_val.msec = t4 % 1000; + pjsip_cfg()->tsx.t4=t4; + } + if(td!=0) { + td_timer_val.sec = td / 1000; + td_timer_val.msec = td % 1000; + timeout_timer_val = td_timer_val; + pjsip_cfg()->tsx.td=td; + } +} + +/* + * (Re)Initializes timer values from `pjsip_cfg()`. + */ +PJ_DEF(void) pjsip_tsx_initialize_timer_values(void) +{ + t1_timer_val.sec = pjsip_cfg()->tsx.t1 / 1000; + t1_timer_val.msec = pjsip_cfg()->tsx.t1 % 1000; + t2_timer_val.sec = pjsip_cfg()->tsx.t2 / 1000; + t2_timer_val.msec = pjsip_cfg()->tsx.t2 % 1000; + t4_timer_val.sec = pjsip_cfg()->tsx.t4 / 1000; + t4_timer_val.msec = pjsip_cfg()->tsx.t4 % 1000; + td_timer_val.sec = pjsip_cfg()->tsx.td / 1000; + td_timer_val.msec = pjsip_cfg()->tsx.td % 1000; + timeout_timer_val = td_timer_val; +} + /***************************************************************************** ** ** Transaction layer module @@ -438,20 +491,7 @@ PJ_ASSERT_RETURN(mod_tsx_layer.endpt==NULL, PJ_EINVALIDOP); /* Initialize timer values */ - t1_timer_val.sec = pjsip_cfg()->tsx.t1 / 1000; - t1_timer_val.msec = pjsip_cfg()->tsx.t1 % 1000; - t2_timer_val.sec = pjsip_cfg()->tsx.t2 / 1000; - t2_timer_val.msec = pjsip_cfg()->tsx.t2 % 1000; - t4_timer_val.sec = pjsip_cfg()->tsx.t4 / 1000; - t4_timer_val.msec = pjsip_cfg()->tsx.t4 % 1000; - td_timer_val.sec = pjsip_cfg()->tsx.td / 1000; - td_timer_val.msec = pjsip_cfg()->tsx.td % 1000; - /* Changed the initialization below to use td_timer_val instead, to enable - * customization to the timeout value. - */ - //timeout_timer_val.sec = (64 * pjsip_cfg()->tsx.t1) / 1000; - //timeout_timer_val.msec = (64 * pjsip_cfg()->tsx.t1) % 1000; - timeout_timer_val = td_timer_val; + pjsip_tsx_initialize_timer_values(); /* * Initialize transaction layer structure. @@ -1124,8 +1164,11 @@ return; } - if (entry->id == TRANSPORT_ERR_TIMER) { - /* Posted transport error event */ + if (entry->id == TRANSPORT_ERR_TIMER || entry->id == TRANSPORT_DISC_TIMER) + { + /* Posted transport error/disconnection event */ + pj_bool_t tp_disc = (entry->id == TRANSPORT_DISC_TIMER); + entry->id = 0; if (tsx->state < PJSIP_TSX_STATE_TERMINATED) { pjsip_tsx_state_e prev_state; @@ -1137,6 +1180,31 @@ /* Release transport as it's no longer working. */ tsx_update_transport(tsx, NULL); +#if PJSIP_TSX_UAS_CONTINUE_ON_TP_ERROR + if (tp_disc && tsx->method.id == PJSIP_INVITE_METHOD && + tsx->role == PJSIP_ROLE_UAS && tsx->status_code < 200 && + !(tsx->transport_flag & TSX_HAS_PENDING_TRANSPORT) && + !(tsx->transport_flag & TSX_HAS_PENDING_DESTROY)) +#else + PJ_UNUSED_ARG(tp_disc); + if (0) +#endif + { + /* Upon transport disconnection event, if we receive + * incoming INVITE and haven't responded with a final answer, + * just return here and don't terminate the transaction, + * in case that the library can switch to another working + * transport. + */ + tsx->transport_flag = 0; + tsx->addr_len = 0; + tsx->res_addr.transport = NULL; + tsx->res_addr.addr_len = 0; + + pj_grp_lock_release(tsx->grp_lock); + return; + } + if (tsx->status_code < 200) { pj_str_t err; char errmsg[PJ_ERR_MSG_SIZE]; @@ -1295,6 +1363,9 @@ if (tsx->pending_tx) { tsx->pending_tx->mod_data[mod_tsx_layer.mod.id] = NULL; tsx->pending_tx = NULL; + + /* Decrease pending send counter */ + pj_grp_lock_dec_ref(tsx->grp_lock); } tsx->transport_flag &= ~(TSX_HAS_PENDING_TRANSPORT); } @@ -1856,8 +1927,10 @@ /* Decrease pending send counter, but only if the transaction layer * hasn't been shutdown. */ - if (mod_tsx_layer.mod.id >= 0) - pj_grp_lock_dec_ref(tsx->grp_lock); + // If tsx has cancelled itself from this transmit notification + // it should have also decreased pending send counter. + //if (mod_tsx_layer.mod.id >= 0) + // pj_grp_lock_dec_ref(tsx->grp_lock); return; } @@ -2025,6 +2098,10 @@ { pjsip_transaction *tsx = (pjsip_transaction*) token; + /* Check if the transaction layer has been shutdown. */ + if (mod_tsx_layer.mod.id < 0) + return; + /* In other circumstances, locking tsx->grp_lock AFTER transport mutex * will introduce deadlock if another thread is currently sending a * SIP message to the transport. But this should be safe as there should @@ -2033,6 +2110,38 @@ */ pj_grp_lock_acquire(tsx->grp_lock); tsx->transport_flag &= ~(TSX_HAS_PENDING_TRANSPORT); + + if (sent > 0) { + /* Pending destroy? */ + if (tsx->transport_flag & TSX_HAS_PENDING_DESTROY) { + tsx_set_state( tsx, PJSIP_TSX_STATE_DESTROYED, + PJSIP_EVENT_UNKNOWN, NULL, 0 ); + pj_grp_lock_release(tsx->grp_lock); + return; + } + + /* Need to transmit a message? */ + if (tsx->transport_flag & TSX_HAS_PENDING_SEND) { + tsx->transport_flag &= ~(TSX_HAS_PENDING_SEND); + tsx_send_msg(tsx, tsx->last_tx); + } + + /* Need to reschedule retransmission? + * Note that when sending a pending message above, tsx_send_msg() + * may set the flag TSX_HAS_PENDING_TRANSPORT. + * Please refer to ticket #1875. + */ + if (tsx->transport_flag & TSX_HAS_PENDING_RESCHED && + !(tsx->transport_flag & TSX_HAS_PENDING_TRANSPORT)) + { + tsx->transport_flag &= ~(TSX_HAS_PENDING_RESCHED); + + /* Only update when transport turns out to be unreliable. */ + if (!tsx->is_reliable) { + tsx_resched_retransmission(tsx); + } + } + } pj_grp_lock_release(tsx->grp_lock); if (sent < 0) { @@ -2091,7 +2200,7 @@ if (tsx->state < PJSIP_TSX_STATE_COMPLETED) { tsx_cancel_timer(tsx, &tsx->timeout_timer); tsx_schedule_timer(tsx, &tsx->timeout_timer, &delay, - TRANSPORT_ERR_TIMER); + TRANSPORT_DISC_TIMER); } unlock_timer(tsx); } @@ -2224,6 +2333,7 @@ if (status == PJ_EPENDING) status = PJ_SUCCESS; if (status != PJ_SUCCESS) { + tsx->transport_flag &= ~(TSX_HAS_PENDING_TRANSPORT); pj_grp_lock_dec_ref(tsx->grp_lock); pjsip_tx_data_dec_ref(tdata); tdata->mod_data[mod_tsx_layer.mod.id] = NULL; @@ -2243,6 +2353,8 @@ if (status == PJ_EPENDING) status = PJ_SUCCESS; if (status != PJ_SUCCESS) { + tsx->transport_flag &= ~(TSX_HAS_PENDING_TRANSPORT); + pj_grp_lock_dec_ref(tsx->grp_lock); pjsip_tx_data_dec_ref(tdata); tdata->mod_data[mod_tsx_layer.mod.id] = NULL; tsx->pending_tx = NULL; @@ -2399,7 +2511,7 @@ pjsip_transport_add_ref(tp); pjsip_transport_add_state_listener(tp, &tsx_tp_state_callback, tsx, &tsx->tp_st_key); - if (tp->is_shutdown) { + if (tp->is_shutdown || tp->is_destroying) { pjsip_transport_state_info info; pj_bzero(&info, sizeof(info)); @@ -3261,10 +3373,11 @@ } } else { - /* Ignore request to transmit. */ - PJ_ASSERT_RETURN(event->type == PJSIP_EVENT_TX_MSG && - event->body.tx_msg.tdata == tsx->last_tx, + PJ_ASSERT_RETURN(event->type == PJSIP_EVENT_TX_MSG, PJ_EINVALIDOP); + /* Ignore request to transmit a new message. */ + if (event->body.tx_msg.tdata != tsx->last_tx) + return PJ_EINVALIDOP; } return PJ_SUCCESS; diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip/src/pjsip/sip_transport.c asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip/src/pjsip/sip_transport.c --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip/src/pjsip/sip_transport.c 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip/src/pjsip/sip_transport.c 2022-02-24 07:54:38.000000000 +0000 @@ -358,7 +358,8 @@ } } - pj_assert(!"Invalid transport name"); + /* Just return instead of raising assertion. */ + //pj_assert(!"Invalid transport name"); return PJSIP_TRANSPORT_UNSPECIFIED; } @@ -732,7 +733,11 @@ if (src->msg->body) msg->body = pjsip_msg_body_clone(dst->pool, src->msg->body); - dst->is_pending = src->is_pending; + /* We shouldn't copy is_pending since it's src's internal state, + * indicating that it's currently being sent by the transport. + * While the cloned tdata is of course not. + */ + //dst->is_pending = src->is_pending; PJ_LOG(5,(THIS_FILE, "Tx data %s cloned", @@ -1067,6 +1072,19 @@ return; entry->id = PJ_FALSE; + + /* Set is_destroying flag under transport manager mutex to avoid + * race condition with pjsip_tpmgr_acquire_transport2(). + */ + pj_lock_acquire(tp->tpmgr->lock); + if (pj_atomic_get(tp->ref_cnt) == 0) { + tp->is_destroying = PJ_TRUE; + } else { + pj_lock_release(tp->tpmgr->lock); + return; + } + pj_lock_release(tp->tpmgr->lock); + pjsip_transport_destroy(tp); } @@ -1388,8 +1406,8 @@ mgr = tp->tpmgr; pj_lock_acquire(mgr->lock); - /* Do nothing if transport is being shutdown already */ - if (tp->is_shutdown) { + /* Do nothing if transport is being shutdown/destroyed already */ + if (tp->is_shutdown || tp->is_destroying) { pj_lock_release(mgr->lock); pj_lock_release(tp->lock); return PJ_SUCCESS; @@ -1825,7 +1843,7 @@ itr = pj_hash_first(mgr->table, &itr_val); while (itr) { transport *tp_entry = (transport *)pj_hash_this(mgr->table, itr); - nr_of_transports += pj_list_size(tp_entry); + nr_of_transports += (int)pj_list_size(tp_entry); itr = pj_hash_next(mgr->table, itr); } @@ -2057,8 +2075,8 @@ pj_exception_id_name(err->except_code), (int)err->hname.slen, err->hname.ptr, err->line, err->col); - if (len >= (int)sizeof(buf)-tmp.slen) { - len = (int)sizeof(buf)-tmp.slen; + if (len >= (int)sizeof(buf)-(int)tmp.slen) { + len = (int)sizeof(buf)-(int)tmp.slen; } if (len > 0) { tmp.slen += len; @@ -2252,6 +2270,13 @@ return PJSIP_ETPNOTSUITABLE; } + /* Make sure the transport is not being destroyed */ + if (seltp->is_destroying) { + pj_lock_release(mgr->lock); + TRACE_((THIS_FILE,"Transport to be acquired is being destroyed")); + return PJ_ENOTFOUND; + } + /* We could also verify that the destination address is reachable * from this transport (i.e. both are equal), but if application * has requested a specific transport to be used, assume that @@ -2280,7 +2305,7 @@ int key_len; pjsip_transport *tp_ref = NULL; transport *tp_entry = NULL; - + unsigned flag = pjsip_transport_get_flag_from_type(type); /* If listener is specified, verify that the listener type matches * the destination type. @@ -2307,8 +2332,23 @@ if (tp_entry) { transport *tp_iter = tp_entry; do { - /* Don't use transport being shutdown */ - if (!tp_iter->tp->is_shutdown) { + /* Don't use transport being shutdown/destroyed */ + if (!tp_iter->tp->is_shutdown && + !tp_iter->tp->is_destroying) + { + if ((flag & PJSIP_TRANSPORT_SECURE) && tdata) { + /* For secure transport, make sure tdata's + * destination host matches the transport's + * remote host. + */ + if (pj_stricmp(&tdata->dest_info.name, + &tp_iter->tp->remote_name.host)) + { + tp_iter = tp_iter->next; + continue; + } + } + if (sel && sel->type == PJSIP_TPSELECTOR_LISTENER && sel->u.listener) { @@ -2330,7 +2370,6 @@ if (tp_ref == NULL && (!sel || sel->disable_connection_reuse == PJ_FALSE)) { - unsigned flag = pjsip_transport_get_flag_from_type(type); const pj_sockaddr *remote_addr = (const pj_sockaddr*)remote; @@ -2378,7 +2417,7 @@ TRACE_((THIS_FILE, "Transport found but from different listener")); } - if (tp_ref!=NULL && !tp_ref->is_shutdown) { + if (tp_ref!=NULL && !tp_ref->is_shutdown && !tp_ref->is_destroying) { /* * Transport found! */ @@ -2620,7 +2659,7 @@ PJ_ASSERT_RETURN(tp && cb && key, PJ_EINVAL); - if (tp->is_shutdown) { + if (tp->is_shutdown || tp->is_destroying) { *key = NULL; return PJ_EINVALIDOP; } diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip/src/pjsip/sip_transport_tcp.c asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip/src/pjsip/sip_transport_tcp.c --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip/src/pjsip/sip_transport_tcp.c 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip/src/pjsip/sip_transport_tcp.c 2022-02-24 07:54:38.000000000 +0000 @@ -330,6 +330,7 @@ enum { INFO_LEN = 100 }; char local_addr[PJ_INET6_ADDRSTRLEN + 10]; char pub_addr[PJ_INET6_ADDRSTRLEN + 10]; + int len; pj_sockaddr *listener_addr = &listener->factory.local_addr; /* Set transport info. */ @@ -341,9 +342,10 @@ pj_addr_str_print(&listener->factory.addr_name.host, listener->factory.addr_name.port, pub_addr, sizeof(pub_addr), 1); - pj_ansi_snprintf( + len = pj_ansi_snprintf( listener->factory.info, INFO_LEN, "tcp %s [published as %s]", local_addr, pub_addr); + PJ_CHECK_TRUNC_STR(len, listener->factory.info, INFO_LEN); if (listener->asock) { char addr[PJ_INET6_ADDRSTRLEN+10]; @@ -776,6 +778,9 @@ if (pending_tx->timeout.sec > 0 && PJ_TIME_VAL_GT(now, pending_tx->timeout)) { + pj_lock_release(tcp->base.lock); + on_data_sent(tcp->asock, op_key, -PJ_ETIMEDOUT); + pj_lock_acquire(tcp->base.lock); continue; } diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip/src/pjsip/sip_transport_tls.c asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip/src/pjsip/sip_transport_tls.c --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip/src/pjsip/sip_transport_tls.c 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip/src/pjsip/sip_transport_tls.c 2022-02-24 07:54:38.000000000 +0000 @@ -113,6 +113,9 @@ /* Group lock to be used by TLS transport and ioqueue key */ pj_grp_lock_t *grp_lock; + + /* Verify callback. */ + pj_bool_t(*on_verify_cb)(const pjsip_tls_on_verify_param *param); }; @@ -139,6 +142,8 @@ pj_ioqueue_op_key_t *send_key, pj_ssize_t sent); +static pj_bool_t on_verify_cb(pj_ssl_sock_t *ssock, pj_bool_t is_server); + /* This callback is called by transport manager to destroy listener */ static pj_status_t lis_destroy(pjsip_tpfactory *factory); @@ -218,6 +223,9 @@ case PJSIP_TLSV1_2_METHOD: out_proto = PJ_SSL_SOCK_PROTO_TLS1_2; break; + case PJSIP_TLSV1_3_METHOD: + out_proto = PJ_SSL_SOCK_PROTO_TLS1_3; + break; case PJSIP_SSLV23_METHOD: out_proto = PJ_SSL_SOCK_PROTO_SSL23; break; @@ -301,6 +309,9 @@ pj_ssl_sock_param_default(ssock_param); ssock_param->sock_af = af; ssock_param->cb.on_accept_complete2 = &on_accept_complete2; + if (listener->tls_setting.on_verify_cb) + ssock_param->cb.on_verify_cb = &on_verify_cb; + ssock_param->async_cnt = listener->async_cnt; ssock_param->ioqueue = pjsip_endpt_get_ioqueue(listener->endpt); ssock_param->timer_heap = pjsip_endpt_get_timer_heap(listener->endpt); @@ -419,6 +430,7 @@ enum { INFO_LEN = 100 }; char local_addr[PJ_INET6_ADDRSTRLEN + 10]; char pub_addr[PJ_INET6_ADDRSTRLEN + 10]; + int len; pj_sockaddr *listener_addr = &listener->factory.local_addr; if (listener->factory.info == NULL) { @@ -429,9 +441,10 @@ pj_addr_str_print(&listener->factory.addr_name.host, listener->factory.addr_name.port, pub_addr, sizeof(pub_addr), 1); - pj_ansi_snprintf( + len = pj_ansi_snprintf( listener->factory.info, INFO_LEN, "tls %s [published as %s]", local_addr, pub_addr); + PJ_CHECK_TRUNC_STR(len, listener->factory.info, INFO_LEN); if (listener->ssock) { char addr[PJ_INET6_ADDRSTRLEN+10]; @@ -880,6 +893,7 @@ tls->base.factory = &listener->factory; tls->ssock = ssock; + tls->on_verify_cb = listener->tls_setting.on_verify_cb; /* Set up the group lock */ tls->grp_lock = tls->base.grp_lock = glock; @@ -941,6 +955,9 @@ if (pending_tx->timeout.sec > 0 && PJ_TIME_VAL_GT(now, pending_tx->timeout)) { + pj_lock_release(tls->base.lock); + on_data_sent(tls->ssock, op_key, -PJ_ETIMEDOUT); + pj_lock_acquire(tls->base.lock); continue; } @@ -1174,6 +1191,8 @@ ssock_param.cb.on_connect_complete = &on_connect_complete; ssock_param.cb.on_data_read = &on_data_read; ssock_param.cb.on_data_sent = &on_data_sent; + if (listener->tls_setting.on_verify_cb) + ssock_param.cb.on_verify_cb = &on_verify_cb; ssock_param.async_cnt = 1; ssock_param.ioqueue = pjsip_endpt_get_ioqueue(listener->endpt); ssock_param.timer_heap = pjsip_endpt_get_timer_heap(listener->endpt); @@ -1325,9 +1344,26 @@ PJ_UNUSED_ARG(src_addr_len); listener = (struct tls_listener*) pj_ssl_sock_get_user_data(ssock); + if (!listener) { + /* Listener already destroyed, e.g: after TCP accept but before SSL + * handshake is completed. + */ + if (new_ssock && accept_status == PJ_SUCCESS) { + /* Close the SSL socket if the accept op is successful */ + PJ_LOG(4,(THIS_FILE, + "Incoming TLS connection from %s (sock=%d) is discarded " + "because listener is already destroyed", + pj_sockaddr_print(src_addr, addr, sizeof(addr), 3), + new_ssock)); + + pj_ssl_sock_close(new_ssock); + } + + return PJ_FALSE; + } if (accept_status != PJ_SUCCESS) { - if (listener && listener->tls_setting.on_accept_fail_cb) { + if (listener->tls_setting.on_accept_fail_cb) { pjsip_tls_on_accept_fail_param param; pj_ssl_sock_info ssi; @@ -1350,6 +1386,8 @@ PJ_ASSERT_RETURN(new_ssock, PJ_TRUE); if (!listener->is_registered) { + pj_ssl_sock_close(new_ssock); + if (listener->tls_setting.on_accept_fail_cb) { pjsip_tls_on_accept_fail_param param; pj_bzero(¶m, sizeof(param)); @@ -1401,6 +1439,8 @@ ssl_info.grp_lock, &tls); if (status != PJ_SUCCESS) { + pj_ssl_sock_close(new_ssock); + if (listener->tls_setting.on_accept_fail_cb) { pjsip_tls_on_accept_fail_param param; pj_bzero(¶m, sizeof(param)); @@ -1546,6 +1586,40 @@ return PJ_TRUE; } +static pj_bool_t on_verify_cb(pj_ssl_sock_t* ssock, pj_bool_t is_server) +{ + pj_bool_t(*verify_cb)(const pjsip_tls_on_verify_param * param) = NULL; + + if (is_server) { + struct tls_listener* tls; + + tls = (struct tls_listener*)pj_ssl_sock_get_user_data(ssock); + verify_cb = tls->tls_setting.on_verify_cb; + } else { + struct tls_transport* tls; + + tls = (struct tls_transport*)pj_ssl_sock_get_user_data(ssock); + verify_cb = tls->on_verify_cb; + } + + if (verify_cb) { + pjsip_tls_on_verify_param param; + pj_ssl_sock_info info; + + pj_bzero(¶m, sizeof(param)); + pj_ssl_sock_get_info(ssock, &info); + + param.local_addr = &info.local_addr; + param.remote_addr = &info.remote_addr; + param.local_cert_info = info.local_cert_info; + param.remote_cert_info = info.remote_cert_info; + param.tp_dir = is_server?PJSIP_TP_DIR_INCOMING:PJSIP_TP_DIR_OUTGOING; + + return (*verify_cb)(¶m); + } + return PJ_TRUE; +} + /* * This callback is called by transport manager to send SIP message diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip/src/pjsip/sip_transport_udp.c asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip/src/pjsip/sip_transport_udp.c --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip/src/pjsip/sip_transport_udp.c 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip/src/pjsip/sip_transport_udp.c 2022-02-24 07:54:38.000000000 +0000 @@ -143,6 +143,8 @@ goto on_return; if (-bytes_read == PJ_ESOCKETSTOP) { +#if 0 + /* Auto restart is disabled, see #2881 */ --tp->read_loop_spin; /* Try to recover by restarting the transport. */ PJ_LOG(4,(tp->base.obj_name, "Restarting SIP UDP transport")); @@ -158,6 +160,9 @@ "Error restarting SIP UDP transport")); } return; +#else + goto on_return; +#endif } /* @@ -321,6 +326,8 @@ tdata_op_key->tdata = NULL; +#if 0 + /* Auto restart is disabled, see #2881 */ if (-bytes_sent == PJ_ESOCKETSTOP) { pj_status_t status; /* Try to recover by restarting the transport. */ @@ -338,6 +345,7 @@ } return; } +#endif if (tdata_op_key->callback) { tdata_op_key->callback(&tp->base, tdata_op_key->token, bytes_sent); @@ -380,6 +388,8 @@ rem_addr, addr_len); if (status != PJ_EPENDING) { +#if 0 + /* Auto restart is disabled, see #2881 */ if (status == PJ_ESOCKETSTOP) { /* Try to recover by restarting the transport. */ PJ_LOG(4,(tp->base.obj_name, "Restarting SIP UDP transport")); @@ -395,6 +405,7 @@ "Error restarting SIP UDP transport")); } } +#endif tdata->op_key.tdata = NULL; } @@ -621,6 +632,7 @@ enum { INFO_LEN = 80 }; char local_addr[PJ_INET6_ADDRSTRLEN+10]; char pub_addr[PJ_INET6_ADDRSTRLEN+10]; + int len; pj_assert(a_name->host.slen != 0); @@ -644,8 +656,9 @@ tp->base.local_name.port, pub_addr, sizeof(pub_addr), 1), - pj_ansi_snprintf( tp->base.info, INFO_LEN, "udp %s [published as %s]", + len = pj_ansi_snprintf( tp->base.info, INFO_LEN, "udp %s [published as %s]", local_addr, pub_addr); + PJ_CHECK_TRUNC_STR(len, tp->base.info, INFO_LEN); } /* Set the socket handle of the transport */ diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip/src/pjsip/sip_ua_layer.c asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip/src/pjsip/sip_ua_layer.c --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip/src/pjsip/sip_ua_layer.c 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip/src/pjsip/sip_ua_layer.c 2022-02-24 07:54:38.000000000 +0000 @@ -65,6 +65,9 @@ /* This is the buffer to store this entry in the hash table. */ pj_hash_entry_buf ht_entry; + /* Entry key in the hash table */ + pj_str_t ht_key; + /* List of dialog in this dialog set. */ struct dlg_set_head dlg_list; }; @@ -165,6 +168,12 @@ { pjsip_dialog *dlg; + /* If the module id is -1, it could mean that the module has been + * destroyed. + */ + if (mod_ua.mod.id == -1) + return; + /* Get the dialog where this transaction belongs. */ dlg = (pjsip_dialog*) tsx->mod_data[mod_ua.mod.id]; @@ -321,6 +330,7 @@ * Create the dialog set and add this dialog to it. */ dlg_set = alloc_dlgset_node(); + dlg_set->ht_key = dlg->local.info->tag; pj_list_init(&dlg_set->dlg_list); pj_list_push_back(&dlg_set->dlg_list, dlg); @@ -328,8 +338,8 @@ /* Register the dialog set in the hash table. */ pj_hash_set_np_lower(mod_ua.dlg_table, - dlg->local.info->tag.ptr, - (unsigned)dlg->local.info->tag.slen, + dlg_set->ht_key.ptr, + (unsigned)dlg_set->ht_key.slen, dlg->local.tag_hval, dlg_set->ht_entry, dlg_set); } @@ -339,14 +349,15 @@ struct dlg_set *dlg_set; dlg_set = alloc_dlgset_node(); + dlg_set->ht_key = dlg->local.info->tag; pj_list_init(&dlg_set->dlg_list); pj_list_push_back(&dlg_set->dlg_list, dlg); dlg->dlg_set = dlg_set; pj_hash_set_np_lower(mod_ua.dlg_table, - dlg->local.info->tag.ptr, - (unsigned)dlg->local.info->tag.slen, + dlg_set->ht_key.ptr, + (unsigned)dlg_set->ht_key.slen, dlg->local.tag_hval, dlg_set->ht_entry, dlg_set); } @@ -391,12 +402,43 @@ /* If dialog list is empty, remove the dialog set from the hash table. */ if (pj_list_empty(&dlg_set->dlg_list)) { - pj_hash_set_lower(NULL, mod_ua.dlg_table, dlg->local.info->tag.ptr, - (unsigned)dlg->local.info->tag.slen, + + /* Verify that the dialog set is valid */ + pj_assert(pj_hash_get_lower(mod_ua.dlg_table, dlg_set->ht_key.ptr, + (unsigned)dlg_set->ht_key.slen, + &dlg->local.tag_hval) == dlg_set); + + pj_hash_set_lower(NULL, mod_ua.dlg_table, dlg_set->ht_key.ptr, + (unsigned)dlg_set->ht_key.slen, dlg->local.tag_hval, NULL); /* Return dlg_set to free nodes. */ pj_list_push_back(&mod_ua.free_dlgset_nodes, dlg_set); + } else { + /* If the just unregistered dialog is being used as hash key, + * reset the dlg_set entry with a new key (i.e: from the first dialog + * in dlg_set). + */ + if (dlg_set->ht_key.ptr == dlg->local.info->tag.ptr && + dlg_set->ht_key.slen == dlg->local.info->tag.slen) + { + pjsip_dialog* key_dlg = dlg_set->dlg_list.next; + + /* Verify that the old & new keys share the hash value */ + pj_assert(key_dlg->local.tag_hval == dlg->local.tag_hval); + + pj_hash_set_lower(NULL, mod_ua.dlg_table, dlg_set->ht_key.ptr, + (unsigned)dlg_set->ht_key.slen, + dlg->local.tag_hval, NULL); + + dlg_set->ht_key = key_dlg->local.info->tag; + + pj_hash_set_np_lower(mod_ua.dlg_table, + dlg_set->ht_key.ptr, + (unsigned)dlg_set->ht_key.slen, + key_dlg->local.tag_hval, dlg_set->ht_entry, + dlg_set); + } } /* Unlock user agent. */ diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip/src/pjsip/sip_util.c asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip/src/pjsip/sip_util.c --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip/src/pjsip/sip_util.c 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip/src/pjsip/sip_util.c 2022-02-24 07:54:38.000000000 +0000 @@ -779,14 +779,14 @@ pjsip_hdr_clone(cancel_tdata->pool, req_tdata->saved_strict_route); } - /* Copy the destination host name from the original request */ - pj_strdup(cancel_tdata->pool, &cancel_tdata->dest_info.name, - &req_tdata->dest_info.name); - - /* Finally copy the destination info from the original request */ + /* Copy the destination info from the original request */ pj_memcpy(&cancel_tdata->dest_info, &req_tdata->dest_info, sizeof(req_tdata->dest_info)); + /* Finally, copy the destination host name from the original request */ + pj_strdup(cancel_tdata->pool, &cancel_tdata->dest_info.name, + &req_tdata->dest_info.name); + /* Done. * Return the transmit buffer containing the CANCEL request. */ @@ -1417,7 +1417,10 @@ */ if (tdata->dest_info.addr.count == 0) { /* Copy the destination host name to TX data */ - pj_strdup(tdata->pool, &tdata->dest_info.name, &dest_info.addr.host); + if (!tdata->dest_info.name.slen) { + pj_strdup(tdata->pool, &tdata->dest_info.name, + &dest_info.addr.host); + } pjsip_endpt_resolve( endpt, tdata->pool, &dest_info, stateless_data, &stateless_send_resolver_callback); @@ -1810,8 +1813,10 @@ } } else { /* Copy the destination host name to TX data */ - pj_strdup(tdata->pool, &tdata->dest_info.name, - &res_addr->dst_host.addr.host); + if (!tdata->dest_info.name.slen) { + pj_strdup(tdata->pool, &tdata->dest_info.name, + &res_addr->dst_host.addr.host); + } pjsip_endpt_resolve(endpt, tdata->pool, &res_addr->dst_host, send_state, &send_response_resolver_cb); diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip/src/pjsip-simple/evsub.c asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip/src/pjsip-simple/evsub.c --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip/src/pjsip-simple/evsub.c 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip/src/pjsip-simple/evsub.c 2022-02-24 07:54:38.000000000 +0000 @@ -306,7 +306,9 @@ pj_list_init(&mod_evsub.pkg_list); /* Create pool: */ - mod_evsub.pool = pjsip_endpt_create_pool(endpt, "evsub", 512, 512); + mod_evsub.pool = pjsip_endpt_create_pool(endpt, "evsub", + PJSIP_POOL_EVSUB_LEN, + PJSIP_POOL_EVSUB_INC); if (!mod_evsub.pool) return PJ_ENOMEM; diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip/src/pjsip-simple/presence_body.c asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip/src/pjsip-simple/presence_body.c --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip/src/pjsip-simple/presence_body.c 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip/src/pjsip-simple/presence_body.c 2022-02-24 07:54:38.000000000 +0000 @@ -117,9 +117,18 @@ int tslen = 0; pj_time_val tv; pj_parsed_time pt; + pj_status_t s; pj_gettimeofday(&tv); - /* TODO: convert time to GMT! (unsupported by pjlib) */ + + /* Convert time to GMT (some platforms may not support it + * such as WinCE). + */ + s = pj_time_local_to_gmt(&tv); + if (s != PJ_SUCCESS) { + PJ_PERROR(4,(THIS_FILE,s, + "Warning: failed to convert PIDF time to GMT")); + } pj_time_decode( &tv, &pt); tslen = pj_ansi_snprintf(buf, sizeof(buf), diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip/src/pjsip-simple/rpid.c asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip/src/pjsip-simple/rpid.c --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip/src/pjsip-simple/rpid.c 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip/src/pjsip-simple/rpid.c 2022-02-24 07:54:38.000000000 +0000 @@ -115,22 +115,13 @@ PJ_UNUSED_ARG(options); - /* Check if we need to add RPID information into the PIDF document. */ - if (elem->id.slen==0 && - elem->activity==PJRPID_ACTIVITY_UNKNOWN && - elem->note.slen==0) - { - /* No RPID information to be added. */ - return PJ_SUCCESS; - } - - /* Add to */ + /* Add to , if none */ if (elem->note.slen != 0) { pj_xml_node *nd_tuple; nd_tuple = find_node(pres, "tuple"); - - if (nd_tuple) { + nd_note = nd_tuple? find_node(nd_tuple, "note"):NULL; + if (!nd_note) { nd_note = pj_xml_node_new(pool, &NOTE); pj_strdup(pool, &nd_note->content, &elem->note); pj_xml_add_node(nd_tuple, nd_note); @@ -138,6 +129,14 @@ } } + /* Check if we need to add RPID information into the PIDF document. */ + if (elem->id.slen==0 && + elem->activity==PJRPID_ACTIVITY_UNKNOWN) + { + /* No RPID information to be added. */ + return PJ_SUCCESS; + } + /* Update namespace */ update_namespaces(pres, pool); @@ -204,7 +203,11 @@ if (!nd_tuple) return PJSIP_SIMPLE_EBADRPID; - nd_note = find_node(pres, "note"); + nd_note = find_node(nd_tuple, "note"); + /* If we cannot find inside , try to get it from root. */ + if (!nd_note) + nd_note = find_node(pres, "note"); + if (nd_note) { pj_strdup(pool, &elem->note, &nd_note->content); return PJ_SUCCESS; diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip/src/pjsip-ua/sip_100rel.c asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip/src/pjsip-ua/sip_100rel.c --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip/src/pjsip-ua/sip_100rel.c 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip/src/pjsip-ua/sip_100rel.c 2022-02-24 07:54:38.000000000 +0000 @@ -584,7 +584,7 @@ /* Send 500 response */ status = pjsip_inv_end_session(dd->inv, 500, &reason, &tdata); - if (status == PJ_SUCCESS) { + if (status == PJ_SUCCESS && tdata) { pjsip_dlg_send_response(dd->inv->dlg, dd->inv->invite_tsx, tdata); @@ -600,7 +600,14 @@ final = tdata->msg->line.status.code >= 200; if (dd->uas_state->retransmit_count == 1) { - pjsip_tsx_send_msg(dd->inv->invite_tsx, tdata); + pj_status_t status; + + status = pjsip_tsx_send_msg(dd->inv->invite_tsx, tdata); + if (status != PJ_SUCCESS) { + PJ_PERROR(3, (THIS_FILE, status, + "Failed to send message")); + return; + } } else { pjsip_tsx_retransmit_no_state(dd->inv->invite_tsx, tdata); } @@ -618,7 +625,7 @@ if (dd->uas_state->retransmit_count < 6) { delay.sec = 0; delay.msec = (1 << dd->uas_state->retransmit_count) * - pjsip_cfg()->tsx.t1; + (long)pjsip_cfg()->tsx.t1; pj_time_val_normalize(&delay); } else { delay.sec = 1; @@ -809,7 +816,7 @@ char rseq_str[32]; pj_str_t rseq; tx_data_list_t *tl; - + /* Create UAS state if we don't have one */ if (dd->uas_state == NULL) { dd->uas_state = PJ_POOL_ZALLOC_T(inv->dlg->pool, diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip/src/pjsip-ua/sip_inv.c asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip/src/pjsip-ua/sip_inv.c --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip/src/pjsip-ua/sip_inv.c 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip/src/pjsip-ua/sip_inv.c 2022-02-24 07:54:38.000000000 +0000 @@ -118,6 +118,8 @@ static pj_bool_t inv_check_secure_dlg(pjsip_inv_session *inv, pjsip_event *e); +static int print_sdp(pjsip_msg_body *body, char *buf, pj_size_t len); + static void (*inv_state_handler[])( pjsip_inv_session *inv, pjsip_event *e) = { &inv_on_state_null, @@ -323,9 +325,19 @@ (*mod_inv.cb.on_state_changed)(inv, e); pjsip_inv_dec_ref(inv); - /* Only decrement when previous state is not already DISCONNECTED */ + /* The above callback may change the state, so we need to be careful here + * and only decrement inv under the following conditions: + * 1. If the state parameter is DISCONNECTED, and previous state is not + * already DISCONNECTED. + * This is to make sure that dec_ref() is not called more than once. + * 2. If current state is PJSIP_INV_STATE_DISCONNECTED. + * This is to make sure that dec_ref() is not called if user restarts + * inv within the callback. Note that this check must be last since + * inv may have already been destroyed. + */ if (state == PJSIP_INV_STATE_DISCONNECTED && - prev_state != PJSIP_INV_STATE_DISCONNECTED) + prev_state != PJSIP_INV_STATE_DISCONNECTED && + inv->state == PJSIP_INV_STATE_DISCONNECTED) { pjsip_inv_dec_ref(inv); } @@ -502,6 +514,13 @@ */ if (inv->state < PJSIP_INV_STATE_CONFIRMED) { inv_set_state(inv, PJSIP_INV_STATE_CONFIRMED, &ack_e); + } else if (inv->state == PJSIP_INV_STATE_DISCONNECTED && inv->last_ack) { + /* Avoid possible leaked tdata when invite session is already + * destroyed. + * https://github.com/pjsip/pjproject/pull/2432 + */ + pjsip_tx_data_dec_ref(inv->last_ack); + inv->last_ack = NULL; } return PJ_SUCCESS; @@ -810,7 +829,7 @@ PJ_ASSERT_RETURN(endpt && cb, PJ_EINVAL); /* Some callbacks are mandatory */ - PJ_ASSERT_RETURN(cb->on_state_changed && cb->on_new_session, PJ_EINVAL); + PJ_ASSERT_RETURN(cb->on_state_changed, PJ_EINVAL); /* Check if module already registered. */ PJ_ASSERT_RETURN(mod_inv.mod.id == -1, PJ_EINVALIDOP); @@ -881,6 +900,8 @@ options |= PJSIP_INV_SUPPORT_100REL; if (options & PJSIP_INV_REQUIRE_TIMER) options |= PJSIP_INV_SUPPORT_TIMER; + if (options & PJSIP_INV_REQUIRE_TRICKLE_ICE) + options |= PJSIP_INV_SUPPORT_TRICKLE_ICE; /* Create the session */ inv = PJ_POOL_ZALLOC_T(dlg->pool, pjsip_inv_session); @@ -946,66 +967,170 @@ return PJ_SUCCESS; } -PJ_DEF(pjsip_rdata_sdp_info*) pjsip_rdata_get_sdp_info(pjsip_rx_data *rdata) -{ - pjsip_rdata_sdp_info *sdp_info; - pjsip_msg_body *body = rdata->msg_info.msg->body; - pjsip_ctype_hdr *ctype_hdr = rdata->msg_info.ctype; - pjsip_media_type app_sdp; +PJ_DEF(pjsip_sdp_info*) pjsip_get_sdp_info(pj_pool_t *pool, + pjsip_msg_body *body, + pjsip_media_type *msg_media_type, + const pjsip_media_type *search_media_type) +{ + pjsip_sdp_info *sdp_info; + pjsip_media_type search_type; + pjsip_media_type multipart_mixed; + pjsip_media_type multipart_alternative; + pjsip_media_type *msg_type; + pj_status_t status; - sdp_info = (pjsip_rdata_sdp_info*) - rdata->endpt_info.mod_data[mod_inv.mod.id]; - if (sdp_info) - return sdp_info; + sdp_info = PJ_POOL_ZALLOC_T(pool, + pjsip_sdp_info); - sdp_info = PJ_POOL_ZALLOC_T(rdata->tp_info.pool, - pjsip_rdata_sdp_info); PJ_ASSERT_RETURN(mod_inv.mod.id >= 0, sdp_info); - rdata->endpt_info.mod_data[mod_inv.mod.id] = sdp_info; - pjsip_media_type_init2(&app_sdp, "application", "sdp"); + if (!body) { + return sdp_info; + } + + if (msg_media_type) { + msg_type = msg_media_type; + } else { + if (body->content_type.type.slen == 0) { + return sdp_info; + } + msg_type = &body->content_type; + } - if (body && ctype_hdr && - pj_stricmp(&ctype_hdr->media.type, &app_sdp.type)==0 && - pj_stricmp(&ctype_hdr->media.subtype, &app_sdp.subtype)==0) - { - sdp_info->body.ptr = (char*)body->data; - sdp_info->body.slen = body->len; - } else if (body && ctype_hdr && - pj_stricmp2(&ctype_hdr->media.type, "multipart")==0 && - (pj_stricmp2(&ctype_hdr->media.subtype, "mixed")==0 || - pj_stricmp2(&ctype_hdr->media.subtype, "alternative")==0)) + if (!search_media_type) { + pjsip_media_type_init2(&search_type, "application", "sdp"); + } else { + pj_memcpy(&search_type, search_media_type, sizeof(search_type)); + } + + pjsip_media_type_init2(&multipart_mixed, "multipart", "mixed"); + pjsip_media_type_init2(&multipart_alternative, "multipart", "alternative"); + + if (pjsip_media_type_cmp(msg_type, &search_type, PJ_FALSE) == 0) { - pjsip_multipart_part *part; + /* + * If the print_body function is print_sdp, we know that + * body->data is a pjmedia_sdp_session object and came from + * a tx_data. If not, it's the text representation of the + * sdp from an rx_data. + */ + if (body->print_body == print_sdp) { + sdp_info->sdp = body->data; + } else { + sdp_info->body.ptr = (char*)body->data; + sdp_info->body.slen = body->len; + } + } else if (pjsip_media_type_cmp(&multipart_mixed, msg_type, PJ_FALSE) == 0 || + pjsip_media_type_cmp(&multipart_alternative, msg_type, PJ_FALSE) == 0) + { + pjsip_multipart_part *part; + part = pjsip_multipart_find_part(body, &search_type, NULL); + if (part) { + if (part->body->print_body == print_sdp) { + sdp_info->sdp = part->body->data; + } else { + sdp_info->body.ptr = (char*)part->body->data; + sdp_info->body.slen = part->body->len; + } + } + } - part = pjsip_multipart_find_part(body, &app_sdp, NULL); - if (part) { - sdp_info->body.ptr = (char*)part->body->data; - sdp_info->body.slen = part->body->len; - } + /* + * If the body was already a pjmedia_sdp_session, we can just + * return it. If not and there wasn't a text representation + * of the sdp either, we can also just return. + */ + if (sdp_info->sdp || !sdp_info->body.ptr) { + return sdp_info; } - if (sdp_info->body.ptr) { - pj_status_t status; - status = pjmedia_sdp_parse(rdata->tp_info.pool, - sdp_info->body.ptr, - sdp_info->body.slen, - &sdp_info->sdp); - if (status == PJ_SUCCESS) - status = pjmedia_sdp_validate2(sdp_info->sdp, PJ_FALSE); + /* + * If the body was the text representation of teh SDP, we need + * to parse it to create a pjmedia_sdp_session object. + */ + status = pjmedia_sdp_parse(pool, + sdp_info->body.ptr, + sdp_info->body.slen, + &sdp_info->sdp); + if (status == PJ_SUCCESS) + status = pjmedia_sdp_validate2(sdp_info->sdp, PJ_FALSE); - if (status != PJ_SUCCESS) { - sdp_info->sdp = NULL; - PJ_PERROR(1,(THIS_FILE, status, - "Error parsing/validating SDP body")); - } + if (status != PJ_SUCCESS) { + sdp_info->sdp = NULL; + PJ_PERROR(1, (THIS_FILE, status, + "Error parsing/validating SDP body")); + } - sdp_info->sdp_err = status; + sdp_info->sdp_err = status; + + return sdp_info; +} + +PJ_DEF(pjsip_rdata_sdp_info*) pjsip_rdata_get_sdp_info2( + pjsip_rx_data *rdata, + const pjsip_media_type *search_media_type) +{ + pjsip_media_type *msg_media_type = NULL; + pjsip_rdata_sdp_info *sdp_info; + + if (rdata->endpt_info.mod_data[mod_inv.mod.id]) { + return (pjsip_rdata_sdp_info *)rdata->endpt_info.mod_data[mod_inv.mod.id]; } + /* + * rdata should have a Content-Type header at this point but we'll + * make sure. + */ + if (rdata->msg_info.ctype) { + msg_media_type = &rdata->msg_info.ctype->media; + } + sdp_info = pjsip_get_sdp_info(rdata->tp_info.pool, + rdata->msg_info.msg->body, + msg_media_type, + search_media_type); + rdata->endpt_info.mod_data[mod_inv.mod.id] = sdp_info; + return sdp_info; } +PJ_DEF(pjsip_rdata_sdp_info*) pjsip_rdata_get_sdp_info(pjsip_rx_data *rdata) +{ + return pjsip_rdata_get_sdp_info2(rdata, NULL); +} + +PJ_DEF(pjsip_tdata_sdp_info*) pjsip_tdata_get_sdp_info2( + pjsip_tx_data *tdata, + const pjsip_media_type *search_media_type) +{ + pjsip_ctype_hdr *ctype_hdr = NULL; + pjsip_media_type *msg_media_type = NULL; + pjsip_tdata_sdp_info *sdp_info; + + if (tdata->mod_data[mod_inv.mod.id]) { + return (pjsip_tdata_sdp_info *)tdata->mod_data[mod_inv.mod.id]; + } + /* + * tdata won't usually have a Content-Type header at this point + * but we'll check just the same, + */ + ctype_hdr = pjsip_msg_find_hdr(tdata->msg, PJSIP_H_CONTENT_TYPE, NULL); + if (ctype_hdr) { + msg_media_type = &ctype_hdr->media; + } + + sdp_info = pjsip_get_sdp_info(tdata->pool, + tdata->msg->body, + msg_media_type, + search_media_type); + tdata->mod_data[mod_inv.mod.id] = sdp_info; + + return sdp_info; +} + +PJ_DEF(pjsip_tdata_sdp_info*) pjsip_tdata_get_sdp_info(pjsip_tx_data *tdata) +{ + return pjsip_tdata_get_sdp_info2(tdata, NULL); +} /* * Verify incoming INVITE request. @@ -1043,6 +1168,8 @@ *options |= PJSIP_INV_SUPPORT_TIMER; if (*options & PJSIP_INV_REQUIRE_ICE) *options |= PJSIP_INV_SUPPORT_ICE; + if (*options & PJSIP_INV_REQUIRE_TRICKLE_ICE) + *options |= PJSIP_INV_SUPPORT_TRICKLE_ICE; if (rdata) { /* Get the message in rdata */ @@ -1269,6 +1396,7 @@ const pj_str_t STR_100REL = { "100rel", 6}; const pj_str_t STR_TIMER = { "timer", 5}; const pj_str_t STR_ICE = { "ice", 3 }; + const pj_str_t STR_TRICKLE_ICE = { "trickle-ice", 11 }; for (i=0; icount; ++i) { if (pj_stricmp(&sup_hdr->values[i], &STR_100REL)==0) @@ -1277,6 +1405,8 @@ rem_option |= PJSIP_INV_SUPPORT_TIMER; else if (pj_stricmp(&sup_hdr->values[i], &STR_ICE)==0) rem_option |= PJSIP_INV_SUPPORT_ICE; + else if (pj_stricmp(&sup_hdr->values[i], &STR_TRICKLE_ICE)==0) + rem_option |= PJSIP_INV_SUPPORT_TRICKLE_ICE; } } @@ -1291,6 +1421,7 @@ const pj_str_t STR_REPLACES = { "replaces", 8 }; const pj_str_t STR_TIMER = { "timer", 5 }; const pj_str_t STR_ICE = { "ice", 3 }; + const pj_str_t STR_TRICKLE_ICE = { "trickle-ice", 11 }; unsigned unsupp_cnt = 0; pj_str_t unsupp_tags[PJSIP_GENERIC_ARRAY_MAX_COUNT]; @@ -1317,6 +1448,11 @@ { rem_option |= PJSIP_INV_REQUIRE_ICE; + } else if ((*options & PJSIP_INV_SUPPORT_TRICKLE_ICE) && + pj_stricmp(&req_hdr->values[i], &STR_TRICKLE_ICE)==0) + { + rem_option |= PJSIP_INV_REQUIRE_TRICKLE_ICE; + } else if (!pjsip_endpt_has_capability(endpt, PJSIP_H_SUPPORTED, NULL, &req_hdr->values[i])) { @@ -1364,9 +1500,11 @@ * by peer. */ if ( msg && (((*options & PJSIP_INV_REQUIRE_100REL)!=0 && - (rem_option & PJSIP_INV_SUPPORT_100REL)==0) || - ((*options & PJSIP_INV_REQUIRE_TIMER)!=0 && - (rem_option & PJSIP_INV_SUPPORT_TIMER)==0))) + (rem_option & PJSIP_INV_SUPPORT_100REL)==0) || + ((*options & PJSIP_INV_REQUIRE_TIMER)!=0 && + (rem_option & PJSIP_INV_SUPPORT_TIMER)==0) || + ((*options & PJSIP_INV_REQUIRE_TRICKLE_ICE)!=0 && + (rem_option & PJSIP_INV_SUPPORT_TRICKLE_ICE)==0))) { code = PJSIP_SC_EXTENSION_REQUIRED; status = PJSIP_ERRNO_FROM_SIP_STATUS(code); @@ -1382,6 +1520,8 @@ req_hdr->values[req_hdr->count++] = pj_str("100rel"); if (*options & PJSIP_INV_REQUIRE_TIMER) req_hdr->values[req_hdr->count++] = pj_str("timer"); + if (*options & PJSIP_INV_REQUIRE_TRICKLE_ICE) + req_hdr->values[req_hdr->count++] = pj_str("trickle-ice"); pj_list_push_back(&res_hdr_list, req_hdr); @@ -1411,6 +1551,10 @@ pj_assert(*options & PJSIP_INV_SUPPORT_TIMER); *options |= PJSIP_INV_REQUIRE_TIMER; } + if (rem_option & PJSIP_INV_REQUIRE_TRICKLE_ICE) { + pj_assert(*options & PJSIP_INV_SUPPORT_TRICKLE_ICE); + *options |= PJSIP_INV_REQUIRE_TRICKLE_ICE; + } on_return: @@ -1730,13 +1874,55 @@ return PJ_SUCCESS; } +static pjsip_multipart_part* create_sdp_part(pj_pool_t *pool, pjmedia_sdp_session *sdp) +{ + pjsip_multipart_part *sdp_part; + pjsip_media_type media_type; + + pjsip_media_type_init2(&media_type, "application", "sdp"); + + sdp_part = pjsip_multipart_create_part(pool); + PJ_ASSERT_RETURN(sdp_part != NULL, NULL); + + sdp_part->body = PJ_POOL_ZALLOC_T(pool, pjsip_msg_body); + PJ_ASSERT_RETURN(sdp_part->body != NULL, NULL); + + pjsip_media_type_cp(pool, &sdp_part->body->content_type, &media_type); + + sdp_part->body->data = sdp; + sdp_part->body->clone_data = clone_sdp; + sdp_part->body->print_body = print_sdp; + + return sdp_part; +} + +PJ_DEF(pj_status_t) pjsip_create_multipart_sdp_body(pj_pool_t *pool, + pjmedia_sdp_session *sdp, + pjsip_msg_body **p_body) +{ + pjsip_media_type media_type; + pjsip_msg_body *multipart; + pjsip_multipart_part *sdp_part; + + pjsip_media_type_init2(&media_type, "multipart", "mixed"); + multipart = pjsip_multipart_create(pool, &media_type, NULL); + PJ_ASSERT_RETURN(multipart != NULL, PJ_ENOMEM); + + sdp_part = create_sdp_part(pool, sdp); + PJ_ASSERT_RETURN(sdp_part != NULL, PJ_ENOMEM); + pjsip_multipart_add_part(pool, multipart, sdp_part); + *p_body = multipart; + + return PJ_SUCCESS; +} + static pjsip_msg_body *create_sdp_body(pj_pool_t *pool, const pjmedia_sdp_session *c_sdp) { pjsip_msg_body *body; pj_status_t status; - status = pjsip_create_sdp_body(pool, + status = pjsip_create_sdp_body(pool, pjmedia_sdp_session_clone(pool, c_sdp), &body); @@ -1772,7 +1958,8 @@ { /* If all extensions are enabled, nothing to do */ if ((inv_option & PJSIP_INV_SUPPORT_100REL) && - (inv_option & PJSIP_INV_SUPPORT_TIMER)) + (inv_option & PJSIP_INV_SUPPORT_TIMER) && + (inv_option & PJSIP_INV_SUPPORT_TRICKLE_ICE)) { return; } @@ -1796,6 +1983,11 @@ remove_val_from_array_hdr(sup_hdr, &STR_TIMER); } + if ((inv_option & PJSIP_INV_SUPPORT_TRICKLE_ICE) == 0 && sup_hdr) { + const pj_str_t STR_TRICKLE_ICE = { "trickle-ice", 11 }; + remove_val_from_array_hdr(sup_hdr, &STR_TRICKLE_ICE); + } + if ((inv_option & PJSIP_INV_SUPPORT_100REL) == 0) { const pj_str_t STR_PRACK = { "PRACK", 5 }; const pj_str_t STR_100REL = { "100rel", 6 }; @@ -1903,7 +2095,8 @@ /* Add Require header. */ if ((inv->options & PJSIP_INV_REQUIRE_100REL) || - (inv->options & PJSIP_INV_REQUIRE_TIMER)) + (inv->options & PJSIP_INV_REQUIRE_TIMER) || + (inv->options & PJSIP_INV_REQUIRE_TRICKLE_ICE)) { pjsip_require_hdr *hreq; @@ -1913,6 +2106,8 @@ hreq->values[hreq->count++] = pj_str("100rel"); if (inv->options & PJSIP_INV_REQUIRE_TIMER) hreq->values[hreq->count++] = pj_str("timer"); + if (inv->options & PJSIP_INV_REQUIRE_TRICKLE_ICE) + hreq->values[hreq->count++] = pj_str("trickle-ice"); pjsip_msg_add_hdr(tdata->msg, (pjsip_hdr*) hreq); } @@ -2006,6 +2201,14 @@ return PJMEDIA_SDP_EINSDP; } + /* Process the SDP body. */ + if (sdp_info->sdp_err) { + PJ_PERROR(4,(THIS_FILE, sdp_info->sdp_err, + "Error parsing SDP in %s", + pjsip_rx_data_get_info(rdata))); + return PJMEDIA_SDP_EINSDP; + } + /* Get/attach invite session's transaction data */ tsx_inv_data = (struct tsx_inv_data*) tsx->mod_data[mod_inv.mod.id]; if (tsx_inv_data == NULL) { @@ -2059,22 +2262,33 @@ ) ) { + pjsip_sdp_info *tdata_sdp_info; const pjmedia_sdp_session *reoffer_sdp = NULL; + if (pjmedia_sdp_neg_get_state(inv->neg) != + PJMEDIA_SDP_NEG_STATE_DONE) + { + PJ_LOG(4,(inv->obj_name, "SDP negotiation in progress, " + "message body in %s response is ignored", + (st_code/10==18? "early" : "final" ))); + return PJ_SUCCESS; + } + PJ_LOG(4,(inv->obj_name, "Received %s response " "after SDP negotiation has been done in early " "media. Renegotiating SDP..", (st_code/10==18? "early" : "final" ))); /* Retrieve original SDP offer from INVITE request */ - reoffer_sdp = (const pjmedia_sdp_session*) - tsx->last_tx->msg->body->data; + tdata_sdp_info = pjsip_tdata_get_sdp_info(tsx->last_tx); + reoffer_sdp = tdata_sdp_info->sdp; /* Feed the original offer to negotiator */ status = pjmedia_sdp_neg_modify_local_offer2(inv->pool_prov, inv->neg, inv->sdp_neg_flags, reoffer_sdp); + if (status != PJ_SUCCESS) { PJ_LOG(1,(inv->obj_name, "Error updating local offer for " "forked 2xx/18x response (err=%d)", status)); @@ -2095,14 +2309,6 @@ } } - /* Process the SDP body. */ - if (sdp_info->sdp_err) { - PJ_PERROR(4,(THIS_FILE, sdp_info->sdp_err, - "Error parsing SDP in %s", - pjsip_rx_data_get_info(rdata))); - return PJMEDIA_SDP_EINSDP; - } - pj_assert(sdp_info->sdp != NULL); /* The SDP can be an offer or answer, depending on negotiator's state */ @@ -2422,14 +2628,13 @@ status = pjsip_tx_data_clone(inv->last_answer, 0, &last_res); if (status != PJ_SUCCESS) goto on_return; - old_res = inv->last_answer; - inv->last_answer = last_res; - pjsip_tx_data_dec_ref(old_res); /* Modify last response. */ status = pjsip_dlg_modify_response(inv->dlg, last_res, st_code, st_text); - if (status != PJ_SUCCESS) + if (status != PJ_SUCCESS) { + pjsip_tx_data_dec_ref(last_res); goto on_return; + } /* For non-2xx final response, strip message body */ if (st_code >= 300) { @@ -2449,6 +2654,13 @@ /* Cleanup Allow & Supported headers from disabled extensions */ cleanup_allow_sup_hdr(inv->options, last_res, NULL, NULL); + /* Update last_answer */ + old_res = inv->last_answer; + inv->last_answer = last_res; + + /* Release old answer */ + pjsip_tx_data_dec_ref(old_res); + *p_tdata = last_res; on_return: @@ -2535,6 +2747,7 @@ /* Create appropriate message. */ switch (inv->state) { + case PJSIP_INV_STATE_NULL: case PJSIP_INV_STATE_CALLING: case PJSIP_INV_STATE_EARLY: case PJSIP_INV_STATE_INCOMING: @@ -2586,6 +2799,9 @@ /* For UAS, send a final response. */ tdata = inv->invite_tsx->last_tx; + if (tdata == NULL) + tdata = inv->last_answer; + PJ_ASSERT_RETURN(tdata != NULL, PJ_EINVALIDOP); //status = pjsip_dlg_modify_response(inv->dlg, tdata, st_code, @@ -3257,6 +3473,33 @@ goto on_error; } + /* Check if this is delayed manual ACK (see #416) */ + if (mod_inv.cb.on_send_ack && + tdata->msg->line.req.method.id == PJSIP_ACK_METHOD && + tdata == inv->last_ack) + { + pjsip_dlg_inc_lock(inv->dlg); + + /* Set state to CONFIRMED (if we're not in CONFIRMED yet). + * But don't set it to CONFIRMED if we're already DISCONNECTED + * (this may have been a late 200/OK response. + */ + if (inv->state < PJSIP_INV_STATE_CONFIRMED) { + pjsip_event ack_e; + PJSIP_EVENT_INIT_TX_MSG(ack_e, inv->last_ack); + inv_set_state(inv, PJSIP_INV_STATE_CONFIRMED, &ack_e); + } else if (inv->state == PJSIP_INV_STATE_DISCONNECTED) { + /* Avoid possible leaked tdata when invite session is + * already destroyed. + * https://github.com/pjsip/pjproject/pull/2432 + */ + pjsip_tx_data_dec_ref(inv->last_ack); + inv->last_ack = NULL; + } + + pjsip_dlg_dec_lock(inv->dlg); + } + } else { pjsip_cseq_hdr *cseq; @@ -3976,8 +4219,8 @@ if (inv->state != PJSIP_INV_STATE_DISCONNECTED && ((tsx->status_code == PJSIP_SC_CALL_TSX_DOES_NOT_EXIST && tsx->method.id != PJSIP_CANCEL_METHOD) || - tsx->status_code == PJSIP_SC_REQUEST_TIMEOUT || - tsx->status_code == PJSIP_SC_TSX_TIMEOUT)) + (tsx->status_code == PJSIP_SC_REQUEST_TIMEOUT && + !pjsip_cfg()->endpt.keep_inv_after_tsx_timeout))) { pjsip_tx_data *bye; pj_status_t status; @@ -4044,14 +4287,7 @@ return PJ_TRUE; /* Handled */ } - /* Process 502/503 error */ - else if ((tsx->state == PJSIP_TSX_STATE_TERMINATED) && - (tsx->status_code == 503 || tsx->status_code == 502)) - { - pjsip_timer_handle_refresh_error(inv, e); - return PJ_TRUE; - } else { return PJ_FALSE; /* Unhandled */ } @@ -5207,6 +5443,11 @@ if (tsx == inv->invite_tsx) inv->invite_tsx = NULL; + + /* Process 502/503 error for session timer refresh */ + if (tsx->status_code == 503 || tsx->status_code == 502) { + pjsip_timer_handle_refresh_error(inv, e); + } } } else if (tsx->role == PJSIP_ROLE_UAS && diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip/src/pjsip-ua/sip_reg.c asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip/src/pjsip-ua/sip_reg.c --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip/src/pjsip-ua/sip_reg.c 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip/src/pjsip-ua/sip_reg.c 2022-02-24 07:54:38.000000000 +0000 @@ -165,12 +165,21 @@ return PJ_SUCCESS; } - PJ_DEF(pj_status_t) pjsip_regc_destroy(pjsip_regc *regc) { + return pjsip_regc_destroy2(regc, PJ_TRUE); +} + +PJ_DEF(pj_status_t) pjsip_regc_destroy2(pjsip_regc *regc, pj_bool_t force) +{ PJ_ASSERT_RETURN(regc, PJ_EINVAL); pj_lock_acquire(regc->lock); + if (!force && regc->has_tsx) { + pj_lock_release(regc->lock); + return PJ_EBUSY; + } + if (regc->has_tsx || pj_atomic_get(regc->busy_ctr) != 0) { regc->_delete_flag = 1; regc->cb = NULL; @@ -1350,6 +1359,28 @@ PJSIP_REGC_MAX_CONTACT, contact); +#if PJSIP_REGISTER_ALLOW_EXP_REFRESH + if (expiration == 0 && regc->current_op != REGC_UNREGISTERING) { + /* Response contain expires contact param 0, allow client to + * continue refresh registration. + * Refer to: https://github.com/pjsip/pjproject/pull/2809 + */ + const pjsip_msg *msg = rdata->msg_info.msg; + const pjsip_expires_hdr *expires; + expires = (const pjsip_expires_hdr*) pjsip_msg_find_hdr(msg, + PJSIP_H_EXPIRES, NULL); + + if (expires) { + expiration = expires->ivalue; + } else if (regc->expires_hdr && regc->expires_hdr->ivalue) { + expiration = regc->expires_hdr->ivalue; + } else { + expiration = 3600; + } + PJ_LOG(4, (THIS_FILE, "Modify response's expiration from 0 " + "to %d", expiration)); + } +#endif /* Schedule next registration */ schedule_registration(regc, expiration); @@ -1390,7 +1421,7 @@ pj_status_t status; pjsip_cseq_hdr *cseq_hdr; pjsip_expires_hdr *expires_hdr; - pj_uint32_t cseq; + pj_int32_t cseq; pjsip_regc_add_ref(regc); pj_lock_acquire(regc->lock); @@ -1460,18 +1491,23 @@ /* Now send the message */ status = pjsip_endpt_send_request(regc->endpt, tdata, REGC_TSX_TIMEOUT, regc, ®c_tsx_callback); + + /* Reacquire the lock */ + pj_lock_acquire(regc->lock); + if (status!=PJ_SUCCESS) { /* On failure, regc_tsx_callback() may not be called, so we need * to reset regc->has_tsx here (see also ticket #1936). + * But note that we are releasing the lock when sending the request + * above, so there can be a race with another registration send. */ - regc->has_tsx = PJ_FALSE; + if (cseq == regc->cseq_hdr->cseq) { + regc->has_tsx = PJ_FALSE; + } PJ_PERROR(4,(THIS_FILE, status, "Error sending request")); } - /* Reacquire the lock */ - pj_lock_acquire(regc->lock); - /* Get last transport used and add reference to it */ if (tdata->tp_info.transport != regc->last_transport && status==PJ_SUCCESS) diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip/src/pjsip-ua/sip_timer.c asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip/src/pjsip-ua/sip_timer.c --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip/src/pjsip-ua/sip_timer.c 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip/src/pjsip-ua/sip_timer.c 2022-02-24 07:54:38.000000000 +0000 @@ -385,6 +385,11 @@ pjsip_endpt_schedule_timer(inv->dlg->endpt, &inv->timer->timer, &delay); pjsip_dlg_dec_lock(inv->dlg); + + PJ_LOG(3, (obj_name, + "Reschedule refresh request after %d seconds as " + "there is another SDP negotiation in progress", + delay.sec)); return; } diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip/src/pjsua2/account.cpp asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip/src/pjsua2/account.cpp --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip/src/pjsua2/account.cpp 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip/src/pjsua2/account.cpp 2022-02-24 07:54:38.000000000 +0000 @@ -76,7 +76,7 @@ pj_bzero(&setting, sizeof(setting)); setting.dont_use_avpf = this->dontUseAvpf; - setting.cap_count = this->caps.size(); + setting.cap_count = (unsigned)this->caps.size(); for (unsigned i = 0; i < setting.cap_count; ++i) { setting.caps[i] = this->caps[i].toPj(); } @@ -166,12 +166,12 @@ pj_bzero(&opt, sizeof(opt)); - opt.crypto_count = this->cryptos.size(); + opt.crypto_count = (unsigned)this->cryptos.size(); for (unsigned i = 0; i < opt.crypto_count; ++i) { opt.crypto[i] = this->cryptos[i].toPj(); } - opt.keying_count = this->keyings.size(); + opt.keying_count = (unsigned)this->keyings.size(); for (unsigned i = 0; i < opt.keying_count; ++i) { opt.keying[i] = (pjmedia_srtp_keying_method)this->keyings[i]; } @@ -389,6 +389,7 @@ NODE_READ_NUM_T ( this_node, pjsua_stun_use, mediaStunUse); NODE_READ_NUM_T ( this_node, pjsua_nat64_opt, nat64Opt); NODE_READ_BOOL ( this_node, iceEnabled); + NODE_READ_NUM_T ( this_node, pj_ice_sess_trickle, iceTrickle); NODE_READ_INT ( this_node, iceMaxHostCands); NODE_READ_BOOL ( this_node, iceAggressiveNomination); NODE_READ_UNSIGNED( this_node, iceNominatedCheckDelayMsec); @@ -422,6 +423,7 @@ NODE_WRITE_NUM_T ( this_node, pjsua_stun_use, mediaStunUse); NODE_WRITE_NUM_T ( this_node, pjsua_nat64_opt, nat64Opt); NODE_WRITE_BOOL ( this_node, iceEnabled); + NODE_WRITE_NUM_T ( this_node, pj_ice_sess_trickle, iceTrickle); NODE_WRITE_INT ( this_node, iceMaxHostCands); NODE_WRITE_BOOL ( this_node, iceAggressiveNomination); NODE_WRITE_UNSIGNED( this_node, iceNominatedCheckDelayMsec); @@ -461,6 +463,8 @@ NODE_READ_NUM_T ( this_node, pjsua_ipv6_use, ipv6Use); NODE_READ_OBJ ( this_node, transportConfig); NODE_READ_BOOL ( this_node, rtcpMuxEnabled); + NODE_READ_BOOL ( this_node, useLoopMedTp); + NODE_READ_BOOL ( this_node, enableLoopback); } void AccountMediaConfig::writeObject(ContainerNode &node) const @@ -476,6 +480,8 @@ NODE_WRITE_NUM_T ( this_node, pjsua_ipv6_use, ipv6Use); NODE_WRITE_OBJ ( this_node, transportConfig); NODE_WRITE_BOOL ( this_node, rtcpMuxEnabled); + NODE_WRITE_BOOL ( this_node, useLoopMedTp); + NODE_WRITE_BOOL ( this_node, enableLoopback); } /////////////////////////////////////////////////////////////////////////////// @@ -573,6 +579,7 @@ ret.unreg_timeout = regConfig.unregWaitMsec; ret.reg_use_proxy = regConfig.proxyUse; ret.reg_contact_params = str2Pj(regConfig.contactParams); + ret.reg_contact_uri_params = str2Pj(regConfig.contactUriParams); for (i=0; iext.aka.cb = (pjsip_cred_cb)Endpoint::on_auth_create_aka_response_callback; + } pj_acc_cfg.user_data = (void*)this; PJSUA2_CHECK_EXPR( pjsua_acc_add(&pj_acc_cfg, make_default, &id) ); } diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip/src/pjsua2/call.cpp asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip/src/pjsua2/call.cpp --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip/src/pjsua2/call.cpp 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip/src/pjsua2/call.cpp 2022-02-24 07:54:38.000000000 +0000 @@ -31,6 +31,9 @@ /////////////////////////////////////////////////////////////////////////////// +/* Avoid conflict with predefined standard macros. */ +#undef max +#undef min MathStat::MathStat() : n(0), max(0), min(0), last(0), mean(0) @@ -225,20 +228,39 @@ void CallSetting::fromPj(const pjsua_call_setting &prm) { + int i, mi; + this->flag = prm.flag; this->reqKeyframeMethod = prm.req_keyframe_method; this->audioCount = prm.aud_cnt; this->videoCount = prm.vid_cnt; + this->mediaDir.clear(); + /* Since we don't know the size of media_dir array, we populate + * mediaDir vector up to the element with non-default value. + */ + for (mi = PJMEDIA_MAX_SDP_MEDIA - 1; mi >= 0; mi--) { + if (prm.media_dir[mi] != PJMEDIA_DIR_ENCODING_DECODING) break; + } + for (i = 0; i <= mi; i++) { + this->mediaDir.push_back(prm.media_dir[i]); + } } pjsua_call_setting CallSetting::toPj() const { pjsua_call_setting setting; + unsigned mi; + + /* This is important to initialize media_dir array. */ + pjsua_call_setting_default(&setting); setting.flag = this->flag; setting.req_keyframe_method = this->reqKeyframeMethod; setting.aud_cnt = this->audioCount; setting.vid_cnt = this->videoCount; + for (mi = 0; mi < this->mediaDir.size(); mi++) { + setting.media_dir[mi] = (pjmedia_dir)this->mediaDir[mi]; + } return setting; } @@ -324,6 +346,15 @@ codecName = pj2Str(info.info.aud.fmt.encoding_name); codecClockRate = info.info.aud.fmt.clock_rate; audCodecParam.fromPj(*info.info.aud.param); + jbInit = info.info.aud.jb_init; + jbMinPre = info.info.aud.jb_min_pre; + jbMaxPre = info.info.aud.jb_max_pre; + jbMax = info.info.aud.jb_max; + jbDiscardAlgo = info.info.aud.jb_discard_algo; +#if defined(PJMEDIA_STREAM_ENABLE_KA) && (PJMEDIA_STREAM_ENABLE_KA != 0) + useKa = PJ2BOOL(info.info.aud.use_ka); +#endif + rtcpSdesByeDisabled = PJ2BOOL(info.info.aud.rtcp_sdes_bye_disabled); } else if (type == PJMEDIA_TYPE_VIDEO) { proto = info.info.vid.proto; dir = info.info.vid.dir; @@ -334,8 +365,17 @@ txPt = info.info.vid.tx_pt; rxPt = info.info.vid.rx_pt; codecName = pj2Str(info.info.vid.codec_info.encoding_name); - codecClockRate = info.info.vid.codec_info.clock_rate; - vidCodecParam.fromPj(*info.info.vid.codec_param); + codecClockRate = info.info.vid.codec_info.clock_rate; + vidCodecParam.fromPj(*info.info.vid.codec_param); + jbInit = info.info.vid.jb_init; + jbMinPre = info.info.vid.jb_min_pre; + jbMaxPre = info.info.vid.jb_max_pre; + jbMax = info.info.vid.jb_max; + jbDiscardAlgo = PJMEDIA_JB_DISCARD_NONE; +#if defined(PJMEDIA_STREAM_ENABLE_KA) && (PJMEDIA_STREAM_ENABLE_KA != 0) + useKa = PJ2BOOL(info.info.vid.use_ka); +#endif + rtcpSdesByeDisabled = PJ2BOOL(info.info.vid.rtcp_sdes_bye_disabled); } } diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip/src/pjsua2/endpoint.cpp asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip/src/pjsua2/endpoint.cpp --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip/src/pjsua2/endpoint.cpp 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip/src/pjsua2/endpoint.cpp 2022-02-24 07:54:38.000000000 +0000 @@ -60,13 +60,21 @@ pj_ssl_sock_info *ssock_info = info.ssl_sock_info; char straddr[PJ_INET6_ADDRSTRLEN+10]; const char *verif_msgs[32]; + const char *cipher_name; unsigned verif_msg_cnt; empty = false; established = PJ2BOOL(ssock_info->established); protocol = ssock_info->proto; cipher = ssock_info->cipher; - cipherName = pj_ssl_cipher_name(ssock_info->cipher); + cipher_name = pj_ssl_cipher_name(ssock_info->cipher); + if (cipher_name) { + cipherName = cipher_name; + } else { + char tmp[32]; + pj_ansi_snprintf(tmp, sizeof(tmp), "Cipher 0x%x", cipher); + cipherName = tmp; + } pj_sockaddr_print(&ssock_info->local_addr, straddr, sizeof(straddr), 3); localAddr = straddr; pj_sockaddr_print(&ssock_info->remote_addr, straddr, sizeof(straddr),3); @@ -121,6 +129,86 @@ } } +void DigestCredential::fromPj(const pjsip_digest_credential &prm) +{ + realm = pj2Str(prm.realm); + pjsip_param *p = (pjsip_param*)prm.other_param.next; + while (p != &prm.other_param) { + otherParam[pj2Str(p->name)] = pj2Str(p->value); + p = p->next; + } + username = pj2Str(prm.username); + nonce = pj2Str(prm.nonce); + uri = pj2Str(prm.uri); + response = pj2Str(prm.response); + algorithm = pj2Str(prm.algorithm); + cnonce = pj2Str(prm.cnonce); + opaque = pj2Str(prm.opaque); + qop = pj2Str(prm.qop); + nc = pj2Str(prm.nc); +} + +pjsip_digest_credential DigestCredential::toPj() const +{ + pjsip_digest_credential credentials; + pj_list_init(&credentials.other_param); + credentials.realm = str2Pj(realm); + credentials.username = str2Pj(username); + for (std::map::const_iterator it = otherParam.begin(); + it != otherParam.end(); ++it) { + pjsip_param other_param; + other_param.name = str2Pj(it->first); + other_param.value = str2Pj(it->second); + pj_list_push_back(&credentials.other_param, &other_param); + } + credentials.nonce = str2Pj(nonce); + credentials.uri = str2Pj(uri); + credentials.response = str2Pj(response); + credentials.algorithm = str2Pj(algorithm); + credentials.cnonce = str2Pj(cnonce); + credentials.opaque = str2Pj(opaque); + credentials.qop = str2Pj(qop); + credentials.nc = str2Pj(nc); + return credentials; +} + +void DigestChallenge::fromPj(const pjsip_digest_challenge &prm) +{ + realm = pj2Str(prm.realm); + pjsip_param *p = (pjsip_param*)prm.other_param.next; + while (p != &prm.other_param) { + otherParam[pj2Str(p->name)] = pj2Str(p->value); + p = p->next; + } + domain = pj2Str(prm.domain); + nonce = pj2Str(prm.nonce); + opaque = pj2Str(prm.opaque); + stale = prm.stale; + algorithm = pj2Str(prm.algorithm); + qop = pj2Str(prm.qop); +} + +pjsip_digest_challenge DigestChallenge::toPj() const +{ + pjsip_digest_challenge challenge; + pj_list_init(&challenge.other_param); + challenge.realm = str2Pj(realm); + challenge.domain = str2Pj(domain); + for (std::map::const_iterator it = otherParam.begin(); + it != otherParam.end(); ++it) { + pjsip_param other_param; + other_param.name = str2Pj(it->first); + other_param.value = str2Pj(it->second); + pj_list_push_back(&challenge.other_param, &other_param); + } + challenge.nonce = str2Pj(nonce); + challenge.opaque = str2Pj(opaque); + challenge.stale = stale; + challenge.algorithm = str2Pj(algorithm); + challenge.qop = str2Pj(qop); + return challenge; +} + /////////////////////////////////////////////////////////////////////////////// IpChangeParam::IpChangeParam() { @@ -349,6 +437,7 @@ this->jbMinPre = mc.jb_min_pre; this->jbMaxPre = mc.jb_max_pre; this->jbMax = mc.jb_max; + this->jbDiscardAlgo = mc.jb_discard_algo; this->sndAutoCloseTime = mc.snd_auto_close_time; this->vidPreviewEnableNative = PJ2BOOL(mc.vid_preview_enable_native); } @@ -380,6 +469,7 @@ mcfg.jb_min_pre = this->jbMinPre; mcfg.jb_max_pre = this->jbMaxPre; mcfg.jb_max = this->jbMax; + mcfg.jb_discard_algo = this->jbDiscardAlgo; mcfg.snd_auto_close_time = this->sndAutoCloseTime; mcfg.vid_preview_enable_native = this->vidPreviewEnableNative; @@ -411,6 +501,7 @@ NODE_READ_INT ( this_node, jbMinPre); NODE_READ_INT ( this_node, jbMaxPre); NODE_READ_INT ( this_node, jbMax); + NODE_READ_NUM_T ( this_node, pjmedia_jb_discard_algo, jbDiscardAlgo); NODE_READ_INT ( this_node, sndAutoCloseTime); NODE_READ_BOOL ( this_node, vidPreviewEnableNative); } @@ -440,6 +531,7 @@ NODE_WRITE_INT ( this_node, jbMinPre); NODE_WRITE_INT ( this_node, jbMaxPre); NODE_WRITE_INT ( this_node, jbMax); + NODE_WRITE_NUM_T ( this_node, pjmedia_jb_discard_algo, jbDiscardAlgo); NODE_WRITE_INT ( this_node, sndAutoCloseTime); NODE_WRITE_BOOL ( this_node, vidPreviewEnableNative); } @@ -571,6 +663,12 @@ } } +pj_status_t Endpoint::onCredAuth(OnCredAuthParam &prm) +{ + PJ_UNUSED_ARG(prm); + return PJ_ENOTSUP; +} + /* Run pending jobs only in main thread */ void Endpoint::performPendingJobs() { @@ -1094,6 +1192,45 @@ } } +void Endpoint::on_stream_precreate(pjsua_call_id call_id, + pjsua_on_stream_precreate_param *param) +{ + Call *call = Call::lookup(call_id); + if (!call) { + return; + } + + OnStreamPreCreateParam prm; + prm.streamIdx = param->stream_idx; + prm.streamInfo.fromPj(param->stream_info); + + call->onStreamPreCreate(prm); + + /* Copy back only the fields which are allowed to be changed. */ + if (param->stream_info.type == PJMEDIA_TYPE_AUDIO) { + param->stream_info.info.aud.jb_init = prm.streamInfo.jbInit; + param->stream_info.info.aud.jb_min_pre = prm.streamInfo.jbMinPre; + param->stream_info.info.aud.jb_max_pre = prm.streamInfo.jbMaxPre; + param->stream_info.info.aud.jb_max = prm.streamInfo.jbMax; + param->stream_info.info.aud.jb_discard_algo = prm.streamInfo.jbDiscardAlgo; +#if defined(PJMEDIA_STREAM_ENABLE_KA) && (PJMEDIA_STREAM_ENABLE_KA != 0) + param->stream_info.info.aud.use_ka = prm.streamInfo.useKa; +#endif + param->stream_info.info.aud.rtcp_sdes_bye_disabled = prm.streamInfo.rtcpSdesByeDisabled; + } else if (param->stream_info.type == PJMEDIA_TYPE_VIDEO) { + param->stream_info.info.vid.jb_init = prm.streamInfo.jbInit; + param->stream_info.info.vid.jb_min_pre = prm.streamInfo.jbMinPre; + param->stream_info.info.vid.jb_max_pre = prm.streamInfo.jbMaxPre; + param->stream_info.info.vid.jb_max = prm.streamInfo.jbMax; +#if defined(PJMEDIA_STREAM_ENABLE_KA) && (PJMEDIA_STREAM_ENABLE_KA != 0) + param->stream_info.info.vid.use_ka = prm.streamInfo.useKa; +#endif + param->stream_info.info.vid.rtcp_sdes_bye_disabled = prm.streamInfo.rtcpSdesByeDisabled; + param->stream_info.info.vid.codec_param->enc_fmt = prm.streamInfo.vidCodecParam.encFmt.toPj(); + + } +} + void Endpoint::on_stream_created2(pjsua_call_id call_id, pjsua_on_stream_created_param *param) { @@ -1185,6 +1322,60 @@ Endpoint::instance().utilAddPendingJob(job); } +struct PendingOnDtmfEventCallback : public PendingJob +{ + int call_id; + OnDtmfEventParam prm; + + virtual void execute(bool is_pending) + { + PJ_UNUSED_ARG(is_pending); + + Call *call = Call::lookup(call_id); + if (!call) + return; + + call->onDtmfEvent(prm); + + /* If this event indicates a new DTMF digit, invoke onDtmfDigit + * as well. + * Note that the duration is pretty much useless in this context as it + * will most likely equal the ptime of one frame received via RTP in + * milliseconds. Since the application can't receive updates to the + * duration via this interface and the total duration of the event is + * not known yet, just indicate an unknown duration. + */ + if (!(prm.flags & PJMEDIA_STREAM_DTMF_IS_UPDATE)) { + OnDtmfDigitParam prmBasic; + prmBasic.method = prm.method; + prmBasic.digit = prm.digit; + prmBasic.duration = PJSUA_UNKNOWN_DTMF_DURATION; + call->onDtmfDigit(prmBasic); + } + } +}; + +void Endpoint::on_dtmf_event(pjsua_call_id call_id, + const pjsua_dtmf_event* event) +{ + Call *call = Call::lookup(call_id); + if (!call) { + return; + } + + PendingOnDtmfEventCallback *job = new PendingOnDtmfEventCallback; + job->call_id = call_id; + char buf[10]; + pj_ansi_sprintf(buf, "%c", event->digit); + job->prm.method = event->method; + job->prm.timestamp = event->timestamp; + job->prm.digit = string(buf); + job->prm.duration = event->duration; + job->prm.flags = event->flags; + + Endpoint::instance().utilAddPendingJob(job); +} + void Endpoint::on_call_transfer_request2(pjsua_call_id call_id, const pj_str_t *dst, pjsip_status_code *code, @@ -1677,10 +1868,12 @@ ua_cfg.cb.on_call_tsx_state = &Endpoint::on_call_tsx_state; ua_cfg.cb.on_call_media_state = &Endpoint::on_call_media_state; ua_cfg.cb.on_call_sdp_created = &Endpoint::on_call_sdp_created; + ua_cfg.cb.on_stream_precreate = &Endpoint::on_stream_precreate; ua_cfg.cb.on_stream_created2 = &Endpoint::on_stream_created2; ua_cfg.cb.on_stream_destroyed = &Endpoint::on_stream_destroyed; //ua_cfg.cb.on_dtmf_digit = &Endpoint::on_dtmf_digit; - ua_cfg.cb.on_dtmf_digit2 = &Endpoint::on_dtmf_digit2; + //ua_cfg.cb.on_dtmf_digit2 = &Endpoint::on_dtmf_digit2; + ua_cfg.cb.on_dtmf_event = &Endpoint::on_dtmf_event; ua_cfg.cb.on_call_transfer_request2 = &Endpoint::on_call_transfer_request2; ua_cfg.cb.on_call_transfer_status = &Endpoint::on_call_transfer_status; ua_cfg.cb.on_call_replace_request2 = &Endpoint::on_call_replace_request2; @@ -2236,7 +2429,7 @@ void Endpoint::setCodecOpusConfig(const CodecOpusConfig &opus_cfg) PJSUA2_THROW(Error) { - const pj_str_t codec_id = {"opus", 4}; + const pj_str_t codec_id = {(char *)"opus", 4}; pjmedia_codec_param param; pjmedia_codec_opus_config new_opus_cfg; @@ -2358,7 +2551,7 @@ PJSUA2_CHECK_EXPR(pjsua_vid_codec_set_param(&codec_str, NULL)); #else - PJ_UNUSED_ARG(codec_id); + PJ_UNUSED_ARG(codec_id); #endif } @@ -2386,3 +2579,41 @@ pjsua_ip_change_param ip_change_param = param.toPj(); PJSUA2_CHECK_EXPR(pjsua_handle_ip_change(&ip_change_param)); } + +pj_status_t Endpoint::on_auth_create_aka_response_callback(pj_pool_t *pool, + const pjsip_digest_challenge *chal, + const pjsip_cred_info *cred, + const pj_str_t *method, + pjsip_digest_credential *auth) +{ + OnCredAuthParam prm; + prm.digestChallenge.fromPj(*chal); + prm.credentialInfo.fromPj(*cred); + prm.method = pj2Str(*method); + prm.digestCredential.fromPj(*auth); + + pj_status_t status = Endpoint::instance().onCredAuth(prm); + + if (status == PJ_SUCCESS) { + pjsip_digest_credential auth_new = prm.digestCredential.toPj(); + // Duplicate in the pool, so that digestCredential + // is allowed to be destructed at the end of the method. + pj_strdup(pool, &auth->realm, &auth_new.realm); + pj_strdup(pool, &auth->username, &auth_new.username); + pj_strdup(pool, &auth->nonce, &auth_new.nonce); + pj_strdup(pool, &auth->uri, &auth_new.uri); + pj_strdup(pool, &auth->response, &auth_new.response); + pj_strdup(pool, &auth->algorithm, &auth_new.algorithm); + pj_strdup(pool, &auth->cnonce, &auth_new.cnonce); + pj_strdup(pool, &auth->opaque, &auth_new.opaque); + pj_strdup(pool, &auth->qop, &auth_new.qop); + pj_strdup(pool, &auth->nc, &auth_new.nc); + pjsip_param_clone(pool, &auth->other_param, &auth_new.other_param); + } +#if PJSIP_HAS_DIGEST_AKA_AUTH + else if (status == PJ_ENOTSUP) { + status = pjsip_auth_create_aka_response(pool, chal, cred, method, auth); + } +#endif + return status; +} diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip/src/pjsua2/media.cpp asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip/src/pjsua2/media.cpp --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip/src/pjsua2/media.cpp 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip/src/pjsua2/media.cpp 2022-02-24 07:54:38.000000000 +0000 @@ -25,6 +25,8 @@ using namespace pj; using namespace std; +#include + #define THIS_FILE "media.cpp" #define MAX_FILE_NAMES 64 #define MAX_DEV_COUNT 64 @@ -712,10 +714,9 @@ void AudDevManager::setCaptureDev(int capture_dev) const PJSUA2_THROW(Error) { pjsua_snd_dev_param param; - pjsua_snd_dev_param_default(¶m); + PJSUA2_CHECK_EXPR(pjsua_get_snd_dev2(¶m)); param.capture_dev = capture_dev; - param.playback_dev = getPlaybackDev(); /* Normalize invalid ID or null device to default device */ if (param.playback_dev == PJMEDIA_AUD_INVALID_DEV || @@ -724,7 +725,7 @@ param.playback_dev = PJMEDIA_AUD_DEFAULT_PLAYBACK_DEV; } - param.mode = PJSUA_SND_DEV_NO_IMMEDIATE_OPEN; + param.mode |= PJSUA_SND_DEV_NO_IMMEDIATE_OPEN; PJSUA2_CHECK_EXPR( pjsua_set_snd_dev2(¶m) ); } @@ -732,10 +733,9 @@ void AudDevManager::setPlaybackDev(int playback_dev) const PJSUA2_THROW(Error) { pjsua_snd_dev_param param; - pjsua_snd_dev_param_default(¶m); + PJSUA2_CHECK_EXPR(pjsua_get_snd_dev2(¶m)); param.playback_dev = playback_dev; - param.capture_dev = getCaptureDev(); /* Normalize invalid ID or null device to default device */ if (param.capture_dev == PJMEDIA_AUD_INVALID_DEV || @@ -744,7 +744,7 @@ param.capture_dev = PJMEDIA_AUD_DEFAULT_CAPTURE_DEV; } - param.mode = PJSUA_SND_DEV_NO_IMMEDIATE_OPEN; + param.mode |= PJSUA_SND_DEV_NO_IMMEDIATE_OPEN; PJSUA2_CHECK_EXPR( pjsua_set_snd_dev2(¶m) ); } @@ -798,15 +798,9 @@ void AudDevManager::setSndDevMode(unsigned mode) const PJSUA2_THROW(Error) { - int capture_dev = 0, playback_dev = 0; pjsua_snd_dev_param param; - pj_status_t status = pjsua_get_snd_dev(&capture_dev, &playback_dev); - if (status != PJ_SUCCESS) { - PJSUA2_RAISE_ERROR2(status, "AudDevManager::setSndDevMode()"); - } - pjsua_snd_dev_param_default(¶m); - param.capture_dev = capture_dev; - param.playback_dev = playback_dev; + + PJSUA2_CHECK_EXPR(pjsua_get_snd_dev2(¶m)); param.mode = mode; PJSUA2_CHECK_EXPR( pjsua_set_snd_dev2(¶m) ); } @@ -1284,12 +1278,24 @@ void VideoWindow::setFullScreen(bool enabled) PJSUA2_THROW(Error) { #if PJSUA_HAS_VIDEO - PJSUA2_CHECK_EXPR( pjsua_vid_win_set_fullscreen(winId, enabled) ); + pjmedia_vid_dev_fullscreen_flag mode; + mode = enabled? PJMEDIA_VID_DEV_FULLSCREEN : PJMEDIA_VID_DEV_WINDOWED; + PJSUA2_CHECK_EXPR( pjsua_vid_win_set_fullscreen(winId, mode) ); #else PJ_UNUSED_ARG(enabled); #endif } +void VideoWindow::setFullScreen2(pjmedia_vid_dev_fullscreen_flag mode) + PJSUA2_THROW(Error) +{ +#if PJSUA_HAS_VIDEO + PJSUA2_CHECK_EXPR( pjsua_vid_win_set_fullscreen(winId, mode) ); +#else + PJ_UNUSED_ARG(mode); +#endif +} + /////////////////////////////////////////////////////////////////////////////// VideoPreviewOpParam::VideoPreviewOpParam() { @@ -1333,9 +1339,12 @@ } VideoPreview::VideoPreview(int dev_id) -: devId(dev_id) +: devId(dev_id), winId(PJSUA_INVALID_ID) { - +#if !PJSUA_HAS_VIDEO + /* Suppress warning of unused field when video is disabled */ + PJ_UNUSED_ARG(winId); +#endif } bool VideoPreview::hasNative() @@ -1352,6 +1361,11 @@ #if PJSUA_HAS_VIDEO pjsua_vid_preview_param prm = param.toPj(); PJSUA2_CHECK_EXPR(pjsua_vid_preview_start(devId, &prm)); + + /* Device may be fast-switched and VideoPreview will not aware of that, + * so better keep win ID too. + */ + winId = pjsua_vid_preview_get_win(devId); #else PJ_UNUSED_ARG(param); PJ_UNUSED_ARG(devId); @@ -1361,14 +1375,15 @@ void VideoPreview::stop() PJSUA2_THROW(Error) { #if PJSUA_HAS_VIDEO - pjsua_vid_preview_stop(devId); + updateDevId(); + PJSUA2_CHECK_EXPR(pjsua_vid_preview_stop(devId)); #endif } VideoWindow VideoPreview::getVideoWindow() { #if PJSUA_HAS_VIDEO - return (VideoWindow(pjsua_vid_preview_get_win(devId))); + return (VideoWindow(winId)); #else return (VideoWindow(PJSUA_INVALID_ID)); #endif @@ -1377,6 +1392,7 @@ VideoMedia VideoPreview::getVideoMedia() PJSUA2_THROW(Error) { #if PJSUA_HAS_VIDEO + updateDevId(); pjsua_conf_port_id id = pjsua_vid_preview_get_vid_conf_port(devId); if (id != PJSUA_INVALID_ID) { VideoMediaHelper vm; @@ -1390,6 +1406,22 @@ #endif } +/* Device may be fastswitched and VideoPreview will not aware of that, + * this function will update the VideoPreview device ID. + */ +void VideoPreview::updateDevId() +{ +#if PJSUA_HAS_VIDEO + if (winId != PJSUA_INVALID_ID) { + PJSUA_LOCK(); + pjsua_vid_win *w = &pjsua_var.win[winId]; + pj_assert(w->type == PJSUA_WND_TYPE_PREVIEW); + devId = w->preview_cap_id; + PJSUA_UNLOCK(); + } +#endif +} + /////////////////////////////////////////////////////////////////////////////// void MediaFormatVideo::fromPj(const pjmedia_format &format) { @@ -1464,6 +1496,17 @@ } /////////////////////////////////////////////////////////////////////////////// +void VidDevManager::initSubsys() PJSUA2_THROW(Error) +{ +#if PJSUA_HAS_VIDEO && PJSUA_DONT_INIT_VID_DEV_SUBSYS + /* Should init once only! */ + if (pjmedia_get_vid_subsys()->init_count > 0) + return; + + PJSUA2_CHECK_EXPR(pjmedia_vid_dev_subsys_init(pjsua_get_pool_factory())); +#endif +} + void VidDevManager::refreshDevs() PJSUA2_THROW(Error) { #if PJSUA_HAS_VIDEO @@ -2005,3 +2048,12 @@ PJSUA2_RAISE_ERROR(PJ_EINVALIDOP); #endif } + +void VideoMedia::update() const PJSUA2_THROW(Error) +{ +#if PJSUA_HAS_VIDEO + PJSUA2_CHECK_EXPR( pjsua_vid_conf_update_port(id) ); +#else + PJSUA2_RAISE_ERROR(PJ_EINVALIDOP); +#endif +} diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip/src/pjsua2/presence.cpp asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip/src/pjsua2/presence.cpp --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip/src/pjsua2/presence.cpp 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip/src/pjsua2/presence.cpp 2022-02-24 07:54:38.000000000 +0000 @@ -143,6 +143,11 @@ account.addBuddy(this); } + +int Buddy::getId() const +{ + return id; +} /* * Check if this buddy is valid. diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip/src/pjsua2/siptypes.cpp asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip/src/pjsua2/siptypes.cpp --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip/src/pjsua2/siptypes.cpp 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip/src/pjsua2/siptypes.cpp 2022-02-24 07:54:38.000000000 +0000 @@ -145,6 +145,32 @@ NODE_WRITE_STRING( this_node, akaAmf); } +void AuthCredInfo::fromPj(const pjsip_cred_info &prm) +{ + realm = pj2Str(prm.realm); + scheme = pj2Str(prm.scheme); + username = pj2Str(prm.username); + dataType = prm.data_type; + data = pj2Str(prm.data); + akaK = pj2Str(prm.ext.aka.k); + akaOp = pj2Str(prm.ext.aka.op); + akaAmf = pj2Str(prm.ext.aka.amf); +} + +pjsip_cred_info AuthCredInfo::toPj() const +{ + pjsip_cred_info ret; + ret.realm = str2Pj(realm); + ret.scheme = str2Pj(scheme); + ret.username = str2Pj(username); + ret.data_type = dataType; + ret.data = str2Pj(data); + ret.ext.aka.k = str2Pj(akaK); + ret.ext.aka.op = str2Pj(akaOp); + ret.ext.aka.amf = str2Pj(akaAmf); + return ret; +} + /////////////////////////////////////////////////////////////////////////////// TlsConfig::TlsConfig() : method(PJSIP_SSL_UNSPECIFIED_METHOD), diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip/src/pjsua2-test/main.cpp asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip/src/pjsua2-test/main.cpp --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip/src/pjsua2-test/main.cpp 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip/src/pjsua2-test/main.cpp 2022-02-24 07:54:38.000000000 +0000 @@ -20,6 +20,7 @@ using namespace pj; +extern "C" int main(int argc, char *argv[]) { Endpoint ep; diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip/src/pjsua-lib/pjsua_acc.c asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip/src/pjsua-lib/pjsua_acc.c --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip/src/pjsua-lib/pjsua_acc.c 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip/src/pjsua-lib/pjsua_acc.c 2022-02-24 07:54:38.000000000 +0000 @@ -90,6 +90,8 @@ pj_strdup_with_null(pool, &dst->force_contact, &src->force_contact); pj_strdup_with_null(pool, &dst->reg_contact_params, &src->reg_contact_params); + pj_strdup_with_null(pool, &dst->reg_contact_uri_params, + &src->reg_contact_uri_params); pj_strdup_with_null(pool, &dst->contact_params, &src->contact_params); pj_strdup_with_null(pool, &dst->contact_uri_params, &src->contact_uri_params); @@ -460,7 +462,8 @@ if (acc->pool) pj_pool_reset(acc->pool); else - acc->pool = pjsua_pool_create("acc%p", 512, 256); + acc->pool = pjsua_pool_create("acc%p", PJSUA_POOL_LEN_ACC, + PJSUA_POOL_INC_ACC); /* Copy config */ pjsua_acc_config_dup(acc->pool, &pjsua_var.acc[id].cfg, cfg); @@ -1029,6 +1032,16 @@ unreg_first = PJ_TRUE; } + /* Register contact URI params */ + if (pj_strcmp(&acc->cfg.reg_contact_uri_params, + &cfg->reg_contact_uri_params)) + { + pj_strdup_with_null(acc->pool, &acc->cfg.reg_contact_uri_params, + &cfg->reg_contact_uri_params); + update_reg = PJ_TRUE; + unreg_first = PJ_TRUE; + } + /* Contact param */ if (pj_strcmp(&acc->cfg.contact_params, &cfg->contact_params)) { pj_strdup_with_null(acc->pool, &acc->cfg.contact_params, @@ -1526,7 +1539,9 @@ return PJ_SUCCESS; } -/* Create reg_contact, mainly for SIP outbound */ +/* Create reg_contact, adding SIP outbound params and other REGISTER specific + * Contact params, i.e: reg_contact_params, reg_contact_uri_params. + */ static void update_regc_contact(pjsua_acc *acc) { pjsua_acc_config *acc_cfg = &acc->cfg; @@ -1559,7 +1574,10 @@ pj_str_t reg_contact; acc->rfc5626_status = OUTBOUND_WANTED; - len = acc->contact.slen + acc->cfg.reg_contact_params.slen + + len = acc->contact.slen + + acc->cfg.contact_params.slen + + acc->cfg.reg_contact_params.slen + + acc->cfg.reg_contact_uri_params.slen + (need_outbound? (acc->rfc5626_instprm.slen + acc->rfc5626_regprm.slen): 0); if (len > acc->contact.slen) { @@ -1567,6 +1585,44 @@ pj_strcpy(®_contact, &acc->contact); + /* Contact URI params */ + if (acc->cfg.reg_contact_uri_params.slen) { + pj_pool_t *pool; + pjsip_contact_hdr *contact_hdr; + pjsip_sip_uri *uri; + pj_str_t uri_param = acc->cfg.reg_contact_uri_params; + const pj_str_t STR_CONTACT = { "Contact", 7 }; + char tmp_uri[PJSIP_MAX_URL_SIZE]; + pj_ssize_t tmp_len; + + /* Get the URI string */ + pool = pjsua_pool_create("tmp", 512, 512); + contact_hdr = (pjsip_contact_hdr*) + pjsip_parse_hdr(pool, &STR_CONTACT, + reg_contact.ptr, + reg_contact.slen, NULL); + pj_assert(contact_hdr != NULL); + uri = (pjsip_sip_uri*) contact_hdr->uri; + pj_assert(uri != NULL); + uri = (pjsip_sip_uri*) pjsip_uri_get_uri(uri); + tmp_len = pjsip_uri_print(PJSIP_URI_IN_CONTACT_HDR, + uri, tmp_uri, + sizeof(tmp_uri)); + pj_assert(tmp_len > 0); + pj_pool_release(pool); + + /* Regenerate Contact */ + reg_contact.slen = pj_ansi_snprintf( + reg_contact.ptr, len, + "<%.*s%.*s>%.*s", + (int)tmp_len, tmp_uri, + (int)uri_param.slen, uri_param.ptr, + (int)acc->cfg.contact_params.slen, + acc->cfg.contact_params.ptr); + pj_assert(reg_contact.slen > 0); + } + + /* Outbound */ if (need_outbound) { acc->rfc5626_status = OUTBOUND_WANTED; @@ -1579,6 +1635,7 @@ acc->rfc5626_status = OUTBOUND_NA; } + /* Contact params */ pj_strcat(®_contact, &acc->cfg.reg_contact_params); acc->reg_contact = reg_contact; @@ -2019,7 +2076,6 @@ acc->index, uri_cnt)); } - /* Keep alive timer callback */ static void keep_alive_timer_cb(pj_timer_heap_t *th, pj_timer_entry *te) { @@ -2028,6 +2084,8 @@ pj_time_val delay; char addrtxt[PJ_INET6_ADDRSTRLEN]; pj_status_t status; + unsigned ka_timer; + unsigned lower_bound; PJ_UNUSED_ARG(th); @@ -2068,13 +2126,20 @@ /* Check just in case keep-alive has been disabled. This shouldn't happen * though as when ka_interval is changed this timer should have been * cancelled. + * + * Also check if Flow Timer (rfc5626) is not set. */ - if (acc->cfg.ka_interval == 0) + if (acc->cfg.ka_interval == 0 && acc->rfc5626_flowtmr == 0) goto on_return; - /* Reschedule next timer */ - delay.sec = acc->cfg.ka_interval; + ka_timer = acc->rfc5626_flowtmr ? acc->rfc5626_flowtmr : + acc->cfg.ka_interval; + + lower_bound = (unsigned)((float)ka_timer * 0.8f); + delay.sec = pj_rand() % (ka_timer - lower_bound) + lower_bound; delay.msec = 0; + + /* Reschedule next timer */ status = pjsip_endpt_schedule_timer(pjsua_var.endpt, te, &delay); if (status == PJ_SUCCESS) { te->id = PJ_TRUE; @@ -2105,8 +2170,22 @@ if (start) { pj_time_val delay; pj_status_t status; + pjsip_generic_string_hdr *hsr = NULL; + unsigned ka_timer; + unsigned lower_bound; + + static const pj_str_t STR_FLOW_TIMER = { "Flow-Timer", 10 }; + + hsr = (pjsip_generic_string_hdr*) + pjsip_msg_find_hdr_by_name(param->rdata->msg_info.msg, + &STR_FLOW_TIMER, hsr); + + if (hsr) { + acc->rfc5626_flowtmr = pj_strtoul(&hsr->hvalue); + } /* Only do keep-alive if: + * - REGISTER response contain Flow-Timer header, otherwise * - ka_interval is not zero in the account, and * - transport is UDP. * @@ -2121,9 +2200,9 @@ * is done by the transport layer. */ if (/*pjsua_var.stun_srv.ipv4.sin_family == 0 ||*/ - acc->cfg.ka_interval == 0 || - (param->rdata->tp_info.transport->key.type & - ~PJSIP_TRANSPORT_IPV6)!= PJSIP_TRANSPORT_UDP) + ((acc->cfg.ka_interval == 0) && (acc->rfc5626_flowtmr == 0)) || + (!hsr && ((param->rdata->tp_info.transport->key.type & + ~PJSIP_TRANSPORT_IPV6) != PJSIP_TRANSPORT_UDP))) { /* Keep alive is not necessary */ return; @@ -2157,7 +2236,11 @@ acc->ka_timer.cb = &keep_alive_timer_cb; acc->ka_timer.user_data = (void*)acc; - delay.sec = acc->cfg.ka_interval; + ka_timer = acc->rfc5626_flowtmr ? acc->rfc5626_flowtmr : + acc->cfg.ka_interval; + + lower_bound = (unsigned)((float)ka_timer * 0.8f); + delay.sec = pj_rand() % (ka_timer - lower_bound) + lower_bound; delay.msec = 0; status = pjsip_endpt_schedule_timer(pjsua_var.endpt, &acc->ka_timer, &delay); @@ -2170,7 +2253,7 @@ addr, sizeof(addr), 1); PJ_LOG(4,(THIS_FILE, "Keep-alive timer started for acc %d, " "destination:%s, interval:%ds", - acc->index, addr, acc->cfg.ka_interval)); + acc->index, addr, delay.sec)); } else { acc->ka_timer.id = PJ_FALSE; pjsip_transport_dec_ref(acc->ka_transport); @@ -2288,16 +2371,38 @@ * Print registration status. */ if (param->status!=PJ_SUCCESS) { + pj_status_t status; + pjsua_perror(THIS_FILE, "SIP registration error", param->status); - pjsip_regc_destroy(acc->regc); - acc->regc = NULL; - acc->contact.slen = 0; - acc->reg_mapped_addr.slen = 0; - acc->rfc5626_status = OUTBOUND_UNKNOWN; + + if (param->status == PJSIP_EBUSY) { + pj_log_pop_indent(); + PJSUA_UNLOCK(); + return; + } + + /* This callback is called without holding the registration's lock, + * so there can be a race condition with another registration + * process. Therefore, we must not forcefully try to destroy + * the registration here. + */ + status = pjsip_regc_destroy2(acc->regc, PJ_FALSE); + if (status == PJ_SUCCESS) { + acc->regc = NULL; + acc->contact.slen = 0; + acc->reg_mapped_addr.slen = 0; + acc->rfc5626_status = OUTBOUND_UNKNOWN; + acc->rfc5626_flowtmr = 0; - /* Stop keep-alive timer if any. */ - update_keep_alive(acc, PJ_FALSE, NULL); + /* Stop keep-alive timer if any. */ + update_keep_alive(acc, PJ_FALSE, NULL); + } else { + /* Another registration is in progress. */ + pj_assert(status == PJ_EBUSY); + pjsua_perror(THIS_FILE, "Deleting registration failed", + status); + } } else if (param->code < 0 || param->code >= 300) { PJ_LOG(2, (THIS_FILE, "SIP registration failed, status=%d (%.*s)", @@ -2308,6 +2413,7 @@ acc->contact.slen = 0; acc->reg_mapped_addr.slen = 0; acc->rfc5626_status = OUTBOUND_UNKNOWN; + acc->rfc5626_flowtmr = 0; /* Stop keep-alive timer if any. */ update_keep_alive(acc, PJ_FALSE, NULL); @@ -2324,6 +2430,7 @@ acc->contact.slen = 0; acc->reg_mapped_addr.slen = 0; acc->rfc5626_status = OUTBOUND_UNKNOWN; + acc->rfc5626_flowtmr = 0; /* Reset pointer to registration transport */ //acc->auto_rereg.reg_tp = NULL; @@ -2356,14 +2463,26 @@ /* Check and update Service-Route header */ update_service_route(acc, param->rdata); - PJ_LOG(3, (THIS_FILE, - "%s: registration success, status=%d (%.*s), " - "will re-register in %d seconds", - pjsua_var.acc[acc->index].cfg.id.ptr, - param->code, - (int)param->reason.slen, param->reason.ptr, - param->expiration)); +#if PJSUA_REG_AUTO_REG_REFRESH + PJ_LOG(3, (THIS_FILE, + "%s: registration success, status=%d (%.*s), " + "will re-register in %d seconds", + pjsua_var.acc[acc->index].cfg.id.ptr, + param->code, + (int)param->reason.slen, param->reason.ptr, + param->expiration)); + +#else + + PJ_LOG(3, (THIS_FILE, + "%s: registration success, status=%d (%.*s), " + "auto re-register disabled", + pjsua_var.acc[acc->index].cfg.id.ptr, + param->code, + (int)param->reason.slen, param->reason.ptr)); + +#endif /* Start keep-alive timer if necessary. */ update_keep_alive(acc, PJ_TRUE, param); @@ -2724,7 +2843,8 @@ goto on_return; } - status = pjsip_regc_register(pjsua_var.acc[acc_id].regc, 1, + status = pjsip_regc_register(pjsua_var.acc[acc_id].regc, + PJSUA_REG_AUTO_REG_REFRESH, &tdata); if (0 && status == PJ_SUCCESS && pjsua_var.acc[acc_id].cred_cnt) { @@ -2739,11 +2859,11 @@ PJ_UNUSED_ARG(d); h = pjsip_authorization_hdr_create(tdata->pool); - h->scheme = pj_str("Digest"); + h->scheme = pjsip_DIGEST_STR; h->credential.digest.username = acc->cred[0].username; h->credential.digest.realm = acc->srv_domain; h->credential.digest.uri = pj_str(uri); - h->credential.digest.algorithm = pj_str("md5"); + h->credential.digest.algorithm = pjsip_MD5_STR; pjsip_msg_add_hdr(tdata->msg, (pjsip_hdr*)h); } @@ -3346,7 +3466,7 @@ for (i = 0; i < sizeof(pjsua_var.tpdata); i++) { if (tfla2_prm.ret_tp==(const void *)pjsua_var.tpdata[i].data.tp) { if (pjsua_var.tpdata[i].has_bound_addr) { - pj_strdup(acc->pool, &addr->host, + pj_strdup(pool, &addr->host, &pjsua_var.tpdata[i].data.tp->local_name.host); addr->port = (pj_uint16_t) pjsua_var.tpdata[i].data.tp->local_name.port; @@ -3784,6 +3904,42 @@ /* Start re-registration */ acc->auto_rereg.attempt_cnt++; + + /* Generate new contact as the current contact may use a disconnected + * transport. Only do this when outbound is not active and contact is not + * rewritten (where the contact address may really be used by server to + * contact the UA). + */ + if (acc->rfc5626_status != OUTBOUND_ACTIVE && !acc->contact_rewritten) { + pj_str_t tmp_contact; + pj_pool_t *pool; + + pool = pjsua_pool_create("tmpregc", 512, 512); + + status = pjsua_acc_create_uac_contact(pool, &tmp_contact, acc->index, + &acc->cfg.reg_uri); + if (status != PJ_SUCCESS) { + pjsua_perror(THIS_FILE, + "Unable to generate suitable Contact header" + " for re-registration", status); + pj_pool_release(pool); + schedule_reregistration(acc); + goto on_return; + } + + if (pj_strcmp(&tmp_contact, &acc->contact)) { + if (acc->contact.slen < tmp_contact.slen) { + pj_strdup_with_null(acc->pool, &acc->contact, &tmp_contact); + } else { + pj_strcpy(&acc->contact, &tmp_contact); + } + update_regc_contact(acc); + if (acc->regc) + pjsip_regc_update_contact(acc->regc, 1, &acc->reg_contact); + } + pj_pool_release(pool); + } + status = pjsua_acc_set_registration(acc->index, PJ_TRUE); if (status != PJ_SUCCESS) schedule_reregistration(acc); @@ -3909,6 +4065,10 @@ if (acc->via_tp == (void*)tp) { pj_bzero(&acc->via_addr, sizeof(acc->via_addr)); acc->via_tp = NULL; + + /* Also reset regc's Via addr */ + if (acc->regc) + pjsip_regc_set_via_sent_by(acc->regc, NULL, NULL); } /* Release transport immediately if regc is using it diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip/src/pjsua-lib/pjsua_aud.c asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip/src/pjsua-lib/pjsua_aud.c --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip/src/pjsua-lib/pjsua_aud.c 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip/src/pjsua-lib/pjsua_aud.c 2022-02-24 07:54:38.000000000 +0000 @@ -467,32 +467,33 @@ close_snd_dev(); - if (pjsua_var.mconf) { - pjmedia_conf_destroy(pjsua_var.mconf); - pjsua_var.mconf = NULL; - } - - if (pjsua_var.null_port) { - pjmedia_port_destroy(pjsua_var.null_port); - pjsua_var.null_port = NULL; - } - /* Destroy file players */ for (i=0; iprev_aud_si); + /* Unsubscribe from stream events */ pjmedia_event_unsubscribe(NULL, &call_media_on_event, call_med, strm); @@ -514,9 +517,14 @@ call_med->strm.a.conf_slot = PJSUA_INVALID_ID; } - if ((call_med->dir & PJMEDIA_DIR_ENCODING) && - (pjmedia_stream_get_stat(strm, &stat) == PJ_SUCCESS) && - stat.tx.pkt) + /* Don't check for direction and transmitted packets count as we + * assume that RTP timestamp remains increasing when outgoing + * direction is disabled/paused. + */ + //if ((call_med->dir & PJMEDIA_DIR_ENCODING) && + // (pjmedia_stream_get_stat(strm, &stat) == PJ_SUCCESS) && + // stat.tx.pkt) + if (pjmedia_stream_get_stat(strm, &stat) == PJ_SUCCESS) { /* Save RTP timestamp & sequence, so when media session is * restarted, those values will be restored as the initial @@ -529,7 +537,9 @@ call_med->rtp_tx_ts = stat.rtp_tx_last_ts; } - if (pjsua_var.ua_cfg.cb.on_stream_destroyed) { + if (!call_med->call->hanging_up && + pjsua_var.ua_cfg.cb.on_stream_destroyed) + { pjsua_var.ua_cfg.cb.on_stream_destroyed(call_med->call->index, strm, call_med->idx); } @@ -553,32 +563,63 @@ static void dtmf_callback(pjmedia_stream *strm, void *user_data, int digit) { + pjsua_call_id call_id; + PJ_UNUSED_ARG(strm); + call_id = (pjsua_call_id)(pj_ssize_t)user_data; + if (pjsua_var.calls[call_id].hanging_up) + return; + pj_log_push_indent(); if (pjsua_var.ua_cfg.cb.on_dtmf_digit2) { - pjsua_call_id call_id; pjsua_dtmf_info info; - call_id = (pjsua_call_id)(pj_ssize_t)user_data; info.method = PJSUA_DTMF_METHOD_RFC2833; info.digit = digit; + info.duration = PJSUA_UNKNOWN_DTMF_DURATION; (*pjsua_var.ua_cfg.cb.on_dtmf_digit2)(call_id, &info); } else if (pjsua_var.ua_cfg.cb.on_dtmf_digit) { /* For discussions about call mutex protection related to this * callback, please see ticket #460: * http://trac.pjsip.org/repos/ticket/460#comment:4 */ - pjsua_call_id call_id; - - call_id = (pjsua_call_id)(pj_ssize_t)user_data; (*pjsua_var.ua_cfg.cb.on_dtmf_digit)(call_id, digit); } pj_log_pop_indent(); } +/* + * DTMF callback from the stream. + */ +static void dtmf_event_callback(pjmedia_stream *strm, void *user_data, + const pjmedia_stream_dtmf_event *event) +{ + pjsua_call_id call_id; + pjsua_dtmf_event evt; + + PJ_UNUSED_ARG(strm); + + call_id = (pjsua_call_id)(pj_ssize_t)user_data; + if (pjsua_var.calls[call_id].hanging_up) + return; + + pj_log_push_indent(); + + if (pjsua_var.ua_cfg.cb.on_dtmf_event) { + evt.method = PJSUA_DTMF_METHOD_RFC2833; + evt.timestamp = event->timestamp; + evt.digit = event->digit; + evt.duration = event->duration; + evt.flags = event->flags; + (*pjsua_var.ua_cfg.cb.on_dtmf_event)(call_id, &evt); + } + + pj_log_pop_indent(); +} + /* Internal function: update audio channel after SDP negotiation. * Warning: do not use temporary/flip-flop pool, e.g: inv->pool_prov, * for creating stream, etc, as after SDP negotiation and when @@ -614,6 +655,7 @@ si->jb_min_pre = pjsua_var.media_cfg.jb_min_pre; si->jb_max_pre = pjsua_var.media_cfg.jb_max_pre; si->jb_max = pjsua_var.media_cfg.jb_max; + si->jb_discard_algo = pjsua_var.media_cfg.jb_discard_algo; /* Set SSRC and CNAME */ si->ssrc = call_med->ssrc; @@ -631,7 +673,28 @@ #if defined(PJMEDIA_STREAM_ENABLE_KA) && PJMEDIA_STREAM_ENABLE_KA!=0 /* Enable/disable stream keep-alive and NAT hole punch. */ si->use_ka = pjsua_var.acc[call->acc_id].cfg.use_stream_ka; + + si->ka_cfg = pjsua_var.acc[call->acc_id].cfg.stream_ka_cfg; +#endif + + if (!call->hanging_up && pjsua_var.ua_cfg.cb.on_stream_precreate) { + pjsua_on_stream_precreate_param prm; + prm.stream_idx = strm_idx; + prm.stream_info.type = PJMEDIA_TYPE_AUDIO; + prm.stream_info.info.aud = *si; + (*pjsua_var.ua_cfg.cb.on_stream_precreate)(call->index, &prm); + + /* Copy back only the fields which are allowed to be changed. */ + si->jb_init = prm.stream_info.info.aud.jb_init; + si->jb_min_pre = prm.stream_info.info.aud.jb_min_pre; + si->jb_max_pre = prm.stream_info.info.aud.jb_max_pre; + si->jb_max = prm.stream_info.info.aud.jb_max; + si->jb_discard_algo = prm.stream_info.info.aud.jb_discard_algo; +#if defined(PJMEDIA_STREAM_ENABLE_KA) && (PJMEDIA_STREAM_ENABLE_KA != 0) + si->use_ka = prm.stream_info.info.aud.use_ka; #endif + si->rtcp_sdes_bye_disabled = prm.stream_info.info.aud.rtcp_sdes_bye_disabled; + } /* Create session based on session info. */ status = pjmedia_stream_create(pjsua_var.med_endpt, NULL, si, @@ -653,8 +716,13 @@ /* If DTMF callback is installed by application, install our * callback to the session. */ - if (pjsua_var.ua_cfg.cb.on_dtmf_digit || - pjsua_var.ua_cfg.cb.on_dtmf_digit2) + if (!call->hanging_up && pjsua_var.ua_cfg.cb.on_dtmf_event) { + pjmedia_stream_set_dtmf_event_callback(call_med->strm.a.stream, + &dtmf_event_callback, + (void*)(pj_ssize_t)(call->index)); + } else if (!call->hanging_up && + (pjsua_var.ua_cfg.cb.on_dtmf_digit || + pjsua_var.ua_cfg.cb.on_dtmf_digit2)) { pjmedia_stream_set_dtmf_callback(call_med->strm.a.stream, &dtmf_callback, @@ -671,7 +739,7 @@ * Note: application may modify media_port to point to different * media port */ - if (pjsua_var.ua_cfg.cb.on_stream_created2) { + if (!call->hanging_up && pjsua_var.ua_cfg.cb.on_stream_created2) { pjsua_on_stream_created_param prm; prm.stream = call_med->strm.a.stream; @@ -683,7 +751,8 @@ call_med->strm.a.destroy_port = prm.destroy_port; call_med->strm.a.media_port = prm.port; - } else if (pjsua_var.ua_cfg.cb.on_stream_created) { + } else if (!call->hanging_up && pjsua_var.ua_cfg.cb.on_stream_created) + { (*pjsua_var.ua_cfg.cb.on_stream_created)(call->index, call_med->strm.a.stream, strm_idx, @@ -1099,6 +1168,9 @@ if (pjsua_var.player_cnt >= PJ_ARRAY_SIZE(pjsua_var.player)) return PJ_ETOOMANY; + if (filename->slen >= PJ_MAXPATH) + return PJ_ENAMETOOLONG; + PJ_LOG(4,(THIS_FILE, "Creating file player: %.*s..", (int)filename->slen, filename->ptr)); pj_log_push_indent(); @@ -1416,6 +1488,11 @@ /* Don't support encoding type at present */ PJ_ASSERT_RETURN(enc_type == 0, PJ_EINVAL); + if (filename->slen >= PJ_MAXPATH) + return PJ_ENAMETOOLONG; + if (filename->slen < 4) + return PJ_EINVALIDOP; + PJ_LOG(4,(THIS_FILE, "Creating recorder %.*s..", (int)filename->slen, filename->ptr)); pj_log_push_indent(); @@ -1642,13 +1719,15 @@ unsigned bits_per_sample) { pj_status_t status; + pj_bool_t speaker_only = (pjsua_var.snd_mode & PJSUA_SND_DEV_SPEAKER_ONLY); /* Normalize device ID with new convention about default device ID */ if (playback_dev == PJMEDIA_AUD_DEFAULT_CAPTURE_DEV) playback_dev = PJMEDIA_AUD_DEFAULT_PLAYBACK_DEV; /* Create default parameters for the device */ - status = pjmedia_aud_dev_default_param(capture_dev, param); + status = pjmedia_aud_dev_default_param((speaker_only? playback_dev: + capture_dev), param); if (status != PJ_SUCCESS) { pjsua_perror(THIS_FILE, "Error retrieving default audio " "device parameters", status); @@ -1809,14 +1888,20 @@ pj_log_push_indent(); if (speaker_only) { - status = pjmedia_snd_port_create_player(pjsua_var.snd_pool, - -1, - param->base.clock_rate, - param->base.channel_count, - param->base.samples_per_frame, - param->base.bits_per_sample, - 0, - &pjsua_var.snd_port); + pjmedia_snd_port_param cp_param; + int dev_id = param->base.play_id; + + /* Normalize dev_id */ + if (dev_id < 0) + dev_id = PJMEDIA_AUD_DEFAULT_PLAYBACK_DEV; + + pjmedia_snd_port_param_default(&cp_param); + pj_memcpy(&cp_param.base, ¶m->base, sizeof(cp_param.base)); + cp_param.base.dir = PJMEDIA_DIR_PLAYBACK; + cp_param.base.play_id = dev_id; + + status = pjmedia_snd_port_create2(pjsua_var.snd_pool, &cp_param, + &pjsua_var.snd_port); } else { status = pjmedia_snd_port_create2(pjsua_var.snd_pool, @@ -1902,7 +1987,7 @@ } /* Update sound device name. */ - { + if (!speaker_only) { pjmedia_aud_dev_info rec_info; pjmedia_aud_stream *strm; pjmedia_aud_param si; @@ -1979,8 +2064,11 @@ strm = pjmedia_snd_port_get_snd_stream(pjsua_var.snd_port); pjmedia_aud_stream_get_param(strm, ¶m); - if (pjmedia_aud_dev_get_info(param.rec_id, &cap_info) != PJ_SUCCESS) + if (param.rec_id == PJSUA_SND_NO_DEV || + pjmedia_aud_dev_get_info(param.rec_id, &cap_info) != PJ_SUCCESS) + { cap_info.name[0] = '\0'; + } if (pjmedia_aud_dev_get_info(param.play_id, &play_info) != PJ_SUCCESS) play_info.name[0] = '\0'; @@ -2017,54 +2105,89 @@ int playback_dev) { pjsua_snd_dev_param param; - - pjsua_snd_dev_param_default(¶m); - + pjsua_get_snd_dev2(¶m); param.capture_dev = capture_dev; param.playback_dev = playback_dev; + /* Always open the sound device. */ - param.mode = 0; + param.mode &= ~PJSUA_SND_DEV_NO_IMMEDIATE_OPEN; return pjsua_set_snd_dev2(¶m); } + +PJ_DEF(pj_status_t) pjsua_get_snd_dev2(pjsua_snd_dev_param *snd_param) +{ + PJ_ASSERT_RETURN(snd_param, PJ_EINVAL); + + PJSUA_LOCK(); + snd_param->capture_dev = pjsua_var.cap_dev; + snd_param->playback_dev = pjsua_var.play_dev; + snd_param->mode = pjsua_var.snd_mode; + PJSUA_UNLOCK(); + + return PJ_SUCCESS; +} + + /* * Select or change sound device. Application may call this function at * any time to replace current sound device. */ -PJ_DEF(pj_status_t) pjsua_set_snd_dev2(pjsua_snd_dev_param *snd_param) +PJ_DEF(pj_status_t) pjsua_set_snd_dev2(const pjsua_snd_dev_param *snd_param) { unsigned alt_cr_cnt = 1; unsigned alt_cr[] = {0, 44100, 48000, 32000, 16000, 8000}; unsigned i; pj_status_t status = -1; unsigned orig_snd_dev_mode = pjsua_var.snd_mode; - pj_bool_t no_change = (pjsua_var.snd_is_on || (!pjsua_var.snd_is_on && - (snd_param->mode & - PJSUA_SND_DEV_NO_IMMEDIATE_OPEN))); - PJ_LOG(4,(THIS_FILE, "Set sound device: capture=%d, playback=%d", - snd_param->capture_dev, snd_param->playback_dev)); + PJ_ASSERT_RETURN(snd_param, PJ_EINVAL); + + PJ_LOG(4,(THIS_FILE, "Set sound device: capture=%d, playback=%d, mode=%d", + snd_param->capture_dev, snd_param->playback_dev, + snd_param->mode)); + pj_log_push_indent(); PJSUA_LOCK(); + /* Check if there are no changes in sound device settings */ if (pjsua_var.cap_dev == snd_param->capture_dev && pjsua_var.play_dev == snd_param->playback_dev && - pjsua_var.snd_mode == snd_param->mode && - !pjsua_var.no_snd && no_change) + pjsua_var.snd_mode == snd_param->mode) { - PJ_LOG(4, (THIS_FILE, "No changes in capture and playback devices")); - PJSUA_UNLOCK(); - pj_log_pop_indent(); - return PJ_SUCCESS; + /* If sound device is already opened, just print log and return. + * Also if PJSUA_SND_DEV_NO_IMMEDIATE_OPEN is set. + */ + if (pjsua_var.snd_is_on || (snd_param->mode & + PJSUA_SND_DEV_NO_IMMEDIATE_OPEN)) + { + PJ_LOG(4,(THIS_FILE,"No changes in capture and playback devices")); + PJSUA_UNLOCK(); + pj_log_pop_indent(); + return PJ_SUCCESS; + } } + /* No sound */ + if (snd_param->capture_dev == PJSUA_SND_NO_DEV && + snd_param->playback_dev == PJSUA_SND_NO_DEV) + { + PJSUA_UNLOCK(); + PJ_LOG(4, (THIS_FILE, "No sound device, mode setting is ignored")); + if (!pjsua_var.no_snd) + pjsua_set_no_snd_dev(); + pj_log_pop_indent(); + return status; + } + /* Null-sound */ if (snd_param->capture_dev == PJSUA_SND_NULL_DEV && snd_param->playback_dev == PJSUA_SND_NULL_DEV) { PJSUA_UNLOCK(); + PJ_LOG(4, (THIS_FILE, "Null sound device, mode setting is ignored")); status = pjsua_set_null_snd_dev(); pj_log_pop_indent(); return status; @@ -2072,11 +2195,15 @@ pjsua_var.snd_mode = snd_param->mode; - if (!pjsua_var.no_snd && !pjsua_var.snd_is_on && + /* Just update the IDs if app does not want to open now and currently + * audio is off. + */ + if (!pjsua_var.snd_is_on && (snd_param->mode & PJSUA_SND_DEV_NO_IMMEDIATE_OPEN)) { pjsua_var.cap_dev = snd_param->capture_dev; pjsua_var.play_dev = snd_param->playback_dev; + pjsua_var.no_snd = PJ_FALSE; PJSUA_UNLOCK(); pj_log_pop_indent(); diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip/src/pjsua-lib/pjsua_call.c asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip/src/pjsua-lib/pjsua_call.c --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip/src/pjsua-lib/pjsua_call.c 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip/src/pjsua-lib/pjsua_call.c 2022-02-24 07:54:38.000000000 +0000 @@ -39,6 +39,12 @@ */ #define RESTART_ICE_ON_REINVITE 1 +/* Retry interval of trying to hangup a call. */ +#define CALL_HANGUP_RETRY_INTERVAL 5000 + +/* Max number of hangup retries. */ +#define CALL_HANGUP_MAX_RETRY 4 + /* * The INFO method. */ @@ -126,9 +132,18 @@ /* Timer callback to send re-INVITE/UPDATE to lock codec or ICE update */ static void reinv_timer_cb(pj_timer_heap_t *th, pj_timer_entry *entry); +/* Timer callback to hangup the call */ +static void hangup_timer_cb(pj_timer_heap_t *th, pj_timer_entry *entry); + /* Check and send reinvite for lock codec and ICE update */ static pj_status_t process_pending_reinvite(pjsua_call *call); +/* Timer callbacks for trickle ICE */ +static void trickle_ice_send_sip_info(pj_timer_heap_t *th, + struct pj_timer_entry *te); +static void trickle_ice_retrans_18x(pj_timer_heap_t *th, + struct pj_timer_entry *te); + /* * Reset call descriptor. */ @@ -161,6 +176,9 @@ pjsua_call_setting_default(&call->opt); pj_timer_entry_init(&call->reinv_timer, PJ_FALSE, (void*)(pj_size_t)id, &reinv_timer_cb); + pj_bzero(&call->trickle_ice, sizeof(call->trickle_ice)); + pj_timer_entry_init(&call->trickle_ice.timer, 0, call, + &trickle_ice_send_sip_info); } /* Get DTMF method type name */ @@ -183,6 +201,7 @@ pjsip_inv_callback inv_cb; unsigned i; const pj_str_t str_norefersub = { "norefersub", 10 }; + const pj_str_t str_trickle_ice = { "trickle-ice", 11 }; pj_status_t status; /* Init calls array. */ @@ -230,6 +249,10 @@ pjsip_endpt_add_capability(pjsua_var.endpt, NULL, PJSIP_H_ALLOW, NULL, 1, &pjsip_info_method.name); + /* Add "trickle-ice" in Supported header */ + pjsip_endpt_add_capability(pjsua_var.endpt, NULL, PJSIP_H_SUPPORTED, + NULL, 1, &str_trickle_ice); + return status; } @@ -471,6 +494,11 @@ else if (acc->cfg.use_timer == PJSUA_SIP_TIMER_ALWAYS) options |= PJSIP_INV_ALWAYS_USE_TIMER; } + if (acc->cfg.ice_cfg.enable_ice && + acc->cfg.ice_cfg.ice_opt.trickle != PJ_ICE_SESS_TRICKLE_DISABLED) + { + options |= PJSIP_INV_SUPPORT_TRICKLE_ICE; + } status = pjsip_inv_create_uac( dlg, offer, options, &inv); if (status != PJ_SUCCESS) { @@ -542,7 +570,7 @@ /* Upon failure to send first request, the invite * session would have been cleared. */ - inv = NULL; + call->inv = inv = NULL; goto on_error; } @@ -556,6 +584,7 @@ on_error: if (inv == NULL && call_id != -1 && !cb_called && + !call->hanging_up && pjsua_var.ua_cfg.cb.on_call_state) { /* Use user event rather than NULL to avoid crash in @@ -570,10 +599,12 @@ if (dlg) { /* This may destroy the dialog */ pjsip_dlg_dec_lock(dlg); + call->async_call.dlg = NULL; } if (inv != NULL) { pjsip_inv_terminate(inv, PJSIP_SC_OK, PJ_FALSE); + call->inv = NULL; } if (call_id != -1) { @@ -599,7 +630,7 @@ { opt->flag &= ~(PJSUA_CALL_UNHOLD | PJSUA_CALL_UPDATE_CONTACT | PJSUA_CALL_NO_SDP_OFFER | PJSUA_CALL_REINIT_MEDIA | - PJSUA_CALL_UPDATE_VIA); + PJSUA_CALL_UPDATE_VIA | PJSUA_CALL_SET_MEDIA_DIR); } @@ -608,6 +639,8 @@ */ PJ_DEF(void) pjsua_call_setting_default(pjsua_call_setting *opt) { + unsigned i; + pj_assert(opt); pj_bzero(opt, sizeof(*opt)); @@ -619,6 +652,10 @@ opt->req_keyframe_method = PJSUA_VID_REQ_KEYFRAME_SIP_INFO | PJSUA_VID_REQ_KEYFRAME_RTCP_PLI; #endif + + for (i = 0; i < PJMEDIA_MAX_SDP_MEDIA; i++) { + opt->media_dir[i] = PJMEDIA_DIR_ENCODING_DECODING; + } } /* @@ -639,16 +676,16 @@ if (!opt) { pjsua_call_cleanup_flag(&call->opt); - return PJ_SUCCESS; + } else { + call->opt = *opt; } #if !PJMEDIA_HAS_VIDEO - pj_assert(opt->vid_cnt == 0); + pj_assert(call->opt.vid_cnt == 0); #endif - call->opt = *opt; - if (call->opt.flag & PJSUA_CALL_REINIT_MEDIA) { + PJ_LOG(4, (THIS_FILE, "PJSUA_CALL_REINIT_MEDIA")); pjsua_media_channel_deinit(call->index); } @@ -790,13 +827,13 @@ pj_pool_t *tmp_pool = NULL; pjsip_dialog *dlg = NULL; pjsua_acc *acc; - pjsua_call *call; + pjsua_call *call = NULL; int call_id = -1; pj_str_t contact; pj_status_t status; /* Check that account is valid */ - PJ_ASSERT_RETURN(acc_id>=0 || acc_id<(int)PJ_ARRAY_SIZE(pjsua_var.acc), + PJ_ASSERT_RETURN(acc_id>=0 && acc_id<(int)PJ_ARRAY_SIZE(pjsua_var.acc), PJ_EINVAL); /* Check arguments */ @@ -974,9 +1011,10 @@ on_error: - if (dlg) { + if (dlg && call) { /* This may destroy the dialog */ pjsip_dlg_dec_lock(dlg); + call->async_call.dlg = NULL; } if (call_id != -1) { @@ -1028,7 +1066,7 @@ replaced_call = (pjsua_call*) replaced_dlg->mod_data[pjsua_var.mod.id]; /* Notify application */ - if (pjsua_var.ua_cfg.cb.on_call_replaced) + if (!replaced_call->hanging_up && pjsua_var.ua_cfg.cb.on_call_replaced) pjsua_var.ua_cfg.cb.on_call_replaced(replaced_call->index, call->index); @@ -1195,6 +1233,12 @@ } } + /* Disable media if it has zero format/codec */ + if (m->desc.fmt_count == 0) { + m->desc.fmt[m->desc.fmt_count++] = pj_str("0"); + pjmedia_sdp_media_deactivate(pool, m); + } + sdp->media[sdp->media_count++] = m; } @@ -1458,9 +1502,9 @@ pjsip_response_addr res_addr; pjsip_get_response_addr(response->pool, rdata, &res_addr); - pjsip_endpt_send_response(pjsua_var.endpt, &res_addr, response, + status = pjsip_endpt_send_response(pjsua_var.endpt, &res_addr, response, NULL, NULL); - + if (status != PJ_SUCCESS) pjsip_tx_data_dec_ref(response); } else { /* Respond with 500 (Internal Server Error) */ @@ -1491,13 +1535,17 @@ pjsua_call_cleanup_flag(&call->opt); /* Notify application */ - if (pjsua_var.ua_cfg.cb.on_call_replace_request) { + if (!replaced_call->hanging_up && + pjsua_var.ua_cfg.cb.on_call_replace_request) + { pjsua_var.ua_cfg.cb.on_call_replace_request(replaced_call->index, rdata, &st_code, &st_text); } - if (pjsua_var.ua_cfg.cb.on_call_replace_request2) { + if (!replaced_call->hanging_up && + pjsua_var.ua_cfg.cb.on_call_replace_request2) + { pjsua_var.ua_cfg.cb.on_call_replace_request2(replaced_call->index, rdata, &st_code, &st_text, @@ -1628,8 +1676,14 @@ options |= PJSIP_INV_SUPPORT_TIMER; if (pjsua_var.acc[acc_id].cfg.require_100rel == PJSUA_100REL_MANDATORY) options |= PJSIP_INV_REQUIRE_100REL; - if (pjsua_var.acc[acc_id].cfg.ice_cfg.enable_ice) + if (pjsua_var.acc[acc_id].cfg.ice_cfg.enable_ice) { options |= PJSIP_INV_SUPPORT_ICE; + if (pjsua_var.acc[acc_id].cfg.ice_cfg.ice_opt.trickle != + PJ_ICE_SESS_TRICKLE_DISABLED) + { + options |= PJSIP_INV_SUPPORT_TRICKLE_ICE; + } + } if (pjsua_var.acc[acc_id].cfg.use_timer == PJSUA_SIP_TIMER_REQUIRED) options |= PJSIP_INV_REQUIRE_TIMER; else if (pjsua_var.acc[acc_id].cfg.use_timer == PJSUA_SIP_TIMER_ALWAYS) @@ -1646,8 +1700,9 @@ pjsip_response_addr res_addr; pjsip_get_response_addr(response->pool, rdata, &res_addr); - pjsip_endpt_send_response(pjsua_var.endpt, &res_addr, response, - NULL, NULL); + status = pjsip_endpt_send_response(pjsua_var.endpt, &res_addr, response, + NULL, NULL); + if (status != PJ_SUCCESS) pjsip_tx_data_dec_ref(response); } else { /* Respond with 500 (Internal Server Error) */ @@ -1945,6 +2000,7 @@ goto on_return; } else { +#if !PJSUA_DISABLE_AUTO_SEND_100 status = pjsip_inv_send_msg(inv, response); if (status != PJ_SUCCESS) { pjsua_perror(THIS_FILE, "Unable to send 100 response", status); @@ -1953,6 +2009,7 @@ call->async_call.dlg = NULL; goto on_return; } +#endif } /* Only do this after sending 100/Trying (really! see the long comment @@ -2039,7 +2096,8 @@ { PJ_ASSERT_RETURN(call_id>=0 && call_id<(int)pjsua_var.ua_cfg.max_calls, PJ_EINVAL); - return pjsua_var.calls[call_id].inv != NULL && + return !pjsua_var.calls[call_id].hanging_up && + pjsua_var.calls[call_id].inv != NULL && pjsua_var.calls[call_id].inv->state != PJSIP_INV_STATE_DISCONNECTED; } @@ -2199,7 +2257,9 @@ pj_memcpy(&info->setting, &call->opt, sizeof(call->opt)); /* state, state_text */ - if (call->inv) { + if (call->hanging_up) { + info->state = PJSIP_INV_STATE_DISCONNECTED; + } else if (call->inv) { info->state = call->inv->state; if (call->inv->role == PJSIP_ROLE_UAS && info->state == PJSIP_INV_STATE_NULL) @@ -2553,6 +2613,15 @@ if (status != PJ_SUCCESS) goto on_return; + if (!call->inv->invite_tsx || + call->inv->invite_tsx->state >= PJSIP_TSX_STATE_COMPLETED) + { + PJ_LOG(3,(THIS_FILE, "Unable to answer call (no incoming INVITE or " + "already answered)")); + status = PJ_EINVALIDOP; + goto on_return; + } + /* Apply call setting, only if status code is 1xx or 2xx. */ if (opt && code < 300) { /* Check if it has not been set previously or it is different to @@ -2714,63 +2783,13 @@ } -/* - * Hangup call by using method that is appropriate according to the - * call state. - */ -PJ_DEF(pj_status_t) pjsua_call_hangup(pjsua_call_id call_id, - unsigned code, - const pj_str_t *reason, - const pjsua_msg_data *msg_data) +static pj_status_t call_inv_end_session(pjsua_call *call, + unsigned code, + const pj_str_t *reason, + const pjsua_msg_data *msg_data) { - pjsua_call *call; - pjsip_dialog *dlg = NULL; - pj_status_t status; pjsip_tx_data *tdata; - - - if (call_id<0 || call_id>=(int)pjsua_var.ua_cfg.max_calls) { - PJ_LOG(1,(THIS_FILE, "pjsua_call_hangup(): invalid call id %d", - call_id)); - } - - PJ_ASSERT_RETURN(call_id>=0 && call_id<(int)pjsua_var.ua_cfg.max_calls, - PJ_EINVAL); - - PJ_LOG(4,(THIS_FILE, "Call %d hanging up: code=%d..", call_id, code)); - pj_log_push_indent(); - - status = acquire_call("pjsua_call_hangup()", call_id, &call, &dlg); - if (status != PJ_SUCCESS) - goto on_return; - - call->hanging_up = PJ_TRUE; - - /* If media transport creation is not yet completed, we will hangup - * the call in the media transport creation callback instead. - */ - if ((call->med_ch_cb && !call->inv) || - ((call->inv != NULL) && (call->inv->state == PJSIP_INV_STATE_NULL))) - { - PJ_LOG(4,(THIS_FILE, "Pending call %d hangup upon completion " - "of media transport", call_id)); - - if (call->inv && call->inv->role == PJSIP_ROLE_UAS) - call->async_call.call_var.inc_call.hangup = PJ_TRUE; - else - call->async_call.call_var.out_call.hangup = PJ_TRUE; - - if (code == 0) - call->last_code = PJSIP_SC_REQUEST_TERMINATED; - else - call->last_code = (pjsip_status_code)code; - if (reason) { - pj_strncpy(&call->last_text, reason, - sizeof(call->last_text_buf_)); - } - - goto on_return; - } + pj_status_t status; if (code==0) { if (call->inv->state == PJSIP_INV_STATE_CONFIRMED) @@ -2781,12 +2800,17 @@ code = PJSIP_SC_REQUEST_TERMINATED; } + /* Stop hangup timer, if it is active. */ + if (call->hangup_timer.id) { + pjsua_cancel_timer(&call->hangup_timer); + call->hangup_timer.id = PJ_FALSE; + } + status = pjsip_inv_end_session(call->inv, code, reason, &tdata); if (status != PJ_SUCCESS) { pjsua_perror(THIS_FILE, "Failed to create end session message", status); - call->hanging_up = PJ_FALSE; goto on_return; } @@ -2794,8 +2818,9 @@ * as p_tdata when INVITE transaction has not been answered * with any provisional responses. */ - if (tdata == NULL) + if (tdata == NULL) { goto on_return; + } /* Add additional headers etc */ pjsua_process_msg_data( tdata, msg_data); @@ -2806,14 +2831,182 @@ pjsua_perror(THIS_FILE, "Failed to send end session message", status); - call->hanging_up = PJ_FALSE; goto on_return; } + +on_return: + /* Failure in pjsip_inv_send_msg() can cause + * pjsua_call_on_state_changed() to be called and call to be reset, + * so we need to check for call->inv as well. + */ + if (status != PJ_SUCCESS && call->inv) { + pj_time_val delay; + + /* Schedule a retry */ + if (call->hangup_retry >= CALL_HANGUP_MAX_RETRY) { + /* Forcefully terminate the invite session. */ + PJ_LOG(1,(THIS_FILE,"Call %d: failed to hangup after %d retries, " + "terminating the session forcefully now!", + call->index, call->hangup_retry)); + pjsip_inv_terminate(call->inv, call->hangup_code, PJ_TRUE); + return PJ_SUCCESS; + } + + if (call->hangup_retry == 0) { + pj_timer_entry_init(&call->hangup_timer, PJ_FALSE, + (void*)call, &hangup_timer_cb); + + call->hangup_code = code; + if (reason) { + pj_strdup(call->inv->pool_prov, &call->hangup_reason, + reason); + } + if (msg_data) { + call->hangup_msg_data = pjsua_msg_data_clone( + call->inv->pool_prov, + msg_data); + } + } - /* Stop reinvite timer, if it is active */ - if (call->reinv_timer.id) { - pjsua_cancel_timer(&call->reinv_timer); - call->reinv_timer.id = PJ_FALSE; + delay.sec = 0; + delay.msec = CALL_HANGUP_RETRY_INTERVAL; + pj_time_val_normalize(&delay); + call->hangup_timer.id = PJ_TRUE; + pjsua_schedule_timer(&call->hangup_timer, &delay); + call->hangup_retry++; + + PJ_LOG(4, (THIS_FILE, "Will retry call %d hangup in %d msec", + call->index, CALL_HANGUP_RETRY_INTERVAL)); + } + + return PJ_SUCCESS; +} + +/* Timer callback to hangup call */ +static void hangup_timer_cb(pj_timer_heap_t *th, pj_timer_entry *entry) +{ + pjsua_call* call = (pjsua_call *)entry->user_data; + pjsip_dialog *dlg; + pj_status_t status; + + PJ_UNUSED_ARG(th); + + pj_log_push_indent(); + + status = acquire_call("hangup_timer_cb()", call->index, &call, &dlg); + if (status != PJ_SUCCESS) { + pj_log_pop_indent(); + return; + } + + call->hangup_timer.id = PJ_FALSE; + call_inv_end_session(call, call->hangup_code, &call->hangup_reason, + call->hangup_msg_data); + + pjsip_dlg_dec_lock(dlg); + + pj_log_pop_indent(); +} + +/* + * Hangup call by using method that is appropriate according to the + * call state. + */ +PJ_DEF(pj_status_t) pjsua_call_hangup(pjsua_call_id call_id, + unsigned code, + const pj_str_t *reason, + const pjsua_msg_data *msg_data) +{ + pjsua_call *call; + pjsip_dialog *dlg = NULL; + pj_status_t status; + + if (call_id<0 || call_id>=(int)pjsua_var.ua_cfg.max_calls) { + PJ_LOG(1,(THIS_FILE, "pjsua_call_hangup(): invalid call id %d", + call_id)); + } + + PJ_ASSERT_RETURN(call_id>=0 && call_id<(int)pjsua_var.ua_cfg.max_calls, + PJ_EINVAL); + + PJ_LOG(4,(THIS_FILE, "Call %d hanging up: code=%d..", call_id, code)); + pj_log_push_indent(); + + status = acquire_call("pjsua_call_hangup()", call_id, &call, &dlg); + if (status != PJ_SUCCESS) + goto on_return; + + if (!call->hanging_up) { + pjsip_event user_event; + + pj_gettimeofday(&call->dis_time); + if (call->res_time.sec == 0) + pj_gettimeofday(&call->res_time); + + if (code==0) { + if (call->inv && call->inv->state == PJSIP_INV_STATE_CONFIRMED) + code = PJSIP_SC_OK; + else if (call->inv && call->inv->role == PJSIP_ROLE_UAS) + code = PJSIP_SC_DECLINE; + else + code = PJSIP_SC_REQUEST_TERMINATED; + } + + call->last_code = code; + pj_strncpy(&call->last_text, + pjsip_get_status_text(call->last_code), + sizeof(call->last_text_buf_)); + + /* Stop reinvite timer, if it is active. */ + if (call->reinv_timer.id) { + pjsua_cancel_timer(&call->reinv_timer); + call->reinv_timer.id = PJ_FALSE; + } + + /* If media transport creation is not yet completed, we will continue + * from the media transport creation callback instead. + */ + if ((call->med_ch_cb && !call->inv) || + ((call->inv != NULL) && + (call->inv->state == PJSIP_INV_STATE_NULL))) + { + PJ_LOG(4,(THIS_FILE, "Will continue call %d hangup upon " + "completion of media transport", call_id)); + + if (call->inv && call->inv->role == PJSIP_ROLE_UAS) + call->async_call.call_var.inc_call.hangup = PJ_TRUE; + else + call->async_call.call_var.out_call.hangup = PJ_TRUE; + + if (reason) { + pj_strncpy(&call->last_text, reason, + sizeof(call->last_text_buf_)); + } + + call->hanging_up = PJ_TRUE; + } else { + /* Destroy media session. */ + pjsua_media_channel_deinit(call_id); + call->hanging_up = PJ_TRUE; + pjsua_check_snd_dev_idle(); + } + + /* Call callback which will report DISCONNECTED state. + * Use user event rather than NULL to avoid crash in + * unsuspecting app. + */ + PJSIP_EVENT_INIT_USER(user_event, 0, 0, 0, 0); + if (pjsua_var.ua_cfg.cb.on_call_state) { + (*pjsua_var.ua_cfg.cb.on_call_state)(call->index, + &user_event); + } + + if (call->inv) + call_inv_end_session(call, code, reason, msg_data); + } else { + /* Already requested and on progress */ + PJ_LOG(4,(THIS_FILE, "Call %d hangup request ignored as " + "it is on progress", call_id)); } on_return: @@ -3467,24 +3660,32 @@ pjsip_media_type ctype; pjsua_im_data *im_data; pjsip_tx_data *tdata; + pj_bool_t content_in_msg_data; pj_status_t status; + content_in_msg_data = msg_data && (msg_data->msg_body.slen || + msg_data->multipart_ctype.type.slen); + PJ_ASSERT_RETURN(call_id>=0 && call_id<(int)pjsua_var.ua_cfg.max_calls, PJ_EINVAL); + + /* Message body must be specified. */ + PJ_ASSERT_RETURN(content || content_in_msg_data, PJ_EINVAL); + + if (content) { + PJ_LOG(4,(THIS_FILE, "Call %d sending %d bytes MESSAGE..", + call_id, (int)content->slen)); + } else { + PJ_LOG(4,(THIS_FILE, "Call %d sending MESSAGE..", + call_id)); + } - PJ_LOG(4,(THIS_FILE, "Call %d sending %d bytes MESSAGE..", - call_id, (int)content->slen)); pj_log_push_indent(); status = acquire_call("pjsua_call_send_im()", call_id, &call, &dlg); if (status != PJ_SUCCESS) goto on_return; - /* Set default media type if none is specified */ - if (mime_type == NULL) { - mime_type = &mime_text_plain; - } - /* Create request message. */ status = pjsip_dlg_create_request( call->inv->dlg, &pjsip_message_method, -1, &tdata); @@ -3497,16 +3698,24 @@ pjsip_msg_add_hdr( tdata->msg, (pjsip_hdr*)pjsua_im_create_accept(tdata->pool)); - /* Parse MIME type */ - pjsua_parse_media_type(tdata->pool, mime_type, &ctype); - - /* Create "text/plain" message body. */ - tdata->msg->body = pjsip_msg_body_create( tdata->pool, &ctype.type, - &ctype.subtype, content); - if (tdata->msg->body == NULL) { - pjsua_perror(THIS_FILE, "Unable to create msg body", PJ_ENOMEM); - pjsip_tx_data_dec_ref(tdata); - goto on_return; + /* Add message body, if content is set */ + if (content) { + /* Set default media type if none is specified */ + if (mime_type == NULL) { + mime_type = &mime_text_plain; + } + + /* Parse MIME type */ + pjsua_parse_media_type(tdata->pool, mime_type, &ctype); + + /* Create "text/plain" message body. */ + tdata->msg->body = pjsip_msg_body_create( tdata->pool, &ctype.type, + &ctype.subtype, content); + if (tdata->msg->body == NULL) { + pjsua_perror(THIS_FILE, "Unable to create msg body", PJ_ENOMEM); + pjsip_tx_data_dec_ref(tdata); + goto on_return; + } } /* Add additional headers etc */ @@ -3517,7 +3726,8 @@ im_data->acc_id = call->acc_id; im_data->call_id = call_id; im_data->to = call->inv->dlg->remote.info_str; - pj_strdup_with_null(tdata->pool, &im_data->body, content); + if (content) + pj_strdup_with_null(tdata->pool, &im_data->body, content); im_data->user_data = user_data; @@ -3945,6 +4155,9 @@ )); } + /* Clear reinit media flag. Should we also cleanup other flags here? */ + call->opt.flag &= ~PJSUA_CALL_REINIT_MEDIA; + /* Generate SDP re-offer */ status = pjsua_media_channel_create_sdp(call->index, pool, NULL, &new_offer, NULL); @@ -4125,6 +4338,478 @@ } +static void trickle_ice_retrans_18x(pj_timer_heap_t *th, + struct pj_timer_entry *te) +{ + pjsua_call *call = (pjsua_call*)te->user_data; + pjsip_tx_data *tdata = NULL; + pj_time_val delay; + + PJ_UNUSED_ARG(th); + + /* If trickling has been started or dialog has been established on + * both sides, stop 18x retransmission. + */ + if (call->trickle_ice.trickling >= PJSUA_OP_STATE_RUNNING || + call->trickle_ice.remote_dlg_est) + { + return; + } + + /* Make sure last tdata is 18x response */ + if (call->inv->invite_tsx) + tdata = call->inv->invite_tsx->last_tx; + if (!tdata || tdata->msg->type != PJSIP_RESPONSE_MSG || + tdata->msg->line.status.code/10 != 18) + { + return; + } + + /* Retransmit 18x */ + ++call->trickle_ice.retrans18x_count; + PJ_LOG(4,(THIS_FILE, + "Call %d: ICE trickle retransmitting 18x (retrans #%d)", + call->index, call->trickle_ice.retrans18x_count)); + + pjsip_tx_data_add_ref(tdata); + pjsip_tsx_retransmit_no_state(call->inv->invite_tsx, tdata); + + /* Schedule next retransmission */ + if (call->trickle_ice.retrans18x_count < 6) { + pj_uint32_t tmp; + tmp = (1 << call->trickle_ice.retrans18x_count) * pjsip_cfg()->tsx.t1; + delay.sec = 0; + delay.msec = tmp; + pj_time_val_normalize(&delay); + } else { + delay.sec = 1; + delay.msec = 500; + } + pjsua_schedule_timer(te, &delay); +} + + +static void trickle_ice_recv_sip_info(pjsua_call *call, pjsip_rx_data *rdata) +{ + pjsip_media_type med_type; + pjsip_rdata_sdp_info *sdp_info; + pj_status_t status; + unsigned i, j, med_cnt; + pj_bool_t use_med_prov; + + pjsip_media_type_init2(&med_type, "application", "trickle-ice-sdpfrag"); + + /* Parse the SDP */ + sdp_info = pjsip_rdata_get_sdp_info2(rdata, &med_type); + if (!sdp_info->sdp) { + pj_status_t err = sdp_info->body.ptr? sdp_info->sdp_err:PJ_ENOTFOUND; + pjsua_perror(THIS_FILE, "Failed to parse trickle ICE SDP in " + "incoming INFO", err); + return; + } + + PJSUA_LOCK(); + + /* Retrieve the candidates from the SDP */ + use_med_prov = call->med_prov_cnt > call->med_cnt; + med_cnt = use_med_prov? call->med_prov_cnt : call->med_cnt; + for (i = 0; i < sdp_info->sdp->media_count; ++i) { + pjmedia_transport *tp = NULL; + pj_str_t mid, ufrag, pwd; + unsigned cand_cnt = PJ_ICE_ST_MAX_CAND; + pj_ice_sess_cand cand[PJ_ICE_ST_MAX_CAND]; + pj_bool_t end_of_cand; + + status = pjmedia_ice_trickle_decode_sdp(sdp_info->sdp, i, &mid, + &ufrag, &pwd, + &cand_cnt, cand, + &end_of_cand); + if (status != PJ_SUCCESS) { + pjsua_perror(THIS_FILE, "Failed to retrive ICE candidates from " + "SDP in incoming INFO", status); + continue; + } + + for (j = 0; j < med_cnt; ++j) { + pjsua_call_media *cm = use_med_prov? &call->media_prov[j] : + &call->media[j]; + tp = cm->tp_orig; + + if (tp && tp->type == PJMEDIA_TRANSPORT_TYPE_ICE && + pj_strcmp(&cm->rem_mid, &mid) == 0) + { + break; + } + } + + if (j == med_cnt) { + pjsua_perror(THIS_FILE, "Cannot add remote candidates from SDP in " + "incoming INFO because media ID (SDP a=mid) is not " + "recognized", + PJ_EIGNORED); + continue; + } + + /* Update ICE checklist */ + status = pjmedia_ice_trickle_update(tp, &ufrag, &pwd, cand_cnt, cand, + end_of_cand); + if (status != PJ_SUCCESS) { + pjsua_perror(THIS_FILE, "Failed to update ICE checklist from " + "incoming INFO", status); + } + } + + PJSUA_UNLOCK(); +} + + +static void trickle_ice_send_sip_info(pj_timer_heap_t *th, + struct pj_timer_entry *te) +{ + pjsua_call *call = (pjsua_call*)te->user_data; + pj_pool_t *tmp_pool = NULL; + pj_bool_t all_end_of_cand, use_med_prov; + pjmedia_sdp_session *sdp; + unsigned i, med_cnt; + pjsua_msg_data msg_data; + pjsip_generic_string_hdr hdr1, hdr2; + pj_status_t status = PJ_SUCCESS; + pj_bool_t forced, need_send = PJ_FALSE; + pj_sockaddr orig_addr; + + pj_str_t SIP_INFO = {"INFO", 4}; + pj_str_t CONTENT_DISP_STR = {"Content-Disposition", 19}; + pj_str_t INFO_PKG_STR = {"Info-Package", 12}; + pj_str_t TRICKLE_ICE_STR = {"trickle-ice", 11}; + + PJ_UNUSED_ARG(th); + + PJSUA_LOCK(); + + /* Check provisional media or active media to use */ + use_med_prov = call->med_prov_cnt > call->med_cnt; + med_cnt = use_med_prov? call->med_prov_cnt : call->med_cnt; + + /* Check if any pending INFO already */ + if (call->trickle_ice.pending_info) + goto on_return; + + /* Check if any new candidate, if not forced */ + forced = (te->id == 2); + if (!forced) { + for (i = 0; i < med_cnt; ++i) { + pjsua_call_media *cm = use_med_prov? &call->media_prov[i] : + &call->media[i]; + pjmedia_transport *tp = cm->tp_orig; + + if (!tp || tp->type != PJMEDIA_TRANSPORT_TYPE_ICE) + continue; + + if (pjmedia_ice_trickle_has_new_cand(tp)) + break; + } + + /* No new local candidate */ + if (i == med_cnt) + goto on_return; + } + + PJ_LOG(4,(THIS_FILE, "Call %d: ICE trickle sending SIP INFO%s", + call->index, (forced? " (forced)":""))); + + /* Create temporary pool */ + tmp_pool = pjsua_pool_create("tmp_ice", 128, 128); + + /* Create empty SDP */ + pj_sockaddr_init(pj_AF_INET(), &orig_addr, NULL, 0); + status = pjmedia_endpt_create_base_sdp(pjsua_var.med_endpt, tmp_pool, + NULL, &orig_addr, &sdp); + if (status != PJ_SUCCESS) + goto on_return; + + /* Generate SDP for SIP INFO */ + all_end_of_cand = PJ_TRUE; + for (i = 0; i < med_cnt; ++i) { + pjsua_call_media *cm = use_med_prov? &call->media_prov[i] : + &call->media[i]; + pjmedia_transport *tp = cm->tp_orig; + pj_bool_t end_of_cand = PJ_FALSE; + + if (!tp || tp->type != PJMEDIA_TRANSPORT_TYPE_ICE) + continue; + + status = pjmedia_ice_trickle_send_local_cand(tp, tmp_pool, sdp, + &end_of_cand); + if (status != PJ_SUCCESS || !end_of_cand) + all_end_of_cand = PJ_FALSE; + + need_send |= (status==PJ_SUCCESS); + } + + if (!need_send) + goto on_return; + + /* Generate and send SIP INFO */ + pjsua_msg_data_init(&msg_data); + + pjsip_generic_string_hdr_init2(&hdr1, &INFO_PKG_STR, &TRICKLE_ICE_STR); + pj_list_push_back(&msg_data.hdr_list, &hdr1); + pjsip_generic_string_hdr_init2(&hdr2, &CONTENT_DISP_STR, &INFO_PKG_STR); + pj_list_push_back(&msg_data.hdr_list, &hdr2); + + msg_data.content_type = pj_str("application/trickle-ice-sdpfrag"); + msg_data.msg_body.ptr = pj_pool_alloc(tmp_pool, PJSIP_MAX_PKT_LEN); + msg_data.msg_body.slen = pjmedia_sdp_print(sdp, msg_data.msg_body.ptr, + PJSIP_MAX_PKT_LEN); + if (msg_data.msg_body.slen == -1) { + PJ_LOG(3,(THIS_FILE, + "Warning! Call %d: ICE trickle failed to print SDP for " + "SIP INFO due to insufficient buffer", call->index)); + goto on_return; + } + + status = pjsua_call_send_request(call->index, &SIP_INFO, &msg_data); + if (status != PJ_SUCCESS) + goto on_return; + + /* Set flag for pending SIP INFO */ + call->trickle_ice.pending_info = PJ_TRUE; + + /* Stop trickling if local candidate gathering for all media is done */ + if (all_end_of_cand) { + PJ_LOG(4,(THIS_FILE, "Call %d: ICE trickle stopped trickling " + "as local candidate gathering completed", + call->index)); + call->trickle_ice.trickling = PJSUA_OP_STATE_DONE; + } + + /* Update ICE checklist after conveying local candidates. */ + for (i = 0; i < med_cnt; ++i) { + pjsua_call_media *cm = use_med_prov? &call->media_prov[i] : + &call->media[i]; + pjmedia_transport *tp = cm->tp_orig; + if (!tp || tp->type != PJMEDIA_TRANSPORT_TYPE_ICE) + continue; + + pjmedia_ice_trickle_update(tp, NULL, NULL, 0, NULL, PJ_FALSE); + } + +on_return: + if (tmp_pool) + pj_pool_release(tmp_pool); + + /* Reschedule if we are trickling */ + if (call->trickle_ice.trickling == PJSUA_OP_STATE_RUNNING) { + pj_time_val delay = {0, PJSUA_TRICKLE_ICE_NEW_CAND_CHECK_INTERVAL}; + + /* Reset forced mode after successfully sending forced SIP INFO */ + te->id = (status==PJ_SUCCESS? 0 : 2); + + pj_time_val_normalize(&delay); + pjsua_schedule_timer(te, &delay); + } + + PJSUA_UNLOCK(); +} + + +/* Before sending INFO can be started, UA needs to confirm these: + * 1. dialog is established (perhaps early) at both sides, + * 2. trickle ICE is supported by peer. + * + * This function needs to be called when: + * - UAS sending 18x, to start 18x retrans + * - UAC receiving 18x, to forcefully send SIP INFO & start trickling + * - UAS receiving INFO, to cease 18x retrans & start trickling + * - UAS receiving PRACK, to start trickling + * - UAC/UAS receiving remote SDP (and check for trickle ICE support), + * to start trickling. + */ +void pjsua_ice_check_start_trickling(pjsua_call *call, + pj_bool_t forceful, + pjsip_event *e) +{ + pjsip_inv_session *inv = call->inv; + + /* Make sure trickling/sending-INFO has not been started */ + if (!forceful && call->trickle_ice.trickling >= PJSUA_OP_STATE_RUNNING) + return; + + /* Make sure trickle ICE is enabled */ + if (!call->trickle_ice.enabled) + return; + + /* Make sure the dialog state is established */ + if (!inv || inv->dlg->state != PJSIP_DIALOG_STATE_ESTABLISHED) + return; + + /* First, make sure remote dialog is also established. */ + if (inv->state == PJSIP_INV_STATE_CONFIRMED) { + /* Set flag indicating remote dialog is established */ + call->trickle_ice.remote_dlg_est = PJ_TRUE; + } else if (inv->state > PJSIP_INV_STATE_CONFIRMED) { + /* Call is terminating/terminated (just trying to be safe) */ + call->trickle_ice.remote_dlg_est = PJ_FALSE; + } else if (!call->trickle_ice.remote_dlg_est && e) { + /* Call is being initialized */ + pjsip_msg *msg = NULL; + pjsip_rx_data *rdata = NULL; + pjsip_tx_data *tdata = NULL; + pj_bool_t has_100rel = (inv->options & PJSIP_INV_REQUIRE_100REL); + pj_timer_entry *te = &call->trickle_ice.timer; + + if (e->type == PJSIP_EVENT_TSX_STATE && + e->body.tsx_state.type == PJSIP_EVENT_RX_MSG) + { + rdata = e->body.tsx_state.src.rdata; + } else if (e->type == PJSIP_EVENT_TSX_STATE && + e->body.tsx_state.type == PJSIP_EVENT_TX_MSG) + { + tdata = e->body.tsx_state.src.tdata; + } else { + return; + } + + /* UAC must have received 18x at this point, so dialog must have been + * established at the remote side. + */ + if (inv->role == PJSIP_ROLE_UAC) { + /* UAC needs to send SIP INFO when receiving 18x and 100rel is not + * active. + * Note that 18x may not have SDP (so we don't know if remote + * supports trickle ICE), but we should send INFO anyway, as the + * draft allows start trickling without answer. + */ + if (!has_100rel && rdata && + rdata->msg_info.msg->type == PJSIP_RESPONSE_MSG && + rdata->msg_info.msg->line.status.code/10 == 18) + { + pjsip_rdata_sdp_info *sdp_info; + sdp_info = pjsip_rdata_get_sdp_info(rdata); + if (sdp_info->sdp) { + unsigned i; + for (i = 0; i < sdp_info->sdp->media_count; ++i) { + if (pjmedia_ice_sdp_has_trickle(sdp_info->sdp, i)) { + call->trickle_ice.remote_sup = PJ_TRUE; + break; + } + } + } else { + /* Start sending SIP INFO forcefully */ + forceful = PJ_TRUE; + } + + if (forceful || call->trickle_ice.remote_sup) { + PJ_LOG(4,(THIS_FILE, + "Call %d: ICE trickle started after UAC " + "receiving 18x (with%s SDP)", + call->index, sdp_info->sdp?"":"out")); + } + } + } + + /* But if we are the UAS, we need to wait for SIP PRACK or INFO to + * confirm dialog state at remote. And while waiting, 18x needs to be + * retransmitted. + */ + else { + + if (tdata && e->body.tsx_state.tsx == inv->invite_tsx && + call->trickle_ice.retrans18x_count == 0) + { + /* Ignite 18x retransmission */ + msg = tdata->msg; + if (msg->type == PJSIP_RESPONSE_MSG && + msg->line.status.code/10 == 18) + { + pj_time_val delay; + delay.sec = pjsip_cfg()->tsx.t1 / 1000; + delay.msec = pjsip_cfg()->tsx.t1 % 1000; + pj_assert(!pj_timer_entry_running(te)); + te->cb = &trickle_ice_retrans_18x; + pjsua_schedule_timer(te, &delay); + + PJ_LOG(4,(THIS_FILE, + "Call %d: ICE trickle start retransmitting 18x", + call->index)); + } + return; + } + + /* Check for incoming PRACK or INFO to stop 18x retransmission */ + if (!rdata) + return; + + msg = rdata->msg_info.msg; + if (has_100rel) { + /* With 100rel, has received PRACK? */ + if (msg->type != PJSIP_REQUEST_MSG || + pjsip_method_cmp(&msg->line.req.method, + pjsip_get_prack_method())) + { + return; + } + } else { + pj_str_t INFO_PKG_STR = {"Info-Package", 12}; + pjsip_generic_string_hdr *hdr; + + /* Without 100rel, has received INFO? */ + if (msg->type != PJSIP_REQUEST_MSG || + pjsip_method_cmp(&msg->line.req.method, + &pjsip_info_method)) + { + return; + } + + /* With Info-Package header containing 'trickle-ice' */ + hdr = (pjsip_generic_string_hdr*) + pjsip_msg_find_hdr_by_name(msg, &INFO_PKG_STR, NULL); + if (!hdr || pj_strcmp2(&hdr->hvalue, "trickle-ice")) + return; + + /* Set the flag indicating remote supports trickle ICE */ + call->trickle_ice.remote_sup = PJ_TRUE; + } + PJ_LOG(4,(THIS_FILE, + "Call %d: ICE trickle stop retransmitting 18x after " + "receiving %s", + call->index, (has_100rel?"PRACK":"INFO"))); + } + + /* Set flag indicating remote dialog is established. + * Any 18x retransmission should be ceased automatically. + */ + call->trickle_ice.remote_dlg_est = PJ_TRUE; + } + + /* Check if ICE trickling can be started */ + if (!forceful && + (!call->trickle_ice.remote_dlg_est || !call->trickle_ice.remote_sup)) + { + return; + } + + /* Let's start trickling (or sending SIP INFO) */ + if (forceful || call->trickle_ice.trickling < PJSUA_OP_STATE_RUNNING) + { + pj_timer_entry *te = &call->trickle_ice.timer; + pj_time_val delay = {0,0}; + + if (call->trickle_ice.trickling < PJSUA_OP_STATE_RUNNING) + call->trickle_ice.trickling = PJSUA_OP_STATE_RUNNING; + + pjsua_cancel_timer(te); + te->id = forceful? 2 : 0; + te->cb = &trickle_ice_send_sip_info; + pjsua_schedule_timer(te, &delay); + + PJ_LOG(4,(THIS_FILE, + "Call %d: ICE trickle start trickling", + call->index)); + } +} + + /* * This callback receives notification from invite session when the * session state has changed. @@ -4158,8 +4843,21 @@ sizeof(call->last_text_buf_)); break; case PJSIP_INV_STATE_CONFIRMED: + if (call->hanging_up) { + /* This can happen if there is a crossover between + * our CANCEL request and the remote's 200 response. + * So we send BYE here. + */ + call_inv_end_session(call, 200, NULL, NULL); + return; + } pj_gettimeofday(&call->conn_time); + if (call->trickle_ice.enabled) { + call->trickle_ice.remote_dlg_est = PJ_TRUE; + pjsua_ice_check_start_trickling(call, PJ_FALSE, NULL); + } + /* See if auto reinvite was pended as media update was done in the * EARLY state and remote does not support UPDATE. */ @@ -4268,6 +4966,16 @@ } } + /* Destroy media session when invite session is disconnected. */ + if (inv->state == PJSIP_INV_STATE_DISCONNECTED) { + PJSUA_LOCK(); + + if (!call->hanging_up) + pjsua_media_channel_deinit(call->index); + + PJSUA_UNLOCK(); + } + /* Release locks before calling callbacks, to avoid deadlock. */ while (PJSUA_LOCK_IS_LOCKED()) { num_locks++; @@ -4277,14 +4985,14 @@ /* Ticket #1627: Invoke on_call_tsx_state() when call is disconnected. */ if (inv->state == PJSIP_INV_STATE_DISCONNECTED && e->type == PJSIP_EVENT_TSX_STATE && - call->inv && + !call->hanging_up && call->inv && pjsua_var.ua_cfg.cb.on_call_tsx_state) { (*pjsua_var.ua_cfg.cb.on_call_tsx_state)(call->index, e->body.tsx_state.tsx, e); } - if (pjsua_var.ua_cfg.cb.on_call_state) + if (!call->hanging_up && pjsua_var.ua_cfg.cb.on_call_state) (*pjsua_var.ua_cfg.cb.on_call_state)(call->index, e); /* Re-acquire the locks. */ @@ -4293,13 +5001,11 @@ /* call->inv may be NULL now */ - /* Destroy media session when invite session is disconnected. */ + /* Finally, free call when invite session is disconnected. */ if (inv->state == PJSIP_INV_STATE_DISCONNECTED) { PJSUA_LOCK(); - pjsua_media_channel_deinit(call->index); - /* Free call */ call->inv = NULL; @@ -4381,7 +5087,7 @@ pj_status_t status; status = pjsip_inv_end_session(inv, code, NULL, &tdata); - if (status != PJ_SUCCESS) + if (status != PJ_SUCCESS || !tdata) return; #if DISABLED_FOR_TICKET_1185 @@ -4434,8 +5140,8 @@ pjsua_perror(THIS_FILE, "SDP negotiation has failed", status); - /* Clean up provisional media */ - pjsua_media_prov_clean_up(call->index); + /* Revert back provisional media. */ + pjsua_media_prov_revert(call->index); /* Do not deinitialize media since this may be a re-INVITE or * UPDATE (which in this case the media should not get affected @@ -4479,6 +5185,20 @@ call->med_update_success = (status == PJ_SUCCESS); + /* Trickle ICE tasks: + * - Check remote SDP for trickle ICE support & start sending SIP INFO. + */ + { + unsigned i; + for (i = 0; i < remote_sdp->media_count; ++i) { + if (pjmedia_ice_sdp_has_trickle(remote_sdp, i)) + break; + } + call->trickle_ice.remote_sup = (i < remote_sdp->media_count); + if (call->trickle_ice.remote_sup) + pjsua_ice_check_start_trickling(call, PJ_FALSE, NULL); + } + /* Update remote's NAT type */ if (pjsua_var.ua_cfg.nat_type_in_sdp) { update_remote_nat_type(call, remote_sdp); @@ -4512,7 +5232,7 @@ pjsua_call_schedule_reinvite_check(call, 0); /* Call application callback, if any */ - if (pjsua_var.ua_cfg.cb.on_call_media_state) + if (!call->hanging_up && pjsua_var.ua_cfg.cb.on_call_media_state) pjsua_var.ua_cfg.cb.on_call_media_state(call->index); on_return: @@ -4637,6 +5357,8 @@ pj_bool_t async = PJ_FALSE; call = (pjsua_call*) inv->dlg->mod_data[pjsua_var.mod.id]; + if (call->hanging_up) + return; /* Supply candidate answer */ PJ_LOG(4,(THIS_FILE, "Call %d: received updated media offer", @@ -4811,9 +5533,11 @@ pj_log_push_indent(); call = (pjsua_call*) inv->dlg->mod_data[pjsua_var.mod.id]; - if (pjsua_call_media_is_changing(call)) { + if (call->hanging_up || pjsua_call_media_is_changing(call)) { *offer = NULL; - PJ_LOG(1,(THIS_FILE, "Unable to create offer" ERR_MEDIA_CHANGING)); + PJ_LOG(1,(THIS_FILE, "Unable to create offer%s", + call->hanging_up? ", call hanging up": + ERR_MEDIA_CHANGING)); goto on_return; } @@ -4930,7 +5654,9 @@ /* Since no subscription is desired, assume that call has been * transferred successfully. */ - if (call && pjsua_var.ua_cfg.cb.on_call_transfer_status) { + if (call && !call->hanging_up && + pjsua_var.ua_cfg.cb.on_call_transfer_status) + { const pj_str_t ACCEPTED = { "Accepted", 8 }; pj_bool_t cont = PJ_FALSE; (*pjsua_var.ua_cfg.cb.on_call_transfer_status)(call->index, @@ -4951,7 +5677,9 @@ /* Notify application about call transfer progress. * Initially notify with 100/Accepted status. */ - if (call && pjsua_var.ua_cfg.cb.on_call_transfer_status) { + if (call && !call->hanging_up && + pjsua_var.ua_cfg.cb.on_call_transfer_status) + { const pj_str_t ACCEPTED = { "Accepted", 8 }; pj_bool_t cont = PJ_FALSE; (*pjsua_var.ua_cfg.cb.on_call_transfer_status)(call->index, @@ -4988,7 +5716,9 @@ } - if (!call || !event || !pjsua_var.ua_cfg.cb.on_call_transfer_status) { + if (!call || call->hanging_up || !event || + !pjsua_var.ua_cfg.cb.on_call_transfer_status) + { /* Application is not interested with call progress status */ goto on_return; } @@ -5131,6 +5861,10 @@ pj_log_push_indent(); existing_call = (pjsua_call*) inv->dlg->mod_data[pjsua_var.mod.id]; + if (existing_call->hanging_up) { + pjsip_dlg_respond( inv->dlg, rdata, 487, NULL, NULL, NULL); + goto on_return; + } /* Find the Refer-To header */ refer_to = (pjsip_generic_string_hdr*) @@ -5355,6 +6089,12 @@ pjsip_transaction *tsx, pjsip_event *e) { + /* Incoming INFO request for media control, DTMF, trickle ICE, etc. */ + const pj_str_t STR_APPLICATION = { "application", 11}; + const pj_str_t STR_MEDIA_CONTROL_XML = { "media_control+xml", 17 }; + const pj_str_t STR_DTMF_RELAY = { "dtmf-relay", 10 }; + const pj_str_t STR_TRICKLE_ICE_SDP = { "trickle-ice-sdpfrag", 19 }; + pjsua_call *call; pj_log_push_indent(); @@ -5364,7 +6104,7 @@ if (call == NULL) goto on_return; - if (call->inv == NULL) { + if (call->inv == NULL || call->hanging_up) { /* Call has been disconnected. */ goto on_return; } @@ -5432,26 +6172,57 @@ &inv->dlg->local.info_str, rdata); } - else if (tsx->role == PJSIP_ROLE_UAC && - pjsip_method_cmp(&tsx->method, &pjsip_message_method)==0) - { - /* Handle outgoing pager status */ - if (tsx->status_code >= 200) { - pjsua_im_data *im_data; - - im_data = (pjsua_im_data*) tsx->mod_data[pjsua_var.mod.id]; - /* im_data can be NULL if this is typing indication */ - - if (im_data && pjsua_var.ua_cfg.cb.on_pager_status) { - pjsua_var.ua_cfg.cb.on_pager_status(im_data->call_id, - &im_data->to, - &im_data->body, - im_data->user_data, - (pjsip_status_code) - tsx->status_code, - &tsx->status_text); - } - } + else if (e->type == PJSIP_EVENT_TSX_STATE && + tsx->role == PJSIP_ROLE_UAC && + pjsip_method_cmp(&tsx->method, &pjsip_message_method)==0 && + (tsx->state == PJSIP_TSX_STATE_COMPLETED || + (tsx->state == PJSIP_TSX_STATE_TERMINATED && + e->body.tsx_state.prev_state != PJSIP_TSX_STATE_COMPLETED))) + { + /* Handle outgoing pager status */ + if (tsx->status_code >= 200) { + pjsua_im_data *im_data; + + im_data = (pjsua_im_data*) tsx->mod_data[pjsua_var.mod.id]; + /* im_data can be NULL if this is typing indication */ + + if (im_data) { + pj_str_t im_body = im_data->body; + if (im_body.slen==0) { + pjsip_msg_body *body = tsx->last_tx->msg->body; + pj_strset(&im_body, body->data, body->len); + } + + if (pjsua_var.ua_cfg.cb.on_pager_status) { + pjsua_var.ua_cfg.cb.on_pager_status(im_data->call_id, + &im_data->to, + &im_body, + im_data->user_data, + (pjsip_status_code) + tsx->status_code, + &tsx->status_text); + } + + if (pjsua_var.ua_cfg.cb.on_pager_status2) { + pjsip_rx_data* rdata; + + if (e->body.tsx_state.type == PJSIP_EVENT_RX_MSG) + rdata = e->body.tsx_state.src.rdata; + else + rdata = NULL; + + pjsua_var.ua_cfg.cb.on_pager_status2(im_data->call_id, + &im_data->to, + &im_body, + im_data->user_data, + (pjsip_status_code) + tsx->status_code, + &tsx->status_text, + tsx->last_tx, + rdata, im_data->acc_id); + } + } + } } else if (tsx->role == PJSIP_ROLE_UAC && pjsip_method_cmp(&tsx->method, pjsip_get_invite_method())==0 && tsx->state >= PJSIP_TSX_STATE_COMPLETED && @@ -5493,9 +6264,9 @@ (tsx->status_code/100 != 2 || !call->med_update_success)) { /* Either we get non-2xx or media update failed, - * clean up provisional media. + * revert back provisional media. */ - pjsua_media_prov_clean_up(call->index); + pjsua_media_prov_revert(call->index); } } else if (tsx->role == PJSIP_ROLE_UAC && pjsip_method_cmp(&tsx->method, &pjsip_update_method)==0 && @@ -5509,27 +6280,18 @@ (tsx->status_code/100 != 2 || !call->med_update_success)) { /* Either we get non-2xx or media update failed, - * clean up provisional media. + * revert back provisional media. */ - pjsua_media_prov_clean_up(call->index); + pjsua_media_prov_revert(call->index); } } else if (tsx->role==PJSIP_ROLE_UAS && - tsx->state==PJSIP_TSX_STATE_TRYING && - pjsip_method_cmp(&tsx->method, &pjsip_info_method)==0) + tsx->state==PJSIP_TSX_STATE_TRYING && + pjsip_method_cmp(&tsx->method, &pjsip_info_method)==0) { - /* - * Incoming INFO request for media control. - */ - const pj_str_t STR_APPLICATION = { "application", 11}; - const pj_str_t STR_MEDIA_CONTROL_XML = { "media_control+xml", 17 }; - /* - * Incoming INFO request for DTMF. - */ - const pj_str_t STR_DTMF_RELAY = { "dtmf-relay", 10 }; - pjsip_rx_data *rdata = e->body.tsx_state.src.rdata; pjsip_msg_body *body = rdata->msg_info.msg->body; + /* Check Media Control content in the INFO message */ if (body && body->len && pj_stricmp(&body->content_type.type, &STR_APPLICATION)==0 && pj_stricmp(&body->content_type.subtype, &STR_MEDIA_CONTROL_XML)==0) @@ -5552,16 +6314,21 @@ if (status == PJ_SUCCESS) status = pjsip_tsx_send_msg(tsx, tdata); } - } else if (body && body->len && - pj_stricmp(&body->content_type.type, &STR_APPLICATION)==0 && - pj_stricmp(&body->content_type.subtype, &STR_DTMF_RELAY)==0) + } + + /* Check DTMF content in the INFO message */ + else if (body && body->len && + pj_stricmp(&body->content_type.type, &STR_APPLICATION)==0 && + pj_stricmp(&body->content_type.subtype, &STR_DTMF_RELAY)==0) { pjsip_tx_data *tdata; pj_status_t status; pj_bool_t is_handled = PJ_FALSE; - if (pjsua_var.ua_cfg.cb.on_dtmf_digit2) { - pjsua_dtmf_info info; + if (pjsua_var.ua_cfg.cb.on_dtmf_digit2 || + pjsua_var.ua_cfg.cb.on_dtmf_event) + { + pjsua_dtmf_info info = {0}; pj_str_t delim, token, input; pj_ssize_t found_idx; @@ -5570,35 +6337,90 @@ found_idx = pj_strtok(&input, &delim, &token, 0); if (found_idx != input.slen) { /* Get signal/digit */ - const pj_str_t STR_SIGNAL = { "Signal=", 7 }; - const pj_str_t STR_DURATION = { "Duration=", 9 }; + const pj_str_t STR_SIGNAL = { "Signal", 6 }; + const pj_str_t STR_DURATION = { "Duration", 8 }; char *val; + pj_ssize_t count_equal_sign; val = pj_strstr(&input, &STR_SIGNAL); if (val) { - info.digit = *(val+STR_SIGNAL.slen); - is_handled = PJ_TRUE; + char* p = val + STR_SIGNAL.slen; + count_equal_sign = 0; + while ((p - input.ptr < input.slen) && (*p == ' ' || *p == '=')) { + if(*p == '=') + count_equal_sign++; + ++p; + } + + if (count_equal_sign == 1 && (p - input.ptr < input.slen)) { + info.digit = *p; + is_handled = PJ_TRUE; + } else { + PJ_LOG(2, (THIS_FILE, "Invalid dtmf-relay format")); + } /* Get duration */ input.ptr += token.slen + 2; input.slen -= (token.slen + 2); val = pj_strstr(&input, &STR_DURATION); - if (val) { + if (val && is_handled) { pj_str_t val_str; + char* ptr = val + STR_DURATION.slen; + count_equal_sign = 0; + while ((ptr - input.ptr < input.slen) && + (*ptr == ' ' || *ptr == '=')) + { + if (*ptr == '=') + count_equal_sign++; + ++ptr; + } + + if ((count_equal_sign == 1) && + (ptr - input.ptr < input.slen)) + { + val_str.ptr = ptr; + val_str.slen = input.slen - (ptr - input.ptr); + info.duration = pj_strtoul(&val_str); + } else { + info.duration = PJSUA_UNKNOWN_DTMF_DURATION; + is_handled = PJ_FALSE; + PJ_LOG(2, (THIS_FILE, + "Invalid dtmf-relay format")); + } + } - val_str.ptr = val + STR_DURATION.slen; - val_str.slen = input.slen - STR_DURATION.slen; - info.duration = pj_strtoul(&val_str); + if (is_handled) { + info.method = PJSUA_DTMF_METHOD_SIP_INFO; + if (pjsua_var.ua_cfg.cb.on_dtmf_event) { + pjsua_dtmf_event evt; + pj_timestamp begin_of_time, timestamp; + /* Use the current instant as the events start + * time. + */ + begin_of_time.u64 = 0; + pj_get_timestamp(×tamp); + evt.method = info.method; + evt.timestamp = pj_elapsed_msec(&begin_of_time, + ×tamp); + evt.digit = info.digit; + evt.duration = info.duration; + /* There is only one message indicating the full + * duration of the digit. + */ + evt.flags = PJMEDIA_STREAM_DTMF_IS_END; + (*pjsua_var.ua_cfg.cb.on_dtmf_event)(call->index, + &evt); + } else { + (*pjsua_var.ua_cfg.cb.on_dtmf_digit2)(call->index, + &info); + } + + status = pjsip_endpt_create_response(tsx->endpt, rdata, + 200, NULL, &tdata); + if (status == PJ_SUCCESS) + status = pjsip_tsx_send_msg(tsx, tdata); } - info.method = PJSUA_DTMF_METHOD_SIP_INFO; - (*pjsua_var.ua_cfg.cb.on_dtmf_digit2)(call->index, - &info); - - status = pjsip_endpt_create_response(tsx->endpt, rdata, - 200, NULL, &tdata); - if (status == PJ_SUCCESS) - status = pjsip_tsx_send_msg(tsx, tdata); } } } @@ -5610,16 +6432,44 @@ status = pjsip_tsx_send_msg(tsx, tdata); } } + + /* Check Trickle ICE content in the INFO message */ + else if (body && body->len && + pj_stricmp(&body->content_type.type, &STR_APPLICATION)==0 && + pj_stricmp(&body->content_type.subtype, + &STR_TRICKLE_ICE_SDP)==0) + { + pjsip_tx_data *tdata; + pj_status_t status; + + /* Trickle ICE tasks: + * - UAS receiving INFO, cease 18x retrans & start trickling + */ + if (call->trickle_ice.enabled) { + pjsua_ice_check_start_trickling(call, PJ_FALSE, e); + + /* Process the SIP INFO content */ + trickle_ice_recv_sip_info(call, rdata); + + /* Send 200 response, regardless */ + status = pjsip_endpt_create_response(tsx->endpt, rdata, + 200, NULL, &tdata); + } else { + /* Trickle ICE not enabled, send 400 response */ + status = pjsip_endpt_create_response(tsx->endpt, rdata, + 400, NULL, &tdata); + } + if (status == PJ_SUCCESS) + status = pjsip_tsx_send_msg(tsx, tdata); + } + } else if (tsx->role == PJSIP_ROLE_UAC && pjsip_method_cmp(&tsx->method, &pjsip_info_method)==0 && (tsx->state == PJSIP_TSX_STATE_COMPLETED || (tsx->state == PJSIP_TSX_STATE_TERMINATED && e->body.tsx_state.prev_state != PJSIP_TSX_STATE_COMPLETED))) { - const pj_str_t STR_APPLICATION = { "application", 11}; - const pj_str_t STR_DTMF_RELAY = { "dtmf-relay", 10 }; pjsip_msg_body *body = NULL; - pj_bool_t dtmf_info = PJ_FALSE; if (e->body.tsx_state.type == PJSIP_EVENT_TX_MSG) body = e->body.tsx_state.src.tdata->msg->body; @@ -5631,13 +6481,6 @@ pj_stricmp(&body->content_type.type, &STR_APPLICATION)==0 && pj_stricmp(&body->content_type.subtype, &STR_DTMF_RELAY)==0) { - dtmf_info = PJ_TRUE; - } - - if (dtmf_info && (tsx->state == PJSIP_TSX_STATE_COMPLETED || - (tsx->state == PJSIP_TSX_STATE_TERMINATED && - e->body.tsx_state.prev_state != PJSIP_TSX_STATE_COMPLETED))) - { /* Status of outgoing INFO request */ if (tsx->status_code >= 200 && tsx->status_code < 300) { PJ_LOG(4,(THIS_FILE, @@ -5652,6 +6495,35 @@ tsx->status_text.ptr)); } } + + /* Check Trickle ICE content in the INFO message */ + else if (body && body->len && + pj_stricmp(&body->content_type.type, &STR_APPLICATION)==0 && + pj_stricmp(&body->content_type.subtype, + &STR_TRICKLE_ICE_SDP)==0) + { + /* Reset pending SIP INFO for Trickle ICE */ + call->trickle_ice.pending_info = PJ_FALSE; + } + } else if (inv->state < PJSIP_INV_STATE_CONFIRMED && + pjsip_method_cmp(&tsx->method, pjsip_get_invite_method())==0 && + tsx->state == PJSIP_TSX_STATE_PROCEEDING && + tsx->status_code/10 == 18) + { + /* Trickle ICE tasks: + * - UAS sending 18x, start 18x retrans + * - UAC receiving 18x, forcefully send SIP INFO & start trickling + */ + pj_bool_t force = call->trickle_ice.tricklingrole == PJSIP_ROLE_UAS && + pjsip_method_cmp(&tsx->method, pjsip_get_prack_method())==0 && + tsx->state==PJSIP_TSX_STATE_TRYING) + { + /* Trickle ICE tasks: + * - UAS receiving PRACK, start trickling + */ + pjsua_ice_check_start_trickling(call, PJ_FALSE, e); } on_return: @@ -5669,14 +6541,16 @@ pj_log_push_indent(); - if (pjsua_var.ua_cfg.cb.on_call_redirected) { + if (!call->hanging_up && pjsua_var.ua_cfg.cb.on_call_redirected) { op = (*pjsua_var.ua_cfg.cb.on_call_redirected)(call->index, target, e); } else { - PJ_LOG(4,(THIS_FILE, "Unhandled redirection for call %d " - "(callback not implemented by application). Disconnecting " - "call.", - call->index)); + if (!call->hanging_up) { + PJ_LOG(4,(THIS_FILE, "Unhandled redirection for call %d " + "(callback not implemented by application). " + "Disconnecting call.", + call->index)); + } op = PJSIP_REDIRECT_STOP; } diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip/src/pjsua-lib/pjsua_core.c asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip/src/pjsua-lib/pjsua_core.c --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip/src/pjsua-lib/pjsua_core.c 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip/src/pjsua-lib/pjsua_core.c 2022-02-24 07:54:38.000000000 +0000 @@ -104,7 +104,7 @@ { pj_bzero(cfg, sizeof(*cfg)); - cfg->max_calls = ((PJSUA_MAX_CALLS) < 4) ? (PJSUA_MAX_CALLS) : 4; + cfg->max_calls = PJSUA_MAX_CALLS; cfg->thread_cnt = PJSUA_SEPARATE_WORKER_FOR_TIMER? 2 : 1; cfg->nat_type_in_sdp = 1; cfg->stun_ignore_failure = PJ_TRUE; @@ -365,6 +365,7 @@ PJSUA_REG_USE_ACC_PROXY; #if defined(PJMEDIA_STREAM_ENABLE_KA) && PJMEDIA_STREAM_ENABLE_KA!=0 cfg->use_stream_ka = (PJMEDIA_STREAM_ENABLE_KA != 0); + pjmedia_stream_ka_config_default(&cfg->stream_ka_cfg); #endif pj_list_init(&cfg->reg_hdr_list); pj_list_init(&cfg->sub_hdr_list); @@ -415,6 +416,7 @@ cfg->snd_rec_latency = PJMEDIA_SND_DEFAULT_REC_LATENCY; cfg->snd_play_latency = PJMEDIA_SND_DEFAULT_PLAY_LATENCY; cfg->jb_init = cfg->jb_min_pre = cfg->jb_max_pre = cfg->jb_max = -1; + cfg->jb_discard_algo = PJMEDIA_JB_DISCARD_PROGRESSIVE; cfg->snd_auto_close_time = 1; cfg->ice_max_host_cands = -1; @@ -936,12 +938,13 @@ /* Init caching pool. */ pj_caching_pool_init(&pjsua_var.cp, NULL, 0); - /* Create memory pool for application. */ - pjsua_var.pool = pjsua_pool_create("pjsua", 1000, 1000); - if (pjsua_var.pool == NULL) { + /* Create memory pools for application and internal use. */ + pjsua_var.pool = pjsua_pool_create("pjsua", PJSUA_POOL_LEN, PJSUA_POOL_INC); + pjsua_var.timer_pool = pjsua_pool_create("pjsua_timer", 500, 500); + if (pjsua_var.pool == NULL || pjsua_var.timer_pool == NULL) { pj_log_pop_indent(); status = PJ_ENOMEM; - pjsua_perror(THIS_FILE, "Unable to create pjsua pool", status); + pjsua_perror(THIS_FILE, "Unable to create pjsua/timer pool", status); pj_shutdown(); return status; } @@ -969,8 +972,10 @@ return status; } - /* Init timer entry list */ + /* Init timer entry and event list */ + pj_list_init(&pjsua_var.active_timer_list); pj_list_init(&pjsua_var.timer_list); + pj_list_init(&pjsua_var.event_list); /* Create timer mutex */ status = pj_mutex_create_recursive(pjsua_var.pool, "pjsua_timer", @@ -2041,7 +2046,11 @@ pjsua_var.timer_mutex = NULL; } - /* Destroy pool and pool factory. */ + /* Destroy pools and pool factory. */ + if (pjsua_var.timer_pool) { + pj_pool_release(pjsua_var.timer_pool); + pjsua_var.timer_pool = NULL; + } if (pjsua_var.pool) { pj_pool_release(pjsua_var.pool); pjsua_var.pool = NULL; @@ -2872,20 +2881,27 @@ tp_type = pjsua_var.tpdata[id].type & ~PJSIP_TRANSPORT_IPV6; - /* Note: destroy() may not work if there are objects still referencing - * the transport. - */ if (force) { - switch (tp_type) { + /* Forcefully closing transport is deprecated, since any pending + * transactions that are using the transport may not terminate + * properly and can even crash. + */ + PJ_LOG(1, (THIS_FILE, "pjsua_transport_close(force=PJ_TRUE) is " + "deprecated.")); + + /* To minimize the effect to users, we shouldn't hard-deprecate this + * and let it continue as if force is false. + */ + // return PJ_EINVAL; + } + + /* If force is not specified, transports will be closed at their + * convenient time. + */ + switch (tp_type) { case PJSIP_TRANSPORT_UDP: status = pjsip_transport_shutdown(pjsua_var.tpdata[id].data.tp); - if (status != PJ_SUCCESS) - return status; - status = pjsip_transport_destroy(pjsua_var.tpdata[id].data.tp); - if (status != PJ_SUCCESS) - return status; break; - case PJSIP_TRANSPORT_TLS: case PJSIP_TRANSPORT_TCP: /* This will close the TCP listener, but existing TCP/TLS @@ -2893,41 +2909,21 @@ */ status = (*pjsua_var.tpdata[id].data.factory->destroy) (pjsua_var.tpdata[id].data.factory); - if (status != PJ_SUCCESS) - return status; - break; - default: return PJ_EINVAL; - } - - } else { - /* If force is not specified, transports will be closed at their - * convenient time. However this will leak PJSUA-API transport - * descriptors as PJSUA-API wouldn't know when exactly the - * transport is closed thus it can't cleanup PJSUA transport - * descriptor. - */ - switch (tp_type) { - case PJSIP_TRANSPORT_UDP: - return pjsip_transport_shutdown(pjsua_var.tpdata[id].data.tp); - case PJSIP_TRANSPORT_TLS: - case PJSIP_TRANSPORT_TCP: - return (*pjsua_var.tpdata[id].data.factory->destroy) - (pjsua_var.tpdata[id].data.factory); - default: - return PJ_EINVAL; - } } - /* Cleanup pjsua data when force is applied */ - if (force) { - pjsua_var.tpdata[id].type = PJSIP_TRANSPORT_UNSPECIFIED; - pjsua_var.tpdata[id].data.ptr = NULL; + /* Cleanup pjsua data. We don't need to keep the transport + * descriptor, the transport will be destroyed later by the last user + * which decrements the transport's reference. + */ + if (status == PJ_SUCCESS) { + pjsua_var.tpdata[id].type = PJSIP_TRANSPORT_UNSPECIFIED; + pjsua_var.tpdata[id].data.ptr = NULL; } - return PJ_SUCCESS; + return status; } @@ -3301,12 +3297,13 @@ PJ_UNUSED_ARG(th); + if (cb) + (*cb)(user_data); + pj_mutex_lock(pjsua_var.timer_mutex); + pj_list_erase(tmr); pj_list_push_back(&pjsua_var.timer_list, tmr); pj_mutex_unlock(pjsua_var.timer_mutex); - - if (cb) - (*cb)(user_data); } /* @@ -3331,7 +3328,7 @@ pj_mutex_lock(pjsua_var.timer_mutex); if (pj_list_empty(&pjsua_var.timer_list)) { - tmr = PJ_POOL_ALLOC_T(pjsua_var.pool, pjsua_timer_list); + tmr = PJ_POOL_ALLOC_T(pjsua_var.timer_pool, pjsua_timer_list); } else { tmr = pjsua_var.timer_list.next; pj_list_erase(tmr); @@ -3348,7 +3345,9 @@ #else status = pjsip_endpt_schedule_timer(pjsua_var.endpt, &tmr->entry, &delay); #endif - if (status != PJ_SUCCESS) { + if (status == PJ_SUCCESS) { + pj_list_push_back(&pjsua_var.active_timer_list, tmr); + } else { pj_list_push_back(&pjsua_var.timer_list, tmr); } @@ -3735,13 +3734,28 @@ switch (tp_info.type) { case PJSIP_TRANSPORT_UDP: - case PJSIP_TRANSPORT_UDP6: + case PJSIP_TRANSPORT_UDP6: + { + unsigned num_locks = 0; + + /* Release locks before restarting the transport, to avoid deadlock. */ + while (PJSUA_LOCK_IS_LOCKED()) { + num_locks++; + PJSUA_UNLOCK(); + } + status = pjsip_udp_transport_restart2( pjsua_var.tpdata[id].data.tp, PJSIP_UDP_TRANSPORT_DESTROY_SOCKET, PJ_INVALID_SOCKET, &bind_addr, NULL); + + /* Re-acquire the locks. */ + for (;num_locks > 0; num_locks--) + PJSUA_LOCK(); + + } break; #if defined(PJSIP_HAS_TLS_TRANSPORT) && PJSIP_HAS_TLS_TRANSPORT!=0 @@ -3818,6 +3832,15 @@ } +static void ip_change_put_back_inv_config(void *user_data) +{ + PJ_UNUSED_ARG(user_data); + + PJ_LOG(4,(THIS_FILE,"IP change stops ignoring request timeout")); + pjsip_cfg()->endpt.keep_inv_after_tsx_timeout = PJ_FALSE; +} + + PJ_DEF(pj_status_t) pjsua_handle_ip_change(const pjsua_ip_change_param *param) { pj_status_t status = PJ_SUCCESS; @@ -3836,6 +3859,21 @@ } PJ_LOG(3, (THIS_FILE, "Start handling IP address change")); + + /* Avoid call disconnection due to request timeout. Some requests may + * be in progress when network is changing, they may eventually get + * timed out and cause call disconnection. + */ + if (!pjsip_cfg()->endpt.keep_inv_after_tsx_timeout) { + pjsip_cfg()->endpt.keep_inv_after_tsx_timeout = PJ_TRUE; + + /* Put it back after some time (transaction timeout setting value) */ + pjsua_schedule_timer2(&ip_change_put_back_inv_config, NULL, + pjsip_cfg()->tsx.td); + + PJ_LOG(4,(THIS_FILE,"IP change temporarily ignores request timeout")); + } + if (param->restart_listener) { PJSUA_LOCK(); /* Restart listener/transport, handle_ip_change_on_acc() will diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip/src/pjsua-lib/pjsua_dump.c asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip/src/pjsua-lib/pjsua_dump.c --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip/src/pjsua-lib/pjsua_dump.c 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip/src/pjsua-lib/pjsua_dump.c 2022-02-24 07:54:38.000000000 +0000 @@ -907,13 +907,14 @@ char *buf, pj_size_t size) { int len; - pjsip_inv_session *inv = pjsua_var.calls[call_id].inv; + pjsua_call *call = &pjsua_var.calls[call_id]; + pjsip_inv_session *inv = call->inv; pjsip_dialog *dlg; char userinfo[PJSIP_MAX_URL_SIZE]; /* Dump invite sesion info. */ - dlg = (inv? inv->dlg: pjsua_var.calls[call_id].async_call.dlg); + dlg = (inv? inv->dlg: call->async_call.dlg); len = pjsip_hdr_print_on(dlg->remote.info, userinfo, sizeof(userinfo)); if (len < 0) pj_ansi_strcpy(userinfo, "<--uri too long-->"); @@ -922,8 +923,9 @@ len = pj_ansi_snprintf(buf, size, "%s[%s] %s", title, - pjsip_inv_state_name(inv? inv->state: - PJSIP_INV_STATE_DISCONNECTED), + pjsip_inv_state_name((call->hanging_up || !inv)? + PJSIP_INV_STATE_DISCONNECTED: + inv->state), userinfo); if (len < 1 || len >= (int)size) { pj_ansi_strcpy(buf, "<--uri too long-->"); @@ -952,6 +954,7 @@ PJ_ASSERT_RETURN(call_id>=0 && call_id<(int)pjsua_var.ua_cfg.max_calls, PJ_EINVAL); + PJ_ASSERT_RETURN(maxlen > 3, PJ_ETOOSMALL); status = acquire_call("pjsua_call_dump()", call_id, &call, &dlg); if (status != PJ_SUCCESS) @@ -965,11 +968,13 @@ print_call(indent, call_id, tmp, sizeof(tmp)); len = (int)pj_ansi_strlen(tmp); - pj_ansi_strcpy(buffer, tmp); + if (len + 3 > (int)maxlen) len = maxlen - 3; + pj_ansi_strncpy(buffer, tmp, len); p += len; *p++ = '\r'; *p++ = '\n'; + *p = '\0'; /* Calculate call duration */ if (call->conn_time.sec != 0) { diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip/src/pjsua-lib/pjsua_im.c asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip/src/pjsua-lib/pjsua_im.c --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip/src/pjsua-lib/pjsua_im.c 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip/src/pjsua-lib/pjsua_im.c 2022-02-24 07:54:38.000000000 +0000 @@ -394,6 +394,12 @@ return; } pjsip_auth_clt_deinit(&auth); + + /* Don't invoke callback if another callback (with auth, + * different tsx) has been called. + */ + if (im_data2->acc_id == PJSUA_INVALID_ID) + return; } } @@ -411,9 +417,15 @@ } if (pjsua_var.ua_cfg.cb.on_pager_status) { + pj_str_t im_body = im_data->body; + if (im_body.slen==0) { + pjsip_msg_body *body = tsx->last_tx->msg->body; + pj_strset(&im_body, body->data, body->len); + } + pjsua_var.ua_cfg.cb.on_pager_status(im_data->call_id, &im_data->to, - &im_data->body, + &im_body, im_data->user_data, (pjsip_status_code) tsx->status_code, @@ -422,15 +434,21 @@ if (pjsua_var.ua_cfg.cb.on_pager_status2) { pjsip_rx_data *rdata; + pj_str_t im_body = im_data->body; if (e->body.tsx_state.type == PJSIP_EVENT_RX_MSG) rdata = e->body.tsx_state.src.rdata; else rdata = NULL; + if (im_body.slen==0) { + pjsip_msg_body *body = tsx->last_tx->msg->body; + pj_strset(&im_body, body->data, body->len); + } + pjsua_var.ua_cfg.cb.on_pager_status2(im_data->call_id, &im_data->to, - &im_data->body, + &im_body, im_data->user_data, (pjsip_status_code) tsx->status_code, @@ -438,6 +456,9 @@ tsx->last_tx, rdata, im_data->acc_id); } + + /* Reset acc_id after invoking callback */ + im_data->acc_id = PJSUA_INVALID_ID; } } @@ -521,10 +542,14 @@ pjsip_media_type media_type; pjsua_im_data *im_data; pjsua_acc *acc; + pj_bool_t content_in_msg_data; pj_status_t status; + content_in_msg_data = msg_data && (msg_data->msg_body.slen || + msg_data->multipart_ctype.type.slen); + /* To and message body must be specified. */ - PJ_ASSERT_RETURN(to && content, PJ_EINVAL); + PJ_ASSERT_RETURN(to && (content || content_in_msg_data), PJ_EINVAL); acc = &pjsua_var.acc[acc_id]; @@ -585,26 +610,30 @@ im_data->acc_id = acc_id; im_data->call_id = PJSUA_INVALID_ID; pj_strdup_with_null(tdata->pool, &im_data->to, to); - pj_strdup_with_null(tdata->pool, &im_data->body, content); im_data->user_data = user_data; - /* Set default media type if none is specified */ - if (mime_type == NULL) { - mime_type = &mime_text_plain; - } - - /* Parse MIME type */ - pjsua_parse_media_type(tdata->pool, mime_type, &media_type); - - /* Add message body */ - tdata->msg->body = pjsip_msg_body_create( tdata->pool, &media_type.type, - &media_type.subtype, - &im_data->body); - if (tdata->msg->body == NULL) { - pjsua_perror(THIS_FILE, "Unable to create msg body", PJ_ENOMEM); - pjsip_tx_data_dec_ref(tdata); - return PJ_ENOMEM; + /* Add message body, if content is set */ + if (content) { + pj_strdup_with_null(tdata->pool, &im_data->body, content); + + /* Set default media type if none is specified */ + if (mime_type == NULL) { + mime_type = &mime_text_plain; + } + + /* Parse MIME type */ + pjsua_parse_media_type(tdata->pool, mime_type, &media_type); + + /* Add message body */ + tdata->msg->body = pjsip_msg_body_create( tdata->pool, &media_type.type, + &media_type.subtype, + &im_data->body); + if (tdata->msg->body == NULL) { + pjsua_perror(THIS_FILE, "Unable to create msg body", PJ_ENOMEM); + pjsip_tx_data_dec_ref(tdata); + return PJ_ENOMEM; + } } /* Add additional headers etc. */ diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip/src/pjsua-lib/pjsua_media.c asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip/src/pjsua-lib/pjsua_media.c --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip/src/pjsua-lib/pjsua_media.c 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip/src/pjsua-lib/pjsua_media.c 2022-02-24 07:54:38.000000000 +0000 @@ -27,6 +27,10 @@ # define PJSUA_REQUIRE_CONSECUTIVE_RTCP_PORT 0 #endif +#ifndef PJSUA_RESET_SRTP_ROC_ON_REM_ADDRESS_CHANGE +# define PJSUA_RESET_SRTP_ROC_ON_REM_ADDRESS_CHANGE 0 +#endif + static void stop_media_stream(pjsua_call *call, unsigned med_idx); static void pjsua_media_config_dup(pj_pool_t *pool, @@ -673,7 +677,19 @@ opt.af = af; if (cfg->bound_addr.slen) opt.addr = cfg->bound_addr; - opt.port = cfg->port; + + if (acc->next_rtp_port == 0 || cfg->port == 0) + acc->next_rtp_port = (pj_uint16_t)cfg->port; + + if (cfg->port > 0 && cfg->port_range > 0 && + (acc->next_rtp_port > cfg->port + cfg->port_range || + acc->next_rtp_port < cfg->port)) + { + acc->next_rtp_port = (pj_uint16_t)cfg->port; + } + opt.port = acc->next_rtp_port; + acc->next_rtp_port += 2; + opt.disable_rx=!pjsua_var.acc[call_med->call->acc_id].cfg.enable_loopback; status = pjmedia_transport_loop_create2(pjsua_var.med_endpt, &opt, &call_med->tp); @@ -745,7 +761,7 @@ { pjsua_call_media *call_med = (pjsua_call_media*)user_data; - if (call_med->call == NULL) + if (call_med->call == NULL || call_med->tp_ready == PJ_SUCCESS) return; /* No need to acquire_call() if we only change the tp_ready flag @@ -758,11 +774,15 @@ if (call_med->med_create_cb) { pjsua_call *call = NULL; pjsip_dialog *dlg = NULL; + pj_status_t status; - if (acquire_call("ice_init_complete_cb", call_med->call->index, - &call, &dlg) != PJ_SUCCESS) - { - /* Call have been terminated */ + status = acquire_call("ice_init_complete_cb", call_med->call->index, + &call, &dlg); + if (status != PJ_SUCCESS) { + if (status != PJSIP_ESESSIONTERMINATED) { + /* Retry, if call is still active */ + pjsua_schedule_timer2(&ice_init_complete_cb, call_med, 10); + } return; } @@ -780,15 +800,20 @@ int call_id = (int)(pj_ssize_t)user_data; pjsua_call *call = NULL; pjsip_dialog *dlg = NULL; + pj_status_t status; - if (acquire_call("ice_failed_nego_cb", call_id, - &call, &dlg) != PJ_SUCCESS) - { - /* Call have been terminated */ + status = acquire_call("ice_failed_nego_cb", call_id, &call, &dlg); + if (status != PJ_SUCCESS) { + if (status != PJSIP_ESESSIONTERMINATED) { + /* Retry, if call is still active */ + pjsua_schedule_timer2(&ice_failed_nego_cb, + (void*)(pj_ssize_t)call_id, 10); + } return; } - pjsua_var.ua_cfg.cb.on_call_media_state(call_id); + if (!call->hanging_up) + pjsua_var.ua_cfg.cb.on_call_media_state(call_id); if (dlg) pjsip_dlg_dec_lock(dlg); @@ -823,12 +848,24 @@ } else { call_med->state = PJSUA_CALL_MEDIA_ERROR; call_med->dir = PJMEDIA_DIR_NONE; - if (call && pjsua_var.ua_cfg.cb.on_call_media_state) { + if (call && !call->hanging_up && + pjsua_var.ua_cfg.cb.on_call_media_state) + { /* Defer the callback to a timer */ pjsua_schedule_timer2(&ice_failed_nego_cb, (void*)(pj_ssize_t)call->index, 1); } } + + /* Stop trickling */ + if (call->trickle_ice.trickling < PJSUA_OP_STATE_DONE) { + call->trickle_ice.trickling = PJSUA_OP_STATE_DONE; + pjsua_cancel_timer(&call->trickle_ice.timer); + PJ_LOG(4,(THIS_FILE, "Call %d: ICE trickle stopped trickling as " + "ICE nego completed", + call->index)); + } + /* Check if default ICE transport address is changed */ call->reinv_ice_sent = PJ_FALSE; pjsua_call_schedule_reinvite_check(call, 0); @@ -840,7 +877,9 @@ "ICE keep alive failure for transport %d:%d", call->index, call_med->idx)); } - if (pjsua_var.ua_cfg.cb.on_call_media_transport_state) { + if (!call->hanging_up && + pjsua_var.ua_cfg.cb.on_call_media_transport_state) + { pjsua_med_tp_state_info info; pj_bzero(&info, sizeof(info)); @@ -903,6 +942,8 @@ unsigned comp_cnt; pj_status_t status; pj_bool_t use_ipv6, use_nat64; + pj_bool_t trickle = PJ_FALSE; + pjmedia_sdp_session *rem_sdp; acc_cfg = &pjsua_var.acc[call_med->call->acc_id].cfg; use_ipv6 = (acc_cfg->ipv6_media_use != PJSUA_IPV6_DISABLED); @@ -932,15 +973,16 @@ ice_cfg.resolver = pjsua_var.resolver; ice_cfg.opt = acc_cfg->ice_cfg.ice_opt; + rem_sdp = call_med->call->async_call.rem_sdp; - if (call_med->call->async_call.rem_sdp) { + if (rem_sdp) { /* Match the default address family according to the offer */ const pj_str_t ID_IP6 = { "IP6", 3}; const pjmedia_sdp_media *m; const pjmedia_sdp_conn *c; - m = call_med->call->async_call.rem_sdp->media[call_med->idx]; - c = m->conn? m->conn : call_med->call->async_call.rem_sdp->conn; + m = rem_sdp->media[call_med->idx]; + c = m->conn? m->conn : rem_sdp->conn; if (pj_stricmp(&c->addr_type, &ID_IP6) == 0) ice_cfg.af = pj_AF_INET6(); @@ -948,6 +990,31 @@ ice_cfg.af = pj_AF_INET6(); } + /* Should not wait for ICE STUN/TURN ready when trickle ICE is enabled */ + if (ice_cfg.opt.trickle != PJ_ICE_SESS_TRICKLE_DISABLED && + (call_med->call->inv == NULL || + call_med->call->inv->state < PJSIP_INV_STATE_CONFIRMED)) + { + if (rem_sdp) { + /* As answerer: and when remote signals trickle ICE in SDP */ + trickle = pjmedia_ice_sdp_has_trickle(rem_sdp, call_med->idx); + if (trickle) { + call_med->call->trickle_ice.remote_sup = PJ_TRUE; + call_med->call->trickle_ice.enabled = PJ_TRUE; + } + } else { + /* As offerer: and when trickle ICE mode is full */ + trickle = (ice_cfg.opt.trickle==PJ_ICE_SESS_TRICKLE_FULL); + call_med->call->trickle_ice.enabled = PJ_TRUE; + } + + /* Check if trickle ICE can start trickling/sending SIP INFO */ + pjsua_ice_check_start_trickling(call_med->call, PJ_FALSE, NULL); + } else { + /* For non-initial INVITE, always use regular ICE */ + ice_cfg.opt.trickle = PJ_ICE_SESS_TRICKLE_DISABLED; + } + /* If STUN transport is configured, initialize STUN transport settings */ if ((pj_sockaddr_has_addr(&pjsua_var.stun_srv) && pjsua_media_acc_is_using_stun(call_med->call->acc_id)) || @@ -1092,15 +1159,15 @@ pj_bzero(&ice_cb, sizeof(pjmedia_ice_cb)); ice_cb.on_ice_complete = &on_ice_complete; pj_ansi_snprintf(name, sizeof(name), "icetp%02d", call_med->idx); - call_med->tp_ready = PJ_EPENDING; + call_med->tp_ready = trickle? PJ_SUCCESS : PJ_EPENDING; comp_cnt = 1; if (PJMEDIA_ADVERTISE_RTCP && !acc_cfg->ice_cfg.ice_no_rtcp) ++comp_cnt; status = pjmedia_ice_create3(pjsua_var.med_endpt, name, comp_cnt, - &ice_cfg, &ice_cb, 0, call_med, - &call_med->tp); + &ice_cfg, &ice_cb, PJSUA_ICE_TRANSPORT_OPTION, + call_med, &call_med->tp); if (status != PJ_SUCCESS) { pjsua_perror(THIS_FILE, "Unable to create ICE media transport", status); @@ -1108,7 +1175,7 @@ } /* Wait until transport is initialized, or time out */ - if (!async) { + if (!async && !trickle) { pj_bool_t has_pjsua_lock = PJSUA_LOCK_IS_LOCKED(); pjsip_dialog *dlg = call_med->call->inv ? call_med->call->inv->dlg : NULL; @@ -1501,6 +1568,20 @@ return status; } +/* Call on_call_media_event() callback using timer */ +void call_med_event_cb(void *user_data) +{ + pjsua_event_list *eve = (pjsua_event_list *)user_data; + + (*pjsua_var.ua_cfg.cb.on_call_media_event)(eve->call_id, + eve->med_idx, + &eve->event); + + pj_mutex_lock(pjsua_var.timer_mutex); + pj_list_push_back(&pjsua_var.event_list, eve); + pj_mutex_unlock(pjsua_var.timer_mutex); +} + /* Callback to receive media events of a call */ pj_status_t call_media_on_event(pjmedia_event *event, void *user_data) @@ -1510,7 +1591,6 @@ char ev_name[5]; pj_status_t status = PJ_SUCCESS; - pj_assert(call && call_med); pjmedia_fourcc_name(event->type, ev_name); PJ_LOG(5,(THIS_FILE, "Call %d: Media %d: Received media event, type=%s, " "src=%p, epub=%p", @@ -1559,11 +1639,10 @@ if (call_med->strm.v.rdr_win_id != PJSUA_INVALID_ID) { pjsua_vid_win *w = &pjsua_var.win[call_med->strm.v.rdr_win_id]; if (event->epub == w->vp_rend) { - /* Renderer just changed format, reconnect stream */ - pjsua_vid_conf_disconnect(call_med->strm.v.strm_dec_slot, - w->rend_slot); - pjsua_vid_conf_connect(call_med->strm.v.strm_dec_slot, - w->rend_slot, NULL); + /* Renderer just changed format, update its + * conference bridge port. + */ + pjsua_vid_conf_update_port(w->rend_slot); } } @@ -1571,10 +1650,7 @@ /* Stream decoder changed format, update all conf listeners * by reconnecting. */ - pjsua_conf_port_id dec_pid = call_med->strm.v.strm_dec_slot; pjmedia_port *strm_dec; - pjsua_vid_conf_port_info pi; - unsigned i; status = pjmedia_vid_stream_get_port(call_med->strm.v.stream, PJMEDIA_DIR_DECODING, @@ -1586,14 +1662,10 @@ if (event->epub != strm_dec) break; - status = pjsua_vid_conf_get_port_info(dec_pid, &pi); - if (status != PJ_SUCCESS) - break; - - for (i = 0; i < pi.listener_cnt; i++) { - pjsua_vid_conf_disconnect(dec_pid, pi.listeners[i]); - pjsua_vid_conf_connect(dec_pid, pi.listeners[i], NULL); - } + /* Stream decoder just changed format, update its + * conference bridge port. + */ + pjsua_vid_conf_update_port(call_med->strm.v.strm_dec_slot); } break; @@ -1612,14 +1684,32 @@ } if (pjsua_var.ua_cfg.cb.on_call_media_event) { - if (call) { - (*pjsua_var.ua_cfg.cb.on_call_media_event)(call->index, - call_med->idx, event); - } else { + pjsua_event_list *eve = NULL; + + pj_mutex_lock(pjsua_var.timer_mutex); + + if (pj_list_empty(&pjsua_var.event_list)) { + eve = PJ_POOL_ALLOC_T(pjsua_var.timer_pool, pjsua_event_list); + } else { + eve = pjsua_var.event_list.next; + pj_list_erase(eve); + } + + pj_mutex_unlock(pjsua_var.timer_mutex); + + if (call) { + if (call->hanging_up) + return status; + + eve->call_id = call->index; + eve->med_idx = call_med->idx; + } else { /* Also deliver non call events such as audio device error */ - (*pjsua_var.ua_cfg.cb.on_call_media_event)(PJSUA_INVALID_ID, - 0, event); - } + eve->call_id = PJSUA_INVALID_ID; + eve->med_idx = 0; + } + pj_memcpy(&eve->event, event, sizeof(pjmedia_event)); + pjsua_schedule_timer2(&call_med_event_cb, eve, 1); } return status; @@ -1629,7 +1719,8 @@ void pjsua_set_media_tp_state(pjsua_call_media *call_med, pjsua_med_tp_st tp_st) { - if (pjsua_var.ua_cfg.cb.on_call_media_transport_state && + if (!call_med->call->hanging_up && + pjsua_var.ua_cfg.cb.on_call_media_transport_state && call_med->tp_st != tp_st) { pjsua_med_tp_state_info info; @@ -1664,7 +1755,9 @@ if (result != PJ_SUCCESS) { call_med->state = PJSUA_CALL_MEDIA_ERROR; call_med->dir = PJMEDIA_DIR_NONE; - if (call && pjsua_var.ua_cfg.cb.on_call_media_state) { + if (call && !call->hanging_up && + pjsua_var.ua_cfg.cb.on_call_media_state) + { /* Defer the callback to a timer */ pjsua_schedule_timer2(&ice_failed_nego_cb, (void*)(pj_ssize_t)call->index, 1); @@ -1978,8 +2071,11 @@ call->med_ch_info.status = status; call->med_ch_info.sip_err_code = PJSIP_SC_TEMPORARILY_UNAVAILABLE; } - pjsua_media_prov_clean_up(call_id); - goto on_return; + + /* Revert back provisional media. */ + pjsua_media_prov_revert(call_id); + + goto on_return; } /* Tell the media transport of a new offer/answer session */ @@ -2021,7 +2117,10 @@ call->med_ch_info.med_idx = mi; call->med_ch_info.state = call_med->tp_st; call->med_ch_info.sip_err_code = PJSIP_SC_TEMPORARILY_UNAVAILABLE; - pjsua_media_prov_clean_up(call_id); + + /* Revert back provisional media. */ + pjsua_media_prov_revert(call_id); + goto on_return; } @@ -2079,7 +2178,24 @@ } } - call->med_prov_cnt = 0; + // Cleaning up unused media transports should not change provisional + // media count. + //call->med_prov_cnt = 0; +} + + +/* Revert back provisional media. */ +void pjsua_media_prov_revert(pjsua_call_id call_id) +{ + pjsua_call *call = &pjsua_var.calls[call_id]; + + /* Clean up unused media transport */ + pjsua_media_prov_clean_up(call_id); + + /* Copy provisional media from active media */ + pj_memcpy(call->media_prov, call->media, + sizeof(call->media[0]) * call->med_cnt); + call->med_prov_cnt = call->med_cnt; } @@ -2347,6 +2463,16 @@ } } + if (call->opt.flag & PJSUA_CALL_SET_MEDIA_DIR) { + call_med->def_dir = call->opt.media_dir[mi]; + PJ_LOG(4,(THIS_FILE, "Call %d: setting media direction " + "#%d to %d.", call_id, mi, + call_med->def_dir)); + } else if (!reinit) { + /* Initialize default initial media direction as bidirectional */ + call_med->def_dir = PJMEDIA_DIR_ENCODING_DECODING; + } + if (enabled) { call_med->enable_rtcp_mux = acc->cfg.enable_rtcp_mux; @@ -2373,9 +2499,26 @@ return PJ_EPENDING; } - pjsua_media_prov_clean_up(call_id); + /* Revert back provisional media. */ + pjsua_media_prov_revert(call_id); + goto on_error; } + + /* Find and save "a=mid". Currently this is for trickle ICE. + * Trickle ICE match media in SDP of SIP INFO by comparing this + * attribute, so remote SDP must be received first before remote + * SDP in SIP INFO can be processed. + */ + if (rem_sdp && call_med->rem_mid.slen == 0) { + const pjmedia_sdp_media *m = rem_sdp->media[mi]; + pjmedia_sdp_attr *a; + + a = pjmedia_sdp_media_find_attr2(m, "mid", NULL); + if (a) + call_med->rem_mid = a->value; + } + } else { /* By convention, the media is disabled if transport is NULL * or transport state is PJSUA_MED_TP_DISABLED. @@ -2541,6 +2684,7 @@ pjsua_call_media *call_med = &call->media_prov[mi]; pjmedia_sdp_media *m = NULL; pjmedia_transport_info tpinfo; + pjmedia_endpt_create_sdp_param param; unsigned i; if (rem_sdp && mi >= rem_sdp->media_count) { @@ -2636,15 +2780,19 @@ pjmedia_transport_get_info(call_med->tp, &tpinfo); /* Ask pjmedia endpoint to create SDP media line */ + pjmedia_endpt_create_sdp_param_default(¶m); + param.dir = call_med->def_dir; switch (call_med->type) { case PJMEDIA_TYPE_AUDIO: status = pjmedia_endpt_create_audio_sdp(pjsua_var.med_endpt, pool, - &tpinfo.sock_info, 0, &m); + &tpinfo.sock_info, + ¶m, &m); break; #if defined(PJMEDIA_HAS_VIDEO) && (PJMEDIA_HAS_VIDEO != 0) case PJMEDIA_TYPE_VIDEO: status = pjmedia_endpt_create_video_sdp(pjsua_var.med_endpt, pool, - &tpinfo.sock_info, 0, &m); + &tpinfo.sock_info, + ¶m, &m); break; #endif default: @@ -2655,13 +2803,24 @@ if (status != PJ_SUCCESS) goto on_error; + /* Add generated media to SDP session */ + sdp->media[sdp->media_count++] = m; + + /* Disable media if it has zero format/codec */ + if (m->desc.fmt_count == 0) { + m->desc.fmt[m->desc.fmt_count++] = pj_str("0"); + pjmedia_sdp_media_deactivate(pool, m); + PJ_LOG(3,(THIS_FILE, + "Call %d media %d: Disabled due to no active codec", + call_id, mi)); + continue; + } + /* Add ssrc and cname attribute */ m->attr[m->attr_count++] = pjmedia_sdp_attr_create_ssrc(pool, call_med->ssrc, &call->cname); - sdp->media[sdp->media_count++] = m; - /* Give to transport */ status = pjmedia_transport_encode_sdp(call_med->tp, pool, sdp, rem_sdp, mi); @@ -2748,6 +2907,19 @@ } } } + + /* Find and save "a=mid". Currently this is for trickle ICE. Trickle + * ICE match media in SDP of SIP INFO by comparing this attribute, + * so remote SDP must be received first before remote SDP in SIP INFO + * can be processed. + */ + if (call_med->rem_mid.slen == 0) { + pjmedia_sdp_attr *a; + + a = pjmedia_sdp_media_find_attr2(m, "mid", NULL); + if (a) + call_med->rem_mid = a->value; + } } /* Add NAT info in the SDP */ @@ -2850,7 +3022,7 @@ call->rem_offerer = (rem_sdp != NULL); /* Notify application */ - if (pjsua_var.ua_cfg.cb.on_call_sdp_created) { + if (!call->hanging_up && pjsua_var.ua_cfg.cb.on_call_sdp_created) { (*pjsua_var.ua_cfg.cb.on_call_sdp_created)(call_id, sdp, pool, rem_sdp); } @@ -2882,6 +3054,7 @@ pj_log_push_indent(); + call_med->prev_type = call_med->type; if (call_med->type == PJMEDIA_TYPE_AUDIO) { pjsua_aud_stop_stream(call_med); } @@ -2912,6 +3085,11 @@ prov_med->rtp_tx_seq = call_med->rtp_tx_seq; prov_med->rtp_tx_ts = call_med->rtp_tx_ts; + /* Saved media type and stream info */ + prov_med->prev_type = call_med->prev_type; + prov_med->prev_aud_si = call_med->prev_aud_si; + prov_med->prev_vid_si = call_med->prev_vid_si; + /* Stream */ if (call_med->type == PJMEDIA_TYPE_AUDIO) { prov_med->strm.a.conf_slot = call_med->strm.a.conf_slot; @@ -2939,9 +3117,63 @@ } } + +/* + * Print log of call states. Since call states may be too long for logger, + * printing it is a bit tricky, it should be printed part by part as long + * as the logger can accept. + */ +static void log_call_dump(int call_id) +{ + pj_pool_t *pool; + unsigned call_dump_len; + unsigned part_len; + unsigned part_idx; + unsigned log_decor; + char *buf; + enum { BUF_LEN = 10*1024 }; + pj_status_t status; + + pool = pjsua_pool_create("tmp", 1024, 1024); + buf = pj_pool_alloc(pool, sizeof(char) * BUF_LEN); + + status = pjsua_call_dump(call_id, PJ_TRUE, buf, BUF_LEN, " "); + if (status != PJ_SUCCESS) + goto on_return; + + call_dump_len = (unsigned)pj_ansi_strlen(buf); + + log_decor = pj_log_get_decor(); + pj_log_set_decor(log_decor & ~(PJ_LOG_HAS_NEWLINE | PJ_LOG_HAS_CR)); + PJ_LOG(3,(THIS_FILE, "\n")); + pj_log_set_decor(0); + + part_idx = 0; + part_len = PJ_LOG_MAX_SIZE-80; + while (part_idx < call_dump_len) { + char p_orig, *p; + + p = buf + part_idx; + if (part_idx + part_len > call_dump_len) + part_len = call_dump_len - part_idx; + p_orig = p[part_len]; + p[part_len] = '\0'; + PJ_LOG(3,(THIS_FILE, "%s", p)); + p[part_len] = p_orig; + part_idx += part_len; + } + pj_log_set_decor(log_decor); + +on_return: + if (pool) + pj_pool_release(pool); +} + + pj_status_t pjsua_media_channel_deinit(pjsua_call_id call_id) { pjsua_call *call = &pjsua_var.calls[call_id]; + pjsip_dialog *dlg; unsigned mi; for (mi=0; mimed_cnt; ++mi) { @@ -2959,8 +3191,23 @@ PJ_LOG(4,(THIS_FILE, "Call %d: deinitializing media..", call_id)); pj_log_push_indent(); + /* Print call dump first */ + dlg = (call->inv? call->inv->dlg : call->async_call.dlg); + if (dlg) + log_call_dump(call_id); + stop_media_session(call_id); + /* Stop trickle ICE timer */ + if (call->trickle_ice.trickling > PJSUA_OP_STATE_NULL) { + call->trickle_ice.trickling = PJSUA_OP_STATE_NULL; + pjsua_cancel_timer(&call->trickle_ice.timer); + } + call->trickle_ice.enabled = PJ_FALSE; + call->trickle_ice.pending_info = PJ_FALSE; + call->trickle_ice.remote_sup = PJ_FALSE; + call->trickle_ice.retrans18x_count = 0; + /* Clean up media transports */ pjsua_media_prov_clean_up(call_id); call->med_prov_cnt = 0; @@ -2968,6 +3215,40 @@ pjsua_call_media *call_med = &call->media[mi]; if (call_med->tp_st > PJSUA_MED_TP_IDLE) { + pjmedia_transport_info tpinfo; + pjmedia_srtp_info *srtp_info; + pjmedia_ice_transport_info *ice_info; + + pjmedia_transport_info_init(&tpinfo); + pjmedia_transport_get_info(call_med->tp, &tpinfo); + srtp_info = (pjmedia_srtp_info *) + pjmedia_transport_info_get_spc_info( + &tpinfo, PJMEDIA_TRANSPORT_TYPE_SRTP); + ice_info = (pjmedia_ice_transport_info *) + pjmedia_transport_info_get_spc_info( + &tpinfo, PJMEDIA_TRANSPORT_TYPE_ICE); + + call_med->prev_srtp_use = (srtp_info && srtp_info->active)? + PJ_TRUE: PJ_FALSE; + if (call_med->prev_srtp_use) + call_med->prev_srtp_info = *srtp_info; + call_med->prev_ice_use = (ice_info && ice_info->active)? + PJ_TRUE: PJ_FALSE; + if (call_med->prev_ice_use) + call_med->prev_ice_info = *ice_info; + + /* Try to sync recent changes to provisional media */ + if (mi < call->med_prov_cnt && + call->media_prov[mi].tp == call_med->tp) + { + pjsua_call_media *prov_med = &call->media_prov[mi]; + + prov_med->prev_ice_use = call_med->prev_ice_use; + prov_med->prev_ice_info = call_med->prev_ice_info; + prov_med->prev_srtp_use = call_med->prev_srtp_use; + prov_med->prev_srtp_info = call_med->prev_srtp_info; + } + pjsua_set_media_tp_state(call_med, PJSUA_MED_TP_IDLE); pjmedia_transport_media_stop(call_med->tp); } @@ -2978,6 +3259,7 @@ call_med->tp = call_med->tp_orig = NULL; } call_med->tp_orig = NULL; + call_med->rem_srtp_use = PJMEDIA_SRTP_UNKNOWN; } pj_log_pop_indent(); @@ -3021,6 +3303,195 @@ } +#if defined(PJMEDIA_HAS_SRTP) && (PJMEDIA_HAS_SRTP != 0) + +static void check_srtp_roc(pjsua_call *call, + unsigned med_idx, + const pjsua_stream_info *new_si_, + const pjmedia_sdp_media *local_sdp, + const pjmedia_sdp_media *remote_sdp) +{ + pjsua_call_media *call_med = &call->media[med_idx]; + pjmedia_transport_info tpinfo; + pjmedia_srtp_info *srtp_info; + pjmedia_ice_transport_info *ice_info; + const pjmedia_stream_info *prev_aud_si = NULL; + pjmedia_stream_info aud_si; +#if defined(PJMEDIA_HAS_VIDEO) && (PJMEDIA_HAS_VIDEO != 0) + const pjmedia_vid_stream_info *prev_vid_si = NULL; + pjmedia_vid_stream_info vid_si; +#endif + pj_bool_t local_change = PJ_FALSE, rem_change = PJ_FALSE; + pjmedia_srtp_setting setting; + + pjmedia_transport_info_init(&tpinfo); + pjmedia_transport_get_info(call_med->tp, &tpinfo); + srtp_info = (pjmedia_srtp_info *) pjmedia_transport_info_get_spc_info( + &tpinfo, PJMEDIA_TRANSPORT_TYPE_SRTP); + /* We are not using SRTP. */ + if (!srtp_info) + return; + + ice_info = (pjmedia_ice_transport_info*) + pjmedia_transport_info_get_spc_info(&tpinfo, + PJMEDIA_TRANSPORT_TYPE_ICE); + + /* RFC 3711 section 3.3.1: + * After a re-keying occurs (changing to a new master key), the rollover + * counter always maintains its sequence of values, i.e., it MUST NOT be + * reset to zero. + * + * RFC 4568 section 7.1.4: + * If the offerer includes an IP address and/or port that differs from + * that used previously for a media stream (or FEC stream), the offerer + * MUST include a new master key with the offer (and in so doing, it + * will be creating a new crypto context where the ROC is set to zero). + * Similarly, if the answerer includes an IP address and/or port that + * differs from that used previously for a media stream (or FEC stream), + * the answerer MUST include a new master key with the answer (and hence + * create a new crypto context with the ROC set to zero). + */ + if (call->opt.flag & PJSUA_CALL_REINIT_MEDIA) { + if (!call_med->prev_srtp_use) return; + + /* The stream has been deinitialized by now, so we need to retrieve + * the previous stream info from the stored data. + */ + if (call_med->prev_type == PJMEDIA_TYPE_AUDIO) + prev_aud_si = &call_med->prev_aud_si; +#if defined(PJMEDIA_HAS_VIDEO) && (PJMEDIA_HAS_VIDEO != 0) + else if (call_med->prev_type == PJMEDIA_TYPE_VIDEO) + prev_vid_si = &call_med->prev_vid_si; +#endif + } else { + call_med->prev_srtp_use = PJ_TRUE; + call_med->prev_srtp_info = *srtp_info; + call_med->prev_ice_use = (ice_info && ice_info->active)? + PJ_TRUE: PJ_FALSE; + if (call_med->prev_ice_use) + call_med->prev_ice_info = *ice_info; + + if (call_med->type == PJMEDIA_TYPE_AUDIO) { + /* Get current active audio stream info */ + if (call_med->strm.a.stream) { + pjmedia_stream_get_info(call_med->strm.a.stream, &aud_si); + prev_aud_si = &aud_si; + } + } +#if defined(PJMEDIA_HAS_VIDEO) && (PJMEDIA_HAS_VIDEO != 0) + else if (call_med->type == PJMEDIA_TYPE_VIDEO) { + /* Get current active video stream info */ + if (call_med->strm.v.stream) { + pjmedia_vid_stream_get_info(call_med->strm.v.stream, &vid_si); + prev_vid_si = &vid_si; + } + } +#endif + } + +#if 0 + PJ_LOG(4, (THIS_FILE, "SRTP TX ROC %d %d", + call_med->prev_srtp_info.tx_roc.ssrc, + call_med->prev_srtp_info.tx_roc.roc)); + PJ_LOG(4, (THIS_FILE, "SRTP RX ROC %d %d", + call_med->prev_srtp_info.rx_roc.ssrc, + call_med->prev_srtp_info.rx_roc.roc)); +#endif + + if (prev_aud_si) { + const pjmedia_stream_info *new_si = &new_si_->info.aud; + + /* Local IP address changes */ + if (pj_sockaddr_cmp(&prev_aud_si->local_addr, &new_si->local_addr)) + local_change = PJ_TRUE; + /* Remote IP address changes */ + if (pj_sockaddr_cmp(&prev_aud_si->rem_addr, &new_si->rem_addr)) + rem_change = PJ_TRUE; + } +#if defined(PJMEDIA_HAS_VIDEO) && (PJMEDIA_HAS_VIDEO != 0) + if (prev_vid_si) { + const pjmedia_vid_stream_info *new_si = &new_si_->info.vid; + + /* Local IP address changes */ + if (pj_sockaddr_cmp(&prev_vid_si->local_addr, &new_si->local_addr)) + local_change = PJ_TRUE; + /* Remote IP address changes */ + if (pj_sockaddr_cmp(&prev_vid_si->rem_addr, &new_si->rem_addr)) + rem_change = PJ_TRUE; + } +#endif + + /* There are some complications if we are using ICE, because default + * IP address can change after negotiation. In this case, we'll consider + * this as a change of IP address only if ICE is restarted as well + * (i.e. if ufrag changes). + */ + if (ice_info && call_med->prev_ice_use) { + const pj_str_t STR_ICE_UFRAG = { "ice-ufrag", 9 }; + pjmedia_sdp_attr *attr; + + if (local_change) { + attr = pjmedia_sdp_attr_find(local_sdp->attr_count, + local_sdp->attr, &STR_ICE_UFRAG, + NULL); + if (!pj_strcmp(&call_med->prev_ice_info.loc_ufrag, + &attr->value)) + { + PJ_LOG(4, (THIS_FILE, "ICE unchanged, SRTP TX ROC " + "maintained")); + local_change = PJ_FALSE; + } + } + + if (rem_change) { + attr = pjmedia_sdp_attr_find(remote_sdp->attr_count, + remote_sdp->attr, &STR_ICE_UFRAG, + NULL); + if (!pj_strcmp(&call_med->prev_ice_info.rem_ufrag, + &attr->value)) + { + PJ_LOG(4, (THIS_FILE, "ICE unchanged, SRTP RX ROC " + "maintained")); + rem_change = PJ_FALSE; + } + } + } + + pjmedia_transport_srtp_get_setting(call_med->tp, &setting); + setting.tx_roc = call_med->prev_srtp_info.tx_roc; + setting.rx_roc = call_med->prev_srtp_info.rx_roc; + if (local_change) { + PJ_LOG(4, (THIS_FILE, "Local address change detected, " + "resetting SRTP TX ROC")); + setting.tx_roc.roc = 0; + /* Depending on the interpretation of the RFC, remote + * may or may not reset its ROC as well. So we anticipate both. + */ + setting.prev_rx_roc = call_med->prev_srtp_info.rx_roc; + setting.prev_rx_roc.roc = 0; + } + if (rem_change) { + PJ_LOG(4, (THIS_FILE, "Remote address change detected, " + "resetting SRTP RX ROC")); + setting.rx_roc.roc = 0; + /* There is a possibility that remote's IP address in the SDP + * changes, but its actual IP address actually doesn't change, + * such as when using ICE. So the only thing we can do here + * is to anticipate if remote doesn't reset the ROC. + */ + setting.prev_rx_roc = call_med->prev_srtp_info.rx_roc; +#if PJSUA_RESET_SRTP_ROC_ON_REM_ADDRESS_CHANGE + if (!local_change) { + PJ_LOG(4, (THIS_FILE, "Remote address change detected, " + "resetting SRTP TX ROC")); + setting.tx_roc.roc = 0; + } +#endif + } + pjmedia_transport_srtp_modify_setting(call_med->tp, &setting); +} +#endif + static pj_bool_t is_media_changed(const pjsua_call *call, unsigned med_idx, const pjsua_stream_info *new_si_) @@ -3060,12 +3531,13 @@ return (new_si->dir != PJMEDIA_DIR_NONE); } + if (old_si->rtcp_mux != new_si->rtcp_mux) + return PJ_TRUE; + /* Compare remote RTP address. If ICE is running, change in default * address can happen after negotiation, this can be handled * internally by ICE and does not need to cause media restart. */ - if (old_si->rtcp_mux != new_si->rtcp_mux) - return PJ_TRUE; if (!is_ice_running(call_med->tp) && pj_sockaddr_cmp(&old_si->rem_addr, &new_si->rem_addr)) { @@ -3293,7 +3765,11 @@ /* Process each media stream */ for (mi=0; mi < call->med_cnt; ++mi) { - pjsua_call_media *call_med = &call->media[mi]; + const char *STR_SENDRECV = "sendrecv"; + const char *STR_SENDONLY = "sendonly"; + const char *STR_RECVONLY = "recvonly"; + const char *STR_INACTIVE = "inactive"; + pjsua_call_media *call_med = &call->media[mi]; pj_bool_t media_changed = PJ_FALSE; if (mi >= local_sdp->media_count || @@ -3361,9 +3837,73 @@ si->param->setting.vad = 0; } - /* Check if this media is changed */ + if (!pjmedia_sdp_neg_was_answer_remote(call->inv->neg) && + si->dir != PJMEDIA_DIR_NONE) + { + pjmedia_dir dir = si->dir; + + if (call->opt.flag & PJSUA_CALL_SET_MEDIA_DIR) { + call_med->def_dir = call->opt.media_dir[mi]; + PJ_LOG(4,(THIS_FILE, "Call %d: setting audio media " + "direction #%d to %d.", + call_id, mi, call_med->def_dir)); + } + + /* If the default direction specifies we do not wish + * encoding/decoding, clear that direction. + */ + if ((call_med->def_dir & PJMEDIA_DIR_ENCODING) == 0) { + dir &= ~PJMEDIA_DIR_ENCODING; + } + if ((call_med->def_dir & PJMEDIA_DIR_DECODING) == 0) { + dir &= ~PJMEDIA_DIR_DECODING; + } + + if (dir != si->dir) { + const char *str_attr = NULL; + pjmedia_sdp_attr *attr; + pjmedia_sdp_media *m; + + if (!need_renego_sdp) { + pjmedia_sdp_session *local_sdp_renego; + local_sdp_renego = + pjmedia_sdp_session_clone(tmp_pool, local_sdp); + local_sdp = local_sdp_renego; + need_renego_sdp = PJ_TRUE; + } + + si->dir = dir; + m = local_sdp->media[mi]; + + /* Remove existing directions attributes */ + pjmedia_sdp_media_remove_all_attr(m, STR_SENDRECV); + pjmedia_sdp_media_remove_all_attr(m, STR_SENDONLY); + pjmedia_sdp_media_remove_all_attr(m, STR_RECVONLY); + + if (si->dir == PJMEDIA_DIR_ENCODING_DECODING) { + str_attr = STR_SENDRECV; + } else if (si->dir == PJMEDIA_DIR_ENCODING) { + str_attr = STR_SENDONLY; + } else if (si->dir == PJMEDIA_DIR_DECODING) { + str_attr = STR_RECVONLY; + } else { + str_attr = STR_INACTIVE; + } + attr = pjmedia_sdp_attr_create(tmp_pool, str_attr, NULL); + pjmedia_sdp_media_add_attr(m, attr); + } + } + stream_info.type = PJMEDIA_TYPE_AUDIO; stream_info.info.aud = the_si; + +#if defined(PJMEDIA_HAS_SRTP) && (PJMEDIA_HAS_SRTP != 0) + /* Check if we need to reset or maintain SRTP ROC */ + check_srtp_roc(call, mi, &stream_info, + local_sdp->media[mi], remote_sdp->media[mi]); +#endif + + /* Check if this media is changed */ if (pjsua_var.media_cfg.no_smart_media_update || is_media_changed(call, mi, &stream_info)) { @@ -3538,6 +4078,63 @@ si->rtcp_mux = PJ_FALSE; } + if (!pjmedia_sdp_neg_was_answer_remote(call->inv->neg) && + si->dir != PJMEDIA_DIR_NONE) + { + pjmedia_dir dir = si->dir; + + if (call->opt.flag & PJSUA_CALL_SET_MEDIA_DIR) { + call_med->def_dir = call->opt.media_dir[mi]; + PJ_LOG(4,(THIS_FILE, "Call %d: setting video media " + "direction #%d to %d.", + call_id, mi, call_med->def_dir)); + } + + /* If the default direction specifies we do not wish + * encoding/decoding, clear that direction. + */ + if ((call_med->def_dir & PJMEDIA_DIR_ENCODING) == 0) { + dir &= ~PJMEDIA_DIR_ENCODING; + } + if ((call_med->def_dir & PJMEDIA_DIR_DECODING) == 0) { + dir &= ~PJMEDIA_DIR_DECODING; + } + + if (dir != si->dir) { + const char *str_attr = NULL; + pjmedia_sdp_attr *attr; + pjmedia_sdp_media *m; + + if (!need_renego_sdp) { + pjmedia_sdp_session *local_sdp_renego; + local_sdp_renego = + pjmedia_sdp_session_clone(tmp_pool, local_sdp); + local_sdp = local_sdp_renego; + need_renego_sdp = PJ_TRUE; + } + + si->dir = dir; + m = local_sdp->media[mi]; + + /* Remove existing directions attributes */ + pjmedia_sdp_media_remove_all_attr(m, STR_SENDRECV); + pjmedia_sdp_media_remove_all_attr(m, STR_SENDONLY); + pjmedia_sdp_media_remove_all_attr(m, STR_RECVONLY); + + if (si->dir == PJMEDIA_DIR_ENCODING_DECODING) { + str_attr = STR_SENDRECV; + } else if (si->dir == PJMEDIA_DIR_ENCODING) { + str_attr = STR_SENDONLY; + } else if (si->dir == PJMEDIA_DIR_DECODING) { + str_attr = STR_RECVONLY; + } else { + str_attr = STR_INACTIVE; + } + attr = pjmedia_sdp_attr_create(tmp_pool, str_attr, NULL); + pjmedia_sdp_media_add_attr(m, attr); + } + } + /* Check if this media is changed */ stream_info.type = PJMEDIA_TYPE_VIDEO; stream_info.info.vid = the_si; @@ -3596,7 +4193,7 @@ call_med->rem_srtp_use = srtp_info->peer_use; } - /* Update audio channel */ + /* Update video channel */ if (media_changed) { status = pjsua_vid_channel_update(call_med, call->inv->pool, si, diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip/src/pjsua-lib/pjsua_vid.c asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip/src/pjsua-lib/pjsua_vid.c --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip/src/pjsua-lib/pjsua_vid.c 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip/src/pjsua-lib/pjsua_vid.c 2022-02-24 07:54:38.000000000 +0000 @@ -34,6 +34,10 @@ static pjsua_vid_win_id vid_preview_get_win(pjmedia_vid_dev_index id, pj_bool_t running_only); static void free_vid_win(pjsua_vid_win_id wid); +static pj_status_t media_event_unsubscribe(pjmedia_event_mgr* mgr, + pjmedia_event_cb* cb, + void* user_data, + void* epub); /***************************************************************************** * pjsua video subsystem. @@ -85,6 +89,15 @@ } #endif +#if PJMEDIA_HAS_VIDEO && PJMEDIA_HAS_ANDROID_MEDIACODEC + status = pjmedia_codec_and_media_vid_init(NULL, &pjsua_var.cp.factory); + if (status != PJ_SUCCESS) { + pjsua_perror(THIS_FILE, "Error initializing AMediaCodec library", + status); + goto on_error; + } +#endif + #if PJMEDIA_HAS_VIDEO && PJMEDIA_HAS_OPENH264_CODEC status = pjmedia_codec_openh264_vid_init(NULL, &pjsua_var.cp.factory); if (status != PJ_SUCCESS) { @@ -111,12 +124,15 @@ } #endif +#if !defined(PJSUA_DONT_INIT_VID_DEV_SUBSYS) || \ + PJSUA_DONT_INIT_VID_DEV_SUBSYS==0 status = pjmedia_vid_dev_subsys_init(&pjsua_var.cp.factory); if (status != PJ_SUCCESS) { pjsua_perror(THIS_FILE, "Error creating PJMEDIA video subsystem", status); goto on_error; } +#endif for (i=0; iwnd, sizeof(p->wnd)); } +static pj_status_t media_event_unsubscribe(pjmedia_event_mgr* mgr, + pjmedia_event_cb* cb, + void* user_data, + void* epub) +{ + unsigned num_locks = 0; + pj_status_t status; + + /* Release locks before unsubscribing, to avoid deadlock. */ + num_locks = PJSUA_RELEASE_LOCK(); + + status = pjmedia_event_unsubscribe(mgr, cb, user_data, epub); + + /* Re-acquire the locks. */ + PJSUA_RELOCK(num_locks); + + return status; +} /***************************************************************************** * Devices. @@ -861,24 +900,31 @@ static void free_vid_win(pjsua_vid_win_id wid) { pjsua_vid_win *w = &pjsua_var.win[wid]; + unsigned num_locks = 0; PJ_LOG(4,(THIS_FILE, "Window %d: destroying..", wid)); pj_log_push_indent(); + /* Release locks before unsubscribing/destroying, to avoid deadlock. */ + num_locks = PJSUA_RELEASE_LOCK(); + if (w->vp_cap) { pjsua_vid_conf_remove_port(w->cap_slot); pjmedia_event_unsubscribe(NULL, &call_media_on_event, NULL, - w->vp_cap); + w->vp_cap); pjmedia_vid_port_stop(w->vp_cap); pjmedia_vid_port_destroy(w->vp_cap); } if (w->vp_rend) { pjsua_vid_conf_remove_port(w->rend_slot); pjmedia_event_unsubscribe(NULL, &call_media_on_event, NULL, - w->vp_rend); + w->vp_rend); pjmedia_vid_port_stop(w->vp_rend); pjmedia_vid_port_destroy(w->vp_rend); } + /* Re-acquire the locks. */ + PJSUA_RELOCK(num_locks); + pjsua_vid_win_reset(wid); pj_log_pop_indent(); @@ -917,6 +963,12 @@ call_med->strm.v.cap_dev = acc->cfg.vid_cap_dev; call_med->strm.v.strm_dec_slot = PJSUA_INVALID_ID; call_med->strm.v.strm_enc_slot = PJSUA_INVALID_ID; + /* + * pjmedia_vid_dev_get_info() will raise assertion when video device + * subsys initialization is delayed (see PJSUA_DONT_INIT_VID_DEV_SUBSYS + * or #2777). While normalizing default device IDs is not urgent + * at this point. + if (call_med->strm.v.rdr_dev == PJMEDIA_VID_DEFAULT_RENDER_DEV) { pjmedia_vid_dev_info info; pjmedia_vid_dev_get_info(call_med->strm.v.rdr_dev, &info); @@ -927,6 +979,7 @@ pjmedia_vid_dev_get_info(call_med->strm.v.cap_dev, &info); call_med->strm.v.cap_dev = info.id; } + */ return PJ_SUCCESS; } @@ -994,6 +1047,9 @@ /* Done */ inc_vid_win(wid); call_med->strm.v.cap_win_id = wid; + PJ_LOG(4,(THIS_FILE, "Call %d media %d: video capture set up with " + "dev %d, wid=%d", call_med->call->index, + call_med->idx, call_med->strm.v.cap_dev, wid)); PJSUA_UNLOCK(); @@ -1061,7 +1117,9 @@ #if defined(PJMEDIA_STREAM_ENABLE_KA) && PJMEDIA_STREAM_ENABLE_KA!=0 /* Enable/disable stream keep-alive and NAT hole punch. */ - si->use_ka = pjsua_var.acc[call->acc_id].cfg.use_stream_ka; + si->use_ka = acc->cfg.use_stream_ka; + + si->ka_cfg = acc->cfg.stream_ka_cfg; #endif /* Try to get shared format ID between the capture device and @@ -1095,6 +1153,25 @@ } } + if (!call->hanging_up && pjsua_var.ua_cfg.cb.on_stream_precreate) { + pjsua_on_stream_precreate_param prm; + prm.stream_idx = call_med->idx; + prm.stream_info.type = PJMEDIA_TYPE_VIDEO; + prm.stream_info.info.vid = *si; + (*pjsua_var.ua_cfg.cb.on_stream_precreate)(call->index, &prm); + + /* Copy back only the fields which are allowed to be changed. */ + si->jb_init = prm.stream_info.info.vid.jb_init; + si->jb_min_pre = prm.stream_info.info.vid.jb_min_pre; + si->jb_max_pre = prm.stream_info.info.vid.jb_max_pre; + si->jb_max = prm.stream_info.info.vid.jb_max; +#if defined(PJMEDIA_STREAM_ENABLE_KA) && (PJMEDIA_STREAM_ENABLE_KA != 0) + si->use_ka = prm.stream_info.info.vid.use_ka; +#endif + si->rtcp_sdes_bye_disabled = prm.stream_info.info.vid.rtcp_sdes_bye_disabled; + si->codec_param->enc_fmt = prm.stream_info.info.vid.codec_param->enc_fmt; + } + /* Create session based on session info. */ status = pjmedia_vid_stream_create(pjsua_var.med_endpt, NULL, si, call_med->tp, NULL, @@ -1197,26 +1274,26 @@ pj_log_pop_indent(); } + /* Retrieve stream encoding port */ + status = pjmedia_vid_stream_get_port(call_med->strm.v.stream, + PJMEDIA_DIR_ENCODING, + &media_port); + if (status != PJ_SUCCESS) + goto on_error; + + /* Register stream encoding to conf, using tmp_pool should be fine + * as bridge will create its own pool (using tmp_pool factory). + */ + status = pjsua_vid_conf_add_port(tmp_pool, media_port, NULL, + &call_med->strm.v.strm_enc_slot); + if (status != PJ_SUCCESS) + goto on_error; + /* Setup encoding direction */ if (si->dir & PJMEDIA_DIR_ENCODING) { PJ_LOG(4,(THIS_FILE, "Setting up TX..")); pj_log_push_indent(); - /* Retrieve stream encoding port */ - status = pjmedia_vid_stream_get_port(call_med->strm.v.stream, - PJMEDIA_DIR_ENCODING, - &media_port); - if (status != PJ_SUCCESS) - goto on_error; - - /* Register stream encoding to conf, using tmp_pool should be fine - * as bridge will create its own pool (using tmp_pool factory). - */ - status = pjsua_vid_conf_add_port(tmp_pool, media_port, NULL, - &call_med->strm.v.strm_enc_slot); - if (status != PJ_SUCCESS) - goto on_error; - if (!call->local_hold && acc->cfg.vid_out_auto_transmit) { status = setup_vid_capture(call_med); if (status != PJ_SUCCESS) @@ -1248,6 +1325,7 @@ { pjmedia_vid_stream *strm = call_med->strm.v.stream; pjmedia_rtcp_stat stat; + unsigned num_locks = 0; pj_assert(call_med->type == PJMEDIA_TYPE_VIDEO); @@ -1257,32 +1335,29 @@ PJ_LOG(4,(THIS_FILE, "Stopping video stream..")); pj_log_push_indent(); - /* Unregister video stream ports (encode+decode) from conference */ - if (call_med->strm.v.strm_enc_slot != PJSUA_INVALID_ID) { - pjsua_vid_conf_remove_port(call_med->strm.v.strm_enc_slot); - call_med->strm.v.strm_enc_slot = PJSUA_INVALID_ID; - } - if (call_med->strm.v.strm_dec_slot != PJSUA_INVALID_ID) { - pjsua_vid_conf_remove_port(call_med->strm.v.strm_dec_slot); - call_med->strm.v.strm_dec_slot = PJSUA_INVALID_ID; - } + pjmedia_vid_stream_get_info(strm, &call_med->prev_vid_si); pjmedia_vid_stream_send_rtcp_bye(strm); - PJSUA_LOCK(); + /* Release locks before unsubscribing, to avoid deadlock. */ + while (PJSUA_LOCK_IS_LOCKED()) { + num_locks++; + PJSUA_UNLOCK(); + } + + /* Unsubscribe events first, otherwise the event callbacks + * can be called and access already destroyed objects. + */ if (call_med->strm.v.cap_win_id != PJSUA_INVALID_ID) { pjsua_vid_win *w = &pjsua_var.win[call_med->strm.v.cap_win_id]; /* Unsubscribe event */ pjmedia_event_unsubscribe(NULL, &call_media_on_event, call_med, - w->vp_cap); - - /* Decrement ref count of preview video window */ - dec_vid_win(call_med->strm.v.cap_win_id); - call_med->strm.v.cap_win_id = PJSUA_INVALID_ID; + w->vp_cap); } - if (call_med->strm.v.rdr_win_id != PJSUA_INVALID_ID) { + pj_status_t status; + pjmedia_port *media_port; pjsua_vid_win *w = &pjsua_var.win[call_med->strm.v.rdr_win_id]; /* Unsubscribe event, but stop the render first */ @@ -1290,15 +1365,116 @@ pjmedia_event_unsubscribe(NULL, &call_media_on_event, call_med, w->vp_rend); + /* Retrieve stream decoding port */ + status = pjmedia_vid_stream_get_port(strm, PJMEDIA_DIR_DECODING, + &media_port); + if (status == PJ_SUCCESS) { + pjmedia_event_unsubscribe(NULL, &call_media_on_event, + call_med, media_port); + + pjmedia_vid_port_unsubscribe_event(w->vp_rend, media_port); + } + } + /* Unsubscribe from video stream events */ + pjmedia_event_unsubscribe(NULL, &call_media_on_event, call_med, strm); + + /* Re-acquire the locks. */ + for (; num_locks > 0; num_locks--) + PJSUA_LOCK(); + + PJSUA_LOCK(); + + /* Now that we have unsubscribed from all events, we no longer + * receive future events. But we may have scheduled some timers + * to call media event callbacks, so we need to wait until those + * complete. Note that we can't cancel those timers since timer + * implementation doesn't guarantee there's no race between + * entry cancellation and the callback being called from poll. + */ + while (1) { + pjsua_timer_list *act_timer; + + act_timer = pjsua_var.active_timer_list.next; + while (act_timer != &pjsua_var.active_timer_list) { + if (act_timer->cb == &call_med_event_cb) { + pjsua_event_list *eve; + + eve = (pjsua_event_list *)act_timer->user_data; + + if (eve->call_id == (int)call_med->call->index && + eve->med_idx == call_med->idx) + { + pjsip_dialog *dlg = call_med->call->inv ? + call_med->call->inv->dlg : NULL; + + /* The function may be called from worker thread, we have + * to handle the events instead of simple sleep here + * and must not hold any lock while handling the events: + * https://trac.pjsip.org/repos/ticket/1737 + */ + num_locks = PJSUA_RELEASE_LOCK(); + + if (dlg) { + pjsip_dlg_inc_session(dlg, &pjsua_var.mod); + pjsip_dlg_dec_lock(dlg); + } + + pjsua_handle_events(10); + + if (dlg) { + pjsip_dlg_inc_lock(dlg); + pjsip_dlg_dec_session(dlg, &pjsua_var.mod); + } + + PJSUA_RELOCK(num_locks); + break; + } + } + act_timer = act_timer->next; + } + if (act_timer == &pjsua_var.active_timer_list) + break; + } + + if (call_med->strm.v.cap_win_id != PJSUA_INVALID_ID) { + /* Decrement ref count of preview video window */ + dec_vid_win(call_med->strm.v.cap_win_id); + call_med->strm.v.cap_win_id = PJSUA_INVALID_ID; + + PJ_LOG(4,(THIS_FILE, "Call %d media %d: Preview video window " + "released", call_med->call->index, + call_med->idx)); + } + + if (call_med->strm.v.rdr_win_id != PJSUA_INVALID_ID) { /* Decrement ref count of stream video window */ dec_vid_win(call_med->strm.v.rdr_win_id); call_med->strm.v.rdr_win_id = PJSUA_INVALID_ID; + + PJ_LOG(4,(THIS_FILE, "Call %d media %d: Stream video window " + "released", call_med->call->index, + call_med->idx)); } PJSUA_UNLOCK(); - if ((call_med->dir & PJMEDIA_DIR_ENCODING) && - (pjmedia_vid_stream_get_stat(strm, &stat) == PJ_SUCCESS) && - stat.tx.pkt) + /* Unregister video stream ports (encode+decode) from conference */ + if (call_med->strm.v.strm_enc_slot != PJSUA_INVALID_ID) { + pjsua_vid_conf_remove_port(call_med->strm.v.strm_enc_slot); + call_med->strm.v.strm_enc_slot = PJSUA_INVALID_ID; + } + if (call_med->strm.v.strm_dec_slot != PJSUA_INVALID_ID) { + pjsua_vid_conf_remove_port(call_med->strm.v.strm_dec_slot); + call_med->strm.v.strm_dec_slot = PJSUA_INVALID_ID; + } + + /* Don't check for direction and transmitted packets count as we + * assume that RTP timestamp remains increasing when outgoing + * direction is disabled/paused. + */ + //if ((call_med->dir & PJMEDIA_DIR_ENCODING) && + // (pjmedia_vid_stream_get_stat(strm, &stat) == PJ_SUCCESS) && + // stat.tx.pkt) + if (pjmedia_vid_stream_get_stat(strm, &stat) == PJ_SUCCESS) { /* Save RTP timestamp & sequence, so when media session is * restarted, those values will be restored as the initial @@ -1311,9 +1487,6 @@ call_med->rtp_tx_ts = stat.rtp_tx_last_ts; } - /* Unsubscribe from video stream events */ - pjmedia_event_unsubscribe(NULL, &call_media_on_event, call_med, strm); - pjmedia_vid_stream_destroy(strm); call_med->strm.v.stream = NULL; @@ -1433,7 +1606,6 @@ wid = pjsua_vid_preview_get_win(id); if (wid == PJSUA_INVALID_ID) { PJSUA_UNLOCK(); - pj_log_pop_indent(); return PJ_ENOTFOUND; } @@ -1755,8 +1927,9 @@ /* * Set video window fullscreen. */ -PJ_DEF(pj_status_t) pjsua_vid_win_set_fullscreen( pjsua_vid_win_id wid, - pj_bool_t enabled) +PJ_DEF(pj_status_t) pjsua_vid_win_set_fullscreen( + pjsua_vid_win_id wid, + pjmedia_vid_dev_fullscreen_flag mode) { pjsua_vid_win *w; pjmedia_vid_dev_stream *s; @@ -1774,7 +1947,7 @@ } status = pjmedia_vid_dev_stream_set_cap(s, - PJMEDIA_VID_DEV_CAP_OUTPUT_FULLSCREEN, &enabled); + PJMEDIA_VID_DEV_CAP_OUTPUT_FULLSCREEN, &mode); PJSUA_UNLOCK(); @@ -1821,7 +1994,7 @@ /* Send SDP reoffer. */ static pj_status_t call_reoffer_sdp(pjsua_call_id call_id, - const pjmedia_sdp_session *sdp) + pjmedia_sdp_session *sdp) { pjsua_call *call; pjsip_tx_data *tdata; @@ -1838,6 +2011,13 @@ return PJSIP_ESESSIONSTATE; } + /* Notify application */ + if (!call->hanging_up && pjsua_var.ua_cfg.cb.on_call_sdp_created) { + (*pjsua_var.ua_cfg.cb.on_call_sdp_created)(call_id, sdp, + call->inv->pool_prov, + NULL); + } + /* Create re-INVITE with new offer */ status = pjsip_inv_reinvite( call->inv, NULL, sdp, &tdata); if (status != PJ_SUCCESS) { @@ -1890,13 +2070,8 @@ sdp = pjmedia_sdp_session_clone(call->inv->pool_prov, current_sdp); - /* Clean up provisional media before using it */ - pjsua_media_prov_clean_up(call->index); - - /* Update provisional media from call media */ - call->med_prov_cnt = call->med_cnt; - pj_memcpy(call->media_prov, call->media, - sizeof(call->media[0]) * call->med_cnt); + /* Clean up & sync provisional media before using it */ + pjsua_media_prov_revert(call->index); /* Initialize call media */ call_med = &call->media_prov[call->med_prov_cnt++]; @@ -2002,13 +2177,8 @@ med_idx = first_active; } - /* Clean up provisional media before using it */ - pjsua_media_prov_clean_up(call->index); - - /* Update provisional media from call media */ - call->med_prov_cnt = call->med_cnt; - pj_memcpy(call->media_prov, call->media, - sizeof(call->media[0]) * call->med_cnt); + /* Clean up & sync provisional media before using it */ + pjsua_media_prov_revert(call->index); call_med = &call->media_prov[med_idx]; @@ -2121,7 +2291,9 @@ on_error: if (status != PJ_SUCCESS) { - pjsua_media_prov_clean_up(call->index); + /* Revert back provisional media. */ + pjsua_media_prov_revert(call->index); + return status; } @@ -2181,7 +2353,7 @@ /* Verify the capture device */ status = pjmedia_vid_dev_get_info(cap_dev, &info); - if (status != PJ_SUCCESS || info.dir != PJMEDIA_DIR_CAPTURE) + if (status != PJ_SUCCESS || (info.dir & PJMEDIA_DIR_CAPTURE) == 0) return PJ_EINVAL; /* The specified capture device is being used already */ @@ -2190,6 +2362,15 @@ /* == Apply the new capture device == */ PJSUA_LOCK(); + + /* If media does not have active preview, simply set capture device ID */ + if (call_med->strm.v.cap_win_id == PJSUA_INVALID_ID) { + call_med->strm.v.cap_dev = cap_dev; + + /* That's it */ + goto on_sync_and_return; + } + wid = call_med->strm.v.cap_win_id; w = &pjsua_var.win[wid]; pj_assert(w->type == PJSUA_WND_TYPE_PREVIEW && w->vp_cap); @@ -2205,9 +2386,8 @@ w->preview_cap_id = cap_dev; call_med->strm.v.cap_dev = cap_dev; - PJSUA_UNLOCK(); - /* Yay, change capturer done! */ - return PJ_SUCCESS; + /* Yay, change capturer done! Now return */ + goto on_sync_and_return; } /* Oh no, it doesn't support fast switching. Do normal change then, @@ -2220,8 +2400,7 @@ return status; } - pjmedia_event_unsubscribe(NULL, &call_media_on_event, call_med, - w->vp_cap); + media_event_unsubscribe(NULL, &call_media_on_event, call_med, w->vp_cap); /* Disconnect the old capture device to stream encoding port */ status = pjsua_vid_conf_disconnect(w->cap_slot, @@ -2289,7 +2468,12 @@ call_med->strm.v.cap_dev = cap_dev; call_med->strm.v.cap_win_id = new_wid; dec_vid_win(wid); - + +on_sync_and_return: + + /* Sync provisional media from call media */ + pj_memcpy(&call->media_prov[med_idx], call_med, sizeof(call->media[0])); + PJSUA_UNLOCK(); return PJ_SUCCESS; @@ -2301,8 +2485,8 @@ if (new_w) { /* Unsubscribe, just in case */ - pjmedia_event_unsubscribe(NULL, &call_media_on_event, call_med, - new_w->vp_cap); + media_event_unsubscribe(NULL, &call_media_on_event, call_med, + new_w->vp_cap); /* Release the new capturer */ dec_vid_win(new_wid); @@ -2382,8 +2566,8 @@ w = &pjsua_var.win[wid]; /* Unsubscribe event */ - pjmedia_event_unsubscribe(NULL, &call_media_on_event, call_med, - w->vp_cap); + media_event_unsubscribe(NULL, &call_media_on_event, call_med, + w->vp_cap); /* Disconnect from video conference */ pjsua_vid_conf_disconnect(w->cap_slot, @@ -2397,6 +2581,9 @@ PJSUA_UNLOCK(); } + /* Sync provisional media from call media */ + pj_memcpy(&call->media_prov[med_idx], call_med, sizeof(call->media[0])); + return status; } @@ -2686,6 +2873,16 @@ return pjmedia_vid_conf_disconnect_port(pjsua_var.vid_conf, source, sink); } + +/* + * Update or refresh port states from video port info. + */ +PJ_DEF(pj_status_t) pjsua_vid_conf_update_port(pjsua_conf_port_id id) +{ + return pjmedia_vid_conf_update_port(pjsua_var.vid_conf, id); +} + + /* * Get the video window associated with the call. */ diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip/src/test/dns_test.c asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip/src/test/dns_test.c --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip/src/test/dns_test.c 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip/src/test/dns_test.c 2022-02-24 07:54:38.000000000 +0000 @@ -398,7 +398,7 @@ */ static int round_robin_test(pj_pool_t *pool) { - enum { COUNT = 400, PCT_ALLOWANCE = 5 }; + enum { COUNT = 400, PCT_ALLOWANCE = 10 }; unsigned i; struct server_hit { diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip/src/test/inv_offer_answer_test.c asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip/src/test/inv_offer_answer_test.c --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip/src/test/inv_offer_answer_test.c 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip/src/test/inv_offer_answer_test.c 2022-02-24 07:54:38.000000000 +0000 @@ -137,6 +137,7 @@ pj_bool_t need_established; unsigned count; oa_t oa[4]; + pj_bool_t multipart_body; } inv_test_param_t; typedef struct inv_test_t @@ -257,6 +258,17 @@ } } + /* Special handling for standard offer/answer */ + if (inv_test.param.count == 1 && + inv_test.param.oa[0] == OFFERER_UAC && + inv_test.param.need_established) + { + jobs[job_cnt].type = ESTABLISH_CALL; + jobs[job_cnt].who = PJSIP_ROLE_UAS; + job_cnt++; + TRACE_((THIS_FILE, " C+++")); + } + pj_assert(job_cnt <= PJ_ARRAY_SIZE(jobs)); } } @@ -333,6 +345,15 @@ NULL, &tdata); pj_assert(status == PJ_SUCCESS); + /* Use multipart body, if configured */ + if (sdp && inv_test.param.multipart_body) { + status = pjsip_create_multipart_sdp_body( + tdata->pool, + pjmedia_sdp_session_clone(tdata->pool, sdp), + &tdata->msg->body); + } + pj_assert(status == PJ_SUCCESS); + status = pjsip_inv_send_msg(inv_test.uas, tdata); pj_assert(status == PJ_SUCCESS); @@ -426,6 +447,7 @@ sdp = NULL; status = pjsip_inv_create_uac(dlg, sdp, inv_test.param.inv_option, &inv_test.uac); + //inv_test.uac->create_multipart = param->multipart_body; PJ_ASSERT_RETURN(status==PJ_SUCCESS, -20); TRACE_((THIS_FILE, " Sending INVITE %s offer", (sdp ? "with" : "without"))); @@ -436,8 +458,17 @@ status = pjsip_inv_invite(inv_test.uac, &tdata); PJ_ASSERT_RETURN(status==PJ_SUCCESS, -30); + /* Use multipart body, if configured */ + if (sdp && param->multipart_body) { + status = pjsip_create_multipart_sdp_body( + tdata->pool, + pjmedia_sdp_session_clone(tdata->pool, sdp), + &tdata->msg->body); + } + PJ_ASSERT_RETURN(status==PJ_SUCCESS, -40); + status = pjsip_inv_send_msg(inv_test.uac, tdata); - PJ_ASSERT_RETURN(status==PJ_SUCCESS, -30); + PJ_ASSERT_RETURN(status==PJ_SUCCESS, -50); /* * Wait until test completes @@ -467,8 +498,10 @@ status = pjsip_inv_end_session(inv_test.uas, PJSIP_SC_DECLINE, 0, &tdata); pj_assert(status == PJ_SUCCESS); - status = pjsip_inv_send_msg(inv_test.uas, tdata); - pj_assert(status == PJ_SUCCESS); + if (tdata) { + status = pjsip_inv_send_msg(inv_test.uas, tdata); + pj_assert(status == PJ_SUCCESS); + } flush_events(500); @@ -525,13 +558,14 @@ 200/INVITE (answer) <-- ACK --> */ -#if 0 +#if 1 { "Standard INVITE with offer", 0, PJ_TRUE, 1, - { OFFERER_UAC } + { OFFERER_UAC }, + PJ_FALSE }, { @@ -539,7 +573,25 @@ PJSIP_INV_REQUIRE_100REL, PJ_TRUE, 1, - { OFFERER_UAC } + { OFFERER_UAC }, + PJ_FALSE + }, + { + "Standard INVITE with offer, with Multipart", + 0, + PJ_TRUE, + 1, + { OFFERER_UAC }, + PJ_TRUE + }, + + { + "Standard INVITE with offer, with 100rel, with Multipart", + PJSIP_INV_REQUIRE_100REL, + PJ_TRUE, + 1, + { OFFERER_UAC }, + PJ_TRUE }, #endif @@ -555,7 +607,8 @@ 0, PJ_TRUE, 1, - { OFFERER_UAS } + { OFFERER_UAS }, + PJ_FALSE }, { @@ -563,7 +616,25 @@ PJSIP_INV_REQUIRE_100REL, PJ_TRUE, 1, - { OFFERER_UAS } + { OFFERER_UAS }, + PJ_FALSE + }, + { + "INVITE with no offer, with Multipart", + 0, + PJ_TRUE, + 1, + { OFFERER_UAS }, + PJ_TRUE + }, + + { + "INVITE with no offer, with 100rel, with Multipart", + PJSIP_INV_REQUIRE_100REL, + PJ_TRUE, + 1, + { OFFERER_UAS }, + PJ_TRUE }, #endif @@ -584,14 +655,24 @@ 0, PJ_TRUE, 2, - { OFFERER_UAC, OFFERER_UAC } + { OFFERER_UAC, OFFERER_UAC }, + PJ_FALSE + }, + { + "INVITE and UPDATE by UAC, with Multipart", + 0, + PJ_TRUE, + 2, + { OFFERER_UAC, OFFERER_UAC }, + PJ_TRUE }, { "INVITE and UPDATE by UAC, with 100rel", PJSIP_INV_REQUIRE_100REL, PJ_TRUE, 2, - { OFFERER_UAC, OFFERER_UAC } + { OFFERER_UAC, OFFERER_UAC }, + PJ_FALSE }, #endif @@ -617,6 +698,14 @@ 4, { OFFERER_UAC, OFFERER_UAS, OFFERER_UAC, OFFERER_UAS } }, + { + "INVITE and many UPDATE by UAC and UAS, with Multipart", + 0, + PJ_TRUE, + 4, + { OFFERER_UAC, OFFERER_UAS, OFFERER_UAC, OFFERER_UAS }, + PJ_TRUE + }, }; diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip/src/test/main.c asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip/src/test/main.c --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip/src/test/main.c 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip/src/test/main.c 2022-02-24 07:54:38.000000000 +0000 @@ -24,20 +24,53 @@ extern const char *system_name; -static void usage() +static void usage(void) { puts("Usage: test-pjsip"); puts("Options:"); - puts(" -i,--interractive Key input at the end."); - puts(" -h,--help Show this screen"); - puts(" -l,--log-level N Set log level (0-6)"); + puts(" -i,--interractive Key input at the end."); + puts(" -h,--help Show this screen"); + puts(" -l,--log-level N Set log level (0-6)"); + puts(" -n,--no-trap Let signals be handled by the OS"); + puts(" -t,--tests testname,... Comma separated list of test to run"); + list_tests(); } +#if PJ_LINUX || PJ_DARWINOS + +#include +#include +#include +#include +#include +static void print_stack(int sig) +{ + void *array[16]; + size_t size; + + size = backtrace(array, 16); + fprintf(stderr, "Error: signal %d:\n", sig); + backtrace_symbols_fd(array, size, STDERR_FILENO); + exit(1); +} + +static void init_signals(void) +{ + signal(SIGSEGV, &print_stack); + signal(SIGABRT, &print_stack); +} + +#else +#define init_signals() +#endif + int main(int argc, char *argv[]) { int interractive = 0; int retval; char **opt_arg; + int no_trap = 0; + char *testlist = NULL; PJ_UNUSED_ARG(argc); @@ -48,6 +81,10 @@ strcmp(*opt_arg, "--interractive") == 0) { interractive = 1; + } else if (strcmp(*opt_arg, "-n") == 0 || + strcmp(*opt_arg, "--no-trap") == 0) + { + no_trap = 1; } else if (strcmp(*opt_arg, "-h") == 0 || strcmp(*opt_arg, "--help") == 0) { @@ -71,6 +108,15 @@ return 1; } system_name = *opt_arg; + } else if (strcmp(*opt_arg, "-t") == 0 || + strcmp(*opt_arg, "--tests") == 0) + { + ++opt_arg; + if (!opt_arg) { + usage(); + return 1; + } + testlist = *opt_arg; } else { usage(); return 1; @@ -79,7 +125,11 @@ ++opt_arg; } - retval = test_main(); + if (!no_trap) { + init_signals(); + } + + retval = test_main(testlist); if (interractive) { char s[10]; diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip/src/test/msg_test.c asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip/src/test/msg_test.c --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip/src/test/msg_test.c 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip/src/test/msg_test.c 2022-02-24 07:54:38.000000000 +0000 @@ -953,7 +953,7 @@ #define GENERIC_PARAM "p0=a;p1=\"ab:;cd\";p2=ab%3acd;p3" -#define GENERIC_PARAM_PARSED "p0=a;p1=\"ab:;cd\";p2=ab:cd;p3" +#define GENERIC_PARAM_PARSED "p0=a;p1=\"ab:;cd\";p2=ab%3acd;p3" #define PARAM_CHAR "][/:&+$" #define SIMPLE_ADDR_SPEC "sip:host" #define ADDR_SPEC SIMPLE_ADDR_SPEC ";"PARAM_CHAR"="PARAM_CHAR ";p1=\";\"" @@ -1401,7 +1401,7 @@ param = param->next; if (pj_strcmp2(¶m->name, "p2")) return -956; - if (pj_strcmp2(¶m->value, "ab:cd")) + if (pj_strcmp2(¶m->value, "ab%3acd")) return -957; param = param->next; @@ -1621,7 +1621,7 @@ prm = prm->next; if (prm == &hdr->media.param) return -1960; if (pj_strcmp2(&prm->name, "p2")) return -1961; - if (pj_strcmp2(&prm->value, "ab:cd")) return -1962; + if (pj_strcmp2(&prm->value, "ab%3acd")) return -1962; prm = prm->next; if (prm == &hdr->media.param) return -1970; diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip/src/test/multipart_test.c asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip/src/test/multipart_test.c --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip/src/test/multipart_test.c 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip/src/test/multipart_test.c 2022-02-24 07:54:38.000000000 +0000 @@ -28,6 +28,7 @@ typedef pj_status_t (*verify_ptr)(pj_pool_t*,pjsip_msg_body*); static pj_status_t verify1(pj_pool_t *pool, pjsip_msg_body *body); +static pj_status_t verify2(pj_pool_t *pool, pjsip_msg_body *body); static struct test_t { @@ -68,7 +69,41 @@ "This is epilogue, which should be ignored too", &verify1 + }, + { + /* Content-type */ + "multipart", "mixed", "12345", + + /* Body: */ + "This is the prolog, which should be ignored.\r\n" + "--12345\r\n" + "Content-Type: text/plain\r\n" + "Content-ID: \r\n" + "Content-ID: <\"header1\"@example.org>\r\n" + "Content-Length: 13\r\n" + "\r\n" + "has header1\r\n" + "--12345 \t\r\n" + "Content-Type: application/pidf+xml\r\n" + "Content-ID: \r\n" + "Content-ID: \r\n" + "Content-Length: 13\r\n" + "\r\n" + "has header2\r\n" + "--12345\r\n" + "Content-Type: text/plain\r\n" + "Content-ID: \r\n" + "Content-ID: \r\n" + "Content-ID: \r\n" + "Content-Length: 13\r\n" + "\r\n" + "has header4\r\n" + "--12345--\r\n" + "This is epilogue, which should be ignored too", + + &verify2 } + }; static void init_media_type(pjsip_media_type *mt, @@ -87,6 +122,192 @@ } } +static int verify_hdr(pj_pool_t *pool, pjsip_msg_body *multipart_body, + void *hdr, char *part_body) +{ + pjsip_multipart_part *part; + pj_str_t the_body; + + + part = pjsip_multipart_find_part_by_header(pool, multipart_body, hdr, NULL); + if (!part) { + return -1; + } + + the_body.ptr = (char*)part->body->data; + the_body.slen = part->body->len; + + if (pj_strcmp2(&the_body, part_body) != 0) { + return -2; + } + + return 0; +} + +static int verify_cid_str(pj_pool_t *pool, pjsip_msg_body *multipart_body, + pj_str_t cid_url, char *part_body) +{ + pjsip_multipart_part *part; + pj_str_t the_body; + + part = pjsip_multipart_find_part_by_cid_str(pool, multipart_body, &cid_url); + if (!part) { + return -3; + } + + the_body.ptr = (char*)part->body->data; + the_body.slen = part->body->len; + + if (pj_strcmp2(&the_body, part_body) != 0) { + return -4; + } + + return 0; +} + +static int verify_cid_uri(pj_pool_t *pool, pjsip_msg_body *multipart_body, + pjsip_other_uri *cid_uri, char *part_body) +{ + pjsip_multipart_part *part; + pj_str_t the_body; + + part = pjsip_multipart_find_part_by_cid_uri(pool, multipart_body, cid_uri); + if (!part) { + return -5; + } + + the_body.ptr = (char*)part->body->data; + the_body.slen = part->body->len; + + if (pj_strcmp2(&the_body, part_body) != 0) { + return -6; + } + + return 0; +} + +static pj_status_t verify2(pj_pool_t *pool, pjsip_msg_body *body) +{ + int rc = 0; + int rcbase = 300; + pjsip_other_uri *cid_uri; + pjsip_ctype_hdr *ctype_hdr = pjsip_ctype_hdr_create(pool); + + ctype_hdr->media.type = pj_str("application"); + ctype_hdr->media.subtype = pj_str("pidf+xml"); + + rc = verify_hdr(pool, body, ctype_hdr, "has header2"); + if (rc) { + return (rc - rcbase); + } + + rcbase += 10; + rc = verify_cid_str(pool, body, pj_str("cid:header1@example.org"), "has header1"); + if (rc) { + return (rc - rcbase); + } + + rcbase += 10; + rc = verify_cid_str(pool, body, pj_str("%22header1%22@example.org"), "has header1"); + if (rc) { + return (rc - rcbase); + } + + cid_uri = pjsip_uri_get_uri(pjsip_parse_uri(pool, "", + strlen(""), 0)); + rcbase += 10; + rc = verify_cid_uri(pool, body, cid_uri, "has header1"); + if (rc) { + return (rc - rcbase); + } + + rcbase += 10; + rc = verify_cid_str(pool, body, pj_str(""), "has header2"); + if (rc) { + return (rc - rcbase); + } + + rcbase += 10; + rc = verify_cid_str(pool, body, pj_str("cid:my%ffheader2@example.org"), "has header2"); + if (rc) { + return (rc - rcbase); + } + + cid_uri = pjsip_uri_get_uri(pjsip_parse_uri(pool, "", + strlen(""), 0)); + rcbase += 10; + rc = verify_cid_uri(pool, body, cid_uri, "has header2"); + if (rc) { + return (rc - rcbase); + } + + rcbase += 10; + rc = verify_cid_str(pool, body, pj_str("cid:my%20header3@example.org"), "has header4"); + if (rc) { + return (rc - rcbase); + } + + rcbase += 10; + rc = verify_cid_str(pool, body, pj_str(""), "has header4"); + if (rc) { + return (rc - rcbase); + } + + cid_uri = pjsip_uri_get_uri(pjsip_parse_uri(pool, "", + strlen(""), 0)); + rcbase += 10; + rc = verify_cid_uri(pool, body, cid_uri, "has header4"); + if (rc) { + return (rc - rcbase); + } + + rcbase += 10; + rc = verify_cid_str(pool, body, pj_str(""), "has header4"); + if (rc) { + return (rc - rcbase); + } + + /* These should all fail for malformed or missing URI */ + rcbase += 10; + rc = verify_cid_str(pool, body, pj_str("cid:"), "has header4"); + if (!rc) { + return (rc - rcbase); + } + + /* This will trigger assertion. */ + /* + rcbase += 10; + rc = verify_cid_str(pool, body, pj_str(""), "has header4"); + if (!rc) { + return (rc - rcbase); + } + */ + + rcbase += 10; + rc = verify_cid_str(pool, body, pj_str("<>"), "has header4"); + if (!rc) { + return (rc - rcbase); + } + + rcbase += 10; + rc = verify_cid_str(pool, body, pj_str(""), "has header4"); + if (!rc) { + return (rc - rcbase); + } + + /* + * This is going to pass but the ' ' in the uri is un-encoded which is invalid + * so we should never see it. + */ + rcbase += 10; + rc = verify_cid_str(pool, body, pj_str("cid:my header3@example.org"), "has header4"); + if (rc) { + return (rc - rcbase); + } + + return 0; +} + static int verify_part(pjsip_multipart_part *part, char *h_content_type, char *h_content_subtype, @@ -236,8 +457,10 @@ pj_strdup2_with_null(pool, &str, p_tests[i].msg); body = pjsip_multipart_parse(pool, str.ptr, str.slen, &ctype, 0); - if (!body) + if (!body) { + pj_pool_release(pool); return -100; + } if (p_tests[i].verify) { rc = p_tests[i].verify(pool, body); diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip/src/test/test.c asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip/src/test/test.c --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip/src/test/test.c 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip/src/test/test.c 2022-02-24 07:54:38.000000000 +0000 @@ -45,17 +45,99 @@ if (rc!=0) goto on_return; \ } while (0) +#ifdef _MSC_VER +# define strtok_r strtok_s +#endif pjsip_endpoint *endpt; pj_caching_pool caching_pool; int log_level = 3; -int param_log_decor = PJ_LOG_HAS_NEWLINE | PJ_LOG_HAS_TIME | +int param_log_decor = PJ_LOG_HAS_NEWLINE | PJ_LOG_HAS_TIME | PJ_LOG_HAS_SENDER | PJ_LOG_HAS_MICRO_SEC | PJ_LOG_HAS_INDENT; static pj_oshandle_t fd_report; const char *system_name = "Unknown"; static char buf[1024]; +static struct { + const char *name; + int run_test; +} test_list[] = { + { "uri", 0}, + { "msg", 0}, + { "multipart", 0}, + { "txdata", 0}, + { "tsx_bench", 0}, + { "udp", 0}, + { "loop", 0}, + { "tcp", 0}, + { "resolve", 0}, + { "tsx", 0}, + { "tsx_destroy", 0}, + { "inv_oa", 0}, + { "regc", 0}, +}; +enum tests_to_run { + include_uri_test = 0, + include_msg_test, + include_multipart_test, + include_txdata_test, + include_tsx_bench, + include_udp_test, + include_loop_test, + include_tcp_test, + include_resolve_test, + include_tsx_test, + include_tsx_destroy_test, + include_inv_oa_test, + include_regc_test, +}; +static int run_all_tests = 1; + +static pj_status_t select_tests(char *testlist) +{ + char *token; + char *saveptr; + int maxtok = PJ_ARRAY_SIZE(test_list); + int j; + + if (!testlist) { + return PJ_SUCCESS; + } + run_all_tests = 0; + + for (token = strtok_r(testlist, ",", &saveptr); token != NULL; + token = strtok_r(NULL, ",", &saveptr)) { + + int found = 0; + for (j = 0; j < maxtok; j++) { + if (strcmp(token, test_list[j].name) == 0) { + test_list[j].run_test = 1; + found = 1; + } + } + if (!found) { + fprintf(stderr, "Test '%s' is not valid\n", token); + return PJ_ENOTFOUND; + } + } + + return PJ_SUCCESS; +} + +void list_tests(void) { + int maxtok = PJ_ARRAY_SIZE(test_list); + int j; + + fprintf(stderr, "Valid tests:\n"); + + for (j = 0; j < maxtok; j++) { + fprintf(stderr, " %s\n", test_list[j].name); + } +} + +#define SHOULD_RUN_TEST(ix) (run_all_tests || test_list[ix].run_test) + void app_perror(const char *msg, pj_status_t rc) { char errbuf[256]; @@ -221,7 +303,7 @@ } -int test_main(void) +int test_main(char *testlist) { pj_status_t rc; const char *filename; @@ -237,6 +319,12 @@ #endif /* INCLUDE_TSX_TEST */ int line; + rc = select_tests(testlist); + if (rc != PJ_SUCCESS) { + list_tests(); + return rc; + } + pj_log_set_level(log_level); pj_log_set_decor(param_log_decor); @@ -293,87 +381,112 @@ #if INCLUDE_URI_TEST - DO_TEST(uri_test()); + if (SHOULD_RUN_TEST(include_uri_test)) { + DO_TEST(uri_test()); + } #endif #if INCLUDE_MSG_TEST - DO_TEST(msg_test()); - DO_TEST(msg_err_test()); + if (SHOULD_RUN_TEST(include_msg_test)) { + DO_TEST(msg_test()); + DO_TEST(msg_err_test()); + } #endif #if INCLUDE_MULTIPART_TEST - DO_TEST(multipart_test()); + if (SHOULD_RUN_TEST(include_multipart_test)) { + DO_TEST(multipart_test()); + } #endif #if INCLUDE_TXDATA_TEST - DO_TEST(txdata_test()); + if (SHOULD_RUN_TEST(include_txdata_test)) { + DO_TEST(txdata_test()); + } #endif #if INCLUDE_TSX_BENCH - DO_TEST(tsx_bench()); + if (SHOULD_RUN_TEST(include_tsx_bench)) { + DO_TEST(tsx_bench()); + } #endif #if INCLUDE_UDP_TEST - DO_TEST(transport_udp_test()); + if (SHOULD_RUN_TEST(include_udp_test)) { + DO_TEST(transport_udp_test()); + } #endif #if INCLUDE_LOOP_TEST - DO_TEST(transport_loop_test()); + if (SHOULD_RUN_TEST(include_loop_test)) { + DO_TEST(transport_loop_test()); + } #endif #if INCLUDE_TCP_TEST - DO_TEST(transport_tcp_test()); + if (SHOULD_RUN_TEST(include_tcp_test)) { + DO_TEST(transport_tcp_test()); + } #endif #if INCLUDE_RESOLVE_TEST - DO_TEST(resolve_test()); + if (SHOULD_RUN_TEST(include_resolve_test)) { + DO_TEST(resolve_test()); + } #endif #if INCLUDE_TSX_TEST - status = pjsip_udp_transport_start(endpt, NULL, NULL, 1, &tp); - if (status == PJ_SUCCESS) { - tsx_test[tsx_test_cnt].port = tp->local_name.port; - tsx_test[tsx_test_cnt].tp_type = "udp"; - tsx_test[tsx_test_cnt].type = PJSIP_TRANSPORT_UDP; - ++tsx_test_cnt; - } + if (SHOULD_RUN_TEST(include_tsx_test)) { + status = pjsip_udp_transport_start(endpt, NULL, NULL, 1, &tp); + if (status == PJ_SUCCESS) { + tsx_test[tsx_test_cnt].port = tp->local_name.port; + tsx_test[tsx_test_cnt].tp_type = "udp"; + tsx_test[tsx_test_cnt].type = PJSIP_TRANSPORT_UDP; + ++tsx_test_cnt; + } #if PJ_HAS_TCP - status = pjsip_tcp_transport_start(endpt, NULL, 1, &tpfactory); - if (status == PJ_SUCCESS) { - tsx_test[tsx_test_cnt].port = tpfactory->addr_name.port; - tsx_test[tsx_test_cnt].tp_type = "tcp"; - tsx_test[tsx_test_cnt].type = PJSIP_TRANSPORT_TCP; - ++tsx_test_cnt; - } else { - app_perror("Unable to create TCP", status); - rc = -4; - goto on_return; - } -#endif - - - for (i=0; iaddr_name.port; + tsx_test[tsx_test_cnt].tp_type = "tcp"; + tsx_test[tsx_test_cnt].type = PJSIP_TRANSPORT_TCP; + ++tsx_test_cnt; + } else { + app_perror("Unable to create TCP", status); + rc = -4; + goto on_return; + } +#endif + + for (i = 0; i < tsx_test_cnt; ++i) { + DO_TSX_TEST(tsx_basic_test, &tsx_test[i]); + DO_TSX_TEST(tsx_uac_test, &tsx_test[i]); + DO_TSX_TEST(tsx_uas_test, &tsx_test[i]); + } } #endif #if INCLUDE_INV_OA_TEST - DO_TEST(inv_offer_answer_test()); + if (SHOULD_RUN_TEST(include_inv_oa_test)) { + DO_TEST(inv_offer_answer_test()); + } #endif #if INCLUDE_REGC_TEST - DO_TEST(regc_test()); + if (SHOULD_RUN_TEST(include_regc_test)) { + DO_TEST(regc_test()); + } #endif /* * Better be last because it recreates the endpt */ #if INCLUDE_TSX_DESTROY_TEST - DO_TEST(tsx_destroy_test()); + if (SHOULD_RUN_TEST(include_tsx_destroy_test)) { + DO_TEST(tsx_destroy_test()); + } #endif on_return: diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip/src/test/test.h asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip/src/test/test.h --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip/src/test/test.h 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip/src/test/test.h 2022-02-24 07:54:38.000000000 +0000 @@ -36,8 +36,6 @@ # define PJSIP_TEST_MEM_SIZE (2*1024*1024) #endif - - #define INCLUDE_MESSAGING_GROUP 1 #define INCLUDE_TRANSPORT_GROUP 1 #define INCLUDE_TSX_GROUP 1 @@ -55,11 +53,17 @@ #endif +#if defined(PJ_EXCLUDE_BENCHMARK_TESTS) && (PJ_EXCLUDE_BENCHMARK_TESTS==1) +# define WITH_BENCHMARK 0 +#else +# define WITH_BENCHMARK 1 +#endif + #define INCLUDE_URI_TEST INCLUDE_MESSAGING_GROUP #define INCLUDE_MSG_TEST INCLUDE_MESSAGING_GROUP #define INCLUDE_MULTIPART_TEST INCLUDE_MESSAGING_GROUP #define INCLUDE_TXDATA_TEST INCLUDE_MESSAGING_GROUP -#define INCLUDE_TSX_BENCH INCLUDE_MESSAGING_GROUP +#define INCLUDE_TSX_BENCH (INCLUDE_MESSAGING_GROUP && WITH_BENCHMARK) #define INCLUDE_UDP_TEST INCLUDE_TRANSPORT_GROUP #define INCLUDE_LOOP_TEST INCLUDE_TRANSPORT_GROUP #define INCLUDE_TCP_TEST INCLUDE_TRANSPORT_GROUP @@ -111,9 +115,10 @@ int inv_offer_answer_test(void); /* Test main entry */ -int test_main(void); +int test_main(char *testlist); /* Test utilities. */ +void list_tests(void); void app_perror(const char *msg, pj_status_t status); int init_msg_logger(void); int msg_logger_set_enabled(pj_bool_t enabled); diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip/src/test/transport_test.c asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip/src/test/transport_test.c --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip/src/test/transport_test.c 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip/src/test/transport_test.c 2022-02-24 07:54:38.000000000 +0000 @@ -35,7 +35,7 @@ /* Check that local address name is valid. */ { - struct pj_in_addr addr; + pj_in_addr addr; if (pj_inet_pton(pj_AF_INET(), &tp->local_name.host, &addr) == PJ_SUCCESS) diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip/src/test/transport_udp_test.c asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip/src/test/transport_udp_test.c --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip/src/test/transport_udp_test.c 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip/src/test/transport_udp_test.c 2022-02-24 07:54:38.000000000 +0000 @@ -27,7 +27,7 @@ static pj_status_t multi_transport_test(pjsip_transport *tp[], unsigned num_tp) { pj_status_t status; - pj_uint16_t i = 0; + unsigned i = 0; pj_str_t s; pjsip_transport *udp_tp; pj_sockaddr_in rem_addr; @@ -37,7 +37,7 @@ { pj_sockaddr_in addr; - pj_sockaddr_in_init(&addr, NULL, TEST_UDP_PORT+i); + pj_sockaddr_in_init(&addr, NULL, (pj_uint16_t)(TEST_UDP_PORT+i)); /* Start UDP transport. */ status = pjsip_udp_transport_start( endpt, &addr, NULL, 1, &udp_tp); diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip/src/test/tsx_basic_test.c asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip/src/test/tsx_basic_test.c --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip/src/test/tsx_basic_test.c 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip/src/test/tsx_basic_test.c 2022-02-24 07:54:38.000000000 +0000 @@ -267,20 +267,16 @@ "normal unable to resolve", &tsx_create_and_send_req, "sip:user@somehost", - 15000, + 20000, 1 }, { "resolve and destroy, wait", &tsx_create_and_send_req, "sip:user@somehost", - 3000, /* Wait for DNS timeout, dec ref to the group lock is done in DNS+send callback */ - 15000 + 1, + 20000 }, -#if 0 - /* These tests rely on TCP connect timeout (so group lock reference count becomes 0 and group lock objects destroys are initiated). - * Unfortunately TCP connect timeout may take longer in some OS, e.g: Linux, MacOS, so let's disable this test for now. - */ { "tcp connect and destroy", &tsx_create_and_send_req, @@ -289,13 +285,12 @@ 1000 }, { - "tcp connect and destroy", + "tcp connect and destroy 2", &tsx_create_and_send_req, "sip:user@10.125.36.63:58517;transport=tcp", - 22000, /* Wait for TCP connect timeout, dec ref to the group lock is done in send callback */ + 1, 60000 }, -#endif }; int rc; unsigned i; diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip/src/test/tsx_uac_test.c asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip/src/test/tsx_uac_test.c --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip/src/test/tsx_uac_test.c 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip/src/test/tsx_uac_test.c 2022-02-24 07:54:38.000000000 +0000 @@ -88,7 +88,8 @@ static char *TEST8_BRANCH_ID = PJSIP_RFC3261_BRANCH_ID "-UAC-Test8"; static char *TEST9_BRANCH_ID = PJSIP_RFC3261_BRANCH_ID "-UAC-Test9"; -#define TEST1_ALLOWED_DIFF (150) +// An effort to accommodate CPU load spike on some test machines. +#define TEST1_ALLOWED_DIFF 500 //(150) #define TEST4_RETRANSMIT_CNT 3 #define TEST5_RETRANSMIT_CNT 3 @@ -189,16 +190,22 @@ test_complete = -715; } } else { - /* Check the number of transmissions, which must be - * 6 for INVITE and 10 for non-INVITE + /* Check the number of (re)transmissions, which must be + * 6 or 7 for INVITE and 10 or 11 for non-INVITE. + * Theoretically the total (re)transmission time is 31,500ms + * (plus 300ms for delayed transport), and tsx timeout is 32s. + * In some test machines (e.g: MacOS), sometime the tsx timeout + * fires first which causes recv_count fall short (by one). */ - if (tsx->method.id==PJSIP_INVITE_METHOD && recv_count != 7) { + //if (tsx->method.id==PJSIP_INVITE_METHOD && recv_count != 7) { + if (tsx->method.id==PJSIP_INVITE_METHOD && recv_count < 6) { PJ_LOG(3,(THIS_FILE, " error: there were %d (re)transmissions", recv_count)); test_complete = -716; } else - if (tsx->method.id==PJSIP_OPTIONS_METHOD && recv_count != 11) { + //if (tsx->method.id==PJSIP_OPTIONS_METHOD && recv_count != 11) { + if (tsx->method.id==PJSIP_OPTIONS_METHOD && recv_count < 10) { PJ_LOG(3,(THIS_FILE, " error: there were %d (re)transmissions", recv_count)); @@ -556,7 +563,8 @@ PJ_UNUSED_ARG(timer_heap); - pjsip_endpt_send_response(endpt, &r->res_addr, r->tdata, NULL, NULL); + pj_status_t status = pjsip_endpt_send_response(endpt, &r->res_addr, r->tdata, NULL, NULL); + if (status != PJ_SUCCESS) pjsip_tx_data_dec_ref(r->tdata); if (tp) pjsip_transport_dec_ref(tp); } @@ -1093,9 +1101,12 @@ } sub_test[] = { { &pjsip_invite_method, 0}, - { &pjsip_invite_method, TEST1_ALLOWED_DIFF*2}, + //{ &pjsip_invite_method, TEST1_ALLOWED_DIFF*2}, + { &pjsip_invite_method, 300}, + { &pjsip_options_method, 0}, - { &pjsip_options_method, TEST1_ALLOWED_DIFF*2} + //{ &pjsip_options_method, TEST1_ALLOWED_DIFF*2} + { &pjsip_options_method, 300} }; PJ_LOG(3,(THIS_FILE, " test1: basic uac retransmit and timeout test")); diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip/src/test/tsx_uas_test.c asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip/src/test/tsx_uas_test.c --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip/src/test/tsx_uas_test.c 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip/src/test/tsx_uas_test.c 2022-02-24 07:54:38.000000000 +0000 @@ -140,7 +140,9 @@ #define TEST_TIMEOUT_ERROR -30 -#define MAX_ALLOWED_DIFF 150 + +// An effort to accommodate CPU load spike on some test machines. +#define MAX_ALLOWED_DIFF 500 //150 static void tsx_user_on_tsx_state(pjsip_transaction *tsx, pjsip_event *e); static pj_bool_t on_rx_message(pjsip_rx_data *rdata); diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip-apps/build/libpjproject.vcxproj asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip-apps/build/libpjproject.vcxproj --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip-apps/build/libpjproject.vcxproj 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip-apps/build/libpjproject.vcxproj 2022-02-24 07:54:38.000000000 +0000 @@ -5,6 +5,10 @@ Debug-Dynamic ARM + + Debug-Dynamic + ARM64 + Debug-Dynamic Win32 @@ -17,6 +21,10 @@ Debug-Static ARM + + Debug-Static + ARM64 + Debug-Static Win32 @@ -29,6 +37,10 @@ Debug ARM + + Debug + ARM64 + Debug Win32 @@ -41,6 +53,10 @@ Release-Dynamic ARM + + Release-Dynamic + ARM64 + Release-Dynamic Win32 @@ -53,6 +69,10 @@ Release-Static ARM + + Release-Static + ARM64 + Release-Static Win32 @@ -65,6 +85,10 @@ Release ARM + + Release + ARM64 + Release Win32 @@ -161,36 +185,72 @@ false MultiByte + + StaticLibrary + v140 + false + MultiByte + StaticLibrary v140 false MultiByte + + StaticLibrary + v140 + false + MultiByte + StaticLibrary v140 false MultiByte + + StaticLibrary + v140 + false + MultiByte + StaticLibrary v140 false MultiByte + + StaticLibrary + v140 + false + MultiByte + StaticLibrary v140 false MultiByte + + StaticLibrary + v140 + false + MultiByte + StaticLibrary v140 false MultiByte + + StaticLibrary + v140 + false + MultiByte + $(BuildToolset) @@ -265,31 +325,61 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>14.0.22823.1 @@ -344,6 +434,21 @@ ..\..\lib\$(ProjectName)-$(TargetCPU)-$(Platform)-vc$(VSVer)-$(Configuration).lib + + + + _LIB;%(PreprocessorDefinitions) + + + ProgramDatabase + + + true + + + ..\..\lib\$(ProjectName)-$(TargetCPU)-$(Platform)-vc$(VSVer)-$(Configuration).lib + + _LIB;%(PreprocessorDefinitions) @@ -385,6 +490,20 @@ ..\..\lib\$(ProjectName)-$(TargetCPU)-$(Platform)-vc$(VSVer)-$(Configuration).lib + + + + _LIB;%(PreprocessorDefinitions) + + + + + true + + + ..\..\lib\$(ProjectName)-$(TargetCPU)-$(Platform)-vc$(VSVer)-$(Configuration).lib + + _LIB;%(PreprocessorDefinitions) @@ -427,6 +546,21 @@ ..\..\lib\$(ProjectName)-$(TargetCPU)-$(Platform)-vc$(VSVer)-$(Configuration).lib + + + + _LIB;%(PreprocessorDefinitions) + + + ProgramDatabase + + + true + + + ..\..\lib\$(ProjectName)-$(TargetCPU)-$(Platform)-vc$(VSVer)-$(Configuration).lib + + _LIB;%(PreprocessorDefinitions) @@ -468,6 +602,20 @@ ..\..\lib\$(ProjectName)-$(TargetCPU)-$(Platform)-vc$(VSVer)-$(Configuration).lib + + + + _LIB;%(PreprocessorDefinitions) + + + + + true + + + ..\..\lib\$(ProjectName)-$(TargetCPU)-$(Platform)-vc$(VSVer)-$(Configuration).lib + + _LIB;%(PreprocessorDefinitions) @@ -510,6 +658,21 @@ ..\..\lib\$(ProjectName)-$(TargetCPU)-$(Platform)-vc$(VSVer)-$(Configuration).lib + + + + _LIB;%(PreprocessorDefinitions) + + + ProgramDatabase + + + true + + + ..\..\lib\$(ProjectName)-$(TargetCPU)-$(Platform)-vc$(VSVer)-$(Configuration).lib + + _LIB;%(PreprocessorDefinitions) @@ -546,6 +709,20 @@ true + + + ..\..\lib\$(ProjectName)-$(TargetCPU)-$(Platform)-vc$(VSVer)-$(Configuration).lib + + + + + + _LIB;%(PreprocessorDefinitions) + + + + + true ..\..\lib\$(ProjectName)-$(TargetCPU)-$(Platform)-vc$(VSVer)-$(Configuration).lib diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip-apps/build/Makefile asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip-apps/build/Makefile --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip-apps/build/Makefile 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip-apps/build/Makefile 2022-02-24 07:54:38.000000000 +0000 @@ -70,10 +70,14 @@ $(PJSUA_EXE): $(MAKE) -f $(RULES_MAK) APP=PJSUA app=pjsua $(subst /,$(HOST_PSEP),$(BINDIR)/$@) @if echo "$(TARGET_NAME)" | grep -q "apple-darwin_ios$$"; then \ + mkdir ../src/pjsua/ios-swift/Libraries ; \ + mkdir ../src/pjsua2/ios-swift-pjsua2/Libraries ; \ for F in $(filter %$(TARGET_NAME).a,$(PJ_LIBXX_FILES)); do \ if test -f $$F; then \ tmp=`echo $${F##*/} | sed -e "s/\-$(TARGET_NAME)\.a/.a/"`; \ ln -sf $$F ../src/pjsua/ios/$$tmp; \ + ln -sf $$F ../src/pjsua/ios-swift/Libraries/$$tmp; \ + ln -sf $$F ../src/pjsua2/ios-swift-pjsua2/Libraries/$$tmp; \ fi; \ done; \ fi; @@ -101,5 +105,6 @@ for F in $(filter %$(TARGET_NAME).a,$(PJ_LIBXX_FILES)); do \ tmp=`echo $${F##*/} | sed -e "s/\-$(TARGET_NAME)\.a/.a/"`; \ rm -f ../src/pjsua/ios/$$tmp; \ + rm -f ../src/pjsua/ios-swift/Libraries/$$tmp; \ done; \ fi; diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip-apps/build/pjsua.vcxproj asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip-apps/build/pjsua.vcxproj --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip-apps/build/pjsua.vcxproj 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip-apps/build/pjsua.vcxproj 2022-02-24 07:54:38.000000000 +0000 @@ -5,6 +5,10 @@ Debug-Dynamic ARM + + Debug-Dynamic + ARM64 + Debug-Dynamic Win32 @@ -17,6 +21,10 @@ Debug-Static ARM + + Debug-Static + ARM64 + Debug-Static Win32 @@ -29,6 +37,10 @@ Debug ARM + + Debug + ARM64 + Debug Win32 @@ -41,6 +53,10 @@ Release-Dynamic ARM + + Release-Dynamic + ARM64 + Release-Dynamic Win32 @@ -53,6 +69,10 @@ Release-Static ARM + + Release-Static + ARM64 + Release-Static Win32 @@ -65,6 +85,10 @@ Release ARM + + Release + ARM64 + Release Win32 @@ -161,36 +185,72 @@ false MultiByte + + Application + v140 + false + MultiByte + Application v140 false MultiByte + + Application + v140 + false + MultiByte + Application v140 false MultiByte + + Application + v140 + false + MultiByte + Application v140 false MultiByte + + Application + v140 + false + MultiByte + Application v140 false MultiByte + + Application + v140 + false + MultiByte + Application v140 false MultiByte + + Application + v140 + false + MultiByte + $(BuildToolset) @@ -267,31 +327,61 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>14.0.22823.1 @@ -334,6 +424,18 @@ MachineX64 + + + + ../../pjsip/include;../../pjlib/include;../../pjlib-util/include;../../pjmedia/include;../../pjnath/include;%(AdditionalIncludeDirectories) + _CONSOLE;%(PreprocessorDefinitions) + + + + + Iphlpapi.lib;dsound.lib;dxguid.lib;netapi32.lib;mswsock.lib;ws2_32.lib;odbc32.lib;odbccp32.lib;ole32.lib;user32.lib;gdi32.lib;advapi32.lib;%(AdditionalDependencies) + + ../../pjsip/include;../../pjlib/include;../../pjlib-util/include;../../pjmedia/include;../../pjnath/include;%(AdditionalIncludeDirectories) @@ -369,6 +471,20 @@ MachineX64 + + + + ../../pjsip/include;../../pjlib/include;../../pjlib-util/include;../../pjmedia/include;../../pjnath/include;%(AdditionalIncludeDirectories) + _CONSOLE;%(PreprocessorDefinitions) + + + ProgramDatabase + + + Iphlpapi.lib;dsound.lib;dxguid.lib;netapi32.lib;mswsock.lib;ws2_32.lib;odbc32.lib;odbccp32.lib;ole32.lib;user32.lib;gdi32.lib;advapi32.lib;%(AdditionalDependencies) + msvcrt.lib;%(IgnoreSpecificDefaultLibraries) + + ../../pjsip/include;../../pjlib/include;../../pjlib-util/include;../../pjmedia/include;../../pjnath/include;%(AdditionalIncludeDirectories) @@ -402,6 +518,19 @@ MachineX64 + + + + ../../pjsip/include;../../pjlib/include;../../pjlib-util/include;../../pjmedia/include;../../pjnath/include;%(AdditionalIncludeDirectories) + _CONSOLE;%(PreprocessorDefinitions) + + + ProgramDatabase + + + Iphlpapi.lib;dsound.lib;dxguid.lib;netapi32.lib;mswsock.lib;ws2_32.lib;odbc32.lib;odbccp32.lib;ole32.lib;user32.lib;gdi32.lib;advapi32.lib;%(AdditionalDependencies) + + ../../pjsip/include;../../pjlib/include;../../pjlib-util/include;../../pjmedia/include;../../pjnath/include;%(AdditionalIncludeDirectories) @@ -434,6 +563,18 @@ MachineX64 + + + + ../../pjsip/include;../../pjlib/include;../../pjlib-util/include;../../pjmedia/include;../../pjnath/include;%(AdditionalIncludeDirectories) + _CONSOLE;%(PreprocessorDefinitions) + + + + + Iphlpapi.lib;dsound.lib;dxguid.lib;netapi32.lib;mswsock.lib;ws2_32.lib;odbc32.lib;odbccp32.lib;ole32.lib;user32.lib;gdi32.lib;advapi32.lib;%(AdditionalDependencies) + + ../../pjsip/include;../../pjlib/include;../../pjlib-util/include;../../pjmedia/include;../../pjnath/include;%(AdditionalIncludeDirectories) @@ -467,6 +608,19 @@ MachineX64 + + + + ../../pjsip/include;../../pjlib/include;../../pjlib-util/include;../../pjmedia/include;../../pjnath/include;%(AdditionalIncludeDirectories) + _CONSOLE;%(PreprocessorDefinitions) + + + ProgramDatabase + + + Iphlpapi.lib;dsound.lib;dxguid.lib;netapi32.lib;mswsock.lib;ws2_32.lib;odbc32.lib;odbccp32.lib;ole32.lib;user32.lib;gdi32.lib;advapi32.lib;%(AdditionalDependencies) + + ../../pjsip/include;../../pjlib/include;../../pjlib-util/include;../../pjmedia/include;../../pjnath/include;%(AdditionalIncludeDirectories) @@ -499,6 +653,18 @@ MachineX64 + + + + ../../pjsip/include;../../pjlib/include;../../pjlib-util/include;../../pjmedia/include;../../pjnath/include;%(AdditionalIncludeDirectories) + _CONSOLE;%(PreprocessorDefinitions) + + + + + Iphlpapi.lib;dsound.lib;dxguid.lib;netapi32.lib;mswsock.lib;ws2_32.lib;odbc32.lib;odbccp32.lib;ole32.lib;user32.lib;gdi32.lib;advapi32.lib;%(AdditionalDependencies) + + true @@ -542,21 +708,27 @@ true true true + true true true true + true true true true + true true true true + true true true true + true true true true + true diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip-apps/build/pjsystest.vcxproj asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip-apps/build/pjsystest.vcxproj --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip-apps/build/pjsystest.vcxproj 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip-apps/build/pjsystest.vcxproj 2022-02-24 07:54:38.000000000 +0000 @@ -1,6 +1,10 @@  + + Debug + ARM64 + Debug Win32 @@ -9,6 +13,10 @@ Debug x64 + + Release + ARM64 + Release Win32 @@ -19,11 +27,11 @@ - + {5E507EA2-CB39-47CA-BD39-49EB58D7A0BB} pjsystest - Win32Proj + Win32Proj en-US @@ -40,39 +48,58 @@ Application v140 + + Application + v140 + Application v140 + + Application + v140 + $(BuildToolset) - + + Application StaticLibrary - + - - + + - - + + - - + + + + + + + - - + + + + + + + @@ -107,6 +134,17 @@ MachineX64 + + + + ../../pjsip/include;../../pjlib/include;../../pjlib-util/include;../../pjmedia/include;../../pjnath/include;%(AdditionalIncludeDirectories) + _CONSOLE;%(PreprocessorDefinitions) + ProgramDatabase + + + Iphlpapi.lib;dsound.lib;dxguid.lib;netapi32.lib;mswsock.lib;ws2_32.lib;odbc32.lib;odbccp32.lib;ole32.lib;user32.lib;gdi32.lib;advapi32.lib;%(AdditionalDependencies) + + ../../pjsip/include;../../pjlib/include;../../pjlib-util/include;../../pjmedia/include;../../pjnath/include;%(AdditionalIncludeDirectories) @@ -129,13 +167,25 @@ MachineX64 + + + + ../../pjsip/include;../../pjlib/include;../../pjlib-util/include;../../pjmedia/include;../../pjnath/include;%(AdditionalIncludeDirectories) + _CONSOLE;%(PreprocessorDefinitions) + + + Iphlpapi.lib;dsound.lib;dxguid.lib;netapi32.lib;mswsock.lib;ws2_32.lib;odbc32.lib;odbccp32.lib;ole32.lib;user32.lib;gdi32.lib;advapi32.lib;%(AdditionalDependencies) + + true true + true true true + true diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip-apps/build/pjsystest.vcxproj.filters asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip-apps/build/pjsystest.vcxproj.filters --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip-apps/build/pjsystest.vcxproj.filters 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip-apps/build/pjsystest.vcxproj.filters 2022-02-24 07:54:38.000000000 +0000 @@ -33,9 +33,4 @@ Header Files - - - Resource Files - - \ No newline at end of file diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip-apps/build/python_pjsua.vcxproj asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip-apps/build/python_pjsua.vcxproj --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip-apps/build/python_pjsua.vcxproj 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip-apps/build/python_pjsua.vcxproj 2022-02-24 07:54:38.000000000 +0000 @@ -1,10 +1,18 @@  + + Debug + ARM64 + Debug Win32 + + Release + ARM64 + Release Win32 @@ -20,12 +28,24 @@ false MultiByte + + DynamicLibrary + v140 + false + MultiByte + DynamicLibrary v140 false MultiByte + + DynamicLibrary + v140 + false + MultiByte + @@ -33,10 +53,18 @@ + + + + + + + + <_ProjectFileVersion>14.0.22823.1 @@ -46,11 +74,17 @@ $(OutDir) true + + true + .\output\python_pjsua-i386-win32-vc8-release\ $(OutDir) false + + false + _DEBUG;%(PreprocessorDefinitions) @@ -96,6 +130,50 @@ .\output\python_pjsua-i386-win32-vc6-debug/python_pjsua.bsc + + + _DEBUG;%(PreprocessorDefinitions) + true + true + .\output\python_pjsua-i386-win32-vc6-debug/python_pjsua.tlb + + + + + Disabled + ..\..\pjlib\include;..\..\pjlib-util\include;..\..\pjmedia\include;..\..\pjsip\include;../../pjnath/include;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_WINDOWS;_USRDLL;PY_PJSUA_EXPORTS;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebug + $(OutDir)python_pjsua.pch + $(OutDir) + $(OutDir) + $(OutDir) + true + Level4 + true + EditAndContinue + + + _DEBUG;%(PreprocessorDefinitions) + 0x0421 + + + python24_d.lib;odbc32.lib;odbccp32.lib;dsound.lib;dxguid.lib;netapi32.lib;mswsock.lib;ws2_32.lib;iphlpapi.lib;%(AdditionalDependencies) + ..\lib\_pjsua_d.pyd + true + ../../pjlib/lib;../../pjlib-util/lib;../../pjmedia/lib;../../pjsip/lib;F:\incoming\projects\divusi\Python-2.4\Python-2.4\PCbuild;F:\incoming\projects\divusi\Python-2.4\Python-2.4\PC\VC6;%(AdditionalLibraryDirectories) + ..\src\python\_pjsua.def + true + $(OutDir)_pjsua_d.pdb + $(OutDir)_pjsua_d.lib + + + true + .\output\python_pjsua-i386-win32-vc6-debug/python_pjsua.bsc + + NDEBUG;%(PreprocessorDefinitions) @@ -140,6 +218,52 @@ true + .\output\python_pjsua-i386-win32-vc6-release/python_pjsua.bsc + + + + + NDEBUG;%(PreprocessorDefinitions) + true + true + .\output\python_pjsua-i386-win32-vc6-release/python_pjsua.tlb + + + + + MaxSpeed + OnlyExplicitInline + ..\..\pjlib\include;..\..\pjlib-util\include;..\..\pjmedia\include;..\..\pjsip\include;../../pjnath/include;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;_USRDLL;PY_PJSUA_EXPORTS;%(PreprocessorDefinitions) + true + MultiThreaded + true + $(OutDir)python_pjsua.pch + $(OutDir) + $(OutDir) + $(OutDir) + true + Level3 + true + + + NDEBUG;%(PreprocessorDefinitions) + 0x0421 + + + python24.lib;odbc32.lib;odbccp32.lib;dsound.lib;dxguid.lib;netapi32.lib;mswsock.lib;ws2_32.lib;iphlpapi.lib;%(AdditionalDependencies) + ..\lib\_pjsua.pyd + true + ../../pjlib/lib;../../pjlib-util/lib;../../pjmedia/lib;../../pjsip/lib;%(AdditionalLibraryDirectories) + libcmt.lib;%(IgnoreSpecificDefaultLibraries) + ..\src\python\_pjsua.def + $(OutDir)_pjsua.pdb + true + $(OutDir)_pjsua.map + $(OutDir)_pjsua.lib + + + true .\output\python_pjsua-i386-win32-vc6-release/python_pjsua.bsc diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip-apps/build/sample_debug.vcxproj asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip-apps/build/sample_debug.vcxproj --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip-apps/build/sample_debug.vcxproj 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip-apps/build/sample_debug.vcxproj 2022-02-24 07:54:38.000000000 +0000 @@ -1,6 +1,10 @@  + + Debug-Dynamic + ARM64 + Debug-Dynamic Win32 @@ -9,6 +13,10 @@ Debug-Dynamic x64 + + Debug-Static + ARM64 + Debug-Static Win32 @@ -17,6 +25,10 @@ Debug-Static x64 + + Debug + ARM64 + Debug Win32 @@ -25,6 +37,10 @@ Debug x64 + + Release-Dynamic + ARM64 + Release-Dynamic Win32 @@ -33,6 +49,10 @@ Release-Dynamic x64 + + Release-Static + ARM64 + Release-Static Win32 @@ -41,6 +61,10 @@ Release-Static x64 + + Release + ARM64 + Release Win32 @@ -51,10 +75,10 @@ - + {A0F1AA62-0F6F-420D-B09A-AC04B6862821} - sample_debug + sample_debug en-US @@ -101,110 +125,177 @@ false MultiByte + + Application + v140 + false + MultiByte + Application v140 false MultiByte + + Application + v140 + false + MultiByte + Application v140 false MultiByte + + Application + v140 + false + MultiByte + Application v140 false MultiByte + + Application + v140 + false + MultiByte + Application v140 false MultiByte + + Application + v140 + false + MultiByte + Application v140 false MultiByte - + + Application + v140 + false + MultiByte + + $(BuildToolset) - + + Application StaticLibrary - + - - + + - - + + - - + + - - + + - - + + - - + + - - + + + + + + + - - + + + + + + + - - + + + + + + + - - + + + + + + + - - + + + + + + + - - + + + + + + + <_ProjectFileVersion>14.0.22823.1 - sample-debug-$(TargetCPU)-$(Platform)-vc$(VSVer)-$(Configuration) + sample-debug-$(TargetCPU)-$(Platform)-vc$(VSVer)-$(Configuration) @@ -244,6 +335,21 @@ MachineX64 + + + + ../../pjsip/include;../../pjlib/include;../../pjlib-util/include;../../pjmedia/include;../../pjnath/include;%(AdditionalIncludeDirectories) + _CONSOLE;%(PreprocessorDefinitions) + + + ProgramDatabase + + + iphlpapi.lib;dsound.lib;dxguid.lib;netapi32.lib;mswsock.lib;ws2_32.lib;odbc32.lib;odbccp32.lib;oleaut32.lib;uuid.lib;ole32.lib;user32.lib;%(AdditionalDependencies) + ..\bin\sample-debug-$(TargetCPU)-$(Platform)-vc$(VSVer)-$(Configuration).exe + MSVCRT.LIB;%(IgnoreSpecificDefaultLibraries) + + ../../pjsip/include;../../pjlib/include;../../pjlib-util/include;../../pjmedia/include;../../pjnath/include;%(AdditionalIncludeDirectories) @@ -270,6 +376,19 @@ MachineX64 + + + + ../../pjsip/include;../../pjlib/include;../../pjlib-util/include;../../pjmedia/include;../../pjnath/include;%(AdditionalIncludeDirectories) + _CONSOLE;%(PreprocessorDefinitions) + + + + + iphlpapi.lib;dsound.lib;dxguid.lib;netapi32.lib;mswsock.lib;ws2_32.lib;odbc32.lib;odbccp32.lib;oleaut32.lib;uuid.lib;ole32.lib;user32.lib;%(AdditionalDependencies) + ..\bin\sample-debug-$(TargetCPU)-$(Platform)-vc$(VSVer)-$(Configuration).exe + + ../../pjsip/include;../../pjlib/include;../../pjlib-util/include;../../pjmedia/include;../../pjnath/include;%(AdditionalIncludeDirectories) @@ -299,6 +418,21 @@ MachineX64 + + + + ../../pjsip/include;../../pjlib/include;../../pjlib-util/include;../../pjmedia/include;../../pjnath/include;%(AdditionalIncludeDirectories) + _CONSOLE;%(PreprocessorDefinitions) + + + ProgramDatabase + + + iphlpapi.lib;dsound.lib;dxguid.lib;netapi32.lib;mswsock.lib;ws2_32.lib;odbc32.lib;odbccp32.lib;oleaut32.lib;uuid.lib;ole32.lib;user32.lib;%(AdditionalDependencies) + ..\bin\sample-debug-$(TargetCPU)-$(Platform)-vc$(VSVer)-$(Configuration).exe + MSVCRT.LIB;%(IgnoreSpecificDefaultLibraries) + + ../../pjsip/include;../../pjlib/include;../../pjlib-util/include;../../pjmedia/include;../../pjnath/include;%(AdditionalIncludeDirectories) @@ -325,6 +459,19 @@ MachineX64 + + + + ../../pjsip/include;../../pjlib/include;../../pjlib-util/include;../../pjmedia/include;../../pjnath/include;%(AdditionalIncludeDirectories) + _CONSOLE;%(PreprocessorDefinitions) + + + + + iphlpapi.lib;dsound.lib;dxguid.lib;netapi32.lib;mswsock.lib;ws2_32.lib;odbc32.lib;odbccp32.lib;oleaut32.lib;uuid.lib;ole32.lib;user32.lib;%(AdditionalDependencies) + ..\bin\sample-debug-$(TargetCPU)-$(Platform)-vc$(VSVer)-$(Configuration).exe + + ../../pjsip/include;../../pjlib/include;../../pjlib-util/include;../../pjmedia/include;../../pjnath/include;%(AdditionalIncludeDirectories) @@ -354,6 +501,21 @@ MachineX64 + + + + ../../pjsip/include;../../pjlib/include;../../pjlib-util/include;../../pjmedia/include;../../pjnath/include;%(AdditionalIncludeDirectories) + _CONSOLE;%(PreprocessorDefinitions) + + + ProgramDatabase + + + iphlpapi.lib;dsound.lib;dxguid.lib;netapi32.lib;mswsock.lib;ws2_32.lib;odbc32.lib;odbccp32.lib;oleaut32.lib;uuid.lib;ole32.lib;user32.lib;%(AdditionalDependencies) + ..\bin\sample-debug-$(TargetCPU)-$(Platform)-vc$(VSVer)-$(Configuration).exe + MSVCRT.LIB;%(IgnoreSpecificDefaultLibraries) + + ../../pjsip/include;../../pjlib/include;../../pjlib-util/include;../../pjmedia/include;../../pjnath/include;%(AdditionalIncludeDirectories) @@ -382,6 +544,20 @@ MachineX64 + + + + ../../pjsip/include;../../pjlib/include;../../pjlib-util/include;../../pjmedia/include;../../pjnath/include;%(AdditionalIncludeDirectories) + _CONSOLE;%(PreprocessorDefinitions) + + + + + iphlpapi.lib;dsound.lib;dxguid.lib;netapi32.lib;mswsock.lib;ws2_32.lib;odbc32.lib;odbccp32.lib;oleaut32.lib;uuid.lib;ole32.lib;user32.lib;%(AdditionalDependencies) + ..\bin\sample-debug-$(TargetCPU)-$(Platform)-vc$(VSVer)-$(Configuration).exe + MSVCRT.LIB;%(IgnoreSpecificDefaultLibraries) + + diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip-apps/build/Samples.mak asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip-apps/build/Samples.mak --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip-apps/build/Samples.mak 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip-apps/build/Samples.mak 2022-02-24 07:54:38.000000000 +0000 @@ -7,8 +7,8 @@ ############################################################################### # Gather all flags. # -export _CFLAGS := $(PJ_CFLAGS) $(CFLAGS) -export _CXXFLAGS:= $(PJ_CXXFLAGS) $(CFLAGS) +export _CFLAGS := $(PJ_CFLAGS) $(CFLAGS) $(PJ_VIDEO_CFLAGS) +export _CXXFLAGS:= $(PJ_CXXFLAGS) $(CFLAGS) $(PJ_VIDEO_CFLAGS) export _LDFLAGS := $(PJ_LDFLAGS) $(PJ_LDLIBS) $(LDFLAGS) export _LDXXFLAGS := $(PJ_LDXXFLAGS) $(PJ_LDXXLIBS) $(LDFLAGS) @@ -55,6 +55,10 @@ PJSUA2_EXES := $(foreach file, $(PJSUA2_SAMPLES), $(file)$(HOST_EXE)) endif +ifeq ($(PJ_EXCLUDE_PJSUA2),1) +PJSUA2_EXES := +endif + .PHONY: $(EXES) .PHONY: $(PJSUA2_EXES) diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip-apps/build/Samples-vc.mak asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip-apps/build/Samples-vc.mak --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip-apps/build/Samples-vc.mak 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip-apps/build/Samples-vc.mak 2022-02-24 07:54:38.000000000 +0000 @@ -4,10 +4,13 @@ !if "$(ARCH)" == "win64" TARGET = x86_64-x64-vc$(VC_VER)-$(BUILD_MODE) TARGET_FLAGS = /DPJ_WIN64=1 /DPJ_M_X86_64=1 -!else +!elseif "$(ARCH)" == "win32" TARGET = i386-win32-vc$(VC_VER)-$(BUILD_MODE) -TARGET_FLAGS = /DPJ_WIN32=1 /DPJ_M_I386=1 +TARGET_FLAGS = /DPJ_WIN32=1 /DPJ_M_I386=1 +!elseif "$(ARCH)" == "ARM64" + +TARGET = ARM64-ARM64-vc$(VC_VER)-$(BUILD_MODE) !endif !if "$(BUILD_MODE)" == "debug" diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip-apps/build/samples.vcxproj asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip-apps/build/samples.vcxproj --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip-apps/build/samples.vcxproj 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip-apps/build/samples.vcxproj 2022-02-24 07:54:38.000000000 +0000 @@ -1,6 +1,10 @@  + + Debug-Dynamic + ARM64 + Debug-Dynamic Win32 @@ -9,6 +13,10 @@ Debug-Dynamic x64 + + Debug-Static + ARM64 + Debug-Static Win32 @@ -17,6 +25,10 @@ Debug-Static x64 + + Debug + ARM64 + Debug Win32 @@ -25,6 +37,10 @@ Debug x64 + + Release-Dynamic + ARM64 + Release-Dynamic Win32 @@ -33,6 +49,10 @@ Release-Dynamic x64 + + Release-Static + ARM64 + Release-Static Win32 @@ -41,6 +61,10 @@ Release-Static x64 + + Release + ARM64 + Release Win32 @@ -55,7 +79,7 @@ {E378A1FC-0C9C-4462-860F-7E60BC1BF84E} samples - MakeFileProj + MakeFileProj en-US @@ -95,91 +119,164 @@ v140 false + + Makefile + v140 + false + Makefile v140 false + + Makefile + v140 + false + Makefile v140 false + + Makefile + v140 + false + Makefile v140 false + + Makefile + v140 + false + Makefile v140 false + + Makefile + v140 + false + Makefile v140 false + + Makefile + v140 + false + $(BuildToolset) - + + StaticLibrary - + - + + - + + - + + - + + - + - + + - + - + + - + + + + + + + - + + + + + + + - + + + + + + + - + + - + - + + - + + + + + + + + + + + + + + + + + - + - <_ProjectFileVersion>14.0.22823.1 + <_ProjectFileVersion>14.0.22823.1 @@ -187,108 +284,120 @@ NotUsing false ../../pjsip/include;../../pjlib/include;../../pjlib-util/include;../../pjmedia/include;../../pjnath/include;%(AdditionalIncludeDirectories) - MultiThreadedDebugDLL + MultiThreadedDebugDLL /Ignore:4006 %(AdditionalOptions) - + - .\output\$(ProjectName)-i386-$(Platform)-vs8-$(Configuration)\ - $(OutDir) - nmake /NOLOGO /S /f Samples-vc.mak BUILD_MODE=release VC_VER=14 - nmake /NOLOGO /S /f Samples-vc.mak BUILD_MODE=release VC_VER=14 /a - nmake /NOLOGO /S /f Samples-vc.mak BUILD_MODE=release VC_VER=14 clean + nmake /NOLOGO /S /f Samples-vc.mak BUILD_MODE=release VC_VER=14 ARCH=win32 + nmake /NOLOGO /S /f Samples-vc.mak BUILD_MODE=release VC_VER=14 ARCH=win32 /a + nmake /NOLOGO /S /f Samples-vc.mak BUILD_MODE=release VC_VER=14 ARCH=win32 clean All samples - .\output\$(ProjectName)-x86_64-$(Platform)-vs8-$(Configuration)\ - $(OutDir) nmake /NOLOGO /S /f Samples-vc.mak BUILD_MODE=release VC_VER=14 ARCH=win64 nmake /NOLOGO /S /f Samples-vc.mak BUILD_MODE=release VC_VER=14 ARCH=win64 /a nmake /NOLOGO /S /f Samples-vc.mak BUILD_MODE=release VC_VER=14 ARCH=win64 clean All samples + + nmake /NOLOGO /S /f Samples-vc.mak BUILD_MODE=release VC_VER=14 ARCH=ARM64 + nmake /NOLOGO /S /f Samples-vc.mak BUILD_MODE=release VC_VER=14 ARCH=ARM64 /a + nmake /NOLOGO /S /f Samples-vc.mak BUILD_MODE=release VC_VER=14 ARCH=ARM64 clean + All samples + - .\output\$(ProjectName)-i386-$(Platform)-vs8-$(Configuration)\ - $(OutDir) nmake /NOLOGO /S /f Samples-vc.mak BUILD_MODE=debug VC_VER=14 ARCH=win32 nmake /NOLOGO /S /f Samples-vc.mak BUILD_MODE=debug VC_VER=14 ARCH=win32 /a nmake /NOLOGO /S /f Samples-vc.mak BUILD_MODE=debug VC_VER=14 ARCH=win32 clean All samples - .\output\$(ProjectName)-x86_64-$(Platform)-vs8-$(Configuration)\ - $(OutDir) nmake /NOLOGO /S /f Samples-vc.mak BUILD_MODE=debug VC_VER=14 ARCH=win64 nmake /NOLOGO /S /f Samples-vc.mak BUILD_MODE=debug VC_VER=14 ARCH=win64 /a nmake /NOLOGO /S /f Samples-vc.mak BUILD_MODE=debug VC_VER=14 ARCH=win64 clean All samples + + nmake /NOLOGO /S /f Samples-vc.mak BUILD_MODE=debug VC_VER=14 ARCH=ARM64 + nmake /NOLOGO /S /f Samples-vc.mak BUILD_MODE=debug VC_VER=14 ARCH=ARM64 /a + nmake /NOLOGO /S /f Samples-vc.mak BUILD_MODE=debug VC_VER=14 ARCH=ARM64 clean + All samples + - .\output\$(ProjectName)-i386-$(Platform)-vs8-$(Configuration)\ - $(OutDir) nmake /NOLOGO /S /f Samples-vc.mak BUILD_MODE=debug-static VC_VER=14 ARCH=win32s nmake /NOLOGO /S /f Samples-vc.mak BUILD_MODE=debug-static VC_VER=14 ARCH=win32 /a nmake /NOLOGO /S /f Samples-vc.mak BUILD_MODE=debug-static VC_VER=14 ARCH=win32 clean All samples - .\output\$(ProjectName)-x86_64-$(Platform)-vs8-$(Configuration)\ - $(OutDir) nmake /NOLOGO /S /f Samples-vc.mak BUILD_MODE=debug-static VC_VER=14 ARCH=win64 nmake /NOLOGO /S /f Samples-vc.mak BUILD_MODE=debug-static VC_VER=14 ARCH=win64 /a nmake /NOLOGO /S /f Samples-vc.mak BUILD_MODE=debug-static VC_VER=14 ARCH=win64 clean All samples + + nmake /NOLOGO /S /f Samples-vc.mak BUILD_MODE=debug-static VC_VER=14 ARCH=ARM64 + nmake /NOLOGO /S /f Samples-vc.mak BUILD_MODE=debug-static VC_VER=14 ARCH=ARM64 /a + nmake /NOLOGO /S /f Samples-vc.mak BUILD_MODE=debug-static VC_VER=14 ARCH=ARM64 clean + All samples + - .\output\$(ProjectName)-i386-$(Platform)-vs8-$(Configuration)\ - $(OutDir) nmake /NOLOGO /S /f Samples-vc.mak BUILD_MODE=release-dynamic VC_VER=14 ARCH=win32 nmake /NOLOGO /S /f Samples-vc.mak BUILD_MODE=release-dynamic VC_VER=14 ARCH=win32 /a nmake /NOLOGO /S /f Samples-vc.mak BUILD_MODE=release-dynamic VC_VER=14 ARCH=win32 clean All samples - .\output\$(ProjectName)-x86_64-$(Platform)-vs8-$(Configuration)\ - $(OutDir) nmake /NOLOGO /S /f Samples-vc.mak BUILD_MODE=release-dynamic VC_VER=14 ARCH=win64 nmake /NOLOGO /S /f Samples-vc.mak BUILD_MODE=release-dynamic VC_VER=14 ARCH=win64 /a nmake /NOLOGO /S /f Samples-vc.mak BUILD_MODE=release-dynamic VC_VER=14 ARCH=win64 clean All samples + + nmake /NOLOGO /S /f Samples-vc.mak BUILD_MODE=release-dynamic VC_VER=14 ARCH=ARM64 + nmake /NOLOGO /S /f Samples-vc.mak BUILD_MODE=release-dynamic VC_VER=14 ARCH=ARM64 /a + nmake /NOLOGO /S /f Samples-vc.mak BUILD_MODE=release-dynamic VC_VER=14 ARCH=ARM64 clean + All samples + - .\output\$(ProjectName)-i386-$(Platform)-vs8-$(Configuration)\ - $(OutDir) nmake /NOLOGO /S /f Samples-vc.mak BUILD_MODE=debug-dynamic VC_VER=14 ARCH=win32 nmake /NOLOGO /S /f Samples-vc.mak BUILD_MODE=debug-dynamic VC_VER=14 ARCH=win32 /a nmake /NOLOGO /S /f Samples-vc.mak BUILD_MODE=debug-dynamic VC_VER=14 ARCH=win32 clean All samples - .\output\$(ProjectName)-x86_64-$(Platform)-vs8-$(Configuration)\ - $(OutDir) nmake /NOLOGO /S /f Samples-vc.mak BUILD_MODE=debug-dynamic VC_VER=14 ARCH=win64 nmake /NOLOGO /S /f Samples-vc.mak BUILD_MODE=debug-dynamic VC_VER=14 ARCH=win64 /a nmake /NOLOGO /S /f Samples-vc.mak BUILD_MODE=debug-dynamic VC_VER=14 ARCH=win64 clean All samples + + nmake /NOLOGO /S /f Samples-vc.mak BUILD_MODE=debug-dynamic VC_VER=14 ARCH=ARM64 + nmake /NOLOGO /S /f Samples-vc.mak BUILD_MODE=debug-dynamic VC_VER=14 ARCH=ARM64 /a + nmake /NOLOGO /S /f Samples-vc.mak BUILD_MODE=debug-dynamic VC_VER=14 ARCH=ARM64 clean + All samples + - .\output\$(ProjectName)-i386-$(Platform)-vs8-$(Configuration)\ - $(OutDir) nmake /NOLOGO /S /f Samples-vc.mak BUILD_MODE=release-static VC_VER=14 ARCH=win32 nmake /NOLOGO /S /f Samples-vc.mak BUILD_MODE=release-static VC_VER=14 ARCH=win32 /a nmake /NOLOGO /S /f Samples-vc.mak BUILD_MODE=release-static VC_VER=14 ARCH=win32 clean All samples - .\output\$(ProjectName)-x86_64-$(Platform)-vs8-$(Configuration)\ - $(OutDir) nmake /NOLOGO /S /f Samples-vc.mak BUILD_MODE=release-static VC_VER=14 ARCH=win64 nmake /NOLOGO /S /f Samples-vc.mak BUILD_MODE=release-static VC_VER=14 ARCH=win64 /a nmake /NOLOGO /S /f Samples-vc.mak BUILD_MODE=release-static VC_VER=14 ARCH=win64 clean All samples + + nmake /NOLOGO /S /f Samples-vc.mak BUILD_MODE=release-static VC_VER=14 ARCH=ARM64 + nmake /NOLOGO /S /f Samples-vc.mak BUILD_MODE=release-static VC_VER=14 ARCH=ARM64 /a + nmake /NOLOGO /S /f Samples-vc.mak BUILD_MODE=release-static VC_VER=14 ARCH=ARM64 clean + All samples + @@ -299,6 +408,12 @@ + + + + + + @@ -309,6 +424,12 @@ + + + + + + @@ -319,6 +440,12 @@ + + + + + + @@ -329,6 +456,12 @@ + + + + + + @@ -339,6 +472,12 @@ + + + + + + @@ -349,6 +488,12 @@ + + + + + + @@ -375,8 +520,8 @@ true - - + + true diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip-apps/build/samples.vcxproj.filters asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip-apps/build/samples.vcxproj.filters --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip-apps/build/samples.vcxproj.filters 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip-apps/build/samples.vcxproj.filters 2022-02-24 07:54:38.000000000 +0000 @@ -93,12 +93,6 @@ Source Files - - Source Files - - - Source Files - Source Files diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip-apps/build/swig_java_pjsua2.vcxproj asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip-apps/build/swig_java_pjsua2.vcxproj --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip-apps/build/swig_java_pjsua2.vcxproj 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip-apps/build/swig_java_pjsua2.vcxproj 2022-02-24 07:54:38.000000000 +0000 @@ -1,6 +1,10 @@  + + Debug + ARM64 + Debug Win32 @@ -9,6 +13,10 @@ Debug x64 + + Release + ARM64 + Release Win32 @@ -23,7 +31,6 @@ {63AC6D7A-5D97-40C2-9AF2-E13AA1F9567C} pjsua2 - ..\src\swig\java\output\ swig_java_pjsua2 @@ -44,44 +51,81 @@ MultiByte true + + DynamicLibrary + v140 + MultiByte + true + DynamicLibrary v140 MultiByte + + DynamicLibrary + v140 + MultiByte + + + + + + + + + + + + + + + + + + + - <_ProjectFileVersion>14.0.25431.1 + <_ProjectFileVersion>14.0.25431.1 + ..\src\swig\java\output\ - $(Platform)\$(Configuration)\ + MinimumRecommendedRules.ruleset + + + + MinimumRecommendedRules.ruleset - $(Configuration)\ MinimumRecommendedRules.ruleset - $(Platform)\$(Configuration)\ + MinimumRecommendedRules.ruleset + + + + MinimumRecommendedRules.ruleset @@ -130,6 +174,24 @@ MachineX64 + + + + Disabled + ../../pjsip/include;../../pjlib/include;../../pjlib-util/include;../../pjmedia/include;../../pjnath/include;%(AdditionalIncludeDirectories) + true + EnableFastChecks + MultiThreadedDebug + Level3 + ProgramDatabase + + + Iphlpapi.lib;dsound.lib;dxguid.lib;netapi32.lib;mswsock.lib;ws2_32.lib;odbc32.lib;odbccp32.lib;ole32.lib;user32.lib;gdi32.lib;advapi32.lib;%(AdditionalDependencies) + ..\src\swig\java\output\pjsua2.dll + msvcrt.lib;%(IgnoreSpecificDefaultLibraries) + true + + ../../pjsip/include;../../pjlib/include;../../pjlib-util/include;../../pjmedia/include;../../pjnath/include;%(AdditionalIncludeDirectories) @@ -167,6 +229,23 @@ MachineX64 + + + + ../../pjsip/include;../../pjlib/include;../../pjlib-util/include;../../pjmedia/include;../../pjnath/include;%(AdditionalIncludeDirectories) + MultiThreaded + Level3 + ProgramDatabase + + + Iphlpapi.lib;dsound.lib;dxguid.lib;netapi32.lib;mswsock.lib;ws2_32.lib;odbc32.lib;odbccp32.lib;ole32.lib;user32.lib;gdi32.lib;advapi32.lib;%(AdditionalDependencies) + ..\src\swig\java\output\pjsua2.dll + msvcrt.lib;%(IgnoreSpecificDefaultLibraries) + true + true + true + + @@ -186,7 +265,7 @@ %40echo on %40echo Building pjsua2.dll to $(OutputDir) mkdir $(OutDir)org\pjsip\pjsua2 -swig -c++ -java -package org.pjsip.pjsua2 -I$(SolutionDir)pjsip\include -outdir $(OutDir)org\pjsip\pjsua2 -o $(OutDir)pjsua2_wrap.cpp %(FullPath) +swig -c++ -java -package org.pjsip.pjsua2 -I$(ProjectDir)..\..\pjsip\include -I$(ProjectDir)..\..\pjlib\include -outdir $(OutDir)org\pjsip\pjsua2 -o $(OutDir)pjsua2_wrap.cpp %(FullPath) javac -d $(OutDir) $(OutDir)org\pjsip\pjsua2\*.java %40echo Building sample app javac -d $(OutDir) -classpath $(OutDir) ..\src\swig\java\android\app\src\main\java\org\pjsip\pjsua2\app\MyApp.java @@ -211,7 +290,31 @@ %40echo on %40echo Building pjsua2.dll to $(OutDir) mkdir $(OutDir)org\pjsip\pjsua2 -swig -c++ -java -package org.pjsip.pjsua2 -I$(SolutionDir)pjsip\include -outdir $(OutDir)org\pjsip\pjsua2 -o $(OutDir)pjsua2_wrap.cpp %(FullPath) +swig -c++ -java -package org.pjsip.pjsua2 -I$(ProjectDir)..\..\pjsip\include -I$(ProjectDir)..\..\pjlib\include -outdir $(OutDir)org\pjsip\pjsua2 -o $(OutDir)pjsua2_wrap.cpp %(FullPath) +javac -d $(OutDir) $(OutDir)org\pjsip\pjsua2\*.java +%40echo Building sample app +javac -d $(OutDir) -classpath $(OutDir) ..\src\swig\java\android\app\src\main\java\org\pjsip\pjsua2\app\MyApp.java +javac -d $(OutDir) -classpath $(OutDir) $(OutDir)..\test.java +javac -d $(OutDir) -classpath $(OutDir) $(OutDir)..\sample.java + +%40echo ************************************************************** +%40echo After the build completed succesfully, try to run the test app, e.g: +%40echo java -cp D:\projects\pjproject\pjsip-apps\src\swig\java\output -Djava.library.path="D:\projects\pjproject\pjsip-apps\src\swig\java\output" org.pjsip.pjsua2.app.sample +%40echo ************************************************************** +%40echo off + + %40echo off +%40echo ************************************************************** +%40echo - Make sure %27swig%27 and %27javac%27 locations are in your PATH environment vars. +%40echo - Make sure Java SDK header file directories +%40echo (e.g: C:\Program Files (x86)\Java\jdk1.7.0_79\include and C:\Program Files (x86)\Java\jdk1.7.0_79\include\win32) +%40echo are in your MSVC header search path +%40echo ************************************************************** + +%40echo on +%40echo Building pjsua2.dll to $(OutDir) +mkdir $(OutDir)org\pjsip\pjsua2 +swig -c++ -java -package org.pjsip.pjsua2 -I$(ProjectDir)..\..\pjsip\include -I$(ProjectDir)..\..\pjlib\include -outdir $(OutDir)org\pjsip\pjsua2 -o $(OutDir)pjsua2_wrap.cpp %(FullPath) javac -d $(OutDir) $(OutDir)org\pjsip\pjsua2\*.java %40echo Building sample app javac -d $(OutDir) -classpath $(OutDir) ..\src\swig\java\android\app\src\main\java\org\pjsip\pjsua2\app\MyApp.java @@ -225,6 +328,7 @@ %40echo off %(Filename)_wrap.cxx;%(Outputs) + %(Filename)_wrap.cxx;%(Outputs) %40echo off %40echo ************************************************************** %40echo - Make sure %27swig%27 and %27javac%27 locations are in your PATH environment vars. @@ -236,7 +340,7 @@ %40echo on %40echo Building pjsua2.dll to $(OutDir) mkdir $(OutDir)org\pjsip\pjsua2 -swig -c++ -java -package org.pjsip.pjsua2 -I$(SolutionDir)pjsip\include -outdir $(OutDir)org\pjsip\pjsua2 -o $(OutDir)pjsua2_wrap.cpp %(FullPath) +swig -c++ -java -package org.pjsip.pjsua2 -I$(ProjectDir)..\..\pjsip\include -I$(ProjectDir)..\..\pjlib\include -outdir $(OutDir)org\pjsip\pjsua2 -o $(OutDir)pjsua2_wrap.cpp %(FullPath) javac -d $(OutDir) $(OutDir)org\pjsip\pjsua2\*.java %40echo Building sample app javac -d $(OutDir) -classpath $(OutDir) ..\src\swig\java\android\app\src\main\java\org\pjsip\pjsua2\app\MyApp.java @@ -261,7 +365,31 @@ %40echo on %40echo Building pjsua2.dll to $(OutDir) mkdir $(OutDir)org\pjsip\pjsua2 -swig -c++ -java -package org.pjsip.pjsua2 -I$(SolutionDir)pjsip\include -outdir $(OutDir)org\pjsip\pjsua2 -o $(OutDir)pjsua2_wrap.cpp %(FullPath) +swig -c++ -java -package org.pjsip.pjsua2 -I$(ProjectDir)..\..\pjsip\include -I$(ProjectDir)..\..\pjlib\include -outdir $(OutDir)org\pjsip\pjsua2 -o $(OutDir)pjsua2_wrap.cpp %(FullPath) +javac -d $(OutDir) $(OutDir)org\pjsip\pjsua2\*.java +%40echo Building sample app +javac -d $(OutDir) -classpath $(OutDir) ..\src\swig\java\android\app\src\main\java\org\pjsip\pjsua2\app\MyApp.java +javac -d $(OutDir) -classpath $(OutDir) $(OutDir)..\test.java +javac -d $(OutDir) -classpath $(OutDir) $(OutDir)..\sample.java + +%40echo ************************************************************** +%40echo After the build completed succesfully, try to run the test app, e.g: +%40echo java -cp D:\projects\pjproject\pjsip-apps\src\swig\java\output -Djava.library.path="D:\projects\pjproject\pjsip-apps\src\swig\java\output" org.pjsip.pjsua2.app.sample +%40echo ************************************************************** +%40echo off + + %40echo off +%40echo ************************************************************** +%40echo - Make sure %27swig%27 and %27javac%27 locations are in your PATH environment vars. +%40echo - Make sure Java SDK header file directories +%40echo (e.g: C:\Program Files (x86)\Java\jdk1.7.0_79\include and C:\Program Files (x86)\Java\jdk1.7.0_79\include\win32) +%40echo are in your MSVC header search path +%40echo ************************************************************** + +%40echo on +%40echo Building pjsua2.dll to $(OutDir) +mkdir $(OutDir)org\pjsip\pjsua2 +swig -c++ -java -package org.pjsip.pjsua2 -I$(ProjectDir)..\..\pjsip\include -I$(ProjectDir)..\..\pjlib\include -outdir $(OutDir)org\pjsip\pjsua2 -o $(OutDir)pjsua2_wrap.cpp %(FullPath) javac -d $(OutDir) $(OutDir)org\pjsip\pjsua2\*.java %40echo Building sample app javac -d $(OutDir) -classpath $(OutDir) ..\src\swig\java\android\app\src\main\java\org\pjsip\pjsua2\app\MyApp.java @@ -275,6 +403,7 @@ %40echo off $(OutDir)pjsua2_wrap.cpp;$(OutDir)pjsua2_wrap.h;%(Outputs) + $(OutDir)pjsua2_wrap.cpp;$(OutDir)pjsua2_wrap.h;%(Outputs) diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip-apps/src/3rdparty_media_sample/Makefile asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip-apps/src/3rdparty_media_sample/Makefile --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip-apps/src/3rdparty_media_sample/Makefile 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip-apps/src/3rdparty_media_sample/Makefile 2022-02-24 07:54:38.000000000 +0000 @@ -9,7 +9,7 @@ export _CXXFLAGS:= $(PJ_CXXFLAGS) export _LDFLAGS := $(PJ_LDFLAGS) $(PJ_LDLIBS) $(LDFLAGS) -OBJS = alt_pjsua_aud.o alt_pjsua_vid.o pjsua_app.o main.o +OBJS = alt_pjsua_aud.o alt_pjsua_vid.o pjsua_app.o main.o pjsua_app_cli.o pjsua_app_common.o pjsua_app_config.o pjsua_app_legacy.o all: alt_pjsua @@ -22,6 +22,21 @@ main.o: ../pjsua/main.c $(PJ_CC) $(_CFLAGS) -c -o $@ $< +#main_rtems.o: ../pjsua/main_rtems.c +# $(PJ_CC) $(_CFLAGS) -c -o $@ $< + +pjsua_app_cli.o: ../pjsua/pjsua_app_cli.c + $(PJ_CC) $(_CFLAGS) -c -o $@ $< + +pjsua_app_common.o: ../pjsua/pjsua_app_common.c + $(PJ_CC) $(_CFLAGS) -c -o $@ $< + +pjsua_app_config.o: ../pjsua/pjsua_app_config.c + $(PJ_CC) $(_CFLAGS) -c -o $@ $< + +pjsua_app_legacy.o: ../pjsua/pjsua_app_legacy.c + $(PJ_CC) $(_CFLAGS) -c -o $@ $< + %.o: %.c $(PJ_CC) $(_CFLAGS) -c -o $@ $< diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip-apps/src/pjsua/android/app/build.gradle asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip-apps/src/pjsua/android/app/build.gradle --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip-apps/src/pjsua/android/app/build.gradle 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip-apps/src/pjsua/android/app/build.gradle 2022-02-24 07:54:38.000000000 +0000 @@ -1,13 +1,13 @@ apply plugin: 'com.android.application' android { - compileSdkVersion 15 + compileSdkVersion 26 buildToolsVersion "23.0.3" defaultConfig { applicationId "org.pjsip.pjsua" - minSdkVersion 15 - targetSdkVersion 15 + minSdkVersion 23 + targetSdkVersion 26 ndk { moduleName "libpjsua" diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip-apps/src/pjsua/android/app/src/main/java/MainActivity.java asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip-apps/src/pjsua/android/app/src/main/java/MainActivity.java --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip-apps/src/pjsua/android/app/src/main/java/MainActivity.java 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip-apps/src/pjsua/android/app/src/main/java/MainActivity.java 2022-02-24 07:54:38.000000000 +0000 @@ -23,6 +23,8 @@ import android.app.Activity; import android.content.pm.ApplicationInfo; +import android.hardware.camera2.CameraManager; +import android.content.Context; import android.os.Bundle; import android.util.Log; import android.view.SurfaceHolder; @@ -30,6 +32,7 @@ import android.os.Handler; import android.os.Message; import android.widget.TextView; +import org.pjsip.PjCameraInfo2; class CONST { public static final String LIB_FILENAME = "pjsua"; @@ -160,6 +163,8 @@ protected void onCreate(Bundle savedInstanceState) { LOG.DEBUG(ui_handler, "=== Activity::onCreate() ==="); super.onCreate(savedInstanceState); + CameraManager cm = (CameraManager)getSystemService(Context.CAMERA_SERVICE); + PjCameraInfo2.SetCameraManager(cm); init_view(); diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip-apps/src/pjsua/android/build.gradle asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip-apps/src/pjsua/android/build.gradle --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip-apps/src/pjsua/android/build.gradle 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip-apps/src/pjsua/android/build.gradle 2022-02-24 07:54:38.000000000 +0000 @@ -2,14 +2,16 @@ buildscript { repositories { jcenter() + google() } dependencies { - classpath 'com.android.tools.build:gradle:2.2.3' + classpath 'com.android.tools.build:gradle:3.5.2' } } allprojects { repositories { jcenter() + google() } } diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip-apps/src/pjsua/android/gradle/wrapper/gradle-wrapper.properties asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip-apps/src/pjsua/android/gradle/wrapper/gradle-wrapper.properties --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip-apps/src/pjsua/android/gradle/wrapper/gradle-wrapper.properties 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip-apps/src/pjsua/android/gradle/wrapper/gradle-wrapper.properties 2022-02-24 07:54:38.000000000 +0000 @@ -3,4 +3,4 @@ distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-all.zip diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip-apps/src/pjsua/ios/ipjsua/ipjsuaAppDelegate.m asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip-apps/src/pjsua/ios/ipjsua/ipjsuaAppDelegate.m --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip-apps/src/pjsua/ios/ipjsua/ipjsuaAppDelegate.m 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip-apps/src/pjsua/ios/ipjsua/ipjsuaAppDelegate.m 2022-02-24 07:54:38.000000000 +0000 @@ -162,11 +162,14 @@ } /* Setup device orientation change notification */ - [[UIDevice currentDevice] beginGeneratingDeviceOrientationNotifications]; - [[NSNotificationCenter defaultCenter] addObserver:app - selector:@selector(orientationChanged:) - name:UIDeviceOrientationDidChangeNotification - object:[UIDevice currentDevice]]; + dispatch_async(dispatch_get_main_queue(), + ^{ + [[UIDevice currentDevice] beginGeneratingDeviceOrientationNotifications]; + [[NSNotificationCenter defaultCenter] addObserver:app + selector:@selector(orientationChanged:) + name:UIDeviceOrientationDidChangeNotification + object:[UIDevice currentDevice]]; + }); status = pjsua_app_run(PJ_TRUE); if (status != PJ_SUCCESS) { @@ -288,9 +291,13 @@ // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. [self performSelectorOnMainThread:@selector(keepAlive) withObject:nil waitUntilDone:YES]; + +#if 0 + /* setKeepAliveTimeout is deprecated. Use PushKit instead. */ [application setKeepAliveTimeout:KEEP_ALIVE_INTERVAL handler: ^{ [self performSelectorOnMainThread:@selector(keepAlive) withObject:nil waitUntilDone:YES]; }]; +#endif } - (void)applicationWillEnterForeground:(UIApplication *)application @@ -343,11 +350,11 @@ pjsua_vid_win_info wi; if (pjsua_vid_win_get_info(i, &wi) == PJ_SUCCESS) { - UIView *parent = app.viewController.view; - UIView *view = (__bridge UIView *)wi.hwnd.info.ios.window; + dispatch_async(dispatch_get_main_queue(), ^{ + UIView *parent = app.viewController.view; + UIView *view = (__bridge UIView *)wi.hwnd.info.ios.window; - if (view) { - dispatch_async(dispatch_get_main_queue(), ^{ + if (view) { /* Add the video window as subview */ if (![view isDescendantOfView:parent]) [parent addSubview:view]; @@ -367,8 +374,8 @@ parent.bounds.size.height- view.bounds.size.height/2.0); } - }); - } + } + }); } } diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip-apps/src/pjsua/ios/ipjsua.xcodeproj/project.pbxproj asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip-apps/src/pjsua/ios/ipjsua.xcodeproj/project.pbxproj --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip-apps/src/pjsua/ios/ipjsua.xcodeproj/project.pbxproj 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip-apps/src/pjsua/ios/ipjsua.xcodeproj/project.pbxproj 2022-02-24 07:54:38.000000000 +0000 @@ -22,7 +22,6 @@ 3AA3200018F3FB4C00112C3D /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3AA31FF318F3FB4C00112C3D /* Foundation.framework */; }; 3AA3200118F3FB4C00112C3D /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3AA31FF418F3FB4C00112C3D /* CoreGraphics.framework */; }; 3AA3200218F3FB4C00112C3D /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3AA31FF518F3FB4C00112C3D /* UIKit.framework */; }; - 3AB0EC581DA76B39008A0F62 /* libc++.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 3AB0EC571DA76B39008A0F62 /* libc++.tbd */; }; 3ADCCD171715338D0007BE8E /* pjsua.png in Resources */ = {isa = PBXBuildFile; fileRef = 3ADCCD161715338D0007BE8E /* pjsua.png */; }; 3ADCCD2D172E40120007BE8E /* pjsua_app_cli.c in Sources */ = {isa = PBXBuildFile; fileRef = 3ADCCD28172E40120007BE8E /* pjsua_app_cli.c */; }; 3ADCCD2E172E40120007BE8E /* pjsua_app_common.c in Sources */ = {isa = PBXBuildFile; fileRef = 3ADCCD29172E40120007BE8E /* pjsua_app_common.c */; }; @@ -78,7 +77,6 @@ 3AA31FF318F3FB4C00112C3D /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; 3AA31FF418F3FB4C00112C3D /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; 3AA31FF518F3FB4C00112C3D /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; - 3AB0EC571DA76B39008A0F62 /* libc++.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = "libc++.tbd"; path = "usr/lib/libc++.tbd"; sourceTree = SDKROOT; }; 3ADCCD161715338D0007BE8E /* pjsua.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = pjsua.png; sourceTree = ""; }; 3ADCCD28172E40120007BE8E /* pjsua_app_cli.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = pjsua_app_cli.c; path = ../../pjsua_app_cli.c; sourceTree = ""; }; 3ADCCD29172E40120007BE8E /* pjsua_app_common.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = pjsua_app_common.c; path = ../../pjsua_app_common.c; sourceTree = ""; }; @@ -101,7 +99,6 @@ 3AF0582716F050780046B835 /* en */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = en; path = en.lproj/ipjsuaViewController_iPad.xib; sourceTree = ""; }; 3AF252FF1EFBD15E00213893 /* libyuv.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libyuv.a; sourceTree = ""; }; 3AF253011EFBD36E00213893 /* VideoToolbox.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = VideoToolbox.framework; path = System/Library/Frameworks/VideoToolbox.framework; sourceTree = SDKROOT; }; - 741C73BA1F0E64AF00887FB6 /* libopenh264.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libopenh264.a; path = "../../../../../../../../../../openh264-1.6.0/lib_armv7/lib/libopenh264.a"; sourceTree = ""; }; 7485A6AD1F09AAE500122F1A /* Reachability.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Reachability.h; sourceTree = ""; }; 7485A6AE1F09AAE500122F1A /* Reachability.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Reachability.m; sourceTree = ""; }; 7485A6B01F09B2D500122F1A /* SystemConfiguration.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SystemConfiguration.framework; path = System/Library/Frameworks/SystemConfiguration.framework; sourceTree = SDKROOT; }; @@ -133,7 +130,6 @@ 3A6FDEF0223B3BEC001726FD /* Security.framework in Frameworks */, 7485A6B11F09B2D500122F1A /* SystemConfiguration.framework in Frameworks */, 3AF253021EFBD36E00213893 /* VideoToolbox.framework in Frameworks */, - 3AB0EC581DA76B39008A0F62 /* libc++.tbd in Frameworks */, E5E991EC1B67A45500017E67 /* libpjmedia-codec.a in Frameworks */, 3AA31FF818F3FB4C00112C3D /* CFNetwork.framework in Frameworks */, E5E991E61B67A45500017E67 /* libg7221codec.a in Frameworks */, @@ -207,10 +203,8 @@ isa = PBXGroup; children = ( 3A6FDEEF223B3BEC001726FD /* Security.framework */, - 741C73BA1F0E64AF00887FB6 /* libopenh264.a */, 7485A6B01F09B2D500122F1A /* SystemConfiguration.framework */, 3AF253011EFBD36E00213893 /* VideoToolbox.framework */, - 3AB0EC571DA76B39008A0F62 /* libc++.tbd */, 3AA31FE918F3FB4C00112C3D /* AudioToolbox.framework */, 3AA31FEA18F3FB4C00112C3D /* AVFoundation.framework */, 3AA31FEB18F3FB4C00112C3D /* CFNetwork.framework */, @@ -314,7 +308,7 @@ isa = PBXProject; attributes = { CLASSPREFIX = ipjsua; - LastUpgradeCheck = 1130; + LastUpgradeCheck = 1240; ORGANIZATIONNAME = Teluu; TargetAttributes = { 3AF0580316F050770046B835 = { @@ -424,6 +418,7 @@ CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; CLANG_WARN_STRICT_PROTOTYPES = YES; CLANG_WARN_SUSPICIOUS_MOVE = YES; @@ -449,7 +444,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; + IPHONEOS_DEPLOYMENT_TARGET = 9.0; ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; TARGETED_DEVICE_FAMILY = "1,2"; @@ -476,6 +471,7 @@ CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; CLANG_WARN_STRICT_PROTOTYPES = YES; CLANG_WARN_SUSPICIOUS_MOVE = YES; @@ -493,7 +489,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; + IPHONEOS_DEPLOYMENT_TARGET = 9.0; OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1"; SDKROOT = iphoneos; TARGETED_DEVICE_FAMILY = "1,2"; diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip-apps/src/pjsua/ios/ipjsua.xcodeproj/xcshareddata/xcschemes/ipjsua.xcscheme asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip-apps/src/pjsua/ios/ipjsua.xcodeproj/xcshareddata/xcschemes/ipjsua.xcscheme --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip-apps/src/pjsua/ios/ipjsua.xcodeproj/xcshareddata/xcschemes/ipjsua.xcscheme 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip-apps/src/pjsua/ios/ipjsua.xcodeproj/xcshareddata/xcschemes/ipjsua.xcscheme 2022-02-24 07:54:38.000000000 +0000 @@ -1,6 +1,6 @@ UIView { + let view = UIView(); + view.backgroundColor = UIColor.black; + return view; + } + + func updateUIView(_ uiView: UIView, context: Context) { + if let vid_win = vidWin { + /* Add the video window as subview */ + if (!vid_win.isDescendant(of: uiView)) { + uiView.addSubview(vid_win) + /* Resize it to fit width */ + vid_win.bounds = CGRect(x:0, y:0, width:uiView.bounds.size.width, + height:(uiView.bounds.size.height * + 1.0 * uiView.bounds.size.width / + vid_win.bounds.size.width)); + /* Center it horizontally */ + vid_win.center = CGPoint(x:uiView.bounds.size.width / 2.0, + y:vid_win.bounds.size.height / 2.0); + } + } + } +} + +class PjsipVars: ObservableObject { + @Published var calling = false + var dest: String = "sip:test@pjsip.org" + var call_id: pjsua_call_id = PJSUA_INVALID_ID.rawValue +} + +private func call_func(user_data: UnsafeMutableRawPointer?) { + let pjsip_vars = Unmanaged.fromOpaque(user_data!).takeUnretainedValue() + if (!pjsip_vars.calling) { + var status: pj_status_t; + var opt = pjsua_call_setting(); + + pjsua_call_setting_default(&opt); + opt.aud_cnt = 1; + opt.vid_cnt = 1; + + let dest_str = strdup(pjsip_vars.dest); + var dest:pj_str_t = pj_str(dest_str); + status = pjsua_call_make_call(0, &dest, &opt, nil, nil, &pjsip_vars.call_id); + DispatchQueue.main.sync { + pjsip_vars.calling = (status == PJ_SUCCESS.rawValue); + } + free(dest_str); + } else { + if (pjsip_vars.call_id != PJSUA_INVALID_ID.rawValue) { + DispatchQueue.main.sync { + pjsip_vars.calling = false; + } + pjsua_call_hangup(pjsip_vars.call_id, 200, nil, nil); + pjsip_vars.call_id = PJSUA_INVALID_ID.rawValue; + } + } + +} + +struct ContentView: View { + @StateObject var pjsip_vars = PjsipVars() + @EnvironmentObject var vinfo: VidInfo; + + var body: some View { + VStack(alignment: .center) { + HStack(alignment: .center) { + if (!pjsip_vars.calling) { + Text("Destination:") + TextField(pjsip_vars.dest, text: $pjsip_vars.dest) + .frame(minWidth:0, maxWidth:200) + } + } + + Button(action: { + let user_data = + UnsafeMutableRawPointer(Unmanaged.passUnretained(pjsip_vars).toOpaque()) + + /* IMPORTANT: + * We need to call PJSIP API from a separate thread since + * PJSIP API can potentially block the main/GUI thread. + * And make sure we don't use Apple's Dispatch / gcd since + * it's incompatible with POSIX threads. + * In this example, we take advantage of PJSUA's timer thread + * to make and hangup call. For a more complex application, + * it is recommended to create your own separate thread + * instead for this purpose. + */ + pjsua_schedule_timer2_dbg(call_func, user_data, 0, "swift", 0); + }) { + if (!pjsip_vars.calling) { + Text("Make call") + .foregroundColor(Color.black) + } else { + Text("Hangup call") + .foregroundColor(Color.black) + } + } + .padding(.all, 8.0) + .background(Color.green); + + VidView(vidWin: $vinfo.vid_win) + } + } +} + +struct ContentView_Previews: PreviewProvider { + static var previews: some View { + ContentView() + } +} diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip-apps/src/pjsua/ios-swift/ipjsua-swift/Info.plist asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip-apps/src/pjsua/ios-swift/ipjsua-swift/Info.plist --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip-apps/src/pjsua/ios-swift/ipjsua-swift/Info.plist 1970-01-01 00:00:00.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip-apps/src/pjsua/ios-swift/ipjsua-swift/Info.plist 2022-02-24 07:54:38.000000000 +0000 @@ -0,0 +1,57 @@ + + + + + NSMicrophoneUsageDescription + Audio call permission + NSCameraUsageDescription + Video call permission + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + $(PRODUCT_BUNDLE_PACKAGE_TYPE) + CFBundleShortVersionString + 1.0 + CFBundleVersion + 1 + LSRequiresIPhoneOS + + UIApplicationSceneManifest + + UIApplicationSupportsMultipleScenes + + + UIApplicationSupportsIndirectInputEvents + + UILaunchScreen + + UIRequiredDeviceCapabilities + + video-camera + wifi + microphone + armv7 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + + diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip-apps/src/pjsua/ios-swift/ipjsua-swift/ipjsua_swiftApp.swift asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip-apps/src/pjsua/ios-swift/ipjsua-swift/ipjsua_swiftApp.swift --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip-apps/src/pjsua/ios-swift/ipjsua-swift/ipjsua_swiftApp.swift 1970-01-01 00:00:00.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip-apps/src/pjsua/ios-swift/ipjsua-swift/ipjsua_swiftApp.swift 2022-02-24 07:54:38.000000000 +0000 @@ -0,0 +1,166 @@ +/* + * Copyright (C) 2021-2021 Teluu Inc. (http://www.teluu.com) + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* This is a simple Swift demo app that shows an example of how to use + * PJSUA API to make one audio+video call to another user. + */ + +import SwiftUI + +class VidInfo: ObservableObject { + /* Video window */ + @Published var vid_win:UIView? = nil +} + +class AppDelegate: NSObject, UIApplicationDelegate { + static let Shared = AppDelegate() + var vinfo = VidInfo() +} + +@main +struct ipjsua_swiftApp: App { + init() { + /* Create pjsua */ + var status: pj_status_t; + status = pjsua_create(); + if (status != PJ_SUCCESS.rawValue) { + NSLog("Failed creating pjsua"); + } + + /* Init configs */ + var cfg = pjsua_config(); + var log_cfg = pjsua_logging_config(); + var media_cfg = pjsua_media_config(); + pjsua_config_default(&cfg); + pjsua_logging_config_default(&log_cfg); + pjsua_media_config_default(&media_cfg); + + /* Initialize application callbacks */ + cfg.cb.on_call_state = on_call_state; + cfg.cb.on_call_media_state = on_call_media_state; + + /* Init pjsua */ + status = pjsua_init(&cfg, &log_cfg, &media_cfg); + + /* Create transport */ + var transport_id = pjsua_transport_id(); + var tcp_cfg = pjsua_transport_config(); + pjsua_transport_config_default(&tcp_cfg); + tcp_cfg.port = 5060; + status = pjsua_transport_create(PJSIP_TRANSPORT_TCP, + &tcp_cfg, &transport_id); + + /* Init account config */ + let id = strdup("Test"); + let username = strdup("test"); + let passwd = strdup("pwd"); + let realm = strdup("*"); + let registrar = strdup("sip:pjsip.org"); + let proxy = strdup("sip:sip.pjsip.org;transport=tcp"); + + var acc_cfg = pjsua_acc_config(); + pjsua_acc_config_default(&acc_cfg); + acc_cfg.id = pj_str(id); + acc_cfg.cred_count = 1; + acc_cfg.cred_info.0.username = pj_str(username); + acc_cfg.cred_info.0.realm = pj_str(realm); + acc_cfg.cred_info.0.data = pj_str(passwd); + acc_cfg.reg_uri = pj_str(registrar); + acc_cfg.proxy_cnt = 1; + acc_cfg.proxy.0 = pj_str(proxy); + acc_cfg.vid_out_auto_transmit = pj_bool_t(PJ_TRUE.rawValue); + acc_cfg.vid_in_auto_show = pj_bool_t(PJ_TRUE.rawValue); + + /* Add account */ + pjsua_acc_add(&acc_cfg, pj_bool_t(PJ_TRUE.rawValue), nil); + + /* Free strings */ + free(id); free(username); free(passwd); free(realm); + free(registrar); free(proxy); + + /* Start pjsua */ + status = pjsua_start(); + } + + var body: some Scene { + WindowGroup { + ContentView() + .environmentObject(AppDelegate.Shared.vinfo) + .preferredColorScheme(.light) + } + } +} + +private func on_call_state(call_id: pjsua_call_id, e: UnsafeMutablePointer?) { + var ci = pjsua_call_info(); + pjsua_call_get_info(call_id, &ci); + if (ci.state == PJSIP_INV_STATE_DISCONNECTED) { + /* UIView update must be done in the main thread */ + DispatchQueue.main.sync { + AppDelegate.Shared.vinfo.vid_win = nil; + } + } +} + +private func tupleToArray(tuple: Tuple) -> [Value] { + let tupleMirror = Mirror(reflecting: tuple) + return tupleMirror.children.compactMap { (child: Mirror.Child) -> Value? in + return child.value as? Value + } +} + +private func on_call_media_state(call_id: pjsua_call_id) { + var ci = pjsua_call_info(); + pjsua_call_get_info(call_id, &ci); + + for mi in 0...ci.media_cnt { + let media: [pjsua_call_media_info] = tupleToArray(tuple: ci.media); + + if (media[Int(mi)].status == PJSUA_CALL_MEDIA_ACTIVE || + media[Int(mi)].status == PJSUA_CALL_MEDIA_REMOTE_HOLD) + { + switch (media[Int(mi)].type) { + case PJMEDIA_TYPE_AUDIO: + var call_conf_slot: pjsua_conf_port_id; + + call_conf_slot = media[Int(mi)].stream.aud.conf_slot; + pjsua_conf_connect(call_conf_slot, 0); + pjsua_conf_connect(0, call_conf_slot); + break; + + case PJMEDIA_TYPE_VIDEO: + let wid = media[Int(mi)].stream.vid.win_in; + var wi = pjsua_vid_win_info(); + + if (pjsua_vid_win_get_info(wid, &wi) == PJ_SUCCESS.rawValue) { + let vid_win:UIView = + Unmanaged.fromOpaque(wi.hwnd.info.ios.window).takeUnretainedValue(); + + /* UIView update must be done in the main thread */ + DispatchQueue.main.sync { + AppDelegate.Shared.vinfo.vid_win = vid_win; + } + } + break; + + default: + break; + } + } + } +} diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip-apps/src/pjsua/ios-swift/ipjsua-swift/ipjsua-swift-Bridging-Header.h asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip-apps/src/pjsua/ios-swift/ipjsua-swift/ipjsua-swift-Bridging-Header.h --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip-apps/src/pjsua/ios-swift/ipjsua-swift/ipjsua-swift-Bridging-Header.h 1970-01-01 00:00:00.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip-apps/src/pjsua/ios-swift/ipjsua-swift/ipjsua-swift-Bridging-Header.h 2022-02-24 07:54:38.000000000 +0000 @@ -0,0 +1,6 @@ +// +// Use this file to import your target's public headers that you would like to expose to Swift. +// + +#define PJ_AUTOCONF 1 +#import "pjsua.h" diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip-apps/src/pjsua/ios-swift/ipjsua-swift/pjsip.m asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip-apps/src/pjsua/ios-swift/ipjsua-swift/pjsip.m --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip-apps/src/pjsua/ios-swift/ipjsua-swift/pjsip.m 1970-01-01 00:00:00.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip-apps/src/pjsua/ios-swift/ipjsua-swift/pjsip.m 2022-02-24 07:54:38.000000000 +0000 @@ -0,0 +1,8 @@ +// +// pjsip.m +// ipjsua-swift +// +// Created by Ming on 4/2/21. +// + +#import diff -Nru "/tmp/tmpgod_td0p/c4yCX_i6qB/asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip-apps/src/pjsua/ios-swift/ipjsua-swift/Preview Content/Preview Assets.xcassets/Contents.json" "/tmp/tmpgod_td0p/iHWlLhIivf/asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip-apps/src/pjsua/ios-swift/ipjsua-swift/Preview Content/Preview Assets.xcassets/Contents.json" --- "/tmp/tmpgod_td0p/c4yCX_i6qB/asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip-apps/src/pjsua/ios-swift/ipjsua-swift/Preview Content/Preview Assets.xcassets/Contents.json" 1970-01-01 00:00:00.000000000 +0000 +++ "/tmp/tmpgod_td0p/iHWlLhIivf/asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip-apps/src/pjsua/ios-swift/ipjsua-swift/Preview Content/Preview Assets.xcassets/Contents.json" 2022-02-24 07:54:38.000000000 +0000 @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip-apps/src/pjsua/ios-swift/ipjsua-swift.xcodeproj/project.pbxproj asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip-apps/src/pjsua/ios-swift/ipjsua-swift.xcodeproj/project.pbxproj --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip-apps/src/pjsua/ios-swift/ipjsua-swift.xcodeproj/project.pbxproj 1970-01-01 00:00:00.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip-apps/src/pjsua/ios-swift/ipjsua-swift.xcodeproj/project.pbxproj 2022-02-24 07:54:38.000000000 +0000 @@ -0,0 +1,551 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 50; + objects = { + +/* Begin PBXBuildFile section */ + 3A6FC61C25CBD4540065F472 /* ipjsua_swiftApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3A6FC61B25CBD4540065F472 /* ipjsua_swiftApp.swift */; }; + 3A6FC61E25CBD4540065F472 /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3A6FC61D25CBD4540065F472 /* ContentView.swift */; }; + 3A6FC62025CBD4550065F472 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 3A6FC61F25CBD4550065F472 /* Assets.xcassets */; }; + 3A6FC62325CBD4550065F472 /* Preview Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 3A6FC62225CBD4550065F472 /* Preview Assets.xcassets */; }; + 3A6FC77125CBDB620065F472 /* pjsip.m in Sources */ = {isa = PBXBuildFile; fileRef = 3A6FC77025CBDB620065F472 /* pjsip.m */; }; + 3A6FC77625CBE3700065F472 /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3A6FC75B25CBD6E10065F472 /* AudioToolbox.framework */; }; + 3A6FC77725CBE3700065F472 /* AVFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3A6FC76B25CBD6E10065F472 /* AVFoundation.framework */; }; + 3A6FC77825CBE3700065F472 /* CFNetwork.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3A6FC76925CBD6E10065F472 /* CFNetwork.framework */; }; + 3A6FC77925CBE3700065F472 /* CoreAudio.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3A6FC76525CBD6E10065F472 /* CoreAudio.framework */; }; + 3A6FC77A25CBE3700065F472 /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3A6FC76725CBD6E10065F472 /* CoreFoundation.framework */; }; + 3A6FC77B25CBE3700065F472 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3A6FC75C25CBD6E10065F472 /* CoreGraphics.framework */; }; + 3A6FC77C25CBE3700065F472 /* CoreImage.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3A6FC75E25CBD6E10065F472 /* CoreImage.framework */; }; + 3A6FC77D25CBE3700065F472 /* CoreMedia.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3A6FC76025CBD6E10065F472 /* CoreMedia.framework */; }; + 3A6FC77E25CBE3700065F472 /* CoreVideo.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3A6FC76225CBD6E10065F472 /* CoreVideo.framework */; }; + 3A6FC77F25CBE3700065F472 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3A6FC75F25CBD6E10065F472 /* Foundation.framework */; }; + 3A6FC78025CBE3700065F472 /* libc++.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 3A6FC75D25CBD6E10065F472 /* libc++.tbd */; }; + 3A6FC78125CBE3700065F472 /* OpenGLES.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3A6FC76825CBD6E10065F472 /* OpenGLES.framework */; }; + 3A6FC78225CBE3700065F472 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3A6FC76625CBD6E10065F472 /* QuartzCore.framework */; }; + 3A6FC78325CBE3700065F472 /* Security.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3A6FC76425CBD6E10065F472 /* Security.framework */; }; + 3A6FC78425CBE3700065F472 /* SystemConfiguration.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3A6FC76325CBD6E10065F472 /* SystemConfiguration.framework */; }; + 3A6FC78525CBE3700065F472 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3A6FC76A25CBD6E10065F472 /* UIKit.framework */; }; + 3A6FC78625CBE3700065F472 /* VideoToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3A6FC76125CBD6E10065F472 /* VideoToolbox.framework */; }; + 3A6FC7E125CD1A3D0065F472 /* libpjsip-simple.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3A6FC7CD25CD1A3D0065F472 /* libpjsip-simple.a */; }; + 3A6FC7E225CD1A3D0065F472 /* libgsmcodec.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3A6FC7CE25CD1A3D0065F472 /* libgsmcodec.a */; }; + 3A6FC7E325CD1A3D0065F472 /* libpj.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3A6FC7CF25CD1A3D0065F472 /* libpj.a */; }; + 3A6FC7E425CD1A3D0065F472 /* libpjsip-ua.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3A6FC7D025CD1A3D0065F472 /* libpjsip-ua.a */; }; + 3A6FC7E525CD1A3E0065F472 /* libresample.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3A6FC7D125CD1A3D0065F472 /* libresample.a */; }; + 3A6FC7E625CD1A3E0065F472 /* libsrtp.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3A6FC7D225CD1A3D0065F472 /* libsrtp.a */; }; + 3A6FC7E725CD1A3E0065F472 /* libyuv.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3A6FC7D325CD1A3D0065F472 /* libyuv.a */; }; + 3A6FC7E825CD1A3E0065F472 /* libpjmedia-videodev.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3A6FC7D425CD1A3D0065F472 /* libpjmedia-videodev.a */; }; + 3A6FC7E925CD1A3E0065F472 /* libpjlib-util.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3A6FC7D525CD1A3D0065F472 /* libpjlib-util.a */; }; + 3A6FC7EA25CD1A3E0065F472 /* libpjnath.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3A6FC7D625CD1A3D0065F472 /* libpjnath.a */; }; + 3A6FC7EB25CD1A3E0065F472 /* libpjsua.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3A6FC7D725CD1A3D0065F472 /* libpjsua.a */; }; + 3A6FC7EC25CD1A3E0065F472 /* libpjmedia.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3A6FC7D825CD1A3D0065F472 /* libpjmedia.a */; }; + 3A6FC7ED25CD1A3E0065F472 /* libspeex.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3A6FC7D925CD1A3D0065F472 /* libspeex.a */; }; + 3A6FC7EE25CD1A3E0065F472 /* libg7221codec.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3A6FC7DA25CD1A3D0065F472 /* libg7221codec.a */; }; + 3A6FC7EF25CD1A3E0065F472 /* libpjsip.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3A6FC7DB25CD1A3D0065F472 /* libpjsip.a */; }; + 3A6FC7F025CD1A3E0065F472 /* libpjsua2.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3A6FC7DC25CD1A3D0065F472 /* libpjsua2.a */; }; + 3A6FC7F125CD1A3E0065F472 /* libilbccodec.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3A6FC7DD25CD1A3D0065F472 /* libilbccodec.a */; }; + 3A6FC7F225CD1A3E0065F472 /* libwebrtc.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3A6FC7DE25CD1A3D0065F472 /* libwebrtc.a */; }; + 3A6FC7F325CD1A3E0065F472 /* libpjmedia-codec.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3A6FC7DF25CD1A3D0065F472 /* libpjmedia-codec.a */; }; + 3A6FC7F425CD1A3E0065F472 /* libpjmedia-audiodev.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3A6FC7E025CD1A3D0065F472 /* libpjmedia-audiodev.a */; }; +/* End PBXBuildFile section */ + +/* Begin PBXFileReference section */ + 3A6FC61825CBD4540065F472 /* ipjsua-swift.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "ipjsua-swift.app"; sourceTree = BUILT_PRODUCTS_DIR; }; + 3A6FC61B25CBD4540065F472 /* ipjsua_swiftApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ipjsua_swiftApp.swift; sourceTree = ""; }; + 3A6FC61D25CBD4540065F472 /* ContentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContentView.swift; sourceTree = ""; }; + 3A6FC61F25CBD4550065F472 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + 3A6FC62225CBD4550065F472 /* Preview Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = "Preview Assets.xcassets"; sourceTree = ""; }; + 3A6FC62425CBD4550065F472 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 3A6FC75B25CBD6E10065F472 /* AudioToolbox.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AudioToolbox.framework; path = System/Library/Frameworks/AudioToolbox.framework; sourceTree = SDKROOT; }; + 3A6FC75C25CBD6E10065F472 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; + 3A6FC75D25CBD6E10065F472 /* libc++.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = "libc++.tbd"; path = "usr/lib/libc++.tbd"; sourceTree = SDKROOT; }; + 3A6FC75E25CBD6E10065F472 /* CoreImage.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreImage.framework; path = System/Library/Frameworks/CoreImage.framework; sourceTree = SDKROOT; }; + 3A6FC75F25CBD6E10065F472 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; + 3A6FC76025CBD6E10065F472 /* CoreMedia.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreMedia.framework; path = System/Library/Frameworks/CoreMedia.framework; sourceTree = SDKROOT; }; + 3A6FC76125CBD6E10065F472 /* VideoToolbox.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = VideoToolbox.framework; path = System/Library/Frameworks/VideoToolbox.framework; sourceTree = SDKROOT; }; + 3A6FC76225CBD6E10065F472 /* CoreVideo.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreVideo.framework; path = System/Library/Frameworks/CoreVideo.framework; sourceTree = SDKROOT; }; + 3A6FC76325CBD6E10065F472 /* SystemConfiguration.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SystemConfiguration.framework; path = System/Library/Frameworks/SystemConfiguration.framework; sourceTree = SDKROOT; }; + 3A6FC76425CBD6E10065F472 /* Security.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Security.framework; path = System/Library/Frameworks/Security.framework; sourceTree = SDKROOT; }; + 3A6FC76525CBD6E10065F472 /* CoreAudio.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreAudio.framework; path = System/Library/Frameworks/CoreAudio.framework; sourceTree = SDKROOT; }; + 3A6FC76625CBD6E10065F472 /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; }; + 3A6FC76725CBD6E10065F472 /* CoreFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreFoundation.framework; path = System/Library/Frameworks/CoreFoundation.framework; sourceTree = SDKROOT; }; + 3A6FC76825CBD6E10065F472 /* OpenGLES.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGLES.framework; path = System/Library/Frameworks/OpenGLES.framework; sourceTree = SDKROOT; }; + 3A6FC76925CBD6E10065F472 /* CFNetwork.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CFNetwork.framework; path = System/Library/Frameworks/CFNetwork.framework; sourceTree = SDKROOT; }; + 3A6FC76A25CBD6E10065F472 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; + 3A6FC76B25CBD6E10065F472 /* AVFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AVFoundation.framework; path = System/Library/Frameworks/AVFoundation.framework; sourceTree = SDKROOT; }; + 3A6FC76F25CBDB620065F472 /* ipjsua-swift-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "ipjsua-swift-Bridging-Header.h"; sourceTree = ""; }; + 3A6FC77025CBDB620065F472 /* pjsip.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = pjsip.m; sourceTree = ""; }; + 3A6FC7CD25CD1A3D0065F472 /* libpjsip-simple.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = "libpjsip-simple.a"; sourceTree = ""; }; + 3A6FC7CE25CD1A3D0065F472 /* libgsmcodec.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libgsmcodec.a; sourceTree = ""; }; + 3A6FC7CF25CD1A3D0065F472 /* libpj.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libpj.a; sourceTree = ""; }; + 3A6FC7D025CD1A3D0065F472 /* libpjsip-ua.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = "libpjsip-ua.a"; sourceTree = ""; }; + 3A6FC7D125CD1A3D0065F472 /* libresample.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libresample.a; sourceTree = ""; }; + 3A6FC7D225CD1A3D0065F472 /* libsrtp.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libsrtp.a; sourceTree = ""; }; + 3A6FC7D325CD1A3D0065F472 /* libyuv.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libyuv.a; sourceTree = ""; }; + 3A6FC7D425CD1A3D0065F472 /* libpjmedia-videodev.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = "libpjmedia-videodev.a"; sourceTree = ""; }; + 3A6FC7D525CD1A3D0065F472 /* libpjlib-util.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = "libpjlib-util.a"; sourceTree = ""; }; + 3A6FC7D625CD1A3D0065F472 /* libpjnath.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libpjnath.a; sourceTree = ""; }; + 3A6FC7D725CD1A3D0065F472 /* libpjsua.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libpjsua.a; sourceTree = ""; }; + 3A6FC7D825CD1A3D0065F472 /* libpjmedia.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libpjmedia.a; sourceTree = ""; }; + 3A6FC7D925CD1A3D0065F472 /* libspeex.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libspeex.a; sourceTree = ""; }; + 3A6FC7DA25CD1A3D0065F472 /* libg7221codec.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libg7221codec.a; sourceTree = ""; }; + 3A6FC7DB25CD1A3D0065F472 /* libpjsip.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libpjsip.a; sourceTree = ""; }; + 3A6FC7DC25CD1A3D0065F472 /* libpjsua2.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libpjsua2.a; sourceTree = ""; }; + 3A6FC7DD25CD1A3D0065F472 /* libilbccodec.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libilbccodec.a; sourceTree = ""; }; + 3A6FC7DE25CD1A3D0065F472 /* libwebrtc.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libwebrtc.a; sourceTree = ""; }; + 3A6FC7DF25CD1A3D0065F472 /* libpjmedia-codec.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = "libpjmedia-codec.a"; sourceTree = ""; }; + 3A6FC7E025CD1A3D0065F472 /* libpjmedia-audiodev.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = "libpjmedia-audiodev.a"; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 3A6FC61525CBD4540065F472 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 3A6FC7EE25CD1A3E0065F472 /* libg7221codec.a in Frameworks */, + 3A6FC7F025CD1A3E0065F472 /* libpjsua2.a in Frameworks */, + 3A6FC77625CBE3700065F472 /* AudioToolbox.framework in Frameworks */, + 3A6FC7ED25CD1A3E0065F472 /* libspeex.a in Frameworks */, + 3A6FC7E425CD1A3D0065F472 /* libpjsip-ua.a in Frameworks */, + 3A6FC77725CBE3700065F472 /* AVFoundation.framework in Frameworks */, + 3A6FC77825CBE3700065F472 /* CFNetwork.framework in Frameworks */, + 3A6FC77925CBE3700065F472 /* CoreAudio.framework in Frameworks */, + 3A6FC77A25CBE3700065F472 /* CoreFoundation.framework in Frameworks */, + 3A6FC77B25CBE3700065F472 /* CoreGraphics.framework in Frameworks */, + 3A6FC77C25CBE3700065F472 /* CoreImage.framework in Frameworks */, + 3A6FC77D25CBE3700065F472 /* CoreMedia.framework in Frameworks */, + 3A6FC77E25CBE3700065F472 /* CoreVideo.framework in Frameworks */, + 3A6FC7F225CD1A3E0065F472 /* libwebrtc.a in Frameworks */, + 3A6FC77F25CBE3700065F472 /* Foundation.framework in Frameworks */, + 3A6FC7EB25CD1A3E0065F472 /* libpjsua.a in Frameworks */, + 3A6FC78025CBE3700065F472 /* libc++.tbd in Frameworks */, + 3A6FC7EC25CD1A3E0065F472 /* libpjmedia.a in Frameworks */, + 3A6FC7E525CD1A3E0065F472 /* libresample.a in Frameworks */, + 3A6FC7E325CD1A3D0065F472 /* libpj.a in Frameworks */, + 3A6FC7E225CD1A3D0065F472 /* libgsmcodec.a in Frameworks */, + 3A6FC78125CBE3700065F472 /* OpenGLES.framework in Frameworks */, + 3A6FC7E825CD1A3E0065F472 /* libpjmedia-videodev.a in Frameworks */, + 3A6FC7E925CD1A3E0065F472 /* libpjlib-util.a in Frameworks */, + 3A6FC7EF25CD1A3E0065F472 /* libpjsip.a in Frameworks */, + 3A6FC78225CBE3700065F472 /* QuartzCore.framework in Frameworks */, + 3A6FC7E625CD1A3E0065F472 /* libsrtp.a in Frameworks */, + 3A6FC7F125CD1A3E0065F472 /* libilbccodec.a in Frameworks */, + 3A6FC7E725CD1A3E0065F472 /* libyuv.a in Frameworks */, + 3A6FC78325CBE3700065F472 /* Security.framework in Frameworks */, + 3A6FC7F425CD1A3E0065F472 /* libpjmedia-audiodev.a in Frameworks */, + 3A6FC7EA25CD1A3E0065F472 /* libpjnath.a in Frameworks */, + 3A6FC7E125CD1A3D0065F472 /* libpjsip-simple.a in Frameworks */, + 3A6FC78425CBE3700065F472 /* SystemConfiguration.framework in Frameworks */, + 3A6FC7F325CD1A3E0065F472 /* libpjmedia-codec.a in Frameworks */, + 3A6FC78525CBE3700065F472 /* UIKit.framework in Frameworks */, + 3A6FC78625CBE3700065F472 /* VideoToolbox.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 3A6FC60F25CBD4540065F472 = { + isa = PBXGroup; + children = ( + 3A6FC75A25CBD6CF0065F472 /* Frameworks */, + 3A6FC6AF25CBD5790065F472 /* Libraries */, + 3A6FC61A25CBD4540065F472 /* ipjsua-swift */, + 3A6FC61925CBD4540065F472 /* Products */, + ); + sourceTree = ""; + }; + 3A6FC61925CBD4540065F472 /* Products */ = { + isa = PBXGroup; + children = ( + 3A6FC61825CBD4540065F472 /* ipjsua-swift.app */, + ); + name = Products; + sourceTree = ""; + }; + 3A6FC61A25CBD4540065F472 /* ipjsua-swift */ = { + isa = PBXGroup; + children = ( + 3A6FC61B25CBD4540065F472 /* ipjsua_swiftApp.swift */, + 3A6FC61D25CBD4540065F472 /* ContentView.swift */, + 3A6FC61F25CBD4550065F472 /* Assets.xcassets */, + 3A6FC62425CBD4550065F472 /* Info.plist */, + 3A6FC62125CBD4550065F472 /* Preview Content */, + 3A6FC77025CBDB620065F472 /* pjsip.m */, + 3A6FC76F25CBDB620065F472 /* ipjsua-swift-Bridging-Header.h */, + ); + path = "ipjsua-swift"; + sourceTree = ""; + }; + 3A6FC62125CBD4550065F472 /* Preview Content */ = { + isa = PBXGroup; + children = ( + 3A6FC62225CBD4550065F472 /* Preview Assets.xcassets */, + ); + path = "Preview Content"; + sourceTree = ""; + }; + 3A6FC6AF25CBD5790065F472 /* Libraries */ = { + isa = PBXGroup; + children = ( + 3A6FC7DA25CD1A3D0065F472 /* libg7221codec.a */, + 3A6FC7CE25CD1A3D0065F472 /* libgsmcodec.a */, + 3A6FC7DD25CD1A3D0065F472 /* libilbccodec.a */, + 3A6FC7CF25CD1A3D0065F472 /* libpj.a */, + 3A6FC7D525CD1A3D0065F472 /* libpjlib-util.a */, + 3A6FC7E025CD1A3D0065F472 /* libpjmedia-audiodev.a */, + 3A6FC7DF25CD1A3D0065F472 /* libpjmedia-codec.a */, + 3A6FC7D425CD1A3D0065F472 /* libpjmedia-videodev.a */, + 3A6FC7D825CD1A3D0065F472 /* libpjmedia.a */, + 3A6FC7D625CD1A3D0065F472 /* libpjnath.a */, + 3A6FC7CD25CD1A3D0065F472 /* libpjsip-simple.a */, + 3A6FC7D025CD1A3D0065F472 /* libpjsip-ua.a */, + 3A6FC7DB25CD1A3D0065F472 /* libpjsip.a */, + 3A6FC7D725CD1A3D0065F472 /* libpjsua.a */, + 3A6FC7DC25CD1A3D0065F472 /* libpjsua2.a */, + 3A6FC7D125CD1A3D0065F472 /* libresample.a */, + 3A6FC7D925CD1A3D0065F472 /* libspeex.a */, + 3A6FC7D225CD1A3D0065F472 /* libsrtp.a */, + 3A6FC7DE25CD1A3D0065F472 /* libwebrtc.a */, + 3A6FC7D325CD1A3D0065F472 /* libyuv.a */, + ); + path = Libraries; + sourceTree = ""; + }; + 3A6FC75A25CBD6CF0065F472 /* Frameworks */ = { + isa = PBXGroup; + children = ( + 3A6FC75B25CBD6E10065F472 /* AudioToolbox.framework */, + 3A6FC76B25CBD6E10065F472 /* AVFoundation.framework */, + 3A6FC76925CBD6E10065F472 /* CFNetwork.framework */, + 3A6FC76525CBD6E10065F472 /* CoreAudio.framework */, + 3A6FC76725CBD6E10065F472 /* CoreFoundation.framework */, + 3A6FC75C25CBD6E10065F472 /* CoreGraphics.framework */, + 3A6FC75E25CBD6E10065F472 /* CoreImage.framework */, + 3A6FC76025CBD6E10065F472 /* CoreMedia.framework */, + 3A6FC76225CBD6E10065F472 /* CoreVideo.framework */, + 3A6FC75F25CBD6E10065F472 /* Foundation.framework */, + 3A6FC75D25CBD6E10065F472 /* libc++.tbd */, + 3A6FC76825CBD6E10065F472 /* OpenGLES.framework */, + 3A6FC76625CBD6E10065F472 /* QuartzCore.framework */, + 3A6FC76425CBD6E10065F472 /* Security.framework */, + 3A6FC76325CBD6E10065F472 /* SystemConfiguration.framework */, + 3A6FC76A25CBD6E10065F472 /* UIKit.framework */, + 3A6FC76125CBD6E10065F472 /* VideoToolbox.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 3A6FC61725CBD4540065F472 /* ipjsua-swift */ = { + isa = PBXNativeTarget; + buildConfigurationList = 3A6FC62725CBD4550065F472 /* Build configuration list for PBXNativeTarget "ipjsua-swift" */; + buildPhases = ( + 3A6FC61425CBD4540065F472 /* Sources */, + 3A6FC61525CBD4540065F472 /* Frameworks */, + 3A6FC61625CBD4540065F472 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = "ipjsua-swift"; + productName = "ipjsua-swift"; + productReference = 3A6FC61825CBD4540065F472 /* ipjsua-swift.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 3A6FC61025CBD4540065F472 /* Project object */ = { + isa = PBXProject; + attributes = { + LastSwiftUpdateCheck = 1240; + LastUpgradeCheck = 1240; + TargetAttributes = { + 3A6FC61725CBD4540065F472 = { + CreatedOnToolsVersion = 12.4; + LastSwiftMigration = 1240; + }; + }; + }; + buildConfigurationList = 3A6FC61325CBD4540065F472 /* Build configuration list for PBXProject "ipjsua-swift" */; + compatibilityVersion = "Xcode 9.3"; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 3A6FC60F25CBD4540065F472; + productRefGroup = 3A6FC61925CBD4540065F472 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 3A6FC61725CBD4540065F472 /* ipjsua-swift */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 3A6FC61625CBD4540065F472 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 3A6FC62325CBD4550065F472 /* Preview Assets.xcassets in Resources */, + 3A6FC62025CBD4550065F472 /* Assets.xcassets in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 3A6FC61425CBD4540065F472 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 3A6FC77125CBDB620065F472 /* pjsip.m in Sources */, + 3A6FC61E25CBD4540065F472 /* ContentView.swift in Sources */, + 3A6FC61C25CBD4540065F472 /* ipjsua_swiftApp.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin XCBuildConfiguration section */ + 3A6FC62525CBD4550065F472 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_BITCODE = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + HEADER_SEARCH_PATHS = ( + ../../../../pjsip/include, + ../../../../pjlib/include, + "../../../../pjlib-util/include", + ../../../../pjnath/include, + ../../../../pjmedia/include, + ); + IPHONEOS_DEPLOYMENT_TARGET = 14.4; + MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; + MTL_FAST_MATH = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + }; + name = Debug; + }; + 3A6FC62625CBD4550065F472 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_BITCODE = NO; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + HEADER_SEARCH_PATHS = ( + ../../../../pjsip/include, + ../../../../pjlib/include, + "../../../../pjlib-util/include", + ../../../../pjnath/include, + ../../../../pjmedia/include, + ); + IPHONEOS_DEPLOYMENT_TARGET = 14.4; + MTL_ENABLE_DEBUG_INFO = NO; + MTL_FAST_MATH = YES; + SDKROOT = iphoneos; + SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_OPTIMIZATION_LEVEL = "-O"; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 3A6FC62825CBD4550065F472 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; + CLANG_ENABLE_MODULES = YES; + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_ASSET_PATHS = "\"ipjsua-swift/Preview Content\""; + DEVELOPMENT_TEAM = 93NHJQ455P; + ENABLE_PREVIEWS = YES; + INFOPLIST_FILE = "ipjsua-swift/Info.plist"; + IPHONEOS_DEPLOYMENT_TARGET = 14.0; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + LIBRARY_SEARCH_PATHS = ( + "$(inherited)", + "$(SRCROOT)", + "$(SRCROOT)/Libraries", + "\"$(SRCROOT)/../../../../pjlib/lib\"", + "\"$(SRCROOT)/../../../../pjlib-util/lib\"", + "\"$(SRCROOT)/../../../../pjmedia/lib\"", + "\"$(SRCROOT)/../../../../pjnath/lib\"", + "\"$(SRCROOT)/../../../../pjsip/lib\"", + "\"$(SRCROOT)/../../../../third_party/lib\"", + "$(PROJECT_DIR)", + "$(PROJECT_DIR)/Libraries", + ); + PRODUCT_BUNDLE_IDENTIFIER = "com.teluu.ipjsua-swift"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_OBJC_BRIDGING_HEADER = "ipjsua-swift/ipjsua-swift-Bridging-Header.h"; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + 3A6FC62925CBD4550065F472 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; + CLANG_ENABLE_MODULES = YES; + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_ASSET_PATHS = "\"ipjsua-swift/Preview Content\""; + DEVELOPMENT_TEAM = 93NHJQ455P; + ENABLE_PREVIEWS = YES; + INFOPLIST_FILE = "ipjsua-swift/Info.plist"; + IPHONEOS_DEPLOYMENT_TARGET = 14.0; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + LIBRARY_SEARCH_PATHS = ( + "$(inherited)", + "$(SRCROOT)", + "$(SRCROOT)/Libraries", + "\"$(SRCROOT)/../../../../pjlib/lib\"", + "\"$(SRCROOT)/../../../../pjlib-util/lib\"", + "\"$(SRCROOT)/../../../../pjmedia/lib\"", + "\"$(SRCROOT)/../../../../pjnath/lib\"", + "\"$(SRCROOT)/../../../../pjsip/lib\"", + "\"$(SRCROOT)/../../../../third_party/lib\"", + "$(PROJECT_DIR)", + "$(PROJECT_DIR)/Libraries", + ); + PRODUCT_BUNDLE_IDENTIFIER = "com.teluu.ipjsua-swift"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_OBJC_BRIDGING_HEADER = "ipjsua-swift/ipjsua-swift-Bridging-Header.h"; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 3A6FC61325CBD4540065F472 /* Build configuration list for PBXProject "ipjsua-swift" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 3A6FC62525CBD4550065F472 /* Debug */, + 3A6FC62625CBD4550065F472 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 3A6FC62725CBD4550065F472 /* Build configuration list for PBXNativeTarget "ipjsua-swift" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 3A6FC62825CBD4550065F472 /* Debug */, + 3A6FC62925CBD4550065F472 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 3A6FC61025CBD4540065F472 /* Project object */; +} diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip-apps/src/pjsua/ios-swift/ipjsua-swift.xcodeproj/project.xcworkspace/contents.xcworkspacedata asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip-apps/src/pjsua/ios-swift/ipjsua-swift.xcodeproj/project.xcworkspace/contents.xcworkspacedata --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip-apps/src/pjsua/ios-swift/ipjsua-swift.xcodeproj/project.xcworkspace/contents.xcworkspacedata 1970-01-01 00:00:00.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip-apps/src/pjsua/ios-swift/ipjsua-swift.xcodeproj/project.xcworkspace/contents.xcworkspacedata 2022-02-24 07:54:38.000000000 +0000 @@ -0,0 +1,7 @@ + + + + + diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip-apps/src/pjsua/ios-swift/ipjsua-swift.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip-apps/src/pjsua/ios-swift/ipjsua-swift.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip-apps/src/pjsua/ios-swift/ipjsua-swift.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist 1970-01-01 00:00:00.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip-apps/src/pjsua/ios-swift/ipjsua-swift.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist 2022-02-24 07:54:38.000000000 +0000 @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip-apps/src/pjsua/main.c asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip-apps/src/pjsua/main.c --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip-apps/src/pjsua/main.c 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip-apps/src/pjsua/main.c 2022-02-24 07:54:38.000000000 +0000 @@ -80,7 +80,37 @@ SetConsoleCtrlHandler(&CtrlHandler, TRUE); } +#elif PJ_LINUX || PJ_DARWINOS + +#include +#include +#include +#include +#include +static void print_stack(int sig) +{ + void *array[16]; + size_t size; + + size = backtrace(array, 16); + fprintf(stderr, "Error: signal %d:\n", sig); + backtrace_symbols_fd(array, size, STDERR_FILENO); + exit(1); +} + +static void setup_socket_signal() +{ + signal(SIGPIPE, SIG_IGN); +} + +static void setup_signal_handler(void) +{ + signal(SIGSEGV, &print_stack); + signal(SIGABRT, &print_stack); +} + #else + #include static void setup_socket_signal() @@ -89,6 +119,7 @@ } static void setup_signal_handler(void) {} + #endif int main_func(int argc, char *argv[]) @@ -126,5 +157,7 @@ int main(int argc, char *argv[]) { + pj_log_set_level(1); + return pj_run_app(&main_func, argc, argv, 0); } diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip-apps/src/pjsua/pjsua_app.c asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip-apps/src/pjsua/pjsua_app.c --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip-apps/src/pjsua/pjsua_app.c 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip-apps/src/pjsua/pjsua_app.c 2022-02-24 07:54:38.000000000 +0000 @@ -205,8 +205,10 @@ find_next_call(); } - /* Dump media state upon disconnected */ - if (1) { + /* Dump media state upon disconnected. + * Now pjsua_media_channel_deinit() automatically log the call dump. + */ + if (0) { PJ_LOG(5,(THIS_FILE, "Call %d disconnected, dumping media stats..", call_id)); @@ -271,6 +273,24 @@ } } +/* + * Handler when audio stream is destroyed. + */ +static void on_stream_destroyed(pjsua_call_id call_id, + pjmedia_stream *strm, + unsigned stream_idx) +{ + PJ_UNUSED_ARG(strm); + + /* Now pjsua_media_channel_deinit() automatically log the call dump. */ + if (0) { + PJ_LOG(5,(THIS_FILE, + "Call %d stream %d destroyed, dumping media stats..", + call_id, stream_idx)); + log_call_dump(call_id); + } +} + /** * Handler when there is incoming call. */ @@ -288,8 +308,7 @@ current_call = call_id; #ifdef USE_GUI - if (!showNotification(call_id)) - return; + showNotification(call_id); #endif /* Start ringback */ @@ -383,6 +402,10 @@ call_conf_slot = ci->media[mi].stream.aud.conf_slot; + /* Make sure conf slot is valid (e.g: media dir is not "inactive") */ + if (call_conf_slot == PJSUA_INVALID_ID) + return; + /* Loopback sound, if desired */ if (app_config.auto_loop) { pjsua_conf_connect(call_conf_slot, call_conf_slot); @@ -822,9 +845,11 @@ case PJSIP_TP_STATE_DISCONNECTED: { char buf[100]; + int len; - snprintf(buf, sizeof(buf), "SIP %s transport is disconnected " - "from %s", tp->type_name, host_port); + len = pj_ansi_snprintf(buf, sizeof(buf), "SIP %s transport is " + "disconnected from %s", tp->type_name, host_port); + PJ_CHECK_TRUNC_STR(len, buf, sizeof(buf)); pjsua_perror(THIS_FILE, buf, info->status); } break; @@ -1152,8 +1177,12 @@ srv->hvalue = pj_str("pjsua simple registrar"); pjsip_msg_add_hdr(tdata->msg, (pjsip_hdr*)srv); - pjsip_endpt_send_response2(pjsua_get_pjsip_endpt(), + status = pjsip_endpt_send_response2(pjsua_get_pjsip_endpt(), rdata, tdata, NULL, NULL); + if (status != PJ_SUCCESS) { + pjsip_tx_data_dec_ref(tdata); + } + } /***************************************************************************** @@ -1227,8 +1256,9 @@ pjsip_msg_add_hdr(tdata->msg, h); } - pjsip_endpt_send_response2(pjsua_get_pjsip_endpt(), rdata, tdata, + status = pjsip_endpt_send_response2(pjsua_get_pjsip_endpt(), rdata, tdata, NULL, NULL); + if (status != PJ_SUCCESS) pjsip_tx_data_dec_ref(tdata); return PJ_TRUE; } @@ -1315,6 +1345,7 @@ return 0; } + static pj_status_t app_init(void) { pjsua_transport_id transport_id = -1; @@ -1349,6 +1380,7 @@ /* Initialize application callbacks */ app_config.cfg.cb.on_call_state = &on_call_state; + app_config.cfg.cb.on_stream_destroyed = &on_stream_destroyed; app_config.cfg.cb.on_call_media_state = &on_call_media_state; app_config.cfg.cb.on_incoming_call = &on_incoming_call; app_config.cfg.cb.on_dtmf_digit2 = &call_on_dtmf_callback2; @@ -2013,11 +2045,15 @@ /* Close avi devs and ports */ for (i=0; ipool, ¶m->choice[param->cnt].desc, desc); if (++param->cnt >= param->max_cnt) @@ -493,22 +495,28 @@ unsigned i, count = PJ_ARRAY_SIZE(c); char codec_id[64]; char desc[128]; + pj_str_t all_codec_id = pj_str("*"); pjsua_enum_codecs(c, &count); - for (i=0; ipool, ¶m->choice[param->cnt].value, codec_id); - - pj_ansi_snprintf(desc, sizeof(desc), - "Audio, prio: %d%s%.*s", - c[i].priority, - c[i].desc.slen? " - ":"", - (int)c[i].desc.slen, - c[i].desc.ptr); + pj_ansi_snprintf(codec_id, sizeof(codec_id), + "%.*s", (int)cid.slen, cid.ptr); + if (i < count) { + pj_ansi_snprintf(desc, sizeof(desc), + "Audio, prio: %d%s%.*s", + c[i].priority, + c[i].desc.slen ? " - " : "", + (int)c[i].desc.slen, + c[i].desc.ptr); + } else { + pj_ansi_snprintf(desc, sizeof(desc), "Audio (All)"); + } + pj_strdup2(param->pool, ¶m->choice[param->cnt].value, + codec_id); pj_strdup2(param->pool, ¶m->choice[param->cnt].desc, desc); if (++param->cnt >= param->max_cnt) break; @@ -617,32 +625,45 @@ unsigned i, count = PJ_ARRAY_SIZE(ci); char codec_id[64]; char desc[128]; + pj_str_t all_codec_id = pj_str("*"); pjsua_vid_enum_codecs(ci, &count); - for (i=0; ipool, ¶m->choice[param->cnt].value, codec_id); - - pj_ansi_snprintf(desc, sizeof(desc), - "Video, p[%d], f[%.2f], b[%d/%d], s[%dx%d]", - ci[i].priority, - (vfd->fps.num*1.0/vfd->fps.denum), - vfd->avg_bps/1000, vfd->max_bps/1000, - vfd->size.w, vfd->size.h); + if (i < count) { + pj_ansi_snprintf(desc, sizeof(desc), + "Video, p[%d], f[%.2f], b[%d/%d], s[%dx%d]", + ci[i].priority, + (vfd->fps.num*1.0 / vfd->fps.denum), + vfd->avg_bps / 1000, vfd->max_bps / 1000, + vfd->size.w, vfd->size.h); + } else { + pj_ansi_snprintf(desc, sizeof(desc), "Video (All)"); + } + pj_strdup2(param->pool, ¶m->choice[param->cnt].value, + codec_id); pj_strdup2(param->pool, ¶m->choice[param->cnt].desc, desc); if (++param->cnt >= param->max_cnt) break; @@ -775,7 +796,7 @@ acc_cfg.id = cval->argv[1]; acc_cfg.reg_uri = cval->argv[2]; acc_cfg.cred_count = 1; - acc_cfg.cred_info[0].scheme = pj_str("Digest"); + acc_cfg.cred_info[0].scheme = pjsip_DIGEST_STR; acc_cfg.cred_info[0].realm = cval->argv[3]; acc_cfg.cred_info[0].username = cval->argv[4]; acc_cfg.cred_info[0].data_type = 0; @@ -798,7 +819,7 @@ char out_str[64]; unsigned str_len; - int i = my_atoi(cval->argv[1].ptr); + int i = my_atoi2(&cval->argv[1]); if (!pjsua_acc_is_valid(i)) { pj_ansi_snprintf(out_str, sizeof(out_str), @@ -839,7 +860,7 @@ /* Select account to be used for sending outgoing request */ static pj_status_t cmd_next_account(pj_cli_cmd_val *cval) { - int i = my_atoi(cval->argv[1].ptr); + int i = my_atoi2(&cval->argv[1]); if (pjsua_acc_is_valid(i)) { pjsua_acc_set_default(i); PJ_LOG(3,(THIS_FILE, "Current account changed to %d", i)); @@ -967,7 +988,7 @@ /* Delete buddy */ static pj_status_t cmd_del_buddy(pj_cli_cmd_val *cval) { - int i = my_atoi(cval->argv[1].ptr) - 1; + int i = my_atoi2(&cval->argv[1]) - 1; char out_str[80]; if (!pjsua_buddy_is_valid(i)) { @@ -1777,8 +1798,6 @@ pj_str_t STR_FALSE = { "false", 5 }; pjsua_call_id ids[PJSUA_MAX_CALLS]; pjsua_msg_data msg_data_; - char buf[8] = {0}; - pj_str_t tmp = pj_str(buf); unsigned count; static const pj_str_t err_invalid_num = {"Invalid destination call number\n", 32 }; @@ -1794,8 +1813,7 @@ return PJ_SUCCESS; } - pj_strncpy_with_null(&tmp, &cval->argv[1], sizeof(buf)); - dst_call = my_atoi(tmp.ptr); + dst_call = my_atoi2(&cval->argv[1]); /* Check if call is still there. */ if (call != current_call) { diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip-apps/src/pjsua/pjsua_app_common.c asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip-apps/src/pjsua/pjsua_app_common.c --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip-apps/src/pjsua/pjsua_app_common.c 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip-apps/src/pjsua/pjsua_app_common.c 2022-02-24 07:54:38.000000000 +0000 @@ -45,8 +45,15 @@ int my_atoi(const char *cs) { pj_str_t s; - pj_cstr(&s, cs); + return my_atoi2(&s); +} + +int my_atoi2(const pj_str_t *str) +{ + const char *cs = str->ptr; + pj_str_t s = *str; + if (cs[0] == '-') { s.ptr++; s.slen--; return 0 - (int)pj_strtoul(&s); diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip-apps/src/pjsua/pjsua_app_common.h asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip-apps/src/pjsua/pjsua_app_common.h --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip-apps/src/pjsua/pjsua_app_common.h 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip-apps/src/pjsua/pjsua_app_common.h 2022-02-24 07:54:38.000000000 +0000 @@ -169,6 +169,7 @@ extern pj_bool_t app_running; int my_atoi(const char *cs); +int my_atoi2(const pj_str_t *s); pj_bool_t find_next_call(void); pj_bool_t find_prev_call(void); void send_request(char *cstr_method, const pj_str_t *dst_uri); diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip-apps/src/pjsua/pjsua_app_config.c asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip-apps/src/pjsua/pjsua_app_config.c --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip-apps/src/pjsua/pjsua_app_config.c 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip-apps/src/pjsua/pjsua_app_config.c 2022-02-24 07:54:38.000000000 +0000 @@ -152,7 +152,7 @@ puts (" --ec-tail=MSEC Set echo canceller tail length (default=" xstr(PJSUA_DEFAULT_EC_TAIL_LEN) ")"); puts (" --ec-opt=OPT Select echo canceller algorithm (0=default, "); - puts (" 1=speex, 2=suppressor, 3=WebRtc)"); + puts (" 1=speex, 2=suppressor, 3=WebRtc, 4=WebRtc AEC3)"); puts (" --ilbc-mode=MODE Set iLBC codec mode (20 or 30, default is " xstr(PJSUA_DEFAULT_ILBC_MODE) ")"); puts (" --capture-dev=id Audio capture device ID (default=-1)"); @@ -182,6 +182,7 @@ puts ("Media Transport Options:"); puts (" --use-ice Enable ICE (default:no)"); puts (" --ice-regular Use ICE regular nomination (default: aggressive)"); + puts (" --ice-trickle=N Use trickle ICE? 0:disabled, 1:half, 2:full (default=0)"); puts (" --ice-max-hosts=N Set maximum number of ICE host candidates"); puts (" --ice-no-rtcp Disable RTCP component in ICE (default: no)"); puts (" --rtp-port=N Base port to try for RTP (default=4000)"); @@ -370,7 +371,8 @@ OPT_ADD_BUDDY, OPT_OFFER_X_MS_MSG, OPT_NO_PRESENCE, OPT_AUTO_ANSWER, OPT_AUTO_PLAY, OPT_AUTO_PLAY_HANGUP, OPT_AUTO_LOOP, OPT_AUTO_CONF, OPT_CLOCK_RATE, OPT_SND_CLOCK_RATE, OPT_STEREO, - OPT_USE_ICE, OPT_ICE_REGULAR, OPT_USE_SRTP, OPT_SRTP_SECURE, + OPT_USE_ICE, OPT_ICE_REGULAR, OPT_ICE_TRICKLE, + OPT_USE_SRTP, OPT_SRTP_SECURE, OPT_USE_TURN, OPT_ICE_MAX_HOSTS, OPT_ICE_NO_RTCP, OPT_TURN_SRV, OPT_TURN_TCP, OPT_TURN_USER, OPT_TURN_PASSWD, OPT_TURN_TLS, OPT_TURN_TLS_CA_FILE, OPT_TURN_TLS_CERT_FILE, @@ -462,9 +464,10 @@ { "use-ice", 0, 0, OPT_USE_ICE}, { "ice-regular",0, 0, OPT_ICE_REGULAR}, - { "use-turn", 0, 0, OPT_USE_TURN}, + { "ice-trickle",1, 0, OPT_ICE_TRICKLE}, { "ice-max-hosts",1, 0, OPT_ICE_MAX_HOSTS}, { "ice-no-rtcp",0, 0, OPT_ICE_NO_RTCP}, + { "use-turn", 0, 0, OPT_USE_TURN}, { "turn-srv", 1, 0, OPT_TURN_SRV}, { "turn-tcp", 0, 0, OPT_TURN_TCP}, #if PJ_HAS_SSL_SOCK @@ -635,7 +638,9 @@ case OPT_NO_STDERR: #if !defined(PJ_WIN32_WINCE) || PJ_WIN32_WINCE==0 - freopen("/dev/null", "w", stderr); + if (!freopen("/dev/null", "w", stderr)) { + PJ_LOG(4,(THIS_FILE, "Failed reopening dev/null")); + } #endif break; @@ -883,7 +888,7 @@ case OPT_USERNAME: /* Default authentication user */ cur_acc->cred_info[cur_acc->cred_count].username = pj_str(pj_optarg); - cur_acc->cred_info[cur_acc->cred_count].scheme = pj_str("Digest"); + cur_acc->cred_info[cur_acc->cred_count].scheme = pjsip_DIGEST_STR; break; case OPT_REALM: /* Default authentication realm. */ @@ -1007,6 +1012,22 @@ cur_acc->ice_cfg.ice_opt.aggressive = PJ_FALSE; break; + case OPT_ICE_TRICKLE: + cfg->media_cfg.ice_opt.trickle = + cur_acc->ice_cfg.ice_opt.trickle = my_atoi(pj_optarg); + + if (!pj_isdigit(*pj_optarg) || cfg->media_cfg.ice_opt.trickle>2) { + PJ_LOG(1,(THIS_FILE, "Invalid value for --ice-trickle option")); + return -1; + } + + /* Automatically disable ICE aggressive mode */ + if (cfg->media_cfg.ice_opt.trickle > 0) { + cfg->media_cfg.ice_opt.aggressive = + cur_acc->ice_cfg.ice_opt.aggressive = PJ_FALSE; + } + break; + case OPT_USE_TURN: cfg->media_cfg.enable_turn = cur_acc->turn_cfg.enable_turn = PJ_TRUE; @@ -1249,6 +1270,8 @@ case OPT_EC_OPT: cfg->media_cfg.ec_options = my_atoi(pj_optarg); + if (cfg->media_cfg.ec_options > 0) + cfg->media_cfg.ec_options |= PJMEDIA_ECHO_USE_SW_ECHO; break; case OPT_QUALITY: @@ -1830,6 +1853,12 @@ if (acc_cfg->ice_cfg.ice_opt.aggressive == PJ_FALSE) pj_strcat2(result, "--ice-regular\n"); + if (acc_cfg->ice_cfg.ice_opt.trickle > 0) { + pj_ansi_sprintf(line, "--ice-trickle %d\n", + acc_cfg->ice_cfg.ice_opt.trickle); + pj_strcat2(result, line); + } + if (acc_cfg->turn_cfg.enable_turn) pj_strcat2(result, "--use-turn\n"); diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip-apps/src/pjsua/pjsua_app_legacy.c asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip-apps/src/pjsua/pjsua_app_legacy.c --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip-apps/src/pjsua/pjsua_app_legacy.c 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip-apps/src/pjsua/pjsua_app_legacy.c 2022-02-24 07:54:38.000000000 +0000 @@ -296,7 +296,7 @@ puts("| vid win show|hide ID Show/hide the specified video window ID |"); puts("| vid win move ID X Y Move window ID to position X,Y |"); puts("| vid win resize ID w h Resize window ID to the specified width, height |"); - puts("| vid win full on|off ID Set fullscreen on/off for window ID |"); + puts("| vid win full off|on|dt ID Set fullscreen off/on/desktop for window ID |"); puts("| vid conf list List all video ports in video conference bridge |"); puts("| vid conf cc P Q Connect port P to Q in the video conf bridge |"); puts("| vid conf cd P Q Disconnect port P to Q in the video conf bridge |"); @@ -308,7 +308,7 @@ static void vid_handle_menu(char *menuin) { - char *argv[8]; + char *argv[8] = {NULL}; int argc = 0; /* Tokenize */ @@ -503,8 +503,12 @@ } else if (argc==5 && (strcmp(argv[2], "full")==0)) { pjsua_vid_win_id wid = atoi(argv[4]); - pj_bool_t fullscreen = (strcmp(argv[3], "on")==0); - status = pjsua_vid_win_set_fullscreen(wid, fullscreen); + pjmedia_vid_dev_fullscreen_flag mode = PJMEDIA_VID_DEV_WINDOWED; + if (strcmp(argv[3], "on")==0) + mode = PJMEDIA_VID_DEV_FULLSCREEN; + else if (strcmp(argv[3], "dt")==0) + mode = PJMEDIA_VID_DEV_FULLSCREEN_DESKTOP; + status = pjsua_vid_win_set_fullscreen(wid, mode); } else goto on_error; @@ -1002,7 +1006,7 @@ acc_cfg.id = pj_str(id); acc_cfg.reg_uri = pj_str(registrar); acc_cfg.cred_count = 1; - acc_cfg.cred_info[0].scheme = pj_str("Digest"); + acc_cfg.cred_info[0].scheme = pjsip_DIGEST_STR; acc_cfg.cred_info[0].realm = pj_str(realm); acc_cfg.cred_info[0].username = pj_str(uname); acc_cfg.cred_info[0].data_type = 0; @@ -1591,7 +1595,7 @@ static void ui_conf_list() { unsigned i, count; - pjsua_conf_port_id id[PJSUA_MAX_CALLS]; + pjsua_conf_port_id id[PJSUA_MAX_CONF_PORTS]; printf("Conference ports:\n"); diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip-apps/src/pjsua/winrt/cli/uwp/pjsua_cli_uwp.csproj asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip-apps/src/pjsua/winrt/cli/uwp/pjsua_cli_uwp.csproj --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip-apps/src/pjsua/winrt/cli/uwp/pjsua_cli_uwp.csproj 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip-apps/src/pjsua/winrt/cli/uwp/pjsua_cli_uwp.csproj 2022-02-24 07:54:38.000000000 +0000 @@ -146,7 +146,7 @@ 14.0 - + + + + + + + + + + + + + + + + + + + + + + diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip-apps/src/pjsua2/ios-swift-pjsua2/ios-swift-pjsua2/View/Base.lproj/Main.storyboard asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip-apps/src/pjsua2/ios-swift-pjsua2/ios-swift-pjsua2/View/Base.lproj/Main.storyboard --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip-apps/src/pjsua2/ios-swift-pjsua2/ios-swift-pjsua2/View/Base.lproj/Main.storyboard 1970-01-01 00:00:00.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip-apps/src/pjsua2/ios-swift-pjsua2/ios-swift-pjsua2/View/Base.lproj/Main.storyboard 2022-02-24 07:54:38.000000000 +0000 @@ -0,0 +1,380 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip-apps/src/pjsua2/ios-swift-pjsua2/ios-swift-pjsua2.xcodeproj/project.pbxproj asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip-apps/src/pjsua2/ios-swift-pjsua2/ios-swift-pjsua2.xcodeproj/project.pbxproj --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip-apps/src/pjsua2/ios-swift-pjsua2/ios-swift-pjsua2.xcodeproj/project.pbxproj 1970-01-01 00:00:00.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip-apps/src/pjsua2/ios-swift-pjsua2/ios-swift-pjsua2.xcodeproj/project.pbxproj 2022-02-24 07:54:38.000000000 +0000 @@ -0,0 +1,577 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 50; + objects = { + +/* Begin PBXBuildFile section */ + C337417325BADEEE007785D7 /* Model.swift in Sources */ = {isa = PBXBuildFile; fileRef = C337417225BADEEE007785D7 /* Model.swift */; }; + C351398125A5F70D00A090AA /* libg7221codec.a in Frameworks */ = {isa = PBXBuildFile; fileRef = C3B8521F25A5EC380037A8AB /* libg7221codec.a */; }; + C351398225A5F70D00A090AA /* libgsmcodec.a in Frameworks */ = {isa = PBXBuildFile; fileRef = C3B8521A25A5EC380037A8AB /* libgsmcodec.a */; }; + C351398325A5F70D00A090AA /* libilbccodec.a in Frameworks */ = {isa = PBXBuildFile; fileRef = C3B8522825A5EC380037A8AB /* libilbccodec.a */; }; + C351398425A5F70D00A090AA /* libpj.a in Frameworks */ = {isa = PBXBuildFile; fileRef = C3B8522225A5EC380037A8AB /* libpj.a */; }; + C351398525A5F70D00A090AA /* libpjlib-util.a in Frameworks */ = {isa = PBXBuildFile; fileRef = C3B8522625A5EC380037A8AB /* libpjlib-util.a */; }; + C351398625A5F70D00A090AA /* libpjmedia-audiodev.a in Frameworks */ = {isa = PBXBuildFile; fileRef = C3B8522425A5EC380037A8AB /* libpjmedia-audiodev.a */; }; + C351398725A5F70D00A090AA /* libpjmedia-codec.a in Frameworks */ = {isa = PBXBuildFile; fileRef = C3B8522125A5EC380037A8AB /* libpjmedia-codec.a */; }; + C351398825A5F70D00A090AA /* libpjmedia-videodev.a in Frameworks */ = {isa = PBXBuildFile; fileRef = C3B8521825A5EC380037A8AB /* libpjmedia-videodev.a */; }; + C351398925A5F70D00A090AA /* libpjmedia.a in Frameworks */ = {isa = PBXBuildFile; fileRef = C3B8521E25A5EC380037A8AB /* libpjmedia.a */; }; + C351398A25A5F70D00A090AA /* libpjnath.a in Frameworks */ = {isa = PBXBuildFile; fileRef = C3B8522025A5EC380037A8AB /* libpjnath.a */; }; + C351398B25A5F70D00A090AA /* libpjsip-simple.a in Frameworks */ = {isa = PBXBuildFile; fileRef = C3B8522725A5EC380037A8AB /* libpjsip-simple.a */; }; + C351398C25A5F70D00A090AA /* libpjsip-ua.a in Frameworks */ = {isa = PBXBuildFile; fileRef = C3B8521D25A5EC380037A8AB /* libpjsip-ua.a */; }; + C351398D25A5F70D00A090AA /* libpjsip.a in Frameworks */ = {isa = PBXBuildFile; fileRef = C3B8522325A5EC380037A8AB /* libpjsip.a */; }; + C351398E25A5F70D00A090AA /* libpjsua.a in Frameworks */ = {isa = PBXBuildFile; fileRef = C3B8521925A5EC380037A8AB /* libpjsua.a */; }; + C351398F25A5F70D00A090AA /* libpjsua2.a in Frameworks */ = {isa = PBXBuildFile; fileRef = C3B8521C25A5EC380037A8AB /* libpjsua2.a */; }; + C351399025A5F70D00A090AA /* libresample.a in Frameworks */ = {isa = PBXBuildFile; fileRef = C3B8522925A5EC380037A8AB /* libresample.a */; }; + C351399125A5F70D00A090AA /* libspeex.a in Frameworks */ = {isa = PBXBuildFile; fileRef = C3B8521B25A5EC380037A8AB /* libspeex.a */; }; + C351399225A5F70D00A090AA /* libsrtp.a in Frameworks */ = {isa = PBXBuildFile; fileRef = C3B8522525A5EC380037A8AB /* libsrtp.a */; }; + C351399325A5F70D00A090AA /* libwebrtc.a in Frameworks */ = {isa = PBXBuildFile; fileRef = C3B8522A25A5EC380037A8AB /* libwebrtc.a */; }; + C351399425A5F70D00A090AA /* libyuv.a in Frameworks */ = {isa = PBXBuildFile; fileRef = C3B8522B25A5EC380037A8AB /* libyuv.a */; }; + C374860825B84FA100FBE972 /* OutgoingViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = C374860725B84FA100FBE972 /* OutgoingViewController.swift */; }; + C399A57125AF2721000F742A /* IncomingViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = C399A57025AF2721000F742A /* IncomingViewController.swift */; }; + C3AB889B25A734B400224276 /* wrapper.mm in Sources */ = {isa = PBXBuildFile; fileRef = C3AB889A25A734B400224276 /* wrapper.mm */; }; + C3AB88A025A7358700224276 /* CustomPJSUA2.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C3AB889E25A7358700224276 /* CustomPJSUA2.cpp */; }; + C3B851FF25A5EA6C0037A8AB /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = C3B851FE25A5EA6C0037A8AB /* AppDelegate.swift */; }; + C3B8520125A5EA6C0037A8AB /* SceneDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = C3B8520025A5EA6C0037A8AB /* SceneDelegate.swift */; }; + C3B8520325A5EA6C0037A8AB /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = C3B8520225A5EA6C0037A8AB /* ViewController.swift */; }; + C3B8520625A5EA6C0037A8AB /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = C3B8520425A5EA6C0037A8AB /* Main.storyboard */; }; + C3B8520825A5EA6D0037A8AB /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = C3B8520725A5EA6D0037A8AB /* Assets.xcassets */; }; + C3B8520B25A5EA6D0037A8AB /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = C3B8520925A5EA6D0037A8AB /* LaunchScreen.storyboard */; }; + C3B8524325A5EC940037A8AB /* AVFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C3B8524125A5EC940037A8AB /* AVFoundation.framework */; }; + C3B8524425A5EC940037A8AB /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C3B8524225A5EC940037A8AB /* Foundation.framework */; }; + C3B8524725A5ED6D0037A8AB /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C3B8524625A5ED6D0037A8AB /* AudioToolbox.framework */; }; + C3C4082E25B9A547002C19EB /* ActiveViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = C3C4082D25B9A547002C19EB /* ActiveViewController.swift */; }; +/* End PBXBuildFile section */ + +/* Begin PBXFileReference section */ + C337417225BADEEE007785D7 /* Model.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Model.swift; sourceTree = ""; }; + C374860725B84FA100FBE972 /* OutgoingViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OutgoingViewController.swift; sourceTree = ""; }; + C399A57025AF2721000F742A /* IncomingViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = IncomingViewController.swift; sourceTree = ""; }; + C3AB889A25A734B400224276 /* wrapper.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = wrapper.mm; sourceTree = ""; }; + C3AB889E25A7358700224276 /* CustomPJSUA2.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = CustomPJSUA2.cpp; sourceTree = ""; }; + C3AB889F25A7358700224276 /* CustomPJSUA2.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = CustomPJSUA2.hpp; sourceTree = ""; }; + C3AB88AA25A73F3100224276 /* wrapper.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = wrapper.h; sourceTree = ""; }; + C3B851FB25A5EA6C0037A8AB /* ios-swift-pjsua2.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "ios-swift-pjsua2.app"; sourceTree = BUILT_PRODUCTS_DIR; }; + C3B851FE25A5EA6C0037A8AB /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; + C3B8520025A5EA6C0037A8AB /* SceneDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SceneDelegate.swift; sourceTree = ""; }; + C3B8520225A5EA6C0037A8AB /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; + C3B8520525A5EA6C0037A8AB /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + C3B8520725A5EA6D0037A8AB /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + C3B8520A25A5EA6D0037A8AB /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; + C3B8520C25A5EA6D0037A8AB /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + C3B8521325A5EBF00037A8AB /* ios-swift-pjsua2-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "ios-swift-pjsua2-Bridging-Header.h"; sourceTree = ""; }; + C3B8521825A5EC380037A8AB /* libpjmedia-videodev.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = "libpjmedia-videodev.a"; path = "../PJSip-Build/pjproject/pjmedia/lib/libpjmedia-videodev.a"; sourceTree = ""; }; + C3B8521925A5EC380037A8AB /* libpjsua.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libpjsua.a; path = "../PJSip-Build/pjproject/pjsip/lib/libpjsua.a"; sourceTree = ""; }; + C3B8521A25A5EC380037A8AB /* libgsmcodec.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libgsmcodec.a; path = "../PJSip-Build/pjproject/third_party/lib/libgsmcodec.a"; sourceTree = ""; }; + C3B8521B25A5EC380037A8AB /* libspeex.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libspeex.a; path = "../PJSip-Build/pjproject/third_party/lib/libspeex.a"; sourceTree = ""; }; + C3B8521C25A5EC380037A8AB /* libpjsua2.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libpjsua2.a; path = "../PJSip-Build/pjproject/pjsip/lib/libpjsua2.a"; sourceTree = ""; }; + C3B8521D25A5EC380037A8AB /* libpjsip-ua.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = "libpjsip-ua.a"; path = "../PJSip-Build/pjproject/pjsip/lib/libpjsip-ua.a"; sourceTree = ""; }; + C3B8521E25A5EC380037A8AB /* libpjmedia.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libpjmedia.a; path = "../PJSip-Build/pjproject/pjmedia/lib/libpjmedia.a"; sourceTree = ""; }; + C3B8521F25A5EC380037A8AB /* libg7221codec.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libg7221codec.a; path = "../PJSip-Build/pjproject/third_party/lib/libg7221codec.a"; sourceTree = ""; }; + C3B8522025A5EC380037A8AB /* libpjnath.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libpjnath.a; path = "../PJSip-Build/pjproject/pjnath/lib/libpjnath.a"; sourceTree = ""; }; + C3B8522125A5EC380037A8AB /* libpjmedia-codec.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = "libpjmedia-codec.a"; path = "../PJSip-Build/pjproject/pjmedia/lib/libpjmedia-codec.a"; sourceTree = ""; }; + C3B8522225A5EC380037A8AB /* libpj.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libpj.a; path = "../PJSip-Build/pjproject/pjlib/lib/libpj.a"; sourceTree = ""; }; + C3B8522325A5EC380037A8AB /* libpjsip.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libpjsip.a; path = "../PJSip-Build/pjproject/pjsip/lib/libpjsip.a"; sourceTree = ""; }; + C3B8522425A5EC380037A8AB /* libpjmedia-audiodev.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = "libpjmedia-audiodev.a"; path = "../PJSip-Build/pjproject/pjmedia/lib/libpjmedia-audiodev.a"; sourceTree = ""; }; + C3B8522525A5EC380037A8AB /* libsrtp.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libsrtp.a; path = "../PJSip-Build/pjproject/third_party/lib/libsrtp.a"; sourceTree = ""; }; + C3B8522625A5EC380037A8AB /* libpjlib-util.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = "libpjlib-util.a"; path = "../PJSip-Build/pjproject/pjlib-util/lib/libpjlib-util.a"; sourceTree = ""; }; + C3B8522725A5EC380037A8AB /* libpjsip-simple.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = "libpjsip-simple.a"; path = "../PJSip-Build/pjproject/pjsip/lib/libpjsip-simple.a"; sourceTree = ""; }; + C3B8522825A5EC380037A8AB /* libilbccodec.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libilbccodec.a; path = "../PJSip-Build/pjproject/third_party/lib/libilbccodec.a"; sourceTree = ""; }; + C3B8522925A5EC380037A8AB /* libresample.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libresample.a; path = "../PJSip-Build/pjproject/third_party/lib/libresample.a"; sourceTree = ""; }; + C3B8522A25A5EC380037A8AB /* libwebrtc.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libwebrtc.a; path = "../PJSip-Build/pjproject/third_party/lib/libwebrtc.a"; sourceTree = ""; }; + C3B8522B25A5EC380037A8AB /* libyuv.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libyuv.a; path = "../PJSip-Build/pjproject/third_party/lib/libyuv.a"; sourceTree = ""; }; + C3B8524125A5EC940037A8AB /* AVFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AVFoundation.framework; path = System/Library/Frameworks/AVFoundation.framework; sourceTree = SDKROOT; }; + C3B8524225A5EC940037A8AB /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; + C3B8524625A5ED6D0037A8AB /* AudioToolbox.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AudioToolbox.framework; path = System/Library/Frameworks/AudioToolbox.framework; sourceTree = SDKROOT; }; + C3C4082D25B9A547002C19EB /* ActiveViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ActiveViewController.swift; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + C3B851F825A5EA6C0037A8AB /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + C351398125A5F70D00A090AA /* libg7221codec.a in Frameworks */, + C351398225A5F70D00A090AA /* libgsmcodec.a in Frameworks */, + C351398325A5F70D00A090AA /* libilbccodec.a in Frameworks */, + C351398425A5F70D00A090AA /* libpj.a in Frameworks */, + C351398525A5F70D00A090AA /* libpjlib-util.a in Frameworks */, + C351398625A5F70D00A090AA /* libpjmedia-audiodev.a in Frameworks */, + C351398725A5F70D00A090AA /* libpjmedia-codec.a in Frameworks */, + C351398825A5F70D00A090AA /* libpjmedia-videodev.a in Frameworks */, + C351398925A5F70D00A090AA /* libpjmedia.a in Frameworks */, + C351398A25A5F70D00A090AA /* libpjnath.a in Frameworks */, + C351398B25A5F70D00A090AA /* libpjsip-simple.a in Frameworks */, + C351398C25A5F70D00A090AA /* libpjsip-ua.a in Frameworks */, + C351398D25A5F70D00A090AA /* libpjsip.a in Frameworks */, + C351398E25A5F70D00A090AA /* libpjsua.a in Frameworks */, + C351398F25A5F70D00A090AA /* libpjsua2.a in Frameworks */, + C351399025A5F70D00A090AA /* libresample.a in Frameworks */, + C351399125A5F70D00A090AA /* libspeex.a in Frameworks */, + C351399225A5F70D00A090AA /* libsrtp.a in Frameworks */, + C351399325A5F70D00A090AA /* libwebrtc.a in Frameworks */, + C351399425A5F70D00A090AA /* libyuv.a in Frameworks */, + C3B8524725A5ED6D0037A8AB /* AudioToolbox.framework in Frameworks */, + C3B8524325A5EC940037A8AB /* AVFoundation.framework in Frameworks */, + C3B8524425A5EC940037A8AB /* Foundation.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + C337417125BADEB3007785D7 /* Model */ = { + isa = PBXGroup; + children = ( + C337417225BADEEE007785D7 /* Model.swift */, + ); + path = Model; + sourceTree = ""; + }; + C337417625BADF12007785D7 /* Controller */ = { + isa = PBXGroup; + children = ( + C3B8520225A5EA6C0037A8AB /* ViewController.swift */, + C399A57025AF2721000F742A /* IncomingViewController.swift */, + C374860725B84FA100FBE972 /* OutgoingViewController.swift */, + C3C4082D25B9A547002C19EB /* ActiveViewController.swift */, + ); + path = Controller; + sourceTree = ""; + }; + C337417725BADF22007785D7 /* View */ = { + isa = PBXGroup; + children = ( + C3B8520425A5EA6C0037A8AB /* Main.storyboard */, + C3B8520925A5EA6D0037A8AB /* LaunchScreen.storyboard */, + ); + path = View; + sourceTree = ""; + }; + C3B851F225A5EA6C0037A8AB = { + isa = PBXGroup; + children = ( + C3B851FD25A5EA6C0037A8AB /* ios-swift-pjsua2 */, + C3B851FC25A5EA6C0037A8AB /* Products */, + C3B8521725A5EC380037A8AB /* Frameworks */, + ); + sourceTree = ""; + }; + C3B851FC25A5EA6C0037A8AB /* Products */ = { + isa = PBXGroup; + children = ( + C3B851FB25A5EA6C0037A8AB /* ios-swift-pjsua2.app */, + ); + name = Products; + sourceTree = ""; + }; + C3B851FD25A5EA6C0037A8AB /* ios-swift-pjsua2 */ = { + isa = PBXGroup; + children = ( + C3C1F63A25AC26A300E5E080 /* PJSua2 */, + C337417725BADF22007785D7 /* View */, + C337417125BADEB3007785D7 /* Model */, + C337417625BADF12007785D7 /* Controller */, + C3B851FE25A5EA6C0037A8AB /* AppDelegate.swift */, + C3B8520025A5EA6C0037A8AB /* SceneDelegate.swift */, + C3B8520725A5EA6D0037A8AB /* Assets.xcassets */, + C3B8520C25A5EA6D0037A8AB /* Info.plist */, + C3B8521325A5EBF00037A8AB /* ios-swift-pjsua2-Bridging-Header.h */, + ); + path = "ios-swift-pjsua2"; + sourceTree = ""; + }; + C3B8521725A5EC380037A8AB /* Frameworks */ = { + isa = PBXGroup; + children = ( + C3B8524625A5ED6D0037A8AB /* AudioToolbox.framework */, + C3B8524125A5EC940037A8AB /* AVFoundation.framework */, + C3B8524225A5EC940037A8AB /* Foundation.framework */, + C3B8521F25A5EC380037A8AB /* libg7221codec.a */, + C3B8521A25A5EC380037A8AB /* libgsmcodec.a */, + C3B8522825A5EC380037A8AB /* libilbccodec.a */, + C3B8522225A5EC380037A8AB /* libpj.a */, + C3B8522625A5EC380037A8AB /* libpjlib-util.a */, + C3B8522425A5EC380037A8AB /* libpjmedia-audiodev.a */, + C3B8522125A5EC380037A8AB /* libpjmedia-codec.a */, + C3B8521825A5EC380037A8AB /* libpjmedia-videodev.a */, + C3B8521E25A5EC380037A8AB /* libpjmedia.a */, + C3B8522025A5EC380037A8AB /* libpjnath.a */, + C3B8522725A5EC380037A8AB /* libpjsip-simple.a */, + C3B8521D25A5EC380037A8AB /* libpjsip-ua.a */, + C3B8522325A5EC380037A8AB /* libpjsip.a */, + C3B8521925A5EC380037A8AB /* libpjsua.a */, + C3B8521C25A5EC380037A8AB /* libpjsua2.a */, + C3B8522925A5EC380037A8AB /* libresample.a */, + C3B8521B25A5EC380037A8AB /* libspeex.a */, + C3B8522525A5EC380037A8AB /* libsrtp.a */, + C3B8522A25A5EC380037A8AB /* libwebrtc.a */, + C3B8522B25A5EC380037A8AB /* libyuv.a */, + ); + name = Frameworks; + sourceTree = ""; + }; + C3C1F63A25AC26A300E5E080 /* PJSua2 */ = { + isa = PBXGroup; + children = ( + C3AB889E25A7358700224276 /* CustomPJSUA2.cpp */, + C3AB889F25A7358700224276 /* CustomPJSUA2.hpp */, + C3AB889A25A734B400224276 /* wrapper.mm */, + C3AB88AA25A73F3100224276 /* wrapper.h */, + ); + path = PJSua2; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + C3B851FA25A5EA6C0037A8AB /* ios-swift-pjsua2 */ = { + isa = PBXNativeTarget; + buildConfigurationList = C3B8520F25A5EA6D0037A8AB /* Build configuration list for PBXNativeTarget "ios-swift-pjsua2" */; + buildPhases = ( + C3B851F725A5EA6C0037A8AB /* Sources */, + C3B851F825A5EA6C0037A8AB /* Frameworks */, + C3B851F925A5EA6C0037A8AB /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = "ios-swift-pjsua2"; + productName = "NEW-Swift-NoBuild"; + productReference = C3B851FB25A5EA6C0037A8AB /* ios-swift-pjsua2.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + C3B851F325A5EA6C0037A8AB /* Project object */ = { + isa = PBXProject; + attributes = { + LastSwiftUpdateCheck = 1210; + LastUpgradeCheck = 1210; + TargetAttributes = { + C3B851FA25A5EA6C0037A8AB = { + CreatedOnToolsVersion = 12.1; + LastSwiftMigration = 1210; + }; + }; + }; + buildConfigurationList = C3B851F625A5EA6C0037A8AB /* Build configuration list for PBXProject "ios-swift-pjsua2" */; + compatibilityVersion = "Xcode 9.3"; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = C3B851F225A5EA6C0037A8AB; + productRefGroup = C3B851FC25A5EA6C0037A8AB /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + C3B851FA25A5EA6C0037A8AB /* ios-swift-pjsua2 */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + C3B851F925A5EA6C0037A8AB /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + C3B8520B25A5EA6D0037A8AB /* LaunchScreen.storyboard in Resources */, + C3B8520825A5EA6D0037A8AB /* Assets.xcassets in Resources */, + C3B8520625A5EA6C0037A8AB /* Main.storyboard in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + C3B851F725A5EA6C0037A8AB /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + C337417325BADEEE007785D7 /* Model.swift in Sources */, + C3C4082E25B9A547002C19EB /* ActiveViewController.swift in Sources */, + C399A57125AF2721000F742A /* IncomingViewController.swift in Sources */, + C3AB889B25A734B400224276 /* wrapper.mm in Sources */, + C374860825B84FA100FBE972 /* OutgoingViewController.swift in Sources */, + C3B8520325A5EA6C0037A8AB /* ViewController.swift in Sources */, + C3B851FF25A5EA6C0037A8AB /* AppDelegate.swift in Sources */, + C3B8520125A5EA6C0037A8AB /* SceneDelegate.swift in Sources */, + C3AB88A025A7358700224276 /* CustomPJSUA2.cpp in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXVariantGroup section */ + C3B8520425A5EA6C0037A8AB /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + C3B8520525A5EA6C0037A8AB /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; + C3B8520925A5EA6D0037A8AB /* LaunchScreen.storyboard */ = { + isa = PBXVariantGroup; + children = ( + C3B8520A25A5EA6D0037A8AB /* Base */, + ); + name = LaunchScreen.storyboard; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + C3B8520D25A5EA6D0037A8AB /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 14.1; + MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; + MTL_FAST_MATH = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + }; + name = Debug; + }; + C3B8520E25A5EA6D0037A8AB /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 14.1; + MTL_ENABLE_DEBUG_INFO = NO; + MTL_FAST_MATH = YES; + SDKROOT = iphoneos; + SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_OPTIMIZATION_LEVEL = "-O"; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + C3B8521025A5EA6D0037A8AB /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; + CLANG_ENABLE_MODULES = YES; + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_TEAM = PZ7LKWA782; + ENABLE_BITCODE = NO; + ENABLE_TESTABILITY = YES; + GCC_NO_COMMON_BLOCKS = YES; + GCC_PREPROCESSOR_DEFINITIONS = ( + "PJ_AUTOCONF=1", + "$(inherited)", + ); + HEADER_SEARCH_PATHS = ( + "$(inherited)", + "$(SRCROOT)", + "$(SRCROOT)/Libraries", + "\"$(SRCROOT)/../../../../pjlib/include\"", + "\"$(SRCROOT)/../../../../pjlib-util/include\"", + "\"$(SRCROOT)/../../../../pjmedia/include\"", + "\"$(SRCROOT)/../../../../pjnath/include\"", + "\"$(SRCROOT)/../../../../pjsip/include\"", + "\"$(SRCROOT)/../../../../third_party/include\"", + "$(PROJECT_DIR)", + "$(PROJECT_DIR)/Libraries", + ); + INFOPLIST_FILE = "$(SRCROOT)/ios-swift-pjsua2/Info.plist"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + LIBRARY_SEARCH_PATHS = ( + "$(inherited)", + "$(SRCROOT)", + "$(SRCROOT)/Libraries", + "\"$(SRCROOT)/../../../../pjlib/lib\"", + "\"$(SRCROOT)/../../../../pjlib-util/lib\"", + "\"$(SRCROOT)/../../../../pjmedia/lib\"", + "\"$(SRCROOT)/../../../../pjnath/lib\"", + "\"$(SRCROOT)/../../../../pjsip/lib\"", + "\"$(SRCROOT)/../../../../third_party/lib\"", + "$(PROJECT_DIR)", + "$(PROJECT_DIR)/Libraries", + ); + PRODUCT_BUNDLE_IDENTIFIER = "tbtk.ios-swift-pjsua2"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_OBJC_BRIDGING_HEADER = "ios-swift-pjsua2/ios-swift-pjsua2-Bridging-Header.h"; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + C3B8521125A5EA6D0037A8AB /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; + CLANG_ENABLE_MODULES = YES; + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_TEAM = PZ7LKWA782; + ENABLE_BITCODE = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_PREPROCESSOR_DEFINITIONS = "PJ_AUTOCONF=1"; + HEADER_SEARCH_PATHS = ( + "$(inherited)", + "$(SRCROOT)", + "$(SRCROOT)/Libraries", + "\"$(SRCROOT)/../../../../pjlib/include\"", + "\"$(SRCROOT)/../../../../pjlib-util/include\"", + "\"$(SRCROOT)/../../../../pjmedia/include\"", + "\"$(SRCROOT)/../../../../pjnath/include\"", + "\"$(SRCROOT)/../../../../pjsip/include\"", + "\"$(SRCROOT)/../../../../third_party/include\"", + "$(PROJECT_DIR)", + "$(PROJECT_DIR)/Libraries", + ); + INFOPLIST_FILE = "$(SRCROOT)/ios-swift-pjsua2/Info.plist"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + LIBRARY_SEARCH_PATHS = ( + "$(inherited)", + "$(SRCROOT)", + "$(SRCROOT)/Libraries", + "\"$(SRCROOT)/../../../../pjlib/lib\"", + "\"$(SRCROOT)/../../../../pjlib-util/lib\"", + "\"$(SRCROOT)/../../../../pjmedia/lib\"", + "\"$(SRCROOT)/../../../../pjnath/lib\"", + "\"$(SRCROOT)/../../../../pjsip/lib\"", + "\"$(SRCROOT)/../../../../third_party/lib\"", + "$(PROJECT_DIR)", + "$(PROJECT_DIR)/Libraries", + ); + ONLY_ACTIVE_ARCH = YES; + PRODUCT_BUNDLE_IDENTIFIER = "tbtk.ios-swift-pjsua2"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_OBJC_BRIDGING_HEADER = "ios-swift-pjsua2/ios-swift-pjsua2-Bridging-Header.h"; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + C3B851F625A5EA6C0037A8AB /* Build configuration list for PBXProject "ios-swift-pjsua2" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + C3B8520D25A5EA6D0037A8AB /* Debug */, + C3B8520E25A5EA6D0037A8AB /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + C3B8520F25A5EA6D0037A8AB /* Build configuration list for PBXNativeTarget "ios-swift-pjsua2" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + C3B8521025A5EA6D0037A8AB /* Debug */, + C3B8521125A5EA6D0037A8AB /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = C3B851F325A5EA6C0037A8AB /* Project object */; +} diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip-apps/src/pjsua2/ios-swift-pjsua2/ios-swift-pjsua2.xcodeproj/project.xcworkspace/contents.xcworkspacedata asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip-apps/src/pjsua2/ios-swift-pjsua2/ios-swift-pjsua2.xcodeproj/project.xcworkspace/contents.xcworkspacedata --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip-apps/src/pjsua2/ios-swift-pjsua2/ios-swift-pjsua2.xcodeproj/project.xcworkspace/contents.xcworkspacedata 1970-01-01 00:00:00.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip-apps/src/pjsua2/ios-swift-pjsua2/ios-swift-pjsua2.xcodeproj/project.xcworkspace/contents.xcworkspacedata 2022-02-24 07:54:38.000000000 +0000 @@ -0,0 +1,7 @@ + + + + + diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip-apps/src/pjsua2/ios-swift-pjsua2/ios-swift-pjsua2.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip-apps/src/pjsua2/ios-swift-pjsua2/ios-swift-pjsua2.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip-apps/src/pjsua2/ios-swift-pjsua2/ios-swift-pjsua2.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist 1970-01-01 00:00:00.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip-apps/src/pjsua2/ios-swift-pjsua2/ios-swift-pjsua2.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist 2022-02-24 07:54:38.000000000 +0000 @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip-apps/src/pjsua2/ios-swift-pjsua2/ios-swift-pjsua2.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip-apps/src/pjsua2/ios-swift-pjsua2/ios-swift-pjsua2.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip-apps/src/pjsua2/ios-swift-pjsua2/ios-swift-pjsua2.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings 1970-01-01 00:00:00.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip-apps/src/pjsua2/ios-swift-pjsua2/ios-swift-pjsua2.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings 2022-02-24 07:54:38.000000000 +0000 @@ -0,0 +1,8 @@ + + + + + PreviewsEnabled + + + diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip-apps/src/pjsua2/ios-swift-pjsua2/ios-swift-pjsua2.xcodeproj/xcshareddata/xcschemes/ios-swift-pjsua2.xcscheme asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip-apps/src/pjsua2/ios-swift-pjsua2/ios-swift-pjsua2.xcodeproj/xcshareddata/xcschemes/ios-swift-pjsua2.xcscheme --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip-apps/src/pjsua2/ios-swift-pjsua2/ios-swift-pjsua2.xcodeproj/xcshareddata/xcschemes/ios-swift-pjsua2.xcscheme 1970-01-01 00:00:00.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip-apps/src/pjsua2/ios-swift-pjsua2/ios-swift-pjsua2.xcodeproj/xcshareddata/xcschemes/ios-swift-pjsua2.xcscheme 2022-02-24 07:54:38.000000000 +0000 @@ -0,0 +1,78 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip-apps/src/pjsystest/main_console.c asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip-apps/src/pjsystest/main_console.c --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip-apps/src/pjsystest/main_console.c 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip-apps/src/pjsystest/main_console.c 2022-02-24 07:54:38.000000000 +0000 @@ -85,7 +85,7 @@ puts("M E N U :"); puts("---------"); for (i=0; isubmenu_cnt; ++i) { - char menu_id[4]; + char menu_id[11]; pj_ansi_sprintf(menu_id, "%u", i); print_menu("", menu_id, menu->submenus[i]); } @@ -133,6 +133,8 @@ int main() { + pj_log_set_level(1); + if (systest_init() != PJ_SUCCESS) return 1; diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip-apps/src/pjsystest/systest.c asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip-apps/src/pjsystest/systest.c --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip-apps/src/pjsystest/systest.c 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip-apps/src/pjsystest/systest.c 2022-02-24 07:54:38.000000000 +0000 @@ -1340,11 +1340,14 @@ pj_file_write(fd, textbuf, &size); for (i=0; ititle, (ti->skipped? "Skipped" : (ti->success ? "Success" : "Failed"))); + PJ_CHECK_TRUNC_STR(len, textbuf, sizeof(textbuf)); size = strlen(textbuf); pj_file_write(fd, textbuf, &size); diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip-apps/src/python/_pjsua.c asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip-apps/src/python/_pjsua.c --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip-apps/src/python/_pjsua.c 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip-apps/src/python/_pjsua.c 2022-02-24 07:54:38.000000000 +0000 @@ -4434,7 +4434,8 @@ PyObject* m = NULL; #define ADD_CONSTANT(mod,name) PyModule_AddIntConstant(mod,#name,name) - + pj_log_set_level(1); + PyEval_InitThreads(); if (PyType_Ready(&PyTyp_pjsua_callback) < 0) diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip-apps/src/samples/aviplay.c asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip-apps/src/samples/aviplay.c --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip-apps/src/samples/aviplay.c 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip-apps/src/samples/aviplay.c 2022-02-24 07:54:38.000000000 +0000 @@ -25,7 +25,9 @@ #include #include -#include "util.h" +#ifndef _MSC_VER +#include +#endif /** * \page page_pjmedia_samples_aviplay_c Samples: Playing AVI File to @@ -56,6 +58,7 @@ #if defined(PJMEDIA_HAS_VIDEO) && (PJMEDIA_HAS_VIDEO != 0) +#include "util.h" /* For logging purpose. */ #define THIS_FILE "aviplay.c" @@ -220,6 +223,8 @@ /* Create renderer, set it to active */ param.active = PJ_TRUE; param.vidparam.dir = PJMEDIA_DIR_RENDER; + param.vidparam.flags |= PJMEDIA_VID_DEV_CAP_OUTPUT_WINDOW_FLAGS; + param.vidparam.window_flags = PJMEDIA_VID_DEV_WND_BORDER | PJMEDIA_VID_DEV_WND_RESIZABLE; vfd = pjmedia_format_get_video_format_detail(&vid_port->info.fmt, PJ_TRUE); pjmedia_format_init_video(¶m.vidparam.fmt, @@ -306,9 +311,14 @@ /* Alloc encoding buffer */ enc_buf_size = codec_param.dec_fmt.det.vid.size.w * - codec_param.dec_fmt.det.vid.size.h * 4 - + 16; /*< padding, just in case */ - enc_buf = pj_pool_alloc(pool,enc_buf_size); + codec_param.dec_fmt.det.vid.size.h * 4; + enc_buf = pj_pool_alloc(pool, enc_buf_size + + 128 /*< padding, required for vid codecs + such as ffmpeg. Must be >= + AV_INPUT_BUFFER_PADDING_SIZE. + And must not be included in + the enc_buf_size calculation + above. */); /* Init codec port */ pj_bzero(&codec_port, sizeof(codec_port)); @@ -456,6 +466,19 @@ return rc; } +#ifndef _MSC_VER +static void sig_handler(int sig) +{ + switch (sig) + { + case SIGINT: + case SIGTERM: + break; + } + puts("exit.."); + exit(1); +} +#endif static int main_func(int argc, char *argv[]) { @@ -470,6 +493,10 @@ return 110; } +#ifndef _MSC_VER + signal(SIGINT, sig_handler); + signal(SIGTERM, sig_handler); +#endif /* Must init PJLIB first: */ status = pj_init(); @@ -493,6 +520,7 @@ status = pjmedia_vid_dev_subsys_init(&cp.factory); if (status != PJ_SUCCESS) { + app_perror(THIS_FILE, "Video init failed", status); rc = 130; goto on_return; } diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip-apps/src/samples/clidemo.c asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip-apps/src/samples/clidemo.c --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip-apps/src/samples/clidemo.c 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip-apps/src/samples/clidemo.c 2022-02-24 07:54:38.000000000 +0000 @@ -114,13 +114,13 @@ " " "", &say}, - {"" - " " - " " - " " - " " - " " - " " + {"" + " " + " " + " " + " " + " " + " " " " " " " " @@ -128,7 +128,7 @@ "", NULL}, {"" - " " + " " " " " " " " @@ -176,9 +176,13 @@ for (i = 0; i < sizeof(cmd_xmls)/sizeof(cmd_xmls[0]); i++) { xml = pj_str(cmd_xmls[i].xml); status = pj_cli_add_cmd_from_xml(cli, NULL, &xml, - cmd_xmls[i].handler, NULL, get_codec_list); - if (status != PJ_SUCCESS) + cmd_xmls[i].handler, NULL, + get_codec_list); + if (status != PJ_SUCCESS) { + PJ_PERROR(1,(THIS_FILE, status, + "Failed adding command from XML #%d", i)); goto on_return; + } } /* diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip-apps/src/samples/jbsim.c asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip-apps/src/samples/jbsim.c --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip-apps/src/samples/jbsim.c 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip-apps/src/samples/jbsim.c 2022-02-24 07:54:38.000000000 +0000 @@ -28,6 +28,7 @@ /* Include PJMEDIA and PJLIB */ #include +#include #include #include #include @@ -333,6 +334,7 @@ si.jb_min_pre = g_app.cfg.rx_jb_min_pre; si.jb_max_pre = g_app.cfg.rx_jb_max_pre; si.jb_max = g_app.cfg.rx_jb_max; + si.jb_discard_algo = PJMEDIA_JB_DISCARD_PROGRESSIVE; } /* Get the codec info and param */ @@ -427,6 +429,7 @@ } if (g_app.pool) pj_pool_release(g_app.pool); + pjmedia_event_mgr_destroy(NULL); pj_caching_pool_destroy( &g_app.cp ); pj_shutdown(); } @@ -481,6 +484,13 @@ goto on_error; } + /* Create event manager */ + status = pjmedia_event_mgr_create(g_app.pool, 0, NULL); + if (status != PJ_SUCCESS) { + jbsim_perror("Error creating event manager", status); + goto on_error; + } + /* Create transmitter stream */ pj_bzero(&strm_cfg, sizeof(strm_cfg)); strm_cfg.name = "tx"; @@ -755,7 +765,7 @@ pkt_interval = PJMEDIA_PIA_SPF(&port->info) * 1000 / PJMEDIA_PIA_SRATE(&port->info) * - g_app.cfg.rx_snd_burst; + (long)g_app.cfg.rx_snd_burst; if (PJ_TIME_VAL_GTE(*t, strm->state.rx.next_schedule)) { unsigned i; diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip-apps/src/samples/pcaputil.c asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip-apps/src/samples/pcaputil.c --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip-apps/src/samples/pcaputil.c 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip-apps/src/samples/pcaputil.c 2022-02-24 07:54:38.000000000 +0000 @@ -269,7 +269,7 @@ const pj_str_t WAV = {".wav", 4}; struct pkt { - pj_uint8_t buffer[320]; + pj_uint8_t buffer[PJMEDIA_MAX_MTU]; pjmedia_rtp_hdr *rtp; pj_uint8_t *payload; unsigned payload_len; @@ -358,7 +358,7 @@ struct pkt pkt1; pj_timestamp ts; pjmedia_frame frames[16], pcm_frame; - short pcm[320]; + short pcm[PJMEDIA_MAX_MTU]; unsigned i, frame_cnt; long samples_cnt, ts_gap; diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip-apps/src/samples/pjsip-perf.c asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip-apps/src/samples/pjsip-perf.c --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip-apps/src/samples/pjsip-perf.c 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip-apps/src/samples/pjsip-perf.c 2022-02-24 07:54:38.000000000 +0000 @@ -460,11 +460,10 @@ pjsip_response_addr res_addr; pjsip_get_response_addr(tdata->pool, rdata, &res_addr); - pjsip_endpt_send_response(app.sip_endpt, &res_addr, tdata, + status = pjsip_endpt_send_response(app.sip_endpt, &res_addr, tdata, NULL, NULL); - + if (status != PJ_SUCCESS) pjsip_tx_data_dec_ref(tdata); } else { - /* Respond with 500 (Internal Server Error) */ pjsip_endpt_respond_stateless(app.sip_endpt, rdata, 500, NULL, NULL, NULL); diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip-apps/src/samples/pjsua2_demo.cpp asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip-apps/src/samples/pjsua2_demo.cpp --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip-apps/src/samples/pjsua2_demo.cpp 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip-apps/src/samples/pjsua2_demo.cpp 2022-02-24 07:54:38.000000000 +0000 @@ -24,6 +24,30 @@ using namespace pj; +/* Valid test number: + * 0: JSON account config test + * 1: call test + * 2: JSON endpoint config test + * 3: media player and recorder test + * 4: simple registration test + */ +#define USE_TEST 1 + +class MyEndpoint : public Endpoint +{ +public: + MyEndpoint() : Endpoint() {}; + virtual pj_status_t onCredAuth(OnCredAuthParam &prm) + { + std::cout << "*** Callback onCredAuth called ***" << std::endl; + /* Return PJ_ENOTSUP to use + * pjsip_auth_create_aka_response()/libmilenage (default), + * if PJSIP_HAS_DIGEST_AKA_AUTH is defined. + */ + return PJ_ENOTSUP; + } +}; + class MyAccount; class MyCall : public Call @@ -127,11 +151,10 @@ { PJ_UNUSED_ARG(prm); - unsigned i; CallInfo ci = getInfo(); AudioMedia aud_med; AudioMedia& play_dev_med = - Endpoint::instance().audDevManager().getPlaybackDevMedia(); + MyEndpoint::instance().audDevManager().getPlaybackDevMedia(); try { // Get the first audio media @@ -174,7 +197,8 @@ } -static void mainProg1(Endpoint &ep) +#if USE_TEST == 1 +static void mainProg1(MyEndpoint &ep) { // Init library EpConfig ep_cfg; @@ -194,8 +218,15 @@ AccountConfig acc_cfg; acc_cfg.idUri = "sip:test1@pjsip.org"; acc_cfg.regConfig.registrarUri = "sip:sip.pjsip.org"; - acc_cfg.sipConfig.authCreds.push_back( AuthCredInfo("digest", "*", - "test1", 0, "test1") ); + +#if PJSIP_HAS_DIGEST_AKA_AUTH + AuthCredInfo aci("Digest", "*", "test", PJSIP_CRED_DATA_EXT_AKA | PJSIP_CRED_DATA_PLAIN_PASSWD, "passwd"); + aci.akaK = "passwd"; +#else + AuthCredInfo aci("digest", "*", "test1", 0, "test1"); +#endif + + acc_cfg.sipConfig.authCreds.push_back(aci); MyAccount *acc(new MyAccount); try { acc->create(acc_cfg); @@ -222,7 +253,10 @@ std::cout << "*** PJSUA2 SHUTTING DOWN ***" << std::endl; delete acc; /* Will delete all calls too */ } +#endif + +#if USE_TEST == 2 static void mainProg2() { string json_str; @@ -267,9 +301,11 @@ pj_file_delete("jsontest.js"); } } +#endif -static void mainProg3(Endpoint &ep) +#if USE_TEST == 3 +static void mainProg3(MyEndpoint &ep) { const char *paths[] = { "../../../../tests/pjsua/wavs/input.16.wav", "../../tests/pjsua/wavs/input.16.wav", @@ -326,9 +362,11 @@ pj_thread_sleep(5000); } } +#endif -static void mainProg() +#if USE_TEST == 0 +static void mainProg(MyEndpoint &) { string json_str; @@ -355,6 +393,11 @@ aci.username = "test"; aci.data = "passwd"; aci.realm = "*"; + aci.dataType = PJSIP_CRED_DATA_PLAIN_PASSWD; +#if PJSIP_HAS_DIGEST_AKA_AUTH + aci.dataType |= PJSIP_CRED_DATA_EXT_AKA; + aci.akaK = "key"; +#endif accCfg.sipConfig.authCreds.push_back(aci); jdoc.writeObject(accCfg); @@ -378,9 +421,11 @@ std::cout << json_str << std::endl << std::endl; } } +#endif -static void mainProg4(Endpoint &ep) +#if USE_TEST == 4 +static void mainProg4(MyEndpoint &ep) { // Init library EpConfig ep_cfg; @@ -408,17 +453,34 @@ delete acc; } +#endif +extern "C" int main() { int ret = 0; - Endpoint ep; + MyEndpoint ep; try { ep.libCreate(); +#if USE_TEST == 0 + mainProg(ep); +#endif +#if USE_TEST == 1 mainProg1(ep); +#endif +#if USE_TEST == 2 + mainProg2(ep); +#endif +#if USE_TEST == 3 + mainProg3(ep); +#endif +#if USE_TEST == 4 + mainProg4(ep); +#endif + ret = PJ_SUCCESS; } catch (Error & err) { std::cout << "Exception: " << err.info() << std::endl; diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip-apps/src/samples/simpleua.c asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip-apps/src/samples/simpleua.c --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip-apps/src/samples/simpleua.c 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip-apps/src/samples/simpleua.c 2022-02-24 07:54:38.000000000 +0000 @@ -272,13 +272,14 @@ */ { pj_sockaddr addr; + int af = AF; - pj_sockaddr_init(AF, &addr, NULL, (pj_uint16_t)SIP_PORT); + pj_sockaddr_init(af, &addr, NULL, (pj_uint16_t)SIP_PORT); - if (AF == pj_AF_INET()) { + if (af == pj_AF_INET()) { status = pjsip_udp_transport_start( g_endpt, &addr.ipv4, NULL, 1, NULL); - } else if (AF == pj_AF_INET6()) { + } else if (af == pj_AF_INET6()) { status = pjsip_udp_transport_start6(g_endpt, &addr.ipv6, NULL, 1, NULL); } else { @@ -364,6 +365,9 @@ #endif PJ_ASSERT_RETURN(status == PJ_SUCCESS, 1); + /* Create pool. */ + pool = pjmedia_endpt_create_pool(g_med_endpt, "Media pool", 512, 512); + /* * Add PCMA/PCMU codec to the media endpoint. */ @@ -375,7 +379,6 @@ #if defined(PJMEDIA_HAS_VIDEO) && (PJMEDIA_HAS_VIDEO != 0) /* Init video subsystem */ - pool = pjmedia_endpt_create_pool(g_med_endpt, "Video subsystem", 512, 512); status = pjmedia_video_format_mgr_create(pool, 64, 0, NULL); PJ_ASSERT_RETURN(status == PJ_SUCCESS, 1); status = pjmedia_converter_mgr_create(pool, NULL); diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip-apps/src/samples/siprtp.c asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip-apps/src/samples/siprtp.c --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip-apps/src/samples/siprtp.c 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip-apps/src/samples/siprtp.c 2022-02-24 07:54:38.000000000 +0000 @@ -623,8 +623,9 @@ pjsip_response_addr res_addr; pjsip_get_response_addr(tdata->pool, rdata, &res_addr); - pjsip_endpt_send_response(app.sip_endpt, &res_addr, tdata, - NULL, NULL); + status = pjsip_endpt_send_response(app.sip_endpt, &res_addr, tdata, + NULL, NULL); + if (status != PJ_SUCCESS) pjsip_tx_data_dec_ref(tdata); } else { @@ -732,7 +733,7 @@ static void timer_disconnect_call( pj_timer_heap_t *timer_heap, struct pj_timer_entry *entry) { - struct call *call = entry->user_data; + struct call *call = (struct call *)(entry->user_data); PJ_UNUSED_ARG(timer_heap); @@ -745,7 +746,7 @@ static void call_on_state_changed( pjsip_inv_session *inv, pjsip_event *e) { - struct call *call = inv->mod_data[mod_siprtp.id]; + struct call *call = (struct call *)inv->mod_data[mod_siprtp.id]; PJ_UNUSED_ARG(e); @@ -1020,7 +1021,7 @@ pjmedia_transport_get_info(audio->transport, &tpinfo); /* Create and initialize basic SDP session */ - sdp = pj_pool_zalloc (pool, sizeof(pjmedia_sdp_session)); + sdp = PJ_POOL_ZALLOC_T(pool, pjmedia_sdp_session); pj_gettimeofday(&tv); sdp->origin.user = pj_str("pjsip-siprtp"); @@ -1033,7 +1034,7 @@ /* Since we only support one media stream at present, put the * SDP connection line in the session level. */ - sdp->conn = pj_pool_zalloc (pool, sizeof(pjmedia_sdp_conn)); + sdp->conn = PJ_POOL_ZALLOC_T(pool, pjmedia_sdp_conn); sdp->conn->net_type = pj_str("IN"); sdp->conn->addr_type = pj_str("IP4"); sdp->conn->addr = app.local_addr; @@ -1046,7 +1047,7 @@ /* Create media stream 0: */ sdp->media_count = 1; - m = pj_pool_zalloc (pool, sizeof(pjmedia_sdp_media)); + m = PJ_POOL_ZALLOC_T(pool, pjmedia_sdp_media); sdp->media[0] = m; /* Standard media info: */ @@ -1075,7 +1076,7 @@ } /* Add sendrecv attribute. */ - attr = pj_pool_zalloc(pool, sizeof(pjmedia_sdp_attr)); + attr = PJ_POOL_ZALLOC_T(pool, pjmedia_sdp_attr); attr->name = pj_str("sendrecv"); m->attr[m->attr_count++] = attr; @@ -1085,12 +1086,12 @@ */ m->desc.fmt[m->desc.fmt_count++] = pj_str("121"); /* Add rtpmap. */ - attr = pj_pool_zalloc(pool, sizeof(pjmedia_sdp_attr)); + attr = PJ_POOL_ZALLOC_T(pool, pjmedia_sdp_attr); attr->name = pj_str("rtpmap"); attr->value = pj_str("121 telephone-event/8000"); m->attr[m->attr_count++] = attr; /* Add fmtp */ - attr = pj_pool_zalloc(pool, sizeof(pjmedia_sdp_attr)); + attr = PJ_POOL_ZALLOC_T(pool, pjmedia_sdp_attr); attr->name = pj_str("fmtp"); attr->value = pj_str("121 0-15"); m->attr[m->attr_count++] = attr; @@ -1189,7 +1190,7 @@ const void *payload; unsigned payload_len; - strm = user_data; + strm = (struct media_stream *)user_data; /* Discard packet if media is inactive */ if (!strm->active) @@ -1228,7 +1229,7 @@ { struct media_stream *strm; - strm = user_data; + strm = (struct media_stream *)user_data; /* Discard packet if media is inactive */ if (!strm->active) @@ -1253,7 +1254,7 @@ static int media_thread(void *arg) { enum { RTCP_INTERVAL = 5000, RTCP_RAND = 2000 }; - struct media_stream *strm = arg; + struct media_stream *strm = (struct media_stream *)arg; char packet[1500]; unsigned msec_interval; pj_timestamp freq, next_rtp, next_rtcp; @@ -1402,7 +1403,7 @@ struct codec *codec_desc = NULL; unsigned i; - call = inv->mod_data[mod_siprtp.id]; + call = (struct call *)inv->mod_data[mod_siprtp.id]; audio = &call->media[0]; /* If this is a mid-call media update, then destroy existing media */ diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip-apps/src/samples/stateful_proxy.c asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip-apps/src/samples/stateful_proxy.c --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip-apps/src/samples/stateful_proxy.c 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip-apps/src/samples/stateful_proxy.c 2022-02-24 07:54:38.000000000 +0000 @@ -346,6 +346,7 @@ status = pjsip_endpt_send_response(global.endpt, &res_addr, tdata, NULL, NULL); if (status != PJ_SUCCESS) { + pjsip_tx_data_dec_ref(tdata); app_perror("Error forwarding response", status); return PJ_TRUE; } diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip-apps/src/samples/stateless_proxy.c asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip-apps/src/samples/stateless_proxy.c --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip-apps/src/samples/stateless_proxy.c 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip-apps/src/samples/stateless_proxy.c 2022-02-24 07:54:38.000000000 +0000 @@ -163,6 +163,7 @@ status = pjsip_endpt_send_response(global.endpt, &res_addr, tdata, NULL, NULL); if (status != PJ_SUCCESS) { + pjsip_tx_data_dec_ref(tdata); app_perror("Error forwarding response", status); return PJ_TRUE; } diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip-apps/src/samples/vid_codec_test.c asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip-apps/src/samples/vid_codec_test.c --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip-apps/src/samples/vid_codec_test.c 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip-apps/src/samples/vid_codec_test.c 2022-02-24 07:54:38.000000000 +0000 @@ -43,10 +43,6 @@ #include "util.h" -static const char *desc = - " vid_vodec_test \n" -; - #define THIS_FILE "vid_vodec_test.c" @@ -61,10 +57,6 @@ #define DEF_RENDERER_HEIGHT 480 -/* Prototype */ -static void print_stream_stat(pjmedia_vid_stream *stream, - const pjmedia_vid_codec_param *codec_param); - /* Prototype for LIBSRTP utility in file datatypes.c */ int hex_string_to_octet_string(char *raw, char *hex, int len); @@ -126,13 +118,6 @@ } -/* - * usage() - */ -static void usage() -{ - puts(desc); -} static void show_diff(const pj_uint8_t *buf1, const pj_uint8_t *buf2, unsigned size) @@ -190,11 +175,14 @@ fseek(fhnd, 0, SEEK_SET); buf[i] = (pj_uint8_t*)malloc(size[i] + 4); - if (!buf[i]) + if (!buf[i]){ + fclose(fhnd); return; + } if (fread (buf[i], 1, size[i], fhnd) != (unsigned)size[i]) { fprintf (stderr, "Unable to read whole file\n"); + fclose(fhnd); return; } @@ -360,7 +348,7 @@ &codec_info, NULL); if (status != PJ_SUCCESS) { printf("Error: unable to find codec %s\n", codec_id); - return 1; + goto on_exit; } } else { static pjmedia_vid_codec_info info[1]; @@ -407,7 +395,6 @@ pjmedia_frame frm_yuv, frm_enc[MAX_FRAMES]; pj_bool_t has_more = PJ_FALSE; const pj_uint8_t start_nal[] = { 0, 0, 1 }; - unsigned i; ++ read_cnt; @@ -523,6 +510,9 @@ /* Shutdown PJLIB */ pj_shutdown(); + /* Avoid compile warning */ + PJ_UNUSED_ARG(app_perror); + return (status == PJ_SUCCESS) ? 0 : 1; } diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip-apps/src/samples/vid_streamutil.c asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip-apps/src/samples/vid_streamutil.c --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip-apps/src/samples/vid_streamutil.c 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip-apps/src/samples/vid_streamutil.c 2022-02-24 07:54:38.000000000 +0000 @@ -104,10 +104,6 @@ #define DEF_RENDERER_HEIGHT 480 -/* Prototype */ -static void print_stream_stat(pjmedia_vid_stream *stream, - const pjmedia_vid_codec_param *codec_param); - /* Hexa string to octet array */ int my_hex_string_to_octet_string(char *raw, char *hex, int len) { @@ -132,6 +128,7 @@ /* To suppress warning about unused var when all codecs are disabled */ PJ_UNUSED_ARG(status); + PJ_UNUSED_ARG(pf); #if defined(PJMEDIA_HAS_OPENH264_CODEC) && PJMEDIA_HAS_OPENH264_CODEC != 0 status = pjmedia_codec_openh264_vid_init(NULL, pf); @@ -374,7 +371,7 @@ /* * main() */ -int main(int argc, char *argv[]) +static int main_func(int argc, char *argv[]) { pj_caching_pool cp; pjmedia_endpt *med_endpt; @@ -1003,6 +1000,11 @@ } +int main(int argc, char *argv[]) +{ + return pj_run_app(&main_func, argc, argv, 0); +} + #else int main(int argc, char *argv[]) diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip-apps/src/swig/importsym.py asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip-apps/src/swig/importsym.py --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip-apps/src/swig/importsym.py 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip-apps/src/swig/importsym.py 2022-02-24 07:54:38.000000000 +0000 @@ -54,6 +54,8 @@ sys.exit(1) # Hardcoded! +# Note for win32: +# - temporarily comment "#include " in pj/sock.h (line ~29) if sys.platform == 'win32': PYCPARSER_DIR="D:/work/tool/pycparser-master" elif sys.platform == "linux2": diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip-apps/src/swig/java/android/android.iml asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip-apps/src/swig/java/android/android.iml --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip-apps/src/swig/java/android/android.iml 1970-01-01 00:00:00.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip-apps/src/swig/java/android/android.iml 2022-02-24 07:54:38.000000000 +0000 @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + + \ No newline at end of file diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip-apps/src/swig/java/android/app/app.iml asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip-apps/src/swig/java/android/app/app.iml --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip-apps/src/swig/java/android/app/app.iml 1970-01-01 00:00:00.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip-apps/src/swig/java/android/app/app.iml 2022-02-24 07:54:38.000000000 +0000 @@ -0,0 +1,93 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip-apps/src/swig/java/android/app/build.gradle asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip-apps/src/swig/java/android/app/build.gradle --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip-apps/src/swig/java/android/app/build.gradle 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip-apps/src/swig/java/android/app/build.gradle 2022-02-24 07:54:38.000000000 +0000 @@ -1,23 +1,12 @@ apply plugin: 'com.android.application' android { - compileSdkVersion 15 - buildToolsVersion "23.0.3" + compileSdkVersion 29 defaultConfig { applicationId "org.pjsip.pjsua2.app" - minSdkVersion 11 - targetSdkVersion 15 - - ndk { - moduleName "libpjsua2" - } - - externalNativeBuild { - cmake { - arguments "-DANDROID_STL=c++_shared" - } - } + minSdkVersion 23 + targetSdkVersion 29 } buildTypes { @@ -27,3 +16,7 @@ } } } + +dependencies { + implementation project(path: ':pjsua2') +} diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip-apps/src/swig/java/android/app/src/main/AndroidManifest.xml asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip-apps/src/swig/java/android/app/src/main/AndroidManifest.xml --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip-apps/src/swig/java/android/app/src/main/AndroidManifest.xml 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip-apps/src/swig/java/android/app/src/main/AndroidManifest.xml 2022-02-24 07:54:38.000000000 +0000 @@ -4,10 +4,6 @@ android:versionCode="1" android:versionName="1.0" > - - diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip-apps/src/swig/java/android/app/src/main/java/org/pjsip/pjsua2/app/MainActivity.java asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip-apps/src/swig/java/android/app/src/main/java/org/pjsip/pjsua2/app/MainActivity.java --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip-apps/src/swig/java/android/app/src/main/java/org/pjsip/pjsua2/app/MainActivity.java 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip-apps/src/swig/java/android/app/src/main/java/org/pjsip/pjsua2/app/MainActivity.java 2022-02-24 07:54:38.000000000 +0000 @@ -19,6 +19,7 @@ package org.pjsip.pjsua2.app; import android.content.IntentFilter; +import android.hardware.camera2.CameraManager; import android.os.Bundle; import android.os.Handler; import android.os.Message; @@ -46,6 +47,7 @@ import java.util.HashMap; import java.util.Map; +import org.pjsip.PjCameraInfo2; import org.pjsip.pjsua2.*; public class MainActivity extends Activity @@ -128,6 +130,9 @@ super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); + CameraManager cm = (CameraManager)getSystemService(Context.CAMERA_SERVICE); + PjCameraInfo2.SetCameraManager(cm); + if (app == null) { app = new MyApp(); // Wait for GDB to init, for native debugging only diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip-apps/src/swig/java/android/app/src/main/java/org/pjsip/pjsua2/app/MyApp.java asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip-apps/src/swig/java/android/app/src/main/java/org/pjsip/pjsua2/app/MyApp.java --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip-apps/src/swig/java/android/app/src/main/java/org/pjsip/pjsua2/app/MyApp.java 2020-02-14 09:48:27.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip-apps/src/swig/java/android/app/src/main/java/org/pjsip/pjsua2/app/MyApp.java 2022-02-24 07:54:38.000000000 +0000 @@ -280,21 +280,7 @@ } -class MyApp { - static { - try{ - System.loadLibrary("openh264"); - // Ticket #1937: libyuv is now included as static lib - //System.loadLibrary("yuv"); - } catch (UnsatisfiedLinkError e) { - System.out.println("UnsatisfiedLinkError: " + e.getMessage()); - System.out.println("This could be safely ignored if you " + - "don't need video."); - } - System.loadLibrary("pjsua2"); - System.out.println("Library loaded"); - } - +class MyApp extends pjsua2 { public static Endpoint ep = new Endpoint(); public static MyAppObserver observer; public ArrayList accList = new ArrayList(); diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip-apps/src/swig/java/android/app-kotlin/build.gradle asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip-apps/src/swig/java/android/app-kotlin/build.gradle --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip-apps/src/swig/java/android/app-kotlin/build.gradle 1970-01-01 00:00:00.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip-apps/src/swig/java/android/app-kotlin/build.gradle 2022-02-24 07:54:38.000000000 +0000 @@ -0,0 +1,38 @@ +plugins { + id 'com.android.application' + id 'kotlin-android' +} + +android { + compileSdkVersion 29 + + defaultConfig { + applicationId "org.pjsip.pjsua2.app_kotlin" + minSdkVersion 23 + targetSdkVersion 29 + versionCode 1 + versionName "1.0" + } + + buildTypes { + release { + minifyEnabled false + proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' + } + } + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + } + kotlinOptions { + jvmTarget = '1.8' + } +} + +dependencies { + + implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version" + implementation 'com.android.support:appcompat-v7:28.0.0' + implementation 'com.android.support.constraint:constraint-layout:2.0.4' + implementation project(path: ':pjsua2') +} \ No newline at end of file diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip-apps/src/swig/java/android/app-kotlin/proguard-rules.pro asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip-apps/src/swig/java/android/app-kotlin/proguard-rules.pro --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip-apps/src/swig/java/android/app-kotlin/proguard-rules.pro 1970-01-01 00:00:00.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip-apps/src/swig/java/android/app-kotlin/proguard-rules.pro 2022-02-24 07:54:38.000000000 +0000 @@ -0,0 +1,21 @@ +# Add project specific ProGuard rules here. +# You can control the set of applied configuration files using the +# proguardFiles setting in build.gradle. +# +# For more details, see +# http://developer.android.com/guide/developing/tools/proguard.html + +# If your project uses WebView with JS, uncomment the following +# and specify the fully qualified class name to the JavaScript interface +# class: +#-keepclassmembers class fqcn.of.javascript.interface.for.webview { +# public *; +#} + +# Uncomment this to preserve the line number information for +# debugging stack traces. +#-keepattributes SourceFile,LineNumberTable + +# If you keep the line number information, uncomment this to +# hide the original source file name. +#-renamesourcefileattribute SourceFile \ No newline at end of file diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip-apps/src/swig/java/android/app-kotlin/src/main/AndroidManifest.xml asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip-apps/src/swig/java/android/app-kotlin/src/main/AndroidManifest.xml --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip-apps/src/swig/java/android/app-kotlin/src/main/AndroidManifest.xml 1970-01-01 00:00:00.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip-apps/src/swig/java/android/app-kotlin/src/main/AndroidManifest.xml 2022-02-24 07:54:38.000000000 +0000 @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff -Nru asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip-apps/src/swig/java/android/app-kotlin/src/main/java/org/pjsip/pjsua2/app_kotlin/MainActivity.kt asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip-apps/src/swig/java/android/app-kotlin/src/main/java/org/pjsip/pjsua2/app_kotlin/MainActivity.kt --- asterisk-18.11.2~dfsg+~cs6.10.40431413/Xpjproject/pjsip-apps/src/swig/java/android/app-kotlin/src/main/java/org/pjsip/pjsua2/app_kotlin/MainActivity.kt 1970-01-01 00:00:00.000000000 +0000 +++ asterisk-18.12.0~dfsg+~cs6.12.40431413/Xpjproject/pjsip-apps/src/swig/java/android/app-kotlin/src/main/java/org/pjsip/pjsua2/app_kotlin/MainActivity.kt 2022-02-24 07:54:38.000000000 +0000 @@ -0,0 +1,167 @@ +package org.pjsip.pjsua2.app_kotlin + +import android.os.Bundle +import android.support.v7.app.AppCompatActivity +import android.widget.Button +import org.pjsip.pjsua2.* + +/* Global objects */ +internal object g { + /* Maintain reference to avoid auto garbage collecting */ + lateinit var logWriter: MyLogWriter + + val ep = Endpoint() + val acc = MyAccount() +} + +/* Log writer, redirects logs to stdout */ +internal class MyLogWriter : LogWriter() { + override fun write(entry: LogEntry) { + println(entry.msg) + } +} + +/* Account implementation */ +internal class MyAccount : Account() { + override fun onIncomingCall(prm: OnIncomingCallParam) { + /* Auto answer with 200 for incoming calls */ + val call = MyCall(g.acc, prm.callId) + val ansPrm = CallOpParam() + ansPrm.statusCode = pjsip_status_code.PJSIP_SC_OK + try { + call.answer(ansPrm) + } catch (e: Exception) { + println(e) + } + } +} + +/* Call implementation */ +internal class MyCall(acc: Account, call_id: Int) : Call(acc, call_id) { + override fun onCallState(prm: OnCallStateParam?) { + val ci : CallInfo + try { + ci = info + } catch (e: Exception) { + println(e) + return + } + + g.ep.utilLogWrite(3, "MyCall", "Call state changed to: " + ci.getStateText()) + if (ci.state == pjsip_inv_state.PJSIP_INV_STATE_DISCONNECTED) { + g.ep.utilLogWrite(3, "MyCall", this.dump(true, "")) + } + } + + override fun onCallMediaState(prm: OnCallMediaStateParam?) { + val ci : CallInfo + try { + ci = info + } catch (e: Exception) { + println(e) + return + } + + val cmiv = ci.media + for (i in cmiv.indices) { + val cmi = cmiv[i] + if (cmi.type == pjmedia_type.PJMEDIA_TYPE_AUDIO && + (cmi.status == pjsua_call_media_status.PJSUA_CALL_MEDIA_ACTIVE || + cmi.status == pjsua_call_media_status.PJSUA_CALL_MEDIA_REMOTE_HOLD)) + { + /* Connect ports */ + try { + val am = getAudioMedia(i) + g.ep.audDevManager().captureDevMedia.startTransmit(am) + am.startTransmit(g.ep.audDevManager().playbackDevMedia) + } catch (e: Exception) { + println("Failed connecting media ports" + e.message) + continue + } + } + } + } +} + +class MainActivity : AppCompatActivity() { + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + setContentView(R.layout.activity_main) + + /* Setup Start button */ + val buttonStart = findViewById