ominicall 0.1.2__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,86 @@
1
+ Metadata-Version: 2.4
2
+ Name: ominicall
3
+ Version: 0.1.2
4
+ Summary: A lightweight, headless WebRTC-based communication SDK for 1-on-1 voice calls
5
+ Author-email: Vamshidhar Reddy Gorre <your-email@example.com>
6
+ License-Expression: MIT
7
+ Project-URL: Homepage, https://github.com/yourusername/ominicall
8
+ Project-URL: Bug Tracker, https://github.com/yourusername/ominicall/issues
9
+ Project-URL: Documentation, https://github.com/yourusername/ominicall#readme
10
+ Project-URL: Source, https://github.com/yourusername/ominicall
11
+ Keywords: webrtc,communication,voice-call,sdk,headless
12
+ Classifier: Development Status :: 3 - Alpha
13
+ Classifier: Intended Audience :: Developers
14
+ Classifier: Programming Language :: Python :: 3
15
+ Classifier: Programming Language :: Python :: 3.8
16
+ Classifier: Programming Language :: Python :: 3.9
17
+ Classifier: Programming Language :: Python :: 3.10
18
+ Classifier: Programming Language :: Python :: 3.11
19
+ Classifier: Programming Language :: Python :: 3.12
20
+ Classifier: Topic :: Communications :: Telephony
21
+ Classifier: Topic :: Internet :: WWW/HTTP
22
+ Requires-Python: >=3.8
23
+ Description-Content-Type: text/markdown
24
+ License-File: LICENSE
25
+ Requires-Dist: fastapi>=0.95.0
26
+ Requires-Dist: uvicorn[standard]>=0.21.0
27
+ Requires-Dist: websockets>=10.0
28
+ Requires-Dist: aiortc>=1.3.0
29
+ Requires-Dist: aiohttp>=3.8.0
30
+ Provides-Extra: dev
31
+ Requires-Dist: pytest>=7.0; extra == "dev"
32
+ Requires-Dist: pytest-asyncio>=0.21.0; extra == "dev"
33
+ Requires-Dist: black>=23.0; extra == "dev"
34
+ Requires-Dist: flake8>=6.0; extra == "dev"
35
+ Requires-Dist: mypy>=1.0; extra == "dev"
36
+ Dynamic: license-file
37
+
38
+ # OmniCall Headless SDK
39
+
40
+ A lightweight, headless WebRTC engine for 1-on-1 voice calls. Works across Web, Mobile Web, and Desktop.
41
+
42
+ ## Features
43
+ - **Headless:** No UI included. Build your own interface.
44
+ - **Auto-Busy:** Automatically rejects incoming calls if user is already in a call.
45
+ - **Cross-Platform:** Connect Web-to-Web, Mobile-to-Mobile, or Web-to-Mobile.
46
+ - **Hardware Management:** Automatically handles microphone permissions and cleanup.
47
+
48
+ ## Installation
49
+ Import the `OmniCall` class into your project:
50
+
51
+ ```javascript
52
+ import { OmniCall } from './path/to/sdk_core/web/core.js';
53
+
54
+
55
+ ## QUICK START
56
+
57
+ const voice = new OmniCall({
58
+ userId: "User_Unique_ID", // Can be Phone Number or String
59
+ serverUrl: "ws://your-signaling-server:8000",
60
+ onReady: () => console.log("Connected to server"),
61
+ onIncoming: (callerId) => {
62
+ // Show your custom "Incoming Call" popup here
63
+ if(confirm("Call from " + callerId)) {
64
+ voice.acceptCall();
65
+ } else {
66
+ voice.hangup();
67
+ }
68
+ },
69
+ onAccepted: () => console.log("Call Connected!"),
70
+ onBusy: () => alert("User is on another call"),
71
+ onHangup: () => console.log("Call Ended")
72
+ });
73
+
74
+ voice.connect();
75
+
76
+
77
+ ## CONTROL CALLS
78
+
79
+ // Start a call
80
+ voice.startCall("Target_User_ID");
81
+
82
+ // Mute logic (Implementation example)
83
+ voice.localStream.getAudioTracks()[0].enabled = false;
84
+
85
+ // End a call
86
+ voice.hangup();
@@ -0,0 +1,49 @@
1
+ # OmniCall Headless SDK
2
+
3
+ A lightweight, headless WebRTC engine for 1-on-1 voice calls. Works across Web, Mobile Web, and Desktop.
4
+
5
+ ## Features
6
+ - **Headless:** No UI included. Build your own interface.
7
+ - **Auto-Busy:** Automatically rejects incoming calls if user is already in a call.
8
+ - **Cross-Platform:** Connect Web-to-Web, Mobile-to-Mobile, or Web-to-Mobile.
9
+ - **Hardware Management:** Automatically handles microphone permissions and cleanup.
10
+
11
+ ## Installation
12
+ Import the `OmniCall` class into your project:
13
+
14
+ ```javascript
15
+ import { OmniCall } from './path/to/sdk_core/web/core.js';
16
+
17
+
18
+ ## QUICK START
19
+
20
+ const voice = new OmniCall({
21
+ userId: "User_Unique_ID", // Can be Phone Number or String
22
+ serverUrl: "ws://your-signaling-server:8000",
23
+ onReady: () => console.log("Connected to server"),
24
+ onIncoming: (callerId) => {
25
+ // Show your custom "Incoming Call" popup here
26
+ if(confirm("Call from " + callerId)) {
27
+ voice.acceptCall();
28
+ } else {
29
+ voice.hangup();
30
+ }
31
+ },
32
+ onAccepted: () => console.log("Call Connected!"),
33
+ onBusy: () => alert("User is on another call"),
34
+ onHangup: () => console.log("Call Ended")
35
+ });
36
+
37
+ voice.connect();
38
+
39
+
40
+ ## CONTROL CALLS
41
+
42
+ // Start a call
43
+ voice.startCall("Target_User_ID");
44
+
45
+ // Mute logic (Implementation example)
46
+ voice.localStream.getAudioTracks()[0].enabled = false;
47
+
48
+ // End a call
49
+ voice.hangup();
@@ -0,0 +1,86 @@
1
+ Metadata-Version: 2.4
2
+ Name: ominicall
3
+ Version: 0.1.2
4
+ Summary: A lightweight, headless WebRTC-based communication SDK for 1-on-1 voice calls
5
+ Author-email: Vamshidhar Reddy Gorre <your-email@example.com>
6
+ License-Expression: MIT
7
+ Project-URL: Homepage, https://github.com/yourusername/ominicall
8
+ Project-URL: Bug Tracker, https://github.com/yourusername/ominicall/issues
9
+ Project-URL: Documentation, https://github.com/yourusername/ominicall#readme
10
+ Project-URL: Source, https://github.com/yourusername/ominicall
11
+ Keywords: webrtc,communication,voice-call,sdk,headless
12
+ Classifier: Development Status :: 3 - Alpha
13
+ Classifier: Intended Audience :: Developers
14
+ Classifier: Programming Language :: Python :: 3
15
+ Classifier: Programming Language :: Python :: 3.8
16
+ Classifier: Programming Language :: Python :: 3.9
17
+ Classifier: Programming Language :: Python :: 3.10
18
+ Classifier: Programming Language :: Python :: 3.11
19
+ Classifier: Programming Language :: Python :: 3.12
20
+ Classifier: Topic :: Communications :: Telephony
21
+ Classifier: Topic :: Internet :: WWW/HTTP
22
+ Requires-Python: >=3.8
23
+ Description-Content-Type: text/markdown
24
+ License-File: LICENSE
25
+ Requires-Dist: fastapi>=0.95.0
26
+ Requires-Dist: uvicorn[standard]>=0.21.0
27
+ Requires-Dist: websockets>=10.0
28
+ Requires-Dist: aiortc>=1.3.0
29
+ Requires-Dist: aiohttp>=3.8.0
30
+ Provides-Extra: dev
31
+ Requires-Dist: pytest>=7.0; extra == "dev"
32
+ Requires-Dist: pytest-asyncio>=0.21.0; extra == "dev"
33
+ Requires-Dist: black>=23.0; extra == "dev"
34
+ Requires-Dist: flake8>=6.0; extra == "dev"
35
+ Requires-Dist: mypy>=1.0; extra == "dev"
36
+ Dynamic: license-file
37
+
38
+ # OmniCall Headless SDK
39
+
40
+ A lightweight, headless WebRTC engine for 1-on-1 voice calls. Works across Web, Mobile Web, and Desktop.
41
+
42
+ ## Features
43
+ - **Headless:** No UI included. Build your own interface.
44
+ - **Auto-Busy:** Automatically rejects incoming calls if user is already in a call.
45
+ - **Cross-Platform:** Connect Web-to-Web, Mobile-to-Mobile, or Web-to-Mobile.
46
+ - **Hardware Management:** Automatically handles microphone permissions and cleanup.
47
+
48
+ ## Installation
49
+ Import the `OmniCall` class into your project:
50
+
51
+ ```javascript
52
+ import { OmniCall } from './path/to/sdk_core/web/core.js';
53
+
54
+
55
+ ## QUICK START
56
+
57
+ const voice = new OmniCall({
58
+ userId: "User_Unique_ID", // Can be Phone Number or String
59
+ serverUrl: "ws://your-signaling-server:8000",
60
+ onReady: () => console.log("Connected to server"),
61
+ onIncoming: (callerId) => {
62
+ // Show your custom "Incoming Call" popup here
63
+ if(confirm("Call from " + callerId)) {
64
+ voice.acceptCall();
65
+ } else {
66
+ voice.hangup();
67
+ }
68
+ },
69
+ onAccepted: () => console.log("Call Connected!"),
70
+ onBusy: () => alert("User is on another call"),
71
+ onHangup: () => console.log("Call Ended")
72
+ });
73
+
74
+ voice.connect();
75
+
76
+
77
+ ## CONTROL CALLS
78
+
79
+ // Start a call
80
+ voice.startCall("Target_User_ID");
81
+
82
+ // Mute logic (Implementation example)
83
+ voice.localStream.getAudioTracks()[0].enabled = false;
84
+
85
+ // End a call
86
+ voice.hangup();
@@ -0,0 +1,14 @@
1
+ LICENSE
2
+ README.md
3
+ pyproject.toml
4
+ setup.py
5
+ ominicall.egg-info/PKG-INFO
6
+ ominicall.egg-info/SOURCES.txt
7
+ ominicall.egg-info/dependency_links.txt
8
+ ominicall.egg-info/requires.txt
9
+ ominicall.egg-info/top_level.txt
10
+ sdk_core/__init__.py
11
+ sdk_core/python_app/__init__.py
12
+ sdk_core/python_app/core.py
13
+ sdk_core/python_app/health.py
14
+ sdk_core/python_app/signaling.py
@@ -0,0 +1,12 @@
1
+ fastapi>=0.95.0
2
+ uvicorn[standard]>=0.21.0
3
+ websockets>=10.0
4
+ aiortc>=1.3.0
5
+ aiohttp>=3.8.0
6
+
7
+ [dev]
8
+ pytest>=7.0
9
+ pytest-asyncio>=0.21.0
10
+ black>=23.0
11
+ flake8>=6.0
12
+ mypy>=1.0
@@ -0,0 +1 @@
1
+ sdk_core
@@ -0,0 +1,68 @@
1
+ [build-system]
2
+ requires = ["setuptools>=45", "wheel"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "ominicall"
7
+ version = "0.1.2"
8
+ description = "A lightweight, headless WebRTC-based communication SDK for 1-on-1 voice calls"
9
+ readme = "README.md"
10
+ license = "MIT"
11
+ authors = [
12
+ {name = "Vamshidhar Reddy Gorre", email = "your-email@example.com"}
13
+ ]
14
+ keywords = ["webrtc", "communication", "voice-call", "sdk", "headless"]
15
+ classifiers = [
16
+ "Development Status :: 3 - Alpha",
17
+ "Intended Audience :: Developers",
18
+ "Programming Language :: Python :: 3",
19
+ "Programming Language :: Python :: 3.8",
20
+ "Programming Language :: Python :: 3.9",
21
+ "Programming Language :: Python :: 3.10",
22
+ "Programming Language :: Python :: 3.11",
23
+ "Programming Language :: Python :: 3.12",
24
+ "Topic :: Communications :: Telephony",
25
+ "Topic :: Internet :: WWW/HTTP",
26
+ ]
27
+ requires-python = ">=3.8"
28
+ dependencies = [
29
+ "fastapi>=0.95.0",
30
+ "uvicorn[standard]>=0.21.0",
31
+ "websockets>=10.0",
32
+ "aiortc>=1.3.0",
33
+ "aiohttp>=3.8.0",
34
+ ]
35
+
36
+ [project.optional-dependencies]
37
+ dev = [
38
+ "pytest>=7.0",
39
+ "pytest-asyncio>=0.21.0",
40
+ "black>=23.0",
41
+ "flake8>=6.0",
42
+ "mypy>=1.0",
43
+ ]
44
+
45
+ [project.urls]
46
+ "Homepage" = "https://github.com/yourusername/ominicall"
47
+ "Bug Tracker" = "https://github.com/yourusername/ominicall/issues"
48
+ "Documentation" = "https://github.com/yourusername/ominicall#readme"
49
+ "Source" = "https://github.com/yourusername/ominicall"
50
+
51
+ [tool.setuptools]
52
+
53
+ [tool.setuptools.packages.find]
54
+ include = ["sdk_core", "sdk_core.*"]
55
+
56
+ [tool.black]
57
+ line-length = 100
58
+ target-version = ["py38"]
59
+
60
+ [tool.mypy]
61
+ python_version = "3.8"
62
+ warn_return_any = true
63
+ warn_unused_configs = true
64
+ disallow_untyped_defs = false
65
+
66
+ [tool.pytest.ini_options]
67
+ testpaths = ["tests"]
68
+ asyncio_mode = "auto"
@@ -0,0 +1 @@
1
+ """Top-level package for OmniCall SDK."""
@@ -0,0 +1,3 @@
1
+ from .core import OmniCallApp
2
+
3
+ # This allows a developer to do: from sdk_core.python_app import OmniCallApp
@@ -0,0 +1,53 @@
1
+ import asyncio
2
+ import json
3
+ import aiohttp
4
+ import datetime
5
+ from aiortc import RTCPeerConnection, RTCSessionDescription
6
+
7
+ class OmniCallApp:
8
+ def __init__(self, user_id, signaling_url="ws://localhost:8000/ws"):
9
+ self.user_id = user_id
10
+ self.signaling_url = f"{signaling_url}/{user_id}"
11
+ self.pc = RTCPeerConnection()
12
+
13
+ async def start(self):
14
+ async with aiohttp.ClientSession() as session:
15
+ async with session.ws_connect(self.signaling_url) as ws:
16
+ print(f"🚀 Headless Client '{self.user_id}' is Online.")
17
+ async for msg in ws:
18
+ data = json.loads(msg.data)
19
+ if data['type'] == 'offer':
20
+ await self._handle_offer(data, ws)
21
+
22
+ async def _handle_offer(self, data, ws):
23
+ print(f"📞 Connection request from: {data.get('sender')}")
24
+ offer = RTCSessionDescription(sdp=data['sdp'], type='offer')
25
+ await self.pc.setRemoteDescription(offer)
26
+
27
+ @self.pc.on("datachannel")
28
+ def on_datachannel(channel):
29
+ print(f"✅ Data Channel detected: {channel.label}")
30
+
31
+ async def heartbeat():
32
+ # Wait for the browser to be ready
33
+ while channel.readyState != "open":
34
+ await asyncio.sleep(0.2)
35
+
36
+ print(f"🔥 Channel {channel.label} is ACTIVE. Starting Heartbeat...")
37
+ while channel.readyState == "open":
38
+ now = datetime.datetime.now().strftime("%H:%M:%S")
39
+ msg = f"Heartbeat from {self.user_id} at {now}"
40
+ channel.send(msg)
41
+ print(f"📤 Sent: {msg}")
42
+ await asyncio.sleep(5)
43
+
44
+ asyncio.create_task(heartbeat())
45
+
46
+ answer = await self.pc.createAnswer()
47
+ await self.pc.setLocalDescription(answer)
48
+ await ws.send_json({
49
+ 'type': 'answer',
50
+ 'target': data.get('sender'),
51
+ 'sdp': self.pc.localDescription.sdp
52
+ })
53
+ print("📤 Answer sent back.")
@@ -0,0 +1,27 @@
1
+ import asyncio
2
+
3
+ class HealthMonitor:
4
+ def __init__(self, pc):
5
+ self.pc = pc
6
+
7
+ async def start_watchdog(self):
8
+ print("[Health] Monitoring active...")
9
+ last_bytes = 0
10
+
11
+ while self.pc.iceConnectionState == "connected":
12
+ stats = await self.pc.getStats()
13
+ current_bytes = 0
14
+
15
+ # Find the inbound audio stats
16
+ for report in stats.values():
17
+ if report.type == "inbound-rtp" and report.kind == "audio":
18
+ current_bytes = report.get("bytesReceived", 0)
19
+
20
+ if current_bytes == last_bytes and last_bytes > 0:
21
+ print("[Health] ALERT: Data frozen! Potential Silent Killer.")
22
+ else:
23
+ # Flowing normally
24
+ pass
25
+
26
+ last_bytes = current_bytes
27
+ await asyncio.sleep(2)
@@ -0,0 +1,23 @@
1
+ import aiohttp
2
+ import json
3
+ import asyncio
4
+
5
+ class SignalingClient:
6
+ def __init__(self, url, on_message):
7
+ self.url = url
8
+ self.on_message = on_message
9
+ self.ws = None
10
+ asyncio.create_task(self._listen())
11
+
12
+ async def _listen(self):
13
+ async with aiohttp.ClientSession() as session:
14
+ async with session.ws_connect(self.url) as ws:
15
+ self.ws = ws
16
+ print(f"[Signaling] Connected to {self.url}")
17
+ async for msg in ws:
18
+ if msg.type == aiohttp.WSMsgType.TEXT:
19
+ await self.on_message(json.loads(msg.data))
20
+
21
+ async def send(self, data):
22
+ if self.ws:
23
+ await self.ws.send_json(data)
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,3 @@
1
+ from setuptools import setup
2
+
3
+ setup()