Hi list, 

My team are developing a SIP client for mobile running iOS , 

then having to deal with the "back ground mode" problem while this soft is installed on mobiles

One of the solutions is using APNS. (Apple Push Notification Service)

I wanna to use Kamailio as SIP Redirect / Proxy for my current SIP server 

The model is like that:

User A <---------> Kamailio  <---------> SIP server <--------> User B

IF UserA call UserB, UserB is not available now (not registered yet), normally, SIP server will reply Kamailio with "404 Not found"

In that case, i want to set up Kamailio do the communication with APNS and waiting  for UserB "Wake up" then RESEND the Invite message ......
(instead of forwarding this 404 message to UserA)

I am getting stuck at how Kamailio can control "404 Not found" message which it receives from SIP server .

I do searching around several days but still can not get any clearer points. 

Please help me with some instruction/ configuration of Kamailio for this case ! 

Thank you very much.