TUTORIAL step by step guide to setup endpoints

synack

Guru
Joined
Dec 31, 2013
Messages
227
Reaction score
56
If you are using only internal extensions, why don't you setup a new directory under the "applications" tab. It's so simple and will populate your Site A with all internal extensions.
Create a new directory and add "all users". It adds the benefit of having an IVR directory available to you as well. any users you do not want in the directory can be removed.
External entries can be done, if you wish, via Asteridex under the "other" tab.
 

ariban

Member
Joined
Aug 1, 2013
Messages
310
Reaction score
16
If you are using only internal extensions, why don't you setup a new directory under the "applications" tab. It's so simple and will populate your Site A with all internal extensions.
Create a new directory and add "all users". It adds the benefit of having an IVR directory available to you as well. any users you do not want in the directory can be removed.
External entries can be done, if you wish, via Asteridex under the "other" tab.

Wow yes that is amazing, it works for all internal numbers.
as for external number, i will try using asteridex but so far the file you sent me is not connect to it. i will try to play around but i have more hopes you know why than i will ever find out!

thank you
 

ariban

Member
Joined
Aug 1, 2013
Messages
310
Reaction score
16
it's a slow day for me today....
directory.php with asteridex for outside numbers.
At the top you can specify your dialout prefix (dial 9 by default)

notice the getextlist=2 in menuitem for asteridex. fill out the blanks as above.


it keeps on saying requesting and then says request failed. but everything looks good to me in your file, the mysql connection details are correct. i dont get why its saying request failed!
 

ariban

Member
Joined
Aug 1, 2013
Messages
310
Reaction score
16
Oh yuck, the asterisk phonebook uses the Asterisk AGI. The DB backend on the agi is not all that great. I would strongly consider using something else like asteridex with a proper DB backend.
If you really really must use the Asterisk phonebook, I invite you to refer to /var/lib/asterisk/agi-bin/pbdirectory file for hints on what code you would need to integrate into the directory php I provided.
I unfortunately won't have the time to get too involved into that, but I am available for questions.

also would you have a way to upload a lot of names, and numbers to asterdix at once? maybe through phpmyadmin?? what format would i type in run sql command
 

synack

Guru
Joined
Dec 31, 2013
Messages
227
Reaction score
56
Can you please run from a SSH console:
Code:
mysql -u root -ppassw0rd asteridex -e 'show tables;'
I would expect the result:
Code:
+---------------------+
| Tables_in_asteridex |
+---------------------+
| user1               |
+---------------------+
 

ariban

Member
Joined
Aug 1, 2013
Messages
310
Reaction score
16
yes these are the results
+---------------------+
| Tables_in_asteridex |
+---------------------+
| user1 |
+---------------------+
 

synack

Guru
Joined
Dec 31, 2013
Messages
227
Reaction score
56
can you please make sure your menuitem line looks something like this:
Code:
menuitem("Asteridex A", "http://192.168.1.126/directory.php?getextlist=2&returl=$LOCAL");
making sure your ip is correct and getextlist=2, and that you are using the second file I uploaded with asteridex support.
 

ariban

Member
Joined
Aug 1, 2013
Messages
310
Reaction score
16
yes its exactly like this, the getextlist=2 not 1 and the ip is correct!
 

synack

Guru
Joined
Dec 31, 2013
Messages
227
Reaction score
56
OK edit that directory php file, on the first line delete the // to uncomment the parse_str command.
run from a ssh console:
Code:
cd /var/www/html
php -f directory.php getextlist=2 returl="blah"
Does it return with a bunch of XML?
Can you sanitize the names and numbers out and post the results?

don't forget to edit that file again afterwards, and reinsert the // to comment out that line for web.
 

ariban

Member
Joined
Aug 1, 2013
Messages
310
Reaction score
16
yes it gives me the results from asteridex:

PHP Notice: Undefined index: SERVER_ADDR in /var/www/html/directory.php on line 4
<CiscoIPPhoneDirectory>
<Title>Phonebook</Title>
<Prompt> </Prompt>
<DirectoryEntry>
<Name>American Airlines</Name>
<Telephone>8004337300</Telephone>
</DirectoryEntry>
<DirectoryEntry>
<Name>JetBlue Airways</Name>
<Telephone>8005382583</Telephone>
</DirectoryEntry>
<DirectoryEntry>
<Name>United Airlines</Name>
<Telephone>8005250280</Telephone>
</DirectoryEntry>
<SoftKeyItem>
<Name>Exit</Name>
<URL>Init:Services</URL>
<Position>4</Position>
</SoftKeyItem>
<SoftKeyItem>
<Name>Dial</Name>
<URL>SoftKey:Dial</URL>
<Position>1</Position>
</SoftKeyItem>
<SoftKeyItem>
<Name>Back</Name>
<URL>http://blah/directory.php</URL>
<Position>3</Position>
</SoftKeyItem>
</CiscoIPPhoneDirectory>
 

