Yate Community Forum

General Category => Yate users hangout place => Topic started by: ganapathi on September 03, 2018, 08:07:43 AM

Title: Copy All Parameters from Handled message
Post by: ganapathi on September 03, 2018, 08:07:43 AM
Hi

i just want to copy all the parameters from dispatched message into new message, so that i can emit this message without missing any parameters.

 Message* m = new Message("call.route");
 m->copyParam(msg,"billid");
 m->copyParam(msg,"peerid");
 if (Engine::dispatch(m))
 {
  Message* notify = new Message("chan.masquerade");
  notify->addParam("id", msg.getParam(YSTRING("id"))->c_str());
  notify->addParam("message", "call.execute");
  notify->copyParams(m,notify); // Like this i need to copy all the paramaters from dispatched message to new message.
 }

By any loop or any default function available. ?

Kindly help me out
Title: Re: Copy All Parameters from Handled message
Post by: Ioana Stanciu on September 05, 2018, 06:20:44 AM
notify->copyParams(*m) is what you are looking for.

Please see: http://yate.null.ro/docs/api/TelEngine__NamedList.html#ref17