Can you double check that $var(sip_url) is actually set to the right uri? Try also with the uri parameter in between quotes:
You can execute:
``` ds_is_active("1", "$var(sip_url)"); $var(rc) = $rc; xinfo("check active uri: $var(sip_url) returned $var(rc)\n"); ```
Otherwise the code seems ok and the function hasn't been changed for quite some time.