[asterisk-users] DID/CID doesn't match "." (dot) in CID field

Steve Murphy murf at parsetree.com
Tue Mar 16 12:19:16 CDT 2010


On Tue, Mar 16, 2010 at 7:45 AM, Daniel Grotti <daniel.grotti at klarya.it>wrote:

>  Hi Murf,
> this is what I get from CLI if I type : "[.]" instead of ".":
>
>
> [example]
> exten => test.skype/example[.]skype,1, NoOp(nothing)
> exten => test.skype/example[.]skype,n, Hangup()
>

Daniel--

OK, I went and looked thru the source. The code doing this to your CID
number is ast_shrink_phone_number().  It gets called on your cid number
and dutifully does this:

"remove '(', ' ', ')', non-trailing '.' and '-' not in square brackets.

Because the . is not at the end of the pattern, it gets wiped by this
routine.
There seems little to do about it, as is. The call to
ast_shrink_phone_number()
is not optional or conditional. Apparently, asterisk is expecting plain
phone numbers
with stuff like (715) 693-4855, or 715.693.4855, and will remove the cruft
for you. That
it's preserving dashes inside of brackets (and brackets, too), means it is
expecting
to see patterns here.

So, I'd file a bug, and say that a dot in brackets should survive, too,
along with a
dash in brackets. ...that to limit dots in the cid pattern to the last
character is
not good behavior.

Because of this, I wonder if your CID should begin with an "_".... you'll
have to test
it out if they go and add the few lines to that routine they would need to,
to allow
dots in the pattern string. My memory is failing me and I don't have enough
time
to go playing in the source code.

murf



> CLI> show dialplan example
>
> [ Context 'example' created by 'pbx_config' ]
>   'test.skype' (CID match *'example[]skype'*) =>  1.
> NoOp(nothing)                              [pbx_config]
>                     2. Hangup()
> [pbx_config]
>
>
> As you  can see the only "." has been erased.
> There is no problem on DID ("." notations works fine), but only in CID
> field.
> I'm usign Asterisk 1.4.26.2
>
> Thanks,
>
> Daniel
>
>
>
> Il 16/03/2010 14.19, Steve Murphy ha scritto:
>
> Daniel--
>
> Haven't tried this myself, but have you tried '[.]' instead of just '.' in
> the string (as a pattern search)?
>
> So,
>
> [example]
> exten => _test[.]skype/e[x]ample[.]skype,1, NoOp(nothing)
> exten => _test[.]skype/e[x]ample[.]skype,n, Hangup()
>
> If you don't really mean the cid matching (denoted with /), you have to
> also 'escape' the '/'...
>
> and watch out for N,X,Z in the pattern, they mean something, and will have
> to be 'escaped'
> like the '.' if you want them to match literally. I can't remember how case
> is handled at the
> moment, so... just for safety, you can 'escape' the little 'x' also...
>
> murf
>
>
> On Tue, Mar 16, 2010 at 5:59 AM, Daniel Grotti <daniel.grotti at klarya.it>wrote:
>
>> Hi all,
>> using Skype for Asterisk I have the following problem.
>> In my dialplan I need to have a CID matching (example.skype) over a DID
>> (test.skype) :
>>
>> [example]
>> exten => test.skype/example.skype,1, NoOp(nothing)
>> exten => test.skype/example.skype,n, Hangup()
>>
>> Where test.skype and example.skype are Skype business account.
>> In this case, when I get a :
>>
>> CLI> show dialplan example
>>
>> I get:
>>
>> [ Context 'example' created by 'pbx_config' ]
>>   '*test.example*' (CID match '*danexample*') =>  1.
>> NoOp(nothing)                              [pbx_config]
>>                     2. Hangup()
>>                                                 [pbx_config]
>>
>>
>> As you can see, the "." (dot) is disappeared and, of course, CID matching
>> doesn't work as I aspected.
>> I've try to escape "." with something like that "\.", but nothing.
>> It seems that asterisk doesn't consider "." in DID/CID  evaluations.
>> This is an important point, because many Skype account uses "dot"
>> notation.
>>
>> It seems to work, instead, with "_" or "-".
>>
>> Any clues?
>>
>> Regards,
>>
>> Daniel
>>
>>
>>
>> --
>> _____________________________________________________________________
>> -- Bandwidth and Colocation Provided by http://www.api-digital.com --
>> New to Asterisk? Join us for a live introductory webinar every Thurs:
>>               http://www.asterisk.org/hello
>>
>> asterisk-users mailing list
>> To UNSUBSCRIBE or update options visit:
>>   http://lists.digium.com/mailman/listinfo/asterisk-users
>>
>
>
>
> --
> Steve Murphy
> ParseTree Corp
>
>
> --
> _____________________________________________________________________
> -- Bandwidth and Colocation Provided by http://www.api-digital.com --
> New to Asterisk? Join us for a live introductory webinar every Thurs:
>               http://www.asterisk.org/hello
>
> asterisk-users mailing list
> To UNSUBSCRIBE or update options visit:
>   http://lists.digium.com/mailman/listinfo/asterisk-users
>



-- 
Steve Murphy
ParseTree Corp
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20100316/d75f1b0c/attachment.htm 


More information about the asterisk-users mailing list