Author Topic: Play the file after the call  (Read 14757 times)

parti3an

  • Newbie
  • *
  • Posts: 6
    • View Profile
Play the file after the call
« on: January 05, 2015, 02:10:27 AM »
Hi, all!

User A calls B.
After completing the call B, A to play a file.

Tried to do so but the file does not play:

[extra]
chan.disconnected = 20

[chan.disconnected]
^.*$=wave/play//home/test/test.g729

[contexts]

[default]
${rtp_forward}^.*=;rtp_forward=no
\(.*\)$=sip/sip:\0@1.1.1.1

How can this be done?
Thank you very much for your help.

Monica Tepelus

  • Administrator
  • Full Member
  • *****
  • Posts: 198
    • View Profile
Re: Play the file after the call
« Reply #1 on: January 05, 2015, 05:48:10 AM »
Hi,

Try doing this from a php/javascript global script or from a javascript routing script. You have better control over your parameters.

In a global script catch chan.disconnected and send a call.execute inside chan.masquerade on behalf of the chan A

An example in php:
$m = new Yate("chan.masquerade");
$m->params["message"] = "call.execute";
$m->params["id"] = "id_chan_A";
$m->params["callto"] = "wave/play//home/test/test.g729";
$m->Dispatch();

parti3an

  • Newbie
  • *
  • Posts: 6
    • View Profile
Re: Play the file after the call
« Reply #2 on: January 06, 2015, 11:14:28 AM »
Hi,

I have formed here is the query in Yate:

Returned false 'chan.masquerade' delay=0.046953
  thread=0x7efee8040ea0 'Engine Worker'
  data=0x7efee8020600
  retval='66666666666666666666666666666666'
  param['cause_sip'] = '200'
  param['reason_sip'] = 'OK'
  param['rtp_stats'] = 'PS=39,OS=1170,PR=64,OR=1280,PL=0'
  param['sip_user-agent'] = 'Digilinea'
  param['sip_x-asterisk-hangupcause'] = 'Normal Clearing'
  param['sip_x-asterisk-hangupcausecode'] = '16'
  param['id'] = 'sip/92'
  param['module'] = 'sip'
  param['status'] = 'answered'
  param['address'] = '1.1.1.1:5064'
  param['targetid'] = 'sip/93'
  param['billid'] = '1420531230-60'
  param['lastpeerid'] = 'sip/93'
  param['answered'] = 'true'
  param['direction'] = 'incoming'
  param['domain'] = '2.2.2.2'
  param['callid'] = 'sip/989ff44c-5fd63660@192.168.1.2/d8acbb5cdd119a90o3/2016253436'
  param['message'] = 'call.execute'
  param['callto'] = 'wave/play//home/test/test.g729

But nothing happens, you can still tell what is. Thank U.

Monica Tepelus

  • Administrator
  • Full Member
  • *****
  • Posts: 198
    • View Profile
Re: Play the file after the call
« Reply #3 on: January 07, 2015, 03:59:21 AM »
I need a complete log to see what is happening. You might have sent this too late or for the wrong channel id. Post a longer sniffer log. One that contains both chan.disconnected messages.

parti3an

  • Newbie
  • *
  • Posts: 6
    • View Profile
Re: Play the file after the call
« Reply #4 on: January 09, 2015, 09:21:03 AM »
Thank you very much for your help.
Figured out how it should work.

arsenieciprian

  • Newbie
  • *
  • Posts: 1
    • View Profile
Re: Play the file after the call
« Reply #5 on: May 02, 2015, 03:33:25 AM »
I want to do the same but from regexroute and i want when a number hang up the b number to remain with tone on the phone and wait forever until decide to hangup

asymetrixs

  • Administrator
  • Newbie
  • *****
  • Posts: 47
    • View Profile
Re: Play the file after the call
« Reply #6 on: June 04, 2015, 04:32:21 AM »
Thank you very much for your help.
Figured out how it should work.

parti3an, please provide your solution here so that others can benefit as well, thanks.