yashsingh1/xdaforums huggingface dataset:
[Nexus 4 General] acegolfer:
I didn't say TCP cannot be used in 1.8 in OP. In fact, I have no doubt asterisk 1.8 supports TCP.

I was stating your guide wasn't written for TCP. Let me know if you have updated your guide with TCP.

If there's no hangup issues and G722 works with 1.8 when TCP/remote, then I'll ditch 11 in a heartbeat.
[Nexus 4 General] acegolfer:
I haven't had time to test this. But if my understanding of sip technology is correct, VPN will not solve UDP battery drain issue. For example, even if I use UDP within LAN, I have to set KA interval = 40 or qualifyfreq = 60. Otherwise, my phone will lose connection to the sip server until the next registration (which is less frequent than KA intervals).
[Nexus 4 General] errorcod3:
Re: [DISCUSSION] Asterisk/FreePBX/PIAF

I was using my rpi for awhile on my home net. I switched to an amazon ec2 micro instance. much better speeds, reliability, and quality.
[Nexus 4 General] acegolfer:
1. Is AWS EC2 behind NAT?

2. Anyone has an updated guide for installing asterisk 1.8 or 11 on EC2.
[Nexus 4 General] bluespire:
That is an awesome idea, but how much does it cost to keep it up 24/7?
[Nexus 4 General] Becool0130:
Does this work without my personal router setup correctly for NAT? Does this even apply since Ill be using EC2 and not my local network?

Ill be using both my wifi and cellphone data :) thanks
[Nexus 4 General] ttabbal:
Which part? Your home router will need to allow your phone to connect to the internet, so NAT will be needed unless you have real IPs for it to use? The server side on EC2 will have it's own firewall settings, including NAT.

For an EC2 setup, you shouldn't need port forwarding and such in your personal router at home, if that's what you're getting at.
[Nexus 4 General] Becool0130:
Real IPs? Please explain more because it sounds very interesting :)

Now my router allows me to access the internet. True, however, I cannot login into the web interface of my router to configure the settings so.. I think I have to buy a new router or hard reset it and start from scratch. Anyways, so Ill need NAT configurations for this to work is what your saying?

Because honestly, I have redone this installation 3 times in a row and the last time I got so far! but when I even tried to dial *43 it wouldn't even go through. So there was a problem registering the sip. You think my firewall not being set up with NAT is the big problem?

Please let me know if you need more info as Im VERY eager to get this set up.

Honestly.. I was hoping amazon EC2 could solve all my problems as I didnt think I would need to use my router for much.

Thanks

Update: Ditto... I think NAT has got the best of me -_-. Same problems as above on this 3rd install
[Nexus 4 General] chunjaenim:
After playing around with GrooveIP, Sipdroid, pbxes.org, etc., I finally settled with Amazon EC2 + SILK + CSIPSimple.

Thanks acegolfer(OP) for awesome write up.

It was a bit hard to follow from time to time, but I've managed to complete the setup.

Few tips for fellow 'i-have-no-idea-what-i-am-doing-i-just-follow-instructions' (Pretty obvious when I look back, but not when I was trying to follow the direction one step at a time. I still don't know what I did, so correct me if you can.).

1. Amazon EC2 link (http://aws.amazon.com/ec2/), when signed up, click on 'EC2 - virtual Servers in the Cloud' under 'AWS Management Console'

2. Follow the steps on Launch PIAF image in AWS EC2.. When you get to #16, you need to download a program to run SSH.

Download Putty and PuttyGen.

A) Open PuttyGen and 'Load' your private key that you downloaded from Amazon. Use 'All Files' to see the PEM file, then Save.

B) Putty. Enter ip info in 'Session'. Load the Key file under Connection-SSH-Auth. Enter this in SSH "chmod 600 mykey.pem" (NECESSARY?)

C) login will be "EC2-USER" you won't need the password.

Continue with the setup.

3. Open the IP in your browser and follow OP's instructions.

A) your login id is "MAINT" your password is the passwd-master that you setup in PuTTY.

B) TIP : Restart takes time, be patient.

C) Step 2.4 Google Voice is under "Connectivity". Also check 'Add Trunk' 'Add Outbound Routes' and 'Send to Voicemail'

D) Under Application->Extension change the "Qualify" from 'yes' to 'no'

Continue with the setup.

#Option for SILK

So I did as OP said, but "core show codecs" didn't show SILK codecs, so I followed his 2nd instruction on post #71.

The 'codecs.conf' is under "/etc/asterisk/" You can use 'nano /etc/asterisk/codecs.conf' to add post #71. Make sure you are root ('su root').

After all is done, I downloaded CSipSimple on my phone.

