=== MediaSFU – Voice, Video & AI Call Widgets ===
Contributors: mediasfu
Tags: live chat, click to call, video call, AI agent, WebRTC
Requires at least: 5.8
Tested up to: 6.7
Stable tag: 1.0.0
Requires PHP: 7.4
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Add real-time voice, video, and AI agent call widgets to any WordPress site in minutes.

== Description ==

**MediaSFU** is a Canadian-built, programmable real-time media platform. This plugin lets you embed MediaSFU's click-to-call, video, and AI agent widgets on any page or post — no coding required.

**What you can add to your site:**

* 📞 **Click-to-Call** (`type="click-to-call"`) — a button that opens a live voice call right in the browser
* 🤖 **AI Agent** (`type="ai-agent"`) — standalone AI voice agent, no human escalation, bring your own OpenAI/Claude key
* 📹 **Meeting Portal** (`type="meeting-join"`) — create or join embedded meeting rooms for support, consultations, or demos
* 📱 **Calls Dashboard** (`type="calls"`) — full softphone with inbound/outbound calling and dialpad
* 🧠 **AI Agent Plus** (`type="web-agent-embed"`) — AI agent with live human escalation and operator takeover *(recommended)*
* 📊 **Agents Dashboard** (`type="web-agent-dashboard"`) — operator console for monitoring and taking over AI agent sessions

**How it works:**

1. Install & activate the plugin
2. Go to **Settings → MediaSFU Widgets** and enter your free widget key (get one at [mediasfu.com](https://mediasfu.com))
3. Drop the shortcode `[mediasfu_widget]` anywhere on your site
4. Done — visitors can call, video chat, or connect with an AI agent instantly

**Key features:**

* Simple shortcode — `[mediasfu_widget]` or type-specific `[mediasfu_click_to_call button_text="Talk to Us"]`
* Powered by real Web Components — `<mediasfu-call-button>` custom elements from the MediaSFU CDN
* Auto-embed mode — floats a widget on every page without shortcodes
* Widgets are fully self-contained — they load their own UI, styles, and media handling
* E2E encrypted (SFU routing — the server never decodes your media)
* Works with Gutenberg, Elementor, Divi, WPBakery, and all major page builders
* Fully responsive — works on mobile, tablet, and desktop
* No jQuery dependency — pure Web Components, loaded once from CDN

**Pricing:**

MediaSFU charges **$0.10 per 1,000 minutes** — flat rate, no per-seat fees. A free tier is available for testing.

**Compared to alternatives:**

| Platform | Price |
|---|---|
| Aircall / JustCall | Per-seat monthly + per-minute |
| Zoom / Google Meet | Per-seat monthly |
| **MediaSFU** | **$0.10 / 1,000 minutes flat** |

== Installation ==

1. Upload the `mediasfu-widgets` folder to `/wp-content/plugins/`, or install via **Plugins → Add New → Upload Plugin**
2. Activate the plugin in **Plugins → Installed Plugins**
3. Go to **Settings → MediaSFU Widgets**
4. Enter your widget key (free at [mediasfu.com](https://mediasfu.com))
5. Add `[mediasfu_widget]` (or a type-specific shortcode) to any page, post, or widget area

== Frequently Asked Questions ==

= Do I need a MediaSFU account? =
Yes. Create a free account at [mediasfu.com](https://mediasfu.com) — no credit card required. The free tier includes enough minutes to test and go live. Your widget key is shown in the MediaSFU dashboard.

= Does this work with Elementor, Divi, or WPBakery? =
Yes. Use `[mediasfu_widget]` (or any type-specific shortcode) in any text/shortcode element in any page builder. `[mediasfu_call]` still works as a backward-compatible alias.

= Can I put the call button in a specific spot on the page? =
Yes — place the shortcode exactly where you want the button. You can also enable **Auto-embed** in settings to float the button in the corner of every page.

= Can I have different rooms for different pages? =
Usually you only need `widget-key` and `type`. If your call flow needs explicit routing overrides, you can still pass advanced click-to-call attributes per shortcode (for example `sip_config_id` or `did`).

= Is this secure / encrypted? =
Yes. MediaSFU uses SFU (Selective Forwarding Unit) routing with end-to-end encryption. The server never decodes your media.

= What widget types are available? =
Six types — use `[mediasfu_widget type="..."]` or the type-specific shortcodes directly:

* `[mediasfu_click_to_call]` — voice call button
* `[mediasfu_ai_agent]` — standalone AI voice agent
* `[mediasfu_meeting_join]` — meeting portal (create/join rooms)
* `[mediasfu_calls]` — softphone dashboard
* `[mediasfu_web_agent_embed]` — AI agent with live human escalation (recommended)
* `[mediasfu_web_agent_dashboard]` — operator console for monitoring agent sessions

Set the global default type in **Settings → MediaSFU Widgets**, or override per-shortcode.

= Does the widget work on mobile? =
Yes. MediaSFU widgets are responsive Web Components. Microphone/camera permissions work on iOS Safari 15.4+ and Android Chrome.

= Can I use this for AI voice agents? =
Yes. Configure your AI agent in the MediaSFU dashboard, then use `[mediasfu_web_agent_embed config_name="your-agent-config"]`. Visitors talk directly to your AI agent — with optional human escalation.

== Screenshots ==

1. Click-to-Call widget embedded in a page — visitors click to start a live voice call
2. Settings page — enter widget key, choose widget type, theme, and enable auto-embed
3. AI Agent Plus widget active in a browser — voice conversation with human escalation
4. Shortcode quick-reference — all 7 shortcodes and common attribute examples
5. Calls Dashboard widget — full softphone with inbound/outbound calling and dialpad
6. Web Agent Dashboard — operator console for monitoring and taking over agent sessions

== Changelog ==

= 1.0.0 =
* Initial release — shortcode, settings page, auto-embed using native Web Components from MediaSFU CDN
* 7 shortcodes: `[mediasfu_widget]` plus 6 type-specific convenience shortcodes
* Embed code import — paste a MediaSFU embed snippet into Settings to auto-populate all fields
* Import-from-embed feature on settings page parses widget-key, type, theme, position, button-text automatically

== Upgrade Notice ==

= 1.0.0 =
Initial release.
