Reputation: 233
I'm new to Asterisk but I can make an outgoing call by generating a call file and moving it to the spool folder. I can even link it to an AGI script and get the call to do more things
The problem is I can see all the details including the CLI number in the cdrdb database but not the number it was calling. Only the letter 's' in the 'dst' column.
Also when I type "core show channels concise" I get a channel for the current outgoing call but it says "SIP/0001c" or something similar.
Is there something I should be putting into the call file or the AGI script that can pass the destination number on? Or should I be doing a dial plan here?
BTW calls are defiantly going through.
Thanks
Upvotes: 0
Views: 4187
Reputation: 7180
From: http://www.voip-info.org/wiki/view/Asterisk+auto-dial+out
The phone number you are dialling will not be stored in the CDR by * - if you need this information for CDR processing you can set the CallerID in the call file to this number and it will be stored. However, this will present the person you are calling their own phone number, which doesn't make much sense. A better solution might be to put the number you are dialing in the Set: channel variable in the .call file and later put it into the UserField of the CDR. See example above in the first section.
So I think the best way would be to add a variable in your call file (as the text says), with the target, like:
Set: Target=5555555
Then, in your agi script, you will have a channel variable named Target with the value in question.
Get its contents via GET VARIABLE or GET FULL VARIABLE, and in your agi script, add a custom CDR field by setting CDR(myvariable) with SET VARIABLE "CDR(myvariablename)" "value"
This will get the value to the cdr, ready to be saved. You can try it out with the csv backend, by adding the custom field in cdr_custom.conf, for example adding ${CSV_QUOTE(${CDR(myvariablename)})} at the end.
If you're using other cdr backends, you might have to look at the right documentation (for mysql -and probably the rest too-, you might get away by using the "userfield" column).
Hope it helps!
Upvotes: 2