Hard to say with the limited information you've provided. It sounds like you've developed two entirely separate sites for your mobile and desktop users. Is that content generated dynamically or is it all static? Need more information.
I have a mobile url and desktop url too. They just happen to be identical (hence the need for the Vary: User-Agent header). In my CMS, there is only one package module processing the various template files. If you're using a single cgi script to dynamically generate both the desktop and mobile pages, then the example code could probably be configured to work on your site. If not, you probably just need a simple 301 or 302 redirection to send mobile users to the mobile version of your site and vice versa for your desktop vistors.