CID match not working in Asterisk 16

I haven’t been able to reproduce this issue.

Some points…

  • You do NOT need to use the wildcard underscore prefix in either the extension or callerid part of a match pattern unless you actually are using wildcard characters.

  • Extensions in the dialplan don’t have to be mentioned in pjsip and pjsip endpoint names don’t have to be mentioned in the dialplan. You may name your local endpoints the same as the extension but that’s not required and not even recommended for security purposes.

  • The callerid part of an extension match rule matches on callerid only. It has nothing to do with pjsip. EXCEPT…

  • If the pjsip endpoint for the incoming call has callerid set, that’s the callerid that will be matched in the dialplan.

  • There are other pjsip endpoint options that can affect the callerid presented to the dialplan, so…

If you want to take this further, we really will need the full pjsip endpoint configuration and a pcap.

1 Like

When you say callerid, do you mean callerid(num)? In my case, I do have speciall settings in pjsip.conf.

Yep. The number part.

I have this

[cos-all-post](+)
exten => _7000/_100,1,Answer()
 same => n,playback(vm-goodbye)
 same => n,Hangup()

Something important to metion is that I am using VitalPBX, so, that’s why I am extending from context “cos-all-post”, another important thing to mention is that I am using Asterisk 17.1.0

If I go to the asteirsk CLI, and execute the following command:

dialplan show cos-all-post

This is the result

 '_7000' (CID match '_100') =>  1. Answer()   [extensions__60-tests.conf:13790]
                    2. playback(vm-goodbye)   [extensions__60-tests.conf:13791]
                    3. Hangup()               [extensions__60-tests.conf:13792]

Asterisk Log

-- Executing [s@cos-all:13] Goto("PJSIP/VPBX0-0000000c", "cos-all-post,7000,1") in new stack
    -- Goto (cos-all-post,7000,1)
    -- Executing [7000@cos-all-post:1] Answer("PJSIP/VPBX0-0000000c", "") in new stack
    -- Executing [7000@cos-all-post:2] Playback("PJSIP/VPBX0-0000000c", "vm-goodbye") in new stack
    -- <PJSIP/VPBX0-0000000c> Playing 'vm-goodbye.ulaw' (language 'en')
    -- Executing [7000@cos-all-post:3] Hangup("PJSIP/VPBX0-0000000c", "") in new stack
  == Spawn extension (cos-all-post, 7000, 3) exited non-zero on 'PJSIP/VPBX0-0000000c'
    -- Executing [h@cos-all-post:1] NoOp("PJSIP/VPBX0-0000000c", "Hanging Up the Call (Post)") in new stack
    -- Executing [h@cos-all-post:2] Hangup("PJSIP/VPBX0-0000000c", "") in new stack
  == Spawn extension (cos-all-post, h, 2) exited non-zero on 'PJSIP/VPBX0-0000000c'

You should try updating Asterisk, because with this version of Asterisk is working fine, using PJSIP

I am not sure whether your dialplan is applicable here. There is the initial s extension and an explicit Goto. It looks as if this is something special. What do you get with dialplan show cos-all?

Asterisk 16.8.0

[cos-all-post]
exten => _7000/_100,1,Answer()
same => n,playback(vm-goodbye)
same => n,Hangup()

dialplan show cos-all-post
[ Context ‘cos-all-post’ created by ‘pbx_config’ ]
‘_7000’ (CID match ‘_100’) => 1.
Answer() [extensions.conf:160]
2. playback(vm-goodbye)
[extensions.conf:161]
3. Hangup()
[extensions.conf:162]

  -= 1 extension (3 priorities) in 1 context. =-

Calling 7000 extension from extension 100:

  NOTICE[19104]: res_pjsip_session.c:3078 new_invite: Call from

‘100’ (UDP:192.168.5.103:8020) to extension ‘7000’ rejected
because extension not found in context ‘cos-all-post’.

Remove the underscore from 7000 and 100
If I’m not wrong, underscore is to use with wildcards and in your case, you are trying match only 7000 from 100.

Changing dialplan to:

[cos-all-post]
exten => 7000/100,1,Answer()
same => n,playback(vm-goodbye)
same => n,Hangup()

not solving:

  NOTICE[20199]: res_pjsip_session.c:3078 new_invite: Call from

‘100’ (UDP:192.168.5.103:8020) to extension ‘7000’ rejected
because extension not found in context ‘cos-all-post’.

add a

exten => 7000,1,Dumpchan()
 same => n,Hangup()

Then call 7000 from 100, what is the output of the dumpchan?

Dumping Info For Channel: PJSIP/100-00000016:

a single line of output isn’t of any use. please post the whole output using the preformatted text button.

You must to put the dialplan in the context assign it to your device. The most common context is from-internal

I have the same problem. Created a request in jira.
https://issues.asterisk.org/jira/browse/ASTERISK-28767

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