OpenSER with OpenXCAP integration
|
| Author |
Message |
osiris123d
Joined: Jan 04, 2009
Posts: 20
Status: Offline
|
| Posted:
Jan 11, 2009 - 01:58 AM |
|
|
I have OpenSER and OpenXCAP configured on 2 different servers. I have openser-mi-proxy configured on the OpenSER server and SOAP-SIMPLE-Proxy on the OpenXCAP server. From the logs I can see that the OpenXCAP server is logging into the OpenSER MySQL Service shown here
090110 19:27:11 407 Query select rlsubs_did,resource_uri,auth_state,content_type,reason,presence_state from rls_presentity
where updated=1 order by rlsubs_did
090110 19:27:14 430 Connect openserro@localhost on openser
430 Query SET NAMES latin1
430 Query select password,rpid from subscriber where username='3000'
431 Connect openser@localhost on openser
431 Query SET NAMES latin1
431 Query select status,expires,watcher_username,watcher_domain from active_watchers where presentity_uri=
'sip:3000@192.168.0.103' AND event='presence'
432 Connect openser@localhost on openser
432 Query SET NAMES latin1
432 Query select doc from xcap where username='3000' AND domain='192.168.0.103' AND doc_type=2
432 Query insert into presentity (domain,username,event,etag,expires,body,received_time ) values ('192.168
.0.103','3000','presence','a.1231302146.28528.3.0',1231640834,'<?xml version=\'1.0\' encoding=\'UTF-8\'?><presence xmlns=\'urn:ietf:
params:xml:ns:pidf\' xmlns:dm=\'urn:ietf:params:xml:ns:pidf:data-model\' xmlns:rpid=\'urn:ietf:params:xml:ns:pidf:rpid\' xmlns:c=\'u
rn:ietf:params:xml:ns:pidf:cipid\' xmlns:lt=\'urn:ietf:params:xml:ns:location-type\' entity=\'sip:3000@192.168.0.103\'><tuple id=\'t
ab160304\'><status><basic>open</basic></status></tuple><dm:person id=\'p516e4b3d\'><dm:note>Available</dm:note></dm:person></presenc
e>',1231637234)
432 Query select to_user,to_domain,watcher_username,watcher_domain,event_id,from_tag,to_tag,callid,local_c
seq,record_route,contact,expires,reason,socket_info,local_contact,version from active_watchers where presentity_uri='sip:3000@192.16
8.0.103' AND event='presence' AND status=1
433 Connect openser [!at] xcap.xxx.net (replace the [!at] with a @) on openser
433 Query SET NAMES latin1
433 Query SELECT password
FROM subscriber
WHERE username = '3000'
AND domain = 'xxx.net'
433 Query commit
434 Connect openser [!at] xcap.xxx.net (replace the [!at] with a @) on openser
434 Query SET NAMES latin1
434 Query SELECT doc, etag FROM xcap
WHERE username = '3000' AND domain = 'xxx.net'
AND doc_type= 2 AND doc_uri='index.xml'
434 Query commit
090110 19:27:15 435 Connect openser [!at] xcap.xxx.net (replace the [!at] with a @) on openser
435 Query SET NAMES latin1
435 Query SELECT password
FROM subscriber
WHERE username = '3000'
AND domain = 'xxx.net'
435 Query commit
436 Connect openser [!at] xcap.xxx.net (replace the [!at] with a @) on openser
436 Query SET NAMES latin1
436 Query SELECT doc, etag FROM xcap
WHERE username = '3000' AND domain = 'xxx.net'
AND doc_type= 4 AND doc_uri='resource-list.xml'
436 Query commit
On the OpenXCAP server I see that the Bria Counterpath client is connecting, but I see some 401 errors.
/org.openmobilealliance.pres-rules/users/3000@xxx.net/pres-rules HTTP/1.1' 401 0 141 - -
REQUEST headers:
Host: xcap.xxx.net
Accept: */*
2009-01-10 19:27:19-0600 [-] 192.168.0.100 'GET /xcap-root/org.openmobilealliance.pres-rules/users/3000@xxx.net/pres-rules HTTP/1.
1' 200 0 196 - "558cf0a81c248c5d61bd136f6af5834f"
2009-01-10 19:27:19-0600 [HTTPChannel,50,192.168.0.100] 192.168.0.100 'GET /xcap-root/resource-lists/users/3000@xxx.net/resource-l
ist.xml HTTP/1.1' 401 0 141 - -
REQUEST headers:
Host: xcap.xxx.net
Accept: */*
2009-01-10 19:27:19-0600 [-] 192.168.0.100 'GET /xcap-root/resource-lists/users/3000@xxx.net/resource-list.xml HTTP/1.1' 200 0 209
- "1fbaa80b2fe69475d8829f19400e7481"
Also when the Bria client is turned on I see the following logs in the syslog on the OpenSER server
Jan 10 20:07:22 OpenSER01 /sbin/kamailio[17259]: ERROR:presence:handle_subscribe: Missing or unsupported event header field value
Jan 10 20:07:22 OpenSER01 /sbin/kamailio[17259]: ERROR:presence:handle_subscribe: ^Ievent= message-summary
Jan 10 20:07:22 OpenSER01 /sbin/kamailio[17257]: ERROR:presence:handle_subscribe: Missing or unsupported event header field value
I guess my question is have I configured everything right or am I missing something? The configuration documentation is very lacking. The OpenXCAP website talks about installing SOAP-SIMPLE-Proxy, but I am not sure what it is suppose to do. I am also not sure that the OpenSER-MI-Proxy is receiving any connections or doing anything.
Is the OpenXCAP server suppose to have a MySQL database? How do I use the SOAP-SIMPLE-Proxy? What are the 401 errors from the Bria client for? And what are the syslog presence errors on the OpenSER Syslog? |
|
|
|
 |
osiris123d
Joined: Jan 04, 2009
Posts: 20
Status: Offline
|
| Posted:
Jan 11, 2009 - 09:42 PM |
|
|
So I believe OpenSER doesn't know how to connect to the OpenXCAP server. Here is the OpenSER config. How do I tell OpenSER how to access OpenXCAP?
loadmodule "db_mysql.so"
loadmodule "sl.so"
loadmodule "tm.so"
loadmodule "rr.so"
loadmodule "maxfwd.so"
loadmodule "usrloc.so"
loadmodule "registrar.so"
loadmodule "textops.so"
loadmodule "mi_fifo.so"
#loadmodule "mi_xmlrpc.so"
loadmodule "uri_db.so"
loadmodule "uri.so"
loadmodule "xlog.so"
loadmodule "acc.so"
/* uncomment next lines for MySQL based authentication support
NOTE: a DB (like db_mysql) module must be also loaded */
loadmodule "auth.so"
loadmodule "auth_db.so"
/* uncomment next line for aliases support
NOTE: a DB (like db_mysql) module must be also loaded */
#loadmodule "alias_db.so"
/* uncomment next line for multi-domain support
NOTE: a DB (like db_mysql) module must be also loaded
NOTE: be sure and enable multi-domain support in all used modules
(see "multi-module params" section ) */
#loadmodule "domain.so"
/* uncomment the next two lines for presence server support
NOTE: a DB (like db_mysql) module must be also loaded */
loadmodule "presence.so"
loadmodule "presence_xml.so"
loadmodule "rls.so"
loadmodule "pua.so"
loadmodule "pua_mi.so"
loadmodule "permissions.so"
# ----------------- setting module-specific parameters ---------------
#modparam("mi_xmlrpc", "log_file", "/var/log/openser-xmlrpc.log")
#modparam("mi_xmlrpc", "port", 8080)
# ----- mi_fifo params -----
modparam("mi_fifo", "fifo_name", "/tmp/kamailio_fifo")
# ----- rr params -----
# add value to ;lr param to cope with most of the UAs
modparam("rr", "enable_full_lr", 1)
# do not append from tag to the RR (no need for this script)
modparam("rr", "append_fromtag", 0)
# ----- rr params -----
modparam("registrar", "method_filtering", 1)
/* uncomment the next line to disable parallel forking via location */
# modparam("registrar", "append_branches", 0)
/* uncomment the next line not to allow more than 10 contacts per AOR */
#modparam("registrar", "max_contacts", 10)
# ----- uri_db params -----
/* by default we disable the DB support in the module as we do not need it
in this configuration */
modparam("uri_db", "use_uri_table", 0)
modparam("uri_db", "db_url", "")
# ----- acc params -----
/* what sepcial events should be accounted ? */
modparam("acc", "early_media", 1)
modparam("acc", "report_ack", 1)
modparam("acc", "report_cancels", 1)
/* by default ww do not adjust the direct of the sequential requests.
if you enable this parameter, be sure the enable "append_fromtag"
in "rr" module */
modparam("acc", "detect_direction", 0)
/* account triggers (flags) */
modparam("acc", "failed_transaction_flag", 3)
modparam("acc", "log_flag", 1)
modparam("acc", "log_missed_flag", 2)
/* uncomment the following lines to enable DB accounting also */
modparam("acc", "db_flag", 1)
modparam("acc", "db_missed_flag", 2)
# ----- usrloc params -----
modparam("usrloc", "db_mode", 0)
/* uncomment the following lines if you want to enable DB persistency
for location entries */
modparam("usrloc", "db_mode", 2)
#modparam("usrloc", "db_url",
# "mysql://openser:openserrw@localhost/openser")
# ----- auth_db params -----
/* uncomment the following lines if you want to enable the DB based
authentication */
modparam("auth_db", "calculate_ha1", yes)
modparam("auth_db", "password_column", "password")
#modparam("auth_db", "db_url",
# "mysql://openser:openserrw@localhost/openser")
#modparam("auth_db", "load_credentials", "")
# ----- alias_db params -----
/* uncomment the following lines if you want to enable the DB based
aliases */
#modparam("alias_db", "db_url",
# "mysql://openser:openserrw@localhost/openser")
# ----- domain params -----
/* uncomment the following lines to enable multi-domain detection
support */
#modparam("domain", "db_url",
# "mysql://openser:openserrw@localhost/openser")
#modparam("domain", "db_mode", 1) # Use caching
# ----- multi-module params -----
/* uncomment the following line if you want to enable multi-domain support
in the modules (dafault off) */
#modparam("alias_db|auth_db|usrloc|uri_db", "use_domain", 1)
# ----- presence params -----
/* uncomment the following lines if you want to enable presence */
#modparam("presence|presence_xml", "db_url",
# "mysql://openser:openserrw@localhost/openser")
#modparam("presence_xml", "force_active", 1)
#modparam("presence", "server_address", "sip:192.168.1.2:5060")
# -- presence params --
modparam("presence|pua|rls", "db_url", "mysql://openser:openserrw@localhost/openser")
modparam("presence", "server_address", "sip:192.168.0.103:5060")
modparam("presence", "fallback2db", 1)
# -- xcap params --
#modparam("presence_xml", "db_url", "mysql://openser:openser123d@xcap.duane.net/OpenXCAP")
modparam("presence_xml", "db_url", "mysql://openser:openserrw@localhost/openser")
modparam("presence_xml", "force_active", 0)
modparam("presence_xml", "xcap_table", "xcap")
modparam("presence_xml", "pidf_manipulation", 1)
modparam("presence_xml", "integrated_xcap_server", 1)
#modparam("presence_xml", "integrated_xcap_server", 0)
#modparam("presence_xml", "xcap_server", "xcap.duane.net")
# -- rls params --
modparam("rls", "integrated_xcap_server", 1)
modparam("rls", "to_presence_code", 10)
#modparam("rls","db_url", "mysql://openser:openser123d@192.168.0.104/OpenXCAP")
modparam("rls","db_url", "mysql://openser:openserrw@localhost/openser")
# -- permissions params --
modparam("permissions", "db_url", "mysql://openser:openserrw@localhost/openser") |
|
|
|
 |
osiris123d
Joined: Jan 04, 2009
Posts: 20
Status: Offline
|
| Posted:
Jan 18, 2009 - 11:28 PM |
|
|
OK... I guess my first posts were a little premature. Luckily the people that host openxcap.org updated their webpage and the picture depicting communication explains it a lot more for me. So Openser/Kamailio will not communicate with the OpenXCAP server, all communication will be one-way from OpenXCAP to OpenSER.
So from the OpenXCAP server I am seeing that it is getting connections from Bria Counterpath clients. I also see on the Kamailio server that the OpenXCAP server is connecting to the Kamailio Openser database.
The two Bria devices are able to subscribe to each others presence info, but the info is not getting updated at all.
I am seeing the following error on the Kamailio Syslog
Jan 18 17:11:10 OpenSER01 openser-mi-proxy[27198]: [-] Got XMLRPC request from 192.168.0.104: refreshWatchers (sip:3000@xxxxx.net pr
esence 0)
Jan 18 17:11:10 OpenSER01 openser-mi-proxy[27198]: [-] miproxy.openser.UNIXSocketProtocol starting on '/var/run/openser-mi-proxy/ope
nser_01.sock'
Jan 18 17:11:10 OpenSER01 openser-mi-proxy[27198]: [miproxy.openser.UNIXSocketProtocol (UDP)] error: Error while processing command
refreshWatchers (sip:3000@xxxxx.net presence 0): :refreshWatchers:
Jan 18 17:11:10 OpenSER01 openser-mi-proxy[27198]: [-] Got XMLRPC request from 192.168.0.104: pua_publish (sip:3000@xxxxx.net 3600 x
cap-diff application/xcap-diff+xml . . <?xml version="1.0" encoding="UTF-8"?>
Jan 18 17:11:10 OpenSER01 openser-mi-proxy[27198]: [-] <xcap-diff xmlns="urn:ietf:params:xml:ns:xcap-diff" xcap-root="https://xc
ap.xxxxx.net/xcap-root">
Jan 18 17:11:10 OpenSER01 openser-mi-proxy[27198]: [-] <document new-etag="3b151908e87278398ad4a0243fe9682a" sel="https://xcap.d
uane.net/xcap-root/org.openmobilealliance.pres-rules/users/3000@xxxxx.net/pres-rules" previous-etag="a145be4fbd768c5eb800162cf1f23d9
1"/>
Jan 18 17:11:10 OpenSER01 openser-mi-proxy[27198]: [-] </xcap-diff>
Jan 18 17:11:10 OpenSER01 openser-mi-proxy[27198]: [-] )
Jan 18 17:11:10 OpenSER01 openser-mi-proxy[27198]: [miproxy.openser.UNIXSocketProtocol (UDP)] error: Error while processing command
pua_publish (sip:3000@xxxxx.net 3600 xcap-diff application/xcap-diff+xml . . <?xml version="1.0" encoding="UTF-8"?>
Jan 18 17:11:10 OpenSER01 openser-mi-proxy[27198]: [miproxy.openser.UNIXSocketProtocol (UDP)] error: <xcap-diff xmlns="urn:ietf:
params:xml:ns:xcap-diff" xcap-root="https://xcap.xxxxx.net/xcap-root">
Jan 18 17:11:10 OpenSER01 openser-mi-proxy[27198]: [miproxy.openser.UNIXSocketProtocol (UDP)] error: <document new-etag="3b15190
8e87278398ad4a0243fe9682a" sel="https://xcap.xxxxx.net/xcap-root/org.openmobilealliance.pres-rules/users/3000@xxxxx.net/pres-rules"
previous-etag="a145be4fbd768c5eb800162cf1f23d91"/>
Jan 18 17:11:10 OpenSER01 openser-mi-proxy[27198]: [miproxy.openser.UNIXSocketProtocol (UDP)] error: </xcap-diff>
Jan 18 17:11:10 OpenSER01 openser-mi-proxy[27198]: [miproxy.openser.UNIXSocketProtocol (UDP)] error: ): :pua_publish:
Jan 18 17:11:10 OpenSER01 openser-mi-proxy[27198]: [-] Got XMLRPC request from 192.168.0.104: pua_publish (sip:3000@xxxxx.net 3600 x
cap-diff application/xcap-diff+xml . . <?xml version="1.0" encoding="UTF-8"?>
Jan 18 17:11:10 OpenSER01 openser-mi-proxy[27198]: [-] <xcap-diff xmlns="urn:ietf:params:xml:ns:xcap-diff" xcap-root="https://xc
ap.xxxxx.net/xcap-root">
Jan 18 17:11:10 OpenSER01 openser-mi-proxy[27198]: [-] <document new-etag="6964a91d5ba7b9903920166a3562207d" sel="https://xcap.d
uane.net/xcap-root/resource-lists/users/3000@xxxxx.net/resource-list.xml" previous-etag="5002012a71e71650d760a847df1b6633"/>
Jan 18 17:11:10 OpenSER01 openser-mi-proxy[27198]: [-] </xcap-diff>
Jan 18 17:11:10 OpenSER01 openser-mi-proxy[27198]: [-] )
Jan 18 17:11:10 OpenSER01 openser-mi-proxy[27198]: [miproxy.openser.UNIXSocketProtocol (UDP)] error: Error while processing command
pua_publish (sip:3000@xxxxx.net 3600 xcap-diff application/xcap-diff+xml . . <?xml version="1.0" encoding="UTF-8"?>
Jan 18 17:11:10 OpenSER01 openser-mi-proxy[27198]: [miproxy.openser.UNIXSocketProtocol (UDP)] error: <xcap-diff xmlns="urn:ietf:
params:xml:ns:xcap-diff" xcap-root="https://xcap.xxxxx.net/xcap-root">
Jan 18 17:11:10 OpenSER01 openser-mi-proxy[27198]: [miproxy.openser.UNIXSocketProtocol (UDP)] error: <document new-etag="6964a91
d5ba7b9903920166a3562207d" sel="https://xcap.xxxxx.net/xcap-root/resource-lists/users/3000@xxxxx.net/resource-list.xml" previous-eta
g="5002012a71e71650d760a847df1b6633"/>
Jan 18 17:11:10 OpenSER01 openser-mi-proxy[27198]: [miproxy.openser.UNIXSocketProtocol (UDP)] error: </xcap-diff>
Jan 18 17:11:10 OpenSER01 openser-mi-proxy[27198]: [miproxy.openser.UNIXSocketProtocol (UDP)] error: ): :pua_publish:
So it looks like the refreshwatchers command is not getting processed. Why is this not working? Just so you know I am using openser-mi-proxy instead of Kamailios XMLRPC module.
The only other logs I am getting at around the same time is on the OpenXCAP server in the error.log
2009-01-18 17:11:18-0600 [-] Starting factory <twisted.web.xmlrpc._QueryFactory instance at 0x9e107ac>
2009-01-18 17:11:18-0600 [QueryProtocol,client] Starting factory <twisted.web.xmlrpc._QueryFactory instance at 0x9e276ec>
2009-01-18 17:11:18-0600 [QueryProtocol,client] Stopping factory <twisted.web.xmlrpc._QueryFactory instance at 0x9e107ac>
2009-01-18 17:11:18-0600 [QueryProtocol,client] Stopping factory <twisted.web.xmlrpc._QueryFactory instance at 0x9e276ec>
2009-01-18 17:11:18-0600 [-] Starting factory <twisted.web.xmlrpc._QueryFactory instance at 0x9e270ec>
2009-01-18 17:11:18-0600 [QueryProtocol,client] Stopping factory <twisted.web.xmlrpc._QueryFactory instance at 0x9e270ec>
Any help is much appreciated. Once I get this all working I think I will post all my notes since this kind of setup is lacking. |
|
|
|
 |
osiris123d
Joined: Jan 04, 2009
Posts: 20
Status: Offline
|
| Posted:
Mar 02, 2009 - 05:52 AM |
|
|
I've been working with this for a while and I think I know why Presence isn't working.
When I have 2 new users first start up Bria they are able to do a PUT to OpenXCAP and upload the following files to the OpenSER database
2009-03-01 22:47:25-0600 [QueryProtocol,client] 192.168.0.100 'PUT /xcap-root/org.openmobilealliance.pres-rules/users/222@XXXXXX.net/
pres-rules HTTP/1.1' 201 0 - - "47c80aa4c0152ad9fa71d7b93e3289d0"
REQUEST headers:
Host: xcap.XXXXXX.net
Accept: */*
Authorization: Basic MjIyQGR1YW5lLm5ldDpwYXNzd29yZA==
Expect: 100-continue
RESPONSE headers:
Date: Mon, 02 Mar 2009 04:47:25 GMT
ETag: "47c80aa4c0152ad9fa71d7b93e3289d0"
Content-Type: application/auth-policy+xml
Server: OpenXCAP/1.0.6
2009-03-01 22:47:25-0600 [-] 192.168.0.100 'PUT /xcap-root/resource-lists/users/222@XXXXXX.net/resource-list.xml HTTP/1.1' 201 0 - -
"a4aa88042263c6d19406f547f49c69e0"
REQUEST headers:
Host: xcap.XXXXXX.net
Accept: */*
Authorization: Basic MjIyQGR1YW5lLm5ldDpwYXNzd29yZA==
Expect: 100-continue
RESPONSE headers:
Date: Mon, 02 Mar 2009 04:47:25 GMT
ETag: "a4aa88042263c6d19406f547f49c69e0"
Content-Type: application/resource-lists+xml
Server: OpenXCAP/1.0.6
2009-03-01 22:54:47-0600 [-] 192.168.0.100 'PUT /xcap-root/resource-lists/users/222@XXXXXX.net/contacts-resource-list.xml HTTP/1.1' 2
01 0 - - "c3d04b4688fecffc3b143dab4208e8eb"
REQUEST headers:
Host: xcap.XXXXXX.net
Accept: */*
Authorization: Basic MjIyQGR1YW5lLm5ldDpwYXNzd29yZA==
Expect: 100-continue
RESPONSE headers:
Date: Mon, 02 Mar 2009 04:54:47 GMT
ETag: "c3d04b4688fecffc3b143dab4208e8eb"
Content-Type: application/resource-lists+xml
Server: OpenXCAP/1.0.6
Those files seem to have no problem making it to the OpenSER database. Yet when I have one of the users add the other user as a contact Bria says that it is waiting for a response to approve from the other user. Well the other user can't approve because it never gets a message to approve. When I look in OpenXCAP logs I see that I get 401 errors.
2009-03-01 23:13:31-0600 [-] 192.168.0.100 'PUT /xcap-root/resource-lists/users/222@XXXXXX.net/contacts-resource-list.xml HTTP/1.1' 4
01 0 141 - -
REQUEST headers:
Host: xcap.XXXXXX.net
Accept: */*
Expect: 100-continue
RESPONSE headers:
Date: Mon, 02 Mar 2009 05:13:31 GMT
Content-Type: text/html
WWW-Authenticate: basic realm="XXXXXX.net"
Server: OpenXCAP/1.0.6
2009-03-01 23:18:18-0600 [-] 192.168.0.100 'PUT /xcap-root/org.openmobilealliance.pres-rules/users/222@XXXXXX.net/pres-rules HTTP/1.1
' 401 0 141 - -
REQUEST headers:
Host: xcap.XXXXXX.net
Accept: */*
Expect: 100-continue
RESPONSE headers:
Date: Mon, 02 Mar 2009 05:18:18 GMT
Content-Type: text/html
WWW-Authenticate: basic realm="XXXXXX.net"
Server: OpenXCAP/1.0.6
2009-03-01 23:18:19-0600 [-] 192.168.0.100 'PUT /xcap-root/resource-lists/users/222@XXXXXX.net/resource-list.xml HTTP/1.1' 401 0 141
- -
REQUEST headers:
Host: xcap.XXXXXX.net
Accept: */*
Expect: 100-continue
RESPONSE headers:
Date: Mon, 02 Mar 2009 05:18:19 GMT
Content-Type: text/html
WWW-Authenticate: basic realm="XXXXXX.net"
Server: OpenXCAP/1.0.6
I don't know why I am getting 401 errors when the Bria clients are trying to update the xcap docs. Theres got to be something small I am missing. It can't be this hard to get Presence working. Theres got to be someone out there that has this running. |
|
|
|
 |
osiris123d
Joined: Jan 04, 2009
Posts: 20
Status: Offline
|
| Posted:
Apr 08, 2009 - 02:17 AM |
|
|
Solved the issue.
Solution:
Ended up contacting Counterpath and telling them that I was seeing in a network sniff that the Bria client was sending a PUT once without the authorization and credentials and OpenXCAP would send a 401. The problem was that Bria would not send the PUT a second time with the authorization and credentials needed. Counterpath had me upgrade my Bria client to Version 2.5 build 52614. Everything is working now. I see Bria send 2 PUTs (The first without authorization and credentials, the second with authorization and credentials). |
|
|
|
 |
|
| Forum Rules and Guidelines |
About VoIP User |
Privacy Policy
|
All logos and trademarks in this site are property of their respective owner. Comments and posts are property of the poster, all the rest (c) 2003-2008 VoIP User Limited.
VoIP User Limited is incorporated in England and Wales under Company Number 6694577.
No part of this site may be reproduced without our prior consent.
|
|