synack

Guru
Joined
Dec 31, 2013
Messages
227
Reaction score
56
WHAT?
can you try it again, but with only
php -f directory.php
this time?
 

synack

Guru
Joined
Dec 31, 2013
Messages
227
Reaction score
56
(WHAT? meaning, that's exactly how it should look)
 

ariban

Member
Joined
Aug 1, 2013
Messages
310
Reaction score
16
PHP Notice: Undefined index: getextlist in /var/www/html/directory.php on line 3
PHP Notice: Undefined index: SERVER_ADDR in /var/www/html/directory.php on line 4
PHP Notice: Undefined index: returl in /var/www/html/directory.php on line 5
<CiscoIPPhoneMenu>
<Title>Corporate Directory</Title>
<Prompt> </Prompt>
<MenuItem>
<Name>Internal Extensions</Name>
<URL>http://192.168.1.126/directory.php?getextlist=1&amp;returl=</URL>
</MenuItem>
<MenuItem>
<Name>Phonebook</Name>
<URL>http://192.168.126/directory.php?getextlist=2&amp;returl=</URL>
</MenuItem>
<SoftKeyItem>
<Name>Exit</Name>
<URL>Init:Services</URL>
<Position>4</Position>
</SoftKeyItem>
<SoftKeyItem>
<Name>Select</Name>
<URL>SoftKey:Select</URL>
<Position>1</Position>
</SoftKeyItem>
</CiscoIPPhoneMenu>
 

synack

Guru
Joined
Dec 31, 2013
Messages
227
Reaction score
56
ah the typo in your menulist. you are missing a "1." in 192.168.1.126
 

ariban

Member
Joined
Aug 1, 2013
Messages
310
Reaction score
16
i am so SORRY for driving you nuts!!!
I just realized i was missing the 1. in the ip address instead of 192.168.1.126 i had 192.168.126 so i corrected that and now its working! amazing!! thank you very much!!!

just out of curiosity and i dont mean to drive you more nuts, i have one polycom phone ip 335, is there a way to make it read from asteridex as well??

thank you again its working great!
 

synack

Guru
Joined
Dec 31, 2013
Messages
227
Reaction score
56
Sorry, I don't have any polycoms and wouldn't know the first thing about their directory support.
As for a bulk load in mysql. Possibly phpmyadmin, haven't used that in a long time.
you can do a mysqlimport on the command line but you need to make sure your file is formatted correctly.
it's a tab delimited list.
you can run
Code:
mysql -u root -ppassw0rd asteridex -e 'select * into outfile "/tmp/user1" from user1;'
to see what the file should look like (saved in /tmp/user1)

If you use that file to re-import, make sure you delete the lines from the file that already exist in the database, or you will get duplication issues.

I would caution you however, that the phones cannot store very large lists. Besides, it would not be practical to have a directory of more than 30 or 40 entries. The amount of scrolling would drive users mad.
 

ariban

Member
Joined
Aug 1, 2013
Messages
310
Reaction score
16
Sorry, I don't have any polycoms and wouldn't know the first thing about their directory support.
As for a bulk load in mysql. Possibly phpmyadmin, haven't used that in a long time.
you can do a mysqlimport on the command line but you need to make sure your file is formatted correctly.
it's a tab delimited list.
you can run
Code:
mysql -u root -ppassw0rd asteridex -e 'select * into outfile "/tmp/user1" from user1;'
to see what the file should look like (saved in /tmp/user1)

If you use that file to re-import, make sure you delete the lines from the file that already exist in the database, or you will get duplication issues.

I would caution you however, that the phones cannot store very large lists. Besides, it would not be practical to have a directory of more than 30 or 40 entries. The amount of scrolling would drive users mad.

your correct, thank you. i am just putting some very small lists for quick dials.....
again thank you for everything, i hope all this can help other people looking to do the same!!
 

Members online

No members online now.

Forum statistics

Threads
25,782
Messages
167,509
Members
19,202
Latest member
pbxnewguy
Get 3CX - Absolutely Free!

Link up your team and customers Phone System Live Chat Video Conferencing

Hosted or Self-managed. Up to 10 users free forever. No credit card. Try risk free.

3CX
A 3CX Account with that email already exists. You will be redirected to the Customer Portal to sign in or reset your password if you've forgotten it.
Top