example pseudo code for smpp session