Recent Posts

Pages: [1] 2 3 ... 10
1
Yate users hangout place / Re: Custom API - NamedList
« Last post by ganapathi on December 10, 2018, 11:55:51 PM »
Please Ignore it. I get this done.
2
Yate users hangout place / Re: Custom API - NamedList
« Last post by ganapathi on December 10, 2018, 07:57:08 AM »
If am not wrong then is this correct ?.

Code: [Select]
const NamedString* s = msg.getParam(i);
String* str = getParam(s->name());
addParam(s->name(),*s);

Adding and gather like normal NamedList generation (addParam,getParam).

But here there is no NamedList variable mentioned, if not mentioned then by default it would take as "name" ?. right ?
3
Other Yate server issues / Re: send keepalives only during SIP calls
« Last post by marian on December 10, 2018, 02:54:28 AM »
Custom parameters configured in cdrbuild.conf and set via copyparams in call.execute will be available in all call.cdr messages related a given call leg.

You must track the number of calls related to a given parameter (line ?)
call.cdr with operation=initialize. Increase counter. Start keep alive if counter=1
call.cdr with operation=finalize. Decrease counter. Stop keep alive if counter=0
4
Other Yate server issues / Re: send keepalives only during SIP calls
« Last post by slurp on December 10, 2018, 02:38:51 AM »
Thanks Marian, it will take me some time this digest that fully. Do I understand correctly that the advantage of using the cdrbuild module is that any custom parameter I set in routing will be available in cdr.call/finalize? Do I need to keep track of the number of calls using a line myself or is there some trick I can use?
5
Yate users hangout place / Re: Custom API - NamedList
« Last post by marian on December 10, 2018, 02:08:18 AM »
You should take a look at
CdrBuilder class
and
CdrBuilder::update(const Message& msg ...) method.
6
Yate users hangout place / Re: Custom API - NamedList
« Last post by ganapathi on December 10, 2018, 02:03:04 AM »
I was looking into that one only earlier as well. But couldn't get some points.

ObjList defined under namespace
Code: [Select]
namespace {
static ObjList s_cdrs;
..

Object pointer created with ID and append into ObjList
Code: [Select]
String id(msg.getValue(YSTRING("id")));
b = new CdrBuilder(id);
s_cdrs.append(b);

Get the Object Pointer with ID
Code: [Select]
String id(msg.getValue(YSTRING("id")));
CdrBuilder *b = CdrBuilder::find(id);

Remove Object pointer from ObjList
Code: [Select]
s_cdrs.remove(this);
But didn't find where NamedList with value storing into id object and retrieval from that. any sample syntax push namedlist into pointer and access from tht would be more helpful
7
Other Yate server issues / Re: send keepalives only during SIP calls
« Last post by marian on December 10, 2018, 01:15:58 AM »
You may set the 'keepalive' parameter if want to change the interval (value in seconds).
See:
https://docs.yate.ro/wiki/Accfile

In an external or javascript module you may track call.cdr messages with operation=initialize/finalize.
Track channels belonging to your line. You don't need to logout the line. Just send same parameters as login with changed keepalive
The line parameter can be added to CDR.
See:
https://docs.yate.ro/wiki/CDR_Build_Module
https://docs.yate.ro/wiki/How_to_add_custom_parameters_in_CDR_from_routing

If your last phrase means you want to have some parameters set in outbound/inbound calls using a line you may set them.
All line parameters starting with 'out:' prefix will be set for outbound call legs using them (prefix stripped).
Same for 'inb:' parameters for inbound calls.
8
Yate users hangout place / Re: Custom API - NamedList
« Last post by marian on December 10, 2018, 12:40:20 AM »
You may take a look at modules/cdrbuild.cpp
It tracks call legs and update parameters associated with them.
9
Yate users hangout place / Re: Custom API - NamedList
« Last post by ganapathi on December 09, 2018, 11:48:43 AM »
Can you point me best way to store associated parameters on the single module but various class. Define a variable under namespace instead of class would give access I think but need to keep different set of list for each call.

declare variable;

Call 1: Active
variable = { "key1" => "value1" , "key2" = "value2" } // Kind of List with named key.
Call 2: Active
variable = { "key3" => "value3" , "key2" = "value4" } // Kind of List with named key.

But at the same time module should keep multiple list for each call. Means each list need to track by billid.

I just read ObjList as well but don't know how named pair of value append and retrieval from there.
10
Other Yate server issues / Re: send keepalives only during SIP calls
« Last post by slurp on December 09, 2018, 02:54:26 AM »
Hi Marian,

Thanks for the reply. We have our wires crossed I think. I have my outbound only providers set up as lines in accfile.conf rather than what I think you are referring to, (dynamic) SIP targets set by a routing module.

I don't know whether I would go so far to call my outbound only providers "registered lines" as I have omitted the registrar parameter from these lines to prevent registration.

In Yate 6.0 these also send keep-alives regardless of whether there is a call active or not which is pointless in perhaps the majority of NAT configurations so I would like to prevent that.

Looking at message traces, I think a workaround might be to duplicate accfile's behaviour in sending user.login messages but only in response to a call.route message for that line, and send a user.logoff when there no more calls using that line. If globals can't be modified from regexroute than I assume I would need to write an extmodule. I think it would be more sensible to modify ysipchan if the current software can't be configured to behave the way I desire.

BTW, I would have thought that most of the static parameters for a SIP line entry would be able to be supplied as parameters to a call.route message with a SIP destination as a target and vice versa but it seems this is not the case.
Pages: [1] 2 3 ... 10