Archive for the ‘Asterisk’ Category

Unlimited international PSTN(including Cell Phone) Calls with VOIP

Wednesday, February 6th, 2008

What we are going to do here we try to use our cell phone to make calls through VOIP service.

The advantages are:

1. If you are in US, you have VOIP service at home(Not something like vonage). You want to have more flexibility so that you can also use VOIP when you are not home using your cell phone.

2. If we want our families in those areas or countries without internet to use VOIP with us. (We need get a DID number in that area or country to avoid long distance rate.)

3. It’s not PSTN callback. PSTN service in the market are comparatively expensive.

4. People can also do it with sip cpe FX300 or celliax. With those, it could be free to call the access number using Tmobile to Tmobile. But that will cost monthly fee for another sim card and T-to-T unlimited call.

5. More as you like.

Solution: We need set up asterisk@home. We have an access set up in the asterisk server. When we call this number with a PSTN phone, we are prompted for a password. We put in the password and are allowed to dial the destination number.

Let’s say I’m using voipstunt to make calls. And I’m using stanaphone voip-in number as the access number.

So in sip.conf:

[general]

nat=yes
externip=my asterisk server ip
;externip=200.201.202.203
localnet=192.168.0.0/255.255.0.0 ; Also RFC1919

register => stananumber:stanapassword@sip.stanaphone.com

;It’s the username and password for the website. We need login stanaphone and go to account information to get the configuration information.

[stanaphone]
type=friend
insecure=very
canreinvite=no
context=disa
username=stana number
host=sip.stanaphone.com
secret=stana password
nat = yes
disallow=all
allow=alaw
allow=ulaw
dtmfmode=RFC2833

in extensions.conf:

[disa]
exten => s(or stana number),1,Answer
exten => s(or stana number),2,DigitTimeout(5)
exten => s(or stana number),3,ResponseTimeout(20)
exten => s(or stana number),4,Authenticate(XXX)
;XXXX is the password you set up
exten => s(or stana number),5,DISA(no-password|voipdiscount)

[voipdiscount]
exten => _91NXXNXXXXXX,1,StripMSD,1

exten => _1NXXNXXXXXX,2,Dial(sip/sipout/${EXTEN})

According to my test, freedigits has DTMF problem. The system will not correctly get the numbers I dial. And there must be externip for stanaphone, otherwise it can not register.

Now, we can call international with voipstunt by cell phone anywhere anytime, even without a callback connection fee.

Basically, this is a calling card sytem. We can also set up a password for different users. If we can get a DID from another country, our people in that country call call the access number with long distance fee, then dial an international number with 9 first.

by Alen

Sphere: Related Content

Asterisk setup, configuration and other stuff

Wednesday, February 6th, 2008

Getting Started With Asterisk

http://www.automated.it/guidetoasterisk.htm

Asterisk Handbook Documentation

http://www.digium.com/en/supportcenter/documentation/viewdocs/asterisk_handbook

Convert WAV audio files for use in Asterisk

http://www.voip-info.org/tiki-index.php?page=Convert%20WAV%20audio%20files%20for%20use%20in%20Asterisk

Sphere: Related Content

Asterisk for OpenWRT

Wednesday, February 6th, 2008

Asterisk 1.4.4

Asterisk 1.4 Graphical User Interface

Asterisk 1.2.16

Sounds

http://zandbelt.dyndns.org/asterisk.html

Install Asterisk on OpenWRT Guide: http://wiki.koumbit.net/Asterisk14OnOpenWRT

Asterisk codecs g.723 and g.729 download

Wednesday, February 6th, 2008

G729 Licensing

Discussion

Click-to-Call with your Asterisk@Home Box

Wednesday, February 6th, 2008

Link

OpenWRT on WRT54G/S: reset the root password

Wednesday, February 6th, 2008

*Do it on your own risk

If you’ve broken one of the startup scripts, firewalled yourself or corrupted the JFFS2 partition, you can get back in by using OpenWrt’s failsafe mode. Full failsafe mode is only working when you have installed one of the SquashFS images.

  1. Get ready
    • Download the recvudp utility and save it somewhere (e.g. on your desktop).
    • Unzip the recvudp-win32.zip file, enter the folder, change the file recvudp-win32 name to recvudp-win32.zip, unzip it again. You got 2 files with one exe file.
    • Open a DOS shell (a command prompt) and run the recvudp.exe that you have just saved
    • Running it nothing will happen, the cursor will just blink on the following line. That’s ok.
  2. Set static IP in your computer to say, 192.168.1.2, connect it to the OpenWRT, switch it on.
  3. Put the WRT in Failsafe mode
    • In the DOS window you have open in first step, you will notice that the following message appears:
      Msg from 192.168.1.1: Press reset now, to enter Failsafe!  
    • When the above message appears, press and hold the reset button for 2 seconds. You should now get the message:
Entering Failsafe!

Once in failsafe mode, the router will ignore the configuration and use the ip address 192.168.1.1 and will boot directly into a telnet server, bypassing normal boot up. There will be no DHCP server, and the JFFS2 partition won’t be mounted.

/!\OpenWrt itself uses the reset button to enter into failsafe mode, and for no other purpose. In particular, it will not reset the NVRAM. The boot loader, however, may reset the NVRAM in response to the reset button. Therefore, it’s important to know what’s running when you hold down the reset button. One indicator is that OpenWrt will light the DMZ LED (on systems that have one) from the time it begins until the time the bootup scripts complete. If the DMZ LED has not yet lit up, you are still in the bootloader!

Resetting the NVRAM will brick some models.

4. Telnet OpenWRT at 192.168.1.1

5. Apparently when in Failsafe mode telnet drops right into a shell. Cool !

