{"id":49820079,"url":"https://github.com/dzikrymh/cdn-softphone-widget","last_synced_at":"2026-05-13T10:01:04.711Z","repository":{"id":357535523,"uuid":"1237380738","full_name":"dzikrymh/cdn-softphone-widget","owner":"dzikrymh","description":"CDN Softphone Widget","archived":false,"fork":false,"pushed_at":"2026-05-13T08:26:00.000Z","size":17,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-05-13T08:27:33.585Z","etag":null,"topics":["cdn","jsdelivr-cdn","testing"],"latest_commit_sha":null,"homepage":"https://cdn.jsdelivr.net/gh/dzikrymh/cdn-softphone-widget@2.0.0/softphone-widget.js","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dzikrymh.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-05-13T06:09:37.000Z","updated_at":"2026-05-13T08:26:03.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/dzikrymh/cdn-softphone-widget","commit_stats":null,"previous_names":["dzikrymh/cdn-softphone-widget"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/dzikrymh/cdn-softphone-widget","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dzikrymh%2Fcdn-softphone-widget","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dzikrymh%2Fcdn-softphone-widget/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dzikrymh%2Fcdn-softphone-widget/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dzikrymh%2Fcdn-softphone-widget/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dzikrymh","download_url":"https://codeload.github.com/dzikrymh/cdn-softphone-widget/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dzikrymh%2Fcdn-softphone-widget/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32977273,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-13T06:31:55.726Z","status":"ssl_error","status_checked_at":"2026-05-13T06:31:51.336Z","response_time":115,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cdn","jsdelivr-cdn","testing"],"created_at":"2026-05-13T10:00:56.427Z","updated_at":"2026-05-13T10:01:04.697Z","avatar_url":"https://github.com/dzikrymh.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# Softphone Widget\n\nWidget embeddable untuk menampilkan panel softphone di website (muncul di kanan bawah), lengkap dengan:\n- status SIP (REGISTER)\n- outgoing call dari host page\n- incoming call popup (Answer / Decline)\n\n## Dokumentasi untuk Client (Website Host)\nBagian ini menjelaskan **cara pemakaian** dan **fungsi yang tersedia** saat widget sudah di-embed.\n\n### File yang dibutuhkan\nClient hanya perlu **1 file** hasil build:\n- `softphone-widget.js`\n\nFile ini sudah berisi CSS widget (di-inject ke Shadow DOM), jadi **tidak perlu** menyertakan file CSS terpisah.\n\n### Cara embed\n1) Host `softphone-widget.js` di server/hosting client (atau CDN)\n2) Sertakan script di HTML\n3) Panggil `SoftphoneWidget.init(config)`\n\nAda 2 opsi url yang disediakan dan bisa di embed\n- https://cdn.jsdelivr.net/gh/dzikrymh/cdn-softphone-widget@2.0.0/softphone-widget.js\n- https://cdn.jsdelivr.net/gh/dzikrymh/cdn-softphone-widget@2.0.0/softphone-widget.min.js\n\nContoh:\n\n```html\n\u003cscript src=\"https://cdn.jsdelivr.net/gh/dzikrymh/cdn-softphone-widget@2.0.0/softphone-widget.min.js\"\u003e\u003c/script\u003e\n\u003cscript\u003e\n  SoftphoneWidget.init({\n    extension: 'YOUR_USER',\n    password: 'YOUR_SECRET',\n    server: 'YOUR_SERVER_WSS',\n    theme: 'light'\n  });\n\u003c/script\u003e\n```\n\n### Konfigurasi (`init(config)`)\nWajib:\n- `extension` (string)\n- `password` (string)\n- `server` (string) — endpoint SIP over WebSocket (umumnya **WSS**)\n\nOpsional:\n- `theme`: `'dark' | 'light'`\n\nCatatan validasi:\n- Jika field wajib kosong, `init` akan throw error.\n- Jika `theme` diisi selain `dark/light`, `init` akan throw error.\n\n### Fungsi yang tersedia (Global API)\nWidget build diexpose sebagai global `SoftphoneWidget` (format IIFE), dengan fungsi:\n\n- `SoftphoneWidget.init(config)`\n  - Fungsi untuk mount widget (pojok kanan bawah).\n  - Aman dipanggil sebelum DOM siap: akan menunggu `DOMContentLoaded`.\n  - Jika dipanggil lagi, widget akan di-render ulang dengan config terbaru.\n\n- `SoftphoneWidget.call(target: string): Promise\u003cvoid\u003e`\n  - Trigger outgoing call dari host page.\n  - Akan throw error jika:\n    - `target` kosong\n    - widget belum siap\n    - belum terkoneksi/REGISTER (status online)\n\n- `SoftphoneWidget.hangup(): Promise\u003cvoid\u003e`\n  - Mengakhiri panggilan aktif.\n  - Akan throw error jika widget belum siap.\n\n### Contoh pemakaian (dengan error handling)\nKarena `call()` / `hangup()` berbasis Promise dan bisa melempar error, sebaiknya dipanggil dengan `await` + `try/catch`.\n\n```html\n\u003cbutton id=\"btn-call\"\u003eCall 1002\u003c/button\u003e\n\u003cbutton id=\"btn-hangup\"\u003eHangup\u003c/button\u003e\n\n\u003cscript src=\"https://cdn.jsdelivr.net/gh/dzikrymh/cdn-softphone-widget@2.0.0/softphone-widget.min.js\"\u003e\u003c/script\u003e\n\u003cscript\u003e\n  SoftphoneWidget.init({\n    extension: 'YOUR_USER',\n    password: 'YOUR_SECRET',\n    server: 'YOUR_SERVER_WSS',\n    theme: 'light'\n  });\n\n  document.getElementById('btn-call').addEventListener('click', async () =\u003e {\n    try {\n      await SoftphoneWidget.call('1002');\n    } catch (e) {\n      console.error(e);\n      alert(String(e \u0026\u0026 e.message ? e.message : e));\n    }\n  });\n\n  document.getElementById('btn-hangup').addEventListener('click', async () =\u003e {\n    try {\n      await SoftphoneWidget.hangup();\n    } catch (e) {\n      console.error(e);\n      alert(String(e \u0026\u0026 e.message ? e.message : e));\n    }\n  });\n\u003c/script\u003e\n```\n\n### Catatan integrasi\n- Widget akan membuat container `\u003cdiv id=\"softphone-widget\"\u003e` di `document.body` dan memasang UI di Shadow DOM.\n- Outgoing call hanya bisa dilakukan saat status SIP sudah online/REGISTER (ditampilkan di UI widget). Saat belum online, `SoftphoneWidget.call()` akan error.\n- Audio ringtone incoming bisa tidak bunyi jika browser memblokir autoplay. Biasanya perlu minimal 1 interaksi user (klik) di halaman.\n- Untuk akses mikrofon dan WebRTC yang stabil, umumnya disarankan menjalankan website host via HTTPS (terutama di environment produksi).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdzikrymh%2Fcdn-softphone-widget","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdzikrymh%2Fcdn-softphone-widget","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdzikrymh%2Fcdn-softphone-widget/lists"}