Koozali.org: home of the SME Server

Obsolete Releases => SME VoIP (Asterisk, SAIL etc) => Topic started by: glenm201 on September 02, 2010, 05:37:15 AM

Title: Amateurish logic on extension change
Post by: glenm201 on September 02, 2010, 05:37:15 AM
Wow, I never thought I'd see programmed logic like this in a published program:

If you change a defined extension, apparently the code searches for all string occurrences of your old extension in the asterisk definition and just blindly changes the string to the new extension!

Here's what I mean:

Before:

[110]
type=friend
username=ext110
secret=xxxx1101
host=dynamic
qualify=3000
context=internal
callerid="ext110" <110>
canreinvite=no
mailbox=110
pickupgroup=1
callgroup=1
call-limit=99
subscribecontext=extensions
deny=0.0.0.0/0.0.0.0
permit=192.168.110.200/255.255.255.0
disallow=all
allow=alaw
allow=ulaw


After:

[210]
type=friend
username=ext210
secret=xxx2101
host=dynamic
qualify=3000
context=internal
callerid="ext210" <210>
canreinvite=no
mailbox=210
pickupgroup=1
callgroup=1
call-limit=99
subscribecontext=extensions
deny=0.0.0.0/0.0.0.0
permit=192.168.210.200/255.255.255.0
disallow=all
allow=alaw
allow=ulaw

Note that the secret= and permit= which happened to have 110 in them changed to 210

Ugh!
Title: Re: Amateurish logic on extension change
Post by: SARK devs on September 02, 2010, 07:22:42 PM
So what should it do when you make an extension change?

Kind Regards

S

Title: Re: Amateurish logic on extension change
Post by: glenm201 on September 02, 2010, 07:37:45 PM
So what should it do when you make an extension change?

Kind Regards

S

Well, for one thing, I'd parse the input. Look for

username=ext*
callerid="ext*" <*>
mailbox=*


--glen
Title: Re: Amateurish logic on extension change
Post by: SARK devs on September 02, 2010, 09:09:42 PM


Thanks,  we'll put it on the list.

Kind Regards

S