Hello Alex,
thanks for the patch, definitely will be integrated to the devel branch.
Please register the patch to the tracker on sourceforge, not to get
lost. probably next week I will have the time to review and commit.
Thanks,
Daniel
On 08/16/07 12:15, Alex Hermann wrote:
Hello all,
find attached a patch which adds a new assignment operator (:=) to the config
script. Instead of the regular assignment (=), this operator will not add an
entry to an existing avp, but it deletes the existing avp and creates a new
avp with only one value.
I think this is usefull because I was using a lot of avp_delete()/assignment
sequences to keep just 1 value in an avp instead of a list.
Please review and comment on it. Although the patch seems to work ok, I don't
have any insight in the pointer dances OpenSER does, so I might have done
something completely insane.
If the patch is acceptable as is, please commit.
Patch is against OpenSER 1.2 svn revision 2606
Config example and result:
route {
xlog("Part 1");
$avp(s:test1) = "test1_1";
$avp(s:test1) = "test1_2";
$avp(s:test2) := "test2_1";
$avp(s:test2) := "test2_2";
avp_print();
xlog("Part 2");
$avp(s:test1) := "test1_3";
$avp(s:test2) = "test2_3";
avp_print();
}
Log snippet:
[19924]: Part 1
[19924]: INFO:avpops:print_avp: p=0xb5c4fbc0, flags=0x0003
[19924]: INFO: name=<test2>
[19924]: INFO: val_str=<test2_2 / 7>
[19924]: INFO:avpops:print_avp: p=0xb5c4fb90, flags=0x0003
[19924]: INFO: name=<test1>
[19924]: INFO: val_str=<test1_2 / 7>
[19924]: INFO:avpops:print_avp: p=0xb5c4fb60, flags=0x0003
[19924]: INFO: name=<test1>
[19924]: INFO: val_str=<test1_1 / 7>
[19924]: Part 2
[19924]: INFO:avpops:print_avp: p=0xb5c4fb90, flags=0x0003
[19924]: INFO: name=<test2>
[19924]: INFO: val_str=<test2_3 / 7>
[19924]: INFO:avpops:print_avp: p=0xb5c4fb60, flags=0x0003
[19924]: INFO: name=<test1>
[19924]: INFO: val_str=<test1_3 / 7>
[19924]: INFO:avpops:print_avp: p=0xb5c4fbc0, flags=0x0003
[19924]: INFO: name=<test2>
[19924]: INFO: val_str=<test2_2 / 7>
------------------------------------------------------------------------
_______________________________________________
Devel mailing list
Devel@openser.org
http://openser.org/cgi-bin/mailman/listinfo/devel
_______________________________________________
Devel mailing list
Devel@openser.org
http://openser.org/cgi-bin/mailman/listinfo/devel