Plantronics + Polycom. Now together as Poly Logo

Can't search contact directory in vvx310

SOLVED
Visitor

Can't search contact directory in vvx310

Hi, I using a config file which the phone picks up from tftp server on our phone system (Freepbx).  The contacts all show OK on the phone, but if I go to try and search a contact (even if I type the name exactly), it won't find anything.  We have 70 users, so having to manually scroll through the entire list will be an issue.  Below is an example of what the file looks like:

 

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<!-- $RCSfile: 000000000000-directory~.xml,v $  $Revision: 1.3 $ -->
<directory>
    <item_list>
        <item>
            <ln> Diaz </ln>
            <fn> Test </fn>
            <ct> 101 </ct>
        </item>
        <item>
            <ln> Carraro </ln>
            <fn> Smith </fn>
            <ct> 102 </ct>
        </item>
        <item>
            <ln> Schmitz </ln>
            <fn> Test </fn>
            <ct> 106 </ct>
        </item>
        <item>
            <ln> Zaino </ln>
            <fn> Smith </fn>
            <ct> 107 </ct>
        </item>
    </item_list>
</directory>

I have tried updating one of the phones to the latest firmware (as of 22/08/2018), but makes no difference.  Just wondering if the contact directory file is missing something to allow it to be searchable or there is something else I am missing to get this working? 

 

 

Message 1 of 8
7 REPLIES 7
Visitor

Re: Can't search contact directory in vvx310

Just to add, I am using software version:

Polycom UC Software 5.8.0.12848

Message 2 of 8
Highlighted
Polycom Employee & Community Manager

Re: Can't search contact directory in vvx310

Hello @Giotech,

welcome to the Polycom Community.

I am not aware of any known issues so I suggest you verify your configuration and if you need to take this further please open a ticket.


In order to raise a support ticket you need to work with your Polycom reseller as they need to do this for you.

End Customers are unable to open a ticket directly with Polycom support.

If this is some sort of an Internet discounter please post either your phone's MAC address or your Polycom devices serial so I can look up who would be able to support you. This may not be who you purchased the Polycom device from.

If the unit is no longer within warranty please be prepared to Pay Per Incident / PPI. This is all outlined in detail here

Please ensure to provide some feedback if this reply has helped you so other users can profit from your experience.

Best Regards

Steffen Baier

Polycom Global Services




<======== Signature / Disclaimer ========>
Please be aware:For questions about the type of support to expect please check here

Please also ensure you always check the VoIP , Video Endpoint , Skype for Business , PSTN or RPM FAQ's

Please remember, if you see a post that helped you , and it answers your question, please mark it as an "Accept as Solution".

The title Polycom Employee & Community Manager is an automatic setting within the community and any forum reply or post is based upon my personal experience and does not reflect the opinion or view of my employer.
Poly employee participation within this community is not mandatory and any post or FAQ article provided by myself is done either during my working hours or outside working hours, in my private time, and maybe answered on weekends, bank holidays or personal holidays.
Message 3 of 8
Visitor

Re: Can't search contact directory in vvx310

Thanks for replying, are you able to check who we would need to call, MAC for one of the phones is:

64167f989cc5

Message 4 of 8
Visitor

Re: Can't search contact directory in vvx310

In case anyone else is having this issue, I have found out what is causing it.  It seems you have to specific all the options in the polycom directory xml (even if you are not using them) or you can't search on the phone. 

I was using a script from Thyrus Gorges which pulls all the extensions from FreepBX and creates the file.  But had a adjust his script so it adds the missing options:

