Metadata-Version: 2.4
Name: telerixa
Version: 1.0.0
Summary: Telerixa SDK - SignalWire/Twilio compatible voice API client
Author: Telerixa
License: MIT
Project-URL: Homepage, https://telerixa.com
Project-URL: Documentation, https://telerixa.com/documentation
Keywords: voice,telephony,sip,twilio,signalwire,laml,ivr,amd
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Topic :: Communications :: Telephony
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Requires-Python: >=3.8
Description-Content-Type: text/markdown
Requires-Dist: requests>=2.25.0
Provides-Extra: dev
Requires-Dist: pytest>=7.0.0; extra == "dev"

# Telerixa SDK

Cliente Python para la API de voz de [Telerixa](https://telerixa.com), compatible con SignalWire y Twilio.

## Instalación

```bash
pip install telerixa
```

## Credenciales

Las obtienes desde el dashboard en [telerixa.com](https://telerixa.com):

- `project_id`
- `api_token`
- `space_url` (por defecto `telerixa.com`)

## Uso

```python
from telerixa import Client

client = Client(project_id, api_token)

call = client.calls.create(
    to="+15551234567",
    from_="+15557654321",
    url="https://mi-backend.com/laml",
)

print(call.sid, call.status)
```

## Migrar desde SignalWire

El parámetro `signalwire_space_url` se sigue aceptando, así que basta con cambiar el import:

```python
# Antes
from signalwire.rest import Client
client = Client(project_id, api_token, signalwire_space_url="mi-space.signalwire.com")

# Después
from telerixa import Client
client = Client(project_id, api_token, signalwire_space_url="telerixa.com")
```

El resto del código no cambia.

## Grabación y detección de contestador

```python
call = client.calls.create(
    to="+15551234567",
    from_="+15557654321",
    url="https://mi-backend.com/laml",
    record=True,
    recording_status_callback="https://mi-backend.com/grabacion",
    machine_detection="Enable",
    status_callback="https://mi-backend.com/estado",
    status_callback_event=["initiated", "ringing", "answered", "completed"],
)
```

`call.answered_by` devuelve `human`, `machine_start` o `unknown`.

## Consultar y modificar llamadas

```python
# Listar
for c in client.calls.list(status="completed", limit=20):
    print(c.sid, c.duration)

# Consultar una
call = client.calls("CALL_SID").fetch()

# Colgar
client.calls("CALL_SID").update(status="completed")
```

## Espacio propio

Si tu cuenta usa un subdominio:

```python
client = Client(project_id, api_token, space_url="mi-space.telerixa.com")
```

## Licencia

MIT
