Author Topic: Call.Route after call answered  (Read 7103 times)

ganapathi

  • Full Member
  • ***
  • Posts: 101
    • View Profile
Call.Route after call answered
« on: August 03, 2018, 01:30:02 AM »
Hi

As am initiating a outbound call through background system and i need to call sip user by using call.route method moment call got answered.

Is it possible.

Initiating Outbound :

Message* notify = new Message("call.execute");
      copyParams2(*notify, a, i);
      notify->addParam("copyparams", "cdrtrack,link");
      notify->addParam("cdrtrack", "false");
      Engine::enqueue(notify);

Call.cdr Message Handler :

if (msg.getParam(YSTRING("operation"))->c_str() == YSTRING("update") &&
         msg.getParam(YSTRING("status"))->c_str() == YSTRING("answered")) {
         Message* notify = new Message("call.route");
                        notify->copyParam(msg,"billid");
                        notify->copyParam(msg,"caller");
                        notify->copyParam(msg,"called");
      }

marian

  • Hero Member
  • *****
  • Posts: 513
    • View Profile
Re: Call.Route after call answered
« Reply #1 on: August 06, 2018, 03:27:08 AM »
call.route is not enough.
It just returns a target.

You must dispatch call.route, check result and masquerade a call.execute for the channel.

ganapathi

  • Full Member
  • ***
  • Posts: 101
    • View Profile
Re: Call.Route after call answered
« Reply #2 on: August 06, 2018, 04:28:56 AM »
call.route is for one leg is fine or both leg it's required. ?.

For Initial Outbound call am using dumb module.

Code: [Select]
"direct" : "sig/9500000";
"callto" : "dumb/";
"target" : "95000000"

So it would do the call.route and executing call.execute and calls are initiating properly.

To handle the result for this i need CDR Data as well. Is it possible to get CDR data by using billid /ID ?.

And for testing am using call.answered for result handling as call got answered or not then trying to send call.execute like below.


Code: [Select]
                                        Message* notify = new Message("chan.masquerade");
                                        notify->addParam("id", msg.getParam(YSTRING("id"))->c_str());
                                        notify->addParam("message", "call.execute");
                                        notify->copyParam(msg, "status");
                                        notify->addParam("direction","incoming");
                                        notify->addParam("callto.1","sip/sip:7007@192.168.1.41:5896");
                                        notify->addParam("callto.1.secure","no");
                                        notify->addParam("callto.1.oconnection_id","general");

ganapathi

  • Full Member
  • ***
  • Posts: 101
    • View Profile
Re: Call.Route after call answered
« Reply #3 on: August 09, 2018, 03:33:43 AM »
this would works ?

b=CDRBuilder::find(id);
b->custom_header->c_str();
« Last Edit: August 09, 2018, 04:44:17 AM by ganapathi »