]> git.ipfire.org Git - thirdparty/asterisk.git/commit
pbx_realtime: Prevent premature extension matching 60/5060/1
authorSean Bright <sean.bright@gmail.com>
Tue, 21 Feb 2017 16:47:41 +0000 (11:47 -0500)
committerSean Bright <sean.bright@gmail.com>
Wed, 22 Feb 2017 16:22:46 +0000 (10:22 -0600)
commit78d37b9cdde1ce5fa0e5d50008112d6d6e4c1c15
tree8aa79db49eaa6f9c0b003e69967c55108688d272
parent79391f2a03fe380c4310b1c20338d93e03236174
pbx_realtime: Prevent premature extension matching

The patterns provided by pbx_realtime were checked in the order in
which they were returned from the realtime backend. If there was
overlap between multiple patterns, the first one to correctly match was
chosen even though it may not have been the best match.

We now sort the patterns descending by their length and compare in that
order. There may be cases where this still results in a sub-optimal
match, but this patch should improve the overall behavior.

ASTERISK-18271 #close
Reported by: Charlie Smurthwaite

Change-Id: I56d9ac15810eb1775966b669c3028e32cc7bd809
pbx/pbx_realtime.c