]> git.ipfire.org Git - thirdparty/asterisk.git/commit
pbx.c: Fix handling of '-' in extension name and callerid 53/3353/6
authorCorey Farrell <git@cfware.com>
Tue, 26 Jul 2016 22:42:50 +0000 (18:42 -0400)
committerCorey Farrell <git@cfware.com>
Fri, 29 Jul 2016 00:00:20 +0000 (20:00 -0400)
commitf0e8af0487fcdef907eee861a3e1f11fec83be19
tree011917428a73478a7293851a7f8ac11c2efbc884
parent6e2976002d8b7d22e232a760d82cfc7d52727ec7
pbx.c: Fix handling of '-' in extension name and callerid

This adds a two strings to ast_exten.  name to go with exten and
cidmatch_display to go with cidmatch.  The new fields contain input used
to add the extension in the first place.  The existing fields now
contain stripped input that excludes insignificant spaces and dashes.
These stripped fields should always be used for comparisons.  The
unstripped fields should normally be used for display, but displaying
stripped values will not cause runtime errors.

Note the actual string is only stored twice if it contains dashes.  If
no dashes are found then both 'char *' fields point to the same memory.
So this change has a minimum effect on memory usage.

The existing functions ast_get_extension_name and
ast_get_extension_cidmatch return unstripped values as they did before
this change.  Other similar bugs likely still exist where unstripped
extensions are saved outside pbx.c then passed back in.

ASTERISK-26233 #close

Change-Id: I6cd61ce57acc1570ca6cc14960c4c3b0a9eb837f
main/pbx.c