<br>I've written a program that tests ISDN dial backup at 1,000 locations. I've broken up the logic into server functions within a threading class (i.e. logon, get interfaces, get dial string, etc.). At 999 locations, the following code extract the first of three dial strings:
<br><br> def GetDialString(self):<br> """ This function extracts the dial string."""<br> self.tn.write("term len 0\n")<br> self.tn.expect([self.host.upper() + "#"], 7)
<br> self.tn.write("sh dialer | i Default\n")<br> self.data = self.tn.read_until(self.host.upper() + "#", 7)<br> print self.data<br> match = re.search("\d\d\d\d\d\d\d\d\d\d\d+",
self.data)<br> if match is not None:<br> rc = match.group()<br> else:<br> rc = "missing"<br> return rc<br><br>One location doesn't return it's dial string. In Idle, the output is:
<br><br><span style="color: rgb(51, 102, 255);">>>> print data</span><br style="color: rgb(51, 102, 255);"><span style="color: rgb(51, 102, 255);">sh dialer | i Default</span><br style="color: rgb(51, 102, 255);">
<span style="color: rgb(51, 102, 255);">17002111000 1 0 8w2d successful Default</span><br style="color: rgb(51, 102, 255);"><span style="color: rgb(51, 102, 255);">17002111002 0 0 never - Default
</span><br style="color: rgb(51, 102, 255);"><span style="color: rgb(51, 102, 255);">17002111001 1 0 never - Default</span><br style="color: rgb(51, 102, 255);"><span style="color: rgb(51, 102, 255);">
J07MR3640#</span><br><br>The "print data" statement yields:<br><br><span style="color: rgb(51, 102, 255);">term len 0</span><br style="color: rgb(51, 102, 255);"><span style="color: rgb(51, 102, 255);">J07MR3640#
</span><br><br>I've run a packet capture and I see the data coming back every time. I don't understand why it works fine for 999 out of 1,000 locations. Any suggestions?<br>