aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--channels/chan_sip.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index 827728514..06f5943fa 100644
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -8456,10 +8456,8 @@ static enum parse_register_result parse_register_contact(struct sip_pvt *pvt, st
/* Save SIP options profile */
peer->sipoptions = pvt->sipoptions;
- if (!ast_strlen_zero(curi)) /* Overwrite the default username from config at registration */
+ if (!ast_strlen_zero(curi) && ast_strlen_zero(peer->username))
ast_copy_string(peer->username, curi, sizeof(peer->username));
- else
- peer->username[0] = '\0';
if (peer->expire > -1) {
ast_sched_del(sched, peer->expire);