Testing Multi-Tenant Softphones

Hello there, newbie here.

I have been able to set up a multi-tenant box but I noticed a weird issue where the wrong softphone rings If I have all of them registered at the same time. Below is my setup.

Domain A: Has two users 1000, 1001
Domain B: Has two users 1000, 1001

If I call 1001 from 1000 on domain B, 1001 on domain A rings unless I unregister it.

Below is a sample log.

2023/08/06 18:32:03.502069 R.R.R.R:5060 -> X.X.X.X:10667
INVITE sip:1001@X.X.X.X:10667;ob SIP/2.0
Via: SIP/2.0/UDP R.R.R.R;rport;branch=z9hG4bKNjcZF7S9N669S
Max-Forwards: 69
From: "John" <sip:1000@R.R.R.R>;tag=S6F8XrSv9S7Ng
To: <sip:1001@X.X.X.X:10667;ob>
Call-ID: 61562cf2-af2a-123c-6e89-1e845ce2c4f7
CSeq: 71119569 INVITE
Contact: <sip:mod_sofia@R.R.R.R:5060>
User-Agent: ASTPP
Allow: INVITE, ACK, BYE, CANCEL, OPTIONS, MESSAGE, INFO, UPDATE, REGISTER, REFER, NOTIFY, PUBLISH, SUBSCRIBE
Supported: timer, path, replaces
Allow-Events: talk, hold, conference, presence, as-feature-event, dialog, line-seize, call-info, sla, include-session-description, pre
nce.winfo, message-summary, refer
Content-Type: application/sdp
Content-Disposition: session
Content-Length: 479
X-FS-Support: update_display,send_info
Remote-Party-ID: "John" <sip:1000@R.R.R.R>;party=calling;screen=yes;privacy=off

v=0
o=FreeSWITCH 1691314027 1691314028 IN IP4 R.R.R.R
s=FreeSWITCH
c=IN IP4 R.R.R.R
t=0 0
m=audio 32696 RTP/AVP 102 9 8 0 103 101
a=rtpmap:102 opus/48000/2
a=fmtp:102 useinbandfec=1; maxaveragebitrate=30000; maxplaybackrate=48000; ptime=20; minptime=10; maxptime=40; stereo=1
a=rtpmap:9 G722/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:0 PCMU/8000
a=rtpmap:103 telephone-event/48000
a=fmtp:103 0-15
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-15
a=ptime:20

How can I rectify this? All help will be appreciated.

Hello there, newbie here.

I have been able to set up a multi-tenant box

Please define how you have separated tenants from each other.

but I noticed a weird issue where the wrong softphone rings If I have all of
them registered at the same time. Below is my setup.

Domain A: Has two users 1000, 1001
Domain B: Has two users 1000, 1001

What are the SIP usernames for the above 4 telephones (we don’t need
passwords)?

If I call 1001 from 1000 on domain B, 1001 on domain A rings unless I
unregister it.

Please define how you have separated the tenants from each other.

Antony.

@Pooh Thanks for the reply.

I followed the instructions here.

I commented out the recommended three params, The below also shows my user directory served through mod_xml_curl.

<document type="freeswitch/xml">
            <section name="directory">
                <domain name="a.domain.co">
                    <params>
                        <param name="dial-string" value="{{presence_id=${{dialed_user}}@${{dialed_domain}}}}${{sofia_contact(${{dialed_user}}@${{dialed_domain}})}}"/>
                    </params>

                    <variables>
                        <variable name="record_stereo" value="true"/>
                        <variable name="user_context" value="a.domain.co"/>
                    </variables>
                
                    <groups>
                        <group name="a.domain.co">
                            <users>
                                <user id="1000">
                                    <params>
                                        <param name="password" value="PASSWORD"/>
                                    </params>
                                </user>
                                <user id="1001">
                                    <params>
                                        <param name="password" value="PASSWORD"/>
                                    </params>
                                </user>
                            </users>
                        </group>
                    </groups>
                </domain>
                <domain name="b.domain.co">
                    <params>
                        <param name="dial-string" value="{{presence_id=${{dialed_user}}@${{dialed_domain}}}}${{sofia_contact(${{dialed_user}}@${{dialed_domain}})}}"/>
                    </params>

                    <variables>
                        <variable name="record_stereo" value="true"/>
                        <variable name="user_context" value="b.domain.co"/>
                    </variables>
                
                    <groups>
                        <group name="b.domain.co">
                            <users>
                                <user id="1000">
                                    <params>
                                        <param name="password" value="PASSWORD"/>
                                    </params>
                                </user>
                                <user id="1001">
                                    <params>
                                        <param name="password" value="PASSWORD"/>
                                    </params>
                                </user>
                            </users>
                        </group>
                    </groups>
                </domain>
        </section>
        </document>

My dialplan looks like the below.

<document type="freeswitch/xml">
        <section name="dialplan" description="RE Dial Plan For FreeSwitch">
	            <context name="a.domain.co">
		            <extension name="Local_Extension">
					    <condition field="destination_number" expression="^(10[012][0-9])$">
                            <action application="export" data="dialed_extension=$1" />
                            <action application="log" data="${dialed_extension}" />
			                <action application="info"/>
						    <action application="bridge" data="user/${dialed_extension}@a.domain.co"/>
						</condition>    
                    </extension>
		        </context>  
	            <context name="b.domain.co">
		            <extension name="Local_Extension">
					    <condition field="destination_number" expression="^(10[012][0-9])$">
                            <action application="export" data="dialed_extension=$1" />
                            <action application="log" data="${dialed_extension}" />
			                <action application="info"/>
                            <action application="bridge" data="user/${dialed_extension}@b.domain.co"/>
						</condition>    
                    </extension>
		        </context>  
		</section>
	</document>

So, you originally said:

Domain A: Has two users 1000, 1001
Domain B: Has two users 1000, 1001

And I asked:

What are the SIP usernames for the above 4 telephones (we don’t need
passwords)?

Basically, I’m trying to get at how the system knows that these four
telephones are all different from each other.

Antony.

@Pooh

I assume that “1000” and “1001” are the usernames and the domain value uniquely differentiates them. This might be a wrong assumption. Please correct me.

Thanks

Have you really followed all of the instructions you referred to?

I don’t see anything in your config about company-b.org/*.xml etc.

I am using mod_xml_curl and hence I can’t do that. My directory structure arrives at the same result though.

Maybe you’d be better off (as a beginner especially) sticking to simple XML files for configuration to get something working, and only afterwards change this for a curl configuration setup?
I don’t use curl, but I do use Lua, and I found it easiest to create the XML files first, make sure things worked as expected, and only then added the complication of Lua. Otherwise I found I was dealing with too many unknowns at once.