Updated to 10.13.66-4 and now my Sangoma A200 card is no longer seen

That’s more or less what I thought but shouldn’t the dependencies between the packages have kept it all in sync?

I am trying to remove and install the new packages now…

Thank you!

Nick

@Marbled,
Yes the new one depends on the new kernel and the version of dahdi you have installed but the old one also thinks it’s fine because the dependencies are met there as well, as you still have the old kernel installed and the correct version of dahdi. To fix this you should be able to do a yum update wanpipe.

Good point…

yum update didn’t do the trick when I tried earlier so I removed the packages and installed specifically the ones you mentioned…

I then reinstalled dahdi-tools which had been removed for dependencies…

I now have the same problem I have each time I try to reinstall my Sangoma A200 from scratch…

It takes me forever for FreePBX to see it’s there…

When it “sees” the module (I have 2 FXS modules each providing 2 lines) reload or restart doesn’t seem to work.

If I try from the command line I see It complains about the signaling not being OK and all that…

Presently it doesn’t “see” the modules or my card hardware echo canceller…

I tried rerunning setup-sangoma and it detects everything and supposedly write the config but once I am in FreePBX even after a reboot it complains that DAHDI is not running…

When I run setup-sangoma it seems to detect everything correclty and when I try to start on the command line I see firmware (I think it’s the echo canceller) being loaded but it never ends up working…

By the way, when I run setup-sangoma what should I reply to:

Would you like wanrouter to start on system boot?
Would you like to execute ‘dahdi_cfg’ each time wanrouter starts?

There is obviously something I am not doing like FreePBX wants me to do because each time I play too much with my Sangoma A200 configuration it takes ages to have a working configuration again…

I seem to have quite a few errors in my logs as well, some concerning DAHDI… Look like a lot of modules/librairies are missing now…

[2015-09-02
22:20:53] WARNING[2490] loader.c: Error loading module
‘res_pjsip_pidf_body_generator.so’:
/usr/lib64/asterisk/modules/res_pjsip_pidf_body_generator.so: undefined
symbol: ast_sip_pubsub_unregister_body_generator
[2015-09-02 22:20:53] WARNING[2490] loader.c: Module ‘res_pjsip_pidf_body_generator.so’ could not be loaded.
[2015-09-02
22:20:53] WARNING[2490] loader.c: Error loading module
‘res_pjsip_path.so’: /usr/lib64/asterisk/modules/res_pjsip_path.so:
undefined symbol: ast_sip_location_retrieve_aor
[2015-09-02 22:20:53] WARNING[2490] loader.c: Module ‘res_pjsip_path.so’ could not be loaded.
[2015-09-02
22:20:53] WARNING[2490] loader.c: Error loading module
‘res_pjsip_keepalive.so’:
/usr/lib64/asterisk/modules/res_pjsip_keepalive.so: undefined symbol:
ast_sip_get_keep_alive_interval
[2015-09-02 22:20:53] WARNING[2490] loader.c: Module ‘res_pjsip_keepalive.so’ could not be loaded.
[2015-09-02
22:20:53] WARNING[2490] loader.c: Error loading module
‘res_pjsip_multihomed.so’:
/usr/lib64/asterisk/modules/res_pjsip_multihomed.so: undefined symbol:
ast_sip_unregister_service
[2015-09-02 22:20:53] WARNING[2490] loader.c: Module ‘res_pjsip_multihomed.so’ could not be loaded.
[2015-09-02
22:20:53] WARNING[2490] loader.c: Error loading module
‘func_pjsip_aor.so’: /usr/lib64/asterisk/modules/func_pjsip_aor.so:
undefined symbol: ast_sip_get_sorcery
[2015-09-02 22:20:53] WARNING[2490] loader.c: Module ‘func_pjsip_aor.so’ could not be loaded.
[2015-09-02
22:20:53] WARNING[2490] loader.c: Error loading module
‘res_pjsip_dialog_info_body_generator.so’:
/usr/lib64/asterisk/modules/res_pjsip_dialog_info_body_generator.so:
undefined symbol: ast_sip_pubsub_unregister_body_generator
[2015-09-02 22:20:53] WARNING[2490] loader.c: Module ‘res_pjsip_dialog_info_body_generator.so’ could not be loaded.
[2015-09-02
22:20:53] WARNING[2490] loader.c: Error loading module
‘res_pjsip_mwi_body_generator.so’:
/usr/lib64/asterisk/modules/res_pjsip_mwi_body_generator.so: undefined
symbol: ast_sip_pubsub_unregister_body_generator
[2015-09-02 22:20:53] WARNING[2490] loader.c: Module ‘res_pjsip_mwi_body_generator.so’ could not be loaded.
[2015-09-02
22:20:53] WARNING[2490] loader.c: Error loading module
‘res_pjsip_dlg_options.so’:
/usr/lib64/asterisk/modules/res_pjsip_dlg_options.so: undefined symbol:
ast_sip_session_unregister_supplement
[2015-09-02 22:20:53] WARNING[2490] loader.c: Module ‘res_pjsip_dlg_options.so’ could not be loaded.
[2015-09-02
22:20:53] WARNING[2490] loader.c: Error loading module ‘chan_dahdi.so’:
libopenr2.so.3: cannot open shared object file: No such file or
directory
[2015-09-02 22:20:53] WARNING[2490] loader.c: Module ‘chan_dahdi.so’ could not be loaded.
[2015-09-02
22:20:53] WARNING[2490] loader.c: Error loading module
‘res_pjsip_pidf_eyebeam_body_supplement.so’:
/usr/lib64/asterisk/modules/res_pjsip_pidf_eyebeam_body_supplement.so:
undefined symbol: ast_sip_pubsub_register_body_supplement
[2015-09-02 22:20:53] WARNING[2490] loader.c: Module ‘res_pjsip_pidf_eyebeam_body_supplement.so’ could not be loaded.
[2015-09-02
22:20:53] WARNING[2490] loader.c: Error loading module
‘res_pjsip_publish_asterisk.so’:
/usr/lib64/asterisk/modules/res_pjsip_publish_asterisk.so: undefined
symbol: ast_sip_unregister_event_publisher_handler
[2015-09-02 22:20:53] WARNING[2490] loader.c: Module ‘res_pjsip_publish_asterisk.so’ could not be loaded.
[2015-09-02
22:20:53] WARNING[2490] loader.c: Error loading module
‘res_pjsip_pidf_digium_body_supplement.so’:
/usr/lib64/asterisk/modules/res_pjsip_pidf_digium_body_supplement.so:
undefined symbol: ast_sip_pubsub_register_body_supplement
[2015-09-02 22:20:53] WARNING[2490] loader.c: Module ‘res_pjsip_pidf_digium_body_supplement.so’ could not be loaded.
[2015-09-02
22:20:53] WARNING[2490] loader.c: Error loading module
‘res_pjsip_send_to_voicemail.so’:
/usr/lib64/asterisk/modules/res_pjsip_send_to_voicemail.so: undefined
symbol: ast_sip_session_unregister_supplement
[2015-09-02 22:20:53] WARNING[2490] loader.c: Module ‘res_pjsip_send_to_voicemail.so’ could not be loaded.
[2015-09-02
22:20:53] WARNING[2490] loader.c: Error loading module
‘res_pjsip_xpidf_body_generator.so’:
/usr/lib64/asterisk/modules/res_pjsip_xpidf_body_generator.so: undefined
symbol: ast_sip_pubsub_unregister_body_generator
[2015-09-02 22:20:53] WARNING[2490] loader.c: Module ‘res_pjsip_xpidf_body_generator.so’ could not be loaded.
[2015-09-02
22:20:53] WARNING[2490] loader.c: Error loading module
‘res_hep_pjsip.so’: /usr/lib64/asterisk/modules/res_hep_pjsip.so:
undefined symbol: ast_sip_unregister_service
[2015-09-02 22:20:53] WARNING[2490] loader.c: Module ‘res_hep_pjsip.so’ could not be loaded.
[2015-09-02
22:20:53] WARNING[2490] loader.c: Error loading module
‘func_pjsip_contact.so’:
/usr/lib64/asterisk/modules/func_pjsip_contact.so: undefined symbol:
ast_sip_get_contact_status_label
[2015-09-02 22:20:53] WARNING[2490] loader.c: Module ‘func_pjsip_contact.so’ could not be loaded.
[2015-09-02
22:20:53] WARNING[2490] loader.c: Error loading module
‘res_pjsip_sips_contact.so’:
/usr/lib64/asterisk/modules/res_pjsip_sips_contact.so: undefined symbol:
ast_sip_unregister_service
[2015-09-02 22:20:53] WARNING[2490] loader.c: Module ‘res_pjsip_sips_contact.so’ could not be loaded.
[2015-09-02
22:20:53] WARNING[2490] loader.c: Error loading module
‘res_pjsip_phoneprov_provider.so’:
/usr/lib64/asterisk/modules/res_pjsip_phoneprov_provider.so: undefined
symbol: ast_sip_get_pjsip_endpoint

