Browse code

modules_k/xcap_server: Added $xcapuri(u=>uri_adoc) pvar

- This gives access to the adoc field in the internal xuri
data-structure (the xuri without xpath).

Peter Dunkley authored on 10/04/2012 16:57:25
Showing 3 changed files
... ...
@@ -264,7 +264,7 @@ event_route[xhttp:request] {
264 264
 
265 265
      * $xcapuri(name=>key) - name can be any to idenitfy the XCAP uri; key
266 266
        can be: data, uri, root, auid, type, tree, xuid, file, node,
267
-       target, domain.
267
+       target, domain, uri_adoc.
268 268
 
269 269
    Exported pseudo-variables are documented at
270 270
    http://www.kamailio.org/dokuwiki/.
... ...
@@ -307,7 +307,7 @@ event_route[xhttp:request] {
307 307
 			<listitem><para>
308 308
 				<emphasis>$xcapuri(name=>key)</emphasis> - name can be any
309 309
 				to idenitfy the XCAP uri; key can be: data, uri, root, auid,
310
-				type, tree, xuid, file, node, target, domain.
310
+				type, tree, xuid, file, node, target, domain, uri_adoc.
311 311
 			</para></listitem>
312 312
 		</itemizedlist>
313 313
 		<para>
... ...
@@ -814,6 +814,8 @@ int pv_parse_xcap_uri_name(pv_spec_p sp, str *in)
814 814
 		pxs->ktype = 9;
815 815
 	} else if(pxs->key.len==6 && strncmp(pxs->key.s, "domain", 6)==0) {
816 816
 		pxs->ktype = 10;
817
+	} else if(pxs->key.len== 8 && strncmp(pxs->key.s, "uri_adoc", 8)==0) {
818
+		pxs->ktype = 11;
817 819
 	} else {
818 820
 		LM_ERR("unknown key type [%.*s]\n", in->len, in->s);
819 821
 		goto error;
... ...
@@ -917,6 +919,11 @@ int pv_get_xcap_uri(struct sip_msg *msg,  pv_param_t *param,
917 917
 			/* get domain */
918 918
 			if(pxs->xus->xuri.domain.len>0)
919 919
 				return pv_get_strval(msg, param, res, &pxs->xus->xuri.domain);
920
+		case 11:
921
+			/* get xuri->adoc */
922
+			if(pxs->xus->xuri.adoc.len>0)
923
+				return pv_get_strval(msg, param, res, &pxs->xus->xuri.adoc);
924
+		break;
920 925
 		break;
921 926
 		default:
922 927
 			return pv_get_null(msg, param, res);