Hi,
For some reason my telecoms provider has been messing around with the caller ids that we are receiving (no idea why I certainly didn't ask them to). Short story is they won't/can't change it back.
Some calls that I receive seem to drop the leading zero on international calls for no apparent reason. For example:
0091123456789
is received as:
091123456789
Fortunately I can work around it. What I need to do is check to see if the incoming caller id starts with "09" and append "0" to the front if this is true. I've looked around and pieced together some code based on the following URL: http://www.freepbx.org/support/documentation/howtos/how-to-change...
I'm using Trixbox 2.6.2.1, according to the URL (if I understand it correctly) I need to find out what context I'm using in zapata.conf which is:
context=from-pstn
Then change this to:
context=from-pstn-custom
Then in the extensions_custom.conf I add the following:
[from-pstn-custom]
exten => _X!,1,GotoIf($["${CALLERID(num):0:2}" != "09"]?numberok)
exten => _X!,n,NoOp(Changing Caller ID number from ${CALLERID(num)} to 0${CALLERID(num)})
exten => _X!,n,Set(CALLERID(num)=0${CALLERID(num)})
exten => _X!,n(numberok),Goto(from-pstn,${EXTEN},1)
My understanding is CALLERID(num):0:2 is a substring starting from char 0 - 2? If its not true it goes to the last line (numberok). Otherwise a print some 'useful' stuff to the screen to notify nobody in particular as I don't watch the terminal all day. Then I set the caller id to 0 + whatever the caller ID was. Finally the last line sends me back to the original from-pstn context?
The problem is when I do this all my call routing dies. Calls come in on the zap lines but won't ring anything. If you're a caller phoning in, all you get is silence. I know this must be something simple but I don't understand enough of asterisk to work this out myself.
Can anyone point me in the right direction?
Wayne Merricks

Member Since:
2009-01-21