Dynamically altering cell contents with custom Javascript to show two different browsers two different links!

I have a use case where I need to take the contents of a cell, in this case 01433443665, and then transform that number into a URL containing that number and then present browser 1 with a URL which looks like

http://192.168.1.50/callr.php?01433443665

and browser 1 with a URL which looks like

http://192.168.1.50/calll.php?01433443665

If you're wondering what on Earth this is for(!), it's to allow the cell to be clicked and then Asterisk/FreePBX (hosted at 192.168.1.50) takes the number and dials it on the user's deskphone.

Browser 1 is in one room, Browser 2 in another. They have separate extensions and separate deskphones.

This would have to be done with Jquery/Javascript I guess?!

I currently use Javascript like the below:

$(document).on("db-view-render.view_321", function (event, view, data) {
$("input#field_32").keyup(function() {
var str=this.value.replace(/[^0-9]/gi,"");
var d1=(str.length<=10)?str.toUpperCase():str.slice(0,11).toUpperCase();
$("#field_32").attr("value",d1);
});
});

to enforce only numbers in an input field in the database. It works well.

I'm guessing I'd have to use a Chrome extension like [Custom User Agent][1] to allow the two browsers to identify themselves to the javascript...but how to tie this all up and make it work is totally beyond me. I understand the theory and steps needed (I think) but can't begin to imagine how to code for it.

Any help much appreciated!!

Thanks...


[1]: https://chrome.google.com/webstore/detail/custom-useragent-string/lejiafennghcpgmbpiodgofeklkpahoe?hl=en

Have you thought about saving the two urls in the database? one for calll.php and other for callr.php.

And create two different users in knack, one for room 1 and one for room 2.

Then with the page rules show the link of the url of calll.php to room 1 and the link of the url of callr.php to the user of room 2

I hope it helps you