big-controller-60015
02/17/2025, 12:36 PMgray-monkey-83525
02/17/2025, 12:36 PMsip.twilio.callSid
attribute from the SIP participant's attributes. This attribute is available once the call is connected and the participant is active. You can retrieve it using the participant's attributes in your code, as shown in the example below:
participant = await ctx.wait_for_participant()
twilio_call_sid = participant.attributes.get("sip.twilio.callSid")
However, note that the sip.twilio.callSid
might not be immediately available as it takes time for the call to be fully established. You may need to listen for participant attribute changes to get it when it becomes available.
Would you like more details on handling participant attribute changes or any other aspect?
Sources:
- SIP participant attributes
- Slack discussion on Twilio Call SID 👍 0 button 👎 0 button 💡 Hint: Mention @runllm in the thread for followups.big-controller-60015
02/17/2025, 12:39 PMgray-monkey-83525
02/17/2025, 12:39 PMsip.twilio.callSid
attribute. Here's a basic example of how you can set up an event listener to detect when this attribute becomes available:
@ctx.room.on("participant_attributes_changed")
def on_attributes_changed(changed_attributes, participant):
if "sip.twilio.callSid" in changed_attributes:
twilio_call_sid = changed_attributes["sip.twilio.callSid"]
print(f"Twilio Call SID: {twilio_call_sid}")
This code listens for the participant_attributes_changed
event and checks if the sip.twilio.callSid
attribute is present in the changed attributes. When it is, you can access the Twilio Call SID.
Would you like more detailed guidance on setting up this event listener or any other related topic?
Sources:
- SIP participant attributes
- Slack discussion on participant attributes 👍 0 button 👎 0 button 💡 Hint: Mention @runllm in the thread for followups.