Hello, Is it possible to use $avp() or $var() inside re.subst? Example:
$var(PrefixMatch) = "00"; $var(destnumber1) = $(ru{re.subst,/^sip:$var(PrefixMatch)(.*)@(.*)/\1/}); $var(destnumber2) = $(ru{re.subst,/^sip:00(.*)@(.*)/\1/}); xlog("L_INFO", "destnumber1 $var(destnumber1)\n"); xlog("L_INFO", "destnumber2 $var(destnumber2)\n");
In the above, destnumber2 works, yet destnumber1 does not. Thanks! /V
On 01/08/2016 04:28 PM, Vik Killa wrote:
$var(destnumber1) =
$(ru{re.subst,/^sip:$var(PrefixMatch)(.*)@(.*)/\1/}); $var(destnumber2) = $(ru{re.subst,/^sip:00(.*)@(.*)/\1/}); xlog("L_INFO", "destnumber1 $var(destnumber1)\n"); xlog("L_INFO", "destnumber2 $var(destnumber2)\n");
In the above, destnumber2 works, yet destnumber1 does not.
If I may be so bold, I think you have your answer. :-)
Assuming the answer is no this is not possible, then does anyone know of a way to accomplish this? Perhaps with textops module? Thanks, /V
On Fri, Jan 8, 2016 at 4:30 PM, Alex Balashov abalashov@evaristesys.com wrote:
On 01/08/2016 04:28 PM, Vik Killa wrote:
$var(destnumber1) =
$(ru{re.subst,/^sip:$var(PrefixMatch)(.*)@(.*)/\1/}); $var(destnumber2) = $(ru{re.subst,/^sip:00(.*)@(.*)/\1/}); xlog("L_INFO", "destnumber1 $var(destnumber1)\n"); xlog("L_INFO", "destnumber2 $var(destnumber2)\n");
In the above, destnumber2 works, yet destnumber1 does not.
If I may be so bold, I think you have your answer. :-)
-- 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/
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
On 01/08/2016 04:28 PM, Vik Killa wrote:
$var(destnumber1) =
$(ru{re.subst,/^sip:$var(PrefixMatch)(.*)@(.*)/\1/});
But, it's certainly worth asking if what you're trying to accomplish here can't be accomplished differently...
$var(destnumber1) = "$rz:" + $var(PrefixMatch) + "@" + $rd + ":" + $rp;
Or:
$var(destnumber1) = $_s($rz:$var(PrefixMatch)@$rd:$rp);
-- Alex
I'm not trying to replace the R-URI like in your example, im trying to remove a prefix from the RURI
On Fri, Jan 8, 2016 at 4:34 PM, Alex Balashov abalashov@evaristesys.com wrote:
On 01/08/2016 04:28 PM, Vik Killa wrote:
$var(destnumber1) =
$(ru{re.subst,/^sip:$var(PrefixMatch)(.*)@(.*)/\1/});
But, it's certainly worth asking if what you're trying to accomplish here can't be accomplished differently...
$var(destnumber1) = "$rz:" + $var(PrefixMatch) + "@" + $rd + ":" + $rp;
Or:
$var(destnumber1) = $_s($rz:$var(PrefixMatch)@$rd:$rp);
-- Alex
-- 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/
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
That last statement was in-accurate. Im not trying to modify the R-URI at all actually. I'd like to create a variable.
On Fri, Jan 8, 2016 at 4:38 PM, Vik Killa vipkilla@gmail.com wrote:
I'm not trying to replace the R-URI like in your example, im trying to remove a prefix from the RURI
On Fri, Jan 8, 2016 at 4:34 PM, Alex Balashov abalashov@evaristesys.com wrote:
On 01/08/2016 04:28 PM, Vik Killa wrote:
$var(destnumber1) =
$(ru{re.subst,/^sip:$var(PrefixMatch)(.*)@(.*)/\1/});
But, it's certainly worth asking if what you're trying to accomplish here can't be accomplished differently...
$var(destnumber1) = "$rz:" + $var(PrefixMatch) + "@" + $rd + ":" + $rp;
Or:
$var(destnumber1) = $_s($rz:$var(PrefixMatch)@$rd:$rp);
-- Alex
-- 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/
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
On 01/08/2016 04:40 PM, Vik Killa wrote:
That last statement was in-accurate. Im not trying to modify the R-URI at all actually. I'd like to create a variable.
Right, you're trying to extract a value from the RURI, transform it, and copy the transformed value into something else.
I think my last suggestion would serve that aim, if I understood the objective correctly.
-- Alex
Hi Alex, Thank you! Your suggestion will most likely fit our solution. /V
On Fri, Jan 8, 2016 at 4:42 PM, Alex Balashov abalashov@evaristesys.com wrote:
On 01/08/2016 04:40 PM, Vik Killa wrote:
That last statement was in-accurate. Im not trying to modify the R-URI
at all actually. I'd like to create a variable.
Right, you're trying to extract a value from the RURI, transform it, and copy the transformed value into something else.
I think my last suggestion would serve that aim, if I understood the objective correctly.
-- Alex
-- 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/
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
Hello,
short note to add that one can use dialplan module for doing per/sed-like substitutions with rules stored in database. Reloading of records from database can be done via mi/rpc command, thus without restarting kamailio.
dialplan module is particularly useful when needing to deal with lot of substitutions specific for groups of users.
Cheers, Daniel
On 08/01/16 22:45, Vik Killa wrote:
Hi Alex, Thank you! Your suggestion will most likely fit our solution. /V
On Fri, Jan 8, 2016 at 4:42 PM, Alex Balashov <abalashov@evaristesys.com mailto:abalashov@evaristesys.com> wrote:
On 01/08/2016 04:40 PM, Vik Killa wrote: That last statement was in-accurate. Im not trying to modify the R-URI at all actually. I'd like to create a variable. Right, you're trying to extract a value from the RURI, transform it, and copy the transformed value into something else. I think my last suggestion would serve that aim, if I understood the objective correctly. -- Alex -- Alex Balashov | Principal | Evariste Systems LLC 303 Perimeter Center North, Suite 300 Atlanta, GA 30346 United States Tel: +1-800-250-5920 <tel:%2B1-800-250-5920> (toll-free) / +1-678-954-0671 <tel:%2B1-678-954-0671> (direct) Web: http://www.evaristesys.com/, http://www.csrpswitch.com/ _______________________________________________ SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org <mailto:sr-users@lists.sip-router.org> http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
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 Daniel, We are experimenting with the dialplan module. I have a question about the reload of records. We will have 35326 rows in our dialplan table. I expect this would take a while to load into memory. Does the reload interrupt routing? or does the module save new data in a new hash and then change the pointer to the new hash? Thanks, V
On Mon, Jan 11, 2016 at 11:42 AM, Daniel-Constantin Mierla < miconda@gmail.com> wrote:
Hello,
short note to add that one can use dialplan module for doing per/sed-like substitutions with rules stored in database. Reloading of records from database can be done via mi/rpc command, thus without restarting kamailio.
dialplan module is particularly useful when needing to deal with lot of substitutions specific for groups of users.
Cheers, Daniel
On 08/01/16 22:45, Vik Killa wrote:
Hi Alex, Thank you! Your suggestion will most likely fit our solution. /V
On Fri, Jan 8, 2016 at 4:42 PM, Alex Balashov abalashov@evaristesys.com wrote:
On 01/08/2016 04:40 PM, Vik Killa wrote:
That last statement was in-accurate. Im not trying to modify the R-URI
at all actually. I'd like to create a variable.
Right, you're trying to extract a value from the RURI, transform it, and copy the transformed value into something else.
I think my last suggestion would serve that aim, if I understood the objective correctly.
-- Alex
-- 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/ http://www.csrpswitch.com/
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
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing listsr-users@lists.sip-router.orghttp://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
-- Daniel-Constantin Mierlahttp://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda Book: SIP Routing With Kamailio - http://www.asipto.comhttp://miconda.eu
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
It seems dialplan module does not work with that many records (35326 records to be exact) After i increased memory to kamailio, the module could load the data (kamcmd dialplan.reload), but is unable to 'dump'
# /usr/local/sbin/kamcmd dialplan.dump 1 error: 500 - Internal error root reply
On Mon, Jan 11, 2016 at 1:49 PM, Vik Killa vipkilla@gmail.com wrote:
Hi Daniel, We are experimenting with the dialplan module. I have a question about the reload of records. We will have 35326 rows in our dialplan table. I expect this would take a while to load into memory. Does the reload interrupt routing? or does the module save new data in a new hash and then change the pointer to the new hash? Thanks, V
On Mon, Jan 11, 2016 at 11:42 AM, Daniel-Constantin Mierla < miconda@gmail.com> wrote:
Hello,
short note to add that one can use dialplan module for doing per/sed-like substitutions with rules stored in database. Reloading of records from database can be done via mi/rpc command, thus without restarting kamailio.
dialplan module is particularly useful when needing to deal with lot of substitutions specific for groups of users.
Cheers, Daniel
On 08/01/16 22:45, Vik Killa wrote:
Hi Alex, Thank you! Your suggestion will most likely fit our solution. /V
On Fri, Jan 8, 2016 at 4:42 PM, Alex Balashov abalashov@evaristesys.com wrote:
On 01/08/2016 04:40 PM, Vik Killa wrote:
That last statement was in-accurate. Im not trying to modify the R-URI
at all actually. I'd like to create a variable.
Right, you're trying to extract a value from the RURI, transform it, and copy the transformed value into something else.
I think my last suggestion would serve that aim, if I understood the objective correctly.
-- Alex
-- 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/ http://www.csrpswitch.com/
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
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing listsr-users@lists.sip-router.orghttp://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
-- Daniel-Constantin Mierlahttp://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda Book: SIP Routing With Kamailio - http://www.asipto.comhttp://miconda.eu
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
Hello,
if you work with large data records that you want to get via kamcmd, then you have to increase the buffer sizes of ctl module -- see the readme of that module to identify the parameters to adjust.
Cheers, Daniel
On 11/01/16 20:22, Vik Killa wrote:
It seems dialplan module does not work with that many records (35326 records to be exact) After i increased memory to kamailio, the module could load the data (kamcmd dialplan.reload), but is unable to 'dump'
# /usr/local/sbin/kamcmd dialplan.dump 1 error: 500 - Internal error root reply
On Mon, Jan 11, 2016 at 1:49 PM, Vik Killa <vipkilla@gmail.com mailto:vipkilla@gmail.com> wrote:
Hi Daniel, We are experimenting with the dialplan module. I have a question about the reload of records. We will have 35326 rows in our dialplan table. I expect this would take a while to load into memory. Does the reload interrupt routing? or does the module save new data in a new hash and then change the pointer to the new hash? Thanks, V On Mon, Jan 11, 2016 at 11:42 AM, Daniel-Constantin Mierla <miconda@gmail.com <mailto:miconda@gmail.com>> wrote: Hello, short note to add that one can use dialplan module for doing per/sed-like substitutions with rules stored in database. Reloading of records from database can be done via mi/rpc command, thus without restarting kamailio. dialplan module is particularly useful when needing to deal with lot of substitutions specific for groups of users. Cheers, Daniel On 08/01/16 22:45, Vik Killa wrote:
Hi Alex, Thank you! Your suggestion will most likely fit our solution. /V On Fri, Jan 8, 2016 at 4:42 PM, Alex Balashov <abalashov@evaristesys.com <mailto:abalashov@evaristesys.com>> wrote: On 01/08/2016 04:40 PM, Vik Killa wrote: That last statement was in-accurate. Im not trying to modify the R-URI at all actually. I'd like to create a variable. Right, you're trying to extract a value from the RURI, transform it, and copy the transformed value into something else. I think my last suggestion would serve that aim, if I understood the objective correctly. -- Alex -- Alex Balashov | Principal | Evariste Systems LLC 303 Perimeter Center North, Suite 300 Atlanta, GA 30346 United States Tel: +1-800-250-5920 <tel:%2B1-800-250-5920> (toll-free) / +1-678-954-0671 <tel:%2B1-678-954-0671> (direct) Web: http://www.evaristesys.com/, http://www.csrpswitch.com/ _______________________________________________ SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org <mailto:sr-users@lists.sip-router.org> http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users _______________________________________________ SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org <mailto: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://twitter.com/#%21/miconda> - http://www.linkedin.com/in/miconda Book: SIP Routing With Kamailio - http://www.asipto.com http://miconda.eu _______________________________________________ SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org <mailto:sr-users@lists.sip-router.org> http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
Hello,
realoading is done in a separate structure, which is then swapped with the old one and the old one is freed -- like you said, a change of the pointer to the new structure.
Cheers, Daniel
On 11/01/16 19:49, Vik Killa wrote:
Hi Daniel, We are experimenting with the dialplan module. I have a question about the reload of records. We will have 35326 rows in our dialplan table. I expect this would take a while to load into memory. Does the reload interrupt routing? or does the module save new data in a new hash and then change the pointer to the new hash? Thanks, V
On Mon, Jan 11, 2016 at 11:42 AM, Daniel-Constantin Mierla <miconda@gmail.com mailto:miconda@gmail.com> wrote:
Hello, short note to add that one can use dialplan module for doing per/sed-like substitutions with rules stored in database. Reloading of records from database can be done via mi/rpc command, thus without restarting kamailio. dialplan module is particularly useful when needing to deal with lot of substitutions specific for groups of users. Cheers, Daniel On 08/01/16 22:45, Vik Killa wrote:
Hi Alex, Thank you! Your suggestion will most likely fit our solution. /V On Fri, Jan 8, 2016 at 4:42 PM, Alex Balashov <abalashov@evaristesys.com <mailto:abalashov@evaristesys.com>> wrote: On 01/08/2016 04:40 PM, Vik Killa wrote: That last statement was in-accurate. Im not trying to modify the R-URI at all actually. I'd like to create a variable. Right, you're trying to extract a value from the RURI, transform it, and copy the transformed value into something else. I think my last suggestion would serve that aim, if I understood the objective correctly. -- Alex -- Alex Balashov | Principal | Evariste Systems LLC 303 Perimeter Center North, Suite 300 Atlanta, GA 30346 United States Tel: +1-800-250-5920 <tel:%2B1-800-250-5920> (toll-free) / +1-678-954-0671 <tel:%2B1-678-954-0671> (direct) Web: http://www.evaristesys.com/, http://www.csrpswitch.com/ _______________________________________________ SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org <mailto:sr-users@lists.sip-router.org> http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users _______________________________________________ SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org <mailto: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://twitter.com/#%21/miconda> - http://www.linkedin.com/in/miconda Book: SIP Routing With Kamailio - http://www.asipto.com http://miconda.eu _______________________________________________ SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org <mailto:sr-users@lists.sip-router.org> http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
On 01/08/2016 04:38 PM, Vik Killa wrote:
I'm not trying to replace the R-URI like in your example, im trying to remove a prefix from the RURI
Oh, I see.
You might consider stripping[1] the necessary number of characters from the user part of the RURI, then.
$var(prefix_len) = $(var(PrefixMatch){s.len}); $var(destnumber1) = $(rU{s.strip,$var(prefix_len)});
-- Alex
[1] http://www.kamailio.org/wiki/cookbooks/4.3.x/transformations#sstrip_len