Comment 7 for bug 1170058

Revision history for this message
Clemens Rambow (openbig.org) (c-rambow) wrote :

Thanks for pointing me there, Marcel. That would indeed fix the exception.
But in my scenario it would also lead to no calling number being retrieved at all - which is an independent (probably ISDN/DAHDI instead SIP related) issue i guess.

As a workaround I just replaced:
if chan.get('ChannelState') == '6' and sip_account in chan.get('BridgedChannel'): # 6 = Up

with:
if chan.get('ChannelState') == '6' and (chan.get('ConnectedLineNum') == user.internal_number or sip_account in chan.get('BridgedChannel')): # 6 = Up

So the if statement is true before evaluating 'sip_account in chan.get('BridgedChannel')', leading to the correct phone number being returned. As I see now, your fix should also be integrated, as the exception can nevertheless still occur with other responses from asterisk.