With that change, it looks like it's immediately triggering the hangup. Are you sure that ! is not just a shortcut for "hangup"? Here's the relevant log portion:
Code:
fcb0e60c-57bc-4f54-9698-184748269e48 EXECUTE [depth=0] sofia/external/972XXXXXXX@sip.telnyx.com limit(hash inbound b9350c57-786a-4c1d-9eb2-89ea56cd39d3 1 !transfer:*99199 XML test.ivrnetworks.com)
fcb0e60c-57bc-4f54-9698-184748269e48 2023-06-05 12:41:30.128549 99.77% [DEBUG] switch_limit.c:124 incr called: inbound_b9350c57-786a-4c1d-9eb2-89ea56cd39d3 max:1, interval:0
fcb0e60c-57bc-4f54-9698-184748269e48 2023-06-05 12:41:30.128549 99.77% [INFO] mod_hash.c:180 Usage for inbound_b9350c57-786a-4c1d-9eb2-89ea56cd39d3 is already at max value (1)
fcb0e60c-57bc-4f54-9698-184748269e48 2023-06-05 12:41:30.128549 99.77% [NOTICE] mod_dptools.c:4816 Hangup sofia/external/972XXXXXXX@sip.telnyx.com [CS_EXECUTE] [NORMAL_CLEARING]
fcb0e60c-57bc-4f54-9698-184748269e48 2023-06-05 12:41:30.128549 99.77% [DEBUG] switch_core_session.c:2973 sofia/external/972XXXXXXX@sip.telnyx.com skip receive message [PHONE_EVENT] (channel is hungup already)
fcb0e60c-57bc-4f54-9698-184748269e48 2023-06-05 12:41:30.128549 99.77% [DEBUG] switch_core_state_machine.c:647 (sofia/external/972XXXXXXX@sip.telnyx.com) State EXECUTE going to sleep
fcb0e60c-57bc-4f54-9698-184748269e48 2023-06-05 12:41:30.128549 99.77% [DEBUG] switch_core_state_machine.c:581 (sofia/external/972XXXXXXX@sip.telnyx.com) Running State Change CS_HANGUP (Cur 2 Tot 512)
fcb0e60c-57bc-4f54-9698-184748269e48 2023-06-05 12:41:30.128549 99.77% [DEBUG] switch_core_state_machine.c:844 (sofia/external/972XXXXXXX@sip.telnyx.com) Callstate Change RINGING -> HANGUP
fcb0e60c-57bc-4f54-9698-184748269e48 2023-06-05 12:41:30.128549 99.77% [DEBUG] switch_core_state_machine.c:846 (sofia/external/972XXXXXXX@sip.telnyx.com) State HANGUP
fcb0e60c-57bc-4f54-9698-184748269e48 2023-06-05 12:41:30.128549 99.77% [DEBUG] mod_sofia.c:468 Channel sofia/external/972XXXXXXX@sip.telnyx.com hanging up, cause: NORMAL_CLEARING
fcb0e60c-57bc-4f54-9698-184748269e48 2023-06-05 12:41:30.128549 99.77% [DEBUG] mod_sofia.c:613 Responding to INVITE with: 480
I tried again with just !*99199 but it still immediately hung up at that line.
I then repeated it without the !, and it looped again a bunch of times. But I noticed that this time, it was getting to the "send_to_voicemail" dialplan. But because it was also passing through the "call_limit" dialplan every time, the "limit" action would kick off another pass through the dialplan.
So I made this change:
- Added a "call_limit_vmail" dialplan which is basically a copy of the "send_to_voicemail" dialplan.
- Changed the condition to:
- Changed voicemail_id=199 (Ideally, this would use a variable set in domain_variables)
- Added an "answer" right before the lua action.
- Changed the Order for the dialplan to 24 (right before "call_limit") and set continue to "false".
See screenshot below
Then in the "call_limit" dialplan:
- Changed to:
Code:
hash inbound ${domain_uuid} ${max_calls} call_limit_vmail
And it seems to be working. The "call_limit_vmail" shows up as destination in CDR, but for now, that's ok.