question

Daniel Moore avatar image
Daniel Moore asked Phong Vu answered

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)

presence
1 |1000

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

1 Answer

·
Phong Vu avatar image
Phong Vu answered

How about print (a['from'])

1 |1000

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.