I managed to fix the issue, so here is how the debugging went -
- started asterisk CLI using asterisk -rvvv
- used a CLI originate command
channel originate SIP/1000 extension 2000@from-internal
- step 2 showed an error on the extension being busy (error 486 to be specific).
- googled error to find out that the extension 1000 is being used by a hard phone and that can cause issues
changed the manager extension to 2000 in manager.conf and tried making the call using
channel originate SIP/2000 extension 1000@from-internal
step 5 worked, but calls from PHP still failed. added debugging to find that the AMI was returning a permission denied
- found out that from 1.6 onwards you need to have originate in the manager.conf read/write options
Now it works perfectly fine. Hope this helps someone, though I think this case might be a very personalized issue.