Thank you and have a nice day!

Nick

PS: I will probably only come back in Friday now as I have started preparing for my hospital visit and what they are going to give me tomorrow is supposed to affect my capacities so much that I can’t drive for a day… For now I put in place a backup solution so that the absence of my FreePBX box is not noticed too much…

I am back (and surprisingly awake, I don’t know what they gave me this time but I feel more than OK)…

Should I go the reinstall and restore way or do you have something better to propose before I go that way? I really don’t like all those missing symbols which seems to suggest something else got messed up…

I am assuming the problem was caused by the fact I tried to update with System Admin and it failed and I later tried to update by running the scripts, I guess something got messed up in there…

Thank you very much for your help and have a nice day!

Nick

OK, I have started reinstalling and I tried using a backup…

I guess I should not have restored the configs under /etc because it looks like it overwrote the files containing the database password as I am now getting this error message:

“[FATAL] SQLSTATE[28000] [1045] Access denied for user ‘freepbxuser’@‘localhost’ (using password: YES) SQLSTATE[28000] [1045] Access denied for user ‘freepbxuser’@‘localhost’ (using password: YES)”

I think I will simply restore again without restoring those file this time…

Have a nice day!

Nick

It turns out that the problem was the password stored in freepbx_settings as somebody had found out in this thread:

I did a

update freepbx_settings SET value = ‘MY_DATABASE_PASSWORD’ WHERE keyword = ‘CDRDBPASS’;

And it fixed it…

I am not out of the woods yet as I was told when I wanted to update modules that I needed to run this:

yum upgrade nodejs

but this apparently conflicts with npm which is required for ucpnode 13.0.9…

re:

Package npm-1.3.6-5.el6.noarch is obsoleted by nodejs-0.10.40-1.shmz65.1.6.x86_64 which is already installed

But for now I will try to get my Sangoma A200 working…

Have a nice day!

Nick

OK, the nodejs vs npm problem is fixed…

Seems like npm is now provided by nodejs and I had a small permission problem (.npm folder of the asterisk user was owned by root) which was causing the update to fail…

UCP Node Server is now updated to 13.0.9 and enabled…

The only problem I have left is making my Sangoma A200 work with FreePBX…

Can anybody tell me what is the recommended way of configuring that card with FreePBX?

I was able to get it to work somewhat by running setup-sangoma and reconfiguring it but it only worked temporarily…

Thank you!

Nick

@Marbled,
Sangoma cards can be configured in the DAHDI Config module which you can find more information about on the Dahdi Config wiki page.

@GameGamer43,

I know but it doesn’t appear there… I did have a working configuration before I tried to update so I had configured my card there…

It doesn’t show my FXS ports and my hardware echo canceller and tells me DAHDI is not loaded…

Each time I had to play with those settngs it took a lot of prayers before FreePBX started to see my card…

Am I supposed to run setup-sangoma from the command line and configure it?

Do I tell it to run wanrouter and dahdi_cfg’ at boot?

I have not yet found what I did last time to get it to work and even last time I was not quite sure what what the magical recipe…

Should I remove all those (I assume) Digium modules from my configuration?

Thank you and have a nice day!

Nick

What does the command:

dahdi scan

show

Hi Andrew!

