rr: catch uri without host part when matching local addresses
authorDaniel-Constantin Mierla <miconda@gmail.com>
Wed, 17 Feb 2021 11:15:55 +0000 (12:15 +0100)
committerDaniel-Constantin Mierla <miconda@gmail.com>
Mon, 1 Mar 2021 17:30:33 +0000 (18:30 +0100)
- can happen for tel or urn uri

(cherry picked from commit 81cd9c5d6934392cafd4b73541a19dbfa4b553f9)

src/modules/rr/loose.c

index 0ba6ad5..9bf8388 100644 (file)
@@ -122,6 +122,11 @@ static inline int is_myself(sip_uri_t *_puri)
 {
        int ret;
 
+       if(_puri->host.len==0) {
+               /* catch uri without host (e.g., tel uri) */
+               return 0;
+       }
+
        ret = check_self(&_puri->host,
                        _puri->port_no?_puri->port_no:SIP_PORT, 0);/* match all protos*/
        if (ret < 0) return 0;