Hello all, 

I'm actually using a Snom D335 fw. 10.1.64.14 connected to a FreePBX with Asterisk 16.13.0 . 

I've configured phone to monitor extensions with BLF and it is working quite well actually, but I can't understand how to configure a LED OFF status (or any else) for unreachable/inactive/unavailable extensions.

I'm using this configuration on phone

<led_on perm="">ON IN_A_CALL CALLING IN_A_MEETING URGENT_INTERRUPTIONS_ONLY BUSY I-Am-Busy DND_ALL DND_SELF ACTIVE BE_RIGHT_BACK SEIZED CONNECTED ON_HOLD OFFHOOK RINGBACK I-Am-Ready AWAY idle AVAILABLE AVAILABLE_ON_MOBILE AVAILABLE_AT_DESK call_center_status_empty PhoneHasCall PhoneHasMissedCalls CurrentIdentityHasVoiceMessages PhoneHasVoiceMessages seized_local seized_remote active_local active_remote dialog_dnd</led_on>
<led_blink_fast perm="">RINGING PICKUP call_center_status_exceed PhoneHasCallInStateRinging alerting_local alerting_remote</led_blink_fast>
<led_red perm="">CONNECTED BUSY DND_ALL DND_SELF I-Am-Busy IN_A_CALL IN_A_MEETING URGENT_INTERRUPTIONS_ONLY UNAVAILABLE seized_remote alerting_remote active_remote held_remote</led_red>
<led_green perm="">idle AVAILABLE AVAILABLE_ON_MOBILE AVAILABLE_AT_DESK I-Am-Ready I-Am-Almost-Ready call_center_status_empty call_center_status_normal call_center_status_exceed seized_local alerting_local active_local held_local call_parked</led_green>
<led_orange perm="">RINGING AWAY BE_RIGHT_BACK KeyConfigActive dialog_dnd</led_orange>
<led_blue perm=""></led_blue>
<led_call_indicator_usage perm="">PhoneHasCallInStateRinging PhoneHasCallInStateCalling PhoneHasCallInStateRingback PhoneHasCallInStateConnected PhoneHasCallInStateOffhook PhoneHasCallInStateHolding PhoneHasCall PhoneHasMissedCalls DateOngoing DateReminding</led_call_indicator_usage>


I've already searched articles about this issue on community forum, but cannot find nothing viable

Read articles:

How to change the LED colour and behaviour for monitored extensions
How to obtain a SIP trace from a deskphone

HowTo - Extension Monitoring - Asterisk Presence

How to change the LED behaviour for monitored extensions in idle mode


can somebody help me to achieve this goal?

Thanks, 

Andrea

profilePicture

Andrea Biancalani

$userLabel.Name

Joined: 21.09.2022