If I reboot my PBX, doesn’t dahdi_scan doesn’t produce anything, no output at all…

if I do a “wanrouter start”, I get this:

dahdi_scan

[1]
active=yes
alarms=OK
description=wrtdm Board 1
name=WRTDM/0
manufacturer=Sangoma Technologies
devicetype=A200
location=SLOT=9, BUS=3
basechan=1
totchans=24
irq=0
type=analog
port=1,FXS
port=2,FXS
port=3,FXS
port=4,FXS
port=5,none
port=6,none
port=7,none
port=8,none
port=9,none
port=10,none
port=11,none
port=12,none
port=13,none
port=14,none
port=15,none
port=16,none
port=17,none
port=18,none
port=19,none
port=20,none
port=21,none
port=22,none
port=23,none
port=24,none

When I run wanrouter it complains in a few places though:

wanrouter start

Executing DAHDI config T1

########################################################################

Sangoma Wanpipe

Dahdi/Zaptel/SMG/TDMAPI/BOOT Configuration Script

v2.39

Sangoma Technologies Inc.

Copyright(c) 2013.

########################################################################


Configuring T1/E1 cards [A101/A102/A104/A108/A116/T116]

No Sangoma ISDN T1/E1 cards detected


Configuring ISDN BRI cards [A500/B500/B700]

No Sangoma ISDN BRI cards detected


Configuring GSM cards [W400]

No Sangoma GSM cards detected


Configuring analog cards [A200/A400/B600/B610/B700/B800]

AFT-200 configured on slot:9 bus:3 span:1

Analog card configuration complete


Configuring USB devices [U100]

###################################################################

SUMMARY

###################################################################

0 T1/E1 port(s) detected, 0 configured
0 ISDN BRI port(s) detected, 0 configured
1 analog card(s) detected, 1 configured
0 GSM card(s) detected, 0 configured
0 usb device(s) detected, 0 configured

Configurator will create the following files:
1. Wanpipe config files in /etc/wanpipe
2. Dahdi config file /etc/dahdi/system.conf

Your original configuration files will be saved to:
1. /etc/dahdi/system.conf.bak

Your configuration has been saved in /etc/wanpipe/debug-2015-09-04.tgz.
When requesting support, email this file to [email protected]

###################################################################

Stopping Asterisk…
No such command ‘stop now’ (type ‘core show help stop now’ for other possible commands)
Failed to stop asterisk using command: ‘stop now’ Forcing Asterisk Down
Undefined subroutine &main::execute_command called at ./wancfg_zaptel.pl line 1023.
Starting up device: wanpipe1
→ Loading ec image OCT6116-64S.ima…
Configuring interfaces: w1g1
done.
Waiting for Dahdi /dev/dahdi …
Loading DAHDI hardware modules:
wct4xxp: [ OK ]
wcte43x: [ OK ]
wcte12xp: [ OK ]
wcte13xp: [ OK ]
wct1xxp: [ OK ]
wcte11xp: [ OK ]
wctdm24xxp: [ OK ]
wcaxx: [ OK ]
wcfxo: [ OK ]
wctdm: [ OK ]
wcb4xxp: [ OK ]
wctc4xxp: [ OK ]
xpp_usb: [ OK ]
r1t1: [ OK ]
rxt1: [ OK ]
rcbfx: [ OK ]

D: auto ‘/sys/bus/dahdi_devices/devices/wanpipe_devices:wanpipe1’
auto-assign /sys/bus/dahdi_devices/devices/wanpipe_devices:wanpipe1
Running dahdi_cfg: [ OK ]
DAHDI Tools Version - 2.10.0.1

DAHDI Version: 2.10.0.1
Echo Canceller(s): HWEC
Configuration

0 channels to configure.

and apparently rewrite some files and takes backups…

It looks like I should tell wanrouter to start at boot (which setup-sangoma offers to do for me) but I have already tried it and didn’t end up with a working configuration…

Am I supposed to run setup-sangoma? I guess because the Sangoma settings I can play with at the FreePBX level are quite limited…

Thank you and have a nice day!

Nick

PS: For now I am only trying to get it working but I will probably eventually have to turn on hardware DTMF detection and I think this will require editing a file FreePBX rewrites…

Once dahdi scan works then it should show up in freepbx. The dahdi module starts wanrouter during amportal start during bootup. Is that not the case?

Apparently not…

If there’s any command you want me to do to test this you are welcome to tell me what you want me to type…

Seems like this time I got it to work though by telling setup-sangoma to start wanrouter and dahdi_cfg at boot…

re:

Would you like wanrouter to start on system boot?

  1. YES
  2. NO
    [1-2]:1

Verifying Dahdi boot scripts…
Verifying Dahdi boot scripts…Enabled (level:13)
Verifying Dahdi shutdown scripts…Enabled (level:87)
Enabling wanrouter boot scripts …(level:12)
Enabling wanrouter shutdown scripts …(level:86)

Would you like to execute ‘dahdi_cfg’ each time wanrouter starts?

  1. YES
  2. NO
    [1-2]:1

I wish I knew what I did different from the other times because I had tried it and FreePBX didn’t see it…

It’s possible I had restarted amportal,which I did not do this time…

This time FreePBX saw the new hardware and it survived a reboot…

If I/we could just figure out what produces a working configuration…

Please let me know if there’s anything you want to try, I won’t put that server back in Production right now so if there’s anything you want me to try now is the time…

Thank you and have a nice day!

Nick

By the way, an amportal restart gives this

amportal restart

Fetching FreePBX settings with gen_amp_conf.php…

!!!amportal is depreciated. Please use fwconsole!!!
forwarding all commands to ‘fwconsole’
Running FreePBX shutdown…

Checking Asterisk Status…
Run Pre-Asterisk Shutdown Hooks
Stopping UCP Server
Stopped UCP Server

Shutting down Asterisk Gracefully…
Press C to Cancel
Press N to shut down NOW
Stopping Asterisk…
120/120 [============================] 100%
Asterisk Stopped Successfuly

Running Post-Asterisk Stop Scripts
Stopping Wanrouter for Sangoma Cards
Wanrouter Stopped
Stopping DAHDi for Digium Cards
DAHDi Stopped
Running FreePBX startup…

Checking Asterisk Status…
Run Pre-Asterisk Hooks
Wanrouter: No valid device configs found, if you have no Sangoma cards this is OK
Starting DAHDi for Digium Cards
DAHDi Failed: The command “/etc/init.d/dahdi start” failed.
Exit Code: 1(General error)

Output:
================
Loading DAHDI hardware modules:
wct4xxp: [ OK ]
wcte43x: [ OK ]
wcte12xp: [ OK ]
wcte13xp: [ OK ]
wct1xxp: [ OK ]
wcte11xp: [ OK ]
wctdm24xxp: [ OK ]
wcaxx: [ OK ]
wcfxo: [ OK ]
wctdm: [ OK ]
wcb4xxp: [ OK ]
wctc4xxp: [ OK ]
xpp_usb: [ OK ]
r1t1: [ OK ]
rxt1: [ OK ]
rcbfx: [ OK ]

Running dahdi_cfg: [FAILED]

Error Output:
================
DAHDI_CHANCONFIG failed on channel 1: Invalid argument (22)
Selected signaling not supported
Possible causes:
FXO signaling is being used on a FXO interface (use a FXS signaling variant)
RBS signaling is being used on a E1 CCS span
Signaling is being assigned to channel 16 of an E1 CAS span

PagingPro daemon done
Running Sysadmin Hooks
Restarting fail2ban
fail2ban Restarted

Starting Asterisk…
100/100 [============================] 100%
Asterisk Started on 3589

Running Post-Asterisk Scripts
Starting UCP Server
Started UCP Server
Stopping fail2ban: [ OK ]
Starting fail2ban: [ OK ]

Everything in bold (except the first line) appears as white letters on a red background in my SSH shell…

Obviously “Wanrouter: No valid device configs found, if you have no Sangoma cards this is OK” is not OK and my card worked correctly before I did that…

I hope this can help you figure out what’s happening and what can be done about it…

Thank you and have a nice day!

Nick

That is happening because wanrouter is terminating with an exit code of something other than 0. This is outside the scope of freepbx at this point. Seems like a hardware issue. “setup-sangoma” should only be used if you arent using the dahdi configuration module. Which you are more than welcome to do.

Once it works, the card works very well and has performed flawlessly for months…

If anything it might be some sort of driver issue…

As far as I remember I was never able to get it to work by only using the DAHDI configuration module…

I can test with another Sangoma A200, I will let you know the results…

Nick

Same result with another Sangoma A200 card…

The first card is about 6 years old this one is much newer…

(The first card is PCI and this one is PCI-Express…)

Methinks it’s a path or config issue or something similar and definitely not a hardware problem…

If I start wanrouter using amportal restart I get this:

Wanrouter: No valid device configs found, if you have no Sangoma cards this is OK

amongst other things…

But if I start it manually

> # /usr/sbin/wanrouter start

> Executing DAHDI config T1

> ########################################################################
> #                          Sangoma Wanpipe                                  #
> #        Dahdi/Zaptel/SMG/TDMAPI/BOOT Configuration Script             #
> #                             v2.39                                    #
> #                     Sangoma Technologies Inc.                        #
> #                        Copyright(c) 2013.                            #
> ########################################################################

> -------------------------------------------------------
> Configuring T1/E1 cards [A101/A102/A104/A108/A116/T116]
> -------------------------------------------------------

> No Sangoma ISDN T1/E1 cards detected

> -------------------------------------------
> Configuring ISDN BRI cards [A500/B500/B700]
> -------------------------------------------

> No Sangoma ISDN BRI cards detected

> ------------------------------------
> Configuring GSM cards [W400]
> ------------------------------------

> No Sangoma GSM cards detected

> ------------------------------------
> Configuring analog cards [A200/A400/B600/B610/B700/B800]
> ------------------------------------
> AFT-200 configured on slot:4 bus:2 span:1

> Analog card configuration complete

> ------------------------------------
> Configuring USB devices [U100]
> ------------------------------------

> ###################################################################
> #                             SUMMARY                             #
> ###################################################################

>   0 T1/E1 port(s) detected, 0 configured
>   0 ISDN BRI port(s) detected, 0 configured
>   1 analog card(s) detected, 1 configured
>   0 GSM card(s) detected, 0 configured
>   0 usb device(s) detected, 0 configured

> Configurator will create the following files:
>         1. Wanpipe config files in /etc/wanpipe
>         2. Dahdi config file /etc/dahdi/system.conf


> Your original configuration files will be saved to:
>         1. /etc/dahdi/system.conf.bak

> Your configuration has been saved in /etc/wanpipe/debug-2015-09-04.tgz.
> When requesting support, email this file to [email protected]


> ###################################################################


> Stopping Asterisk...
> No such command 'stop now' (type 'core show help stop now' for other possible commands)
> Failed to stop asterisk using command: 'stop now' Forcing Asterisk Down
> Undefined subroutine &main::execute_command called at ./wancfg_zaptel.pl line 1023.
> Error: Device wanpipe1 is already running
>     Run 'wanrouter stop wanpipe1' first

> Configuring interfaces: w1g1
> done.
> Waiting for Dahdi /dev/dahdi ...
> Loading DAHDI hardware modules:
>   wct4xxp:                                                 [  OK  ]
>   wcte43x:                                                 [  OK  ]
>   wcte12xp:                                                [  OK  ]
>   wcte13xp:                                                [  OK  ]
>   wct1xxp:                                                 [  OK  ]
>   wcte11xp:                                                [  OK  ]
>   wctdm24xxp:                                              [  OK  ]
>   wcaxx:                                                   [  OK  ]
>   wcfxo:                                                   [  OK  ]
>   wctdm:                                                   [  OK  ]
>   wcb4xxp:                                                 [  OK  ]
>   wctc4xxp:                                                [  OK  ]
>   xpp_usb:                                                 [  OK  ]
>   r1t1:                                                    [  OK  ]
>   rxt1:                                                    [  OK  ]
>   rcbfx:                                                   [  OK  ]

> D: auto '/sys/bus/dahdi_devices/devices/wanpipe_devices:wanpipe1'
> auto-assign /sys/bus/dahdi_devices/devices/wanpipe_devices:wanpipe1
> Running dahdi_cfg:                                         [  OK  ]
> DAHDI Tools Version - 2.10.0.1

> DAHDI Version: 2.10.0.1
> Echo Canceller(s): HWEC
> Configuration
> ======================

0 channels to configure.

It’s now visible to FreePBX and it wants to “play” with it…

Before doing this I reran setup-sangoma one last time and told it not to start wanrouter at boot and redid my configuration in FreePBX…

What parameters are being passed to wanrouter when it’s started from amportal?

There’s obviously something my 2 Sangoma A200 do not like with them…

I have checked but I have not found yet where those scripts call wanrouter…

Thank you and have a nice day,

Nick

Same options you have. “start”

See for yourself:

12: https://github.com/FreePBX/dahdiconfig/blob/master/bin/freepbx_engine_hook_dahdiconfig#L11
13: dahdiconfig/Dahdiconfig.class.php at release/13.0 · FreePBX/dahdiconfig · GitHub

The offending line(s) of code appear to be in 13 with this:

	$process = new Process('which wanrouter');
	$process->run();
	$wrc = explode(PHP_EOL, file_get_contents('/etc/wanpipe/wanrouter.rc'));
	$wanrouterconf = array();
	foreach($wrc as $line){
		$c = explode("=", $line);
		$wanrouterconf[$c[0]] = $c[1];
	}
	$wandevices = explode(" ", $wanrouterconf['WAN_DEVICES']);
	$confspresent = 0;
	foreach ($wandevices as $wandev) {
		if(file_exists('/etc/wanpipe/'.trim($wandev).'.conf')){
			$confspresent++;
		}
	}

It would be nice to know whats in “/etc/wanpipe/wanrouter.rc” previously. Because it seems like it couldn’t parse or read “/etc/wanpipe/wanrouter.rc” correctly then it tried to find configs that didn’t exist.

Let me see if @jfinstrom has any thoughts

This is what I currently have in those files

/etc/wanpipe/wanrouter.rc:

> #!/bin/bash
> # router.rc     WAN router meta-configuration file.
> #
> #               This file defines variables used by the router shell scripts
> #               and should be located in /etc/wanpipe directory.  These are:
> #
> #               ROUTER_BOOT     =       Boot flag (YES/NO).
> #               WAN_CONF_DIR    =       Where to put wanpipe config files.
> #               WAN_INTR_DIR    =       Where to put wanpipe interface files.
> #               WAN_LOG         =       Where to put start-up log file.
> #               WAN_LOCK        =       File used as a lock.
> #               WAN_LOCK_DIR    =
> #               WAN_IP_FORWARD  =       Enable IP Forwarding on startup.
> #               WAN_DEVICES     =       Name of the wanpipe devices to be
> #                                       loaded on 'wanrouter start'
> #                                       (ex: "wanpipe1 wanpipe2 wanpipe3...")
> #
> #                              Note:    Name of wanpipe devices correspond
> #                                       to the configuration files in
> #                                       WANPIPE_CONF_DIR directory:
> #                                         (ex. /etc/wanpipe/wanpipe1.conf )
> #
> #               Note:   This file is 'executed' by the shell script, so
> #                       the usual shell syntax must be observed.
> ROUTER_BOOT=YES
> WAN_CONF_DIR=/etc/wanpipe
> WAN_INTR_DIR=/etc/wanpipe/interfaces
> WAN_BIN_DIR=/usr/sbin
> WAN_LOG=/var/log/wanrouter
> WAN_LOCK=/var/lock/wanrouter
> WAN_LOCK_DIR=/var/lock
> WAN_IP_FORWARD=NO
> NEW_IF_TYPE=NO
> WAN_LIB_DIR=/etc/wanpipe/lib
> WAN_ADSL_LIST=/etc/wanpipe/wan_adsl.list
> WAN_ANNEXG_LOAD=NO
> WAN_LIP_LOAD=YES
> WAN_DYN_WANCONFIG=NO
> WAN_SCRIPTS_DIR=/etc/wanpipe/scripts
> WAN_FIRMWARE_DIR=/etc/wanpipe/firmware
> WAN_DEVICES_REV_STOP_ORDER=YES
> WAN_DEVICES="wanpipe1 "

