Skip to main content
New Participant
Jun 19, 2020 5:30 PM UTC
Question

I need Help Getting "From" using python

I am using python to get call status on on certain extensions. If an extension has an active call I want to return the "from" number; however, Python doesn't like it when I use "from". It works for fromName but not from. It returns a syntax error.

How do I get the "from" object?


for ext in r.json().records:

exten = ext.extension.extensionNumber

for e in extensions:

if(e == exten):

extname = GetExtensions(int(exten))

status = ext.telephonyStatus

if(status != "NoCall"):

for a in ext.activeCalls:

print(a.from)

    1 reply

    PhongVu
    Community Manager
    Community Manager
    Jun 19, 2020 7:24 PM UTC

    How about print (a['from'])