How to connect your Yeastar IP PBX hardware appliance or cloud to OpenAI Realtime Agents.

Modernize your Yeastar IP PBX phone system. Connect it to OpenAI's real-time agents and turn it into a AI receptionist.

Hello, this is a tutorial to connect your Yeastar cloud PBX or hardware appliance using SIP Trunk to an Asterisk cloud instance that is previously connected to OpenAI Realtime Agents, this way, you will be able to receive calls on your PBX as usual and transfer them to your OpenAI Realtime Agent in the cloud without making many changes or installing anything on your PBX.


After setting up the Azure cloud instance with Asterisk and connecting it to OpenAI Realtime Agents, I tested a Yeastar PBX cloud instance and in less than 10 minutes it was up and running as expected, so today I will show you how to configure your Yeastar PBX Cloud and also hardware appliance to connect to OpenAI Realtime Agents.


Previous Steps:

- Install and configure your Asterisk cloud instance, them connect it to OpenAI Realtime Agents, you need an OpenAI API Key, here:

https://infinitocloud.com/blog/asterisk-to-openai-realtime-2/tutorial-how-to-connect-asterisk-with-openai-realtime-1

- Create a new Sip Trunk account for your Yeastar device on your Asterik cloud instance.

Add a new pjsip trunk 12345 to the end of:

sudo nano /etc/asterisk/pjsip.conf

[12345]
type=endpoint
transport=transport-udp
context=default
disallow=all
allow=ulaw
direct_media=no
media_use_received_transport=yes
rtp_symmetric=yes
force_rport=yes
rewrite_contact=yes
dtmf_mode=auto
auth=12345
aors=12345
outbound_auth=12345
keep_alive_interval=30
timers=yes
timers_min_se=90

[12345]
type=auth
auth_type=userpass
password=6724856900142345 ; Change this password
username=12345

[12345]
type=aor
max_contacts=2
maximum_expiration=3600
minimum_expiration=60
default_expiration=120
qualify_frequency=60
qualify_timeout=3.0

and restart Asterisk:

systemctl restart asterisk


Yeastar configuration:

- Access to your Yeastar hardware device or create a Cloud instace from here.

https://www.yeastar.com/cloud-pbx/

- Create a new Trunk, using as Hostname/IP your Asterisk cloud instance public IP.


- Create a Outbound Route with Pattern 9999 to use it with the Sip Trunk created, move it to right.


- Add your Extension Group and Save.

- Change the Order of the Routes, the newly created Route must be at the Top.


- Make a test call from one of your Yeastart extensions to 9999, the OpenAI Agent should answer.



Option 1, update your Yeastar IVR:

- Create a new voice Prompt for IVR, with elevenlabs TTS.


- Upload the Prompt and replace it on your IVR, PBX Settings, Voice Prompt, Upload.


- Update your IVR configuration, pick the new Prompt.


- Configure the adecuate Key press Event, to call the OpenAI Realtime Agent, Save and Apply.


- Make an incoming test call to your IVR, then press 3 and you'll hear your OpenAI agent in real time.


Option 2, redirect al inbound calls to your OpenAI Realtime Agent:

- Modify your current Call Control, Inbound Route, change the Default Destination to External Number 9999.


- Make a inbound test call.


Video Demo:

https://youtu.be/e2PpzsW2r_k


I'll be creating new posts for different PBX brands. If you found this helpful, please share it.


Thanks.



How to connect Asterisk with OpenAI Realtime.
Make and receive calls from Asterisk PBX to OpenAI Agents with low latency.