Incoming Caller Id - Changes Sometimes in asterisk

We are using PRI and routed via asterisk incoming Voip calls, When i call from mobile number to the extension created in asterisk through PRI Incoming it shows sometimes src as extension number in asterisk server.

So please give me an solution for this

Here is the dialplan:

Preformatted textexten => 115,1,MixMonitor(/var/www/html/monitor/from-internal/{CDR(uniqueid)}.wav,) exten => 115,n,Set(__src={CDR(src)})
exten => 115,n,Set(__uniqueid={CDR(uniqueid)}) exten => 115,n,Queue(quee,trn,,,60,,qm-mac) exten => 115,n,Wait(1) exten => 115,n,set(curresul={CURL(http://ap2-server/apiqueue.php?src=${src}&status=0&queuename=queuename)})

Preformatted text[macro-qm-mac]
exten => s,1,NoOp({MEMBERINTERFACE} --{MEMBERNAME} )
exten => s,n,MYSQL(Connect connid 127.0.0.1 root pass asterisk)
exten => s,n,GotoIf([“{connid}” = “”]?error,1)
exten => s,n,MYSQL(Query resultid {connid} insert into Group_dst (Dst,Uniqueid)values("{MEMBERNAME}",{uniqueid})) exten => s,n,set(curresul={CURL(http://ap2-server/apiqueue.php?src=${src}&status=1&queuename=Chennaiad)})

Preformatted text[quee]
setinterfacevar = yes
setqueuevar = yes
setqueueentryvar = yes
membermacro = qm-mac
autofill = no
weight = 0
musiconhold = default
timeout = 35
retry = 1
wrapuptime = 10
maxlen = 0
servicelevel = 0
strategy = Ringall
joinempty = paused,inuse,invalid
leavewhenempty = 0
reportholdtime = 0
ringinuse = NO
member =>SIP/95514xxxx@matrix

Please use the </> button to mark your logs and configuration files as preformatted text.

Please also provide logs or some other evidence of the problem.

However, I note that the CDR function was not intended for this sort of usage, e.g. you probably want ${CALLERID(num), and ${UNIQUEID}.

For SIP , Asterisk is both server and client.

<— SIP read from UDP:43.254.109.83:5072 —>
SIP/2.0 200 OK
Via: SIP/2.0/UDP 13.234.154.122:5060;branch=z9hG4bK382f4669;rport=5060
From: “asterisk” sip:asterisk@13.234.154.122;tag=as15d3c02a
To: sip:812@43.254.109.83:5072;tag=124051058
Call-ID: 5573dea744dfe84b4fc119767494e235@13.234.154.122:5060
CSeq: 102 OPTIONS
Supported: replaces, path, timer, eventlist
User-Agent: Grandstream HT818 1.0.8.3
Allow: INVITE, ACK, OPTIONS, CANCEL, BYE, SUBSCRIBE, NOTIFY, INFO, REFER, UPDATE
Content-Length: 0

<------------->
— (10 headers 0 lines) —
Really destroying SIP dialog ‘5573dea744dfe84b4fc119767494e235@13.234.154.122:5060’ Method: OPTIONS

<— SIP read from UDP:103.249.83.166:5060 —>
INVITE sip:1164@13.234.154.122 SIP/2.0
From: sip:08680863226@103.249.83.166:5060;tag=dab6c8-af04a8c0-13c4-5d2313ef-4be675ef-5d2313ef
To: sip:1164@13.234.154.122
Call-ID: db9b60-af04a8c0-13c4-5d2313ef-73be1541-5d2313ef
CSeq: 1 INVITE
Via: SIP/2.0/UDP 103.249.83.166:5060;rport;branch=z9hG4bK-5d2313ef-d105ddb6-fcc4815
P-Asserted-Identity: sip:08680863226@192.168.4.175
Max-Forwards: 70
Supported: replaces
User-Agent: Matrix-SETUVTEP
Contact: sip:103.249.83.166:5060;transport=udp
Allow: INVITE,BYE,ACK,CANCEL,REFER,NOTIFY,OPTIONS
Content-Type: application/sdp
Content-Length: 278

v=0
o=- 3922918716 3922918716 IN IP4 103.249.83.166
s=Matrix-SETUVTEP
c=IN IP4 103.249.83.166
t=0 0
m=audio 8040 RTP/AVP 0 8 101
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=rtcp:8041 IN IP4 103.249.83.166
a=sendrecv

<------------->
— (14 headers 12 lines) —
Sending to 103.249.83.166:5060 (NAT)
Sending to 103.249.83.166:5060 (NAT)
Using INVITE request as basis request - db9b60-af04a8c0-13c4-5d2313ef-73be1541-5d2313ef
Found peer ‘matrix’ for ‘08680863226’ from 103.249.83.166:5060
== Using SIP RTP CoS mark 5
Found RTP audio format 0
Found RTP audio format 8
Found RTP audio format 101
Found audio description format PCMU for ID 0
Found audio description format PCMA for ID 8
Found audio description format telephone-event for ID 101
Capabilities: us - (alaw|ulaw|g729), peer - audio=(ulaw|alaw)/video=(nothing)/text=(nothing), combined - (alaw|ulaw)
Non-codec capabilities (dtmf): us - 0x1 (telephone-event|), peer - 0x1 (telephone-event|), combined - 0x1 (telephone-event|)
Peer audio RTP is at port 103.249.83.166:8040
Looking for 1164 in kunamt1 (domain 13.234.154.122)
sip_route_dump: route/path hop: sip:103.249.83.166:5060;transport=udp

<— Transmitting (NAT) to 103.249.83.166:5060 —>
SIP/2.0 100 Trying
Via: SIP/2.0/UDP 103.249.83.166:5060;branch=z9hG4bK-5d2313ef-d105ddb6-fcc4815;received=103.249.83.166;rport=5060
From: sip:08680863226@103.249.83.166:5060;tag=dab6c8-af04a8c0-13c4-5d2313ef-4be675ef-5d2313ef
To: sip:1164@13.234.154.122
Call-ID: db9b60-af04a8c0-13c4-5d2313ef-73be1541-5d2313ef
CSeq: 1 INVITE
Server: Asterisk PBX 16.2.1
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
Contact: sip:1164@13.234.154.122:5060
Content-Length: 0

<------------>
– Executing [1164@kunamt1:1] MixMonitor(“SIP/matrix-00000080”, “/var/www/html/monitor/from-internal/1562579981.194.wav,”) in new stack
– Executing [1164@kunamt1:2] Set(“SIP/matrix-00000080”, “__src=116”) in new stack
– Executing [1164@kunamt1:3] NoOp(“SIP/matrix-00000080”, "1164 SIP/matrix-00000080–116–0 ") in new stack
– Executing [1164@kunamt1:4] Set(“SIP/matrix-00000080”, “__uniqueid=1562579981.194”) in new stack
– Executing [1164@kunamt1:5] Queue(“SIP/matrix-00000080”, “testing,trn,60,qm-testing”) in new stack
[Jul 8 15:29:41] WARNING[14227][C-00000044]: app_queue.c:8299 queue_exec: Unable to join queue ‘testing’
– Executing [1164@kunamt1:6] Wait(“SIP/matrix-00000080”, “1”) in new stack
== Begin MixMonitor Recording SIP/matrix-00000080

<— SIP read from UDP:103.249.83.162:1300 —>
REGISTER sip:zzz.pulxx.com SIP/2.0
Via: SIP/2.0/UDP 103.249.83.162:1300;branch=z9hG4bK371567932DE99EFE
From: “111” sip:111@zzz.pulxx.com;tag=6118B17E-A0F5393
To: sip:111@zzz.pulxx.com
CSeq: 127 REGISTER
Call-ID: a548347e-ab25093-fc1435fe@192.168.4.69
Contact: sip:111@103.249.83.162:1300;methods=“INVITE, ACK, BYE, CANCEL, OPTIONS, INFO, MESSAGE, SUBSCRIBE, NOTIFY, PRACK, UPDATE, REFER”
User-Agent: PolycomSoundPointIP-SPIP_331-UA/4.0.7.2514
Accept-Language: en
Authorization: Digest username=“111”, realm=“asterisk”, nonce=“5348f501”, uri=“sip:zzz.pulxx.com”, response=“81f00d28485b171955c7f89a6c67a928”, algorithm=MD5
Max-Forwards: 70
Expires: 10
Content-Length: 0

<------------->
— (13 headers 0 lines) —
Sending to 103.249.83.162:1300 (NAT)
[Jul 8 15:29:41] NOTICE[13458]: chan_sip.c:17421 check_auth: Correct auth, but based on stale nonce received from ‘“111” sip:111@zzz.pulxx.com;tag=6118B17E-A0F5393’

<— Transmitting (NAT) to 103.249.83.162:1300 —>
SIP/2.0 401 Unauthorized
Via: SIP/2.0/UDP 103.249.83.162:1300;branch=z9hG4bK371567932DE99EFE;received=103.249.83.162;rport=1300
From: “111” sip:111@zzz.pulxx.com;tag=6118B17E-A0F5393
To: sip:111@zzz.pulxx.com;tag=as27db7c38
Call-ID: a548347e-ab25093-fc1435fe@192.168.4.69
CSeq: 127 REGISTER
Server: Asterisk PBX 16.2.1
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
WWW-Authenticate: Digest algorithm=MD5, realm=“asterisk”, nonce=“37981dbc”, stale=true
Content-Length: 0

The log does not match the dialplan.

Your files are still not marked as preformatted. Unless you can see all the $, _, { , < etc. and the newlines are in the correct place, your files are difficult to read and we can’t be sure that important information hasn’t been hidden.

What happens if you use the expected functions, as I gave above?

If it is still not right we need to see the definition of matrix, as it could be overriding the caller ID.

Incoming.txt (76.4 KB)

Here I had attached the call flow kindly please refer it and give me some solution to solve it.

Incoming Caller Id changes in asterisk

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.