Account name: whatever

Server : Amazon IP

Username : Extension number. i.e. 201

Password : 'secret' under extension (read OP)

(make sure you are connected ('registered')

under settings -> network -> enable "Use compact SIP"

under settings -> media -> codecs -> choose your codec

THE END.
[Nexus 4 General] acegolfer:
If you are chunjae, this would have been a walk in the park.

Glad that you made it through.
[Nexus 4 General] HowDoIVoIP:
If any of you have had enough with trying to run it on EC2 and have a spare computer to run it yourself, I've got a 12-part video tutorial on how to set it all up. Maybe you'll find this method superior? If nothing else, I think you'll at least become very familiar with the configuration and how it all works. (Don't mean in any way to derail OP's EC2 tutorial--just offering supplemental information since many people learn better visually.)

FreePBX VoIP Tutorial playlist

http://www.youtube.com/watch?v=u9DzN1Pu6-Q&list=PLE_de-PBwrTSUMm-Y48aiOOHt_YyT69t0
[Nexus 4 General] ttabbal:
If you run ipchecker manually, does it restart iptables properly?

Where did you put that cron line? I suspect you might need to lose the "root" at the start.
[Nexus 4 General] Becool0130:
When i run /ipchecker it says its a bad command.

When I run /root/ipchecker then it accepts it and lists the iptable ex.

"htcone.iptables OK"

I can see that it updates it to the right ip address when I run iptables -nL

Also here is where I put the crontab:

[B][COLOR="Red"]nano -w /etc/crontab[/COLOR][/B]
GNU nano 2.0.9 File: /etc/crontab

# | .------------- hour (0 - 23)
# | | .---------- day of month (1 - 31)
# | | | .------- month (1 - 12) OR jan,feb,mar,apr ...
# | | | | .---- day of week (0 - 6) (Sunday=0 or 7) OR sun,mon,tue,wed,thu,$
# | | | | |
# * * * * * user-name command to be executed

0 0 * * * root /var/lib/asterisk/agi-bin/run_recurring >/dev/null 2>&1
1 0 * * * root rm -f /var/lib/asterisk/sounds/tts/tts* >/dev/null 2>&1
2 0 * * * asterisk /var/lib/asterisk/agi-bin/nv-today.php >/dev/null 2>&1
3 0 * * * root /var/lib/asterisk/agi-bin/run_reminders >/dev/null 2>&1
[B][COLOR="Red"]*/1 * * * * root /root/ipchecker > /dev/null 2>&1[/COLOR][/B]

Does that help you? Thanks for your help!
[Nexus 4 General] acegolfer:
OP setup is definitely not for newbies. I went thru grooveIP>talkatone>pbxes>PIAF on VM>EC2. Wish I had access to video tutorial 5 months ago.
[Nexus 4 General] osi13:
Honestly, none of this is "noob" friendly. It's probably more difficult to install PIAF locally. I've recently switched to EC2, and I've had some strange problems with Asterisk 11. It only took me an hour and a half to essentially "clone" my local set up, but I don't know if using EC2 is any better (I was using a cheap local server with Asterisk 1.8, 2GB of RAM, a 30/10mb connection, and a dual core proc.)

I've been using silk8 with EC2, and I'm not convinced that it's better than G.729. I'm having these strange popping noises with silk16 and CSipSimple -- I always match the clock rate. It's not as exaggerated with silk8, but I'm sure that something is wrong with my Nexus 4 or my server -- I'm leaning towards the former.

Also, there is no ringback tone when calling through a GV trunk -- even with a hardware phone. I'm using GV Motif, btw. Calling from extension to extension gives me a ringback tone. I realize that I should be posting all of this to the piaf forums, but they've been down. I'd like to hear if anyone else is having these aforementioned issues? Using progressinband=yes silencesuppression=no - internal_timing=yes and "Ttr" for dial options does nothing. I'm convinced that there is something wrong with the GV module. This isn't a deal breaker, however.

PS: I'm using TCP transport on a non-standard port. I have been playing around with compact SIP -- yes, I have compact SIP enabled in FreePBX. My extension gets re-registered way too often, even with qualify=no and a 300 KA.

Anyway, I love the concept of Amazon's EC2. The easy firewall options are great, and I've been able to whitelist each IP I use daily via FreePBX for extensions, but I don't know if my current set up is a daily driver.
[Nexus 4 General] ttabbal:
Yes, thanks. Mine looks like so:

*/2 * * * * root /root/ipchecker > /dev/null

So that looks ok. Is crond running?

ps ax | grep cron

Should get something like this:

1386 ? Ss 2:25 crond
6346 pts/0 S+ 0:00 grep cron

You want to see crond in the list. If you don't see that, you need to set up crond, but the PIAF setup should have done that.

If that's all there, you might need to try putting some logging into the ipchecker script or something. You're getting to the point that the PIAF guys might be a better resource, I've never had to do more than dropping that line in the /etc/crontab to get it to run.
[Nexus 4 General] Becool0130:
Thanks for your response man! Im currently reinstalling my pbx now because I accidentally did this and it erased my crontab:

crontab -r

Anyhow, Im curious, how did you edit your /etc/crontab? Did you do it with?:

nano -w /etc/crontab

many thanks!
[Nexus 4 General] ttabbal:
Generally just with nano, nothing real special. :)
[Nexus 4 General] dhawk312:
Can someone please post a working link for the how to Launch PIAF image in AWS EC2? And possibly a link for the PIAF green? Sorry the PIAF website has been down for a couple days.
[Nexus 4 General] osi13:
You can find the tutorial here.

