Python variable’s update is visible only inside the scope where its update was made
I don’t know why the variable is correctly updated within that if block, and the result is visible using a print, but outside the variable nothing seems to happen. I suppose that the issue is related to scopes, since it seems last_dialing_number is created only locally.