(more info on the script: https://gist.github.com/thyrusg/b3b2d556f71514e53527)

 

#!/bin/bash

# Author: Thyrus Gorges
# Date: 2015/03/04

#The MIT License (MIT)

#Copyright (c) <2015> <Thyrus Gorges>

#Permission is hereby granted, free of charge, to any person obtaining a copy
#of this software and associated documentation files (the "Software"), to deal
#in the Software without restriction, including without limitation the rights
#to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
#copies of the Software, and to permit persons to whom the Software is
#furnished to do so, subject to the following conditions:

#The above copyright notice and this permission notice shall be included in
#all copies or substantial portions of the Software.

#THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
#IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
#FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
#AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
#LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
#OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
#THE SOFTWARE.


# Build a Polycom Directory XML file
# by pulling the usernames and extensions of all SIP users

# Set so we can loop on newlines instead of spaces
IFS=$'\n'

# MySQL Creds
SQLUSER=root
SQLPASS="password"

# Declare our file
FILE=/tftpboot/contacts/000000000000-directory.xml

# Remove old file
rm $FILE

# ReCreate our file
touch $FILE


# Write the header of the file
# Passing the -e option to echo allows us to use tabs
echo -e '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>' >> $FILE
echo -e '<!-- $RCSfile: 000000000000-directory~.xml,v $  $Revision: 1.3 $ -->' >> $FILE
echo -e '<directory>' >> $FILE
echo -e "\t<item_list>" >> $FILE


# Query Database
# We pass -N to MySQL so it doens't print headers
# CS:  Original command below, modified to remove password
for i in $( mysql -u $SQLUSER -p$SQLPASS -N -e "use asterisk; select extension, name from users;" ); do
# for i in $( mysql -u $SQLUSER -N -e "use asterisk; select extension, name from users;" ); do
        # Assign Variables to each field
        EXTEN=`echo $i | cut -f1`
        FN=`echo $i | cut  -f2 | cut -d" " -f1`
        LN=`echo $i | cut -d" " -f2`
        # The item tag is the beginning of a contact
        echo -e "\t\t<item>" >> $FILE
        echo -e "\t\t\t<ln> $LN </ln>" >> $FILE
        echo -e "\t\t\t<fn> $FN </fn>" >> $FILE
        echo -e "\t\t\t<ct> $EXTEN </ct>" >> $FILE
	echo -e "\t\t\t<sd>0</sd>" >> $FILE
	echo -e "\t\t\t<rt>3</rt>" >> $FILE
	echo -e "\t\t\t<dc>0</dc>" >> $FILE
	echo -e "\t\t\t<ad>0</ad>" >> $FILE
	echo -e "\t\t\t<ar>0</ar>" >> $FILE
	echo -e "\t\t\t<bw>0</bw>" >> $FILE
	echo -e "\t\t\t<bb>0</bb>" >> $FILE
        echo -e "\t\t</item>" >> $FILE
done

# Write file endings
echo -e "\t</item_list>" >> $FILE
echo -e "</directory>" >> $FILE

 

Message 5 of 8
Visitor

Re: Can't search contact directory in vvx310

Noticed a mistake in the script I posted, this is the correct one:

#!/bin/bash

# Author: Thyrus Gorges
# Date: 2015/03/04

#The MIT License (MIT)

#Copyright (c) <2015> <Thyrus Gorges>

#Permission is hereby granted, free of charge, to any person obtaining a copy
#of this software and associated documentation files (the "Software"), to deal
#in the Software without restriction, including without limitation the rights
#to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
#copies of the Software, and to permit persons to whom the Software is
#furnished to do so, subject to the following conditions:

#The above copyright notice and this permission notice shall be included in
#all copies or substantial portions of the Software.

#THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
#IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
#FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
#AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
#LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
#OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
#THE SOFTWARE.


# Build a Polycom Directory XML file
# by pulling the usernames and extensions of all SIP users

# Set so we can loop on newlines instead of spaces
IFS=$'\n'

# MySQL Creds
SQLUSER=root
SQLPASS="password"

# Declare our file
FILE=/tftpboot/contacts/000000000000-directory.xml

# Remove old file
rm $FILE

# ReCreate our file
touch $FILE


# Write the header of the file
# Passing the -e option to echo allows us to use tabs
echo -e '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>' >> $FILE
echo -e '<!-- $RCSfile: 000000000000-directory~.xml,v $  $Revision: 1.3 $ -->' >> $FILE
echo -e '<directory>' >> $FILE
echo -e "\t<item_list>" >> $FILE


# Query Database
# We pass -N to MySQL so it doens't print headers
# CS:  Original command below, modified to remove password
for i in $( mysql -u $SQLUSER -p$SQLPASS -N -e "use asterisk; select extension, name from users;" ); do
# for i in $( mysql -u $SQLUSER -N -e "use asterisk; select extension, name from users;" ); do
        # Assign Variables to each field
        EXTEN=`echo $i | cut -f1`
        FN=`echo $i | cut  -f2 | cut -d" " -f1`
        LN=`echo $i | cut -d" " -f2`
        # The item tag is the beginning of a contact
        echo -e "\t\t<item>" >> $FILE
        echo -e "\t\t\t<ln>$LN</ln>" >> $FILE
        echo -e "\t\t\t<fn>$FN</fn>" >> $FILE
        echo -e "\t\t\t<ct>$EXTEN</ct>" >> $FILE
	echo -e "\t\t\t<sd>0</sd>" >> $FILE
	echo -e "\t\t\t<rt>3</rt>" >> $FILE
	echo -e "\t\t\t<dc></dc>" >> $FILE
	echo -e "\t\t\t<ad>0</ad>" >> $FILE
	echo -e "\t\t\t<ar>0</ar>" >> $FILE
	echo -e "\t\t\t<bw>0</bw>" >> $FILE
	echo -e "\t\t\t<bb>0</bb>" >> $FILE
        echo -e "\t\t</item>" >> $FILE
done

# Write file endings
echo -e "\t</item_list>" >> $FILE
echo -e "</directory>" >> $FILE
Message 6 of 8
Polycom Employee & Community Manager

Re: Can't search contact directory in vvx310

Hello @Giotech,

The community's VoIP FAQ contains this post here:

Jan 6, 2012 Question: How can I create a local directory or what is the 000000000000-directory.xml used for?

Resolution: Please check => here <=

 

The above post has a XLS file and a Perl Script example archiving the same.


Best Regards

Steffen Baier

Polycom Global Services




<======== Signature / Disclaimer ========>
Please be aware:For questions about the type of support to expect please check here

Please also ensure you always check the VoIP , Video Endpoint , Skype for Business , PSTN or RPM FAQ's

Please remember, if you see a post that helped you , and it answers your question, please mark it as an "Accept as Solution".

The title Polycom Employee & Community Manager is an automatic setting within the community and any forum reply or post is based upon my personal experience and does not reflect the opinion or view of my employer.
Poly employee participation within this community is not mandatory and any post or FAQ article provided by myself is done either during my working hours or outside working hours, in my private time, and maybe answered on weekends, bank holidays or personal holidays.
Message 7 of 8
Frequent Visitor

Re: Can't search contact directory in vvx310

This was helpful, but not entirely clear that there was a syntax error in the original script with relation to spaces in the FN and LN, so adding a note on it.

 

Original script and "broken" searchc (I imagine if you put a space at the beginning of your search, it would work).

 

        echo -e "\t\t\t<ln> $LN </ln>" >> $FILE
        echo -e "\t\t\t<fn> $FN </fn>" >> $FILE
        echo -e "\t\t\t<ct> $EXTEN </ct>" >> $FILE

 

 

Fixed:

 

        echo -e "\t\t\t<ln>$LN</ln>" >> $FILE
        echo -e "\t\t\t<fn>$FN</fn>" >> $FILE
        echo -e "\t\t\t<ct>$EXTEN</ct>" >> $FILE

 

Message 8 of 8