I have tested how I can control a SIP-phone receiving a call to go off-hook.  This is possible by sending a NOTIFY with the SIP Event-header set to talk.

 

My problem is that the NOTIFY message does not include exactly the same SIP To-header information as the FS received as a RINGING response to the INVITE: The tag from the RINGING response, which the phone adds to the SIP To-header, is not included in the NOTIFY. Snom-phones - and possibly other SIP phones as well, uses this tag in the SIP To-header to pinpoint the exact call to be answered.

 

The information is actually present before the NOTIFY is sent. I have tested it in the dialplan using the info application just before firing off the sendevent NOTIFY.

 

Is there any reason for this behaviour, which I should be aware of before dabbling with the code?

 

I have checked the mod_sofia.c code and have found the code which sends the NOTIFY (with the uuid, event and message type as input parameters):

 

if (uuid && ct && es) {

       switch_core_session_t *session;

       private_object_t *tech_pvt;

         //Jon changed: SIPTAG_SUBSCRIPTION_STATE_STR("terminated;reason=noresource") to SIPTAG_SUBSCRIPTION_STATE_STR("active")

       if ((session = switch_core_session_locate(uuid))) {

              if ((tech_pvt = switch_core_session_get_private(session))) {

                     nua_notify(tech_pvt->nh,

                                      NUTAG_NEWSUB(1), SIPTAG_SUBSCRIPTION_STATE_STR("active"),

                                      SIPTAG_EVENT_STR(es), SIPTAG_CONTENT_TYPE_STR(ct), TAG_IF(!zstr(body), SIPTAG_PAYLOAD_STR(body)), TAG_END());

              }

              switch_core_session_rwunlock(session);

       }

}

 

But in order to change the behaviour, I may need to look somewhere else. Some hints as to where to look would be appreciated!

 

Regards Jon