Invalid Gateway

1,097 views
Skip to first unread message

BigJoshua5

unread,
Mar 2, 2015, 6:38:48 PM3/2/15
to as...@googlegroups.com
Hello,

I'm setting up a test box to try out ASTPP, and I've gone through the process of installation, and now I'm working on setup.  My current system is CentOS 6.6 with ASTPP 2.0.

I have inbound calls working just fine with ACL (IP Authentication).  However, when I try to place an outbound call, I get an error.

[ERR] mod_sofia.c:4385 Invalid Gateway 'GATEWAY'


So then I ran the following:

fs_cli
sofia status


Output:

Name Type Data State

=================================================================================================

 external
-ipv6 profile sip:mod_sofia@[::1]:5080 RUNNING (0)

external
-ipv6::example.com gateway sip:joeuser@example.com NOREG

 external profile sip
:mod_sofia@192.168.1.17:5080 RUNNING (0)

 external
::example.com gateway sip:joeuser@example.com NOREG

 external
::example.com gateway sip:joeuser@example.com NOREG

 external
::example.com gateway sip:joeuser@example.com NOREG

 external
::example.com gateway sip:joeuser@example.com NOREG

 external
::example.com gateway sip:joeuser@example.com NOREG

 external
::example.com gateway sip:joeuser@example.com NOREG

 external
::example.com gateway sip:joeuser@example.com NOREG

 external
::example.com gateway sip:joeuser@example.com NOREG

 external
::example.com gateway sip:joeuser@example.com NOREG

 external
::example.com gateway sip:joeuser@example.com NOREG

 external
::example.com gateway sip:joeuser@example.com NOREG

 external
::example.com gateway sip:joeuser@example.com NOREG

 external
::example.com gateway sip:joeuser@example.com NOREG

 external
::example.com gateway sip:joeuser@example.com NOREG

 external
::example.com gateway sip:joeuser@example.com NOREG

 
192.168.1.17 alias internal ALIASED

 
internal-ipv6 profile sip:mod_sofia@[::1]:5060 RUNNING (0)

 
internal profile sip:mod_sofia@192.168.1.17:5060 RUNNING (0)

=================================================================================================

4 profiles 1 alias



I then tried saving the gateway using the web gui (Switch >> Gateways >> Update button next to line item).  FS_CLI posted this to screen:

[ERR] mod_xml_curl.c:315 Received HTTP error 500 trying to fetch http://192.168.1.17/cgi-bin/astpp/astpp-fs-xml.cgi


Naturally I assumed the error was in my install as the documentation told me to copy the files using this command:

 
[CentOS]

cp
-rf /usr/src/trunk/freeswitch/astpp /var/www/cgi-bin
chmod
-Rf 777 /var/www/cgi-bin/astpp


So knowing that my web root is /var/www/html/ and that ASTPP is running out of /var/www/html/astpp/ and listening on port 8081,  whereas the error I'm getting is looking on port 80 for cgi-bin,  I can logically assume why I might potentially be getting this error.

For testing purposes, I created a symbolic link to see if this fixed the error:

ln -s /var/www/cgi-bin/ /var/www/html/cgi-bin


I got the same error.  So then I look at the apache logs:

tail -f /var/log/httpd/error_log


Output:

[error] [client 192.168.1.17] Not a HASH reference at astpp-configuration-xml.pl line 88.

[error] [client 192.168.1.17] Premature end of script headers: astpp-fs-xml.cgi


Can anybody shed some light on why I would be getting this error?  Also, why do I have so many external::example.com gateway sip:joe...@example.com NOREG in sofia status?

Thanks in advance for your help.

Juned Khan

unread,
Mar 2, 2015, 11:09:47 PM3/2/15
to as...@googlegroups.com
Hi,

You facing such issues just because you haven't setup cgi-script properly. I am suggesting you to run below commands
cp -rf /usr/src/trunk/freeswitch/astpp /var/www/cgi-bin
chmod -Rf 777 /var/www/cgi-bin/astpp
/etc/init.d/freeswitch restart
Hope it will fix your issues ;)


Thanks,
Juned Khan
iNextrix Technologies Pvt. Ltd.
www.inextrix.com

--
=====================================================================
Donate us at dona...@astpp.org
Documentation : http://wiki.astpp.org
Website : http://www.astpp.org
Please contact at sa...@inextrix.com for commercial support.
---
You received this message because you are subscribed to the Google Groups "ASTPP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to astpp+un...@googlegroups.com.
To post to this group, send email to as...@googlegroups.com.
Visit this group at http://groups.google.com/group/astpp.
To view this discussion on the web visit https://groups.google.com/d/msgid/astpp/135b099d-2904-4983-b0d7-8ec31aa825ad%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

BigJoshua5

unread,
Mar 3, 2015, 12:26:30 AM3/3/15
to as...@googlegroups.com
Thank you for your reply.  However, I'm still experiencing the same issue.

Juned Khan

unread,
Mar 3, 2015, 12:32:23 AM3/3/15
to as...@googlegroups.com
Joshua, please try with reloadxml, reload mod_xml_curl and reload mod_sofia in fs_cli.
Also does gateway shows up in sofia status output ?

Thanks,
Juned Khan
iNextrix Technologies Pvt. Ltd.
www.inextrix.com

--
=====================================================================
Donate us at dona...@astpp.org
Documentation : http://wiki.astpp.org
Website : http://www.astpp.org
Please contact at sa...@inextrix.com for commercial support.
---
You received this message because you are subscribed to the Google Groups "ASTPP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to astpp+un...@googlegroups.com.
To post to this group, send email to as...@googlegroups.com.
Visit this group at http://groups.google.com/group/astpp.

BigJoshua5

unread,
Mar 3, 2015, 1:02:31 AM3/3/15
to as...@googlegroups.com
So here I ran the commands and it doesn't appear to help.  I am experiencing the same problem.

When I run:  

sofia status

Output:


                     Name   Type                                       Data State

=================================================================================================

            external-ipv6 profile                   sip:mod_sofia@[::1]:5080 RUNNING (0)

external-ipv6::example.com gateway                   sip:joe...@example.com NOREG

                 external profile           sip:mod_...@192.168.1.17:5080 RUNNING (0)

    external::example.com gateway                   sip:joe...@example.com NOREG

             192.168.1.17   alias                                   internal ALIASED

            internal-ipv6 profile                   sip:mod_sofia@[::1]:5060 RUNNING (0)

                 internal profile           sip:mod_...@192.168.1.17:5060 RUNNING (0)

=================================================================================================

4 profiles 1 alias


Thanks again for your help, but I am curious... is the cgi-bin supposed to be in the web root folder?

On Monday, March 2, 2015 at 3:38:48 PM UTC-8, BigJoshua5 wrote:

Juned Khan

unread,
Mar 3, 2015, 1:09:15 AM3/3/15
to as...@googlegroups.com
cgi-bin folder supposed to be in /var/ww/ folder only in CentOS
When you open http://192.168.1.17/cgi-bin/astpp/astpp-fs-xml.cgi in your browser then it should show something like "internal server error"

Thanks,
Juned Khan
iNextrix Technologies Pvt. Ltd.
www.inextrix.com

--
=====================================================================
Donate us at dona...@astpp.org
Documentation : http://wiki.astpp.org
Website : http://www.astpp.org
Please contact at sa...@inextrix.com for commercial support.
---
You received this message because you are subscribed to the Google Groups "ASTPP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to astpp+un...@googlegroups.com.
To post to this group, send email to as...@googlegroups.com.
Visit this group at http://groups.google.com/group/astpp.

BigJoshua5

unread,
Mar 3, 2015, 1:21:55 AM3/3/15
to as...@googlegroups.com
Well, I do get an internal server error, however it just seems incorrect to me since apache port 80 is being served out of /var/www/html/  but I'll follow instructions.  Anyway, so far, nothing has worked.  Any other suggestions I might be able to try? 

On Monday, March 2, 2015 at 3:38:48 PM UTC-8, BigJoshua5 wrote:

Michael Masanga

unread,
Mar 3, 2015, 2:21:56 AM3/3/15
to as...@googlegroups.com
BigJoshua5 have you done the following in fs_cli

1. reload mod_xml_curl
2. reload mod_xml_cdr
3. reload mod_sofia

That should reload your default profile. Also make sure before you do the above your rtp IP is set up as  192.168.1.17  in your case

--
=====================================================================
Donate us at dona...@astpp.org
Documentation : http://wiki.astpp.org
Website : http://www.astpp.org
Please contact at sa...@inextrix.com for commercial support.
---
You received this message because you are subscribed to the Google Groups "ASTPP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to astpp+un...@googlegroups.com.
To post to this group, send email to as...@googlegroups.com.
Visit this group at http://groups.google.com/group/astpp.

Michael Masanga

unread,
Mar 3, 2015, 2:23:15 AM3/3/15
to as...@googlegroups.com
if mod_xml fails to load then enable it it modules.conf and recompile

Juned Khan

unread,
Mar 3, 2015, 2:33:48 AM3/3/15
to as...@googlegroups.com
Please give me a output of reload mod_xml_curl command.

Thanks,
Juned Khan
iNextrix Technologies Pvt. Ltd.
www.inextrix.com

BigJoshua5

unread,
Mar 3, 2015, 10:22:39 PM3/3/15
to as...@googlegroups.com
@vps4hire, yes I have reloaded the modules.  It didn't seem to help.  As far as setting the rtp IP, I'm not sure where to do that.  I'm new to freeswitch,  but extremely familiar with asterisk.  Please forgive me.
Can anybody shed some light on why I would be getting this error?  Also, why do I have so many external::example.com gateway sip:j...@example.com NOREG in sofia status?

Thanks in advance for your help.

BigJoshua5

unread,
Mar 3, 2015, 10:25:45 PM3/3/15
to as...@googlegroups.com
@Juned Khan, Here is the output of reload mod_xml_curl

freeswitch@internal> reload mod_xml_curl

+OK Reloading XML

+OK module unloaded

+OK module loaded


 

freeswitch@internal
> 2015-03-03 19:17:32.002910 [NOTICE] switch_loadable_module.c:1058 Deleting API Function 'xml_curl'

2015-03-03 19:17:32.002910 [DEBUG] switch_loadable_module.c:1060 Write lock interface 'xml_curl' to wait for existing references.

2015-03-03 19:17:32.002910 [CONSOLE] switch_loadable_module.c:1935 Stopping: mod_xml_curl

2015-03-03 19:17:32.002910 [CONSOLE] switch_loadable_module.c:1955 mod_xml_curl unloaded.

2015-03-03 19:17:32.002910 [NOTICE] mod_xml_curl.c:543 Binding [example] XML Fetch Function [http://192.168.1.17/cgi-bin/astpp/astpp-fs-xml.cgi] [dialplan|directory|configuration]

2015-03-03 19:17:32.002910 [CONSOLE] switch_loadable_module.c:1465 Successfully Loaded [mod_xml_curl]

2015-03-03 19:17:32.002910 [NOTICE] switch_loadable_module.c:315 Adding API Function 'xml_curl'

2015-03-03 19:17:32.002910 [INFO] switch_time.c:1411 Timezone reloaded 1781 definitions

Thanks for your help.
Can anybody shed some light on why I would be getting this error?  Also, why do I have so many external::example.com gateway sip:j...@example.com NOREG in sofia status?

BigJoshua5

unread,
Mar 3, 2015, 10:29:04 PM3/3/15
to as...@googlegroups.com
So I ran the command reload mod_xml and got this...


reload mod_xml

+OK Reloading XML

-ERR unloading module [No such module!]

-ERR loading module [module load file routine returned an error]

2015-03-03 19:23:17.703333 [CRIT] switch_loadable_module.c:1447 Error Loading module /usr/local/freeswitch/mod/mod_xml.so

**/usr/local/freeswitch/mod/mod_xml.so: cannot open shared object file: No such file or directory**

freeswitch@internal
> 2015-03-03 19:23:17.822912 [INFO] switch_time.c:1411 Timezone reloaded 1781 definitions

I'm not sure if this is the command you are referring to when you say "if mod_xml fails to load then enable it it modules.conf and recompile".
Can anybody shed some light on why I would be getting this error?  Also, why do I have so many external::example.com gateway sip:j...@example.com NOREG in sofia status?

Thanks in advance for your help.

Juned Khan

unread,
Mar 3, 2015, 11:07:25 PM3/3/15
to as...@googlegroups.com
Joshua, few thoughts

1) make sure you are not using domain in your gateway configuration.
2) check database settings and confirm it connects to astpp database.
3) check mod_xml_curl module is configured correctly check manual installation steps.
4) At last, I would suggest you to re install fs either using script or manual steps.


Thanks,
Juned Khan
iNextrix Technologies Pvt. Ltd.
www.inextrix.com

BigJoshua5

unread,
Mar 3, 2015, 11:13:22 PM3/3/15
to as...@googlegroups.com
Ok.  I'll give that a shot.  I can tell you that 1 and 2 are already done.  I think mod_xml_curl is configured correctly, but I'll go over it again.  Worst case scenario, I'll reinstall FS.

I'll let you know what ends up working.  This group has proved invaluable during this process.

Thanks for your help.

vps4hire

unread,
Mar 4, 2015, 1:35:49 AM3/4/15
to as...@googlegroups.com
First you need to go to your dashboard. Go to Switch >> Sip Profiles. You will see default sip profile. Click to edit the profile. There are 2 places you will see the expression  $${local_ip_v4}. These are on SIP IP and rtp_ip. Change bot to your server Ip address. After this do the following in fs_cli

reload mod_xml_curl
reload mod_xml_cdr
reload mod_sofia


after this when you enter in fs_cli  the following

sofia status

you should be able to see the default profile loaded. Then try registering your sip account
Reply all
Reply to author
Forward
0 new messages