/etc/wanpipe/wanpipe1.conf

> #================================================
> # WANPIPE1 Configuration File
> #================================================
> #
> # Date: Mon Jul 31 17:10:23 EDT 2006
> #
> # Note: This file was generated automatically
> #       by /usr/local/sbin/setup-sangoma program.
> #
> #       If you want to edit this file, it is
> #       recommended that you use wancfg program
> #       to do so.
> #================================================
> # Sangoma Technologies Inc.
> #================================================

> [devices]
> wanpipe1 = WAN_AFT_ANALOG, Comment

> [interfaces]
> w1g1 = wanpipe1, , TDM_VOICE, Comment

> [wanpipe1]
> CARD_TYPE       = AFT
> S514CPU         = A
> CommPort        = PRI
> AUTO_PCISLOT    = NO
> PCISLOT         = 4
> PCIBUS          = 2
> FE_MEDIA        = FXO/FXS
> TDMV_LAW        = MULAW
> TDMV_OPERMODE   = FCC
> RM_BATTTHRESH   = 3
> RM_BATTDEBOUNCE = 16
> FE_NETWORK_SYNC = NO
> MTU             = 1500
> UDPPORT         = 9000
> TTL             = 255
> IGNORE_FRONT_END = NO
> TDMV_SPAN       = 1
> TE_AIS_MAINTENANCE = NO         #NO: defualt  YES: Start port in AIS Blue Alarm and keep line down
>                                 #wanpipemon -i w1g1 -c Ttx_ais_off to disable AIS maintenance mode
>                                                                 #wanpipemon -i w1g1 -c Ttx_ais_on to enable AIS maintenance mode
> TDMV_HW_DTMF        = NO        # YES: receive dtmf events from hardware
> TDMV_HW_FAX_DETECT      = NO     # YES: receive fax 1100hz events from hardware
> HWEC_OPERATION_MODE     = OCT_NORMAL    # OCT_NORMAL: echo cancelation enabled with nlp (default)
>                                         # OCT_SPEECH: improves software tone detection by disabling NLP (echo possible)
>                                         # OCT_NO_ECHO:disables echo cancelation but allows VQE/tone functions.
> HWEC_DTMF_REMOVAL       = NO    # NO: default  YES: remove dtmf out of incoming media (must have hwdtmf enabled)
> HWEC_NOISE_REDUCTION    = NO    # NO: default  YES: reduces noise on the line - could break fax
> HWEC_ACUSTIC_ECHO       = NO    # NO: default  YES: enables acustic echo cancelation
> HWEC_NLP_DISABLE        = NO    # NO: default  YES: guarantees software tone detection (possible echo)
> HWEC_TX_AUTO_GAIN       = 0     # 0: disable   -40-0: default tx audio level to be maintained (-20 default)
> HWEC_RX_AUTO_GAIN       = 0     # 0: disable   -40-0: default tx audio level to be maintained (-20 default)
> HWEC_TX_GAIN            = 0     # 0: disable   -24-24: db values to be applied to tx signal
> HWEC_RX_GAIN            = 0     # 0: disable   -24-24: db values to be applied to tx signal

> [w1g1]
> ACTIVE_CH       = ALL
> MTU             = 8
> TDMV_HWEC       = YES

I am no PHP guru (I did a little but not much) but that’s what I thought when you started posting the links (before you added more info)…

(I am a programmer though, that’s why I want so much to get to the bottom of things, to figure things out…)

There are definitely files in there, it’s just not seeing them…

When I saw the space at the end of WAN_DEVICES in wanrouter.rc I wondered if it could be to blame but it looks like this is what you (and the driver guys) are using as a separator…

The code seems to enumerate the wanpipe devices I have and then check if they have a configuration…

In my case it thinks that nothing was configured and emits that Wanrouter: No valid device configs found, if you have no Sangoma cards this is OK

(At least that’s what I think the snippets you posted were doing…)

Thank you!

Have a nice day!

Nick