<?php
$extension = "754";
$realm = "ds.local.beip.be";
$enable_tcp = true;
$uri = "sip:$extension@$realm";
if ($enable_tcp)
$uri .= ';transport=tcp';
$etag = '.';
$id = "754-web";
$status = "away";
$extended_status = "Belgian Beer Rocks";
$ttl = "3600";
$xml = "<?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'
entity='pres:{{ $extension }}@{{ $realm }}'>
<tuple{{ if $id }} id='{{ $id }}'{{ /if }}>
<status><basic>open</basic></status>
<contact priority='1'>sip:{{ $extension }}@{{ $realm }}</contact>
<note>{{ $extended_status|escape }}</note>
</tuple>
<dm:person id='{{ $id }}-pid'>
<rpid:activities><rpid:{{ $status }}/></rpid:activi";
$args = array ($uri, $ttl, 'presence', 'application/pidf+xml', $etag, '.',
$xml);
$path = implode ($args, ',');
$ch = curl_init ();
curl_setopt ($ch, CURLOPT_URL,
"http://127.0.0.1:8011/json/pua_publish?params=" . urlencode
($path));
curl_setopt ($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt ($ch, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($ch, CURLOPT_HTTP_VERSION, 1.1);
curl_setopt($ch, CURLOPT_HTTPHEADER, array ("Accept: application/json"));
curl_setopt($ch, CURLOPT_TIMEOUT, 2);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$s = curl_exec ($ch);
echo $s . " ici \n";
curl_close ($ch);
?>
---
Reply to this email directly or view it on GitHub:
https://github.com/OpenSIPS/opensips/issues/552#issuecomment-111158777
_______________________________________________
Devel mailing list
Devel@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/devel