1 like 0 dislike
72 views

I want if number is coming from 91 and is greater than 10 digit so need to remove 91 from the incoming number or else go as it is...

asked May 16, 2014 in Education & Reference by Yogi (180 points)
edited May 17, 2014 by Yogi | 72 views
    

1 Answer

1 like 0 dislike

In Asterisk above 1.6

exten => 1234,1,NoOp(Incoming call from # ${CALLERID(num)})

;assign the area code (2 first digits) to variable Digit
exten => 1234,n,Set(Digit=${CALLERID(num):0:2})
 
;Returns integer length of the string.
exten => 1234,n,Set(Number=${LEN(${CALLERID(num)})})
 
;Go to label(True) if condition is true or to next step (or label2(False) if defined) if condition is false
exten => 1234,n,GotoIf($["${Digit}"=="91" && "${Number}">"10"]?True:False)
 
;Removes 91 from the caller number if above condition is true
exten => 1234,n(True),Set(ani=${CALLERID(num):2:12})
exten => 1234,n,Goto(cb,1,1)
 
;else
exten => 1234,n(False),Set(ani=${CALLERID(num)})
exten => 1234,n,Goto(cb,1,1)
answered May 16, 2014 by Krish (820 points)

Related questions

0 like 0 dislike
3 answers
0 like 0 dislike
1 answer
1 like 0 dislike
1 answer
0 like 0 dislike
1 answer
2 like 0 dislike
1 answer
0 like 0 dislike
1 answer
0 like 0 dislike
1 answer
0 like 0 dislike
1 answer
asked Sep 24, 2017 in Education & Reference by Sam (1,360 points) | 552 views
2 like 0 dislike
1 answer
0 like 0 dislike
1 answer

Where your donation goes
Technology: We will utilize your donation for development, server maintenance and bandwidth management, etc for our site.

Employee and Projects: We have only 15 employees. They are involved in a wide sort of project works. Your valuable donation will definitely boost their work efficiency.

How can I earn points?
Awarded a Best Answer 10 points
Answer questions 10 points
Asking Question -20 points

Mathe Forum Schule und Studenten
1,179 questions
1,319 answers
277 comments
1,638 users