[OpenSIPS-Users] Provisional response handling in case of forking
Ramachandran, Agalya (Contractor)
Agalya_Ramachandran at comcast.com
Fri Jul 29 15:27:12 CEST 2016
Hi Bogdan,
In onreply_route(), it logs all the incoming response to OpenSIPS.
My intention is to log and print the outgoing response from OpenSIPS.
A -------->OpenSIPS------->B
Here when User A calling User B, via OpenSIPS proxy, I am logging response am getting from User B.
I also want to log the response sent from OpenSIPS to User A.
As per my understanding , to log the response I have to do in source code from where the response is sent. Due to some formatting we need for the project it is easy if I handle it in config file. So am calling relay2(route) and printing the logs.
Now please guide me what am doing is right or not, if not let me know what could be the best way to handle this.?
P.S : I want to log something like this.
xlog("INFO: event=Reply_from_client; reason=$rr; status=$rs [from=$fu;fromtag=$ft;to=$tu;totag=$tt;callId=$ci]\n");
Regards,
Agalya
From: Bogdan-Andrei Iancu [mailto:bogdan at opensips.org]
Sent: Friday, July 29, 2016 8:46 AM
To: Ramachandran, Agalya (Contractor) <Agalya_Ramachandran at comcast.com>; OpenSIPS users mailling list <users at lists.opensips.org>
Subject: Re: [OpenSIPS-Users] Provisional response handling in case of forking
Hi Agalya,
In the onreply_route(), the logic seems ok:
* if flag set -> drop and log
* for all 180, set the flag.
This should allow only the first 180 reply to pass.
But I do not understand what is the purpose of the relay2 route? the onreply route should go everything you need (in terms of 180 logic).
Regards,
Bogdan-Andrei Iancu
OpenSIPS Founder and Developer
http://www.opensips-solutions.com
On 27.07.2016 16:27, Ramachandran, Agalya (Contractor) wrote:
Hi Bogdan,
Yes you are correct. Am trying to implement that logic. (keep and log the first 180, drop the others)
Am giving you snippet of onreply_route and relay2 attached here with this mail.
My intention is just to log the response sent by OpenSIPS. For other responses logic seems good and I could see that response sent out are logged.
Only for 180 resposne, am not meeting my condition.
Correct me if am wrong.
Regards,
Agalya
From: Bogdan-Andrei Iancu [mailto:bogdan at opensips.org]
Sent: Wednesday, July 27, 2016 3:22 AM
To: Ramachandran, Agalya (Contractor) <Agalya_Ramachandran at comcast.com><mailto:Agalya_Ramachandran at comcast.com>; OpenSIPS users mailling list <users at lists.opensips.org><mailto:users at lists.opensips.org>
Subject: Re: [OpenSIPS-Users] Provisional response handling in case of forking
Hi Agalya,
First, take care that you can set and trigger only one reply route per transaction !
Now, looking at your logic in the script, it does not reflect your statement : keep and log the first 180, drop the others <- is this correct ?
Best regards,
Bogdan-Andrei Iancu
OpenSIPS Founder and Developer
http://www.opensips-solutions.com
On 26.07.2016 21:26, Ramachandran, Agalya (Contractor) wrote:
Hi Bogdan,
I have a question related to the below topic.
When am receiving more than 180 response from different destinations , am sending 1st 180 to the caller and dropping consecutive 180 's.
And this logic is working fine.
Now I have a scenario, where I need to log what are the responses sent out of Opensips.
My logic for this is, am checking the flag value. If flag is set, log the 1st 180 response, reset the flag and drop the remaining 180 response.
I could see FLAG_180 is set, and when I try to reset flag is not getting reset. Is it not possible to reset the flag values when relay is done?
I have added a route(relay2) in onreply_route Below is the snippet of it.
Please guide me if am doing something wrong.
route[relay2] {
if ($rs==100)
drop();
if ($rs==180) {
if (isflagset(FLAG_180)){
xlog("INFO:opensips: Flag is set \n"<INFO:opensips:Flagisset%5Cn>);
resetflag(FLAG_180);
}
else{
drop();
}
#setflag(FLAG_180);
}
xlog("INFO:opensips: Sending $rs resposne out \n"<INFO:opensips:Sending$rsresposneout\n>);
}
Regards,
Agalya
From: Bogdan-Andrei Iancu [mailto:bogdan at opensips.org]
Sent: Monday, June 13, 2016 6:31 AM
To: OpenSIPS users mailling list <users at lists.opensips.org><mailto:users at lists.opensips.org>; Ramachandran, Agalya (Contractor) <Agalya_Ramachandran at comcast.com><mailto:Agalya_Ramachandran at comcast.com>
Subject: Re: [OpenSIPS-Users] Provisional response handling in case of forking
Hi Agalya,
Use the onreply route (be sure to onreply_avp_mode to be set to 1 - see http://www.opensips.org/html/docs/modules/2.2.x/tm.html#id294290) in combination with flags, to record when the an 180 reply was set.
Like:
if ($rs==180) {
if (isflagset(FLAG_180))
drop();
setflag(FALG_180);
}
The onreply_avp_mode 1 will ensure that the onreply route will not overlap for 2 replies .
Regards,
Bogdan-Andrei Iancu
OpenSIPS Founder and Developer
http://www.opensips-solutions.com
On 10.06.2016 23:07, Ramachandran, Agalya (Contractor) wrote:
Hi team,
We are using opensips for our project and we are currently using opensips as proxy.
Am forking the incoming sip call, to two destinations. It Rings in both Dest A and Dest B, as a result I get two 180 Ringing response from A and B.
I want to filter only the first incoming 180 Ringing response and send to the actual caller. Is there a way to do this in opensips config file?
I have seen drop() function which drops the complete provisional response. But in my case I have to forward one 180 Ringing to the caller.
Can it be achieved by the changes in config file? Please guide me.
Regards,
Agalya
_______________________________________________
Users mailing list
Users at lists.opensips.org<mailto:Users at lists.opensips.org>
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/users/attachments/20160729/821d60bf/attachment-0001.htm>
More information about the Users
mailing list