Ticket #3722 (closed Feature Requests: fixed)

Opened 4 years ago

Last modified 4 years ago

Add default language to the dialplan so that language setting 'stick'

Reported by: mickecarlsson Assigned to: mickecarlsson
Priority: minor Milestone: 2.6
Component: Core Version: 2.5-branch
Keywords: Cc:
Confirmation: Unreviewed Distro:
Backend Engine: All Distro Ver:
Backend Ver: SVN Revision (if applicable):

Description

In Asterisk 1.4 the setting language=<language code> is only in effect for a matched user/peer.

That means that if in General settings the setting Allow Anonymous Inbound SIP Calls? is checked and a call arrives as an unknown peer Asterisk defaults to language=en no matter what the setting are in sip_custom.conf for language=

The solution to this is to add this line in context [from-sip-external]

exten => _.,n,Set(CHANNEL(language)=<language code>)

This setting could be added to the General Settings as a Language field with a check box with the title Set as default language for all voices and sounds or something like that.

Attachments

didlanguage.php.diff (3.8 kB) - added by mickecarlsson on 06/12/09 18:19:28.
Proposed patch
siplang.php.diff (3.7 kB) - added by mickecarlsson on 08/30/09 17:16:41.

Change History

06/12/09 02:01:20 changed by mbrevda

a gui setting would be nice as well... But cant you already do this with the language module, after the inbound route?

06/12/09 06:58:50 changed by mickecarlsson

Yes you can, but it is not the best way to do it if you have over 200 DID's and about 100 extensions. You have to create a Language for every destination in your system and change every Inbound Route to point to the Language, then set the Language to point to your Extension.

This Feature Request is for setting it globally. If there is a need to change language after this setting, one can use the Language module.

06/12/09 07:55:34 changed by mbrevda

The answer to that would probably be: modify the inbound routes to be more flexible and to allow pattern matching/regexing to apply to incoming numbers. Or use a default no did/ no cid route. That would also address another issue: say you need 100 did's in one language and 100 did's in another, how would a default language help with that? I'm not trying to give you a hard time - lets just face it, behind the scenes that's what were going to have to do anyway (set the language for every inbound call). So why not have it 'alive' in the gui as well??

06/12/09 18:19:28 changed by mickecarlsson

  • attachment didlanguage.php.diff added.

Proposed patch

06/12/09 18:21:07 changed by mickecarlsson

This patch will fix the issue. However, that requires an additional field in the incoming table.

Up for discussion

08/26/09 01:42:16 changed by p_lindheimer

are we going to do this, and if so, we need the migration code to add the new field? Or have you come up with a better way or otherwise has this been fixed in Asterisk at some point as it appears to be a lacking issue?

Anyhow - let's either get it in or push it to another release...

08/26/09 01:42:32 changed by p_lindheimer

  • owner changed from p_lindheimer to mickecarlsson.

08/27/09 01:38:45 changed by mickecarlsson

Hmm, it seems that I must have disconnected my brain when I did the patch suggestion as this suggestion id per DID, not for the system. I will look into another solution this weekend.

08/30/09 17:12:59 changed by mickecarlsson

OK, this is up for discussion, some changes are required but I think that I have covered them all. However, I have not had the time to test it, I will do it tomorrow on my test system (not reachable from where I am now).

08/30/09 17:16:41 changed by mickecarlsson

  • attachment siplang.php.diff added.

08/31/09 02:18:36 changed by mickecarlsson

I have now tested the patch and it is working perfectly. Trace from two calls, this one is with SIPLANG=se and an anonymous call.

    -- Executing [040xxxxxxx@from-sip-external:1] NoOp("SIP/xxx.xxx.xxx.xxx-08259688", "Received incoming SIP connection from unknown peer to 040xxxxxxx") in new stack
    -- Executing [040xxxxxxx@from-sip-external:2] Set("SIP/xxx.xxx.xxx.xxx-08259688", "DID=040xxxxxxx") in new stack
    -- Executing [040xxxxxxx@from-sip-external:3] Goto("SIP/xxx.xxx.xxx.xxx-08259688", "s|1") in new stack
    -- Goto (from-sip-external,s,1)
    -- Executing [s@from-sip-external:1] GotoIf("SIP/xxx.xxx.xxx.xxx-08259688", "1?checklang:noanonymous") in new stack
    -- Goto (from-sip-external,s,2)
    -- Executing [s@from-sip-external:2] GotoIf("SIP/xxx.xxx.xxx.xxx-08259688", "1?setlanguage:from-trunk|040xxxxxxx|1") in new stack
    -- Goto (from-sip-external,s,3)
    -- Executing [s@from-sip-external:3] Set("SIP/xxx.xxx.xxx.xxx-08259688", "CHANNEL(language)=se") in new stack
    -- Executing [s@from-sip-external:4] Goto("SIP/xxx.xxx.xxx.xxx-08259688", "from-trunk|040xxxxxxx|1") in new stack
    -- Goto (from-trunk,040xxxxxxx,1)
    -- Executing [040xxxxxxx@from-trunk:1] Set("SIP/xxx.xxx.xxx.xxx-08259688", "__FROM_DID=040xxxxxxx") in new stack

This is a call with Anonymous set to No

    -- Executing [040xxxxxxx@from-sip-external:1] NoOp("SIP/xxx.xxx.xxx.xxx-082a7568", "Received incoming SIP connection from unknown peer to 040xxxxxxx") in new stack
    -- Executing [040xxxxxxx@from-sip-external:2] Set("SIP/xxx.xxx.xxx.xxx-082a7568", "DID=040xxxxxxx") in new stack
    -- Executing [040xxxxxxx@from-sip-external:3] Goto("SIP/xxx.xxx.xxx.xxx-082a7568", "s|1") in new stack
    -- Goto (from-sip-external,s,1)
    -- Executing [s@from-sip-external:1] GotoIf("SIP/xxx.xxx.xxx.xxx-082a7568", "0?checklang:noanonymous") in new stack
    -- Goto (from-sip-external,s,5)
    -- Executing [s@from-sip-external:5] Set("SIP/xxx.xxx.xxx.xxx-082a7568", "TIMEOUT(absolute)=15") in new stack
    -- Channel will hangup at 2009-08-31 06:01:52 UTC.
    -- Executing [s@from-sip-external:6] Answer("SIP/xxx.xxx.xxx.xxx-082a7568", "") in new stack
    -- Executing [s@from-sip-external:7] Wait("SIP/xxx.xxx.xxx.xxx-082a7568", "2") in new stack
    -- Executing [s@from-sip-external:8] Playback("SIP/xxx.xxx.xxx.xxx-082a7568", "ss-noservice") in new stack
    -- <SIP/xxx.xxx.xxx.xxx-082a7568> Playing 'ss-noservice' (language 'en')
    -- Executing [s@from-sip-external:9] PlayTones("SIP/xxx.xxx.xxx.xxx-082a7568", "congestion") in new stack
    -- Executing [s@from-sip-external:10] Congestion("SIP/xxx.xxx.xxx.xxx-082a7568", "5") in new stack

08/31/09 18:57:26 changed by p_lindheimer

(In [8259]) adds global variable SIPLANG for the configured channel language re #3722

08/31/09 19:02:19 changed by p_lindheimer

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

(In [8260]) closes #3722 set SIP langauge per SIPLANG as configured in sipsettings module