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)

rest api
1 |3000

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 |3000

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

Developer sandbox tools

Using the RingCentral Phone for Desktop, you can dial or receive test calls, send and receive test SMS or Fax messages in your sandbox environment.

Download RingCentral Phone for Desktop:

Tip: switch to the "sandbox mode" before logging in the app:

  • On MacOS: press "fn + command + f2" keys
  • On Windows: press "Ctrl + F2" keys