As far as I know detecting what capabilities / applications a user has can be tricky for security reasons, but you can rule some things out and go from there.
You could try see of its a mobile browser which can handle the link, and then if not, see if the other device is capable of using a telephone number, e.g. Skype, and again if not, just display a normal number.
this combines answers from these questions a href tel and standard browsers and Javascript to detect Skype?
<div>
<?php if(strstr(strtolower($_SERVER['HTTP_USER_AGENT']), 'mobile') || strstr(strtolower($_SERVER['HTTP_USER_AGENT']), 'android')) { echo '<div id="tel"><a href="tel:123456">123456</a></div>'; }else{?>
<script>
function skype (failureFunction) {
var $ = jQuery;
if ($.browser.safari || $.browser.opera) {
return true;
} else if ($.browser.msie) {
try {
if (new ActiveXObject("Skype.Detection")) return true;
} catch(e) { }
} else {
if (typeof(navigator.mimeTypes["application/x-skype"]) == "object") {
return true;
}
}
$('a[href^="skype:"]').click(function() {
failureFunction();
return false;
});
return false;
}
jQuery(function($) {
if (skype()) {
$('div#tel').html("<a href='skype:123456'>123456</a>");
} else {
$('div#tel').html("<p>123456</p>");
};
});
</script>
<div id="tel"></div>
<?}?>
I hope its a step in the right direction for yer