[SR-Users] check for the number of open branches in Reply

Daniel-Constantin Mierla miconda at gmail.com
Fri Jun 6 10:21:34 CEST 2014


Hello,

On 04/06/14 11:49, Sebastian Damm wrote:
> Hi,
>
> I have a scenario where I want to send a custom SIP package whenever a 
> call is successfully established or definitely missed. This works 
> pretty well, except when a user has multiple devices online.
>
> I need to send exactly one packet. When initiating the call I set a 
> flag, in the reply route I check for that flag, and on the first 4xx 
> or 2xx response the packet gets sent out. After that I reset the flag, 
> so no other packet is generated for another response coming in.
>
> Now when a user has two devices and rejects the call on the first one 
> but accepts it on the second, I see this call as missed, not answered. 
> So I need to use the first 2xx response or the last 4xx response. For 
> that I need to find out how many branches are open at the moment. But 
> I'm missing something. I registered two devices on the same AOR. I 
> tried accessing $branch(count) in the onreply route, but it is always 
> 0. $br and $bR are <null>.
>
> Does anyone have an idea, how to get that information in the reply_route?
try to save the number of branches in an avp before t_relay() in 
request_route.

Cheers,
DAniel

-- 
Daniel-Constantin Mierla - http://www.asipto.com
http://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda




More information about the sr-users mailing list