POSSA / freepbx-Call-Statistics

FreePBX module for reporting concurrent calls as well as breaking calls down by extension
https://github.com/POSSA/freepbx-Call-Statistics
31 stars 18 forks source link

PJSIP Trunk not available #20

Open Herrick19 opened 8 years ago

Herrick19 commented 8 years ago

Hi,

I am not 100% sure PJSIP is the root cause of the issue, but here is what I am experiencing:

In Reports/Concurrent calls, I see the graph and everything works fine.

But if I try to take anythink in the trunk beside the blank value (All IAX2 trunks, all Sip Trunks, All DAHDI Trunks, All Custom Trunks), All I get are empty graphs.

I am trying to get the max calls on my SIP trunk but I can't. I presume the problem is related to SIP VS PJSIP... I am using a PJSIP Trunk.

I guess you just need to add an option for "All PJSIP Trunks".

COuld you try to fix this. I am willing to help out by debugging or even trying to fix the issue if you tell me where you think the bug is and in which file I should do the patch. If you can't help out, I'll just dig ;)

Thanks

mavhc commented 3 years ago

This only works after converting to mysqli

In concurrentcalls.php add

        while ($data = mysqli_fetch_array($SQLTrunksRS)) {
                $trunks[] = array(
                        'channelid' => "SIP/".$data["channelid"]."-",
                        'name' => $data["name"]." (sip)",
                        'dahdi' => false,
                );
        }
        // query to get all PJSIP trunks
        $SQLTrunks = "SELECT
                                        `name`,`channelid`
                                FROM
                                        trunks
                                WHERE
                                        disabled LIKE 'off' AND
                                        (
                                                tech LIKE 'pjsip'
                                        )
                                ORDER BY
                                        trunkid";
        $SQLTrunksRS = mysqli_query($link,$SQLTrunks)
                or die("1 Failed to query the \"" . $dbConf["database"] . "\" database.");