FreeSWITCH package for pfSense 1.2.1 and 2.0 released. PBX or Proxy
-
adrianhensler, Freeswitch can do everything you're talking about with the bridge application in the dialplan…check it out! :)
http://wiki.freeswitch.org/wiki/Misc._Dialplan_Tools_bridgecall -
Okay, in for a penny in for a pound. I just disabled the asterisk and figured I'd go nuts.
The package works great and I got it set up and calling working between two phones (a local grandstream 2020 and a remote linksys voip router; also a remote pap2)
Having some issues that I'm sure someone can assist with - I've been dealing with voip for a long time but not ever with freeswitch.
1. Outgoing calling to a pots (cell phone in this case) results in crazy static as soon as the cell starts ringing - the phone line is all static; I don't hear a ring just noise. It continues after I answer the cell phone. I'm thinking codec mismatch but it's confusing to me - I thought the call would just fail in that case?
2. Trickier problem due to me not understanding where to fix this in freeswitch. I don't have a proper static IP. It's pretty close to static - but it's not static. I had a workaround in asterisk that seemed to work pretty well - a SynDNS dns name and the externip / externhost commands.
In freeswitch, how do I make this work correctly: if I edit the vars to force my domain to be a name; ie myDynDNSname.org instead of the default $${local_ip_v4} this happens (as seen in the logs):
I call in, I hear "goodbye" and my transfer to phone doesn't work because it is looking for 2000@123.123.123.123 which doesn't exist because the line is registered as 2000@myDynDNSname.org
If I leave it as the default; then the incoming call works to get to voicemail - but then my phone doesn't ring because it says it's not registered - it's registered as 2000@myDynDNSname.org and not as 2000@123.123.123.123.
If I change the external devices to register by IP rather than DynDNS name I think everything will work; but when my IP changes I'll haev to update all the devices so I think that the DynDNS name is the way to go.
Someone please show me the error of my ways. I'm so close.
The other interesting bit to this is that while outgoing calling connects but results in noise (problem #1 above) the incoming calling on the same gateway has audio but just doesn't connect correctly due to dns versus ip configurations.
Thanks for listening.
-
To fix your ip<->dns issue, set the phone to register as user 2000, and the ip of the phone server or proxy server (in the phone settings) to your dns name. Then set <x-pre-process cmd="set" data="domain=domaingoeshere.com">in the vars.xml.
I'm using DynDNS with this configuration, and it's working perfectly.
I've got no idea about issue 1 though…sorry! Out of curiousity, who's your provider?</x-pre-process>
-
To fix your ip<->dns issue, set the phone to register as user 2000, and the ip of the phone server or proxy server (in the phone settings) to your dns name. Then set <x-pre-process cmd="set" data="domain=domaingoeshere.com">in the vars.xml.
I'm using DynDNS with this configuration, and it's working perfectly.</x-pre-process>
Perfect answer! adrianhensler: make sure all your phones register with the domain. You can mix domains and IPs only if you enable 'force-register-domain' from the 'Internal' tab. That will make all registration attempts assume the 'force-register-domain' domain name. FreeSWITCH is designed to run as a VOIP SWITCH and therefore is designed for hosting more the one domain for multi-tenant uses.
The static problem you mentioned…
I suspect the problem that is occurring is specific to the provider you are using. I have setup several providers with FreeSWITCH and have not had the problem you described. What provider are you using?
On the Linksys phone you will get better audio quality if you go to the 'SIP' tab under admin advanced in the Linksys GUI and set the 'RTP Packet Size' to '0.020'.
-
Release FreeSWITCH pfSense package 0.4.9 today. Upgrading to this version is highly recommended. Make sure to do a backup from the 'Status' tab before removing and then reinstalling the package.
Over the past few days I have been working on a voicemail to email feature. You can configure this feature under the 'Settings' tab for the general settings to the email server. It is designed to define an email sever that delivers the email. It supports SMTP authentication, as well as TLS, and SSL encryption. Email addresses can be set from the 'Extensions' tab under the individual extensions. From the extensions you can also control whether the voicemail audio will be attached to the email. No attachment is useful if your email is being sent to a mobile phone as a text message.
From the 'Settings' tab 'SMTP Host' an additional backup SMTP host can be provided by seperating the hosts with a ';' semi-colon. An alternate SMTP port can be provided by using a colon and then the port after the host name. Example: mail.example.com:2525
The email is sent using PHP Mailer. http://phpmailer.codeworxtech.com/index.php?pg=tip_srvrs
-
My three registered devices use dns names. My two registered gateway (both with link2voip) use domain names.
The audio issue I'll deal with later, I'm more confused by the inability to get calls coming in through 'public' to get in.
They fail because they are still trying ext@ip.ip.ip.ip instead of ext@domainname.com
switch_core_session_execute_application() sofia/external/9024683007@111.111.111.111 Expanded String bridge(user/2000@222.222.222.222) 2008-12-17 14:12:21 [WARNING] mod_dptools.c:2025 user_outgoing_channel() Can't find user [2000@222.222.222.222] 2008-12-17 14:12:21 [ERR] switch_ivr_originate.c:1071 switch_ivr_originate() Cannot create outgoing channel of type [user] cause: [SUBSCRIBER_ABSENT] 2008-12-17 14:12:21 [DEBUG] switch_ivr_originate.c:1625 switch_ivr_originate() Originate Resulted in Error Cause: 20 [SUBSCRIBER_ABSENT] 2008-12-17 14:12:21 [INFO] mod_dptools.c:1869 audio_bridge_function() Originate Failed. Cause: SUBSCRIBER_ABSENT 2008-12-17 14:12:21 [DEBUG] mod_dptools.c:1890 audio_bridge_function() Continue on fail [true]: Cause: SUBSCRIBER_ABSENT
Why is it using the IP here and failing instead of my dns name?
The above is an incoming call through 'public'
condition destination_number adrianhensler action transfer 2000 XML default
(edit) Can't wait to try the voicemail to email!
-
Can you try changing this line in your public.xml file?
<extension name="set_domain" continue="true"><condition field="${domain_name}" expression="^$"><condition field="source" expression="mod_sofia"><condition field="${sip_req_params}" expression="domain_name=([A-Z-a-z0-9.]+)"><action application="export" data="domain_name=$1"><anti-action application="export" data="domain_name=${sip_req_host}"></anti-action></action></condition></condition></condition></extension>
Change the 3rd to last line to this:
<anti-action application="export" data="domain_name=YOUR_DOMAIN_NAME">Replace YOUR_DOMAIN_NAME with what your external dns name should be.It's a hack but it works for me.
Why is it using the IP here and failing instead of my dns name?
The above is an incoming call through 'public'
condition destination_number adrianhensler action transfer 2000 XML default
(edit) Can't wait to try the voicemail to email!</anti-action>
-
Nice, that worked.
Questions about the fix though:
I am confused – it worked even though I made a typo in my domain name? Then I typed just junk characters instead of my domain name and it still worked? I can even leave it blank and it works.
I've changed it to my domain name just to verify it does indeed work with that. Won't have a chance to test the remote devices until later.
switch_core_session_signal_state_change() Send signal sofia/internal/sip:2000@192.168.1.82:5060;transport=udp [BREAK]
It now contacts 2000@192.168.1.82 (the internal IP of my Grandstream SIP phone). Hm. I'll have to look at this more later, I'm confused.
-
adrianhensler: did you click on 'reload xml' on the status tab after each test?
You might also try 'force-register-domain' under the internal tab. This will force SIP to use this domain whether it is over the IP or the domain.
-
Example Settings for using the new Voicemail to Email feature with GMail TLS to send voicemail to any email address.
FreeSWITCH Settings tab:
SMTP Host: smtp.gmail.com:465
SMTP Secure: tls
SMTP Auth: true
SMTP Username: Use your gmail email address here.
SMTP Password: Use your gmail email password here.
SMTP From: Use your gmail email address here. It may support any valid email address but this has not been tested.
SMTP From Name: Can be anything you choose. For my example I used: voicemail.FreeSWITCH Extensions tab:
Select a specific extension.
Voicemail Mail To: Use any email address here.
Voicemail Attach File: true or false -
Some quick notes:
I meant to mention earlier - for the benefit of anyone reading this thread that the RTP packet size tip earlier in this thread is a great improvement. I had been aware of this - but it's a big difference in quality if this change is implemented.
Re: reload xml - I was pretty careful to do that every time. I was doing other stuff at the same time so may have inadvertently missed once but the results are as above - it works no matter what I put in:
<anti-action application="export" data="domain_name=${sip_req_host}"></anti-action>
Blank works( data="domain_name=" ) or ( data="domain_name=mydomainname.com" ) also works.
Does the line a few lines under that one:
<condition field="destination_number" expression="^(10[01][0-9])$" <="" pre="">… have to be edited as well to match my extensions? I've changed them to be in the 20xx range and edited the "local_extensions" as documented under the extensions tab. And finally, regarding the force-register-domain... Didn't seem to work. I uncommented it and left it as it was - I'm assuming that was the correct thing to do. Editing the public.xml does seem to do the trick though. I'm using 1.2.1-rc4 - are others running the 2.0 beta? Maybe it's not picking up my domain correctly? Again - editing public.xml seems to work so that's fine - maybe I'll figure out why my configuration is different while I look at other parts.' Thanks everyone the help, even though my asterisk configuration was doing everything I needed, it's nice to try something different. Now to try to fix that no-ring only static on outbound calls. I'll try another provider first and see what results I have with that; then I'll look at trying to fix the one I am currently using.</condition>
-
Just tested with les.net for outgoing and the call was fine.
Didn't hear the ringing of the pstn line from the sip-freeSwitch side - haven't looked into that yet. When the call was answered everything was fine; the caller could hear me very clearly but I could not hear the caller very clearly. Haven't tried anything at all to figure out why - suffice it to say that I've used these two providers for a year or more and the quality has been quite reasonable; and my cable modem is typically 15000 / 1200 for speeds.
Great work mcrane; it's not child's play to set it up but it's pretty close.
Now I have to set up my basic IVR and get some 'fake' extensions forwarding to remote lines.
Sorry - I really hijacked this thread. Didn't mean to - seemed the right place to ask questions but maybe I should have started a new thread. Keeps this one at the top anyways!
-
This thread can take it. A bug was found on the IVR today by 'tusc' I will get that fixed soon.
Mark
-
The IVR bug has been fixed.
Great work mcrane; it's not child's play to set it up but it's pretty close.
'sabo11' volunteered to write a tutorial so that should make it easier to get started when its finished.
-
My no-ring and outgoing calling not working with one provider (link2voip.com) are all fixed - the issue was a checkbox on my phone. Troubleshooting with a softphone let me narrow down where the problem was in a big hurry.
Haven't messed with the emailing of voicemail yet or the IVR but the package is looking like it will do everything I need to replace my asterisk box.
Very pleased, going to try to do some customizing over the next few days.
-
Hi,
I think I found a bug.
If a gateway has a number in it - eg sip.ca1.link2voip.com - the dialing doesn't seem to work correctly.
geek.org SET [effective_caller_id_name]=[Adrian softphone] 2008-12-19 00:26:25 [DEBUG] switch_core_state_machine.c:152 switch_core_standard_on_execute() sofia/internal/2009@adrian.is-a-geek.org Execute bridge(sofia/gateway/${default_gateway}/1${default_areacode}4881718) 2008-12-19 00:26:25 [DEBUG] switch_core_session.c:1253 switch_core_session_execute_application() sofia/internal/2009@adrian.is-a-geek.org Expanded String bridge(sofia/gateway//19024881718) 2008-12-19 00:26:25 [ERR] mod_sofia.c:2322 sofia_outgoing_channel() Invalid Gateway 2008-12-19 00:26:25 [NOTICE] mod_sofia.c:2521 sofia_outgoing_channel() Close Channel N/A [CS_NEW] 2008-12-19 00:26:25 [ERR] switch_ivr_originate.c:1071 switch_ivr_originate() Cannot create outgoing channel of type [sofia] cause: [INVALID_NUMBER_FORMAT]
I took a quick look but didn't find where this might be happening.
Note the expanded: (sofia/gateway//19024881718)
You can sort of verify this by just adding a number to an existing gateway; then restart freeswitch then try to dial - you will see the string doesn't get populated as above and you get the sofia/gateway//19025551234)
Sorry if I'm off again but this is my best guess as to what is happening here.
-
Are you referring to the gateway name which is the first field under editing a gateway?
If you are then I changed the name of one of my gateways for testing to the name you provided sip.ca1.link2voip.com and in my test the calls worked fine and the name was not lost.
Note: If you do add a gateway or change the name make sure to 'restart' the external profile from the status tab.
-
adrian, is it possible you had an invalid character in the name?
-
Thanks for the tip on restarting the external, I had been restarting the entire freeswitch service.
To be sure that I didn't have any bad characters I deleted the gateway and added it back.
The problem appears to be only when I try to add 7 digit dialing, it works with 10 digit for example.
I still get this when I try to do 7 digit dialing:
(sofia/gateway/${default_gateway}/1${default_areacode}4881718) 2008-12-19 08:54:31 [DEBUG] switch_core_session.c:1253 switch_core_session_execute_application() sofia/internal/2009@adrian.is-a-geek.org Expanded String bridge(sofia/gateway//19024881718)
Okay - deleted all the link2voip gateways. Found some left over in config.xml? Lots from my previous testing. Deleted those manually. Added it back in with 7 digit dialing. I was pretty sure it would work at this point but it did not.
Then verified it looked good to me:
<config> <dialplanincludeid>{CAB6ADA6-413F-592C-7A86-9A52359389AD}</dialplanincludeid> <tag>condition</tag> <fieldtype>destination_number</fieldtype> <fielddata>^(\d{7})$</fielddata> </config> <config><dialplanincludeid>{CAB6ADA6-413F-592C-7A86-9A52359389AD}</dialplanincludeid> <tag>action</tag> <fieldtype>bridge</fieldtype> <fielddata>sofia/gateway/sip.ca1.link2voip.com/1902$1</fielddata></config>
What's up; it all looks fine but the log shows it is dropping the gateway somewhere.
Ahhhhh…..
Found the fix I think.After testing, the problem only seemed to be with 7 digit dialing. Found there was a 01_example.com.xml in /usr/local/freeswitch/conf/dialplan/default with this bit of code for an example 7 digit dialing:
<extension name="local.example.com"><condition field="${toll_allow}" expression="local"><condition field="destination_number" expression="^(\d{7})$"><action application="set" data="effective_caller_id_number=${outbound_caller_id_number}"><action application="set" data="effective_caller_id_name=${outbound_caller_id_name}"><action application="bridge" data="sofia/gateway/${default_gateway}/1${default_areacode}$1"></action></action></action></condition></condition></extension>
I think this is what was tripping up my 7 digit dialing; I deleted it and everything is gravy.
Maybe I'm not understanding how some of the configs flow through; but it seems like there were some 'old' gateways still showing in the config.xml that I couldn't see in the gui as well as this example code - should I have been able to see this in the gui under the dialplan?
Thanks again for all the help. Sorry if these are newbie type mistakes on my part.
-
mcrane,
I've been meaning to mention this. I believe this example file should be removed from you package as it takes precedence over a user's dialplan configuation.
After testing, the problem only seemed to be with 7 digit dialing. Found there was a 01_example.com.xml in /usr/local/freeswitch/conf/dialplan/default with this bit of code for an example 7 digit dialing:
<extension name="local.example.com"><condition field="${toll_allow}" expression="local"><condition field="destination_number" expression="^(\d{7})$"><action application="set" data="effective_caller_id_number=${outbound_caller_id_number}"><action application="set" data="effective_caller_id_name=${outbound_caller_id_name}"><action application="bridge" data="sofia/gateway/${default_gateway}/1${default_areacode}$1"></action></action></action></condition></condition></extension>
I think this is what was tripping up my 7 digit dialing; I deleted it and everything is gravy.
Maybe I'm not understanding how some of the configs flow through; but it seems like there were some 'old' gateways still showing in the config.xml that I couldn't see in the gui as well as this example code - should I have been able to see this in the gui under the dialplan?
Thanks again for all the help. Sorry if these are newbie type mistakes on my part.