[OpenSER-Devel] [ openser-Patches-1775285 ] Add new assignment operator (:=) to config script

SourceForge.net noreply at sourceforge.net
Thu Aug 16 11:43:50 CEST 2007


Patches item #1775285, was opened at 2007-08-16 11:43
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=743022&aid=1775285&group_id=139143

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: None
Group: None
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: axlh (axlh)
Assigned to: Nobody/Anonymous (nobody)
Summary: Add new assignment operator (:=) to config script

Initial Comment:
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 at openser.org
http://openser.org/cgi-bin/mailman/listinfo/devel

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=743022&aid=1775285&group_id=139143



More information about the Devel mailing list