To find the image you need to be in the US East (N. Virginia) section. Then if you want to use it on a west coast server you need to clone the image.

I've been using silk 8khz the last few days, and I do feel that it's a bit better than my old set up. I still haven't been able to fix the problem I'm having with no ringback tones.
[Nexus 4 General] dhawk312:
I followed the instructions in the OP and I am using Csipsimple. However, it will not register, and just says "registering...." until eventually changing to "error while registering - Request Timeout"

Here are my csipsimple account setup:

Account name: PBX

Caller ID:

Server : Amazon IP

Username : 201

Sip auth ID:

Password : 'secret' from under extension

Use TCP: Checked

Proxy: Same as Server

Any help?
[Nexus 4 General] Becool0130:
Man, I ran into that so many times. I just gave up man really. no one would even lend me a hand. almost ALL of them said EC2 is not for NOOBS and if Im a noob then I need to do some plug and play like vmware pbx -_-. Im sorry I couldnt help you either but do know your road for help will be long...
[Nexus 4 General] acegolfer:
From your posts, I can think of 5+ reasons why registration failed. You need to give us more information. For example, can you register using UDP? Can you register with pbxes?
[Nexus 4 General] dhawk312:
I will gladly give more info. What else should I give? Sorry I'm new to this whole SIP and PBX thing.

--I cannot register using UDP or TCP

--Yes I can register with PBXes
[Nexus 4 General] ttabbal:
Did you open the ports in the EC2 firewall configuration? Did you change any iptables stuff? Try to enable travelin man security stuff? Get any error messages on the server or client?
[Nexus 4 General] acegolfer:
If you can't register using UDP, then forget about TCP, which is far more complicated. First, try to register with UDP.

1. Check the server IP address. It must be the "elastic IP address" given by AWS. AWS may give you several IP addresses so check whether you are using the elastic IP.

2. Check whether the UDP ports are open. There are 2 places you need to check. 1) AWS GUI security, 2) PIAF server linux CLI. While you are at this, make sure the TCP ports are also open.
[Nexus 4 General] dhawk312:
Thanks for the help! Got csipsimple registered finally using TCP. My AWS TCP 5060 port was not open. However, when I place a call the other person complains of an echo and bit of a delay. How can I fix these?
[Nexus 4 General] Becool0130:
Right, So its my turn at amazon EC2 again :) Thanks to dhawk312 for helping me see that I can get my problems solved. As opposed to the official pbxinaflash forum, they dont bother to help in EC2. They think its all for PROS -_-

Anyhow, I got my EC2 Sip extension to register on CSIPSIMPLE. However, now when I dial *43 or any other number it gives me error message:

"488. Not Acceptable Here"

Its very odd, any tips for me to resolve this? Oh Im running PIAF GREEN Incredible 3. With travelin Man 3. All ports are open on EC2 currently for testing purposes.

Thanks

Edit: Maybe its because I only have silk enabled on CSipSimple hmm.. let me install the codec now and Ill report back
[Nexus 4 General] dhawk312:
Glad my ignorance and desire to learn helped someone!!! ;)

I received the same 488 error message. I changed the codecs through csipsimple and Piaf. I just went with the silk12 codec as described in the op. Make sure only the silk12 (or what ever codecs you use) are selected in both apps...I kept getting the 488 error message until they matched 100% then reload Piaf and make a call.

Not sure if this will work for you but it did for me.

