Record "number dialed" for incoming calls

Hello,
We are running Asterisk 1.2.13 and I need to somehow keep track of the number that was dialed for an incoming call. We have several Phone numbers from our Telco and all numbers ring the same queue (extension). However, I would like to know which number was dialed for an incoming call. I do not think that this information gets recorded by default in the CDR.
However, when connected to the console, I see that the information is identified by asterisk, as the first line with each incoming call is:

(the YYYYY is what I want to keep track of).
Any help would be greatly appreciated.

Thank you,
Max

Do you have the CALLERID(num) function in that version?

I am pretty sure we do, but not 100%. How would I check?

He doesn’t need the ${CALLERID(num)} variable . he need the variable ${EXTEN} instead of ${CALLERID(num)}.

Could be something like this :

[quote]same=>n,NoOp( incomming call to the DID ${EXTEN})
same=>n,Set(CDR(DID)=${EXTEN})
[/quote]

He is using a mega obsolete version which doesn’t understand “same”. I’m not sure if it even understands “n”.

I noticed that since the beginning. But if he has at least a little understanding about Asterisk, he must know what to replace, to make it work or upgrade the Asterisk version.

That’s the problem. Upgrading is not an option (“if it’s not broken, don’t fix it”).
I do have “a little” understanding about asterisk, but apparently not enough to solve this. It is my understanding that I should push one of the variables for each incoming call to the “userfield” in the CDR. However, I am not sure which variable and furthermore, I cannot figure out how to set the user variable as either of the syntax ( Set(CDR(userfield)=Value) or SetCDRUserField(Value) ) produces an error.

What error? In any case, many things that are taken for granted may not be in 1.2, and many/most people here will never have used it, or will have forgotten the details. I have never used 1.2.

The error is that the command doesn’t exist.
I understand that the version of asterisk is old, but am still hoping someone can help.

Thanks.

[quote=“ambiorixg12”]He doesn’t need the ${CALLERID(num)} variable . he need the variable ${EXTEN} instead of ${CALLERID(num)}.
[/quote]

ambiorixg12 - you are right. After re-reading the post I see that I was looking at the wrong information.

MrMMM - check out the answer from ambiorixg12. You Asterisk version is ancient, but it should have ${EXTEN} :smile:

[quote=“MrMMM”]That’s the problem. Upgrading is not an option (“if it’s not broken, don’t fix it”).
[/quote]

You are working with a dead version : Asterisk 1.2.X Release Date 2005-11-21 and EOL 2010-11-21
I suggest you upgrade Asterisk. You are wasting great features and security fix. That exist in current versions.
Check Asterisk Versions