I am using the Asterisk CLI Command sip show peers to display the current peers on my asterisk server.
There are about 50 phones in my network.
I am changing the user/extension of a phone by using a script for my phone (Thomson 2030).
Here is an example showing the options, which are being changed by my script:
sip set reg_id 1 123 //this changes the extension id
sip set reg_pwd 1 password //this changes the password for the extension
sip set tel_num 1 123 //this changes the extension number
sip set tel_name 1 John Doe //this changes the name, that shows up on the phone display
When the user/extension is already in use in another phone, my script automatically connects to that phone and changes the user/extension to a dummy account. The script grabs the IP of that phone from the sip show peers command.
When I now run the sip show peers command in my CLI, the old data is still present and the IP of my user/extension did not change.
Is this cached information or is there something wrong?
My problem is when I change the user/extension and then change it back to the original profile, the information I grab from sip show peers is not up to date and therefore I can not grab the correct IP of the phone.
Can you somehow refresh this information or is there even a better way to get the current IP of a phone?
Will sip reload maybe do the job? I don’t want to risk kicking out my users so I did not try to run it yet.
Sorry for the long explanation, I tried to make it as detailed as possible and I hope you didn’t fall asleep while reading.