diff --git a/channels/chan_sip.c b/channels/chan_sip.c index 0a066c7dc46941c721028fda1379fa85b97a8ca5..de914872ec38361712ef923813dbac1107785de5 100644 --- a/channels/chan_sip.c +++ b/channels/chan_sip.c @@ -10609,6 +10609,8 @@ static int transmit_register(struct sip_registry *r, int sipmethod, const char * } if ((fromdomain = strchr(r->username, '@'))) { + /* the domain name is just behind '@' */ + fromdomain++ ; /* We have a domain in the username for registration */ snprintf(from, sizeof(from), "<sip:%s>;tag=%s", r->username, p->tag); if (!ast_strlen_zero(p->theirtag)) @@ -10619,7 +10621,7 @@ static int transmit_register(struct sip_registry *r, int sipmethod, const char * /* If the registration username contains '@', then the domain should be used as the equivalent of "fromdomain" for the registration */ if (ast_strlen_zero(p->fromdomain)) { - ast_string_field_set(p, fromdomain, ++fromdomain); + ast_string_field_set(p, fromdomain, fromdomain); } } else { snprintf(from, sizeof(from), "<sip:%s@%s>;tag=%s", r->username, p->tohost, p->tag);