Question

I need Help Getting "From" using python

  • 19 June 2020
  • 1 reply
  • 249 views

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

Userlevel 1

How about print (a['from'])

Reply