asterisk2billing.org
http://forum.asterisk2billing.org/

callerid not configurable -> use calleridname instead
http://forum.asterisk2billing.org/viewtopic.php?f=35&t=8709
Page 1 of 1

Author:  univ [ Sat Mar 26, 2011 8:30 pm ]
Post subject:  callerid not configurable -> use calleridname instead

The problem I was facing: I wanted to allow softphone users (X-Lite) to set their outgoing callerid directly in the softphone. X-Lite has configurable fields "username" (the a2billing card ID) and "display name" (does nothing in Asterisk/a2billing).

"username" is interpretated as callerid(num) in Asterisk.
"display name" is interpretated as callerid(name) in Asterisk.

If we change "username" in X-Lite the user cannot log in anymore and no longer place calls, since this is his a2billing card ID. So, a workaround is to set "display name" (callerid)name to callerid(num). The following does exactly that if the callerid is identical to the a2billing card ID:

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

The cool thing is that this will only set "display name" as outgoing callerID if the callerID is identical to the users card ID, and not always. This way he can still properly set the outgoing callerID in other softphones or other calling devices that don't have this limitation like X-Lite.

Credits go to lethal-gr in this thread ( viewtopic.php?p=31254 ) who came up with the idea.

Would be great if that could make it into a configurable option (use callerid(name) instead of callerid(num) if callerid(num) empty / identical to card ID / always etc.) in some next release.

Thanks! :)

Author:  torontob [ Fri Aug 30, 2013 3:10 pm ]
Post subject:  Re: callerid not configurable -> use calleridname instead

Hello,

Great post. How can this be tweeked to work for DID Inbound which is forwarding an IAX2 PEER who is registerd to Asterisk? I need both CID NAME and CID NUM to pass as I am in Canada and we are allowed to send both and don't have a CNAM system here.

Thanks,

Page 1 of 1 All times are UTC
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/