 <p>The on_register is a basic module function of ?MODULE. If the gen_server is a singleton server, you can send the name to it using gen_server:call(?MODULE, {name, Name}) or gen_server:cast(?MODULE, {name, Name}).</p> <p>So the result would look like:</p> <pre><code>on_register(SID, JID, INFO) -&gt; {_, _, _, _, Name, _, _} = JID, gen_server:call(?MODULE, {name, Name}), ok. </code></pre>