-
-
Notifications
You must be signed in to change notification settings - Fork 42
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Basic server code isn't running #55
Comments
A side note: with recent Node.js and If you are using the server-mode of ESL (as in this example) you need to have FreeSwitch send calls to your Node.js application on port 7000. The most efficient way to do this is to use
in your SIP profile's Another way is to use the FreeSwitch dialplan and insert something along the lines of
|
@shimaore thanks for the reply! I know the FreeSwitch part but have issues with the above nodejs example where it doesn't work. Do you have simple server code I can try to bridge an incoming call by making an outgoing call? |
If I take the code you were referring to, an up-to-date implementation would look like this: const call_handler = async () => {
const caller = this.data['Channel-Caller-ID-Number']
const callee = this.data['Channel-Destination-Number']
const new_caller = await db.getAsync(`new_caller_for_${caller}`)
await this.command('answer')
await this.command('play-file', 'voicemail/vm-hello')
await this.command('set', `effective_caller_id_number=${new_caller}`)
await this.command('bridge', `sofia/egress/${callee}@example.net`)
};
require('esl').server(call_handler).listen(7000) |
Trying the following basic server code to answer a call and bridge to a new call. But cannot seem to work?
I am newbie to nodejs so not sure how to build a simple server to bridge an incoming call by making an out going call?
Do you have an example code for such basic server use-case?
The text was updated successfully, but these errors were encountered: