Skip to content

Commit

Permalink
get directory numbers of phones for phone export
Browse files Browse the repository at this point in the history
  • Loading branch information
Haas committed Apr 25, 2020
1 parent d846e53 commit eb7078f
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions cucm.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import time
import json


def export_users(ucm_axl):
Expand Down Expand Up @@ -145,6 +146,17 @@ def export_phones(ucm_axl):
"alwaysUsePrimeLine": phone.alwaysUsePrimeLine,
"alwaysUsePrimeLineForVoiceMessage": phone.alwaysUsePrimeLineForVoiceMessage,
}
line_details = ucm_axl.get_phone(name=phone.name)
# print(line_details.lines.line)
try:
for line in line_details.lines.line:
# print(line)
phone_details[f"line_{line.index}_dirn"] = line.dirn.pattern
phone_details[f"line_{line.index}_routePartitionName"] = line.dirn.routePartitionName._value_1
phone_details[f"line_{line.index}_display"] = line.display
phone_details[f"line_{line.index}_e164Mask"] = line.e164Mask
except Exception as e:
print(e)
all_phones.append(phone_details)

print(
Expand Down

0 comments on commit eb7078f

Please sign in to comment.