[Freeswitch-users] How to send a SIP MESSAGE request to an unregistered user?

David R davidr201901 at outlook.com
Thu Apr 4 07:12:58 UTC 2019


When two users have registered themselves with FS, either user can send a SIP SIMPLE MESSAGE request to the other via FS.

For example, Alice and Bob are both registered so Alice can send a message to Bob and vice versa.

However, my use-case is slightly different. Only Alice is registered; Bob is a device at some unknown location on the internet on a NATed network behind a firewall/gateway.

Bob is able to send a SIP MESSAGE request to Alice at Domain.com and it will be received by FS then forwarded to Alice.

My question is how can Alice get a reply MESSAGE back to Bob when he hasn't registered? By default, if Alice tries to reply to Bob at Domain.com, FS will send back a 202/Accepted to Alice, but the message will go nowhere.

Given that when Bob sends his message to Alice, the source address of his message will be valid for a short period (therefore the source address is the return address), how can I ensure that when Alice sends a reply MESSAGE a second or two later, it gets to Bob?

My initial thought was to somehow auto-register Bob in FS using the source address of his message. Then Alice's reply should get there. Is this possible? Or should Alice's reply be sent another way? I think the reply to Bob must come from the same address to which he sent his message.

Some additional info:

Alice never initiates a conversation to Bob, but will always send one reply message to any message from Bob.

Bob actually represents up to a few thousand devices at various locations on the internet. These devices may send a single unsolicited message at any time and expect a reply message within a few seconds.

---

I also tried to do this with Kamailio, but couldn't find a way to auto-register Bob - or save his location in the location db - in order to send back a reply (and Kamailio returns a 404 to Alice rather than 202).

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20190404/8c0b088d/attachment-0001.html>


More information about the FreeSWITCH-users mailing list