6. mount the jffs file system :

    • mtd unlock /dev/mtd/4
    • mount -t jffs2 /dev/mtdblock/4 /jffs

7. vi /jffs/etc/passwd

  • First time, I don’t know the original one in passwd, so change root line to the following I found online: root:$1$$oYzVKLfly6aIyQZGRB/WW0:0:0:root:/tmp:/bin/ash
  • Or change it to the following which is from the passwd file after I changed the password back to admin: root:$1$94$gPojrAnI0oPZSeHEJh/YF.:0:0:root:/tmp:/bin/ash

8. Reboot, back to normal.

9. If you change root line using first one, admin password was set to amsterdam, 2nd one, admin.

Sphere: Related Content

Asterisk: How to authenticate users by callerid?

Wednesday, February 6th, 2008

Refer to ian’s OP1 at voip wiki and OP2 at velocityreviews.
Here is a simple method of authenticating users, This will work for internal and external as long as the have cli. first you need to create a database family
for example:- database put auth_user 123456 1234
will create a user whose cli must be 123456 and password is 1234

Then ad something similar to you extensions.conf

;password system

exten => 567,1,Answer ; Answer the line
exten => 567,n,Noop(${CALLERIDNUM})
exten => 567,n,Background, Welcome-to-test
exten => 567,n,DBget(passkey=auth_user/${CALLERIDNUM})
exten => 567,n,Authenticate(${passkey})
exten => 567,n,SetAccount(${CALLERIDNUM})
exten => 567,n,DISA(no-password|default)

If you want to set up a calling card gateway without putting in any pin, it can be done as follows.

[auth]

exten => xxxxxxx,1,Answer
exten => xxxxxxx,2,DigitTimeout(5)
exten => xxxxxxx,3,ResponseTimeout(20)
;;exten => xxxxxxx,2,NoOp(${CALLERIDNUM})
;exten => xxxxxxx,2,Set(foo=${DB(auth_user/${CALLERIDNUM})})
;;exten => xxxxxxx,3,NoOp(${foo})
;;exten => xxxxxxx,5,NoOp($["${foo}"="1234"])
;exten => xxxxxxx,6,GotoIf(${${foo}=1234}?11)
exten => xxxxxxx,4,GotoIf($["${DB(auth_user/${CALLERIDNUM})}"="1234"]?11)
exten => xxxxxxx,5,Hangup
exten => xxxxxxx,11,Disa(no-password|default)

I didn’t install sound or voicemail on my WRT54GS+OpenWRT+Asterisk. To use authenticate, I need some sounds. I wget some gsm files to /usr/lib/asterisk/sounds. Then edit /etc/init.d/asterisk, add the following line:

[ -d /var/spool/asterisk/sounds ] || ln -s /usr/lib/asterisk/sounds /var/spool/asterisk/sounds

 

It will be very simple to set up the system so users can change passwords themselves from their phone as well as you to add users from yours.

Here’s an example. I didn’t test this code yet.

exten => 567,1,Answer ; Answer the line
exten => 567,2,DBget(passkey=auth_user/${CALLERIDNUM})
exten => 567,3,Authenticate(${passkey})
exten => 567,4,SetAccount(${CALLERIDNUM})
exten => 567,5,Goto(ivr,s,1)
[ivr]enjoy

exten => s,1,Background(please_choose)
exten => s,2,DigitTimeout,5
exten => s,3,ResponseTimeout,15

;Option1 allows outdialing

exten => 1,1,Goto(ivr_dial,s,1)

;Option2 goes to vmail

exten => 2,1,Goto(demo,1571,1)

;Option3, change pin

exten => 3,1,Goto(change_pin,s,1)

[ivr_dial]

include => international
exten => s,1,Background(please_dial)
exten => s,2,DigitTimeout,5
exten => s,3,ResponseTimeout,15

exten => t,1,hangup
exten => i,1,Goto(s,1)

[change_pin]
exten => s,1,Background(put in new pin)
exten => _X.,1,Set(newpin1=${EXTEN})
exten => _X.,2,Background(confirm new pin)
exten => _X.,3,Set(newpin2=${EXTEN})
exten => _X.,4,Gotoif(${newpin1}=${newpin2}?7:5)
exten => _X.,5,Background(pin not confirmed)
exten => _X.,6,Goto(s,1)
exten => _X.,7,Set(DB(auth_user/key)=${EXTEN}))
exten => _X.,8,Background(pin changed)
exten => _X.,9,Goto(ivr,s,1)

 

Sphere: Related Content

How To Install Asterisk VOIP PBX on Debian Linux

Wednesday, February 6th, 2008

OP - by Tobias Rice

Callback with Asterisk

Wednesday, February 6th, 2008

OP

For more asterisk help, please check www.asteriskguru.com.

All about asterisk

Wednesday, February 6th, 2008

OP

asterisk
A complete software PBX
* Compilation
  based on asterisk-1.0.3:     ftp://ftp.asterisk.org/pub/asterisk/       configure options:     . linked statically against openssl (res_crypto.so)
* Configuration
  /etc/asterisk/*.conf   /etc/default/asterisk - startup script defaults
* Startup script
  /etc/init.d/asterisk
* Links
  homepage: http://www.asterisk.org/   sources: http://nthill.free.fr/openwrt/sources/asterisk/
* FAQ
  1) how do I start asterisk ?             /etc/init.d/asterisk start
  2) how do I stop asterisk ?
       /etc/init.d/asterisk stop
  3) how do I start asterisk at boot ?
     put a symbolic link to /etc/init.d/asterisk starting with S in /etc/init.d
       ln -s /etc/init.d/asterisk /etc/init.d/S99asterisk
  4) how can I change the default options the startup script is using ?
     edit /etc/default/asterisk
Sphere: Related Content