Open Source Training Seminar FreePBX Paid Support

Ticket #1748 (closed Bugs: fixed)

Opened 1 year ago

Last modified 1 year ago

UTF-8 gets stripped in dialplans

Reported by: lazytt Assigned to:
Priority: minor Milestone: 2.3
Component: Languages / Translation Version: 2.3-branch
Keywords: hebrew, utf-8 Cc:
Confirmation: Unreviewed SVN Revision (if applicable):
Backend Engine: All Backend Engine Version:

Description

in my quest to enable Hebrew on my extensions, callerid, etc. I've noticed that the dial plan seems to be stripping out the hebrew characters. Here is my log file. Notice how when "Executing Macro("SIP/202-b7a83858", "user-callerid") in new stack" the caller id still contained utf-8 characters however right after "Goto (macro-user-callerid,s,21)" the characters are stripped.


Feb 5 16:03:43 DEBUG[3602] chan_sip.c: Setting NAT on RTP to 0
Feb 5 16:03:43 DEBUG[3602] chan_sip.c: Checking SIP call limits for device 202
Feb 5 16:03:43 DEBUG[3602] chan_sip.c: build_route: Contact hop:
Feb 5 16:03:43 VERBOSE[3594] logger.c: Extension Changed 202 new state InUse for Notify User 202
Feb 5 16:03:43 VERBOSE[23856] logger.c: -- Executing Macro("SIP/202-b7a83858", "exten-vm|novm|280") in new stack
Feb 5 16:03:43 VERBOSE[23856] logger.c: -- Executing Macro("SIP/202-b7a83858", "user-callerid") in new stack
Feb 5 16:03:43 DEBUG[23856] pbx.c: Function result is 'device'
Feb 5 16:03:43 DEBUG[23856] pbx.c: Function result is '202'
Feb 5 16:03:43 VERBOSE[23856] logger.c: -- Executing NoOp("SIP/202-b7a83858", "user-callerid: device 202") in new stack
Feb 5 16:03:43 DEBUG[23856] pbx.c: Expression result is '0'
Feb 5 16:03:43 VERBOSE[23856] logger.c: -- Executing GotoIf("SIP/202-b7a83858", "0?report") in new stack
Feb 5 16:03:43 DEBUG[23856] pbx.c: Not taking any branch
Feb 5 16:03:43 DEBUG[23856] pbx.c: Expression result is '0'
Feb 5 16:03:43 VERBOSE[23856] logger.c: -- Executing GotoIf("SIP/202-b7a83858", "0?start") in new stack
Feb 5 16:03:43 DEBUG[23856] pbx.c: Not taking any branch
Feb 5 16:03:43 DEBUG[23856] pbx.c: Function result is '202'
Feb 5 16:03:43 VERBOSE[23856] logger.c: -- Executing Set("SIP/202-b7a83858", "REALCALLERIDNUM=202") in new stack
Feb 5 16:03:43 VERBOSE[23856] logger.c: -- Executing NoOp("SIP/202-b7a83858", "REALCALLERIDNUM is 202") in new stack
Feb 5 16:03:43 DEBUG[23856] pbx.c: Function result is '202'
Feb 5 16:03:43 VERBOSE[23856] logger.c: -- Executing Set("SIP/202-b7a83858", "AMPUSER=202") in new stack
Feb 5 16:03:43 DEBUG[23856] pbx.c: Function result is 'Michirotמחירות'
Feb 5 16:03:43 VERBOSE[23856] logger.c: -- Executing Set("SIP/202-b7a83858", "AMPUSERCIDNAME=Michirotמחירות") in new stack
Feb 5 16:03:43 DEBUG[23856] pbx.c: Expression result is '0'
Feb 5 16:03:43 VERBOSE[23856] logger.c: -- Executing GotoIf("SIP/202-b7a83858", "0?report") in new stack
Feb 5 16:03:43 DEBUG[23856] pbx.c: Not taking any branch
Feb 5 16:03:43 VERBOSE[23856] logger.c: -- Executing Set("SIP/202-b7a83858", "CALLERID(all)=Michirotמחירות <202>") in new stack
Feb 5 16:03:43 DEBUG[23856] pbx.c: Function result is '202'
Feb 5 16:03:43 VERBOSE[23856] logger.c: -- Executing Set("SIP/202-b7a83858", "REALCALLERIDNUM=202") in new stack
Feb 5 16:03:43 VERBOSE[23856] logger.c: -- Executing NoOp("SIP/202-b7a83858", "TTL: ARG1: novm") in new stack
Feb 5 16:03:43 DEBUG[23856] pbx.c: Expression result is '0'
Feb 5 16:03:43 VERBOSE[23856] logger.c: -- Executing GotoIf("SIP/202-b7a83858", "0?continue") in new stack
Feb 5 16:03:43 DEBUG[23856] pbx.c: Not taking any branch
Feb 5 16:03:43 DEBUG[23856] pbx.c: Expression result is '1'
Feb 5 16:03:43 DEBUG[23856] pbx.c: Expression result is '-1'
Feb 5 16:03:43 DEBUG[23856] pbx.c: Function result is '64'
Feb 5 16:03:43 VERBOSE[23856] logger.c: -- Executing Set("SIP/202-b7a83858", "_TTL=64") in new stack
Feb 5 16:03:43 DEBUG[23856] pbx.c: Expression result is '1'
Feb 5 16:03:43 VERBOSE[23856] logger.c: -- Executing GotoIf("SIP/202-b7a83858", "1?continue") in new stack
Feb 5 16:03:43 VERBOSE[23856] logger.c: -- Goto (macro-user-callerid,s,21)
Feb 5 16:03:43 DEBUG[23856] pbx.c: Function result is '"Michirot" <202>'
Feb 5 16:03:43 VERBOSE[23856] logger.c: -- Executing NoOp("SIP/202-b7a83858", "Using CallerID "Michirot" <202>") in new stack
Feb 5 16:03:43 VERBOSE[23856] logger.c: -- Executing Set("SIP/202-b7a83858", "FROMCONTEXT=exten-vm") in new stack
Feb 5 16:03:43 VERBOSE[23856] logger.c: -- Executing Set("SIP/202-b7a83858", "VMBOX=novm") in new stack
Feb 5 16:03:43 VERBOSE[23856] logger.c: -- Executing Set("SIP/202-b7a83858", "EXTTOCALL=280") in new stack
Feb 5 16:03:43 DEBUG[23856] db.c: Unable to find key '280' in family 'CFU'
Feb 5 16:03:43 DEBUG[23856] func_db.c: DB: CFU/280 not found in database.
Feb 5 16:03:43 DEBUG[23856] pbx.c: Function result is ''
Feb 5 16:03:43 VERBOSE[23856] logger.c: -- Executing Set("SIP/202-b7a83858", "CFUEXT=") in new stack
Feb 5 16:03:43 DEBUG[23856] pbx.c: Expression result is '0'
Feb 5 16:03:43 DEBUG[23856] pbx.c: Expression result is '0'
Feb 5 16:03:43 DEBUG[23856] pbx.c: Expression result is '0'
Feb 5 16:03:43 DEBUG[23856] pbx.c: Function result is ''
Feb 5 16:03:43 VERBOSE[23856] logger.c: -- Executing Set("SIP/202-b7a83858", "RT=") in new stack
Feb 5 16:03:43 VERBOSE[23856] logger.c: -- Executing Macro("SIP/202-b7a83858", "record-enable|280|IN") in new stack
Feb 5 16:03:43 DEBUG[23856] pbx.c: Function result is '0'
Feb 5 16:03:43 DEBUG[23856] pbx.c: Expression result is '0'
Feb 5 16:03:43 VERBOSE[23856] logger.c: -- Executing GotoIf("SIP/202-b7a83858", "0?2:4") in new stack
Feb 5 16:03:43 VERBOSE[23856] logger.c: -- Goto (macro-record-enable,s,4)


