[:python:] Hey folks. I'm running an inbound agent...
# telephony
p
[python] Hey folks. I'm running an inbound agent (through
console
) that receives phone calls and I realised the participant (caller) is an instance of
NonCallableMagicMock
- which is ok. However, there are a few properties I need to access due to my use case which are not initialised with fake values. What's the best way to ensure these get initialised with fake values, so I don't have to patch them each time a participant connects? See 🧵
These are the properties I have to initialise on the
NonCallableMagicMock
instance: •
sip.twilio.callSid
•
sip.hostname
•
sip.callStatus
•
sip.phoneNumber
•
sip.trunkPhoneNumber
•
participant.identity
r
What do you mean by
inbound agent (through console)
?
p
Running it with
console
command, instead of
start
or
dev
, for example.
r
ummm.... You can't receive a SIP call when running with
console
. It does not actually connect to LiveKit when using console.
So I must be missing something with your request.
p
I don't want to receive a SIP call, but I'd like the mock to contain attributes from a SIP call (mocked values are fine, as long as they are valid), if that makes sense.
🤔 1
This is not a big deal, I can still patch the mocked participant to include sip attributes. It would just be nice to be able to run the worker in a SIP context without an actual call (the attributes should be enough).
I have an agent that only works if there are SIP attributes set on the participant, but I don't want to make a phone call during development.
👍🏼 1
r
p
easy!