Answer the question
In order to leave comments, you need to log in
How to send a voice greeting to a channel but not give a 200 SIP response until the second channel picks up the phone?
There is a complex product that uses the following scheme:
- The server is connected to a telephone provider via a standard SIP stream through authorization
- On the server itself, an asterisk is running in the host system and several virtual machines with their own telephone server and business logic.
- Depending on the target number, the asterisk in the host system determines which virtual machine to wrap the stream on.
- On the virtual machine we are interested in, there is a freeswitch that is connected via AGI to our application written in Ruby and communicating through Adhearsion.
Therefore, an incoming call goes through the following chain:
external_SIP_provider->our_server->asterisk_on_host->VPS->freeswitch->AGI->Adhearsion->Ruby
After that, according to the business logic, Ruby determines where the call should go and according to what scheme it should be implemented, and at this time the caller is played a voice greeting.
In some cases, a voice greeting is simply played and, depending on the actions of the caller, the route and purpose of the call will be selected.
The essence of the problem is that before we lose to the caller in the SIP channel, the SIP 200 code leaves, after which the operator begins to charge the call.
It is necessary: to find a solution when, when playing a voice greeting, we do not send the SIP 200 code, but at the same time, after the caller's action, we dial the second target and as soon as she picks up the phone, we send the SIP 200 command.
To begin with, it is not entirely clear on which segment of the connection and in which moment to do it.
I think that it is logical to steer at the application level through Adhearsion, but I'm not sure that he is able to steer it, at least I did not find it in the functions.
UPD .:
the problem is that the charging for an incoming call is 2 euros per minute
, and while the client listens to the greeting and takes actions, I don’t want to impose such a tariff
on
him .
Answer the question
In order to leave comments, you need to log in
What you want is called sip early media.
For example, when you call a subscriber, you play a message like "Call back later" or "Currently, the subscriber cannot receive your call" and these messages are not charged.
Your Wishlist should be supported on the side of the telecom operator or become an operator yourself.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question