sipral 1.1.0__py3-none-win_amd64.whl

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.
sipral/__init__.py ADDED
@@ -0,0 +1,102 @@
1
+ # SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Sipral-Commercial
2
+ # Copyright (c) 2026 Sytek
3
+
4
+ """Sipral: a SIP client stack, over its C ABI.
5
+
6
+ ``Stack``, ``Account`` and ``Call`` are the layer an application is meant
7
+ to use -- built with `cffi` in ABI mode against the same declarations the
8
+ C header, Swift, .NET, Kotlin and Dart bindings are printed from
9
+ (`docs/08-ffi.md`), so installing this package needs no C compiler and no
10
+ second source of truth for what the library exports. ``sipral._sipral_cffi``
11
+ is that raw layer (``ffi``/``lib``); reach for it directly only for
12
+ something this idiomatic layer has not grown yet.
13
+
14
+ ::
15
+
16
+ import asyncio
17
+ from sipral import Stack
18
+
19
+ async def main():
20
+ loop = asyncio.get_running_loop()
21
+ with Stack(loop=loop) as stack:
22
+ account = stack.add_account(
23
+ "sip:alice@example.invalid",
24
+ registrar_address="127.0.0.1:5070",
25
+ )
26
+ call = stack.place_call(account, "sip:bob@example.invalid")
27
+ event = await call.events.get()
28
+ ...
29
+
30
+ On a platform the library has an audio backend for (``features()`` has
31
+ ``Feature.AUDIO_DEVICE``: macOS, iOS, Windows) a stack opens the machine's
32
+ own microphone and loudspeaker and pumps every call through them, so the
33
+ code above is a whole softphone; ``stack.audio`` chooses the devices, the
34
+ volume and the mute. ``Stack(audio=AudioMode.APPLICATION)`` hands the frames
35
+ to the application instead: see ``examples/agent.py`` for a voice agent.
36
+ """
37
+
38
+ from __future__ import annotations
39
+
40
+ from .account import Account, PinnedCertificate
41
+ from .audio import Audio, AudioDevice, AudioInfo
42
+ from .call import Call
43
+ from .conference import LocalConference
44
+ from .counters import Counters
45
+ from .errors import SipralError
46
+ from .events import (
47
+ Answering,
48
+ AudioNotice,
49
+ CallerIdentity,
50
+ ConferenceNotice,
51
+ EndCause,
52
+ Event,
53
+ LocalConferenceNotice,
54
+ Presence,
55
+ Protection,
56
+ TypedText,
57
+ Verification,
58
+ )
59
+ from .locate import advertised_address, lookup
60
+ from .media import Media
61
+ from .settings import Settings
62
+ from .signalling import InviteLimit, TlsTrust
63
+ from .stack import TRACE, Stack, features
64
+ from .subscription import ConferencePicture, Participant, Subscription
65
+
66
+ __version__ = "1.1.0"
67
+
68
+ __all__ = [
69
+ "Account",
70
+ "Answering",
71
+ "Audio",
72
+ "AudioDevice",
73
+ "AudioInfo",
74
+ "AudioNotice",
75
+ "Call",
76
+ "CallerIdentity",
77
+ "ConferenceNotice",
78
+ "ConferencePicture",
79
+ "Counters",
80
+ "EndCause",
81
+ "Event",
82
+ "InviteLimit",
83
+ "LocalConference",
84
+ "LocalConferenceNotice",
85
+ "Media",
86
+ "Participant",
87
+ "PinnedCertificate",
88
+ "Presence",
89
+ "Protection",
90
+ "Settings",
91
+ "SipralError",
92
+ "Stack",
93
+ "Subscription",
94
+ "TRACE",
95
+ "TlsTrust",
96
+ "TypedText",
97
+ "Verification",
98
+ "__version__",
99
+ "advertised_address",
100
+ "features",
101
+ "lookup",
102
+ ]