Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8463655
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T14:30:59+00:00 2026-06-10T14:30:59+00:00

So this is a script that I am coding for my buddies companies customer

  • 0

So this is a script that I am coding for my buddies companies customer support. Basically, what it does is call using the IP phones that are in the script, it works, but with problems. Here is the code:

import urllib, urllib2, sys
num = sys.argv[1]
print 'Calling'
phones = [
'http://phone1/index.htm',
'http://phone2/index.htm',
'https://phone3/index.htm',
'https://phone4/index.htm',
'https://phone5/index.htm'
]
data = urllib.urlencode({"NUMBER":num, "DIAL":"Dial", "active_line":1})
while 1: 
    for phone in phones:
        try:
            urllib2.urlopen(phone,data) # make call
            urllib2.urlopen(phone+"?dialeddel=0") # clear logs
        except: pass

The first problem is that it only calls using phone one… Right now it is setup to keep calling over and over, for debugging purposes, and I seem to only be getting calls from phone one… The second problem is that the script will not terminate. ctrl+c does not work… The only way to terminate it (that I know of) is to end the ssh session. Now, I am new to python so both of these are probably just stupid mistakes so hopefully someone can help. Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T14:31:01+00:00Added an answer on June 10, 2026 at 2:31 pm

    Try replacing the try catch block like this,

    try:
        <code>
    except Exception as exp:
        <code>
    

    While using the below code.

    except:
        pass
    

    The system will catch SystemExit, KeyboardInterrupt and other things that you probably don’t want to catch.

    Thanks.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this script that works, but I need to change the format of
This is more a question of coding style, but I have a script that
I found this script that gives you the username in Windows, but I get
I'm trying to run this script that basically reads/interprets text in from a textfile
I have this jQuery script that works fine: $(select).change(function () { var finalPrice =
I know this has been answered before, but it seems that executing the script
I have a python script that checks code for coding convention errors. It does
I have this script that run to fix my menu bar to the browser
I tweaked this script that I used from JqueryUi and I have a problem.
I have this script that collects data from users and I want to check

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.