[Spce-user] API for getting current calls status?
Andreas Granig
agranig at sipwise.com
Fri Oct 5 07:42:19 EDT 2012
Hi Matt,
On 10/05/2012 02:48 AM, Matt Van Veenendaal wrote:
> I've been working through the API and hooking up things like getting
> subscriber calls, but are there any realtime api hooks for checking if a
> user is actually on the phone or not right now? I tried making a call
> while using get_subscriber_calls and this did not update in real time.
These things are extracted from the accounting.cdr table, which are
populated up to 30sec after a call.
There's currently no prepared way to do what you want, but there are
tools on the platform to query real-time call infos, e.g. you can do it
manually like this:
root at spce:~# ngcp-sercmd proxy
sercmd 0.2
Copyright 2006 iptelorg GmbH
This is free software with ABSOLUTELY NO WARRANTY.
For details type `warranty'.
sercmd> dlg.list
hash:1110:8761 state:4 ref_count:2 timestart:1349436686 timeout:63884767
callid:c8b5e0ad6b38eb7e430628b2c4dff189 at 0:0:0:0:0:0:0:0
from_tag:f2585f1e to_tag:15005C96-506EC508000ABCA0-38A49700
from_uri:sip:testuser1 at 192.168.51.133 to_uri:sip:testuser3 at 192.168.51.133
caller_contact:sip:testuser1 at 10.10.8.15:17168;alias=192.168.51.1~17168~1;transport=udp;registering_acc=192_168_51_133 caller_cseq:2
caller_route_set:
<sip:127.0.0.1;r2=on;lr=on;ftag=f2585f1e;nat=yes;ngcplb=yes>,<sip:192.168.51.133;r2=on;lr=on;ftag=f2585f1e;nat=yes;ngcplb=yes>
callee_contact:sip:testuser3 at 127.0.0.1:5080 callee_cseq:2
callee_route_set:
caller_bind_addr:udp:127.0.0.1:5062 callee_bind_addr:udp:127.0.0.1:5062
sercmd>
The above output shows a situation where one single call was running,
and with the from_uri or to_uri you could filter your subscriber info.
You can access the same info via XMLRPC, e.g. like this in
/usr/share/perl5/Sipwise/Provisioning/Voip.pm:
my $dispatcher = Sipwise::Provisioning::XMLDispatcher->new;
my @result = $dispatcher->dispatch("proxy-ng", 1, 1, <<EOF);
<?xml version="1.0" ?>
<methodCall>
<methodName>dlg.list</methodName>
<params/>
</methodCall>
EOF
# filter you call in @result here
Hope this helps to get you going,
Andreas
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 897 bytes
Desc: OpenPGP digital signature
URL: <http://lists.sipwise.com/pipermail/spce-user_lists.sipwise.com/attachments/20121005/b182f872/attachment-0001.asc>
More information about the Spce-user
mailing list