But for the second one I totally agree it can make the code a little bit cleaner, but you can do it like I did:
var byeOptions: SessionByeOptions = {
requestOptions: {
extraHeaders: ['Reason: Q.850;cause=666;text="SOME_REASON"']
}
};
session.bye(byeOptions);
So I would suggest to add the following for BYE:
- reasonCauseCode
- reasonPhrase
So that way you can manipulate both.
Your PBX will be able to recognize the reason of the disconnect with the above syntax. It worked for me with FreeSWITCH.