testing progress

This commit is contained in:
2025-08-12 09:12:54 -07:00
parent 75fae0fbdb
commit e18e046431
7 changed files with 372 additions and 119 deletions

View File

@@ -72,6 +72,8 @@ class TWP_Workflow {
break;
case 'ivr_menu':
// Add workflow_id to the step data
$step['workflow_id'] = $workflow_id;
$step_twiml = self::create_ivr_menu_twiml($step, $elevenlabs);
$stop_after_step = true; // IVR menu needs user input, stop here
break;
@@ -301,8 +303,12 @@ class TWP_Workflow {
$gather->addAttribute('action', $step['action_url']);
} else {
$webhook_url = home_url('/wp-json/twilio-webhook/v1/ivr-response');
$webhook_url = add_query_arg('workflow_id', $step['workflow_id'], $webhook_url);
$webhook_url = add_query_arg('step_id', $step['id'], $webhook_url);
if (isset($step['workflow_id'])) {
$webhook_url = add_query_arg('workflow_id', $step['workflow_id'], $webhook_url);
}
if (isset($step['id'])) {
$webhook_url = add_query_arg('step_id', $step['id'], $webhook_url);
}
$gather->addAttribute('action', $webhook_url);
}