Add TWP Softphone Flutter app and complete mobile backend API
All checks were successful
Create Release / build (push) Successful in 4s
All checks were successful
Create Release / build (push) Successful in 4s
Backend: Add /voice/token endpoint with AccessToken + VoiceGrant for mobile VoIP, implement unhold_call() with call leg detection, wire FCM push notifications into call queue and webhook missed call handlers, add data-only FCM message support for Android background wake, and add Twilio API Key / Push Credential settings fields. Flutter app: Full softphone with Twilio Voice SDK integration, JWT auth with auto-refresh, SSE real-time queue updates, FCM push notifications, Material 3 UI with dashboard, active call screen, dialpad, and call controls (mute/speaker/hold/transfer). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -40,6 +40,9 @@ if (isset($_POST['twp_save_mobile_settings']) && check_admin_referer('twp_mobile
|
||||
update_option('twp_auto_update_enabled', isset($_POST['twp_auto_update_enabled']) ? '1' : '0');
|
||||
update_option('twp_gitea_repo', sanitize_text_field($_POST['twp_gitea_repo']));
|
||||
update_option('twp_gitea_token', sanitize_text_field($_POST['twp_gitea_token']));
|
||||
update_option('twp_twilio_api_key_sid', sanitize_text_field($_POST['twp_twilio_api_key_sid']));
|
||||
update_option('twp_twilio_api_key_secret', sanitize_text_field($_POST['twp_twilio_api_key_secret']));
|
||||
update_option('twp_fcm_push_credential_sid', sanitize_text_field($_POST['twp_fcm_push_credential_sid']));
|
||||
|
||||
$settings_saved = true;
|
||||
}
|
||||
@@ -49,6 +52,9 @@ $fcm_server_key = get_option('twp_fcm_server_key', '');
|
||||
$auto_update_enabled = get_option('twp_auto_update_enabled', '1') === '1';
|
||||
$gitea_repo = get_option('twp_gitea_repo', 'wp-plugins/twilio-wp-plugin');
|
||||
$gitea_token = get_option('twp_gitea_token', '');
|
||||
$twilio_api_key_sid = get_option('twp_twilio_api_key_sid', '');
|
||||
$twilio_api_key_secret = get_option('twp_twilio_api_key_secret', '');
|
||||
$fcm_push_credential_sid = get_option('twp_fcm_push_credential_sid', '');
|
||||
|
||||
// Get update status
|
||||
require_once TWP_PLUGIN_DIR . 'includes/class-twp-auto-updater.php';
|
||||
@@ -132,6 +138,53 @@ $total_sessions = $wpdb->get_var("SELECT COUNT(*) FROM $sessions_table");
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">
|
||||
<label for="twp_twilio_api_key_sid">Twilio API Key SID</label>
|
||||
</th>
|
||||
<td>
|
||||
<input type="text"
|
||||
id="twp_twilio_api_key_sid"
|
||||
name="twp_twilio_api_key_sid"
|
||||
value="<?php echo esc_attr($twilio_api_key_sid); ?>"
|
||||
class="regular-text"
|
||||
placeholder="SK...">
|
||||
<p class="description">
|
||||
Create an API Key in Twilio Console > Account > API Keys. Required for mobile VoIP tokens.
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">
|
||||
<label for="twp_twilio_api_key_secret">Twilio API Key Secret</label>
|
||||
</th>
|
||||
<td>
|
||||
<input type="password"
|
||||
id="twp_twilio_api_key_secret"
|
||||
name="twp_twilio_api_key_secret"
|
||||
value="<?php echo esc_attr($twilio_api_key_secret); ?>"
|
||||
class="regular-text">
|
||||
<p class="description">
|
||||
The secret associated with the API Key SID above. Shown only once when key is created.
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">
|
||||
<label for="twp_fcm_push_credential_sid">Push Credential SID</label>
|
||||
</th>
|
||||
<td>
|
||||
<input type="text"
|
||||
id="twp_fcm_push_credential_sid"
|
||||
name="twp_fcm_push_credential_sid"
|
||||
value="<?php echo esc_attr($fcm_push_credential_sid); ?>"
|
||||
class="regular-text"
|
||||
placeholder="CR...">
|
||||
<p class="description">
|
||||
Twilio Push Credential SID. Create in Twilio Console > Messaging > Push Credentials using your FCM server key. Required for incoming call push notifications.
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<?php if (!empty($fcm_server_key)): ?>
|
||||
@@ -273,6 +326,11 @@ $total_sessions = $wpdb->get_var("SELECT COUNT(*) FROM $sessions_table");
|
||||
<td>GET</td>
|
||||
<td>Server-Sent Events stream for real-time updates</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>/twilio-mobile/v1/voice/token</code></td>
|
||||
<td>GET</td>
|
||||
<td>Get Twilio Voice access token for VoIP</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user