Page 1 of 1

Need help truncating inbound ani to the last 10 digits sent

PostPosted: Wed Jul 23, 2014 1:49 am
by ianteller
Hello all. I am transferring from on vici system to another via sip. I need some help stripping the sip trunk info off of the caller id.

Best case would be to remove everything except the last 10 digits. Below is the inbound context I tried.

[inbound01]
exten => _X.,1,Set(CALLERID(num)=${CALLERID(num)-10})
exten => _X.,2,AGI(agi-DID_route.agi)
exten => _X.,n,Hangup()
exten => h,1,AGI(agi://127.0.0.1:4577/call_log--HVcauses ... EBUG-----${HANGUPCAUSE}-----${DIALSTATUS}-----${DIALEDTIME}-----${ANSWEREDTIME})

Thanks to anyone who can help!
Ian

Re: Need help truncating inbound ani to the last 10 digits s

PostPosted: Wed Jul 23, 2014 2:56 am
by striker
i think you missed ":" as show below

exten => _X.,1,Set(CALLERID(num)=${CALLERID(num):-10})

Re: Need help truncating inbound ani to the last 10 digits s

PostPosted: Wed Jul 23, 2014 7:35 am
by mflorell
That's the whole reason we added the DID setting "Clean CID Number"

Re: Need help truncating inbound ani to the last 10 digits s

PostPosted: Wed Jul 23, 2014 11:37 am
by ianteller
Thank you both for the replies.
Couldn't get either solution to quite work. I think the extra info that I am seeing on the agent screen is added after the call is accepted.
What I am doing is transferring from one vicidal system to another. They are registered to each other via a sip connection.
I am currently using the below dialplan entry to send the call:

exten => _977.,1,AGI(agi://127.0.0.1:4577/call_log)
exten => _977.,2,Set(CALLERID(num)=${CALLERID(num):-10})
exten => _977.,n,Dial(SIP/${EXTEN:3}@os0101,,tTo)
exten => _977.,n,Hangup

And using the default inbound context to receive the call pointed to a fake DID.
I can see the call is coming in with the correct DID however it is showing all the 20 digit trunk info on the agent screen in the phone field. (V72312320300000003)
How can I fix that?
Here is the incoming info, Caller ID (Ani) looks good here. It must be adding the info before it reaches the agent

[Jul 23 12:21:12] -- Executing [192*168*000*005*9774072221000@default:1] Goto("SIP/voipvoip001-00000086", "default,9774072221000,1") in new stack
[Jul 23 12:21:12] -- Goto (default,9774072221000,1)
[Jul 23 12:21:12] -- Executing [9774072221000@default:1] AGI("SIP/voipvoip001-00000086", "agi://127.0.0.1:4577/call_log") in new stack
[Jul 23 12:21:12] -- AGI Script Executing Application: (EXEC) Options: (Set(_CAMPCUST=CAM001))
[Jul 23 12:21:12] -- <SIP/voipvoip001-00000086>AGI Script agi://127.0.0.1:4577/call_log completed, returning 0
[Jul 23 12:21:12] -- Executing [9774072221000@default:2] Set("SIP/voipvoip001-00000086", "CALLERID(num)=407921xxxx") in new stack
[Jul 23 12:21:12] -- Executing [9774072221000@default:3] Dial("SIP/voipvoip001-00000086", "SIP/4072221000@os0101,,tTo") in new stack
[Jul 23 12:21:12] == Using SIP RTP CoS mark 5
[Jul 23 12:21:12] -- Called SIP/4072221000@os0101
[Jul 23 12:21:12] -- SIP/os0101-00000087 answered SIP/voipvoip001-00000086
[Jul 23 12:21:35] -- Executing [h@default:1] AGI("SIP/voipvoip001-00000086", "agi://127.0.0.1:4577/call_log--HVcauses--PRI-----NODEBUG-----16-----ANSWER-----48-----23") in new stack
[Jul 23 12:21:35] -- <SIP/voipvoip001-00000086>AGI Script agi://127.0.0.1:4577/call_log--HVcauses ... -48-----23 completed, returning 0
[Jul 23 12:21:35] == Spawn extension (default, 9774072221000, 3) exited non-zero on 'SIP/voipvoip001-00000086'

Thanks Again!!