How to match outgoing call DID?

Hello,

I use Asterisk 1.4 with E1 line in Thailand. It work fine I can call out and in.

My number is like 02 264 0100 to 02 264 0199

My Sip extension is 100, 101, 102,…,199

But when i call out it show only 02 264 0100 as my callerid.

How can i do like when i call from my Sip account it show callerid like

Sip CallerID
100 02 264 0100
102 02 264 0101
103 02 264 0103
.
.
.
199 02 264 0199

Now i use dialplan like this

exten => _0.,1,Dial(DAHDI/g0/${EXTEN},30,tTr)

Thank,

Jack

At the very least we need to see sip.conf. In addition, are you sure that your service provider allows you to use anything other than the pilot number?

Hi david55,

my sip.conf like this

[general]
context = default
realm = voip4share.com
udpbindaddr = 0.0.0.0:5060
useragent = VoIP4Share v1.85
sdpsession = VoIP4Share v1.85
disallow = all
allow = g729
allow = alaw
usereqphone = yes
dtmfmode = rfc2833

[100]
type=friend
secret=password
qualify=yes
port=5060
nat=yes
mailbox=100@device
host=dynamic
dtmfmode=rfc2833
disallow=all
allow=g729
allow=alaw
context=from-internal
canreinvite=no
callgroup=1
callerid=022640100
call-limit=1

and in exyension.conf i do like

[from-pstn]
exten => _2640100,1,Dial(SIP/100,30,tTr)
exten => _2640101,1,Dial(SIP/101,30,tTr)

and my service provider say i can use all did

Thank

Delete calleriid from sip.conf. If it still works, use dialplan code to set the CALLERID based on the incoming CALLERID.

See
core show function CALLERID
core show application set

and any reasonable text book on Asterisk dialplan expressions (or just the sample extensions.conf).

Hi david55,

I do delete calleriid from sip.conf.

and change extensions.conf like this

[from-internal]
exten => _0./100,1,Set(CALLERID(num)=022640100)
exten => _0./101,1,Set(CALLERID(all)=“Jack” <022640101>)
exten => _0.,n,Dial(DAHDI/g0/${EXTEN},30,tTr)
exten => _0.,n,Hangup

still not work.

Use “set sip debug on” or wireshark to confirm that you are sending the correct thing to the wire. If so, you will need to ask your service provider to honour the caller ID.

I would have used ${CALLERID(num)} rather than pattern matching individual caller IDs.

Hi david55,

My Asterisk still show only 1 number when call out, If my dial plan is correct I will check with my provider for solve this problem.

Thank for your help.