Good luck getting your setup to work. EVERYONE I called said the connection was great and clear. Still a bit of a voice delay but still way better than groove IP or talkatone.
[Nexus 4 General] Becool0130:
Are you far from the servers? -_-. Im in chicago so not so far from virginia. Hoping not that bad of a delay then :)
[Nexus 4 General] dhawk312:
I'm originally from Chicago. I am in LA at the moment so yes all the way across the country. I'll be in Kansas City tomorrow. We'll see if the delay is better then. If so, then my upcoming move to the UK will result in delayed voice too.
[Nexus 4 General] Becool0130:
Well, it will result in a better connection in Kansas. The UK is a no no for GV and for MEGA delay times to say the least, as it only works in USA and Canada. Youll need to get another Voip provider, possibly skype? or there are alot more out there. Just FYI

Oh, maybe Im wrong... maybe it does work but only for usa/canada numbers? maybe the pros can sort that out for you. However, if successful it will still be useless because your delay(PING) will we huge
[Nexus 4 General] Becool0130:
Anyone know how I can dial a number with the + sign?

Ex. +1773555555 and +1773-555-5555

Thanks
[Nexus 4 General] post-mortem:
Maybe this?

http://xdaforums.com/showpost.php?p=41570826&postcount=36
[Nexus 4 General] Becool0130:
Thanks so much!! Will check this out when I get back home 7 hrs later. Seems promising though!
[Nexus 4 General] dhawk312:
Here's a youtube PBX tutorial that shows how to setup csipsimple, including adding the + sign using contact clean ups. There are some good tips and tricks in some of the videos posted...FYI the video creator posts in this thread too.
[Nexus 4 General] post-mortem:
Those videos are here, BTW.
[Nexus 4 General] Becool0130:
Can you please post the YouTube link? Can't see what you posted on my phone sadly. Thanks
[Nexus 4 General] dhawk312:
Sorry, forgot to embed the link: http://www.youtube.com/watch?v=3A-yar-JoOQ&hd=1
[Nexus 4 General] rsriram22:
i currently have yate on my win box at home that serves as my google voice gateway. i suppose it would not hurt trying out yate on AWS. (wonder how much of latency improvement would i see..) - any one got good numbers to compare for latency (is it the ping numbers?).. i am thinking AWS may be an overkill for me..
[Nexus 4 General] Becool0130:
The closer your are to North Virginia the better ping you will get with EC2. The further... well you know
[Nexus 4 General] Becool0130:
Im concerned about the overall security of my EC2. I think I have all the pbx ports secured as needed as Im running traveling man 3 :)

However, It is these UDP that concerns me with EC2 firewall:

4569	0.0.0.0/0

10000 - 20000	0.0.0.0/0

5060	0.0.0.0/0

Is there any way to tell EC2 to limit the exposure to these ports? If so, please tell me what I should put for the ip addresses (should it be my elastic ip?)

Btw, 0.0.0.0/0 = any ip can access the port, Can I lock this down to an ip address or no? and yes, my ip constantly changes because I use it with my cell.

Thanks!
[Nexus 4 General] post-mortem:
Each phone call uses 4 ports, so if you don't need to support many calls, then you don't need 10000 ports open. You can change them to some other range, but they should still be between 10000-20000. So, you could change it to 14200-15200, for example.

I have no idea about your other questions.
[Nexus 4 General] Becool0130:
Ok thanks, will do this :)

0.0.0.0/0 = any ip can access the given port. For example 5060= UDP SIP. Can I lock this down to a specific IP or no? My ip always changes as Im on a cell. Or should I just leave this to travelin man 3 like I already have?

-Tim
[Nexus 4 General] bluespire:
Given that I'm not quite sure what travelin man does, but it sound like it verifies your current IP and modifies IP Tables on the fly with it. Your EC ports can be left as it so long as your Linux firewall/IP Tables are doing their job. Just think of the EC ports as Amazon's firewall to catch most of the crap coming your way, so that you don't have to spend the processing time blocking those ports.
[Nexus 4 General] Becool0130:
Thanks, your hitting the nail on the head pretty well ;) you know, it does modify it on the fly and only for selected ports. such as I can put a dynamic IP (FQDN) and when it changes then it changes the IP tables in its simplest form. I can say that a given FQDN to only open ports 5060,80 for example.

You know, I was worried that some chinese or russian hacker would come and scan the pbxes... and while they wont be able to reach the pbx. They can still access my EC2 and run up my bills. You know?

Hoping there is a way to modify the open ports to specific ips.. maybe not though. As they change -_-.

Thanks for your help man. Really appreciate it!
[Nexus 4 General] bluespire:
Your best defense against someone running up your bill is to do 2 things:

1) Use a SSH key when logging into the EC2 interface. As long as YOUR COMPUTER is not compromised, such that a man-in-the-middle attack is possible, then no one can access your account without that key. And you probably are not emailing that key to people. ;)

