add $gw on incoming, may add $gw for sendsms and replace most sendsms() with sendsms_helper()