Change History

02/05/07 05:46:37 changed by pnlarsson

You could try to change line 713 in extensions.conf:

exten => s,n,Set(CALLERID(all)=${AMPUSERCIDNAME} <${AMPUSER}>)

to:

exten => s,n,Set(CALLERID(all)="${AMPUSERCIDNAME}" <${AMPUSER}>)

or make it two lines (try this first):

exten => s,n,Set(CALLERID(name)=${AMPUSERCIDNAME})
exten => s,n,Set(CALLERID(number)=${AMPUSER})

02/06/07 22:03:35 changed by lazytt

Thanks - the "" worked!. For me it was on line 702. here is the entire macro:

;
; ############################################################################
; CallerID Handling
; ############################################################################

;sets the callerid of the device to that of the logged in user
[macro-user-callerid]
exten => s,1,Noop(user-callerid: ${CALLERID(name)} ${CALLERID(number)})
exten => s,n,GotoIf($["${CHANNEL:0:5}" = "Local"]?report) 
exten => s,n,GotoIf($["${REALCALLERIDNUM:1:2}" != ""]?start)
exten => s,n,Set(REALCALLERIDNUM=${CALLERID(number)})
exten => s,n(start),NoOp(REALCALLERIDNUM is ${REALCALLERIDNUM})
exten => s,n,Set(AMPUSER=${DB(DEVICE/${REALCALLERIDNUM}/user)})
exten => s,n,Set(AMPUSERCIDNAME=${DB(AMPUSER/${AMPUSER}/cidname)})
exten => s,n,GotoIf($["x${AMPUSERCIDNAME:1:2}" = "x"]?report) 
exten => s,n,Set(CALLERID(all)="${AMPUSERCIDNAME}" <${AMPUSER}>)
exten => s,n,Set(REALCALLERIDNUM=${DB(DEVICE/${REALCALLERIDNUM}/user)})
exten => s,n(report),Noop(TTL: ${TTL} ARG1: ${ARG1})
exten => s,n,GotoIf($[ "${ARG1}" = "SKIPTTL" ]?continue)
exten => s,n(report2),Set(_TTL=${IF($["foo${TTL}" = "foo"]?64:$[ ${TTL} - 1 ])})
exten => s,n,GotoIf($[ ${TTL} > 0 ]?continue)
exten => s,n,Wait(${RINGTIMER}) ; wait for a while, to give it a chance to be picked up by voicemail
exten => s,n,Answer()
exten => s,n,Wait(2)
exten => s,n,Playback(im-sorry&an-error-has-occured&with&call-forwarding)
exten => s,n,Macro(hangupcall)
exten => s,n,Set(CALLERID(all)=${AMPUSERCIDNAME} <${AMPUSER}>)
exten => s,n,Congestion()
exten => s,n(continue),NoOp(Using CallerID ${CALLERID(all)})
exten => h,1,Macro(hangupcall)

op's: please commit and close. Thanks!

02/06/07 22:12:29 changed by vgster

If no other problems are caused could the " " fix be included in the dialplan.

06/25/07 07:59:41 changed by p_lindheimer

  • owner changed.
  • version changed from 2.2 to 2.3-branch.
  • component changed from Core to Languages / Translation.

08/04/07 16:48:17 changed by p_lindheimer

  • status changed from new to closed.
  • confirmation set to Unreviewed.
  • resolution set to fixed.

[r4695]
This had been changed at once point, I think, because of proper CID format issues. I reviewed the Asterisk code and it appears to look for the " and remove them so this should be safe. Also tested with setting and noops and the display is the same, as well as calling a phone with both.

08/04/07 16:48:56 changed by p_lindheimer

r4695 - will be out in next core update

Donate



Support
Download
Develop
Forums
News
Documentation
Paid Support
About

Paid Ads