cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
368
Views
1
Helpful
2
Replies

Selecting Line Association in remote destinations using AXL SQLQuery

jhosefer
Level 1
Level 1

Guys, I need to query and check the 'Line Association' checkbox in remote Destination automatically based on some business conditions. Since we already use the AXL API to perform this type of action, we decided to follow this approach. However, I can't find the table responsible for storing this information. As the operation will be performed for many remote Destinations, the ideal is that this action is executed via executeSQLQuery call.

Can anyone help?

1 Accepted Solution

Accepted Solutions

jhosefer
Level 1
Level 1

After several tests, I believe I achieved the expected result. The mapping is located in the devicenumplanmapremdestmap table, as its name suggests it maps Remote Destinations to specific combinations of device (Remote Destination Profile) and DN. The presence of a record in this table for a Remote Destination indicates that the checkbox is checked, while its absence indicates it is unchecked.

Below is the SQL query for anyone who might need it in the future:

SELECT
    d.name AS remotedestinationprofile,
    np.dNOrPattern AS line,
    rp.name AS partition,
    rd.name AS remotedestination,
    rdd.destination,
    eu.mailid,
    eu.displayname,
    eu.userid,
    rdd.enablesinglenumberreach AS snr_enabled,
    CASE
        WHEN EXISTS (
            SELECT 1
            FROM devicenumplanmapremdestmap drdm
            WHERE drdm.fkremotedestination = rd.pkid
        ) THEN 'Yes'
        ELSE 'No'
    END AS line_association
FROM
    remotedestinationdynamic rdd
INNER JOIN
    remotedestination rd ON rdd.fkremotedestination = rd.pkid
INNER JOIN
    device d ON rd.fkdevice_remotedestinationtemplate = d.pkid
INNER JOIN
    DeviceNumPlanMap dmap ON d.pkid = dmap.fkDevice
INNER JOIN
    NumPlan np ON dmap.fkNumPlan = np.pkid
INNER JOIN
    Routepartition rp ON np.fkRoutePartition = rp.pkid
INNER JOIN
    enduser eu ON d.fkenduser_mobility = eu.pkid
WHERE
    eu.userid = '<USERID>'

View solution in original post

2 Replies 2

Suggest that you ask your question over at DevNet as that forum is better suited for this type of question.



Response Signature


jhosefer
Level 1
Level 1

After several tests, I believe I achieved the expected result. The mapping is located in the devicenumplanmapremdestmap table, as its name suggests it maps Remote Destinations to specific combinations of device (Remote Destination Profile) and DN. The presence of a record in this table for a Remote Destination indicates that the checkbox is checked, while its absence indicates it is unchecked.

Below is the SQL query for anyone who might need it in the future:

SELECT
    d.name AS remotedestinationprofile,
    np.dNOrPattern AS line,
    rp.name AS partition,
    rd.name AS remotedestination,
    rdd.destination,
    eu.mailid,
    eu.displayname,
    eu.userid,
    rdd.enablesinglenumberreach AS snr_enabled,
    CASE
        WHEN EXISTS (
            SELECT 1
            FROM devicenumplanmapremdestmap drdm
            WHERE drdm.fkremotedestination = rd.pkid
        ) THEN 'Yes'
        ELSE 'No'
    END AS line_association
FROM
    remotedestinationdynamic rdd
INNER JOIN
    remotedestination rd ON rdd.fkremotedestination = rd.pkid
INNER JOIN
    device d ON rd.fkdevice_remotedestinationtemplate = d.pkid
INNER JOIN
    DeviceNumPlanMap dmap ON d.pkid = dmap.fkDevice
INNER JOIN
    NumPlan np ON dmap.fkNumPlan = np.pkid
INNER JOIN
    Routepartition rp ON np.fkRoutePartition = rp.pkid
INNER JOIN
    enduser eu ON d.fkenduser_mobility = eu.pkid
WHERE
    eu.userid = '<USERID>'