how to handle outgoing audio calls in background i...
# ask-ai
d
how to handle outgoing audio calls in background in react-native expo ios
t
Thanks for reaching out, Kanchan. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
It sounds like you’re asking how to place outgoing audio calls from a React Native Expo app on iOS. At a high level: • Use a custom Expo dev build (not Expo Go) so native WebRTC runs, and call
registerGlobals()
on app startup. Add mic permissions (and optional background audio) for iOS. • For PSTN dialing, set up LiveKit SIP: create an outbound trunk, then create a SIP participant to dial the phone number into your LiveKit room. Steps: 1. Expo/iOS setup ◦ Build with expo-dev-client (native modules required). Expo quickstart ◦ In app startup (e.g.,
index.js
), call
registerGlobals()
. React Native quickstart ◦ Add iOS permissions (
NSMicrophoneUsageDescription
) and, if needed, Background Modes → Audio. Camera & microphone 1. Connect your app to a room ◦ Get a server-issued LiveKit token and connect the RN client. Connecting to LiveKit 1. Enable outbound calling (PSTN) ◦ Create an outbound SIP trunk with your provider’s number/credentials. SIP outbound trunk ◦ From your server, call
CreateSIPParticipant
with
sip_trunk_id
,
sip_call_to
(phone number), and
room_name
. Options include
wait_until_answered
,
ringing_timeout
,
krisp_enabled
. Making outbound calls | SIP APIs Would you like a minimal code snippet for the Expo setup and a sample
CreateSIPParticipant
request body? Sources: Expo quickstart | LiveKit docs | React Native quickstart | LiveKit docs | Making outbound calls | LiveKit Docs | Make outbound calls | LiveKit Docs | SIP outbound trunk | LiveKit docs
d
i'm doing calling with ai using react-native expo how to handle the outgoing call in background mode passing the server url in livekit component creating room
t
It sounds like you’re building AI calling in React Native Expo and need background audio plus how to pass your server URL when creating the room. To handle background audio on iOS: • Build with a custom Expo dev client (not Expo Go). • Enable iOS Background Modes → Audio, and add mic permission to Info.plist. • Call
registerGlobals()
at app startup before connecting. • Use your token server to fetch a token, then pass your LiveKit server URL and token to the room. Example (Expo RN):
Copy code
// index.js
import { registerGlobals } from '@livekit/react-native';
registerGlobals();
Copy code
// In your component
<LiveKitRoom
  serverUrl="wss://YOUR-LIVEKIT-URL"
  token={tokenFromYourServer}
  connect={true}
/>
Relevant references: • Expo setup and dev client: Expo quickstart • React Native init (
registerGlobals
) and connect: React Native quickstart, Connecting to LiveKit Do you want a minimal
app.json
snippet (plugins, Info.plist keys) and a token fetch example? Sources: Swift quickstart | LiveKit docs | Flutter quickstart | LiveKit docs | Mobile SDKs (Flutter, iOS, Android) | livekit/livekit_composite | DeepWiki | Expo quickstart | LiveKit docs | React Native quickstart | LiveKit docs
d
yes also how to mantain the connection in the background code as well
t
I don't have the answer you're looking for. You could also try asking your question: • in one of the other Slack channels or • to https://deepwiki.com/livekit/livekit_composite which is trained on all LiveKit source code If you find the answer, please post it here to help others!
d
give me a complete example of how to handle the outgoing calls for ios