How to detect if the call is being transferred?
Hello I am working on application using Freeswitch and SIP.js in which I need to detect if the call is being transferred. The Sip.js application is actually an outbound dialer in which I load a list of phone numbers to call. The application starts by calling people. It is interesting to detect voicemail boxes. For that I am using mod_avmd. My problem is when the other end transfers the call, the sip.js client should know that the current call is being transferred. Is there a way that the original caller (sip.js client) knows that the call is being transferred? I was looking at all the channel variables and I found that the RDNIS variable and the transfer_time variable are filled up when there is a transfer. Is there a way to listen to the channel variables during the call and detect any change? Or is there a better way I can do it? Thank you for any suggestion. Anis Bedhiafi
Hi Anis, The way I do it is using ESL interface, I use it to initiate the call and monitor events, in your case you can monitor events and extract variable information, upon that take action. For example: events = "BACKGROUND_JOB " \ "DETECTED_TONE " \ "CHANNEL_OUTGOING " \ "CHANNEL_CREATE " \ "CHANNEL_ANSWER " \ "CHANNEL_PROGRESS_MEDIA " \ "RECORD_START " \ "CHANNEL_HANGUP " \ "CHAN_NOT_IMPLEMENTED " self.connection.events("plain", events) ev_name = reply.getHeader('Event-Name') Filter in the event where you get your transfer information and filter by call channel... if self.call.uuid == reply.getHeader("Channel-Call-UUID"): variable_variable_transfer_time = reply.getHeader('*variable_transfer_time*') if variable_variable_transfer_time: writedb('transfer_time', variable_variable_transfer_time) Take action like write into DB, file, etc.. Hope it helps You can ping me offline for more details. -Gonzalo On Sat, Oct 8, 2016 at 2:29 PM, Anis Bedhiafi <anis.bedhiafi@e-volut.io> wrote:
Hello
I am working on application using Freeswitch and SIP.js in which I need to detect if the call is being transferred.
The Sip.js application is actually an outbound dialer in which I load a list of phone numbers to call.
The application starts by calling people.
It is interesting to detect voicemail boxes. For that I am using mod_avmd.
My problem is when the other end transfers the call, the sip.js client should know that the current call is being transferred.
Is there a way that the original caller (sip.js client) knows that the call is being transferred?
I was looking at all the channel variables and I found that the RDNIS variable and the transfer_time variable are filled up when there is a transfer.
Is there a way to listen to the channel variables during the call and detect any change? Or is there a better way I can do it?
Thank you for any suggestion.
Anis Bedhiafi
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
Official FreeSWITCH Sites http://www.freeswitch.org http://confluence.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
Hi Gonzalo, Thank you for the reply. Yes indeed I was going this way. For this,I am using an Outbound ESL. So when I detect there is a transfer and I want to notify the original caller (the sipjs client), should I use an inbound ESL socket connection to FreeSWITCH and send a NOTIFY Packet used sendEvent() or there is a better way? Thank you so much for your help. Kind Regards, Anis ____________________________ Anis Bedhiafi Telecom Services Engineer @ Evolutio www.e-volut.io Mobile: (+216) 50 44 18 33 Email: anis.bedhiafi@e-volut.io ____________________________ On 10 October 2016 at 00:05, Gonzalo Gasca Meza <gascagonzalo@gmail.com> wrote:
Hi Anis,
The way I do it is using ESL interface, I use it to initiate the call and monitor events, in your case you can monitor events and extract variable information, upon that take action.
For example:
events = "BACKGROUND_JOB " \ "DETECTED_TONE " \ "CHANNEL_OUTGOING " \ "CHANNEL_CREATE " \ "CHANNEL_ANSWER " \ "CHANNEL_PROGRESS_MEDIA " \ "RECORD_START " \ "CHANNEL_HANGUP " \ "CHAN_NOT_IMPLEMENTED "
self.connection.events("plain", events)
ev_name = reply.getHeader('Event-Name')
Filter in the event where you get your transfer information and filter by call channel...
if self.call.uuid == reply.getHeader("Channel-Call-UUID"):
variable_variable_transfer_time = reply.getHeader('*variable_transfer_time*')
if variable_variable_transfer_time:
writedb('transfer_time', variable_variable_transfer_time)
Take action like write into DB, file, etc..
Hope it helps
You can ping me offline for more details.
-Gonzalo
On Sat, Oct 8, 2016 at 2:29 PM, Anis Bedhiafi <anis.bedhiafi@e-volut.io> wrote:
Hello
I am working on application using Freeswitch and SIP.js in which I need to detect if the call is being transferred.
The Sip.js application is actually an outbound dialer in which I load a list of phone numbers to call.
The application starts by calling people.
It is interesting to detect voicemail boxes. For that I am using mod_avmd.
My problem is when the other end transfers the call, the sip.js client should know that the current call is being transferred.
Is there a way that the original caller (sip.js client) knows that the call is being transferred?
I was looking at all the channel variables and I found that the RDNIS variable and the transfer_time variable are filled up when there is a transfer.
Is there a way to listen to the channel variables during the call and detect any change? Or is there a better way I can do it?
Thank you for any suggestion.
Anis Bedhiafi
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
Official FreeSWITCH Sites http://www.freeswitch.org http://confluence.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
Official FreeSWITCH Sites http://www.freeswitch.org http://confluence.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
Hi Anis, Gonzalo, To complete what Gonzalo has said, to subscribe to AVMD messages you will do in Perl: $con->events("plain", "CUSTOM avmd::start"); $con->events("plain", "CUSTOM avmd::stop"); $con->events("plain", "CUSTOM avmd::beep"); Please take a look into src/mod/applications/mod_avmd/scripts/ folder for complete examples. cheers, Piotr
Thank you all for your help. It is very kind of you. Now the problem is when I want the original caller (a sip client) to be notified about the transfer which I detected from the server, should I use sendEvent in ESL or there is a better way Regards On 10 Oct 2016 10:15 am, "rsyncme rsyncme" <piotrek.gregor@gmail.com> wrote:
Hi Anis, Gonzalo,
To complete what Gonzalo has said, to subscribe to AVMD messages you will do in Perl:
$con->events("plain", "CUSTOM avmd::start"); $con->events("plain", "CUSTOM avmd::stop"); $con->events("plain", "CUSTOM avmd::beep");
Please take a look into src/mod/applications/mod_avmd/scripts/ folder for complete examples.
cheers, Piotr
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
Official FreeSWITCH Sites http://www.freeswitch.org http://confluence.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
participants (3)
-
Anis Bedhiafi
-
Gonzalo Gasca Meza
-
rsyncme rsyncme