I have a need to use q-value for serial forking but my clients don't support it. I need to specify unique q-value on all ports on the client device.
I explored using the User-Agent header and appending q-value, but this wouldn't help on multi-port clients.
Some things I have been thinking about are 'abusing' the authorization user or from user to somehow append q-value but this opens the door to other issues, and a database trigger however there would be no way to match this up to a record in another table as the usernames would be the same.
Any thoughts/ideas or methods others have used in situations like this?
-Dan
Hello,
do you want to add q value to Contact header on incoming REGISTER requests?
Cheers, Daniel
On 04/11/15 08:06, Daniel W. Graham wrote:
I have a need to use q-value for serial forking but my clients don’t support it. I need to specify unique q-value on all ports on the client device.
I explored using the User-Agent header and appending q-value, but this wouldn’t help on multi-port clients.
Some things I have been thinking about are ‘abusing’ the authorization user or from user to somehow append q-value but this opens the door to other issues, and a database trigger however there would be no way to match this up to a record in another table as the usernames would be the same.
Any thoughts/ideas or methods others have used in situations like this?
-Dan
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
Yes
[dan-signature]
From: sr-users [mailto:sr-users-bounces@lists.sip-router.org] On Behalf Of Daniel-Constantin Mierla Sent: Wednesday, November 4, 2015 3:36 AM To: Kamailio (SER) - Users Mailing List sr-users@lists.sip-router.org Subject: Re: [SR-Users] q-value on unsupported clients
Hello,
do you want to add q value to Contact header on incoming REGISTER requests?
Cheers, Daniel On 04/11/15 08:06, Daniel W. Graham wrote: I have a need to use q-value for serial forking but my clients don't support it. I need to specify unique q-value on all ports on the client device.
I explored using the User-Agent header and appending q-value, but this wouldn't help on multi-port clients.
Some things I have been thinking about are 'abusing' the authorization user or from user to somehow append q-value but this opens the door to other issues, and a database trigger however there would be no way to match this up to a record in another table as the usernames would be the same.
Any thoughts/ideas or methods others have used in situations like this?
-Dan
_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users@lists.sip-router.orgmailto:sr-users@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
--
Daniel-Constantin Mierla
http://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda
Book: SIP Routing With Kamailio - http://www.asipto.com
Kamailio Advanced Training, Nov 30-Dec 2, Berlin - http://asipto.com/kat
I figured out a way to send q-value by using auth user, however ran into an issue-
# Check Authorization User for q-value and replace Contact header if $(au{param.count}) > 0 { $var(qvalue)=$(au{param.value,q}); if($var(qvalue) != $null) { xlog("L_INFO", "REGISTER $fU: q-value specified by client q=$var(qvalue)\n"); $var(newct) = $ct + ';q=0.' + $var(qvalue); xlog("L_INFO", "REGISTER $fU: new pending Contact hdr: $var(newct)\n"); remove_hf("Contact"); append_hf("Contact: $var(newct)\r\n"); xlog("L_INFO", "REGISTER $fU: new Contact hdr: $hdr(Contact)\n"); } }
Results in:
Nov 5 03:06:45 SIP01 /usr/local/sbin/kamailio[3319]: INFO: xlog: REGISTER someusername: q-value specified by client q=99 Nov 5 03:06:45 SIP01 /usr/local/sbin/kamailio[3319]: INFO: xlog: REGISTER someusername: new pending Contact hdr: <sip: someusername @x.x.x.x:5060>;expires=1800;q=0.99 Nov 5 03:06:45 SIP01 /usr/local/sbin/kamailio[3319]: INFO: xlog: REGISTER someusername: new Contact hdr: <sip: someusername @x.x.x.x:5060>;expires=1800
Based on the xlog output, the following doesn't appear to be working - remove_hf("Contact"); append_hf("Contact: $var(newct)\r\n");
I've actually had a similar issue before replacing a hdr so I'm wondering if I'm doing something wrong?
Thanks, -dan
From: sr-users [mailto:sr-users-bounces@lists.sip-router.org] On Behalf Of Daniel W. Graham Sent: Wednesday, November 4, 2015 11:04 AM To: miconda@gmail.com; Kamailio (SER) - Users Mailing List sr-users@lists.sip-router.org Subject: Re: [SR-Users] q-value on unsupported clients
Yes
[dan-signature]
From: sr-users [mailto:sr-users-bounces@lists.sip-router.org] On Behalf Of Daniel-Constantin Mierla Sent: Wednesday, November 4, 2015 3:36 AM To: Kamailio (SER) - Users Mailing List <sr-users@lists.sip-router.orgmailto:sr-users@lists.sip-router.org> Subject: Re: [SR-Users] q-value on unsupported clients
Hello,
do you want to add q value to Contact header on incoming REGISTER requests?
Cheers, Daniel On 04/11/15 08:06, Daniel W. Graham wrote: I have a need to use q-value for serial forking but my clients don't support it. I need to specify unique q-value on all ports on the client device.
I explored using the User-Agent header and appending q-value, but this wouldn't help on multi-port clients.
Some things I have been thinking about are 'abusing' the authorization user or from user to somehow append q-value but this opens the door to other issues, and a database trigger however there would be no way to match this up to a record in another table as the usernames would be the same.
Any thoughts/ideas or methods others have used in situations like this?
-Dan
_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users@lists.sip-router.orgmailto:sr-users@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
--
Daniel-Constantin Mierla
http://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda
Book: SIP Routing With Kamailio - http://www.asipto.com
Kamailio Advanced Training, Nov 30-Dec 2, Berlin - http://asipto.com/kat
Based on the xlog output, the following doesn't appear to be working - remove_hf("Contact"); append_hf("Contact: $var(newct)\r\n");
I've actually had a similar issue before replacing a hdr so I'm wondering if I'm doing something wrong?
Header manipulation is doesn't update the already parsed message that is being used for $hdr etc. You have to apply the changes with http://kamailio.org/docs/modules/stable/modules/textopsx.html#textopsx.f.msg...
On 05 Nov 2015, at 10:15, Daniel Tryba d.tryba@pocos.nl wrote:
Based on the xlog output, the following doesn't appear to be working - remove_hf("Contact"); append_hf("Contact: $var(newct)\r\n");
I've actually had a similar issue before replacing a hdr so I'm wondering if I'm doing something wrong?
Header manipulation is doesn't update the already parsed message that is being used for $hdr etc.
This is an important fact for all routing scripts. You have one message in memory that you read from and one copy that you apply changes on. The changes are applied when you send the message or when you run the function below.
You have to apply the changes with http://kamailio.org/docs/modules/stable/modules/textopsx.html#textopsx.f.msg...
Not that if you run this function you owerwrite the incoming message and have no way of going back to the original incoming message.
/O
This explains a lot, I definitely wasn't aware.
Thanks for the explanation!
-----Original Message----- From: sr-users [mailto:sr-users-bounces@lists.sip-router.org] On Behalf Of Olle E. Johansson Sent: Thursday, November 5, 2015 4:23 AM To: Kamailio (SER) - Users Mailing List sr-users@lists.sip-router.org Subject: Re: [SR-Users] q-value on unsupported clients
On 05 Nov 2015, at 10:15, Daniel Tryba d.tryba@pocos.nl wrote:
Based on the xlog output, the following doesn't appear to be working
- remove_hf("Contact");
append_hf("Contact: $var(newct)\r\n");
I've actually had a similar issue before replacing a hdr so I'm wondering if I'm doing something wrong?
Header manipulation is doesn't update the already parsed message that is being used for $hdr etc.
This is an important fact for all routing scripts. You have one message in memory that you read from and one copy that you apply changes on. The changes are applied when you send the message or when you run the function below.
You have to apply the changes with http://kamailio.org/docs/modules/stable/modules/textopsx.html#textopsx .f.msg_apply_changes
Not that if you run this function you owerwrite the incoming message and have no way of going back to the original incoming message.
/O _______________________________________________ SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
Thanks!
-----Original Message----- From: sr-users [mailto:sr-users-bounces@lists.sip-router.org] On Behalf Of Daniel Tryba Sent: Thursday, November 5, 2015 4:16 AM To: sr-users@lists.sip-router.org Subject: Re: [SR-Users] q-value on unsupported clients
Based on the xlog output, the following doesn't appear to be working - remove_hf("Contact"); append_hf("Contact: $var(newct)\r\n");
I've actually had a similar issue before replacing a hdr so I'm wondering if I'm doing something wrong?
Header manipulation is doesn't update the already parsed message that is being used for $hdr etc. You have to apply the changes with http://kamailio.org/docs/modules/stable/modules/textopsx.html#textopsx.f.msg...
_______________________________________________ SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users