TIPS Issue with 'Default' Ext 701

CTSFO

New Member
Joined
Jan 2, 2021
Messages
19
Reaction score
4
Hi All,

I have done a fresh install on my dev environment (not connecting SIP Trunks yet) and have never been able to use an out-of-the-box extension 701.

From Terminal, I issue command:
/root/show-passwords

(This is the output - NB - these are not my REAL passwords!!!)

[701]
c250hf8snskcnlsdnfa24413b20819ea3544d

[702]
secret=71413sdfnsd09sd2993uncl113b20819e


701 is pjSIP
702 is SIP


All devices (soft phone and hard phones), will NOT connect to 701 - if I select 701 and use everything AFTER 'Secret=' - 702 works.


In the log file I see:
[2021-01-18 14:59:55] NOTICE[1094] chan_sip.c: Registration from '<sip:[email protected]>' failed for '<IP address>: PORT' - Wrong password


My questions are:

Why on a fresh build, does 'Secret=' not show on 701, but does show on 702-705?

Any ideas where I need to look to get 701 working on a fresh build? From a troubleshooting point of view, I have tried two physical devices and two soft phones.

Thanks!
 
Because 701 is a PJsip extension. Be sure to register extensions to UDP 5061 for extension 701.
 
So where an extension is PJsip, then we won't see "Secret=" at the beginning... Is this statement correct @wardmundy

I have double checked the settings on the soft phone and hard phone.

Are there any known issues using LinPhone on iOS for PJsip that you have seen before (I know I will have missed something really simple my end!)
 
where an extension is PJsip, then we won't see "Secret=" at the beginning... Is this statement correct
Well if you read the /root/show-passwords you will note that this command is only a script that gets the passwords from the fpbx config files and databases. To check the code you could have a look at
Code:
cat /root/show-passwords

In the case of 701 that script looks at the file and fetched the password from there.
'/701]/,$p' /etc/asterisk/sip_additional.conf ## Do NOT edit this file as it is auto-generated by FreePBX. ##

