Module: kamailio
Branch: master
Commit: 12c30d5606213eaf14c250e572545c3f8b37d50b
URL:
https://github.com/kamailio/kamailio/commit/12c30d5606213eaf14c250e572545c3…
Author: Dragos Vingarzan <vingarzan(a)gmail.com>
Committer: GitHub <noreply(a)github.com>
Date: 2024-07-01T13:56:02+02:00
ims_registrar_scscf: fix for location AOR with empty host (#3897)
---
Modified: src/modules/ims_registrar_scscf/lookup.c
---
Diff:
https://github.com/kamailio/kamailio/commit/12c30d5606213eaf14c250e572545c3…
Patch:
https://github.com/kamailio/kamailio/commit/12c30d5606213eaf14c250e572545c3…
---
diff --git a/src/modules/ims_registrar_scscf/lookup.c
b/src/modules/ims_registrar_scscf/lookup.c
index 99707dae0ce..6a6e7d70d4f 100644
--- a/src/modules/ims_registrar_scscf/lookup.c
+++ b/src/modules/ims_registrar_scscf/lookup.c
@@ -115,8 +115,9 @@ int lookup(struct sip_msg *_m, udomain_t *_d, char *ue_type_c)
// add user part
memcpy(aor.s + aor.len, _m->parsed_uri.user.s, _m->parsed_uri.user.len);
aor.len += _m->parsed_uri.user.len;
- // add '@'
- aor.s[aor.len++] = '@';
+ // add '@' - but only if there is a host part, else we make bad URIs like
tel:+123@
+ if(_m->parsed_uri.host.len > 0)
+ aor.s[aor.len++] = '@';
// add host part
memcpy(aor.s + aor.len, _m->parsed_uri.host.s, _m->parsed_uri.host.len);
aor.len += _m->parsed_uri.host.len;