Author Topic: No Ringtone Custom Queue In Handle  (Read 1877 times)

ganapathi

  • Jr. Member
  • **
  • Posts: 78
    • View Profile
Re: No Ringtone Custom Queue In Handle
« Reply #15 on: October 24, 2018, 06:12:09 AM »
Thanks a lot.  Got it

ganapathi

  • Jr. Member
  • **
  • Posts: 78
    • View Profile
Re: No Ringtone Custom Queue In Handle
« Reply #16 on: November 01, 2018, 12:32:59 PM »

To play ring you must use chan.attach to set tone source in desired call leg (in queue chan).

QueueInChannel* c = new QueueInChannel(dest,msg,false);
c->initChan();
DO_SETUP (attach tone source) ...


Like this ?.

Code: [Select]
Message m("chan.attach");
m->addParam("id",c->id());
m->addparam("source","tone/ring");
Engine::dispatch(m);

or

Code: [Select]
Message m("chan.masquerde");
m->addParam("message","chan.attach");
m->addParam("id",c->id());
m->addparam("source","tone/ring");
Engine::dispatch(m);

or any other way. Mentioned both looks not working for me..

marian

  • Hero Member
  • *****
  • Posts: 506
    • View Profile
Re: No Ringtone Custom Queue In Handle
« Reply #17 on: November 02, 2018, 01:07:50 AM »
Why would you want to masquerade a message when you already have the channel in hand?
chan.masquerade will be handled by your Driver anyway.
Don't forget to put channel in message's user data.

ganapathi

  • Jr. Member
  • **
  • Posts: 78
    • View Profile
Re: No Ringtone Custom Queue In Handle
« Reply #18 on: November 02, 2018, 01:46:33 AM »
So this is fine ?

Code: [Select]
Message m("chan.attach");
m->addParam("id",c->id());
m->addparam("source","tone/ring");
Engine::dispatch(m);

How do i push channel in message's user data ?? - Setting peerid & targetid to current channel id rgt ?.

marian

  • Hero Member
  • *****
  • Posts: 506
    • View Profile
Re: No Ringtone Custom Queue In Handle
« Reply #19 on: November 02, 2018, 04:20:12 AM »
Please take a look at Message class API.

ganapathi

  • Jr. Member
  • **
  • Posts: 78
    • View Profile
Re: No Ringtone Custom Queue In Handle
« Reply #20 on: December 13, 2018, 02:25:38 PM »
As I seen everything looks fine but now only understand qin channel not getting hang-up once customer call got hang-up.

As I hope assigned userData properly I think. but don't know where is the mistake.

here is the code :
http://dpaste.com/1N1P73G

here is the log :
http://dpaste.com/2VWKMNE
« Last Edit: December 13, 2018, 02:55:54 PM by ganapathi »

marian

  • Hero Member
  • *****
  • Posts: 506
    • View Profile
Re: No Ringtone Custom Queue In Handle
« Reply #21 on: December 14, 2018, 12:47:22 AM »
Message* m = new Message("chan.masquerade");
....
Engine::dispatch(m);

Engine::dispatch() don't release the object.
Dispatch is assuming you need data on return!
You must delete it after dispatch or call Engine::enqueue()

ganapathi

  • Jr. Member
  • **
  • Posts: 78
    • View Profile
Re: No Ringtone Custom Queue In Handle
« Reply #22 on: December 14, 2018, 12:44:45 PM »
Thanks. Now it's hangup properly.

Where outgoing channel ringing message emitted ,Even though ringtime is not calculated properly for incoming channel. is there any missed here.

incoming channel:
param['chan'] = 'sig/1'
  param['cdrid'] = '1'
  param['runid'] = '1544733185'
  param['operation'] = 'finalize'
  param['direction'] = 'incoming'
  param['duration'] = '5.434'
  param['billtime'] = '0.000'
  param['ringtime'] = '0.000'

Outgoing channel :
  param['chan'] = 'sip/1'
  param['cdrid'] = '2'
  param['runid'] = '1544733185'
  param['operation'] = 'finalize'
  param['direction'] = 'outgoing'
  param['duration'] = '5.371'
  param['billtime'] = '0.000'
  param['ringtime'] = '5.079'

marian

  • Hero Member
  • *****
  • Posts: 506
    • View Profile
Re: No Ringtone Custom Queue In Handle
« Reply #23 on: December 18, 2018, 12:38:02 AM »
Most probably call.ringing is not forwarded on incoming call leg.