sys.GetCurrentCallCount()

New features you'd like see on SIP Sorcery
Post Reply
reraikes
Posts: 237
Joined: Thu Aug 13, 2009 10:15 pm

sys.GetCurrentCallCount()

Post by reraikes » Sun Nov 22, 2009 4:38 pm

Aaron,

Any chance you could enhance the sys.GetCurrentCallCount() function to accept an optional account argument?

Given an owner named 'owner' with sip accounts of 'acct1' and 'acct2', it's my understanding that sys.GetCurrentCallCount() currently returns the number of calls in progress for 'owner' (i.e. 'acct1' + 'acct2'). It would be nice to be able to invoke sys.GetCurrentCallCount('acct1') and sys.GetCurrentCallCount('acct2') to determine the number of calls in progress on each individual sip account.

Thanks,
Ron

Aaron
Site Admin
Posts: 4652
Joined: Thu Jul 12, 2007 12:13 am

Post by Aaron » Sun Nov 22, 2009 9:59 pm

Hi Ron,

The SIP account involved in the call is not tracked explicitly. What I could probably come up with is a way for you to query answered (but not hung up) call detail records.

You'd be able to pick a field (maybe fields if needed) from the list below and a string to match them against.

direction varchar(3) not null, -- In or Out with respect to the proxy.
created varchar(30) not null, -- Time the cdr was created by the proxy.
dst varchar(128), -- The user portion of the destination URI.
dsthost varchar(128) not null, -- The host portion of the destination URI.
dsturi varchar(1024) not null, -- The full destination URI.
fromuser varchar(128), -- The user portion of the From header URI.
fromname varchar(128), -- The name portion of the From header.
fromheader varchar(1024), -- The full From header.
callid varchar(256) not null, -- The Call-ID of the call.
localsocket varchar(64) not null, -- The socket on the proxy used for the call.
remotesocket varchar(64) not null, -- The remote socket used for the call.
bridgeid varchar(36), -- If the call was involved in a bridge the id of it.
inprogresstime varchar(30) null default null, -- The time of the last info response for the call.
inprogressstatus int, -- The SIP response status code of the last info response for the call.
inprogressreason varchar(64), -- The SIP response reason phrase of the last info response for the call.
ringduration int, -- Number of seconds the call was ringing for.
answeredtime varchar(30) null default null, -- The time the call was answered with a final response.
answeredstatus int, -- The SIP response status code of the final response for the call.
answeredreason varchar(64), -- The SIP response reason phrase of the final response for the call.

Regards,

Aaron

MikeTelis
Posts: 1582
Joined: Wed Jul 30, 2008 6:48 am

Post by MikeTelis » Sun Nov 22, 2009 10:14 pm

Hi Aaron,

Ron's request is inspired by this problem and I think that call-in-progress counter(s) is not the right tool to answer this challenge.

Let's consider this scenario. A call comes and it's routed to CH1, a phone registered into this account is ringing (but the call wasn't yet answered); call-in-progress counter is still zero. Another call comes in (while the first is still ringing) and it would be quite logical to forward it to the phone registered into second SIP account. However, since the call-in-progress counter is still zero we forward it to CH1 and get 486 / busy => call rejected.

I think we should discuss this (and maybe the other) scenarios before rushing up to solutions that do not actually solve the problem.

Sincerely,

Mike

Post Reply