The "Accepting Call from" log messages


Ever used PRIs for years and then have SIP trunks? Chances are that you also missed seeing the “Accepting call from …” log events on the SIP calls. This was one of the handiest things of PRI calls if you’re looking for a specific call in the logs.

Well, you can now with SIP calls too!

Consider this dialplan excerpt as I use on extensions_custom.conf:

exten => _+1.,1,Set(DID=${EXTEN:2}) ; Remove +1 from DID
exten => _+1.,n,Set(CALLERID(num)=${CALLERID(num):2}) ; Remove +1 from CID
exten => _+1.,n,Set(CDR(accountcode)=${DID})
exten => _+1.,n,Goto(from-trunk,${DID},1) ; Go to from-trunk
exten => _X.,1,Noop(Accepting call from ${CALLERID(num)} to ${EXTEN})
exten => _X.,n,Set(CDR(accountcode)=${EXTEN})
exten => _X.,n,Noop(Handling call from ${CALLERID(num)} to ${EXTEN})

With this addition ALL of your incoming calls will now log with that first same message. Note that I also update the CDR’s accountcode field with the dialed number. That line probably doesn’t matter to you but I have users that will use CDR call counts for phone numbers used in marketing programs. Having the DID in that field became infinitely useful to them in the reporting of their success.

Hey, thanks for sharing the code. It is really helpful.

Bugs, feature requests and improvements can be submitted to

Patches and pull request (through also appreciated with completed code submission agreement