July 9th, 2007 by Kevin Withnall

Trixbox has what i consider to be a strange behaviour where an extensions Outbound CID will override the trunk CID.

Using engin, i wanted to supress caller id on all outgoing calls. This is easy, i hear you say just by prefixing numbers with 1831. For engin, this works for everywhere but an 07 number. I called them about it and they told me that its not a problem at their end. This seemed strange to me as other Australian numbers worked perfectly. Anyway, i discovered that if you use a PAP2T or a SPA-3000, and supress caller id with them, the CID sent to engin is “anonymous”.

I now knew how to supress it but had trouble getting trixbox (or FreePBX) to actually use it. I decided that I could use the “Emergency CID” field in FreePBX Extensions and only mark engin as the emergency route. Then on the outgoing routes, tick Emergency for the numbers you want to supress caller id on.

I know its a bodgy solution but it works and i would present a normal CID for emergency calls anyway.

July 9th, 2007 by Kevin Withnall

Using engin I was having trouble as all incoming calls from switchboard numbers were appearing on my primary number.

This was annoying as I wanted more control in the inbound routes of trixbox. The following extensioins_custom.conf contect worked for me.

[custom-from-engin]
include => ext-did
exten => _X.,1,SIPGetHeader(Var_TO=To)
exten => _X.,n,Goto(ext-did,switch${Var_TO:5:10},1)

As you can see, the SIP header contains a TO header which can be looked at. I simply add a Custom app inbound route for the main number like “custom-from-engin,${EXTEN},1″ and using the above context, it re-routes the call back to the inbound contect (ext-did) with thenumber called with a “switch” prefix.

Then its just a simple matter of adding inbound routes like
switch0297990000 and making them do as you like.

July 9th, 2007 by Kevin Withnall

When using my new Nokia E65 and dialing out with asterisk, it would often fail as i couldn’t dial a + (international option).

using Trixbox, the + character is reserved in outbound routes so i had to use extensions_custom.conf to make the following changes…

[from-internal-intldial]
exten => _+61XXXXXXXXX,1,Goto(from-internal,0${EXTEN:-9},1)
exten => _*X.,1,Goto(from-internal,${EXTEN},1)
exten => _X.,1,Goto(from-internal,${EXTEN},1)
This allows  my saved phone entries witha + to work.

Obviously, unless you live in Australia,  you may want to change the +61 to something else.

Also, even though asterisk doesn’t appear to list + as a dialplan option, it works.

Tested in asterisk 1.2.4 and 1.2.5

July 9th, 2007 by Kevin Withnall

I was often seeing something like
– Got SIP response 500 “Internal Server Error” back from 192.168.0.10
on my asterisk server. Actually, its running the trixbox installation but asterisk is the application reporting the errors.

While running polycom firmware up to 2.1.1 this error appears. If you change to 2.1.2, the error goes away.

UPDATE: 2007/07/10

It appears that its come back. After a particularly nasty asterisk crash, im getting these errors again.

Bugger.

July 9th, 2007 by Kevin Withnall

This requires MySql 5 or above as it uses triggers.

Asterisk alarm receiver - using triggers, mysql5

This is really rough but it works so far. YMMV.
butchered together by kevin at ilb dot com dot au
2006 07 29 - version 0.00 alpha

http://kevin.withnall.com

email me for any help or information.

This code has been shamelessly butchered from wakeup.php (http://www.voip-info.org/tiki-index.php?page=Asterisk+tips+Wake-Up+Call+PHP)
by Andy Wysocki awysocki at absoftware dot_here com

Andy, please don’t hate me.
Please don’t blame Andy for the complete lack of style, it was a quick fix and it works. Andy’s code had much niceness about it which i
removed while developing. I should have put it back and probably will one day.

Flow of events….
1. Alarm panel sends codes to asterisk box
2. Shell script is run by alarmreceiver
inserts alarmcode into alarm_event
triggers output_events creation
3. shell script then looks at output_events rows to see what work it has to do
4. shell script then tries to create call files (this step is also triggered by cron)

If its a call…
1. Plays message “The alarm has triggered”
2. plays site name using flite
3. plays zone, event code etc (read alarm.php for more info)
4. lets the user press 1 to ack. they get 3 calls if its not acked. alarm_calls for limits


eventcmd = /usr/local/ilb/asterisk/alarmproc (or whereever you want to put it)


/usr/local/ilb/asterisk/alarm_calls


alarm-out
exten => s,1,NoOp(ID == ${ID})
exten => s,n,AGI(alarm.php,ID=${ID})
exten => s,n,Hangupmake an alarm database and upload the sql into it
update triggers

* alarm_event contains the actual events, a trigger runs to …
** set all the appropriate cols
** insert rows into output_events table based on the triggers table
* areas contains the list of areas for each site
* users contains the list of users for each site
* event_groups is the major headings for each category of events
* event_types is the individual events that can be reported
* site is the list of sites with site codes that you listen for
* triggers is the table that has the alerting rules. pretty much, if its blank, it matches.
* action of call means dial
* action of email means emailalarmproc is called by alarmreceiver
alarm_calls just makes the calls (and is called by alarmproc and crontab)edit alarmproc and alarm_calls
* change server.domain.com.au to your mysql server
* set the username/passwords accordingly
* set callerid appropriately
* edit the sendmail line and adjust the from address