RELAYCall

send_fax

View as MarkdownOpen in Claude

Send a fax document on the call. The document must be accessible via URL. Returns a FaxAction that you can use to stop the fax or wait for it to complete.

This method emits calling.call.fax events. See Call Events for payload details.

Parameters

document
strRequired

URL of the document to fax (PDF or TIFF format).

identity
Optional[str]

Caller identity string (TSI) transmitted with the fax.

header_info
Optional[str]

Header text printed at the top of each fax page.

control_id
Optional[str]

Custom control ID. Auto-generated if not provided.

on_completed
Optional[Callable[[RelayEvent], Any]]

Callback invoked when the fax operation completes.

Returns

FaxAction — An action handle with stop() and wait() methods.

Example

1from signalwire.relay import RelayClient
2
3client = RelayClient(
4 project="your-project-id",
5 token="your-api-token",
6 host="your-space.signalwire.com",
7 contexts=["default"],
8)
9
10@client.on_call
11async def handle_call(call):
12 await call.answer()
13
14 action = await call.send_fax(
15 document="https://example.com/invoice.pdf",
16 identity="+15559876543",
17 header_info="Invoice #12345",
18 )
19 event = await action.wait()
20
21 fax_result = event.params.get("fax", {})
22 print(f"Fax sent: {fax_result.get('pages', 0)} pages")
23 await call.hangup()
24
25client.run()