2) Set limits and thresholds with the PBX interface for international calling, since regular calling doesn't cost anything.
[Nexus 4 General] Becool0130:
Welp, thanks bro. Answered my question. Cudos :good:
[Nexus 4 General] acegolfer:
Use "Security Group" within AWS to restrict the necessary ports to known IP addresses such as your home router, cell phone. No, you should not put your elastic IP in there.
[Nexus 4 General] Becool0130:
Ive been using the security group to limit the ports. Yes, I was just wondering if there was a way to set specific IPs for the UDP ports. Everytime I set a specific IP address to a port, say UDP SIP 5060 it will not register on my sip client. Ive tried both the elastic IP and my public IP for home.

Im kinda thinking that I cant say a specific port for any UDP port right? Especially since im moving about with my cellphone. Or am I wrong?

Thanks
[Nexus 4 General] Warbuff:
I actually shut my server down due to numerous attempts to log in to the server from China.
[Nexus 4 General] Becool0130:
brings up an interesting discussion! :)

How do you check to see if your being hacked?
[Nexus 4 General] bluespire:
I forget where it is, but on AWS you can see the internet logs. Again, without the second log-on factor, the SSH key, it would be nearly impossible to brute-force their way into your account. Your server is another matter. You need to enable SSH as the only access method, and then you need to create a SSH key for that, as well.

At that point, you only need to worry about an attacker exploiting a vulnerability in the public facing software that you run, i.e. apache, and the other web softwares you run. I wouldn't worry about Amazon getting hacked through; the world has bigger problems if that ever happens.
[Nexus 4 General] Becool0130:
Well, have you seen what the hacking group Anonymous did? ;) nothing is ever hack proof lol.

Anyhow, I have 2nd authentication measure for logon into my EC2, requires that key. I have an ssh key, yes I do.

However, enable ssh as the only access method? well all my TCP ports are limited to only my public home IP address. ALL my UDP ports are open to world -_-. Is that alright? Surely, they need to be open to make my calls right? Do you have insight on how to limit UDP exposure?

Mortem above has said to limit the UDP ports 10000 -20000 to something smaller. Any other helpful tips you may have?

Oh, Ill check the logs ASAP. Thanks
[Nexus 4 General] bluespire:
On your linux server, the thing running PIAF that is hosted on the AWS EC2. That's where I mean you have to lock down authentication. Make sure TELNET is disabled. Make sure that your login is secure to the SSH on the server. For instance, if you logged in directly to modify Asterisk, it is that login I am speaking of. It has nothing to do with port security (although SSH is normally on port 22, so you could change that just to limit the number of attacks against it. A good hacker will find it, in any case).

I am aware of what Anonymous has done. I'm a security analyst by trade.
[Nexus 4 General] dhawk312:
I've been playing around with different codecs trying to get the best quality on wifi and 2g/3g. For wifi, my codec list and order is mpeg4-generic (48 kHz), speex (32kHz), Silk (24 & 16 kHz) and GSM (8kHz), and the quality is extremely good.

My 2g/3g call quality is so-so. I was using silk (12 kHz) only, but just switched to ilbc (8 kHz), gsm (8 kHz), silk (8 kHz), speex (8 kHz), and silk (12 & 16 kHz). Can anyone recommend a better codec setup?

How do my fast/slow codec setups look?

Also, is anyone using the OPUS codec? How is the quality on wifi/3g/2g? Does this FreePBX setup support OPUS or how can it be installed?
[Nexus 4 General] bluespire:
I thought SILK was based on OPUS, it was just the specific version that Skype uses (or Vice Versa).
[Nexus 4 General] dhawk312:
My understanding is that OPUS is an adaptive codec that can switch between high and low band compression on the fly. It extends speex, silk, and celt. Skype uses silk.
[Nexus 4 General] bluespire:
Perhaps. I'm pretty sure that AceGolfer explained the codec somewhere in the beginning of this thread.
[Nexus 4 General] post-mortem:
acegolfer has never used the word "opus" in this thread

Possibly in another thread.
[Nexus 4 General] ttabbal:
Opus is a great idea, unfortunately, Asterisk doesn't have support for it yet. Opus is based on technology from Silk and some other codec, it's more advanced than silk. The code is available as open source, so hopefully Asterisk supports it in the next release.
[Nexus 4 General] dhawk312:
Let's hope so! Still playing around with the codecs. Switched to ulaw and Silk24 for wifi. Still having some difficulty with 3g/2g calls though....I keep going back and forth between iLBC, Silk16/12, and g722. Thankfully I am not on 3g/2g too often. Any comments on codecs for slow/narrow networks would be appreciated.