[Freeswitch-users] Caller Domain Variable?
Stanislav Sinyagin
ssinyagin at yahoo.com
Thu Sep 26 12:41:50 MSD 2013
you need this:
http://wiki.freeswitch.org/wiki/Multi-tenant
but before reading that, you need to read the FreeSWITCH book.
http://www.packtpub.com/freeswitch-1-2/book
then you will start answering questions on this mailing list, instead of asking :-))
________________________________
From: Matt <code.name.eric at gmail.com>
To: FreeSWITCH Users Help <freeswitch-users at lists.freeswitch.org>
Sent: Thursday, September 26, 2013 4:34 AM
Subject: Re: [Freeswitch-users] Caller Domain Variable?
I am so sorry - I am not sure how to give an example of the sip packet
as I just touched Freeswitch for the first time two days ago.
However, to provide more detail:
I have two sip profiles named foo-192.168.20.0 and foo-192.168.21.0.
In them, I force the domains to foo-20 and foo-21, respectively.
When dialing the voicemail extension, the example invocation is:
<action application="voicemail" data="check default ${domain_name}/>
This fails because ${domain_name} expands to something else altogether.
So, I am looking for a way to use the caller domain when invoking
voicemail. I could use separate contexts. If I knew that I would have a
consistent sip profile and domain naming system, I could do some text
manipulation to construct the domain name. At the moment, I am using an
if/elseif in a lua script like this:
session:answer()
session:sleep(1000)
sofia_profile_name = session:getVariable("sofia_profile_name")
if (sofia_profile_name == "foo-192.168.19.0") then
caller_domain = "foo-20"
elseif (sofia_profile_name == "foo-192.168.21.0") then
caller_domain = "foo-21"
end
session:execute("voicemail", "check default " .. caller_domain)
The vars reported by info do not seem to have the caller's domain
(foo-20 or foo-21).
Again, I may be asking the wrong questions as I have just started
working with this about 60 hours ago.
Matt
On 9/25/13 5:31 PM, Michael Jerris wrote:
> Every chunk of the sip packet you can imagine gets a variable set that you should be able to access. Can you give an example of the sip packet and what your not seeing in the vars?
>
> On Sep 25, 2013, at 8:24 AM, Matt <code.name.eric at gmail.com> wrote:
>
>> Is there a way to access the caller's domain?
>>
>> I do not see it in app info.
>>
>> I can use sofia_profile_name to determine the domain name. However, it
>> would be more convenient access the domain name directly so as to have a
>> DRY approach.
>>
>> Matt
>>
>
> _________________________________________________________________________
> Professional FreeSWITCH Consulting Services:
> consulting at freeswitch.org
> http://www.freeswitchsolutions.com
>
>
>
>
> Official FreeSWITCH Sites
> http://www.freeswitch.org
> http://wiki.freeswitch.org
> http://www.cluecon.com
>
> FreeSWITCH-users mailing list
> FreeSWITCH-users at lists.freeswitch.org
> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
> http://www.freeswitch.org
_________________________________________________________________________
Professional FreeSWITCH Consulting Services:
consulting at freeswitch.org
http://www.freeswitchsolutions.com
Official FreeSWITCH Sites
http://www.freeswitch.org
http://wiki.freeswitch.org
http://www.cluecon.com
FreeSWITCH-users mailing list
FreeSWITCH-users at lists.freeswitch.org
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20130926/3f2b2276/attachment-0001.html
Join us at ClueCon 2013 Aug 6-8, 2013
More information about the FreeSWITCH-users
mailing list