A2Billing Outbound Caller ID – passing using Caller Name

In this post – http://sysadminman.net/blog/2012/a2billing-outbound-caller-id-from-a-sip-client-4077 – I showed how to set the caller ID in A2Billing for a SIP customer. Using a clever trick though it is possible to allow the user to set the ‘Caller ID Name’ in their softphone and use this as the caller ID Number.

This idea was taken from here – http://forum.asterisk2billing.org/viewtopic.php?f=35&t=8709 – and needs us to add a small piece of code to an Asterisk config file. If you would like this doing on your SysAdminMan VPS please open a support ticket.

Currently in this file  – /etc/asterisk/extensions_custom.conf – we have this code –

[a2billing-sip]
exten => _X.,1,DeadAGI(a2billing.php,2)
exten => _X.,n,Hangup

and we are going to change this to –

exten => _X.,1,Set(CALLERID(num)=${IF($[ ${CALLERID(num)} = ${CDR(accountcode)} ]?${CALLERID(name)}:${CALLERID(num)}) })
exten => _X.,n,DeadAGI(a2billing.php,2)
exten => _X.,n,Hangup

You will need to restart Asterisk or reload the dialplan after making this change.

What this says is that if the caller ID is set to the a2billing customer account number set what ever has been entered as the Caller ID Name to be the Caller ID Number.

Also for this to work in A2Billing / Settings / agi-conf2 we must set “cid_sanitize = No” to allow the customer to pass any caller ID –

cid_sanitize_to_no

Now in Zoiper I can set my caller ID Name to 441161231234 and that will be used as my caller ID Number –

caller id in zoiper

1 thought on “A2Billing Outbound Caller ID – passing using Caller Name

  1. wasim

    love the idea
    “What this says is that if the caller ID is set to the a2billing customer account number set what ever has been entered as the Caller ID Name to be the Caller ID Number.”
    but what i want if caller id is set to a2billing account, and what if user enter a2billing account as caller id name? can we check that? what i mean to say check if a2b account is set as caller id name or caller id number than set caller id to what ever user has entered in a2b caller id but if there is nothing entered as caller id set to 0 as caller id. is that possible?

Comments are closed.