Summary:ASTERISK-03680: userfield not set in Local channel
Reporter:ruok (ruok)Labels:
Date Opened:2005-03-14 18:54:27.000-0600Date Closed:2008-01-15 15:27:30.000-0600
Versions:Frequency of
Description:Dial plan:

exten => 201,1,SetCDRUserField(9999)
exten => 201,2,Dial(SIP/joe&Local/5553333@trunk/n|30)

After the call is over, the CDR record for the SIP portion contains the correct userfield value, but the one for the Local leg is blank.

I tried it with and without the /n on the Local channel. Same thing either way.


Asterisk CVS-HEAD-02/24/05-15:32:01 built by root@smf-reg2.sip.o1.com on a i686 running Linux
Comments:By: Brian West (bkw918) 2005-03-14 21:00:45.000-0600

wouldn't the CDR be on the one that actually answered the phone in this case?


By: ruok (ruok) 2005-03-14 21:49:39.000-0600

Actually, I thought that might be the case, but even if I answer the phone from the Local channel, the userfield is still only set on the SIP side. The SIP side is assigned a NO ANSWER, and the Local side shows ANSWERED, but still no userfield value on the Local channel CDR.

By: Mark Spencer (markster) 2005-03-15 13:13:46.000-0600

In this case the userfield will only appear on the SIP side of the channel.  If you want it to show up on the Local side, you would need to set the userfield within the 5553333 extension.  You could use a variable to communicate it, however i.e.

SetVar(__my_userfield=9999) and then within the local handling SetCDRUserField(${my_userfield})

By: ruok (ruok) 2005-03-15 16:11:20.000-0600

I tried like you suggested, and it didnt work. I also tried single inheritance with a single leading '_' as well as adding the 'g' global option to setvar. I could not get a variable to stick across a Local channel. Any other suggestions?

New dialplan (simplied for this example):


exten => _NXXXXXX,1,SetCDRUserField(${MY_EXTENSION_ID})
exten => _NXXXXXX,2,Dial(SIP/${EXTEN}@${STATIC_SIP_GW})


exten => 201,1,SetCDRUserField(9999)
exten => 201,2,SetVar(__MY_EXTENSION_ID=9999)
exten => 201,3,Dial(SIP/joe&Local/5553333@trunk/n|30)

I am calling 201 in mycontext to start the call.

By: Mark Spencer (markster) 2005-03-15 22:06:21.000-0600

Try latest CVS head.  I just made it inherit properly across a local channel.

By: ruok (ruok) 2005-03-21 16:08:43.000-0600

Latest CVS fixed the inherited variables, so your workaround for setting UserField in Local channel CDRs now works. Thanks Mark!

By: Mark Spencer (markster) 2005-03-21 16:14:21.000-0600

Glad to be of service.

By: Russell Bryant (russell) 2005-03-31 20:43:16.000-0600

not included in 1.0

By: Digium Subversion (svnbot) 2008-01-15 15:27:30.000-0600

Repository: asterisk
Revision: 5180

U   trunk/channels/chan_local.c

r5180 | markster | 2008-01-15 15:27:30 -0600 (Tue, 15 Jan 2008) | 2 lines

Inherit variables across local channel (bug ASTERISK-3680)