Below is from your link... If you are in the source directory of Asterisk you can do the following.
wget '
https://issues.asterisk.org/file_download.php?file_id=18023&type=bug' -O - | patch -p0
wget '
https://issues.asterisk.org/file_download.php?file_id=21979&type=bug' -O - | patch -p0
That will patch the source files.
See here...
http://www.asterisk.org/developers/patch-howto# cd /usr/src/asterisk
# patch -p0 < /path/to/thepatch
After that, you need to rebuild asterisk from the source.
BACK UP BEFORE DOING THIS.