Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement load and restore of contact attributes #178

Merged
merged 3 commits into from Jun 11, 2015

Conversation

que273
Copy link
Contributor

@que273 que273 commented May 27, 2015

Implement load and restore of usrloc contact attributes in the t_load_contacts, t_next_contacts and t_next_contact_flows functions in tm module.

Includes documentation of the new tm parameter 'xavp_contact'

Hugh Waite added 2 commits May 27, 2015 14:33
- Note that tm xavp_contact parameter must match
- Add xavp_contact parameter for name of xavp holding attributes from usrloc
- t_load_contacts: Load per branch attributes into contact XAVP
- t_next_contacts/t_next_contact_flow: Restore branch attributes
@que273 que273 changed the title Hpw/contact attributes Implement load and restore of contact attributes May 27, 2015
@que273
Copy link
Contributor Author

que273 commented Jun 8, 2015

Does anyone have any comments on my fix?
Can I merge and backport?

@kamailio-sync
Copy link

kamailio-sync commented Jun 8, 2015 via email

@que273
Copy link
Contributor Author

que273 commented Jun 9, 2015

The tm module needs to know the name of the attributes AVP, which is currently passed as a modparam to the usrloc module. Therefore to 'activate' this bugfix, you need to pass the same modparam to the tm module.E.g.
modparam("usrloc|tm", "xavp_contact", "ulattrs")
If the modparam is not given to tm, the system will behave as before.
There are no changes to the way the functions are called.

@juha-h
Copy link
Contributor

juha-h commented Jun 10, 2015 via email

@miconda
Copy link
Member

miconda commented Jun 11, 2015

No, is not in 4.3 --- actually, this pull request is not even merged in master.

As I see the comments above, the discussion was still open. From my point of view, it can be merged and backported if it is a fix.

que273 added a commit that referenced this pull request Jun 11, 2015
Implement load and restore of contact attributes
@que273 que273 merged commit 9529a6b into master Jun 11, 2015
@que273 que273 deleted the hpw/contact-attributes branch June 11, 2015 08:35
@juha-h
Copy link
Contributor

juha-h commented Jun 12, 2015 via email

@que273
Copy link
Contributor Author

que273 commented Jun 12, 2015

If the usrloc parameter "xavp_contact" is set, the given XAVP is populated with the contact attributes when the "lookup" function is called. The usrloc README example uses the name 'ulattrs'.

The tm module parameters 'contacts_avp' and 'contact_flows_avp' are populated when the t_load_contacts() function is called. These store the data from the branch structures but, before my changes, did not know anything about the attributes loaded by usrloc.

My changes mean that the usrloc attributes are now loaded into the 'contacts_avp' data when t_load_contacts() is called. However, the tm module needs to know the name of the XAVP that usrloc stored these attributes in, hence the new parameter and why they must have the same value.

If you do not set the 'xavp_contact' parameter in usrloc, then attributes are not stored / loaded when you call 'register' / 'lookup'. It is therefore not needed in tm module either.
If you supply the parameter to usrloc, but NOT tm, then the attributes are ignored by the load/next_contacts functions and the bug will still be present.

@kamailio-sync
Copy link

kamailio-sync commented Jun 12, 2015 via email

@kamailio-sync
Copy link

This fix regards the tag-value pairs that are stored in the 'location-attrs' table.

I am adding custom values to the REGISTER transaction just before calling save() and need them to be restored per branch when calling lookup().

Hugh

-----Original Message-----
From: sr-dev [mailto:sr-dev-bounces@lists.sip-router.org] On Behalf Of Juha Heinanen
Sent: 12 June 2015 17:23
To: kamailio/kamailio; Kamailio (SER) - Development Mailing List
Subject: Re: [sr-dev] [kamailio] Implement load and restore of contact attributes (#178)

Hugh Waite writes:

The tm module parameters 'contacts_avp' and 'contact_flows_avp' are
populated when the t_load_contacts() function is called. These store
the data from the branch structures but, before my changes, did not
know anything about the attributes loaded by usrloc.

thanks for your explanation. by usrloc attributes you mean all the fields of location table?

-- juha


sr-dev mailing list
sr-dev@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev


This e-mail and any attachment is for authorised use by the intended recipient(s) only. It may contain proprietary material, confidential information and/or be subject to legal privilege. It should not be copied, disclosed to, retained or used by, any other party. If you are not an intended recipient then please promptly delete this e-mail and any attachment and all copies and inform the sender. Thank you for understanding.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants