Hi,
the BLF lights comes online during call. Problem is when the watchers phone is rebooted and the lights after reboot are off, but before restart they were green/red.

I looked to the source code of presence module and I think that I found the problematic part in function update_subscrition() in file modules/presence/subscribe.c:

        if(subs->expires!= 0 && subs->event->wipeer)
        {
            LM_DBG("send Notify with winfo\n");
            if(query_db_notify(&subs->pres_uri, subs->event->wipeer, subs)< 0)
            {
                LM_ERR("Could not send notify winfo\n");
                goto error;
            }
            if(subs->send_on_cback== 0)
            {
                if(notify(subs, NULL, NULL, 0, 0)< 0)
                {
                    LM_ERR("Could not send notify\n");
                    goto error;
                }
            }
        }
        else
        {
            if(send_fast_notify && (notify(subs, NULL, NULL, 0, 0)< 0))
            {
                LM_ERR("Could not send notify\n");
                goto error;
            }
        }

The presence module is always going to this line> if(send_fast_notify && (notify(subs, NULL, NULL, 0, 0)< 0))
and it sends just empty notify, it should send the last notify (which was from the last call).
What is subs->event->wipeer and why do we need to check it?

Any help is appreciated.

po 16. 7. 2018 o 9:37 Daniel-Constantin Mierla <miconda@gmail.com> napísal(a):

Hello,


On 12.07.18 16:41, Michal Škuta wrote:
Hello,

I am trying make presence module work with Kamailio. Right now I am testing these modules: presence, presence_xml, presence_dialoginfo, pua and pua_dialoginfo.

I had some success, the BLF is working only when the monitored extension is calling. When the monitored extension is calling, then the BLF changes its color (red). After end of the call the BLF changes color to green.
My problem is when a User comes on-line then it sends SUBSCRIBE with *Event: dialog* and
don't get notified of its subscribers state and BLF is not changed.

does it come online during a call?

I found similar problem in this mail list :
https://lists.kamailio.org/pipermail/sr-users/2017-March/096314.html But is not working for me.


Second question is about BLF and offline state. I can not found anything in RFC, there is no offline state, no way to turn off the BLF lamp from green to OFF.
I found only this pdf from grandstream: http://www.grandstream.com/sites/default/files/Resources/GXP21x0_Eventlist_BLF_Guide.pdf  mentioning offline state on page 8.
Does anyone have experience with it?

BLF is about dialog states, not user (device) states, so it is about being in a call (busy) or or not. Not to get notifications about it, you should unsubscribe for dialog event.

Cheers,
Daniel

-- 
Daniel-Constantin Mierla -- www.asipto.com
www.twitter.com/miconda -- www.linkedin.com/in/miconda
Kamailio World Conference -- www.kamailioworld.com