sig_analog: Allow immediate fake ring to be suppressed.

When immediate=yes on an FXS channel, sig_analog will
start fake audible ringback that continues until the
channel is answered. Even if it answers immediately,
the ringback is still audible for a brief moment.
This can be disruptive and unwanted behavior.

This adds an option to disable this behavior, though
the default behavior remains unchanged.

ASTERISK-30003 #close
Resolves: #118

UserNote: The immediatering option can now be set to no to suppress
the fake audible ringback provided when immediate=yes on FXS channels.

(cherry picked from commit d87abb2ec9)
This commit is contained in:
Naveen Albert
2023-06-08 22:04:31 +00:00
committed by Asterisk Development Team
parent 9e2b9424f5
commit 967e8f6beb
5 changed files with 23 additions and 1 deletions

View File

@@ -3815,7 +3815,10 @@ void *analog_handle_init_event(struct analog_pvt *i, int event)
if (i->immediate) {
analog_set_echocanceller(i, 1);
/* The channel is immediately up. Start right away */
res = analog_play_tone(i, ANALOG_SUB_REAL, ANALOG_TONE_RINGTONE);
if (i->immediatering) {
/* Play fake ringing, if we've been told to... */
res = analog_play_tone(i, ANALOG_SUB_REAL, ANALOG_TONE_RINGTONE);
}
chan = analog_new_ast_channel(i, AST_STATE_RING, 1, ANALOG_SUB_REAL, NULL);
if (!chan) {
ast_log(LOG_WARNING, "Unable to start PBX on channel %d\n", i->channel);