I am interested in tracking the periods of participation of phones in calls on SIP switches and B2BUAs as they occur.
Ideally I’d like a solution that is standards-based and generally applicable.
After reading RFC 3265 and looking through the event packages it appeared that the “dialog” events from RFC 4235 were pretty much what I was looking for, as “presence” events only tell about endpoint state but not what calls are involved. As I started implementing (using Sofia-SIP), however, a closer reading of the RFC has raised some doubts. Before I put too much time into this, I want to make sure I’m barking up the right tree.
As regards Asterisk specifically and more broadly trying to understand the RFC and its application:
- How broad a subscription can be made? It isn’t clear if the event parameters in Section 3.2 of RFC 4235 (esp. call-id) are always required or merely available to narrow the notification stream.
- Can I subscribe for some resource of the B2BUA itself (i.e. of asterisk) to identify the other endpoints involved rather than subscribing to watch each endpoint? If so, what do I use for a TO URL?
- Can I simply use some kind of wildcard (e.g. sip:*@myswitch.mydomain.net)?
Assuming I need to register for the dialog events of each interesting endpoint through the asterisk switch:
- Is it feasible to receive notifications for hundreds of endpoints or will that decimate server network performance?
- In order to subscribe for dialog events for an endpoint, does the endpoint phone itself need to support them?
- In order to subscribe for dialog events for an endpoint, does the endpoint need to be up when the subscription is made?
- If not, is it possible to enumerate the currently active endpoints and receive events upon endpoint registration?
And perhaps the most obvious question -
- Is there some other event package that I should be looking at instead?
OK - Let’s just try something much more concrete to start with…
I have a very small asterisk environment on denis.lupestro.net with endpoints: cortland, fifi, mimi, and phydeaux.
Each of these has an extension in the dial plan for 100, 101, 102, 103 respectively.
Each of these has a hint “SIP/cortland”, “SIP/fifi”, “SIP/mimi”, “SIP/phydeaux”.
They all talk to one another through denis.
“core show hints”, “sip show peers”, “sip show users” all look like I’d expect.
Hints, in particular look like: 101@LocalSets : SIP/fifi State:Unavailable Watchers 0
(State is Idle when the phone is up, which it isn’t at the moment, but it was during my testing.)
My client uses the Sofia toolkit to perform a subscription, so I add a user nokie for it.
For now everybody is in the LocalSets context (because I’m not sure how contexts will play into this yet).
- To get timely notification of all of the contacts getting placed, received, held, transferred, perhaps eventually even conferenced between the four endpoints, what set of URLs do I need to subscribe to from my client? (I’m thinking a mix of presence and dialog+xml stuff here.) I was figuring:
However, I get a 404 response on the subscribe for any of these.
Do the phones themselves need the relevant subscription support or is this being handled by asterisk in behalf of the clients? (In other words, by looking for the cause at the asterisk server itself, am I digging in the right field?)
What is the best way of getting sufficient logging to identify the specific reason for the 404 error?
Between request and response I get the following logging:
Creating new subscription
Sending to 192.168.2.15:5060 (NAT)
Found peer ‘nokie’ for ‘nokie’ from 192.168.2.15:5060
Looking for fifi in LocalSets (domain denis.lupestro.net)
OK - I tried the one thing that was left to me.
Since the logging said it was looking for fifi in LocalSets and the hint showed 101@LocalSets,
I tried using the extension on the hint as my TO: user (e.g. email@example.com).
Naturally, it worked. (This answered question 1)
I now get presence and dialog events for the phones from the asterisk server whether they are up or not.
(This answered question 2)
I’ve since renamed the exten => 101 on the hints to exten => fifi so that the behavior is a little more like I originally expected. As a side-note, the page or three on subscription hints in the otherwise excellent starfish book wasn’t quiiite enough to get me by this time, although it did point in the right direction. (A little more on subscriptions maybe for the next round ? )
So now that I’ve answered my second batch of questions, I still have the following from the first batch:
- If I want to see all the call activity, do I have to ask for each of the endpoints? Or is there an easier way?
- From a performance and network perspective, is subscribing for all that activity generally a reasonable thing to do?
- How do I discover (remotely, preferably via an RFC) the list of available endpoints to ask for call activity on?
- Is there any way to get dialog events from Asterisk to report call IDs in the attribute?
- Is there any way to watch the phones go on and off of hold as well?