Decided to give Smart BLF a try… seems like a very useful feature! Trouble is, I’m having some difficulties making status/subscriptions work.
My old config, using “dumb” BLF, works fine.
res_digium_phones.conf snippet:
[myphone]
type=phone
contact=default.xml
contact=myphone.xml
blf_contact_group=SpeedDial
myphone.xml:
<phonebooks>
<contacts group_name="SpeedDial" editable="1" id="speeddial">
<contact first_name=“Copy" last_name=“Room" contact_type="sip" subscribe_to="sip:2475@asterisk">
<numbers>
<number dial="2475" dial_prefix="" primary="1"/>
</numbers>
</contact>
</contacts>
</phonebooks>
Here’s my Smart BLF config, which works (ie. keys appear; long vs. short press is working), but seems unaware of the target phone’s status (no indicators, etc).
res_digium_phones.conf snippet:
[myphone]
type=phone
contact=default.xml
blf_items=smartblftest.xml
default.xml (same as in above config):
<phonebooks>
<contacts group_name=“My Company" editable="0" id="default">
<contact first_name=“Copy" last_name=“Room" contact_type="sip" job_title=“vacant" id="2475" account_id=“2475" subscribe_to="sip:2475@asterisk” has_voicemail="1">
<actions>
<action id="extension" dial="2475" label="Extension"/>
<action id="intercom" dial="*2475" label="Intercom"/>
<action id="voicemail" dial="#2475" label="Voicemail"/>
<action id="pickupcall" dial="##2475" label="Pickup"/>
</actions>
</contact>
</contacts>
</phonebooks>
smartblftest.xml:
<config>
<smart_blf>
<blf_items>
<blf_item location="side" index="0" paging="1" contact_id="2475">
<behaviors>
<behavior press_action="extension" press_function="dial"/>
<behavior long_press_action="intercom" long_press_function="dial"/>
<behavior target_status="on_the_phone" press_action="voicemail" press_function="dial"/>
<behavior target_status="ringing" press_action="pickupcall" press_function="dial"/>
</behaviors>
<indicators>
<indicator target_status="ringing" ring="0" led_color="red" led_state="fast”/>
<indicator target_status=“on_the_phone" ring="0" led_color="red" led_state=“on"/>
</indicators>
</blf_item>
</blf_items>
</smart_blf>
</config>
What am I overlooking?
One thing you’re seemingly overlooking is blf_contact_group. It looks like before you had it set to SpeedDial and the group_name of myphone.xml’s contacts group_name matched.
Whereas your new phone definition might be omitting blf_contact_group, and the group_name of the contacts file is now “My Company”
I thought that was only applicable when the BLF entries were held within a contacts group, rather than in a list of BLF items(?).
Tried adding “blf_contact_group=My Company” to see if it would make any difference. It did not.
(The group named “My Company” was present and identical in the old config; it just wasn’t relevant because I was keeping all the BLF entries in a separate file, redundantly in some cases. Once I was using a file with Smart BLF items, which refer to contact_id-s within default.xml, I figured it became relevant.)
As a test, I tried this in smartblftest.xml - I figured it should cause the red LED to come on regardless of the state of anything.
<config>
<smart_blf>
<blf_items>
<blf_item location="side" index="0" paging="1" contact_id="2475">
<behaviors>
<behavior press_action="extension" press_function="dial"/>
<behavior long_press_action="intercom" long_press_function="dial"/>
</behaviors>
<indicators>
<indicator led_color="red" led_state="fast"/>
</indicators>
</blf_item>
</blf_items>
</smart_blf>
</config>
The short/long press still works, but I still have no light. Despite looking through the documentation all afternoon, I have no idea where I’ve gone wrong.
I don’t really want to piece apart your config, but I’ll try to give you something to start with.
Here’s a brief phone config:
[101]
type=phone
line=101
full_name=Bobby Jones
blf_contact_group=Directory
contact=mycontacts.xml
blf_items=myblfitems.xml
Here’s a contacts snippet, i.e. mycontacts.xml:
<?xml version="1.0" ?>
<phonebooks>
<contacts group_name="Directory" editable="0" id="0">
<contact id="101” account_id="101” first_name="Bobby" last_name="Jones" subscribe_to="auto_hint_101” contact_type="sip">
<actions>
<action id="primary" dial="101” dial_prefix="" label=“Main Phone” name=“Main Phone“ />
</actions>
</contact>
</contacts>
</phonebooks>
And here’s a BLF Items snippet, i.e. myblfitems.xml:
<config>
<smart_blf>
<blf_items>
<blf_item location="main" index="1" paging="1" contact_id="101”>
<behaviors>
</behaviors>
<indicators>
</indicators>
</blf_item>
</blf_items>
</smart_blf>
</config>
With DPMA in use, it makes hints for you, in the format auto_hint_sipendpoint. If you’re not using the automatically generated hints, you’ll have to make your own hints in the dialplan. I don’t think you need to construct your hint like “sip:2475@asterisk” because the phone will try to subscribe already to the primary host of its primary (first) account, so subscribe_to="2475” would probably be sufficient. Again, with DPMA in-play, you’ll want to use the auto_hint instead; probably auto_hint_2475.
Thanks. After testing with the config you provided, and tweaking the config I had, I was able to get it working.
1 Like