AI, engineering
I Couldn't Call China, So I Built an AI That Could
My Mandarin was never going to book the restaurants I wanted in China. They take reservations by phone only, in Chinese. So I built a Mandarin-speaking AI that could call them for me. Here is how it all came together: the whole pipeline, plus four real booking conversations, transcribed in Chinese and English.
A build log with real call transcripts. Everything is exactly what happened.
The booking call, all 1:48 of it. Full transcripts are in section 06.
The short version
- My Mandarin was never going to survive the negotiation: the restaurants only book by phone, in Chinese. So an AI made the calls instead.
- My US voice provider, Twilio, does not support outbound voice calls to mainland China, so it stays the US/Canada lane: domestic voice, SMS, one-time codes, alerts. The China calls needed a different carrier.
- The China lane: ElevenLabs Conversational AI (a Mandarin voice agent) → a SIP trunk ("ElevenLabs AI Voice": sip.rtc.elevenlabs.io:5060, TCP) → Telnyx → the phone network → the restaurant.
- Telnyx needed an ID verification (KYC) to unlock China (+86). Setup cost: $5 of account credit plus a US number ($1 upfront + $1/month) that shows up as the caller ID.
- Four real calls, all transcribed below: a Shanghai booking (7:30 and 8:00 were full, took 9:30 PM for 4, ¥500 per person minimum spend) plus its confirmation call, and a Beijing booking plus a follow-up call that pre-ordered a 28-day baby Peking duck and fixed a wrong WeChat ID.
- A two minute call burns roughly 700 to 850 ElevenLabs credits. If the restaurant's line is busy (the network answers SIP 486), the system retries automatically, 20 minutes apart.
01The problem
This started with a trip to China and a list of restaurants I really wanted to eat at. My Mandarin was never going to book them. I am learning the language, and I can get through the basics, but the restaurants I wanted, in Shanghai and Beijing, were never going to be booked with the basics.
Restaurants at this level in China do not take bookings any other way than by phone. There is no online reservation form, no app that covers them, no email address that gets answered. Their listing pages just show a phone number. The reservation book lives with whoever answers that landline, and if you do not call, you do not have a table.
And the call is only the start of what has to happen by phone. The minimum spend, the deposit, the set menus, the pre-orders: all of it gets negotiated on that call, or it does not happen. One dish on this trip, a 28-day baby Peking duck, is pre-order only and served at exactly one branch; the only way to get one is to phone ahead and ask. The menus and the deposit money get coordinated over WeChat afterwards, but only once the call has happened. All of it runs in Mandarin, during the restaurant's service hours, which from California means the middle of the night, on lines that are busy half the time. A negotiation like this, with a name spelled out letter by letter and deposit terms confirmed out loud, needs real Chinese.
So I decided to have an AI make the call. That plan ran into a wall almost immediately. My US voice provider, Twilio, handles my calls, texts, and one-time codes, and it is rock solid, but it does not do outbound voice calls to mainland China. Not "it's expensive." Not "it's in beta." It just doesn't. I needed a carrier that could actually put a call through to China, which meant Telnyx, plus an identity check before they would unlock +86.
So I built a second lane, China-only, with an AI doing the talking. Here is exactly how a call travels.
02Follow a call, hop by hop
Every booking is five hops. Swipe or tap through and watch a call travel from a prompt to a landline in Shanghai.
03Two lanes
Twilio didn't get fired. It just doesn't go to China. So now there are two lanes, each doing what it's good at:
Twilio
The home lane · US + Canada- Domestic voice calls
- SMS and one-time codes
- Build and alert notifications
- Cannot call mainland China, at any price
Telnyx
The China lane · +86 unlocked- Outbound voice to mainland China
- SIP trunk friendly, plays nice with ElevenLabs
- Needed ID verification (KYC) to unlock the +86 country
- $5 credit to start, $1 number ($1/month)
04Placing a call
One API call starts everything. You hand ElevenLabs three things: which agent talks, which phone identity it calls from (the SIP trunk), and the destination number. ElevenLabs opens the trunk to Telnyx, Telnyx dials out, and the agent starts talking when a human picks up.
const res = await fetch(
"https://api.elevenlabs.io/v1/convai/sip-trunk/outbound-call",
{
method: "POST",
headers: {
// placeholder: use a real key from your ElevenLabs dashboard
"xi-api-key": "ELEVENLABS_API_KEY",
"Content-Type": "application/json"
},
body: JSON.stringify({
agent_id: "agent_xxxx", // the Mandarin booking agent
agent_phone_number_id: "phnum_xxxx", // the SIP trunk identity
to_number: "+8621xxxxxxxx" // the restaurant, E.164 format
})
}
);
const call = await res.json();
// poll GET /v1/convai/conversations/{conversation_id}
// until the call completes, then read the transcript
If the line is busy, the network answers with SIP 486 and the API reports a failure. The fix is boring and effective: schedule retries 20 minutes apart and try again. One Beijing restaurant's line came back busy twice in a row, so the retry job just waits and redials.
05The prompt is the product
The voice is ElevenLabs. The manners are a prompt. The agent opens with one neutral line: “您好,请问是…餐厅吗?我想订个位子。” (Hello, is this … restaurant? I'd like to book a table.) That's the whole introduction. It never claims to be the guest. It never says the word AI. If the restaurant asks who is calling, it says it's the guest's assistant, and only then. It gives the guest's name only when asked for the booking name.
Honest footnote: the first version of the prompt had the agent introduce itself as "an AI assistant." You can hear it in the first transcript below, because that is what actually happened. It was rewritten to the neutral version right after that call. The lesson stuck: the prompt is the product. Nobody on the other end of a restaurant line needs a vocabulary lesson about artificial intelligence. They need a table for four.
06The calls
All four calls below are real, placed through the pipeline above and transcribed word for word. Each line shows the original Chinese first, then the English. The first two calls are one Shanghai dinner: the booking, then its confirmation. The second two are a Beijing three-star: the booking, then a follow-up call to pre-order the one dish that cannot be ordered on the night. Redactions: [guest name], [phone number], [restaurant], and [WeChat ID] stand in for the real values, and on the Beijing calls the dates are redacted too. Everything else is exactly what was said. The actual audio recordings are attached inside each card, PII redacted.
What happened: the agent asked for 7:30 PM (full), then 8:00 PM (full). The restaurant said tables free up after 9 PM, so the agent took 9:30 PM for 4. The restaurant stated a ¥500 per person minimum spend, took the phone number, and confirmed with “确认了” (confirmed). No deposit.
Listen to the actual call, PII meowed over:
One agent turn was truncated in the call log and is shown as it appears. This call used the original prompt, which is why the agent introduces itself as an AI assistant. See section 05.
What happened: the agent called back to verify the booking is in the restaurant's system, confirmed the name and phone number on file are correct, and asked if the restaurant needs anything else. Answer: no deposit needed (“不用,不用付定金”).
Listen to the actual call, PII meowed over:
This call used the rewritten neutral prompt: no AI mention, no self-introduction, just the booking.
What happened: a second restaurant, this time a three-star in Beijing, and the hardest table of the trip. The agent booked the main hall at 6:30 PM for 4 adults. The restaurant echoed every detail back and confirmed. They asked for the guest's WeChat to coordinate the deposit and menus ahead of time; the agent deferred, and the guest messaged the restaurant himself afterward.
Listen to the actual call, PII silenced:
Dates are redacted on the Beijing calls. This agent passed on sharing the guest's WeChat, which is why the guest messaged the restaurant himself that night, and why the next call had a WeChat record to check.
What happened: the follow-up call, and the fiddliest one yet. The agent reconfirmed the Beijing table, pre-ordered the 28-day baby Peking duck (only this branch serves it, and only by pre-order), and asked the restaurant to read back the WeChat ID they had on file. It was wrong. The agent spelled out the correct ID letter by letter and had them read it back right. Then it collected the set menu tiers (¥1,280, ¥1,980, and ¥2,580 per person; the dish lists come from the butler over WeChat) and the deposit terms: ¥1,000 for the hall, due 24 hours ahead, fully refundable with 24 hours notice, and no separate deposit for the duck. The agent paid nothing. Money is always the guest's decision.
Listen to the actual call, PII silenced:
A few agent turns were cut off mid-sentence in the call log and are shown as they appear; delivery tags in the log were removed. The agent collected the deposit terms and paid nothing. Money is always the guest's call.
07What it costs
The full bill for a China-capable calling lane:
Per call
ElevenLabs- Roughly 700 to 850 credits for a two minute call
- The longest call so far, the four minute duck follow-up, ran 1,727 credits
- That covers the voice, the language model, and the phone time
One time setup
Telnyx- $5 of account credit to fund the account
- $1 for the US number, then $1/month
- ID verification (KYC): free, just paperwork
Total damage so far: about $7 in actual money. That is the Telnyx credit and the number. ElevenLabs has cost $0, because every call in this post ran on the free plan's monthly credits.
And what would 10,000 calls look like? Scale the four calls above up and the numbers stay almost silly. Mine averaged about 2.5 minutes and about 1,000 credits each, roughly 420 credits a minute. So 10,000 calls is about 25,000 minutes on the phone, around 420 hours of Mandarin negotiation, and about 10 million credits.
- ElevenLabs: 10 million credits at the paid tier rate of about $165 per million (Pro is $99 for 600,000 credits) comes to roughly $1,650
- Telnyx: $0.002 a minute in API fees plus a small per-minute termination rate for China; at 25,000 minutes it is the smaller half of the bill
- All in: roughly $2,000 for 10,000 calls, about 20 cents a call
On the free plan's 10,000 credits a month, the same 10,000 calls would take about 83 years. The human version is not much faster: 420 hours of talking is three months of full-time phone work, before the busy signals, the retries spaced 20 minutes apart, and the fact that Beijing dinner service runs at 3 AM California time. A bilingual assistant at $25 an hour runs past $10,000 and still cannot be awake for all of it. The pipeline does not care what time it is.
The alternative was me calling in my beginner Mandarin, which would have cost nothing and accomplished less. For about seven dollars plus AI credits, I now have a Mandarin-speaking assistant that books tables across the Pacific while I sleep. That is a trade I will make every time.
08Keep exploring
09Built with
- ElevenLabs Conversational AI, the voice agent platform: speech, language model, and telephony in one place.
- Telnyx Voice, the SIP carrier that handles outbound voice to mainland China after KYC verification.
- Twilio Voice, still the US/Canada lane for domestic calls, SMS, and one-time codes.
- All four call transcripts are real calls placed through this pipeline and transcribed from the ElevenLabs call logs. Guest name, phone number, restaurant name, and WeChat ID are redacted, and on the Beijing calls the dates are redacted too. Everything else is published as it happened.