add a unittest for a freeze scenario
Stop looping infinitely on masquerade

Ticket #5117

When a masquerade happens between 2 Local channels to the same extension@context
_substitute_calls_channel will end since we do not retrieve the next line at each
iteration.

We used to do something like this:

l = [1, 2, 3]
while True:
      if 1 not in l:
          break

      l[l.index(1)] = 1

resulting in an infinite loop
Merge pull request #4 from xivo-pbx/5117-cti_freeze

5117 cti freeze