Skip to main content

The 'context' setting in the trunk configuration doesnt seem to do anything

Posted by amagurie on Mon, 05/12/2008

Hi,

The 'context' setting in the trunk configuration doesnt seem to do anything, I have one trunk configured between the thirdlane box and an Alcatel PBX (internal) with 'context=from-inside' configured in the trunk configuration, and another trunk to an external SIP provider for calls out to the PSTN etc.

But incoming calls from the internal PBX come in using 'from-outside' context, see trunk config from sip.conf below for configuration:

[legacy-alcatel-wlg]
qualify=yes
nat=no
host=192.168.1.9
dtmfmode=rfc2833
context=from-inside
type=friend
canreinvite=no
disallow=all
allow=alaw

The only way to make incoming call use the 'from-inside' is to up date the global 'context=from-outside' (default) in sip.conf.... but this changes all external inbound trunks.

I would have expected outgoing calls made across a trunk with 'context=from-inside' to use 'Internal Caller ID' instead of the 'External Caller ID Number'?

The Administrator's Guide all says the following for trunk configuration, but specifying a caller id in the config for the trunk being used does not override the outgoing caller id?

Caller ID. (SIP, IAX) Caller id associated with the trunk. You can
specify both the numeric caller id and a
readable name. Note: it is not recommended
to specify caller id as this will override any
other caller id settings.

Any help would be much appreciated.

Regards
Allister


Submitted by eeman on Tue, 05/13/2008 Permalink

context has no bearing on outgoing calls, it just declares where incoming calls land within your dialplan. from-inside would bypass any DID or inbound call routes but allow someone to call your extensions directly. If you need to use internal callerid instead of an external callerid you would need to bypass the dialplan code that sets this. This is typically the desired case when linking 2 PBX together for 3digit or 4 digit internal dialing between the two. To do this you cannot use an existing trunkdial application.

an example

[bgnv-extension-outbound]

use=feature

friendlyname=Dial Out (1 trunk)

description

This script handles dialing using 1 trunk to redial an extension as an outbound number while preserving internal callerid. This would be useful when calling another branch PBX where you want the internal extension numbers to remain the callerid. example:

taking calls to 6XX redials on an outbound trunk as +150231525XX

making a speed dial, like *23 strip all 3 digits and dial +15025551212

args=1,How long to ring,text:2,Trunk,trunk:3,String to prepend,text:4,Number of digits to strip,text:5,Dial command options,text

body

exten => s,1,Dial(${ARG2}/${ARG3}${MACRO_EXTEN:${ARG4}},${ARG1},${ARG5})

Submitted by amagurie on Tue, 05/13/2008 Permalink

Hi Erik,

Thank you very much for the script, works perfectly for internal outbound dialing.

With regards to the context, inbound is when I am wanting it to work, for the trunk (previous post) that I have 'context=from-inside' set, inbound calls via said trunk still uses a context of from-outside requiring inbound routes etc.

-- Executing [688@from-outside:1] Wait("SIP/192.168.1.9-09251790", "1") in new stack

-- Executing [688@from-outside:2] Set("SIP/192.168.1.9-09251790", "__INCOMINGCLI=254") in new stack

-- Executing [688@from-outside:3] Goto("SIP/192.168.1.9-09251790", "from-outside-redir|688|1") in new stack

-- Goto (from-outside-redir,688,1)

-- Executing [688@from-outside-redir:1] Macro("SIP/192.168.1.9-09251790", "tl-userexten|SIP/688|688|") in new stack

-- Executing [s@macro-tl-userexten:1] Set("SIP/192.168.1.9-09251790", "__DIALED_NUMBER=688") in new stack

...............................

I want it to bypass inbound routes, so internal extensions can be dialed.

To get around it for now I have hack it by adding 'include => local-extensions' to the '[from-outside-redir]' context.

Regards

Allister

Submitted by eeman on Tue, 05/13/2008 Permalink

this looks wrong, your sip calls are coming in as anonymous calls not via the registered trunk. This is why its showing SIP/ip.add.res.s instead of SIP/trunkname

Once you get the calls to authenticate properly against that trunk, your inside vs outside will work fine.

Submitted by eeman on Tue, 05/13/2008 Permalink

try adding username and secret declarations to your trunk so your gateway can authenticate. You might have to shorten the sip name to something with less dashes because a lot of userexten handlers parse channel names based on the dash.

try this...

[alcatel_wlg]

qualify=yes

nat=no

host=dynamic

defaultip=192.168.1.9

username=alcatel_wlg

secret=somepassword

dtmfmode=rfc2833

context=from-inside

type=friend

canreinvite=no

disallow=all

allow=alaw

then have the alcatel appliance register to your PBX.