There are several tricks and techniques that you can combine that may help here:
- When the phone requests a URL (i.e. when requesting a service), it will replace the occurrence of #DEVICENAME# in the URL with its actual device name (SEPxxxx). You can configure the service itself with this keyword embedded in it:
Then your service can extract the device name from the URL parameters
- Once you have the device name, you can use AXL and a custom executeSQLQuery action to get a list of DNs (could be multiple) configured on the device. Use a query like:
select device.name from device,numplan,devicenumplanmap where >numplan.dnorpattern like "DN to look for" and >devicenumplanmap.fknumplan=numplan.pkid and >devicenumplanmap.fkdevice=device.pkid
Doing this once, you can use session/cookie to keep track of it or embed the DN in any URLs you send to the phone from then on.
- Your service can do the dialing (with a chance to modify the number) in several different ways, possibly the easiest being to create an IP Phone Execute object with the Dial URI set to the modified number. Also available is a JTAPI action. Note both Execute/JTAPI require some administrative configuration (the phone must be associated with a special application user, CUAE device pool config, etc.)