BTW... Do you know how to limit a client to only local extensions and don't use the 2 outgoing providers I made?
The answer is contexts. Create a context "internal" that has only internal extensions. And then include this context to the contexts where you want extensions to be able to dial internal extensions. e.g.
[internal-external]
include => internal
exten => _1XXXXXXXXXX,1,Dial(<use your application here in my case it is spa3102 pstn line as you can see on the next line>)
exten => _1800XXXXXXX,1,Dial(SIP/${EXTEN}@pstn-spa3k,60,)
exten => _1800XXXXXXX,2,Congestion
Now to restrict extensions in your sip.conf define context=internal or external as you like.
How did you make the calls from WAN side work. My calls are going through but after around a minute the voice stops passing through. Could you please share your settings???
Every client extension that roams connect to the WAN-interface and "nat=yes"
Everything for the time being on "canreinvite=no", but when I'm more sure about my config this will change to "canreinvite=nonat"
Do enable srvlookup=yes but first check if your SIP-provider supports it
cat /opt/etc/asterisk/sip.conf
Code:
[general]
nat=no
externip=84.291.0.141
localnet=192.168.10.0/24
useragent=DD-WRT
context=default ; Default context for incoming calls
;allowguest=no ; Allow or reject guest calls (default is yes)
allowoverlap=no ; Disable overlap dialing support. (Default is yes)
;allowtransfer=no ; Disable all transfers (unless enabled in peers or users)
; Default is enabled
realm=mydomain.com ; Realm for digest authentication
; defaults to "asterisk". If you set a system name in
; asterisk.conf, it defaults to that system name
; Realms MUST be globally unique according to RFC 3261
; Set this to your host name or domain name
bindport=5060 ; UDP Port to bind to (SIP standard port is 5060)
; bindport is the local UDP port that Asterisk will listen on
bindaddr=0.0.0.0 ; IP address to bind to (0.0.0.0 binds to all)
srvlookup=yes ; Enable DNS SRV lookups on outbound calls
; Note: Asterisk only uses the first host
; in SRV records
; Disabling DNS SRV lookups disables the
; ability to place SIP calls based on domain
; names to some other SIP users on the Internet
;pedantic=yes ; Enable checking of tags in headers,
; international character conversions in URIs
; and multiline formatted headers for strict
; SIP compatibility (defaults to "no")
disallow=all ; First disallow all codecs
allow=alaw ; Allow codecs in order of preference
allow=ulaw
allow=g726
allow=gsm
;sipdebug = yes ; Turn on SIP debugging by default, from
; the moment the channel loads this configuration
[from-budgetphone]
include => extensions
exten => s,1,Dial(${jp},20)
[from-gakijken]
include => extensions
exten => s,1,Dial(${jp},20)
cat /opt/etc/asterisk/modules.conf
Code:
[modules]
autoload=yes
;
; Any modules that need to be loaded before the Asterisk core has been
; initialized (just after the logger has been initialized) can be loaded
; using 'preload'. This will frequently be needed if you wish to map all
; module configuration files into Realtime storage, since the Realtime
; driver will need to be loaded before the modules using those configuration
; files are initialized.
;
; An example of loading ODBC support would be:
;preload => res_odbc.so
;preload => res_config_odbc.so
;
; Uncomment the following if you wish to use the Speech Recognition API
;preload => res_speech.so
;
; Do not load several modules
;
noload => pbx_ael.so
noload => pbx_dundi.so
noload => chan_iax2.so
;
; Intercom application is obsoleted by
; chan_oss. Don't load it.
;
noload => app_intercom.so
;
; Explicitly load the chan_modem.so early on to be sure
; it loads before any of the chan_modem* 's afte rit
;
; load => chan_modem.so
noload => res_musiconhold.so
noload => chan_modem.so
;
; If you want, load the GTK console right away.
;
noload => pbx_gtkconsole.so
;load => pbx_gtkconsole.so
;
load => res_musiconhold.so
;
; Load either OSS or ALSA, not both
; By default, load OSS only (automatically) and do not load ALSA
;
noload => chan_alsa.so
;noload => chan_oss.so
_________________ Asus RT16N + OTRW
Kingston 4GB USB-disk 128 MB swap + 1.4GB ext3 on /opt + 2 GB ext3 on /mnt
Copperjet 1616 modem in ZipB-config
Asterisk, pixelserv & Pound running on router
Another Asus RT16N as WDS-bridge
Would somebody have a tutorial on how to install and run Asterisk on a MMC. I have installed about half a dozen times but when I reboot the router, asterisk will not start.
I've given all the info to do that in this thread..
Please study harder...
If you know how to do it and can pinpoint where things were not explained properly, you should write a tutorial for others in this forum or the wiki. _________________ Asus RT16N + OTRW
Kingston 4GB USB-disk 128 MB swap + 1.4GB ext3 on /opt + 2 GB ext3 on /mnt
Copperjet 1616 modem in ZipB-config
Asterisk, pixelserv & Pound running on router
Another Asus RT16N as WDS-bridge
Asterisk 1.2.24, Copyright (C) 1999 - 2007 Digium, Inc. and others.
Created by Mark Spencer <markster@digium.com>
Asterisk comes with ABSOLUTELY NO WARRANTY; type 'show warranty' for details.
This is free software, with components licensed under the GNU General Public
License version 2 and other licenses; you are welcome to redistribute it under
certain conditions. Type 'show license' for details.
=========================================================================
Connected to Asterisk 1.2.24 currently running on Asterisk-DD-WRT (pid = 8036)
Asterisk-DD-WRT*CLI>
8.
Now here is where my problem is.
a. For some strange reason I cannot create the file called "S90asterisk" in /opt/etc/init.d" it just wont let me do this.
b. When I reboot the router all the files in the "OPT" dir is lost.
c. But strange enough "mmc/opt" has all the folders & files that were on "OPT" it basically creates a duplicate set, but I just cannot get "asterisk" to run.
Appriciate any help and advice what I should be doing or where I stuffed up.
You should first get your optware issues sorted...
I have no experience with MMC because I simply use an USB memory stick. _________________ Asus RT16N + OTRW
Kingston 4GB USB-disk 128 MB swap + 1.4GB ext3 on /opt + 2 GB ext3 on /mnt
Copperjet 1616 modem in ZipB-config
Asterisk, pixelserv & Pound running on router
Another Asus RT16N as WDS-bridge
Posted: Mon Jun 29, 2009 10:59 Post subject: installation of asterisk on wrt350n with usb flash drive...
Hi all,
I am having some trouble with my installation, hope you can help me sort it out. I am using a WRT350n and i have a usb stick of 2 gigs formatted in 4 partitions of 465 Meg. I think that my problems is with the mounted drives. I used the web gui of dd-wrt to automount the /opt drive and i enabled the JFFS2 options. I installed succesfully asterisk and some dependencies as Robertut stated but when i tried to install the asterisk management GUI, i can't get it to work and everytime i reboot the rooter, i lost all my preconfigured folders and i get my /opt folder back with only one folder : the lost+found folder. I really think that i have a problem with the folders i mounted. Maybe with your expertise you already see where i made a mistake but if you don't, here comes a few questions:
1- In the GUI i put /opt as the default folder to auto-mount is that correct? should i also use a startup script? if yes do you have one?
2- When i enable JFFS2, it shows that i only have 128 kb of total memory and 0 free. Is that normal? How can i expand that memory permanently?
3- Should i have some kind of link between the /JFFS folder and the /opt folder? Should one be inside the other?
4- Do i need to mount /jffs , /opt, /mnt and /mmc in each partitions or is there a way to include all in one folder under /opt?
5- Since every time i reboot the rooter i lost all my config files and folders even in the /opt folder auto-mounted, what can i do to have them permanently on my usb drive? Is there a way to mount them permanently?
6- i can never download the asterisk.php file to the designated folder every time, i have to put it first in my computer and transfer it from my computer to the wrt350n. But even when i do so , i can't make the management gui work it asks me for a password and then i don't get anything, the browser says that the page cannot display...
7- if i have that line:
" mount /dev/scsi/host0/bus0/target0/lun0/part1 /opt " can i mount multiple folders pointing to /opt like: mount /jffs /opt and mount /mnt/tmp /opt all at the same time? if yes how can i make it persistent to survive a reboot?
8- Should i put and use a swap in the usb drive?
This is where i have some difficulties, since i am a windows user i am not really used with mounting partitions and i guess that is where i am struggling. but if you see some other things i am doing wrong please point out.
2- When i enable JFFS2, it shows that i only have 128 kb of total memory and 0 free. Is that normal? How can i expand that memory permanently?
You don't need jffs at all if you have a USB-stick.
rikisphinx wrote:
3- Should i have some kind of link between the /JFFS folder and the /opt folder? Should one be inside the other?
See 2
rikisphinx wrote:
4- Do i need to mount /jffs , /opt, /mnt and /mmc in each partitions or is there a way to include all in one folder under /opt?
Just mount /opt and create a structure as if it's root... You should at least have:
/opt/bin
/opt/sbin
/opt/etc/init.d
/opt/etc/asterisk
/opt/var/run
/opt/var/log/asterisk
/opt/var/lib/asterisk
But most are already there if you used "ipkg-opt" to install asterisk...
BTW... You ARE using ipkg-opt and not ipkg?
rikisphinx wrote:
5- Since every time i reboot the rooter i lost all my config files and folders even in the /opt folder auto-mounted, what can i do to have them permanently on my usb drive? Is there a way to mount them permanently?
Yes, you can use the standard DD-WRT GUI to mount one of your ext2/ext3 partition as /opt
Use that!
rikisphinx wrote:
6- i can never download the asterisk.php file to the designated folder every time, i have to put it first in my computer and transfer it from my computer to the wrt350n. But even when i do so , i can't make the management gui work it asks me for a password and then i don't get anything, the browser says that the page cannot display...
asterisk.php is not part of asterisk and you need a php-webserver for that...
I think you can do enough with the asterisk.sh
You can use http://192.168.10.1/user/cgi-bin/asterisk
to manage asterisk (192.168.10.1 is the IP of my router)
rikisphinx wrote:
7- if i have that line:
" mount /dev/scsi/host0/bus0/target0/lun0/part1 /opt " can i mount multiple folders pointing to /opt like: mount /jffs /opt and mount /mnt/tmp /opt all at the same time? if yes how can i make it persistent to survive a reboot?
Question #5
rikisphinx wrote:
8- Should i put and use a swap in the usb drive?
Never use swap on a flash-drive.
I have enabled it on my friend's DD-WRT but I'm still not sure if it's really used...
Please use a seperate thread (if you have a harddisk instead of flash memory)
rikisphinx wrote:
This is where i have some difficulties, since i am a windows user i am not really used with mounting partitions and i guess that is where i am struggling. but if you see some other things i am doing wrong please point out.
No problem...
Let me know how far this will get you... _________________ Asus RT16N + OTRW
Kingston 4GB USB-disk 128 MB swap + 1.4GB ext3 on /opt + 2 GB ext3 on /mnt
Copperjet 1616 modem in ZipB-config
Asterisk, pixelserv & Pound running on router
Another Asus RT16N as WDS-bridge
Posted: Tue Jun 30, 2009 4:59 Post subject: Now Problems with *.sh files
Frater,
Thank you so much for your help i have now all my files installed and i only have a problem at the management GUI! I can't ever make the download of the asterisk.sh file. I mean in the putty, it just shows me that it connects to the site and bring back the console but the file never get there. I tried your file also and i couldn't get it. for the FIVN site, i downloaded it to my computer and copied it to the box but when i try to open the url, it just ask me if i want to save the file or open it... I think that i can't open any *.sh file. Any suggestions?
I can't ever make the download of the asterisk.sh file.
That was not your fault....
I didn't put it in the right place to be downloaded....
Just try again...
Sorry..
Code:
cd /opt/etc/asterisk
wget -O asterisk.sh http://wd.mirmana.com/asterisk.sh
chmod +x asterisk.sh
BTW if you install "tac" you can view your log in reverse order....
Code:
ipkg-opt install tac
_________________ Asus RT16N + OTRW
Kingston 4GB USB-disk 128 MB swap + 1.4GB ext3 on /opt + 2 GB ext3 on /mnt
Copperjet 1616 modem in ZipB-config
Asterisk, pixelserv & Pound running on router
Another Asus RT16N as WDS-bridge
Posted: Tue Jun 30, 2009 10:44 Post subject: Still having trouble with the last step...
Frater,
Thank you for correcting that one but i still have the same problem... I really don't get it now.... If i out the link in a browser, i can download the asterisk.sh file but using the wget, it just doesn't download the file. What i did is download it to my deskop and create the file in the /opt/etc/asterisk. But it still does not work. When i launch it with http://192.168.1.1/user/cgi-bin/asterisk , it asks me for a password and after that it shows me the page cannot display in IE. If i use Firefox, it asks me if i want to download the file.
You have to give your router's password.. (you're logging into your router)
Did you make asterisk.sh executable by issuing the command "chmod +x asterisk.sh"?
You also have to use MY S90asterisk which makes sure you have a symbolic link in the right place..
Check the output of these commands on your router:
Code:
root@WAN:~# ls -altr /opt/etc/asterisk/asterisk.sh
-rwxr-xr-x 1 root root 18052 Jun 17 08:36 /opt/etc/asterisk/asterisk.sh
root@WAN:~# ls /tmp/www/cgi-bin/asterisk
/tmp/www/cgi-bin/asterisk
root@WAN:~# ls -altr /tmp/www/cgi-bin/asterisk
lrwxrwxrwx 1 root root 29 Jun 25 18:30 /tmp/www/cgi-bin/asterisk -> /opt/etc/asterisk/asterisk.sh
root@WAN:~# ls -altr /opt/etc/init.d/S90asterisk
-rwxr-xr-x 1 root root 2257 Jun 29 22:18 /opt/etc/init.d/S90asterisk
_________________ Asus RT16N + OTRW
Kingston 4GB USB-disk 128 MB swap + 1.4GB ext3 on /opt + 2 GB ext3 on /mnt
Copperjet 1616 modem in ZipB-config
Asterisk, pixelserv & Pound running on router
Another Asus RT16N as WDS-bridge
Frater,
i did what you wrote in your last post and i noticed that i do have the /tmp/www folder but there are nothing in there, no cgi-bin and certainly no asterisk. I think that those folders for some reason are not created when they should be for some reason...Here is what i get for the commands i issued :
"
root@DD-WRT:~# ls -altr /opt/etc/asterisk/asterisk.sh
-rwxr-xr-x 1 root root 17943 Jun 30 10:35 /opt/etc/asterisk/asterisk.sh
root@DD-WRT:~# ls /tmp/www/cgi-bin/asterisk
root@DD-WRT:~# ls -altr /tmp/www/cgi-bin/asterisk
root@DD-WRT:~# ls -altr /opt/etc/init.d/S90asterisk
-rw-r--r-- 1 root root 2257 Jun 30 06:46 /opt/etc/init.d/S90asterisk
"
I am using putty to connect to the unit and i really can't understand why some folders can't be created or downloaded with the get sintax while for others it works normally
_________________ Asus RT16N + OTRW
Kingston 4GB USB-disk 128 MB swap + 1.4GB ext3 on /opt + 2 GB ext3 on /mnt
Copperjet 1616 modem in ZipB-config
Asterisk, pixelserv & Pound running on router
Another Asus RT16N as WDS-bridge