简体   繁体   English

简单的 python 脚本配置多个号码到 SIP 中继

[英]Simple python script to configure multiple numbers to a SIP Trunk

I have a huge port-in request at Twilio and need to assign 200+ numbers to our SIP trunk.我在 Twilio 有一个巨大的端口输入请求,需要为我们的 SIP 中继分配 200 多个号码。 The following (redacted) simple python script works for one number.以下(已编辑)简单的 python 脚本适用于一个号码。 Is there a simple way I can pipe in a.txt file with the 200 +1XXXXXXXXXX numbers and update the SIP trunk for each?有没有一种简单的方法可以在 a.txt 文件中使用 200 +1XXXXXXXXXX 号码 pipe 并为每个号码更新 SIP 中继?

account_sid = 'ACxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
auth_token = 'your_auth_token'
client = Client(account_sid, auth_token)
  
incoming_phone_number = client \
      .incoming_phone_numbers('PNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
      .update(
          trunk_sid='TKXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX',
    )

print(incoming_phone_number.friendly_name)

If you assign the numbers under the Elastic SIP Trunk, you can assign many of them at once.如果您在弹性 SIP 中继下分配号码,您可以一次分配多个号码。 See image below.见下图。

在此处输入图像描述

Enabling E911 on Multiple Numbers对多个号码启用 E911

在此处输入图像描述

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM