<html><body><div style="color:#000; background-color:#fff; font-family:arial, helvetica, sans-serif;font-size:10pt">you need this:<br>http://wiki.freeswitch.org/wiki/Multi-tenant<br><div><br><span></span></div><div style="color: rgb(0, 0, 0); font-size: 13.3333px; font-family: arial,helvetica,sans-serif; background-color: transparent; font-style: normal;"><span>but before reading that, you need to read the FreeSWITCH book.</span></div><div style="color: rgb(0, 0, 0); font-size: 13.3333px; font-family: arial,helvetica,sans-serif; background-color: transparent; font-style: normal;"><span>http://www.packtpub.com/freeswitch-1-2/book</span></div><div style="color: rgb(0, 0, 0); font-size: 13.3333px; font-family: arial,helvetica,sans-serif; background-color: transparent; font-style: normal;"><br><span></span></div><div style="color: rgb(0, 0, 0); font-size: 13.3333px; font-family: arial,helvetica,sans-serif; background-color: transparent; font-style:
 normal;"><span>then you will start answering questions on this mailing list, instead of asking :-))</span></div><div style="color: rgb(0, 0, 0); font-size: 13.3333px; font-family: arial,helvetica,sans-serif; background-color: transparent; font-style: normal;"><br><span></span></div><div style="color: rgb(0, 0, 0); font-size: 13.3333px; font-family: arial,helvetica,sans-serif; background-color: transparent; font-style: normal;"><span></span></div><div><br></div>  <div style="font-family: arial, helvetica, sans-serif; font-size: 10pt;"> <div style="font-family: times new roman, new york, times, serif; font-size: 12pt;"> <div dir="ltr"> <hr size="1">  <font face="Arial" size="2"> <b><span style="font-weight:bold;">From:</span></b> Matt &lt;code.name.eric@gmail.com&gt;<br> <b><span style="font-weight: bold;">To:</span></b> FreeSWITCH Users Help &lt;freeswitch-users@lists.freeswitch.org&gt; <br> <b><span style="font-weight: bold;">Sent:</span></b> Thursday,
 September 26, 2013 4:34 AM<br> <b><span style="font-weight: bold;">Subject:</span></b> Re: [Freeswitch-users] Caller Domain Variable?<br> </font> </div> <div class="y_msg_container"><br>I am so sorry - I am not sure how to give an example of the sip packet<br>as I just touched Freeswitch for the first time two days ago.<br><br>However, to provide more detail:<br><br>I have two sip profiles named foo-192.168.20.0 and foo-192.168.21.0.<br><br>In them, I force the domains to foo-20 and foo-21, respectively.<br><br>When dialing the voicemail extension, the example invocation is:<br><br>&lt;action application="voicemail" data="check default ${domain_name}/&gt;<br><br>This fails because ${domain_name} expands to something else altogether.<br><br>So, I am looking for a way to use the caller domain when invoking<br>voicemail. I could use separate contexts. If I knew that I would have a<br>consistent sip profile and domain naming system, I could do some
 text<br>manipulation to construct the domain name. At the moment, I am using an<br>if/elseif in a lua script like this:<br><br>session:answer()<br>session:sleep(1000)<br><br>sofia_profile_name = session:getVariable("sofia_profile_name")<br><br>if (sofia_profile_name == "foo-192.168.19.0") then<br>&nbsp; &nbsp; caller_domain = "foo-20"<br>elseif (sofia_profile_name == "foo-192.168.21.0") then<br>&nbsp; &nbsp; caller_domain = "foo-21"&nbsp; &nbsp;  <br>end<br><br>session:execute("voicemail", "check default " .. caller_domain)<br> <br>The vars reported by info do not seem to have the caller's domain<br>(foo-20 or foo-21).<br><br>Again, I may be asking the wrong questions as I have just started<br>working with this about 60 hours ago.<br><br>Matt<br><br><br><br>On 9/25/13 5:31 PM, Michael Jerris wrote:<br>&gt; Every chunk of the sip packet you can imagine gets a variable set that you should be able to access.&nbsp; Can you give an example of the sip packet
 and what your not seeing in the vars?<br>&gt;<br>&gt; On Sep 25, 2013, at 8:24 AM, Matt &lt;<a ymailto="mailto:code.name.eric@gmail.com" href="mailto:code.name.eric@gmail.com">code.name.eric@gmail.com</a>&gt; wrote:<br>&gt;<br>&gt;&gt; Is there a way to access the caller's domain?<br>&gt;&gt;<br>&gt;&gt; I do not see it in app info.<br>&gt;&gt;<br>&gt;&gt; I can use sofia_profile_name to determine the domain name. However, it<br>&gt;&gt; would be more convenient access the domain name directly so as to have a<br>&gt;&gt; DRY approach.<br>&gt;&gt;<br>&gt;&gt; Matt<br>&gt;&gt;<br>&gt;<br>&gt; _________________________________________________________________________<br>&gt; Professional FreeSWITCH Consulting Services:<br>&gt; <a ymailto="mailto:consulting@freeswitch.org" href="mailto:consulting@freeswitch.org">consulting@freeswitch.org</a><br>&gt; <a href="http://www.freeswitchsolutions.com/"
 target="_blank">http://www.freeswitchsolutions.com</a><br>&gt;<br>&gt; FreeSWITCH-powered IP PBX: The CudaTel Communication Server<br>&gt; <a href="http://www.cudatel.com/" target="_blank">http://www.cudatel.com</a><br>&gt;<br>&gt; Official FreeSWITCH Sites<br>&gt; <a href="http://www.freeswitch.org/" target="_blank">http://www.freeswitch.org</a><br>&gt; <a href="http://wiki.freeswitch.org/" target="_blank">http://wiki.freeswitch.org</a><br>&gt; <a href="http://www.cluecon.com/" target="_blank">http://www.cluecon.com</a><br>&gt;<br>&gt; FreeSWITCH-users mailing list<br>&gt; <a ymailto="mailto:FreeSWITCH-users@lists.freeswitch.org" href="mailto:FreeSWITCH-users@lists.freeswitch.org">FreeSWITCH-users@lists.freeswitch.org</a><br>&gt; <a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>&gt; UNSUBSCRIBE:<a
 href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>&gt; <a href="http://www.freeswitch.org/" target="_blank">http://www.freeswitch.org</a><br><br><br>_________________________________________________________________________<br>Professional FreeSWITCH Consulting Services:<br><a ymailto="mailto:consulting@freeswitch.org" href="mailto:consulting@freeswitch.org">consulting@freeswitch.org</a><br><a href="http://www.freeswitchsolutions.com/" target="_blank">http://www.freeswitchsolutions.com</a><br><br>FreeSWITCH-powered IP PBX: The CudaTel Communication Server<br><a href="http://www.cudatel.com/" target="_blank">http://www.cudatel.com</a><br><br>Official FreeSWITCH Sites<br><a href="http://www.freeswitch.org/" target="_blank">http://www.freeswitch.org</a><br><a href="http://wiki.freeswitch.org/" target="_blank">http://wiki.freeswitch.org</a><br><a
 href="http://www.cluecon.com/" target="_blank">http://www.cluecon.com</a><br><br>FreeSWITCH-users mailing list<br><a ymailto="mailto:FreeSWITCH-users@lists.freeswitch.org" href="mailto:FreeSWITCH-users@lists.freeswitch.org">FreeSWITCH-users@lists.freeswitch.org</a><br><a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br><a href="http://www.freeswitch.org/" target="_blank">http://www.freeswitch.org</a><br><br><br></div> </div> </div>  </div></body></html>