Clean up Incoming Caller ID

No

Sorry, I don’t understand ?

Use that context for your inbound calls? I don’t know how to be more specific. It is all in the wiki, did you read that yet?

Er no, I’ve read a lot of stuff about call routing and trying to find out modifying Caller ID’s, there seems to be not a lot about it, other than removing leading zeros - I’ll peruse the wiki …

Ozone- You write all that code and can’t get this, facepalm moment.

context variable in the obi trunk to direct to your code.

Hi SkyKing, No I didn’t write the code ‘Timpea’ did I’m just trying to get it to work. Fundamentally I understand how it should work, however, I don’t know how to ‘direct’ a trunk to execute it. I looked into modding some conf files but that just confused me ! As I said before I changed the OBITRUNK1 to LLBT to reflect my trunk name

ok ok , He is MY assumptions on how I think this works.

During boot FreePBX/Asterisk executes various conf files including extensions_custom.conf which has the additional code that can ‘run’ the php script. When a call is passed in from the trunk mentioned in extensions_custom.conf it passes via the script removing the - and space and then returns the modified caller ID for routing via inbound routes - hopefully !

What I don’t get is how ‘from-trunk-sip-LLBT’ fits in to all of this - what/where to I need to change to re-direct the trunk, in the trunk peer detail settings?, some trunk config file ??

Dave.

If you look at the log output you provided, the first meaningful line indicates a call arriving on your system with the context “from-trunk”, but it needs to arrive in the context you created. If you carefully check the PEER details in the GUI for the trunk in question, you will find the line “context=from-trunk” which needs to be changed to “context=from-trunk-sip-LLBT”. Reload your changes and then retest.

Lgaetz just exdplained it to you even simpler. I thought I was pretty clear.

Don’t think any more, it is not working for you and what you “think” is pretty well completely wrong. Just RTFM(s) and all will become clear. . .

I previously tried altering the peer details but it didn’t work (I think I must have added a space by mistake! ‘redface’). That’s when I started looking elsewhere to direct to the script, thinking it needed a conf file altering.
Oh well, the moral is I must double check what I type - At least I’ve learnt some more how Asterisk internals works.

Still not working… At least now the script is being called, but doesn’t remove the - and space - here is the new log http://pastebin.com/raw.php?i=4wr636ec
It looks to me as if it’s working on my DID number rather than the incoming number 0114-123 4567 I could be wrong on that ??

Again, any ides please ?

Dave

First off fix the dup[licate instance of (something like)

full => notice,warning,error,debug,verbose

in /etc/asterisk/logger* heirarchy so you don’t duplicate your logs.

I suggest an easier and cleaner answer might be something like

[from-trunk-sip-LLBT]
exten => _.,1,set(CALLERID(number)=${REPLACE(CALLERID(number), ,)})
exten => _.,n,set(CALLERID(number)=${REPLACE(CALLERID(number),-,)})
exten => _.,n,noop(CALLERID is now ${CALLERID(all)})
exten => _.,n,Goto(from-trunk,${EXTEN},1)

The log file setting are:-

full => debug,error,notice,verbose,warning
console => debug,error,notice,verbose,warning

Could the two instances be causing the duplication ?

I take it I place the code into extensions_custom.conf replacing the:-

[from-trunk-sip-LLBT]
exten => _X!,1,AGI(clean-caller-id.php)
exten => _X!,n,Goto(from-trunk,${EXTEN},1)

Yours seems a lot easier to understand than the pervious script, I’ll give it a go.

Dave.

I said the heirarchy, you will notice that other logger* files are “included” in logger.conf, I believe one of the freepbx upgrade scripts neglected to clean up that situation for some users.

grep -e “^full” /etc/asterisk/logger*

will identify where.

Ah ok, I understand, grep -e “^full” /etc/asterisk/logger* yielded :-

/etc/asterisk/logger_logfiles_additional.conf:full=>debug,error,notice,verbose,warning

/etc/asterisk/logger_logfiles_custom.conf:full=>notice,warning,error,debug,verbose

go ahead and remove the ‘full’ line from the _custom.conf. Also in the future you can see the duplications by running ‘logger show channels’ on the asterisk CLI

Still not work :frowning: - dicko’s code that is …

and the ubiquitous log file …http://pastebin.com/raw.php?i=SCBijWux

From your post:-

.
.
[2013-11-17 18:31:09] VERBOSE[7440][C-00000025] pbx.c: – Executing [MYNUMBER@from-trunk-sip-LLBT:1] Set(“SIP/LLBT-0000002c”, “GROUP()=OUT_8”) in new stack
[2013-11-17 18:31:09] VERBOSE[7440][C-00000025] pbx.c: – Executing [MYNUMBER@from-trunk-sip-LLBT:2] Goto(“SIP/LLBT-0000002c”, “from-trunk,MYNUMBER,1”) in new stack
.
.It does not look like you are not executing the code I suggested, add a couple of noop’s (as I added one) to debug and check your work.