Skip to content

The open-source AI receptionist for businesses. Answers every call, books the appointment and hands over to a person when needed. You own the code and the data.

Staging on the separate Telnyx dev account (PR 2013)

Janik0ca2d41ffd60
diff --git a/apps/agent/src/setup-test-caller.ts b/apps/agent/src/setup-test-caller.ts
index a17b966f..7639c227 100644
--- a/apps/agent/src/setup-test-caller.ts
+++ b/apps/agent/src/setup-test-caller.ts
@@ -1,20 +1,24 @@
// One-time setup for the phone-to-phone call test (re-run it to repair or rotate the password):
// a Telnyx credential connection for outbound calls with the test caller's number, and the LiveKit
-// SIP outbound trunk that uses it. Only objects named "linedesk-test-caller" are created or changed.
+// SIP outbound trunk that uses it. Only objects named "linedesk-test-caller" are created or changed (at Telnyx with the
+// install's LINEDESK_CARRIER_SUFFIX, e.g. "linedesk-test-caller-staging": SIP user names are unique across all Telnyx
+// accounts, so two installs never share one; the LiveKit trunk keeps the plain name).
// Usage: pnpm --filter @linedesk/agent setup-test-caller (needs TELNYX_API_KEY, CALL_TEST_FROM, LiveKit env)
-import { createTelnyxOutbound, telnyxSpendLimits } from '@linedesk/telephony'
+import { createTelnyxOutbound, installCarrierName, telnyxSpendLimits } from '@linedesk/telephony'
import { requireEnv, runScript } from './env.ts'
import { replaceOutboundTrunk, sipClient } from './sip-trunks.ts'
async function main() {
const env = requireEnv(['TELNYX_API_KEY', 'CALL_TEST_FROM'])
+ const name = installCarrierName('linedesk-test-caller')
const outbound = await createTelnyxOutbound({
apiKey: env.TELNYX_API_KEY,
+ name,
spendLimits: telnyxSpendLimits(process.env),
}).ensureOutboundSip(env.CALL_TEST_FROM)
const trunkId = await replaceOutboundTrunk(sipClient(), [env.CALL_TEST_FROM], outbound)
console.log(
- `Telnyx: credential connection "linedesk-test-caller" with ${env.CALL_TEST_FROM} as caller ID (SIP user ${outbound.username}, new password set)`,
+ `Telnyx: credential connection "${name}" with ${env.CALL_TEST_FROM} as caller ID (SIP user ${outbound.username}, new password set)`,
)
console.log(`LiveKit: outbound trunk ${trunkId} through ${outbound.address}`)
}