Dialplan extra number code

On a mobile website, we place links in the form of a (service) number. So when you visit the website with a smartphone and click on the link, you can phone the number directly.

This is not a problem, but we also want to send a tree digit generic code with the number. The link would be: {servicenumber},{code} (i.e. 12345678,252).

The last three numbers (the code) needs to be handled in the dialplan. Is there a way to get the code in the dialplan/extensions.conf?

Yes, but whether you can actually do so depends on lots of things you haven’t told us.

We are running on Asterisk 12.7.1.

This is an example of the extensions.conf:

[Queues]
;Anonymous Mobile
exten => 312400,1,NoOp()
    same => n,Verbose(This is a test)
    same => n,HangUp()

When i call the number 312400,1,2,3 it will output “This is a test”. Now i need to get the numbers 123.

Edit
I got it working:

[Queues]
;Anonymous Mobile
exten => 312400,1,NoOp()
same => n,Answer()
    same => n,Read(CODE,queues/anonymous/calling_tone,3,,,7)
    same => n,Verbose(Code: ${CODE})
    same => n,Hangup()

So they weren’t actually part of the number, but were actually sent in band after the call was set up. In some circumstances they may have actually been sent in the number and appeared in the extension.