Hello,
EDIT: I have solved this on the reply below https://www.pbxforums.com/threads/recreating-bt-1471-call-history.8890/post-35728
I am trying to recreate the BT 1471 functionality where a user dials 1471 and the phone system responds with the date/time and telephone number of the last call, followed by "press 1 to return the call". This all works amazingly well, and my custom UK voices are working great but that's a post for another time
The problem is with the "play_and_get_digits" function. The sound file plays and I can see in fs_cli that the correct digit is collected. However I can't run actions based on the returned digit. I have attached my dialplan code and the area in question is line 33.
Could someone explain where I am going wrong please?
Thanks
EDIT: I have solved this on the reply below https://www.pbxforums.com/threads/recreating-bt-1471-call-history.8890/post-35728
I am trying to recreate the BT 1471 functionality where a user dials 1471 and the phone system responds with the date/time and telephone number of the last call, followed by "press 1 to return the call". This all works amazingly well, and my custom UK voices are working great but that's a post for another time
The problem is with the "play_and_get_digits" function. The sound file plays and I can see in fs_cli that the correct digit is collected. However I can't run actions based on the returned digit. I have attached my dialplan code and the area in question is line 33.
Could someone explain where I am going wrong please?
XML:
<extension name="last_caller" continue="false" uuid="382f0782-2950-43a2-8e5c-3e63e50e886d">
<condition field="destination_number" expression="^1471$">
<action application="answer" data=""/>
<action application="sleep" data="1000"/>
<!-- Retrieve last caller number and time from hash -->
<action application="set" data="last_caller_number=${hash(select/${domain_name}-1471/last_number)}"/>
<action application="set" data="last_caller_time=${hash(select/${domain_name}-1471/last_time)}"/>
<action application="set" data="last_call_datetime=${strftime(%Y-%m-%d %H:%M:%S,${last_caller_time})}"/>
<!-- If NO calls have ever been received -->
<!--
<condition field="${last_caller_number}" expression="^$">
<action application="playback" data="voicemail/vm-no_calls_received.wav"/>
<action application="hangup"/>
</condition>
-->
<!-- Play date and number files -->
<action application="playback" data="voicemail/vm-you_were_called.wav"/>
<action application="say" data="en SHORT_DATE_TIME pronounced ${last_caller_time}"/>
<action application="sleep" data="300"/>
<action application="say" data="en TELEPHONE_NUMBER pronounced ${hash(select/${domain_name}-1471/last_number)}"/>
<action application="sleep" data="300"/>
<!-- Play and collect digit -->
<action application="play_and_get_digits" data="1 1 3 5000 # voicemail/vm-to_return_the_call.wav '' return_digit"/>
<!-- If they pressed 1, call back -->
<condition field="${return_digit}" expression="^1$">
<action application="log" data="INFO Callback condition triggered"/>
<!-- <action application="set" data="last_call_number_int=${regex_replace(${last_call_number}, '^0', '+44')}"/> -->
<action application="bridge" data="sofia/gateway/AQL/${last_call_number}"/>
</condition>
<!-- Play goodbye and hangup -->
<action application="sleep" data="300"/>
<action application="playback" data="voicemail/vm-goodbye.wav"/>
<action application="hangup" data=""/>
</condition>
</extension>
Thanks
Last edited: