Discussion:
[Freeswitch-users] Mod_distributor question
SamyGo
2013-08-06 09:24:59 UTC
Permalink
Dear users,

I'm trying to figure out how this mod_distributor works. I've a few
questions to help me get this going.

I've defined two of my gateways in the distributor.conf.xml like this:

<configuration name="distributor.conf" description="Distributor
Configuration">
<lists>
<list name="GWLB" total-weight="2">
<node name="OpenSIPS-A" weight="1"/>
<node name="OpenSIPS-B" weight="1"/>
</list>
</lists>
</configuration>

and so when I reload the distributor from API I get the following warning:

freeswitch at internal> distributor_ctl reload
+ok reloaded.
2013-08-06 14:17:16.652087 [WARNING] mod_distributor.c:201 Total weight
does not add up to total weight 10

So I've changed the total-weight to 10, and set weight of each node as 5.
That gives the same warning as well.

A Warning is fine, but as soon as I just use API to expand the list I get a
proper gateway name for the first two times only and then -err starts
showing up until I reload the distributor.

freeswitch at internal> expand distributor GWLB
OpenSIPS-A
freeswitch at internal> expand distributor GWLB
OpenSIPS-B
freeswitch at internal> expand distributor GWLB
-err
freeswitch at internal> expand distributor GWLB
-err
freeswitch at internal>

The last question is regarding use of this distributor from LUA script.

I call in the distributor like this from my LUA.

session =
freeswitch.Session("{ignore_early_media=true,origination_caller_id_number="..outbound_cli.."}sofia/gateway/${distributor(GWLB)}/"..
phone_number);

and that gives a straight error:

[ERR] mod_sofia.c:4668 Invalid Gateway '%{distributor(GWLB)}'


I hope somebody can share their knowledge on this module and help me move
forward with my project.

Best Regards,
Sammy
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20130806/3bcf2206/attachment.html
Ahmed Sboor
2013-08-06 09:31:46 UTC
Permalink
Hi,
Total Weight 2 and nodes weight as 1/1 was fine . you should do first
"reloadxml" and then "distributor_ctl reload"
Post by SamyGo
Dear users,
I'm trying to figure out how this mod_distributor works. I've a few
questions to help me get this going.
<configuration name="distributor.conf" description="Distributor
Configuration">
<lists>
<list name="GWLB" total-weight="2">
<node name="OpenSIPS-A" weight="1"/>
<node name="OpenSIPS-B" weight="1"/>
</list>
</lists>
</configuration>
freeswitch at internal> distributor_ctl reload
+ok reloaded.
2013-08-06 14:17:16.652087 [WARNING] mod_distributor.c:201 Total weight
does not add up to total weight 10
So I've changed the total-weight to 10, and set weight of each node as 5.
That gives the same warning as well.
A Warning is fine, but as soon as I just use API to expand the list I get
a proper gateway name for the first two times only and then -err starts
showing up until I reload the distributor.
freeswitch at internal> expand distributor GWLB
OpenSIPS-A
freeswitch at internal> expand distributor GWLB
OpenSIPS-B
freeswitch at internal> expand distributor GWLB
-err
freeswitch at internal> expand distributor GWLB
-err
freeswitch at internal>
The last question is regarding use of this distributor from LUA script.
I call in the distributor like this from my LUA.
session =
freeswitch.Session("{ignore_early_media=true,origination_caller_id_number="..outbound_cli.."}sofia/gateway/${distributor(GWLB)}/"..
phone_number);
[ERR] mod_sofia.c:4668 Invalid Gateway '%{distributor(GWLB)}'
I hope somebody can share their knowledge on this module and help me move
forward with my project.
Best Regards,
Sammy
_________________________________________________________________________
consulting at freeswitch.org
http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server
http://www.cudatel.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/20130806/5811511b/attachment-0001.html
SamyGo
2013-08-06 09:42:37 UTC
Permalink
Dear Saboor,

Thanks for the quick reply, to share my luck with this, I'v even tried a
complete restart of freeswitch after trying reloadxml and sofia module
reloading as well.

The total-weight Warning even if I configured it with 2 made me think that
I'm probably changing in the wrong file but the API command to expand
distributor list gives results for the first two attempts so that is really
weird for me.

Just to add info, this is my FS version:

freeswitch at internal> version
FreeSWITCH Version 1.3.14b+git~20130305T150702Z~57d6495248 (git 57d6495
2013-03-05 15:07:02Z)

BR
Sammy
Post by Ahmed Sboor
Hi,
Total Weight 2 and nodes weight as 1/1 was fine . you should do first
"reloadxml" and then "distributor_ctl reload"
Post by SamyGo
Dear users,
I'm trying to figure out how this mod_distributor works. I've a few
questions to help me get this going.
<configuration name="distributor.conf" description="Distributor
Configuration">
<lists>
<list name="GWLB" total-weight="2">
<node name="OpenSIPS-A" weight="1"/>
<node name="OpenSIPS-B" weight="1"/>
</list>
</lists>
</configuration>
freeswitch at internal> distributor_ctl reload
+ok reloaded.
2013-08-06 14:17:16.652087 [WARNING] mod_distributor.c:201 Total weight
does not add up to total weight 10
So I've changed the total-weight to 10, and set weight of each node as 5.
That gives the same warning as well.
A Warning is fine, but as soon as I just use API to expand the list I get
a proper gateway name for the first two times only and then -err starts
showing up until I reload the distributor.
freeswitch at internal> expand distributor GWLB
OpenSIPS-A
freeswitch at internal> expand distributor GWLB
OpenSIPS-B
freeswitch at internal> expand distributor GWLB
-err
freeswitch at internal> expand distributor GWLB
-err
freeswitch at internal>
The last question is regarding use of this distributor from LUA script.
I call in the distributor like this from my LUA.
session =
freeswitch.Session("{ignore_early_media=true,origination_caller_id_number="..outbound_cli.."}sofia/gateway/${distributor(GWLB)}/"..
phone_number);
[ERR] mod_sofia.c:4668 Invalid Gateway '%{distributor(GWLB)}'
I hope somebody can share their knowledge on this module and help me move
forward with my project.
Best Regards,
Sammy
_________________________________________________________________________
consulting at freeswitch.org
http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server
http://www.cudatel.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
_________________________________________________________________________
consulting at freeswitch.org
http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server
http://www.cudatel.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/20130806/90fa9cc8/attachment.html
Ahmed Sboor
2013-08-06 10:22:46 UTC
Permalink
Hi Sammy,
its a news for me that even after restarting you are having invalid weight
warnings.
there is only one file to change i-e

/usr/local/freeswitch/conf/autoload_configs/distributor.xml

And reloadxml,distributor_ctl reload should work fine.

can you recheck file if sample list is still enabled as default configs
come with something like 10 i think.
Post by SamyGo
Dear Saboor,
Thanks for the quick reply, to share my luck with this, I'v even tried a
complete restart of freeswitch after trying reloadxml and sofia module
reloading as well.
The total-weight Warning even if I configured it with 2 made me think that
I'm probably changing in the wrong file but the API command to expand
distributor list gives results for the first two attempts so that is really
weird for me.
freeswitch at internal> version
FreeSWITCH Version 1.3.14b+git~20130305T150702Z~57d6495248 (git 57d6495
2013-03-05 15:07:02Z)
BR
Sammy
Post by Ahmed Sboor
Hi,
Total Weight 2 and nodes weight as 1/1 was fine . you should do first
"reloadxml" and then "distributor_ctl reload"
Post by SamyGo
Dear users,
I'm trying to figure out how this mod_distributor works. I've a few
questions to help me get this going.
<configuration name="distributor.conf" description="Distributor
Configuration">
<lists>
<list name="GWLB" total-weight="2">
<node name="OpenSIPS-A" weight="1"/>
<node name="OpenSIPS-B" weight="1"/>
</list>
</lists>
</configuration>
freeswitch at internal> distributor_ctl reload
+ok reloaded.
2013-08-06 14:17:16.652087 [WARNING] mod_distributor.c:201 Total weight
does not add up to total weight 10
So I've changed the total-weight to 10, and set weight of each node as
5. That gives the same warning as well.
A Warning is fine, but as soon as I just use API to expand the list I
get a proper gateway name for the first two times only and then -err starts
showing up until I reload the distributor.
freeswitch at internal> expand distributor GWLB
OpenSIPS-A
freeswitch at internal> expand distributor GWLB
OpenSIPS-B
freeswitch at internal> expand distributor GWLB
-err
freeswitch at internal> expand distributor GWLB
-err
freeswitch at internal>
The last question is regarding use of this distributor from LUA script.
I call in the distributor like this from my LUA.
session =
freeswitch.Session("{ignore_early_media=true,origination_caller_id_number="..outbound_cli.."}sofia/gateway/${distributor(GWLB)}/"..
phone_number);
[ERR] mod_sofia.c:4668 Invalid Gateway '%{distributor(GWLB)}'
I hope somebody can share their knowledge on this module and help me
move forward with my project.
Best Regards,
Sammy
_________________________________________________________________________
consulting at freeswitch.org
http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server
http://www.cudatel.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
_________________________________________________________________________
consulting at freeswitch.org
http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server
http://www.cudatel.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
_________________________________________________________________________
consulting at freeswitch.org
http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server
http://www.cudatel.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/20130806/100aa249/attachment-0001.html
SamyGo
2013-08-06 10:41:07 UTC
Permalink
Dear Saboor,

That is indeed weird since I did not want to load the test list in the file
and hence used my own list. Reading your comment I put the test list back
in and my first two issues are resolved. No warning and no -err on
expanding the lists now. Its working now; strange for me.

Anyway, the last question still needs some help which is using this in LUA
script.

Best Regards,
Sammy
Post by Ahmed Sboor
Hi Sammy,
its a news for me that even after restarting you are having invalid weight
warnings.
there is only one file to change i-e
/usr/local/freeswitch/conf/autoload_configs/distributor.xml
And reloadxml,distributor_ctl reload should work fine.
can you recheck file if sample list is still enabled as default configs
come with something like 10 i think.
Post by SamyGo
Dear Saboor,
Thanks for the quick reply, to share my luck with this, I'v even tried a
complete restart of freeswitch after trying reloadxml and sofia module
reloading as well.
The total-weight Warning even if I configured it with 2 made me think
that I'm probably changing in the wrong file but the API command to expand
distributor list gives results for the first two attempts so that is really
weird for me.
freeswitch at internal> version
FreeSWITCH Version 1.3.14b+git~20130305T150702Z~57d6495248 (git 57d6495
2013-03-05 15:07:02Z)
BR
Sammy
Post by Ahmed Sboor
Hi,
Total Weight 2 and nodes weight as 1/1 was fine . you should do first
"reloadxml" and then "distributor_ctl reload"
Post by SamyGo
Dear users,
I'm trying to figure out how this mod_distributor works. I've a few
questions to help me get this going.
<configuration name="distributor.conf" description="Distributor
Configuration">
<lists>
<list name="GWLB" total-weight="2">
<node name="OpenSIPS-A" weight="1"/>
<node name="OpenSIPS-B" weight="1"/>
</list>
</lists>
</configuration>
freeswitch at internal> distributor_ctl reload
+ok reloaded.
2013-08-06 14:17:16.652087 [WARNING] mod_distributor.c:201 Total weight
does not add up to total weight 10
So I've changed the total-weight to 10, and set weight of each node as
5. That gives the same warning as well.
A Warning is fine, but as soon as I just use API to expand the list I
get a proper gateway name for the first two times only and then -err starts
showing up until I reload the distributor.
freeswitch at internal> expand distributor GWLB
OpenSIPS-A
freeswitch at internal> expand distributor GWLB
OpenSIPS-B
freeswitch at internal> expand distributor GWLB
-err
freeswitch at internal> expand distributor GWLB
-err
freeswitch at internal>
The last question is regarding use of this distributor from LUA script.
I call in the distributor like this from my LUA.
session =
freeswitch.Session("{ignore_early_media=true,origination_caller_id_number="..outbound_cli.."}sofia/gateway/${distributor(GWLB)}/"..
phone_number);
[ERR] mod_sofia.c:4668 Invalid Gateway '%{distributor(GWLB)}'
I hope somebody can share their knowledge on this module and help me
move forward with my project.
Best Regards,
Sammy
_________________________________________________________________________
consulting at freeswitch.org
http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server
http://www.cudatel.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
http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org
_________________________________________________________________________
consulting at freeswitch.org
http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server
http://www.cudatel.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
_________________________________________________________________________
consulting at freeswitch.org
http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server
http://www.cudatel.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
_________________________________________________________________________
consulting at freeswitch.org
http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server
http://www.cudatel.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/20130806/b4456c71/attachment.html
Ahmed Sboor
2013-08-06 11:31:12 UTC
Permalink
Hi
i am not sure about lua so may be some other friend can help . but one
thing i can see that you are trying to call a freeswitch variable inside a
lua string so may be its the reason its not doing as you are expecting.
If you share your lua code may be someone here can help .

Thanks
Ahmed
Post by SamyGo
Dear Saboor,
That is indeed weird since I did not want to load the test list in the
file and hence used my own list. Reading your comment I put the test list
back in and my first two issues are resolved. No warning and no -err on
expanding the lists now. Its working now; strange for me.
Anyway, the last question still needs some help which is using this in LUA
script.
Best Regards,
Sammy
Post by Ahmed Sboor
Hi Sammy,
its a news for me that even after restarting you are having invalid
weight warnings.
there is only one file to change i-e
/usr/local/freeswitch/conf/autoload_configs/distributor.xml
And reloadxml,distributor_ctl reload should work fine.
can you recheck file if sample list is still enabled as default configs
come with something like 10 i think.
Post by SamyGo
Dear Saboor,
Thanks for the quick reply, to share my luck with this, I'v even tried a
complete restart of freeswitch after trying reloadxml and sofia module
reloading as well.
The total-weight Warning even if I configured it with 2 made me think
that I'm probably changing in the wrong file but the API command to expand
distributor list gives results for the first two attempts so that is really
weird for me.
freeswitch at internal> version
FreeSWITCH Version 1.3.14b+git~20130305T150702Z~57d6495248 (git 57d6495
2013-03-05 15:07:02Z)
BR
Sammy
Post by Ahmed Sboor
Hi,
Total Weight 2 and nodes weight as 1/1 was fine . you should do first
"reloadxml" and then "distributor_ctl reload"
Post by SamyGo
Dear users,
I'm trying to figure out how this mod_distributor works. I've a few
questions to help me get this going.
<configuration name="distributor.conf" description="Distributor
Configuration">
<lists>
<list name="GWLB" total-weight="2">
<node name="OpenSIPS-A" weight="1"/>
<node name="OpenSIPS-B" weight="1"/>
</list>
</lists>
</configuration>
freeswitch at internal> distributor_ctl reload
+ok reloaded.
2013-08-06 14:17:16.652087 [WARNING] mod_distributor.c:201 Total
weight does not add up to total weight 10
So I've changed the total-weight to 10, and set weight of each node as
5. That gives the same warning as well.
A Warning is fine, but as soon as I just use API to expand the list I
get a proper gateway name for the first two times only and then -err starts
showing up until I reload the distributor.
freeswitch at internal> expand distributor GWLB
OpenSIPS-A
freeswitch at internal> expand distributor GWLB
OpenSIPS-B
freeswitch at internal> expand distributor GWLB
-err
freeswitch at internal> expand distributor GWLB
-err
freeswitch at internal>
The last question is regarding use of this distributor from LUA script.
I call in the distributor like this from my LUA.
session =
freeswitch.Session("{ignore_early_media=true,origination_caller_id_number="..outbound_cli.."}sofia/gateway/${distributor(GWLB)}/"..
phone_number);
[ERR] mod_sofia.c:4668 Invalid Gateway '%{distributor(GWLB)}'
I hope somebody can share their knowledge on this module and help me
move forward with my project.
Best Regards,
Sammy
_________________________________________________________________________
consulting at freeswitch.org
http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server
http://www.cudatel.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
http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org
_________________________________________________________________________
consulting at freeswitch.org
http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server
http://www.cudatel.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
http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org
_________________________________________________________________________
consulting at freeswitch.org
http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server
http://www.cudatel.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
_________________________________________________________________________
consulting at freeswitch.org
http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server
http://www.cudatel.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
_________________________________________________________________________
consulting at freeswitch.org
http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server
http://www.cudatel.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/20130806/2d2897f8/attachment-0001.html
SamyGo
2013-08-06 11:52:54 UTC
Permalink
Thank you Saboor,

I'm not sure I understood what you meant by calling FS variable inside LUA.
I call my LUA script from luarun BGAPI command over ESL and hence no XML
dialplan loads this script.

I have made this work alternatively by calling "eval ${distributor(GWLB)}"
command from the LUA script using freeswitch.API().

