The IP multimedia subsystem is becoming the de facto standard for IP-based multimedia services, while wireless sensor networks are gaining in popularity due to their ability to capture a rich set of contextual information. Integrating the sensing capabilities of WSNs in the IMS can open the door to a wide range of context-aware applications in areas such as wireless healthcare and pervasive gaming. We have previously proposed a presence-based architecture for WSN/IMS integration. This architecture relies on two key components: a WSN/IMS gateway acting as an interworking unit between WSNs and the IMS; and an extended presence server serving as a context information management node in the core network. In this article we focus on the design and implementation of these two components. Furthermore, two applications (a pervasive game and a personalized call control application) are used to concretely show how new applications can be developed using our architecture. Performance has also been evaluated. Several important findings were made in the course of this work; one is that the IMS integration with a large and evolving variety of WSNs may be a never-ending endeavor - the gateway requiring constant upgrading due to the lack of standard APIs for the interaction with sensors produced by different vendors. Another finding is that while the introduction of context as an application building block in the IMS ensures the availability of additional contextual information in the network and enables fast and easy development of context-aware applications, the lack of mature IMS application development toolkits remains a roadblock.