Summary: | ASTERISK-20093: sip show field "Def. Username:" displays incorrect value after config file change and asterisk reload while device still registered | ||||
Reporter: | Sean Allison (cakerack) | Labels: | |||
Date Opened: | 2012-07-05 03:39:56 | Date Closed: | |||
Priority: | Minor | Regression? | |||
Status: | Open/New | Components: | Channels/chan_sip/General | ||
Versions: | Frequency of Occurrence | Constant | |||
Related Issues: |
| ||||
Environment: | OS is Centos 5.5 and Centos 6.2 | Attachments: | |||
Description: | Hi - I found the same issue from last year (ASTERISK-17821) which was closed as it couldn't be reproduced, but I now think I have reproduced it. I am running several flavours of Asterisk (mainly 1.8.x.and 10.x) and it happens in both of them. Firstly I set up a new client: [0001] type=friend host=dynamic defaultuser=Bob secret=123456 context=phones callerid=Bob <0001> call-limit=10 qualify=yes I now do a reload and a 'sip show peer 0001' and I get the following: * Name : 0001 Secret : <Set> ... Callerid : "Bob" <0001> ... Addr->IP : (null) ... Def. Username: Bob ... I now edit sip.conf and change 'Bob' to 'John' as follows: [0001] type=friend host=dynamic defaultuser=John secret=123456 context=phones callerid=John <0001> call-limit=10 qualify=yes I now reload asterisk and 'sip show peer 0001' and I get: * Name : 0001 Secret : <Set> ... Callerid : "John" <0001> ... Addr->IP : (null) ... Def. Username: John ... So far, so good. However, this is all assuming you don't actually have a SIP client registered against this client. So now, connect a SIP device and get it to register using this account, and now do a 'sip show peer 0001' and you will get: * Name : 0001 Secret : <Set> ... Callerid : "John" <0001> ... Addr->IP : 172.16.20.189:5060 ... Def. Username: John ... So again, all is OK. Now, leaving the device registered, edit your sip.conf back to the original "Bob" settings as follows: [0001] type=friend host=dynamic defaultuser=Bob secret=123456 context=phones callerid=Bob <0001> call-limit=10 qualify=yes Reload Asterisk and do a 'sip show peer 0001' and you get: * Name : 0001 Secret : <Set> ... Callerid : "Bob" <0001> ... Addr->IP : 172.16.20.189:5060 ... Def. Username: John ... So... even though your sip.conf has the defaultuser set to 'Bob', the 'sip show peer 0001' doesn't reflect this. Also do a 'sip show peers' and this will also be incorrect as follows: Name/username Host Dyn Forcerport ACL Port Status 0001/John 172.16.20.189 D 5060 OK (10 ms) To get around this, if you de-register your SIP device from Asterisk and then do a reload, this seems to fix it. Note - you can't just switch your device off, as the 'sip show peers' command will show your device as unreachable, as follows: Name/username Host Dyn Forcerport ACL Port Status 0001/John 172.16.20.189 D 5060 UNREACHABLE This might time out eventually, but the quick way is if you properly de-register your session you will get the following (I did this in an SPA504G by selecting Menu option 13 - reboot): Name/username Host Dyn Forcerport ACL Port Status 0001/John (Unspecified) D 5060 UNKNOWN You will also get the following on the Asterisk console: -- Unregistered SIP '0001' Now do an asterisk reload and you should find a 'sip show peer 0001' will give you: * Name : 0001 Secret : <Set> ... Callerid : "Bob" <0001> ... Addr->IP : 172.16.20.189:5060 ... Def. Username: Bob ... ... and... Name/username Host Dyn Forcerport ACL Port Status 0001/Bob (Unspecified) D 5060 UNKNOWN Maybe someone could confirm this as either a bug or by design? Cheers Sean | ||||
Comments: | By: Sean Allison (cakerack) 2012-07-05 03:50:09.421-0500 Two more snippets of information which may be of use: 1) I have found you can unregister a client by doing a 'sip unregister 0001' command rather than mucking about with rebooting phones etc. 2) You will need to make a change to sip.conf every time you reload it or else Asterisk will ignore it if it hasnt changed since the last reload. Cheers Sean |