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

2010-03-16 Thread Daniel Grotti

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

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

2010-03-16 Thread Steve Murphy
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.gro...@klarya.itwrote:

  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

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

2010-03-16 Thread Daniel Grotti

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()

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.gro...@klarya.it mailto:daniel.gro...@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

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

2010-03-16 Thread Richard Kenner
 exten = test.skype/example.skype,1, NoOp(nothing)
 exten = test.skype/example.skype,n, Hangup()
 
 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.

I've been having the same problem.  I tried various escapes and couldn't
get it to work and I think there was also a length-related component to this.
I ended up doing something like:

  exten = _test.,1,Goto(some_context,${FILTER([a-z][0-z],${EXTEN})},1)

I think there's some sort of bug or misfeature here, but I gave up trying to
see exactly what it was.

-- 
_
-- 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


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

2010-03-16 Thread Tilghman Lesher
On Tuesday 16 March 2010 09:18:21 Richard Kenner wrote:
  exten = test.skype/example.skype,1, NoOp(nothing)
  exten = test.skype/example.skype,n, Hangup()
 
  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.

 I've been having the same problem.  I tried various escapes and couldn't
 get it to work and I think there was also a length-related component to
 this. I ended up doing something like:

   exten = _test.,1,Goto(some_context,${FILTER([a-z][0-z],${EXTEN})},1)

 I think there's some sort of bug or misfeature here, but I gave up trying
 to see exactly what it was.

That filter line probably does not do what you think it does.  I would suggest
checking the documentation.

-- 
Tilghman Lesher
Digium, Inc. | Senior Software Developer
twitter: Corydon76 | IRC: Corydon76-dig (Freenode)
Check us out at: www.digium.com  www.asterisk.org

-- 
_
-- 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


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

2010-03-16 Thread Richard Kenner
exten = _test.,1,Goto(some_context,${FILTER([a-z][0-z],${EXTEN})},1)
 
  I think there's some sort of bug or misfeature here, but I gave up trying
  to see exactly what it was.
 
 That filter line probably does not do what you think it does.  I would
 suggest checking the documentation.

Oops, yes, I meant:

  FILTER(a-z0-9,...
It did the trick.

-- 
_
-- 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


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

2010-03-16 Thread Steve Murphy
On Tue, Mar 16, 2010 at 7:45 AM, Daniel Grotti daniel.gro...@klarya.itwrote:

  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.gro...@klarya.itwrote:

 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
-- 
_
-- 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