Yes, based on your description of the problem that transformation should work. We use that transformation to test a comma-separated list for the existence of a value in the same way.
Ben Newlin From: Users <[email protected]> on behalf of Sasmita Panda <[email protected]> Date: Monday, October 23, 2023 at 2:13 AM To: OpenSIPS users mailling list <[email protected]> Subject: Re: [OpenSIPS-Users] I need some help in attr matching while forming the Branch . EXTERNAL EMAIL - Please use caution with links and attachments ________________________________ There are some changes in the requirements now . Although I appreciate your suggestion, I will go with script transformation . But not in a different way . In the register I will get set of comma separated values in Call-Info header and will save that in attr column . Agent1: call-info : en,galileo,level1,true Agent2 : call-info : en,spanish,lenovo,true Agent3: call-info : en,galileo,sales,level1,true 1st Invite : call-info : en,galileo,true (I have to match the contact in which this the substring of Registered contacts Attr . ex : Agent1 and Agent3 will the matching agents here ) 2nd Invite : call-info : en,true (All there agents are matching this critaria ) 3rd Invite : call-info : spanish,lenovo,true (Agent2 will match the criteria ) This is kind of substring matching . Here the challenge for me is , the number of values in the Invite header is not fixed , That can be 2 , that can be 4 that can be 7 . If every comma separated value is present in the Attr field then that contact will get call else not . #Test for existence of string in another if ($(var(strtosearch){s.index, $var(str)}) != NULL) xlog("found $var(sstr) in $var(strtosearch)\n"); So will this help me in this case ? Thanks & Regards Sasmita Panda Senior Network Testing and Software Engineer 3CLogic , ph:07827611765 On Wed, Oct 18, 2023 at 7:10 PM Ben Newlin <[email protected]<mailto:[email protected]>> wrote: Sasmita, Your examples all contain mixed use of semicolons and commas. Without any description or context, it’s very difficult to tell what or how you expect these to match. Having said that, I recommend making use of OpenSIPS transformations [1]. The parameters list transformations [2] specifically, as they operate on semicolon separated “key=value” pairs, just like you have. Depending on what operation you are expecting with respect to the commas, you may be able to combine that with the string select transformation [3] to get your desired outcome. [1] https://www.opensips.org/Documentation/Script-Tran-3-2<https://www.opensips.org/Documentation/Script-Tran-3-2> [2] https://www.opensips.org/Documentation/Script-Tran-3-2#toc60<https://www.opensips.org/Documentation/Script-Tran-3-2#toc60> [3] https://www.opensips.org/Documentation/Script-Tran-3-2#toc7<https://www.opensips.org/Documentation/Script-Tran-3-2#toc7> Ben Newlin From: Users <[email protected]<mailto:[email protected]>> on behalf of Sasmita Panda <[email protected]<mailto:[email protected]>> Date: Wednesday, October 18, 2023 at 6:34 AM To: OpenSIPS users mailling list <[email protected]<mailto:[email protected]>> Subject: Re: [OpenSIPS-Users] I need some help in attr matching while forming the Branch . EXTERNAL EMAIL - Please use caution with links and attachments ________________________________ Hi All , Any help on this ? Thanks & Regards Sasmita Panda Senior Network Testing and Software Engineer 3CLogic , ph:07827611765 On Tue, Oct 17, 2023 at 7:54 PM Sasmita Panda <[email protected]<mailto:[email protected]>> wrote: Hi All , My requirements seem complicated to me. I dont know whether I am right or wrong . I am using opensips 1.11 (I have opensips 3.2 as well ) scenario 1: 989898 - is registered from 3 different contact with different call-info header . and I saved the call-info header in attr column while saving data . 1 contact : call-info : x=hr,network;y=sales,z=marketing 2nd contact : call-info : x=hr;y=sales,z=marketing 3rd contact : call-info : x=hr,network;y=sales,z=marketing INVITE : call-info : x=hr;y=sales Now while forming a branch for this INVITE , how do I compare this call-info with attr to get all the contact and then do serial forking on this ? scenario 2: 989898 - is registered from 3 different contact with different call-info header . and I saved the call-info header in attr column while saving data . 1 contact : call-info : x=hr,network;y=sales,z=marketing 2nd contact : call-info : x=hr;y=sales,z=marketing 3rd contact : call-info : x=hr,network;y=sales,z=marketing INVITE : call-info : call-info : x=hr,network;y=sales,z=marketing In this I am getting only 1 contact where there is exact match . And I am able to gove call to that contact . I am stuck on the 1st scenario . I am thinking of exec module to use on this . But not getting any better examples of how I do this . Please anybody help me out . Any kind of help is appreciated . thank you in advance . Thanks & Regards Sasmita Panda Senior Network Testing and Software Engineer 3CLogic , ph:07827611765 _______________________________________________ Users mailing list [email protected]<mailto:[email protected]> http://lists.opensips.org/cgi-bin/mailman/listinfo/users<http://lists.opensips.org/cgi-bin/mailman/listinfo/users>
_______________________________________________ Users mailing list [email protected] http://lists.opensips.org/cgi-bin/mailman/listinfo/users
