Created attachment 303853 [details, diff] asterisk-1.8.x-json-ebuild.patch These patches to ebuilds will add support of res_json in asterisk:
Created attachment 303855 [details, diff] asterisk-10.x-json-ebuild.patch
It is not acceptable practice to download files in the src_configure stage. Such dependencies should be in SRC_URI, as a versioned tarball with a known MD5 & SHA1 sum. You appear to be fighting the ebuild rather than working with it. Please do feel free to reopen the bug once you have addressed this feedback.