In SIP, an R-URI Username does not have to be a numerical. As example, a hamradio callsign could be valid
So in Perl Regex (not sure if I got that right) this would look like “^HB[93][A-Z]{3}(-*\w{1-2}*)” to match valid swiss ham radio call signs optionally suffixed by a dash and up to two more characters?
exten => _HB[39]. would match too much and X,N,Z anwyays have special meanings by matching digit ranges.
On Thursday 08 January 2026 at 20:54:12, hb9eue wrote:
In SIP, an R-URI Username does not have to be a numerical. As example, a
hamradio callsign could be valid
So in Perl Regex (not sure if I got that right) this would look like
“^HB[93][A-Z]{3}(-*\w{1-2}*)” to match valid swiss ham radio call
signs optionally suffixed by a dash and up to two more characters?
exten => _HB[39]. would match too much and X,N,Z anwyays have special
meanings by matching digit ranges.
X, N and Z lose their special meaning when they are included in a range
definition (potentially as the sole character).
Therefore you could use the Asterisk pattern:
_HB[A-Z]-[0-9].
to match the letters HB followed by any letter between A and Z, followed by a
dash, a digit, and optionally anything else. I’ve taken this format from
I’m not sure where the [93] or [39] come from in your examples above.
Further details on Asterisk’s pattern matching:
It’s not as powerful or as flexible as Perl’s, but it should do what you need.
If you find examples where it doesn’t work, please tells us the pattern you’re
using, and the callsign it matches incorrectly or fails to match correctly.
Antony
–
When you find yourself arguing with an idiot,
you should first of all make sure
that the other person isn’t doing the same thing.
A swiss ham radio all sign starts with HB followed by either the digit 9 (big license) or 3 (small license) the prefix and then between 1 and 3 more non digit characters, a suffix
Like my git username, because when I created my account I was joining some ham project.
In some cases a dash and sid? service id? can be added to indicate different devices or radios, for compatibility the sid should be digit between 1 and 15 (3 bits) but nowadays, also characters are being used as this is often used as string.
On Thursday 08 January 2026 at 21:41:45, hb9eue wrote:
A swiss ham radio all sign starts with HB followed by either the digit 9
(big license) or 3 (small license) the prefix and then between 1 and 3
more non digit characters, a suffix
I’m not sure how wide your definition of “non-digit characters is”.
I assume you don’t just mean “letters”, so there must be some symbols
permitted as well, but I don’t know which ones.
The biggest problem with this definition, though, is “between 1 and 3…”
because that’s something Asterisk pattern matching can’t do.
You’ll need three separate patterns all pointing to the same end result, to
match one, or two, or three of whatever those characters are.
So, I don’t think you’re going to be able to achieve this with a single
pattern (as you could do with Perl for example), but that doesn’t mean you
can’t do it in Asterisk.
If you want some further ideas, tell me what “non-digit characters” really
means, and I’ll make some suggestions.
Antony.
–
Schrödinger’s rule of data integrity: the condition of any backup is unknown
until a restore is attempted.