Is your feature request related to a problem? Please describe.
stir_shaken use parse_uri functions to get user part from "From" and "To" addresses.
The problem is user-part may contain parameters (like for RFC4904), and so, what is considered as number is not, and stir_shaken_verify fails if dest_tn or orig_tn are not manually provided.
Describe the solution you'd like
Remove parameters from user part extracted from "From / To" headers before using it, bypassing need of providing cleaned numbers from script.
Implementation
Adding a cleaning in stir_shaken.c module
Describe alternatives you've considered
Cleaning From/To from opensips.cfg script
Below a simple patch proposal for stir_shaken.c
--- /old/stir_shaken.c 2026-05-20 12:15:13.000000000 +0000
+++ /new/stir_shaken.c 2026-06-03 12:04:35.089478482 +0000
@@ -830,6 +830,14 @@
}
*orig_tn = parsed_uri.user;
-
/* strip RFC 4904 user parameters (tgrp, trunk-context, ...) that may
-
- appear as semicolon-separated fields within the userinfo part of the
-
- URI (before '@'). parse_uri() returns the full userinfo in .user,
-
- so "+33123456789;tgrp=...;trunk-context=..." would otherwise fail the
-
-
char *semi = memchr(orig_tn->s, ';', orig_tn->len);
-
if (semi)
-
orig_tn->len = semi - orig_tn->s;
return 0;
}
@@ -861,6 +869,10 @@
}
*dest_tn = parsed_uri.user;
-
/* strip RFC 4904 user parameters (tgrp, trunk-context, ...) */
-
char *semi = memchr(dest_tn->s, ';', dest_tn->len);
-
if (semi)
-
dest_tn->len = semi - dest_tn->s;
return 0;
}
Is your feature request related to a problem? Please describe.
stir_shaken use parse_uri functions to get user part from "From" and "To" addresses.
The problem is user-part may contain parameters (like for RFC4904), and so, what is considered as number is not, and stir_shaken_verify fails if dest_tn or orig_tn are not manually provided.
Describe the solution you'd like
Remove parameters from user part extracted from "From / To" headers before using it, bypassing need of providing cleaned numbers from script.
Implementation
Adding a cleaning in stir_shaken.c module
Describe alternatives you've considered
Cleaning From/To from opensips.cfg script
Below a simple patch proposal for stir_shaken.c
--- /old/stir_shaken.c 2026-05-20 12:15:13.000000000 +0000
+++ /new/stir_shaken.c 2026-06-03 12:04:35.089478482 +0000
@@ -830,6 +830,14 @@
}
/* strip RFC 4904 user parameters (tgrp, trunk-context, ...) that may
char *semi = memchr(orig_tn->s, ';', orig_tn->len);
if (semi)
return 0;
}
@@ -861,6 +869,10 @@
}
*dest_tn = parsed_uri.user;
/* strip RFC 4904 user parameters (tgrp, trunk-context, ...) */
char *semi = memchr(dest_tn->s, ';', dest_tn->len);
if (semi)
return 0;
}