I used Linphone sdk to develop an android SIP phone, every thing is good but on some wifi network cant receive call and server return USER_NOT_REGISTERED error. for example :
at first after registration: User A and user B can make call to each other successfully.
after about ten minute, when user A make outgoing call to user B , server say user B in not registered and wise versa.
User A and B is registered because can hear server message.
server is asterisk.
I repeat this test with csipsimple and it work without problem.
my app now is complete and port it to csipsimple is not easy.
is there any way to fix it?
No, there are no even moderate complexity way fix it.
That is internal issues in registration on linphone. It is common and well-known at least 5 years, but linphone dev team not care much.
You can try fix linphone core, or just use sip ping(asterisk qualify= option) in attempt to not loose connection.