When I look at my /etc/asterisk/sip_additional.conf (##Do NOT edit this file as it is auto-generated by FreePBX.##) , I find I have no entry for [701] and I also do have the ext 701 registering as pjsip as @wardmundy comment ( to port 5061 ).
I hadn't tried the /root/show-passwords since the initial setup, and I altered 701 to pjsip subsequently. - so this was news to me too.

For my pjsip endpoints the config is found in file /etc/asterisk/pjsip.endpoint.conf (##Do NOT edit this file as it is auto-generated by FreePBX.##) but the 'secret' for 701 is not there so probably encrypted somewhere else, however the place to look at the 701 'secret' would be in the fPBX GUI ? Look in
Applications/Extensions
- edit ext. 701 in general tab - see 'Secret' hover over the password to view.

I think that as far as @wardmundy is concerned he and the team have provided a 'product' with 5 preconfigured Channel_SIP extensions, and have provided a quick (and dirty) linux script to get the passwords for you for the sip extensions. All in all that is a very useful contribution for the incredible product.

Hope that helps
 
Last edited:
Applications/Extensions
- edit ext. 701 in general tab - see 'Secret' hover over the password to view.
It also takes about 2 seconds to change the password on extension 701 to something you know. I would always go to the extension and check the password and not rely on a script.
 
You could add the following line to the script to get the current 701 password:
Code:
mysql -N  -u root -ppassw0rd asterisk -e "select id,data from sip where id = '701' and keyword = 'secret'"
 
change the password on extension 701 to something you know
Subject to the rider that for security of your $bucks you should always make a very secure password. The auto generated ones are clearly more secure.
 
Here's the new show-passwords script in the latest Incredible PBX 2021 release:
Code:
#!/bin/bash

echo "SIP EXTENSION PASSWORDS:"
mysql -u root -ppassw0rd asterisk -e "SELECT data from sip where ID = 701 and keyword = 'secret' limit 1;" | sed 's|data|[701]|'
sed -n -e '/702]/,$p' /etc/asterisk/sip_additional.conf | head -n +3 | sed '/deny/d'
sed -n -e '/703]/,$p' /etc/asterisk/sip_additional.conf | head -n +3 | sed '/deny/d'
sed -n -e '/704]/,$p' /etc/asterisk/sip_additional.conf | head -n +3 | sed '/deny/d'
sed -n -e '/705]/,$p' /etc/asterisk/sip_additional.conf | head -n +3 | sed '/deny/d'
echo " "
echo "SIP EXTENSION VOICEMAIL PINS (dial *98EXT to configure):"
sed -n '/default/,$p' /etc/asterisk/voicemail.conf | sed 's|\[default]|EXT=PIN\n--- ---|' | cut -f 1 -d "," | sed '1,/myaliases/!d' | head -n -1
echo "CONFERENCE PINS FOR EXTENSION 2663 (dial C-O-N-F):"
asterisk -rx "database showkey CONFERENCE/2663/userpin"  | head -n 1
asterisk -rx "database showkey CONFERENCE/2663/adminpin" | head -n 1
echo " "
echo "TELEPHONE REMINDERS PASSWORD (dial 123 to schedule a reminder):"
grep Authenticate /etc/asterisk/extensions_custom.conf | cut -f 3 -d ","
echo " "
echo "ANVEO DIRECT OUTBOUND CALL PIN (6 alphanumeric characters starting with 0):"
grep "OUT_15 " /etc/asterisk/extensions_additional.conf | cut -f 2 -d "/" | cut -f 1 -d "$" | sed 's|anveo-pin|not yet configured|'
echo " "
 
mysql -u root -ppassw0rd asterisk -e "SELECT data from sip where ID = 701 and keyword = 'secret' limit 1;" | sed 's|data|[701]|'
Try this for the Extension Passwords (all)
Code:
#!/bin/bash
echo "SIP EXTENSION PASSWORDS:"
## echo 'FROM mysql'
mysql -u root -ppassw0rd asterisk -e "SELECT data from sip where ID = 701 and keyword = 'secret' limit 1;" |tr -d '\n' |sed 's|data|[701]?secret=|' |sed 's/$/\n/' |sed 's/?/\n/'
mysql -u root -ppassw0rd asterisk -e "SELECT data from sip where ID = 702 and keyword = 'secret' limit 1;" |tr -d '\n' |sed 's|data|[702]?secret=|' |sed 's/$/\n/' |sed 's/?/\n/'
mysql -u root -ppassw0rd asterisk -e "SELECT data from sip where ID = 703 and keyword = 'secret' limit 1;" |tr -d '\n' |sed 's|data|[703]?secret=|' |sed 's/$/\n/' |sed 's/?/\n/'
mysql -u root -ppassw0rd asterisk -e "SELECT data from sip where ID = 704 and keyword = 'secret' limit 1;" |tr -d '\n' |sed 's|data|[704]?secret=|' |sed 's/$/\n/' |sed 's/?/\n/'
mysql -u root -ppassw0rd asterisk -e "SELECT data from sip where ID = 705 and keyword = 'secret' limit 1;" |tr -d '\n' |sed 's|data|[705]?secret=|' |sed 's/$/\n/' |sed 's/?/\n/'
echo " "

This works on iPBX2020.3 Raspbian10Buster Asterisk 16.13.0 for RPi(3)b tested by inserting into the script ' ~/show-passwords '
 
Last edited:
Thats cool - yes, I agree that passwords are simple to change. Im just looking at this as someone who has come back into the fold after a (blush) 13+ year absence...

I just cant work out why 701 never wants to play ball with me.

Just easier keeping one thing per thread for ease of tracking :)
 
Thanks @wardmundy - sometimes the simplest things are missed. Seeing this has just answered about 6 other questions!

Im going to update this to show me my 301-399 extension range :)



Here's the new show-passwords script in the latest Incredible PBX 2021 release:
Code:
#!/bin/bash

