Hello,
I'm trying to change contact header in SIP response message by stripping first characters (for testing only) as below :
$ct = $(ct{s.strip,25});
But I got below error saying that $ct is read-only:
0(15410) : <core> [cfg.y:3419]: yyerror_at(): parse error in config file /usr/local/etc/kamailio/kamailio.cfg, line 575, column 5-7: read only pvar in assignment left side
ERROR: bad config file (1 errors)
The question is how can I change contact header before it's sending of Kamailio?
Thanks
Ali
Hi Alex,
This is related to post Kamailio LCR Multiple choices I created before, where last gateway is listed at the first in contact header.
So as I didn’t get a solution from your side regarding this issue , I tried to strip first gateway from contact header.
Regards,
Ali
From: sr-users [mailto:sr-users-bounces@lists.sip-router.org] On Behalf Of Alex Balashov Sent: Wednesday, June 03, 2015 12:00 PM To: Ali Taher Subject: Re: [SR-Users] Kamailio Contact header read-only
Ali,
With the exception of a few, pseudovariables that expose parts of a SIP message (such as $ct) are read-only, so you cannot assign values to them.
Why are you manipulating the Contact header? This is not something proxies should ordinarily do.
But, assuming you really want to/know what you're doing:
remove_hf("Contact");
append_hf("Contact: sip:...\r\n");
-- Alex Balashov | Principal | Evariste Systems LLC 303 Perimeter Center North, Suite 300 Atlanta, GA 30346 United States
Tel: +1-800-250-5920 (toll-free) / +1-678-954-0671 (direct) Web: http://www.evaristesys.com/, http://www.csrpswitch.com/
Sent from my BlackBerry.
Ali,
That's not going to work, for reasons related to the state of the message body at the time you're manipulating it. You need to get to the bottom of the fundamental issue: why are the gateways not in the order you want? And you need to fix it on that level.
-- Alex Balashov | Principal | Evariste Systems LLC 303 Perimeter Center North, Suite 300 Atlanta, GA 30346 United States
Tel: +1-800-250-5920 (toll-free) / +1-678-954-0671 (direct) Web: http://www.evaristesys.com/, http://www.csrpswitch.com/
Sent from my BlackBerry.
Hi Alex,
In contact header I'm getting last gateway is listed first , then gateways are ordered correctly. Let's say I have 3 gateways ordered as 1,2,3 in LCR_rule_target table I'm getting in the contact header : 3,1,2,3
I'm using below code
if (!load_gws(1, $rU, $fu)) { sl_send_reply("502", "Unable To lOad GatEwAyS"); exit; } else while(next_gw()) { append_branch(); } sl_send_reply("300","Multiple Choices");
any help would be appreciated.
Ali
-----Original Message----- From: sr-users [mailto:sr-users-bounces@lists.sip-router.org] On Behalf Of Alex Balashov Sent: Wednesday, June 03, 2015 1:35 PM To: Ali Taher Subject: Re: [SR-Users] Kamailio Contact header read-only
Ali,
That's not going to work, for reasons related to the state of the message body at the time you're manipulating it. You need to get to the bottom of the fundamental issue: why are the gateways not in the order you want? And you need to fix it on that level.
-- Alex Balashov | Principal | Evariste Systems LLC 303 Perimeter Center North, Suite 300 Atlanta, GA 30346 United States
Tel: +1-800-250-5920 (toll-free) / +1-678-954-0671 (direct) Web: http://www.evaristesys.com/, http://www.csrpswitch.com/
Sent from my BlackBerry.
_______________________________________________ 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
Hi Alex,
Any update regarding the below?
Thanks, Ali
-----Original Message----- From: Ali Taher [mailto:ataher@vanrise.com] Sent: Wednesday, June 03, 2015 2:04 PM To: 'Kamailio (SER) - Users Mailing List' Cc: 'Ali Taher~Vanrise Technical Support' Subject: RE: [SR-Users] Kamailio Contact header read-only
Hi Alex,
In contact header I'm getting last gateway is listed first , then gateways are ordered correctly. Let's say I have 3 gateways ordered as 1,2,3 in LCR_rule_target table I'm getting in the contact header : 3,1,2,3
I'm using below code
if (!load_gws(1, $rU, $fu)) { sl_send_reply("502", "Unable To lOad GatEwAyS"); exit; } else while(next_gw()) { append_branch(); } sl_send_reply("300","Multiple Choices");
any help would be appreciated.
Ali
-----Original Message----- From: sr-users [mailto:sr-users-bounces@lists.sip-router.org] On Behalf Of Alex Balashov Sent: Wednesday, June 03, 2015 1:35 PM To: Ali Taher Subject: Re: [SR-Users] Kamailio Contact header read-only
Ali,
That's not going to work, for reasons related to the state of the message body at the time you're manipulating it. You need to get to the bottom of the fundamental issue: why are the gateways not in the order you want? And you need to fix it on that level.
-- Alex Balashov | Principal | Evariste Systems LLC 303 Perimeter Center North, Suite 300 Atlanta, GA 30346 United States
Tel: +1-800-250-5920 (toll-free) / +1-678-954-0671 (direct) Web: http://www.evaristesys.com/, http://www.csrpswitch.com/
Sent from my BlackBerry.
_______________________________________________ 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
Hi Ali,
Sorry, I've never used the lcr module. Whenever we build anything, we just pull lists of gateways from our own database tables with sqlops, typically using sql_xquery() to store them in lists of XAVPs and then manually iterate over them.
The lcr/carrierroute/drouting modules just provide wrappers for this kind of process, with their own table schema and metrics.
-- Alex Balashov | Principal | Evariste Systems LLC 303 Perimeter Center North, Suite 300 Atlanta, GA 30346 United States
Tel: +1-800-250-5920 (toll-free) / +1-678-954-0671 (direct) Web: http://www.evaristesys.com/, http://www.csrpswitch.com/
Sent from my BlackBerry. Original Message From: Ali Taher Sent: Thursday, June 4, 2015 09:59 To: 'Kamailio (SER) - Users Mailing List' Reply To: Kamailio (SER) - Users Mailing List Subject: Re: [SR-Users] Kamailio Contact header read-only
Hi Alex,
Thanks for your reply,
Can you please send me the routing script you're using in order to pull the list of gateways and iterate over them?
Regards, Ali
-----Original Message----- From: sr-users [mailto:sr-users-bounces@lists.sip-router.org] On Behalf Of Alex Balashov Sent: Thursday, June 04, 2015 12:27 PM To: Ali Taher Subject: Re: [SR-Users] Kamailio Contact header read-only
Hi Ali,
Sorry, I've never used the lcr module. Whenever we build anything, we just pull lists of gateways from our own database tables with sqlops, typically using sql_xquery() to store them in lists of XAVPs and then manually iterate over them.
The lcr/carrierroute/drouting modules just provide wrappers for this kind of process, with their own table schema and metrics.
-- Alex Balashov | Principal | Evariste Systems LLC 303 Perimeter Center North, Suite 300 Atlanta, GA 30346 United States
Tel: +1-800-250-5920 (toll-free) / +1-678-954-0671 (direct) Web: http://www.evaristesys.com/, http://www.csrpswitch.com/
Sent from my BlackBerry. Original Message From: Ali Taher Sent: Thursday, June 4, 2015 09:59 To: 'Kamailio (SER) - Users Mailing List' Reply To: Kamailio (SER) - Users Mailing List Subject: Re: [SR-Users] Kamailio Contact header read-only
_______________________________________________ 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