Hello,
On 6/12/12 12:51 PM, Min Wang wrote:
HI Daniel:
thanks a lot for the explaination.
I have tried the jitsi and bria.
jitsi use this kind of xcap uri: /xcap/resource-lists/users/sip:w102@192.168.51.20/index
while bria/eyebeam use: /xcap/org.openmobilealliance.pres-rules/users/w103@192.168.51.20/pres-rules
The bria/eyebeam client does not have starting "sip:" on the xuid part.
so for the bria case the $var(uri) need to be updated as: $var(uri) = "sip:"+ $xcapuri(u=>xuid); Otherwise the kamailio xcap will give some ERROR: pv
[pv_trans.c:522]: invalid uri [w103@192.168.51.20]
Yes, prefixing with 'sip:' is required in such case, as it has to get to a full sip uri format.
It is the xcaps_put/del using $var(uri) that confuse me a little
bit, I thought it would store $var(uri) in the db.
xcaps_put("$var(uri)", "$hu", "$rb"); xcaps_del("$var(uri)", "$hu");
After checking the db, it seems the doc_uri has been stored
correctly.
It seems some magic happened in the function:
xcaps_put("$var(uri)", "$hu", "$rb"); Just wondering why $var(uri) is needed if all the info are in $hu? I have not checked the source code. :(
Each xcap document is stored for a specific user, whose ID is taken from first parameter of xcap_put(...)/etc. Now the user id can be the same as in xcap url or something known only internally, looked up via some logic in config. In this way you have full flexibility, not hardcoding to use only what xcap url gives. Also, as you notice, the xcap url can have different variants, you can normalized to a desired one by script operations.
Not sure you spotted yet, there is a tutorial that might be useful reading as well:
http://kb.asipto.com/kamailio:presence:k31-made-simple
Cheers, Daniel
kind regards.
min
On 06/12/2012 12:10 PM, Daniel-Constantin Mierla wrote:
Hello,
On 6/12/12 11:28 AM, Min Wang wrote:
Hi I am trying to use kamailio xcap server, saw the sample code:
if($xcapuri(u=>xuid)=~"^sip:.+@.+") $var(uri) = $xcapuri(u=>xuid); else $var(uri) = "sip:"+ $xcapuri(u=>xuid) + "@" + $Ri; why should the xuid have sip:xx@domain.com format? The xcap standard seems does not enforce the format on the xui
part?
http://xcap.example.com/root/resource-lists/users/joe |-------------v-------------||------v------||---v---| document root AUID XUI
the xuid is not not changed -- $var(uri) is built out of it to get to a SIP address (for a coherent format with xuid with or without domain part), but in database the xcap uri is stored as received.
In sip, the user id is email-like address, some functions required that, so if the domain part is missing, then the local ip is used.
Have you encountered some problem due to this thing or is some field in database stored with wrong value?
Cheers, Daniel