Repository navigation
Conversation
biglittlebigben
left a comment
There was a problem hiding this comment.
LGTM. Couple of questions inline.
| } | ||
|
|
||
| func (c *sipInbound) StartRinging() { | ||
| c.attachTag() |
There was a problem hiding this comment.
Will StartRinging and StopRinging always be called from the same goroutine, since c.ringing is not thread safe?
There was a problem hiding this comment.
Although it's not explicitly mentioned, they should run under the same call mutex. Most signaling is done by a single thread, except the calls to Close, but they would still acquire the same mutex.
Having said that, I'll check it again and will probably add mutex specifically for the signaling part of the connection. We will likely reuse it for our test client later.
There was a problem hiding this comment.
Done, everything is protected now. I should actually move it to a separate package later.
| tag, err := getToTag(inviteResp) | ||
| if err != nil { | ||
| return err | ||
| c.invite, c.inviteOk = req, resp |
There was a problem hiding this comment.
Are c.invite and c.inviteOk always be accessed from the same goroutine as the one Invite is called on?
There was a problem hiding this comment.
Should be roughly the same as in the other comment thread. So it should hold the call mutex while doing so. But will double-check.
|
awesome improvement! For the flow without PIN, I'm wondering if we can move publishing earlier:
If we accepted the SIP call, but the track isn't published yet, it means if the caller speaks immediately, their first words won't be heard by the other side. |
|
@davidzhao We can do that, but I'm a bit worried that there will be no explicit signal when finally accepting the call in that case. In the flow that you propose, as soon as SIP subscribes to at least one track, it will confirm the call via SIP signaling. There will be some delay until we actually receive audio packets. SIP won't emit silence automatically in this case. But maybe it's acceptable? |
ccb7871 to
55e88a4
Compare
|
Hi @dennwc currently participants.attribute.get(sip.callstatus) shows ringing and then after ringing even if the user hasn't picked up the call and shows active in the call status , user hasn't picked up the call and call has been turned off but the logs shows that user has picked up and active status on sip participant. |
|
@MFaiqKhan I assume you mean outbound calls in this case. It could be that the server you are dialing is proxying the call to another server and indicates that the call is dialed even before the actual user picks up. From LiveKit's perspective the call is dialed and receives audio from the remote server. We'll have to add dial tone detection to know if the dial tone is still going in the audio stream. |
|
@dennwc here the logs shows that agent left because the phone after ringing turned off but exactly the ringing stops the agent left and the particpant is autoamtically joined when they even havent picked up the call . and are you saying that twilio (sip provider), is proxying the call to the different server ??? |
|
@faiqkhan-aiconnect could you please file a new issue instead with all these details? Please also specify either the callID or the sequence of events as you observed it. |
|
It would be nice in dispatch rules to have it as strategy to accept immediately or wait first track publication or even have ability to answer the call programmatically . In my case I have to broadcast incoming call to other devices which means I have only one way communication |
Refactor SIP signaling an change the call flow for both inbound and outbound.
For inbound with PIN (almost the same as before):
For inbound without PIN:
For outbound:
Should resolve #102, #136, #114