Outbound call to any number using node.js and Freeswitch

112 views Asked by At

I have been trying to initiate a call using node.js with modesl and freeswitch. I also have created a gateway at the freeswitch server. This is my code details: const callerNumber = "1122334455"; // dummy number const destinationNumber = "1122334455"; // dummy number

const dialString = sofia/gateway/gateway-name/+1${callerNumber} &bridge(sofia/gateway/gateway-name/+1${destinationNumber}); connection.api("originate", dialString);

I do not have any freeswitch connection errors, so I just have provided only small part of code. I will provide the rest of the code as well if needed.

Each time I run the code the connection is made and I receive logs in fs_cli. But there is this error for the caller number: 2023-10-24 10:55:18.108202 [DEBUG] sofia.c:7084 Channel sofia/external/+11122334455 entering state [terminated][400] 2023-10-24 10:55:18.108202 [NOTICE] sofia.c:8273 Hangup sofia/external/+11223344556 [CS_CONSUME_MEDIA] [NORMAL_TEMPORARY_FAILURE]

2023-10-24 10:55:18.128202 [DEBUG] switch_ivr_originate.c:3848 Originate Resulted in Error Cause: 41 [NORMAL_TEMPORARY_FAILURE]

I am able to generate call to an extension and to my softphone through this code, except for the caller number which is everytime 0000000000: const dialString = sofia/internal/101@domain; connection.api("originate", ${dialString} &execute_on_answer==hangup_call ${callUUID});

Now I want to make call form one number to any other number. The caller number should be displayed to the receiver. Any idea about the solution will be very helpful.

0

There are 0 answers