[Asterisk-Dev] DID suffix matching, was 1.2 Feature freeze.
Harald Milz
hm at seneca.muc.de
Wed Jul 13 16:04:18 MST 2005
Steven <critch at basesys.com> wrote:
> I guess the official way would to do proper matching in the dialplan
> such as
> exten => 01234-567891,1,do something fo exact match
> exten => _01234-567891.,1, or something similar to match base + extra
> exten => _01234-567891.,2,set a var to the extra portion with a
> substring
I tried that. But -
when sip.conf has
[general]
context=from-sipgate
...
register => XXXXXXX:YYYYYY at sipgate.de
then I can only match the "s" extension in this context, like
[from-sipgate]
exten => s,1,...
right? In the "s" extension, $EXTEN is always "s" hence of no value. If
it's
register => XXXXXXX:YYYYYY at sipgate.de/goobledigook
then I can only match the "goobledigook" (or whatever string is used in
"register") extension, like
[from-sipgate]
exten => goobledigook,1,...
but not something like
[from-sipgate]
exten => _012345678911[1-8],1,Dial(Zap/g1/${EXTEN:11},30,r)
in either case ("s" or something else).
How would I register in order to be able to use the third example? All the
dialplan examples I've seen so far use the "s" extension for incoming
SIP calls, so they only know _that_ they were called but not _how_
they were called, which is fine as long as you don't want to determine
suffixed numbers. I can't see any way to get the number I was called
with from the "s" (or another arbitrary) extension.
With my CALLEDNUM patch, this basically reads
[from-sipgate]
exten => s,1,Goto(to-isdn,${CALLEDNUM:11},1)
while CALLEDNUM contains the string after "sip:" in the SIP header.
So if somebody could give me a working example of a sip.conf
(i.e. register line) and extensions.conf which does determine the incoming
called number I'd be very thankful.
--
It's odd, and a little unsettling, to reflect upon the fact that
English is the only major language in which "I" is capitalized; in many
other languages "You" is capitalized and the "i" is lower case.
-- Sydney J. Harris
More information about the asterisk-dev
mailing list