Closed flantel closed 4 years ago
Hi Barry,
Please provide the current version of your mapping script and some example and we'll be happy to make a suggestion.
Sure. I have a script called callid_genband
created under Advanced:
var returnData=[];
var genband_b=[];
for (var i = 0; i < data.length; i++)
{
genband_b = data[i].match(/^.[^@]{1,29}/);
returnData.push(genband_b + '%');
}
returnData;
..and my mapping script is as follows.
[
{
"source_field": "data_header.callid",
"lookup_id": 100,
"lookup_profile": "default",
"lookup_field": "sid",
"lookup_range": [
-300,
200
],
"input_script": "callid_genband"
},
{
"source_field": "data_header.callid",
"lookup_id": 5,
"lookup_profile": "call",
"lookup_field": "sid",
"lookup_range": [
-300,
200
],
"input_script": "callid_genband"
},
{
"source_field": "protocol_header.correlation_id",
"lookup_id": 1,
"lookup_profile": "call",
"lookup_field": "sid",
"lookup_range": [
-300,
200
],
"input_script": "callid_genband"
},
{
"source_field": "data_header.callid",
"lookup_id": 1,
"lookup_profile": "call",
"lookup_field": "data_header->>'callid'",
"lookup_range": [
-300,
200
],
"input_script": "callid_genband"
}
]
I can see that the search is being performed as per my script as the homer.app logs show "sid array after JS:" correctly.
homer-app is from revision 6d0e6a162447b279092c84a94c124df89e52561e
Many thanks
Sorry, CallID example:
A-Leg: 29256707-3809921585-53286089@SBC01N1TB.domain2.com B-Leg: 29256707-3809921585-53286089_8358307-3809921586-236453012@ix-nextone-01-domain.com
My resulting lookup is 29256707-3809921585-53286089%
However, as the resulting query is "sid in ($1, $2)" wildcards don't work
Thanks, Could you also provide the response for this?
Sorry, which response? HTTP POST transaction, or the SQL response to the query?
https://github.com/sipcapture/homer-app/commit/da0751c033cf16f09cf77a8be660f0bd774d1702
in the correlation block:
"like_search": true
please take it and test it
That should do the trick. Thanks! I'll check it out.
Works like a charm. Many, many thanks!
Great! Have a nice day
Hi,
We have a b2bua which modifies the A and B leg CallIDs by taking (up to) the first 30 chars before any '@' sign of the A-Leg CID then adds "_@new_domain" to create the B-Leg.
I have a mapping rule which catches this, but as I only know up to the first 30 chars, the only way I could express it is with a % wildcard. However, as the resulting query is "sid in ($1, $2)" wildcards don't work. Is there any way around this?
Thanks