Hello LiveKit team, we are integrating with a dial...
# telephony
p
Hello LiveKit team, we are integrating with a dialer which is sending us SIP invites on our inbound trunk that we have created. But the request is not reaching livekit or livekit is not responding with a 200 OK back. The SIP flow is - They send a SIP INVITE to
sip:+18998009999@4sen7zyruwn.sip.livekit.cloud:5060
from their SIP Gateway - but the request hangs at SIP 100 and livekit does not send back a SIP OK. I have attached the pcap file below too for reference. I don't see any calls being shown in the LiveKit dashboard. Can anyone please help what the issue is here?
@refined-appointment-81829 - Apologies for tagging you agian, but would appreciate your help
r
Do you have a dispatch rule associated with that trunk?
p
Yes - dispatch rule id -
SDR_WK8tFepghbXi
Project Id -
4sen7zyruwn
r
Can I see your Agent code where you setup the worker options? (usually bottom of file)
p
Copy code
if __name__ == "__main__":
    agents.cli.run_app(
        agents.WorkerOptions(
            entrypoint_fnc=entrypoint, agent_name=Config.AGENT_NAME, port=Config.PORT
        )
    )
Config.AGENT_NAME resolves to the agent I have configured in the dispatch rule
But the call is not reaching to the worker, I checked that. The call is also not visible on the LiveKit dashboard too.
r
So your trunk is setup up with a
+
but the pcap you sent the to does not have the
+
for the e.164 number
p
I see the
+
in the Request URI. If you mean - > E.164 number - 18998009999 Even twilio sends this way. The SS below is of the above PCAP file
This is the PCAP SS from twilio that shows the E.164 number without
+
. The call gets connected in this case.
r
oh, I am juggling a few different pcaps. I must have looked at the wrong one. Let me check.
👍 1
🙌 1
Does the agent answer or does it only answer sometimes?
p
The agent always answers when I send the calls from twilio and other dialers. But from the new dialer that I am integrating it with. The calls don't seem to be reaching LiveKit or LiveKit is not invoking the agent. I don't see any calls from the dialer to this
+18998009999
inbound trunk number. LiveKit is not sending 200 OK upon receiving the SIP Invite.
r
Thanks, I understand now.
I think the issue is
media timeout
for that dialer. Often that is related to the IP:PORT it offers is not publicly routable.
p
I think the issue is
media timeout
for that dialer
The
media timeout
calls should be visible in the LiveKit dashboard right? But I don't see them too which makes me feel this is a diff issue 😓
r
still digging. I see at least one where it is that.
🙏 1
Ok, in that PCAP look at packet 1 the INVITE. The request line looks right. But look at the
to:
that is not right
That needs to match
But you screen shot above show a different to from what is in the capture.
p
yeah - it is their SIP gateway. There are two diff SS. The first SS is the packet capture file I sent you. The second SS is from a call from twilio
Are you able to check the logs on livekit side for our project to see if this SIP invite landed on your side? If it did not then the
To:
address being diff is the culprit.
r
Looking at
Test calls Aug 12.pcap
Now that I know what I am looking for let me see if I can find more details on our side.
🙌 1
So that is why it does not show up on your dashboard. It is to a domain that is not yours. It should be
id.sip.livekit....
For that we go to
processing invite
then just discard it because of the invalid domain.
p
Ack - so if I understand this correctly. The call is reaching livekit but the livekit discards the request as the
To
address is invalid in the SIP Invite request. Is my understanding correct?
r
yes
If you change the to it looks like it should work.
p
Thanks - let me ask them why there is a discrepancy. Thanks so much @refined-appointment-81829 🙌 It would be really helpful if we can surface these logs on the dashboard or able to check the pcap files on our side. Appreciate your help, thanks again
👍 1
r
I was just thinking that maybe we should return a better SIP error in this case like 404 or something else. I will bring it up with the SIP team
✅ 1
p
Yes - 404 should be the expected response.
yes text 1
Hello @refined-appointment-81829 - the
To
address was the issue. They fixed it and livekit is now sending 200 OK to us. Thank you 🙌 Have asked a couple more questions here - https://livekit-users.slack.com/archives/C07FRP66XGE/p1755064443049959 Would appreciate if you can help 🙏