FreePBX / issue-tracker

The unified FreePBX issue tracker.
https://www.freepbx.org
GNU General Public License v3.0
8 stars 1 forks source link

[bug]: Missed call notification not working #449

Open d-mark opened 4 days ago

d-mark commented 4 days ago

FreePBX Version

FreePBX 17

Issue Description

In FreePBX 16 I used the Missed Call notification. After migration to FreePBX 17 (recommended way: backup and restore) no notifications will be sent.

I digged a bit into the source code and enabled debugging of the missedcall module. There I found that notifications only get sent if UNIQUEID is equal to LINKEDID:

[...]
// if the linkedid and uniqueid are same then its the channel who orginated the call. So we can sent the finaly missed call report
if ($linkedid == $uniqueid) {
    log_write("Uniqueid and Linkedid  Processing  uniqueid = $uniqueid");
[...]

My debugging showed indeed that these IDs differ. So the reason why the notification will not be generated is clear. But from where does this difference come from? As I said: The module worked fine in FreePBX 16. And how can I fix it?

Log output shows a normal call from external to an internal extension via SIP trunk.

Operating Environment

Debian 12.7 Asterisk 21.4.1-1.sng12

FreePBX 17 missedcall 17.0.1.2

Relevant log output

-- Executing [41@app-missedcall-hangup:7] AGI("PJSIP/41-00000114", "agi://127.0.0.1/missedcallnotify.php,41,,41,1,enable,PJSIP/41-00000114,,,,") in new stack
    -- agi://127.0.0.1/missedcallnotify.php,41,,41,1,enable,PJSIP/41-00000114,,,,: ********* Missed Call Summary *********
    -- agi://127.0.0.1/missedcallnotify.php,41,,41,1,enable,PJSIP/41-00000114,,,,: Orginator channel : PJSIP/easybell-00000113
    -- agi://127.0.0.1/missedcallnotify.php,41,,41,1,enable,PJSIP/41-00000114,,,,: unanswered: 1
    -- agi://127.0.0.1/missedcallnotify.php,41,,41,1,enable,PJSIP/41-00000114,,,,: Linked Channel ID: 1726856455.431
    -- agi://127.0.0.1/missedcallnotify.php,41,,41,1,enable,PJSIP/41-00000114,,,,: Unique Channel ID: 1726856455.432
    -- agi://127.0.0.1/missedcallnotify.php,41,,41,1,enable,PJSIP/41-00000114,,,,: Calling extension: 0531*******
    -- agi://127.0.0.1/missedcallnotify.php,41,,41,1,enable,PJSIP/41-00000114,,,,: Calling ext name: *****, ******)
    -- agi://127.0.0.1/missedcallnotify.php,41,,41,1,enable,PJSIP/41-00000114,,,,: Ringing extension: 41
    -- agi://127.0.0.1/missedcallnotify.php,41,,41,1,enable,PJSIP/41-00000114,,,,: Missed Call UID: c136b224180204b0bb0562f45b5b1549
    -- agi://127.0.0.1/missedcallnotify.php,41,,41,1,enable,PJSIP/41-00000114,,,,: Voicemail Status:
    -- agi://127.0.0.1/missedcallnotify.php,41,,41,1,enable,PJSIP/41-00000114,,,,: Notification enabled?: 1
    -- agi://127.0.0.1/missedcallnotify.php,41,,41,1,enable,PJSIP/41-00000114,,,,: Is Internal call?: No
    -- agi://127.0.0.1/missedcallnotify.php,41,,41,1,enable,PJSIP/41-00000114,,,,: Send Internal Notification?: Yes
    -- agi://127.0.0.1/missedcallnotify.php,41,,41,1,enable,PJSIP/41-00000114,,,,: Is External call?: Yes
    -- agi://127.0.0.1/missedcallnotify.php,41,,41,1,enable,PJSIP/41-00000114,,,,: Send External Notification?: Yes
    -- agi://127.0.0.1/missedcallnotify.php,41,,41,1,enable,PJSIP/41-00000114,,,,: Is Ring Group call?: No
    -- agi://127.0.0.1/missedcallnotify.php,41,,41,1,enable,PJSIP/41-00000114,,,,: Send Ring Group Notification?: Yes
    -- agi://127.0.0.1/missedcallnotify.php,41,,41,1,enable,PJSIP/41-00000114,,,,: Is Queue call?: No
    -- agi://127.0.0.1/missedcallnotify.php,41,,41,1,enable,PJSIP/41-00000114,,,,: Send Queue Notification?: Yes
    -- agi://127.0.0.1/missedcallnotify.php,41,,41,1,enable,PJSIP/41-00000114,,,,: To email: dm@markwardt-software.de
    -- agi://127.0.0.1/missedcallnotify.php,41,,41,1,enable,PJSIP/41-00000114,,,,: From email:
    -- agi://127.0.0.1/missedcallnotify.php,41,,41,1,enable,PJSIP/41-00000114,,,,: From name:
    -- agi://127.0.0.1/missedcallnotify.php,41,,41,1,enable,PJSIP/41-00000114,,,,: it's me
    -- <PJSIP/41-00000114>AGI Script agi://127.0.0.1/missedcallnotify.php completed, returning 0
d-mark commented 4 days ago

Sorry... forgot to mention... the code snippet above comes from missedcall/agi-bin/missedcallnotify.php