Koozali.org: home of the SME Server

Amateurish logic on extension change

Offline glenm201

  • *
  • 7
  • +0/-0
Amateurish logic on extension change
« 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!
« Last Edit: September 02, 2010, 07:29:23 PM by glenm201 »

Offline SARK devs

  • *****
  • 2,806
  • +1/-0
    • http://sarkpbx.com
Re: Amateurish logic on extension change
« Reply #1 on: September 02, 2010, 07:22:42 PM »
So what should it do when you make an extension change?

Kind Regards

S


Offline glenm201

  • *
  • 7
  • +0/-0
Re: Amateurish logic on extension change
« Reply #2 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

Offline SARK devs

  • *****
  • 2,806
  • +1/-0
    • http://sarkpbx.com
Re: Amateurish logic on extension change
« Reply #3 on: September 02, 2010, 09:09:42 PM »


Thanks,  we'll put it on the list.

Kind Regards

S