These two lines got me the required gateway:

fs_api = freeswitch.API();
gateway = fs_api:executeString("eval ${distributor(GWLB)}");

I am feeling this as an overhead since its an Auto-dialer LUA application
and is called about couple hundred times a second.

If anyone can advise that'll be great.

Best Regards,
Sammy
Post by Ahmed Sboor
Hi
i am not sure about lua so may be some other friend can help . but one
thing i can see that you are trying to call a freeswitch variable inside a
lua string so may be its the reason its not doing as you are expecting.
If you share your lua code may be someone here can help .
Thanks
Ahmed
Post by SamyGo
Dear Saboor,
That is indeed weird since I did not want to load the test list in the
file and hence used my own list. Reading your comment I put the test list
back in and my first two issues are resolved. No warning and no -err on
expanding the lists now. Its working now; strange for me.
Anyway, the last question still needs some help which is using this in
LUA script.
Best Regards,
Sammy
Post by Ahmed Sboor
Hi Sammy,
its a news for me that even after restarting you are having invalid
weight warnings.
there is only one file to change i-e
/usr/local/freeswitch/conf/autoload_configs/distributor.xml
And reloadxml,distributor_ctl reload should work fine.
can you recheck file if sample list is still enabled as default configs
come with something like 10 i think.
Post by SamyGo
Dear Saboor,
Thanks for the quick reply, to share my luck with this, I'v even tried
a complete restart of freeswitch after trying reloadxml and sofia module
reloading as well.
The total-weight Warning even if I configured it with 2 made me think
that I'm probably changing in the wrong file but the API command to expand
distributor list gives results for the first two attempts so that is really
weird for me.
freeswitch at internal> version
FreeSWITCH Version 1.3.14b+git~20130305T150702Z~57d6495248 (git 57d6495
2013-03-05 15:07:02Z)
BR
Sammy
Post by Ahmed Sboor
Hi,
Total Weight 2 and nodes weight as 1/1 was fine . you should do first
"reloadxml" and then "distributor_ctl reload"
Post by SamyGo
Dear users,
I'm trying to figure out how this mod_distributor works. I've a few
questions to help me get this going.
<configuration name="distributor.conf" description="Distributor
Configuration">
<lists>
<list name="GWLB" total-weight="2">
<node name="OpenSIPS-A" weight="1"/>
<node name="OpenSIPS-B" weight="1"/>
</list>
</lists>
</configuration>
freeswitch at internal> distributor_ctl reload
+ok reloaded.
2013-08-06 14:17:16.652087 [WARNING] mod_distributor.c:201 Total
weight does not add up to total weight 10
So I've changed the total-weight to 10, and set weight of each node
as 5. That gives the same warning as well.
A Warning is fine, but as soon as I just use API to expand the list I
get a proper gateway name for the first two times only and then -err starts
showing up until I reload the distributor.
freeswitch at internal> expand distributor GWLB
OpenSIPS-A
freeswitch at internal> expand distributor GWLB
OpenSIPS-B
freeswitch at internal> expand distributor GWLB
-err
freeswitch at internal> expand distributor GWLB
-err
freeswitch at internal>
The last question is regarding use of this distributor from LUA script.
I call in the distributor like this from my LUA.
session =
freeswitch.Session("{ignore_early_media=true,origination_caller_id_number="..outbound_cli.."}sofia/gateway/${distributor(GWLB)}/"..
phone_number);
[ERR] mod_sofia.c:4668 Invalid Gateway '%{distributor(GWLB)}'
I hope somebody can share their knowledge on this module and help me
move forward with my project.
Best Regards,
Sammy
_________________________________________________________________________
consulting at freeswitch.org
http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server
http://www.cudatel.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
http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org
_________________________________________________________________________
consulting at freeswitch.org
http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server
http://www.cudatel.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
http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org
_________________________________________________________________________
consulting at freeswitch.org
http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server
http://www.cudatel.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
http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org
_________________________________________________________________________
consulting at freeswitch.org
http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server
http://www.cudatel.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
_________________________________________________________________________
consulting at freeswitch.org
http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server
http://www.cudatel.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
_________________________________________________________________________
consulting at freeswitch.org
http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server
http://www.cudatel.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/20130806/bb6b52bf/attachment.html
Loading...