12 Comments

  1. Gianmaria Tononi

    Hi,

    I can see you are actually a Snom partner so I suggest you raise a private ticket, and not a public Community thread, so we can investigate better.

    Anyway, since this can help other people: the phone cannot see if another phone is turned off or in a DND state for example, the BLF are based on some Notify SIP messages coming from the PBX.

    When the BLF is configured the phone sends a Subscribe message to the PBX, asking for updates via Notify for that extension.

    Usually the PBX sends different updates (bury, ringing or idle for example) when a phone is ringing or in a call or in idle state.

    There is no direct way to know if a phone sets itself on DND or is powered off on the phone with the active BLFs, the only way could be the PBX sending a specific Notify, but that usually doesn't happen because even the PBX doesn't know the state of the phone.

    As said, for further investigation, please raise a private ticket.

    Thank you

  2. Andrea Biancalani

    Hi Gianmaria, 

    I solved the problem using this how-to based on XML definitions adding the traslation for Unavailable as following


    HOW TO KB: https://service.snom.com/display/wiki/HowTo+-+Extension+Monitoring+-+Asterisk+Presence


    <general type=”AsteriskPresenceField”/>
    <!–
    Initialization:
    Here we define some variables used in the XML
    subscr_ext: this the extension of the SUBSCRIBE target
    subscr_proxy: this is the domain part of the SIP uri to SUBSCRIBE
    pickup_code: the pickup code to add in front of the extension in order to pickup the call
    subscr_uri: will be created sip:$(subscr_ext)@$(subscr_proxy) this is the SUBSCRIBE URI
    –>
    <initialization>
    <state value=”initial”/>
    <!– PLEASE EDIT THE “value” ATTRIBUTE WITH THE RIGHT EXTENSION –>
    <variable name=”subscr_ext” value=”123“/>

    <!– PLEASE EDIT THE “value” ATTRIBUTE WITH THE RIGHT PROXY IP ADDR –>
    <variable name=”subscr_proxy” value=”172.16.199.2“/>

    <!– PLEASE EDIT THE “value” ATTRIBUTE WITH THE RIGHT PICKU CODE –>
    <variable name=”pickup_code” value=”**“/>

    <!– DO NOT EDIT –>
    <variable name=”subscr_uri” value=”sip:$(subscr_ext)@$(subscr_proxy)”/>
    </initialization>

    <!– Define the kind of SUBSCRIBE –>
    <subscription type=”presence” to=”<$(subscr_uri)>” for=”$(subscr_uri)”/>

    <!– Verify the validity of the NOTIFY –>
    <NotifyParsingRules type=”applies”>
    <level1 translates_to=’OK’>/presence/tuple/contact[.=”$(subscr_uri)”]</level1>
    </NotifyParsingRules>

    <!– set the monitored extension state –>
    <NotifyParsingRules type=”state”>
    <!– if <ep:away/> tag is present se the status to “Away” –>
    <level1 translates_to=”Away”>/presence/pp:person/status/ep:activities/ep:away</level1>
    <!– when the status is closed set it “Offline” –>
    <level1-1 translates_to=”Offline”>/presence/tuple/status/basic[.=”closed”]</level1-1>
    <!– when the status is Unavailable set it “Offline” –>
    <level1-2 translates_to=”Offline”>/presence/note[.=”Unavailable”]</level1-2>
    <!– if <ep:busy/> tag is present se the status to “Busy” –>
    <level2 translates_to=”Busy”>/presence/pp:person/status/ep:activities/ep:busy</level2>
    <!– if <note> content is “Ringing” set the status to “Ringing” –>
    <level2-1 translates_to=”Ringing”>/presence/note[.=”Ringing”]</level2-1>
    <!– if <note> content is “On Hold” set the status to “Holding” (the phone is holding another call) –>
    <level2-2 translates_to=”Holding”>/presence/note[.=”On hold”]</level2-2>
    <!– if status is open set it as “Registered” –>
    <level3 translates_to=”Registered”>/presence/tuple/status/basic[.=”open”]</level3>
    </NotifyParsingRules>

    <action>
    <!– Dial the pickup code only in Ringing (dial is for backward compatibility) –>
    <dial target=”$(pickup_code)$(subscr_ext)” when=”on press” states=”Ringing”/>
    <invite target=”$(pickup_code)$(subscr_ext)” when=”on press” states=”Ringing”/>
    <!– Dial the extension when Registered –>
    <dial target=”$(subscr_ext)” when=”on press” states=”Registered”/>
    <invite target=”$(subscr_ext)” when=”on press” states=”Registered”/>
    <!– Nothing in all others status –>
    </action>

  3. Daniel Huhardeaux

    Hi Gianmaria, could you please explain how you solved it ? BLF function key doesn't accept XML file and Presence or Definition XML doesn't react with the above XML file (corrected with our datas (wink)), led stay off. We configure another function key on the same phone with BLF to the same extension, it's working great except the UNAVAILABLE status.

    Thanks

    1. Andrea Biancalani

      Hello Daniel, 

      you probably have not updated your LED STATUS in settings

      This is my configuration


      led_on=ON BUSY IN_A_CALL CALLING IN_A_MEETING URGENT_INTERRUPTIONS_ONLY DND UNAVAILABLE ACTIVE INACTIVE BE_RIGHT_BACK AWAY SEIZED CONNECTED ON_HOLD OFFHOOK RINGBACK I-Am-Ready AVAILABLE I-Am-Busy PhoneHasCall PhoneHasMissedCalls CurrentIdentityHasVoiceMessages PhoneHasVoiceMessages Away Offline Busy Registered
      led_blink_slow=PARKED HOLDING I-Am-Almost-Ready call_center_status_normal PhoneHasCallInStateHolding held_local held_remote KeyConfigActive call_parked led_blink_medium=RECORDING MESSAGE DateOngoing DateReminding
      led_blink_fast=RINGING PICKUP PhoneHasCallInStateRinging Ringing Holding
      led_red=BUSY IN_A_CALL CALLING IN_A_MEETING URGENT_INTERRUPTIONS_ONLY HOLDING DND I-Am-Busy Busy Ringing
      led_green=AVAILABLE I-Am-Ready I-Am-Almost-Ready Registered
      led_orange=Offline Holding
      led_blue=


      if you don't know  how to set them, you can use HTTP requests on dummy page, this is the guide: Can I set or change phone settings via HTTP requests

      Provided XML file has to be used paired with "XML definition" feature key, cannot be used with "BLF" one.

      Kind regards.

  4. Daniel Huhardeaux

    I setup leds - I changed them using dummy-, they are working as expected with BLF. I will try with your definition if it matter. I'm surprised, I already copy/paste your XML in number area of an XML definition functions keys, led desperatly stay off (sad) 

    Are you using FW 10.1.141.13 or still 10.1.64.14 ? BTW, I do my tests against asterisk 20.2.

    Thanks for you answer

    1. Andrea Biancalani

      Using that configuration on this hardware/firmware:     snomD335-SIP 10.1.64.14

      Connected to Asterisk 16.28.0


  5. Daniel Huhardeaux

    Another one:

    [SuscribeContext]

    exten = 105,hint,PJSIP/abcde_105&Custom:DND105,Custom:lamp2,CustomPresence:105

    exten = 115,hint,PJSIP/abcde_115&Custom:DND115,Custom:lamp5,CustomPresence:115


    Same for you (DNDxxx and lampxxx not to take in account)?

    1. Andrea Biancalani

      Consider I'm not using PJSIP, but old SIP protocol. 

      I'm not sure you can use PJSIP for presence hints. Probably you can, but I'm not so confident on this protocol and I prefer to stay on legacy SIP one.

  6. Daniel Huhardeaux

    Well, that's effective another one, thanks for feedback. I confirm, still nothing with my led despite the fact that I see NOTIFY presence like

    CSeq: 17641 NOTIFY
    Event: presence
    Subscription-State: active;expires=2137
    Allow-Events: presence, dialog, message-summary, refer
    Max-Forwards: 70
    User-Agent: MyAudio
    Content-Type: application/pidf+xml
    Content-Length: 463

    <?xml version="1.0" encoding="UTF-8"?> <presence entity="sip:105@zone-s" xmlns="urn:ietf:params:xml:ns:pidf" xmlns:dm="urn:ietf:params:xml:ns:pidf:data-model" xmlns:rpid="urn:ietf:params:xml:ns:pidf:rpid"> <note>Ringing</note> <tuple id="105"> <status> <basic>open</basic> </status> <contact priority="1">sip:abcde_115@zone-s</contact> </tuple> <dm:person> <rpid:activities> <rpid:on-the-phone /> </rpid:activities> </dm:person> </presence>

    Perhaps someone from SNOM will jump in this ...

    1. Andrea Biancalani

      Weird.

      Had a fast lookup on that xml and it seems compliant to my example

      <!– if <note> content is “Ringing” set the status to “Ringing” –>
      <level2-1 translates_to=”Ringing”>/presence/note[.=”Ringing”]</level2-1>


      it seems my help stops here, we need a more specific one from Snom support to understand and mitigate this strange behaviour. Sorry (sad)

  7. Daniel Huhardeaux

    You already did help us a lot, we continue to investigate, many thanks.

  8. Christos Kratimenos

    Hello dear Andrea Biancalani , did you manage to solve this issue eventually by the configuration provided? i have followed both guides stated here and here, but i cant seem to get the LED to be red when in a call.