Hey team- im having issues dispatching my agent to...
# telephony
r
Hey team- im having issues dispatching my agent to a sip initiated self hosted room, and I believe the error is with my dispatch.json- but am unable to determine where the issue is. here is my dispatch rule, the SIP config.yaml, and my trunk creation commands: :*~*$ vim dispatch.json { "dispatchRule": { "name": "testrule", "trunkIds": [ "ST_piGXWEwNzhXR" ], "rule": { "dispatchRuleIndividual": { "roomPrefix": "test-" } }, "roomConfig": { "agents": [{ }] } } } *~*$ lk -dev sip outbound create --name sbc-outbound-number --address ip_address --transport TCP --media-enc DISABLE --numbers phone-number-of-the-sbc *~*$ lk -dev sip participant create --trunk trunk --call +1phone_num --room demo --name "Callee" inits:tmux new -s livekit 'livekit-server --dev --redis-host localhost:6379 --bind 0.0.0.0' sip.yaml: use_external_ip: false # Do NOT auto-detect public IP nat_1_to_1_ip: "my external ip" # Public-to-private NAT mapping for signalling log_level: debug # debug | info | warn | error rtp_port: start: 10000 end: 60805 api_key: devkey api_secret: secret ws_url: ws://localhost:7880 # LiveKit WS URL # -------- Redis for distributed mode -------- redis: address: localhost:6379 # -------- SIP signalling -------- sip_port: 5060 # Port advertised to peers (UDP/TCP) sip_port_listen: 5060 # Actual bind port (optional – same as above) tls: # Optional TLS listener port: 5061 port_listen: 5061 certs: - cert_file:key file key_file: key file sip_hostname: "not important- not using tls" media_use_external_ip: false # Do NOT auto-discover public IP for RTP media_nat_1_to_1_ip: "my external ip" # Public-to-private mapping for RTP my agent :if name == "__main__": agents.cli.run_app(agents.WorkerOptions(entrypoint_fnc=entrypoint,agent_name="dev")) .env using :LIVEKIT_API_KEY=devkey LIVEKIT_API_SECRET=secret LIVEKIT_URL=ws://localhost:7880 What I've tried: 1. I looked through the issues on github and fixed somewhat trivial formatting issues 2. ive confirmed that both sides are agreeing to the sip invite, and all forwarding looks clean, meaning the call is going through 3. ive also made certain that audio packets are being streamed to the correct ports I've put some logs in the replies to this message- if you are able to help me- that would be great! thanks!
2025-08-28T165644.369Z INFO sip sip/client.go:225 Creating SIP participant {"nodeID": "NE_fEfh8YW9jUAX", "sipTrunk": "ST_piGXWEwNzhXR", "callID": "SCL_8Jqc6r765XRn", "room": "demo", "participant": "sip_+1732xxxxxxx", "participantName": "PSTN Callee", "fromHost": "", "fromUser": "+904xxxxx", "toHost": "91.xxx.xx.xxx", "toUser": "+1732xxxxxxx"} 2025-08-28T165644.389Z INFO sip v2@v2.9.2-0.20250606164215-22b67ed30bd9/localparticipant.go:148 published track {"nodeID": "NE_fEfh8YW9jUAX", "sipTrunk": "ST_piGXWEwNzhXR", "callID": "SCL_8Jqc6r765XRn", "room": "demo", "participant": "sip_+1732xxxxxxx", "participantName": "PSTN Callee", "fromHost": "", "fromUser": "+904xxxxx", "toHost": "91.2.xx.xx.xx", "toUser": "+1732xxxxxxx", "jitterBuf": false, "name": "sip_+1732xxxxxxx", "source": "MICROPHONE", "trackID": "TR_AMQfziNiduv2uz"} 2025-08-28T165650.212Z INFO sip sip/media_port.go:385 using codecs {"nodeID": "NE_fEfh8YW9jUAX", "sipTrunk": "ST_piGXWEwNzhXR", "callID": "SCL_8Jqc6r765XRn", "room": "demo", "participant": "sip_+1732xxxxxxx", "participantName": "PSTN Callee", "fromHost": "", "fromUser": "+904xxxxx", "toHost": "91..xx.xx.xx", "toUser": "+1732xxxxxxx", "jitterBuf": false, "audio-codec": "PCMU/8000", "audio-rtp": 0, "dtmf-rtp": 101, "srtp": ""} 2025-08-28T165650.212Z INFO sip sip/media_port.go:88 setting media destination {"nodeID": "NE_fEfh8YW9jUAX", "sipTrunk": "ST_piGXWEwNzhXR", "callID": "SCL_8Jqc6r765XRn", "room": "demo", "participant": "sip_+1732xxxxxxx", "participantName": "PSTN Callee", "fromHost": "", "fromUser": "+904xxxxx", "toHost": "91.xxx.xx.xxx", "toUser": "+1732xxxxxxx", "jitterBuf": false, "addr": "91.xxx.xx.xxx:60802"} 2025-08-28T165650.212Z INFO sip sip/media_port.go:223 media timeout enabled {"nodeID": "NE_fEfh8YW9jUAX", "sipTrunk": "ST_piGXWEwNzhXR", "callID": "SCL_8Jqc6r765XRn", "room": "demo", "participant": "sip_+1732xxxxxxx", "participantName": "PSTN Callee", "fromHost": "", "fromUser": "+904xxxxx", "toHost": "91.xxx.xx.xxx", "toUser": "+1732xxxxxxx", "jitterBuf": false, "packets": 0} 2025-08-28T165650.212Z INFO sip sip/media_port.go:99 setting media source {"nodeID": "NE_fEfh8YW9jUAX", "sipTrunk": "ST_piGXWEwNzhXR", "callID": "SCL_8Jqc6r765XRn", "room": "demo", "participant": "sip_+1732xxxxxxx", "participantName": "PSTN Callee", "fromHost": "", "fromUser": "+904xxxxx", "toHost": "91.xxx.xx.xxx", "toUser": "+1732xxxxxxx", "jitterBuf": false, "addr": "[:ffff91.xxx.xx.xxx]:11364"} 2025-08-28T165650.212Z INFO sip sip/media_port.go:431 accepting RTP stream {"nodeID": "NE_fEfh8YW9jUAX", "sipTrunk": "ST_piGXWEwNzhXR", "callID": "SCL_8Jqc6r765XRn", "room": "demo", "participant": "sip_+1732xxxxxxx", "participantName": "PSTN Callee", "fromHost": "", "fromUser": "+904xxxxx", "toHost": "91.xxx.xx.xxx", "toUser": "+1732xxxxxxx", "jitterBuf": false, "ssrc": 3812829011} 2025-08-28T165650.212Z INFO sip sip/outbound.go:349 Outbound SIP call established {"nodeID": "NE_fEfh8YW9jUAX", "sipTrunk": "ST_piGXWEwNzhXR", "callID": "SCL_8Jqc6r765XRn", "room": "demo", "participant": "sip_+1732xxxxxxx", "participantName": "PSTN Callee", "fromHost": "", "fromUser": "+904xxxxx", "toHost": "91.xxx.xx.xxx", "toUser": "+1732xxxxxxx", "jitterBuf": false} 2025-08-28T165657.181Z INFO sip sip/client.go:296 BYE {"nodeID": "NE_fEfh8YW9jUAX", "sipTrunk": "ST_piGXWEwNzhXR", "callID": "SCL_8Jqc6r765XRn", "room": "demo", "participant": "sip_+1732xxxxxxx", "participantName": "PSTN Callee", "fromHost": "", "fromUser": "+904xxxxx", "toHost": "91.xxx.xx.xxx", "toUser": "+1732xxxxxxx", "jitterBuf": false} 2025-08-28T165657.182Z INFO sip sip/outbound.go:277 Closing outbound call {"nodeID": "NE_fEfh8YW9jUAX", "sipTrunk": "ST_piGXWEwNzhXR", "callID": "SCL_8Jqc6r765XRn", "room": "demo", "participant": "sip_+1732xxxxxxx", "participantName": "PSTN Callee", "fromHost": "", "fromUser": "+904xxxxx", "toHost": "91.xxx.xx.xxx", "toUser": "+1732xxxxxxx", "jitterBuf": false, "reason": "bye"} 2025-08-28T165657.184Z INFO sip sip/media_port.go:101 changing media source {"nodeID": "NE_fEfh8YW9jUAX", "sipTrunk": "ST_piGXWEwNzhXR", "callID": "SCL_8Jqc6r765XRn", "room": "demo", "participant": "sip_+1732xxxxxxx", "participantName": "PSTN Callee", "fromHost": "", "fromUser": "+904xxxxx", "toHost": "91.xxx.xx.xxx", "toUser": "+1732xxxxxxx", "jitterBuf": false, "addr": "invalid AddrPort"} 2025-08-28T165657.184Z INFO sip sip/outbound.go:294 call statistics {"nodeID": "NE_fEfh8YW9jUAX", "sipTrunk": "ST_piGXWEwNzhXR", "callID": "SCL_8Jqc6r765XRn", "room": "demo", "participant": "sip_+1732xxxxxxx", "participantName": "PSTN Callee", "fromHost": "", "fromUser": "+904xxxxx", "toHost": "91.xxx.xx.xxx", "toUser": "+1732xxxxxxx", "jitterBuf": false, "stats": {"port":{"streams":1,"packets":359,"packets_ignored":0,"packets_input":359,"mux_packets":359,"mux_bytes":57440,"audio_packets":359,"audio_bytes":57440,"dtmf_packets":0,"dtmf_bytes":0},"room":{"input_packets":0,"input_bytes":0,"mixer_samples":0,"mixer_frames":0,"output_samples":614400,"output_frames":640},"mixer":{"tracks":0,"tracks_total":0,"restarts":0,"mixes":640,"mixes_timed":326,"mixes_jump":314,"mixes_zero":157,"input_samples":0,"input_frames":0,"mixed_samples":0,"mixed_frames":0,"output_samples":614400,"output_frames":640}}} 2025-08-28T165657.184Z INFO sip service/service.go:258 SIP call ended {"nodeID": "NE_fEfh8YW9jUAX", "callID": "SCL_8Jqc6r765XRn", "reason": "bye"} [sip] 0:sip*
that was the sip server
livekit logs:
livekitlogs.txt
ah- i was using a dispatch rule but need ed to use agent dispatch. that works now- but still no tallking from the agent