Forced to work with some characters with numbers from outside App

Hi
i have my ODOO app that integrated with Asterisk 13

the WEBRTC send to the server the number as
(786) 290-7229

as a sample

and always it says “the # you have dialed is not in service”

if the External application send it as 7862907229 , it works

but the problems that I’m forced to work on that case .

what can i do with asterisk so that the incoming # like (786) 290-7229 treat them like 7862907229 ???

cheers

sample of call :slight_smile:Server3*CLI>
== Using SIP RTP CoS mark 5
– Executing [(786) 290-7229@from-internal:1] Macro(“SIP/1060-00000af0”, “user-callerid,LIMIT,EXTERNAL,”) in new stack
– Executing [s@macro-user-callerid:1] Set(“SIP/1060-00000af0”, “TOUCH_MONITOR=1470755956.2800”) in new stack
– Executing [s@macro-user-callerid:2] Set(“SIP/1060-00000af0”, “AMPUSER=1060”) in new stack
– Executing [s@macro-user-callerid:3] GotoIf(“SIP/1060-00000af0”, “0?report”) in new stack
– Executing [s@macro-user-callerid:4] ExecIf(“SIP/1060-00000af0”, “1?Set(REALCALLERIDNUM=1060)”) in new stack
– Executing [s@macro-user-callerid:5] Set(“SIP/1060-00000af0”, “AMPUSER=”) in new stack
– Executing [s@macro-user-callerid:6] GotoIf(“SIP/1060-00000af0”, “0?limit”) in new stack
– Executing [s@macro-user-callerid:7] Set(“SIP/1060-00000af0”, “AMPUSERCIDNAME=”) in new stack
– Executing [s@macro-user-callerid:8] GotoIf(“SIP/1060-00000af0”, “1?report”) in new stack
– Goto (macro-user-callerid,s,14)
– Executing [s@macro-user-callerid:14] GotoIf(“SIP/1060-00000af0”, “1?continue”) in new stack
– Goto (macro-user-callerid,s,27)
– Executing [s@macro-user-callerid:27] Set(“SIP/1060-00000af0”, “CALLERID(number)=1060”) in new stack
– Executing [s@macro-user-callerid:28] Set(“SIP/1060-00000af0”, “CALLERID(name)=Unknown”) in new stack
– Executing [s@macro-user-callerid:29] Set(“SIP/1060-00000af0”, “CDR(cnum)=1060”) in new stack
– Executing [s@macro-user-callerid:30] Set(“SIP/1060-00000af0”, “CDR(cnam)=Unknown”) in new stack
– Executing [s@macro-user-callerid:31] Set(“SIP/1060-00000af0”, “CHANNEL(language)=en”) in new stack
– Executing [(786) 290-7229@from-internal:2] Gosub(“SIP/1060-00000af0”, “sub-record-check,s,1(out,(786) 290-7229,dontcare)”) in new stack
– Executing [s@sub-record-check:1] GotoIf(“SIP/1060-00000af0”, “0?initialized”) in new stack
– Executing [s@sub-record-check:2] Set(“SIP/1060-00000af0”, “__REC_STATUS=INITIALIZED”) in new stack
– Executing [s@sub-record-check:3] Set(“SIP/1060-00000af0”, “NOW=1470755956”) in new stack
– Executing [s@sub-record-check:4] Set(“SIP/1060-00000af0”, “__DAY=09”) in new stack
– Executing [s@sub-record-check:5] Set(“SIP/1060-00000af0”, “__MONTH=08”) in new stack
– Executing [s@sub-record-check:6] Set(“SIP/1060-00000af0”, “__YEAR=2016”) in new stack
– Executing [s@sub-record-check:7] Set(“SIP/1060-00000af0”, “__TIMESTR=20160809-171916”) in new stack
– Executing [s@sub-record-check:8] Set(“SIP/1060-00000af0”, “__FROMEXTEN=1060”) in new stack
– Executing [s@sub-record-check:9] Set(“SIP/1060-00000af0”, “__MON_FMT=wav”) in new stack
– Executing [s@sub-record-check:10] NoOp(“SIP/1060-00000af0”, “Recordings initialized”) in new stack
– Executing [s@sub-record-check:11] ExecIf(“SIP/1060-00000af0”, “0?Set(ARG3=dontcare)”) in new stack
– Executing [s@sub-record-check:12] Set(“SIP/1060-00000af0”, “REC_POLICY_MODE_SAVE=”) in new stack
– Executing [s@sub-record-check:13] ExecIf(“SIP/1060-00000af0”, “0?Set(REC_STATUS=NO)”) in new stack
– Executing [s@sub-record-check:14] GotoIf(“SIP/1060-00000af0”, “3?checkaction”) in new stack
– Goto (sub-record-check,s,17)
– Executing [s@sub-record-check:17] GotoIf(“SIP/1060-00000af0”, “1?sub-record-check,out,1”) in new stack
– Goto (sub-record-check,out,1)
– Executing [out@sub-record-check:1] NoOp(“SIP/1060-00000af0”, “Outbound Recording Check from 1060 to (786) 290-7229”) in new stack
– Executing [out@sub-record-check:2] Set(“SIP/1060-00000af0”, “RECMODE=”) in new stack
– Executing [out@sub-record-check:3] ExecIf(“SIP/1060-00000af0”, “1?Goto(routewins)”) in new stack
– Goto (sub-record-check,out,7)
– Executing [out@sub-record-check:7] Gosub(“SIP/1060-00000af0”, “recordcheck,1(dontcare,out,(786) 290-7229)”) in new stack
– Executing [recordcheck@sub-record-check:1] NoOp(“SIP/1060-00000af0”, “Starting recording check against dontcare”) in new stack
– Executing [recordcheck@sub-record-check:2] Goto(“SIP/1060-00000af0”, “dontcare”) in new stack
– Goto (sub-record-check,recordcheck,3)
– Executing [recordcheck@sub-record-check:3] Return(“SIP/1060-00000af0”, “”) in new stack
– Executing [out@sub-record-check:8] Return(“SIP/1060-00000af0”, “”) in new stack
– Executing [(786) 290-7229@from-internal:3] Set(“SIP/1060-00000af0”, “MOHCLASS=default”) in new stack
– Executing [(786) 290-7229@from-internal:4] Set(“SIP/1060-00000af0”, “_NODEST=”) in new stack
– Executing [(786) 290-7229@from-internal:5] Macro(“SIP/1060-00000af0”, “outisbusy,”) in new stack
[2016-08-09 17:19:16] WARNING[20431][C-00004288]: app_macro.c:310 _macro_exec: No such context ‘macro-outisbusy’ for macro ‘outisbusy’. Was called by (786) 290-7229@from-internal
– Auto fallthrough, channel ‘SIP/1060-00000af0’ status is ‘UNKNOWN’
– Executing [h@from-internal:1] Macro(“SIP/1060-00000af0”, “hangupcall”) in new stack
– Executing [s@macro-hangupcall:1] GotoIf(“SIP/1060-00000af0”, “1?theend”) in new stack
– Goto (macro-hangupcall,s,3)
– Executing [s@macro-hangupcall:3] ExecIf(“SIP/1060-00000af0”, “0?Set(CDR(recordingfile)=)”) in new stack
– Executing [s@macro-hangupcall:4] Hangup(“SIP/1060-00000af0”, “”) in new stack
== Spawn extension (macro-hangupcall, s, 4) exited non-zero on ‘SIP/1060-00000af0’ in macro ‘hangupcall’
== Spawn extension (from-internal, h, 1) exited non-zero on ‘SIP/1060-00000af0’

You can use the FILTER function on your Number.

https://wiki.asterisk.org/wiki/display/AST/Function_FILTER

1 Like

thank you
can you give me a live example on that # (786) 290-7229 to be like 7862907229 ??

cheers

This should be so obvious that, especially given the trace you have produced, I don’t think you are doing it on Asterisk. I think you are doing it on FreePBX. Things that are easy on Asterisk may be quite difficult on FreePBX, and you should ask on http://community.freepbx.org/

Set(OLDNUMBER="(786) 290-7229")
Set(NEWNUMBER=${FILTER(0-9,${OLDNUMBER)})

1 Like