I am trying to write a php
script to add VCard details of an existing user, registered to our ejabberd server
. In the vcard table
, there is a field vcard
. I understand it is populated by an XML-data
. Could you please guide me as to how I should implement this feature, adding VCard using php
. I tried a few sample examples available in the internet, none of them works. can this be done without using ejabberd-xmlrpc
module? Are there any php
library where the feature is already implemented?
Asked
Active
Viewed 835 times
1

sonkhya
- 17
- 1
- 6
2 Answers
0
$ ejabberdctl set_vcard user1 localhost NICKNAME "User 1"
$ ejabberdctl get_vcard user1 localhost NICKNAME
User 1
$ ejabberdctl help set_vcard
Command Name: set_vcard
Arguments: user::binary
host::binary
name::binary
content::binary
Returns: res::rescode
Tags: vcard
Description: Set content in a vCard field
Some vcard field names in get/set_vcard are:
FN - Full Name
NICKNAME - Nickname
BDAY - Birthday
TITLE - Work: Position
ROLE - Work: Role
Some vcard field names and subnames in get/set_vcard2 are:
N FAMILY - Family name
N GIVEN - Given name
N MIDDLE - Middle name
ADR CTRY - Address: Country
ADR LOCALITY - Address: City
TEL HOME - Telephone: Home
TEL CELL - Telephone: Cellphone
TEL WORK - Telephone: Work
TEL VOICE - Telephone: Voice
EMAIL USERID - E-Mail Address
ORG ORGNAME - Work: Company
ORG ORGUNIT - Work: Department
For a full list of vCard fields check XEP-0054: vcard-temp at
http://www.xmpp.org/extensions/xep-0054.html

Badlop
- 3,840
- 1
- 8
- 9
-
hi are there any php or python library to add vcard? if the user is not logged in, can we add a vcard on the server side only? or do we need the user logged in in order to add a vcard? – sonkhya Sep 14 '18 at 12:20
-
thanks I implemented it and it worked fine from the commandline. – sonkhya Sep 14 '18 at 12:20
0
ejabberdctl help set_vcard2
Command Name: set_vcard2
Arguments: user::binary
host::binary
name::binary
subname::binary
content::binary
Returns: res::rescode
Tags: vcard
Module: mod_admin_extra
Description: Set content in a vCard subfield
Some vcard field names and subnames in get/set_vcard2 are:
* N FAMILY - Family name
* N GIVEN - Given name
* N MIDDLE - Middle name
* ADR CTRY - Address: Country
* ADR LOCALITY - Address: City
* TEL HOME - Telephone: Home
* TEL CELL - Telephone: Cellphone
* TEL WORK - Telephone: Work
* TEL VOICE - Telephone: Voice
* EMAIL USERID - E-Mail Address
* ORG ORGNAME - Work: Company
* ORG ORGUNIT - Work: Department
For a full list of vCard fields check XEP-0054: vcard-temp at https://xmpp.org/extensions/xep-0054.html
Set phone number:
# ejabberdctl set_vcard2 some_username some.host TEL HOME "+1(234) 567-89-01"
Set Company Name:
# ejabberdctl set_vcard2 some_username some.host TEL HOME "+1(234) 567-89-01"

Someone
- 19
- 4