echo "SIP EXTENSION PASSWORDS:"
mysql -u root -ppassw0rd asterisk -e "SELECT data from sip where ID = 701 and keyword = 'secret' limit 1;" | sed 's|data|[701]|'
sed -n -e '/702]/,$p' /etc/asterisk/sip_additional.conf | head -n +3 | sed '/deny/d'
sed -n -e '/703]/,$p' /etc/asterisk/sip_additional.conf | head -n +3 | sed '/deny/d'
sed -n -e '/704]/,$p' /etc/asterisk/sip_additional.conf | head -n +3 | sed '/deny/d'
sed -n -e '/705]/,$p' /etc/asterisk/sip_additional.conf | head -n +3 | sed '/deny/d'
echo " "
echo "SIP EXTENSION VOICEMAIL PINS (dial *98EXT to configure):"
sed -n '/default/,$p' /etc/asterisk/voicemail.conf | sed 's|\[default]|EXT=PIN\n--- ---|' | cut -f 1 -d "," | sed '1,/myaliases/!d' | head -n -1
echo "CONFERENCE PINS FOR EXTENSION 2663 (dial C-O-N-F):"
asterisk -rx "database showkey CONFERENCE/2663/userpin"  | head -n 1
asterisk -rx "database showkey CONFERENCE/2663/adminpin" | head -n 1
echo " "
echo "TELEPHONE REMINDERS PASSWORD (dial 123 to schedule a reminder):"
grep Authenticate /etc/asterisk/extensions_custom.conf | cut -f 3 -d ","
echo " "
echo "ANVEO DIRECT OUTBOUND CALL PIN (6 alphanumeric characters starting with 0):"
grep "OUT_15 " /etc/asterisk/extensions_additional.conf | cut -f 2 -d "/" | cut -f 1 -d "$" | sed 's|anveo-pin|not yet configured|'
echo " "
 
@wardmundy
I just edited the 'show-password' script to prompt for start, and end range for extensions. Also just made it check the mysql database, as the /etc/asterisk/sip_additional.conf gets generated from it on changes anyways. the default values are the ones that Incredible PBX comes with.

Bash:
#!/bin/bash
startext=701
endext=705
read -e -i "$startext" -p "Please enter starting Extension: " input
startext="${input:-$startext}"
read -e -i "$endext" -p "Please enter ending Extension: " input
endext="${input:-$endext}"

echo "SIP EXTENSION PASSWORDS:"
for i in $(eval "echo {$startext..$endext}"); do
    mysql -u root -ppassw0rd asterisk -e "SELECT data from sip where ID = $i and keyword = 'secret' limit 1;" | sed "s|data|[$i]|"
done
echo " "

echo "SIP EXTENSION VOICEMAIL PINS (dial *98EXT to configure):"
echo -e "EXT=PIN\n--- ---"
sed -n '/default/,$p' /etc/asterisk/voicemail.conf | sed 's|\[default]||' | cut -f 1 -d "," | sed -e '1,/myaliases/!d' -e '/^$/d' | head -n -1 | sort
echo " "

echo "CONFERENCE PINS FOR EXTENSION 2663 (dial C-O-N-F):"
asterisk -rx "database showkey CONFERENCE/2663/userpin"  | head -n 1
asterisk -rx "database showkey CONFERENCE/2663/adminpin" | head -n 1
echo " "

echo "TELEPHONE REMINDERS PASSWORD (dial 123 to schedule a reminder):"
grep Authenticate /etc/asterisk/extensions_custom.conf | cut -f 3 -d ","
echo " "

echo "ANVEO DIRECT OUTBOUND CALL PIN (6 alphanumeric characters starting with 0):"
grep "OUT_15 " /etc/asterisk/extensions_additional.conf | cut -f 2 -d "/" | cut -f 1 -d "$" | sed 's|anveo-pin|not yet configured|'
echo " "

Edit: Voicemail pin's are now sorted by extension
 
Last edited:

Members online

No members online now.

Forum statistics

Threads
26,687
Messages
174,410
Members
20,257
Latest member
Dempan
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.
Back
Top