I am trying to develop a scenario where an extension gets registered on Asterisk when it receives a push notification. This push notification is sent to the sip extension when a call towards this extension reaches to the Asterisk.
For example, suppose there is two SIP extension( extension 1 and extension 2) registered on Asterisk. When a call from extension 1 reaches the asterisk, it forwards the INVITE request towards extension 2. suppose the extension 2 is not able to receive the INVITE request from Kamailio. When extension two receive a push notification, it will register on asterisk.
So I need to get the call on extension 2 through the new registration.
We are trying to simulate registration of extension to the asterisk when receiving the push notification.
First, we registered extension 2 and disconnected the network. Then we tried to register the same extension when a call from extension 1 reaches to Asterisk. This is a simulation of push-based registration since an extension that receives the push will attempt to register when an incoming call is received.
Even though new registration of extension reached to Asterisk, it tries to retransmit the INVITE request to the old port.
This is the problem for me since push relies on the INVITE reaching the phone at the correct port number.
So, is there other good approaches to solve this issue?