its my pjsip.conf
[global]
type=global
default_realm=CALLANYWHERE
user_agent=openairealtimeapi.callanywhere.co.in
use_callerid_contact=no
debug=no
keep_alive_interval=90
endpoint_identifier_order=username,ip,anonymous,header,auth_username
taskprocessor_overload_trigger=pjsip_only
[system]
type=system
timer_t1=5000
timer_b=32000
compact_headers=no
disable_multi_domain=no
follow_early_media_fork=yes
accept_multiple_sdp_answers=yes
threadpool_initial_size=0
threadpool_auto_increment=5
threadpool_idle_timeout=60
threadpool_max_size=50
[general]
icesupport = yes
[transport-tls]
type=transport
protocol=tls
bind=0.0.0.0:5061
external_media_address=139.84.175.186
external_signaling_address=139.84.175.186
cert_file=/etc/asterisk/keys/asterisk.cert
priv_key_file=/etc/asterisk/keys/asterisk.key
method=tlsv1_2
verify_client=no
require_client_cert=no
allow_reload=yes
async_operations=1
[openai-realtime]
type=endpoint
transport=transport-tls
context=openai-context
aors=openai-realtime
disallow=all
allow=alaw
webrtc=no
media_encryption=no
use_avpf=no
rtcp_mux=no
ice_support=no
bundle=no
direct_media=no
rtp_symmetric=yes
force_rport=yes
rewrite_contact=yes
dtmf_mode=rfc4733
rtp_timeout=600
rtp_timeout_hold=1200
media_address=139.84.175.186
timers=no
trust_id_inbound=yes
trust_id_outbound=yes
send_connected_line=no
aggregate_mwi=no
t38_udptl=no
asymmetric_rtp_codec=yes
[openai-realtime]
type=aor
contact=sip:sip.api.openai.com:5061
remove_existing=yes
maximum_expiration=7200
minimum_expiration=60
qualify_frequency=0
max_contacts=1
; Identify configuration for OpenAI
[openai-realtime]
type=identify
endpoint=openai-realtime
match=sip.api.openai.com
and its my extension.conf
[inbound-test]
exten => _.,1,NoOp(Inbound Call from telephony ${CDR(src)} to ${CDR(dst)})
exten => _.,n,Set(TIMEOUT(absolute)=0) ; Remove absolute timeout
exten => _.,n,Set(TIMEOUT(response)=60) ; Allow time for connection
same => n,Dial(PJSIP/proj_ynVte2cOPDHsxBZ6IUbVRcQ7@openai-realtime,60,rg)
same => n,hangup
exten => h,1,hangup
when i dial i see on asterisk side
[Sep 4 15:15:56] == Using SIP RTP CoS mark 5
[Sep 4 15:15:56] > 0x7f43e8013230 – Strict RTP learning after remote address set to: 122.176.155.244:16152
[Sep 4 15:15:56] – Executing [+911213509215@inbound-test:1] NoOp(“SIP/openairealtime-00000005”, “Inbound Call from telephony +911214287400 to +911213509215”) in new stack
[Sep 4 15:15:56] – Executing [+911213509215@inbound-test:2] Set(“SIP/openairealtime-00000005”, “TIMEOUT(absolute)=0”) in new stack
[Sep 4 15:15:56] – Channel hangup cancelled.
[Sep 4 15:15:56] – Executing [+911213509215@inbound-test:3] Set(“SIP/openairealtime-00000005”, “TIMEOUT(response)=60”) in new stack
[Sep 4 15:15:56] – Response timeout set to 60.000
[Sep 4 15:15:56] – Executing [+911213509215@inbound-test:4] Dial(“SIP/openairealtime-00000005”, “PJSIP/proj_ynVte2cOPDHsxBZ6IUbVRcQ7@openai-realtime,60,rg”) in new stack
[Sep 4 15:15:56] – Called PJSIP/proj_ynVte2cOPDHsxBZ6IUbVRcQ7@openai-realtime
[Sep 4 15:15:56] <— Transmitting SIP request (992 bytes) to TLS:172.65.182.150:5061 —>
[Sep 4 15:15:56] INVITE sip:proj_ynVte2cOPDHsxBZ6IUbVRcQ7@sip.api.openai.com:5061 SIP/2.0
[Sep 4 15:15:56] Via: SIP/2.0/TLS 139.84.175.186:5061;rport;branch=z9hG4bKPj159a4ada-7846-420e-a692-11995f728116;alias
[Sep 4 15:15:56] From: “+911214287400” sip:+911214287400@139.84.175.186;tag=ac2b076a-48d3-4d46-ac92-ceeeb226add9
[Sep 4 15:15:56] To: sip:proj_ynVte2cOPDHsxBZ6IUbVRcQ7@sip.api.openai.com
[Sep 4 15:15:56] Contact: sip:asterisk@139.84.175.186:5061;transport=TLS
[Sep 4 15:15:56] Call-ID: 17e11e57-0915-487d-9599-ed7472ae6942
[Sep 4 15:15:56] CSeq: 2075 INVITE
[Sep 4 15:15:56] Allow: OPTIONS, REGISTER, SUBSCRIBE, NOTIFY, PUBLISH, INVITE, ACK, BYE, CANCEL, UPDATE, PRACK, MESSAGE, INFO, REFER
[Sep 4 15:15:56] Supported: 100rel, replaces, norefersub, histinfo
[Sep 4 15:15:56] Max-Forwards: 70
[Sep 4 15:15:56] User-Agent: openairealtimeapi.callanywhere.co.in
[Sep 4 15:15:56] Content-Type: application/sdp
[Sep 4 15:15:56] Content-Length: 239
[Sep 4 15:15:56]
[Sep 4 15:15:56] v=0
[Sep 4 15:15:56] o=- 166540146 166540146 IN IP4 139.84.175.186
[Sep 4 15:15:56] s=Asterisk
[Sep 4 15:15:56] c=IN IP4 139.84.175.186
[Sep 4 15:15:56] t=0 0
[Sep 4 15:15:56] m=audio 17128 RTP/AVP 8 101
[Sep 4 15:15:56] a=rtpmap:8 PCMA/8000
[Sep 4 15:15:56] a=rtpmap:101 telephone-event/8000
[Sep 4 15:15:56] a=fmtp:101 0-16
[Sep 4 15:15:56] a=ptime:20
[Sep 4 15:15:56] a=maxptime:140
[Sep 4 15:15:56] a=sendrecv
[Sep 4 15:15:56]
[Sep 4 15:15:57] <— Received SIP response (484 bytes) from TLS:172.65.182.150:5061 —>
[Sep 4 15:15:57] SIP/2.0 100 Trying
[Sep 4 15:15:57] Via: SIP/2.0/TLS 139.84.175.186:5061;received=172.69.203.193;rport=53174;branch=z9hG4bKPj159a4ada-7846-420e-a692-11995f728116;alias
[Sep 4 15:15:57] From: “+911214287400” sip:+911214287400@139.84.175.186;tag=ac2b076a-48d3-4d46-ac92-ceeeb226add9
[Sep 4 15:15:57] To: sip:proj_ynVte2cOPDHsxBZ6IUbVRcQ7@sip.api.openai.com;tag=be2462d1-c4b0-4de9-825f-1dcb2559562f
[Sep 4 15:15:57] Call-ID: 17e11e57-0915-487d-9599-ed7472ae6942
[Sep 4 15:15:57] CSeq: 2075 INVITE
[Sep 4 15:15:57] Content-Length: 0
[Sep 4 15:15:57] Contact: sip:OAI@sip.api.openai.com:5061
[Sep 4 15:15:57]
[Sep 4 15:15:57]
[Sep 4 15:16:00] <— Received SIP response (688 bytes) from TLS:172.65.182.150:5061 —>
[Sep 4 15:16:00] SIP/2.0 200 OK
[Sep 4 15:16:00] Via: SIP/2.0/TLS 139.84.175.186:5061;branch=z9hG4bKPj159a4ada-7846-420e-a692-11995f728116;received=172.69.203.193;alias;rport=53174
[Sep 4 15:16:00] From: “+911214287400” sip:+911214287400@139.84.175.186;tag=ac2b076a-48d3-4d46-ac92-ceeeb226add9
[Sep 4 15:16:00] To: sip:proj_ynVte2cOPDHsxBZ6IUbVRcQ7@sip.api.openai.com;tag=be2462d1-c4b0-4de9-825f-1dcb2559562f
[Sep 4 15:16:00] Call-ID: 17e11e57-0915-487d-9599-ed7472ae6942
[Sep 4 15:16:00] CSeq: 2075 INVITE
[Sep 4 15:16:00] Content-Length: 206
[Sep 4 15:16:00] Contact: sip:OAI@sip.api.openai.com:5061
[Sep 4 15:16:00]
[Sep 4 15:16:00] v=0
[Sep 4 15:16:00] o=- 166540146 166540148 IN IP4 52.247.123.134
[Sep 4 15:16:00] s=OAI
[Sep 4 15:16:00] c=IN IP4 52.247.123.134
[Sep 4 15:16:00] t=0 0
[Sep 4 15:16:00] m=audio 42920 RTP/AVP 8 101
[Sep 4 15:16:00] a=rtpmap:101 telephone-event/8000
[Sep 4 15:16:00] a=fmtp:101 0-16
[Sep 4 15:16:00] a=ptime:20
[Sep 4 15:16:00] a=rtpmap:8 PCMA/8000
[Sep 4 15:16:00]
[Sep 4 15:16:00] <— Transmitting SIP request (511 bytes) to TLS:172.65.182.150:5061 —>
[Sep 4 15:16:00] ACK sip:OAI@172.65.182.150:5061;transport=TLS SIP/2.0
[Sep 4 15:16:00] Via: SIP/2.0/TLS 139.84.175.186:5061;rport;branch=z9hG4bKPj4063bce8-3598-412e-932b-d9450e52aaa0;alias
[Sep 4 15:16:00] From: “+911214287400” sip:+911214287400@139.84.175.186;tag=ac2b076a-48d3-4d46-ac92-ceeeb226add9
[Sep 4 15:16:00] To: sip:proj_ynVte2cOPDHsxBZ6IUbVRcQ7@sip.api.openai.com;tag=be2462d1-c4b0-4de9-825f-1dcb2559562f
[Sep 4 15:16:00] Call-ID: 17e11e57-0915-487d-9599-ed7472ae6942
[Sep 4 15:16:00] CSeq: 2075 ACK
[Sep 4 15:16:00] Max-Forwards: 70
[Sep 4 15:16:00] User-Agent: openairealtimeapi.callanywhere.co.in
[Sep 4 15:16:00] Content-Length: 0
[Sep 4 15:16:00]
[Sep 4 15:16:00]
[Sep 4 15:16:00] <— Transmitting SIP request (571 bytes) to TLS:172.65.182.150:5061 —>
[Sep 4 15:16:00] BYE sip:OAI@172.65.182.150:5061;transport=TLS SIP/2.0
[Sep 4 15:16:00] Via: SIP/2.0/TLS 139.84.175.186:5061;rport;branch=z9hG4bKPj2ebbf164-1f69-41ac-93c4-128d3440278f;alias
[Sep 4 15:16:00] From: “+911214287400” sip:+911214287400@139.84.175.186;tag=ac2b076a-48d3-4d46-ac92-ceeeb226add9
[Sep 4 15:16:00] To: sip:proj_ynVte2cOPDHsxBZ6IUbVRcQ7@sip.api.openai.com;tag=be2462d1-c4b0-4de9-825f-1dcb2559562f
[Sep 4 15:16:00] Call-ID: 17e11e57-0915-487d-9599-ed7472ae6942
[Sep 4 15:16:00] CSeq: 2076 BYE
[Sep 4 15:16:00] Reason: SIP ;cause=406 ;text=“SDP offer/answer incomplete”
[Sep 4 15:16:00] Max-Forwards: 70
[Sep 4 15:16:00] User-Agent: openairealtimeapi.callanywhere.co.in
[Sep 4 15:16:00] Content-Length: 0
[Sep 4 15:16:00]
[Sep 4 15:16:00]
[Sep 4 15:16:00] – PJSIP/openai-realtime-00000005 answered SIP/openairealtime-00000005
[Sep 4 15:16:00] – Channel PJSIP/openai-realtime-00000005 joined ‘simple_bridge’ basic-bridge <607ee427-3cc6-49d6-a0e8-0b7a7c3537b6>
[Sep 4 15:16:00] – Channel SIP/openairealtime-00000005 joined ‘simple_bridge’ basic-bridge <607ee427-3cc6-49d6-a0e8-0b7a7c3537b6>
[Sep 4 15:16:00] > 0x7f43e8013230 – Strict RTP switching to RTP target address 122.176.155.244:16152 as source
[Sep 4 15:16:00] <— Received SIP response (433 bytes) from TLS:172.65.182.150:5061 —>
[Sep 4 15:16:00] SIP/2.0 200 OK
[Sep 4 15:16:00] Via: SIP/2.0/TLS 139.84.175.186:5061;alias;rport=53174;branch=z9hG4bKPj2ebbf164-1f69-41ac-93c4-128d3440278f;received=172.69.203.193
[Sep 4 15:16:00] From: “+911214287400” sip:+911214287400@139.84.175.186;tag=ac2b076a-48d3-4d46-ac92-ceeeb226add9
[Sep 4 15:16:00] To: sip:proj_ynVte2cOPDHsxBZ6IUbVRcQ7@sip.api.openai.com;tag=be2462d1-c4b0-4de9-825f-1dcb2559562f
[Sep 4 15:16:00] Call-ID: 17e11e57-0915-487d-9599-ed7472ae6942
[Sep 4 15:16:00] CSeq: 2076 BYE
[Sep 4 15:16:00] Content-Length: 0
[Sep 4 15:16:00]
[Sep 4 15:16:00]
[Sep 4 15:16:00] – Channel PJSIP/openai-realtime-00000005 left ‘simple_bridge’ basic-bridge <607ee427-3cc6-49d6-a0e8-0b7a7c3537b6>
[Sep 4 15:16:00] – Channel SIP/openairealtime-00000005 left ‘simple_bridge’ basic-bridge <607ee427-3cc6-49d6-a0e8-0b7a7c3537b6>
[Sep 4 15:16:00] – Executing [+911213509215@inbound-test:5] Hangup(“SIP/openairealtime-00000005”, “”) in new stack
[Sep 4 15:16:00] == Spawn extension (inbound-test, +911213509215, 5) exited non-zero on ‘SIP/openairealtime-00000005’
[Sep 4 15:16:00] – Executing [h@inbound-test:1] Hangup(“SIP/openairealtime-00000005”, “”) in new stack
[Sep 4 15:16:00] == Spawn extension (inbound-test, h, 1) exited non-zero on ‘SIP/openairealtime-00000005’
openairealtimeapi*CLI>
but same openai reatime api is working with twilio just be point to twilio but in twilio
SIP URI is sip:proj_ynVte2cOPDHsxBZ6IUbVRcQ7@sip.api.openai.com;transport=tls
so now here i am stuck, here its not working due to TO URI or anything else