Koozali.org: home of the SME Server

Switching via trunks

Offline compsos

  • *
  • 472
  • +0/-0
Switching via trunks
« on: September 02, 2012, 11:15:42 PM »
Hi S
We have a system where we have 3 sip trunks (with 1 provider). We would like to send each number to particular extensions.

We have set open and closed to the extension number. But this setting has no effect.
 
The cli shows the call arriving on the expected trunk but always goes to the what is set in the global section.

Have we set something wrong?

    -- Launched AGI Script /var/lib/asterisk/agi-bin/sarkhpe
<SIP/peer4802-00000157>AGI Tx >> agi_request: sarkhpe
<SIP/peer4802-00000157>AGI Tx >> agi_channel: SIP/peer4802-00000157
<SIP/peer4802-00000157>AGI Tx >> agi_language: en_AU
<SIP/peer4802-00000157>AGI Tx >> agi_type: SIP
<SIP/peer4802-00000157>AGI Tx >> agi_uniqueid: 1346541631.474
<SIP/peer4802-00000157>AGI Tx >> agi_version: 1.8.7.0
<SIP/peer4802-00000157>AGI Tx >> agi_callerid: 40694753
<SIP/peer4802-00000157>AGI Tx >> agi_calleridname: 40694753
<SIP/peer4802-00000157>AGI Tx >> agi_callingpres: 0
<SIP/peer4802-00000157>AGI Tx >> agi_callingani2: 0
<SIP/peer4802-00000157>AGI Tx >> agi_callington: 0
<SIP/peer4802-00000157>AGI Tx >> agi_callingtns: 0
<SIP/peer4802-00000157>AGI Tx >> agi_dnid: 3082*00004
<SIP/peer4802-00000157>AGI Tx >> agi_rdnis: unknown
<SIP/peer4802-00000157>AGI Tx >> agi_context: mainmenu
<SIP/peer4802-00000157>AGI Tx >> agi_extension: 3082*00004
<SIP/peer4802-00000157>AGI Tx >> agi_priority: 1
<SIP/peer4802-00000157>AGI Tx >> agi_enhanced: 0.0
<SIP/peer4802-00000157>AGI Tx >> agi_accountcode:
<SIP/peer4802-00000157>AGI Tx >> agi_threadid: 1091742016
<SIP/peer4802-00000157>AGI Tx >> agi_arg_1: Inbound
<SIP/peer4802-00000157>AGI Tx >> agi_arg_2: _XXXX.
<SIP/peer4802-00000157>AGI Tx >> agi_arg_3:
<SIP/peer4802-00000157>AGI Tx >> agi_arg_4:
<SIP/peer4802-00000157>AGI Tx >>
<SIP/peer4802-00000157>AGI Rx << GET VARIABLE EXTLEN
<SIP/peer4802-00000157>AGI Tx >> 200 result=1 (3)
<SIP/peer4802-00000157>AGI Rx << GET VARIABLE ASTDLIM
<SIP/peer4802-00000157>AGI Tx >> 200 result=1 (,)
<SIP/peer4802-00000157>AGI Rx << GET VARIABLE ABSTIMEOUT
<SIP/peer4802-00000157>AGI Tx >> 200 result=1 (14400)
<SIP/peer4802-00000157>AGI Rx << EXEC Set CDR(userfield)=_XXXX.
    -- AGI Script Executing Application: (Set) Options: (CDR(userfield)=_XXXX.)
<SIP/peer4802-00000157>AGI Tx >> 200 result=0
<SIP/peer4802-00000157>AGI Rx << GET VARIABLE FAXDETECT
<SIP/peer4802-00000157>AGI Tx >> 200 result=1 (4)
<SIP/peer4802-00000157>AGI Rx << GET VARIABLE RINGDELAY
<SIP/peer4802-00000157>AGI Tx >> 200 result=1 (0)
<SIP/peer4802-00000157>AGI Rx << GET VARIABLE LTERM
<SIP/peer4802-00000157>AGI Tx >> 200 result=1 (YES)
<SIP/peer4802-00000157>AGI Rx << SET VARIABLE __MOH "NO"
<SIP/peer4802-00000157>AGI Tx >> 200 result=1
<SIP/peer4802-00000157>AGI Rx << SET CALLERID 40694753
<SIP/peer4802-00000157>AGI Tx >> 200 result=1
<SIP/peer4802-00000157>AGI Rx << DATABASE GET "STAT" "OCSTAT"
<SIP/peer4802-00000157>AGI Tx >> 200 result=1 (AUTO)
<SIP/peer4802-00000157>AGI Rx << SET VARIABLE REMOTENUM "_XXXX."
<SIP/peer4802-00000157>AGI Tx >> 200 result=1
<SIP/peer4802-00000157>AGI Rx << GET VARIABLE SYSOP
<SIP/peer4802-00000157>AGI Tx >> 200 result=1 (500)
<SIP/peer4802-00000157>AGI Rx << SET PRIORITY 1
<SIP/peer4802-00000157>AGI Tx >> 200 result=0
<SIP/peer4802-00000157>AGI Rx << SET EXTENSION 500
<SIP/peer4802-00000157>AGI Tx >> 200 result=0
<SIP/peer4802-00000157>AGI Rx << SET CONTEXT extensions
<SIP/peer4802-00000157>AGI Tx >> 200 result=0
    -- <SIP/peer4802-00000157>AGI Script sarkhpe completed, returning 0
    -- Executing [500@extensions:1] AGI("SIP/peer4802-00000157", "sarkhpe,InCall,,,") in new stack
    -- Launched AGI Script /var/lib/asterisk/agi-bin/sarkhpe
<SIP/peer4802-00000157>AGI Tx >> agi_request: sarkhpe
<SIP/peer4802-00000157>AGI Tx >> agi_channel: SIP/peer4802-00000157
<SIP/peer4802-00000157>AGI Tx >> agi_language: en_AU
<SIP/peer4802-00000157>AGI Tx >> agi_type: SIP
<SIP/peer4802-00000157>AGI Tx >> agi_uniqueid: 1346541631.474
<SIP/peer4802-00000157>AGI Tx >> agi_version: 1.8.7.0
<SIP/peer4802-00000157>AGI Tx >> agi_callerid: 40694753
<SIP/peer4802-00000157>AGI Tx >> agi_calleridname: unknown
<SIP/peer4802-00000157>AGI Tx >> agi_callingpres: 0
<SIP/peer4802-00000157>AGI Tx >> agi_callingani2: 0
<SIP/peer4802-00000157>AGI Tx >> agi_callington: 0
<SIP/peer4802-00000157>AGI Tx >> agi_callingtns: 0
<SIP/peer4802-00000157>AGI Tx >> agi_dnid: 3082*00004
<SIP/peer4802-00000157>AGI Tx >> agi_rdnis: unknown
<SIP/peer4802-00000157>AGI Tx >> agi_context: extensions
<SIP/peer4802-00000157>AGI Tx >> agi_extension: 500
<SIP/peer4802-00000157>AGI Tx >> agi_priority: 1
<SIP/peer4802-00000157>AGI Tx >> agi_enhanced: 0.0
<SIP/peer4802-00000157>AGI Tx >> agi_accountcode:
<SIP/peer4802-00000157>AGI Tx >> agi_threadid: 1091742016
<SIP/peer4802-00000157>AGI Tx >> agi_arg_1: InCall
<SIP/peer4802-00000157>AGI Tx >> agi_arg_2:
<SIP/peer4802-00000157>AGI Tx >> agi_arg_3:
<SIP/peer4802-00000157>AGI Tx >> agi_arg_4:
<SIP/peer4802-00000157>AGI Tx >>
<SIP/peer4802-00000157>AGI Rx << GET VARIABLE EXTLEN
<SIP/peer4802-00000157>AGI Tx >> 200 result=1 (3)
<SIP/peer4802-00000157>AGI Rx << GET VARIABLE ASTDLIM
<SIP/peer4802-00000157>AGI Tx >> 200 result=1 (,)
<SIP/peer4802-00000157>AGI Rx << GET VARIABLE ABSTIMEOUT
<SIP/peer4802-00000157>AGI Tx >> 200 result=1 (14400)
<SIP/peer4802-00000157>AGI Rx << GET VARIABLE BLINDTRANSFER
<SIP/peer4802-00000157>AGI Tx >> 200 result=0
<SIP/peer4802-00000157>AGI Rx << GET VARIABLE VOICEINSTR
<SIP/peer4802-00000157>AGI Tx >> 200 result=1 (YES)
<SIP/peer4802-00000157>AGI Rx << DATABASE GET "STAT" "OCSTAT"
<SIP/peer4802-00000157>AGI Tx >> 200 result=1 (AUTO)
<SIP/peer4802-00000157>AGI Rx << DATABASE GET "cfimopen" "500"
<SIP/peer4802-00000157>AGI Tx >> 200 result=0
<SIP/peer4802-00000157>AGI Rx << DATABASE GET "cfim" "500"
<SIP/peer4802-00000157>AGI Tx >> 200 result=1 ()
<SIP/peer4802-00000157>AGI Rx << DATABASE GET "STAT" "OCSTAT"
<SIP/peer4802-00000157>AGI Tx >> 200 result=1 (AUTO)
<SIP/peer4802-00000157>AGI Rx << GET VARIABLE VOICEINSTR
<SIP/peer4802-00000157>AGI Tx >> 200 result=1 (YES)
<SIP/peer4802-00000157>AGI Rx << DATABASE GET "cfimopen" "500"
<SIP/peer4802-00000157>AGI Tx >> 200 result=0
<SIP/peer4802-00000157>AGI Rx << DATABASE GET "STAT" "OCSTAT"
<SIP/peer4802-00000157>AGI Tx >> 200 result=1 (AUTO)
<SIP/peer4802-00000157>AGI Rx << GET VARIABLE VOICEINSTR
<SIP/peer4802-00000157>AGI Tx >> 200 result=1 (YES)
<SIP/peer4802-00000157>AGI Rx << DATABASE GET "cfim" "500"
<SIP/peer4802-00000157>AGI Tx >> 200 result=1 ()
<SIP/peer4802-00000157>AGI Rx << SET VARIABLE __PICKUPMARK "500"
<SIP/peer4802-00000157>AGI Tx >> 200 result=1
<SIP/peer4802-00000157>AGI Rx << DATABASE GET "ringdelay" "500"
<SIP/peer4802-00000157>AGI Tx >> 200 result=1 ()
<SIP/peer4802-00000157>AGI Rx << GET VARIABLE INTRINGDELAY
<SIP/peer4802-00000157>AGI Tx >> 200 result=1 (20)
<SIP/peer4802-00000157>AGI Rx << GET VARIABLE CALLRECORD1
<SIP/peer4802-00000157>AGI Tx >> 200 result=1 (None)
<SIP/peer4802-00000157>AGI Rx << GET VARIABLE MOH
<SIP/peer4802-00000157>AGI Tx >> 200 result=1 (NO)
<SIP/peer4802-00000157>AGI Rx << EXEC Dial SIP/500,20,kt
    -- AGI Script Executing Application: (Dial) Options: (SIP/500,20,kt)
Regards

Gordon............

Offline SARK devs

  • *****
  • 2,806
  • +1/-0
    • http://sarkpbx.com
Re: Switching via trunks
« Reply #1 on: September 03, 2012, 11:09:35 PM »
Hi Gordon

Did you change the dialled number in the data (maybe for security)?  It looks a little unusual...

Quote
<SIP/peer4802-00000157>AGI Tx >> agi_extension: 3082*00004

Did you create a DiD trunk for each DiD number in order to catch and route it?  DiDs won't usually route through your original trunk (trunks can only route a single DiD;  you need to create a DiD trunk for each additional number you want to route).  It looks like what is happening is that the SARK catchall DiD (_XXXX.) is catching and routing your numbers.  By default it will route to whatever you have defined as the operator extension.

Best

S

Offline compsos

  • *
  • 472
  • +0/-0
Re: Switching via trunks
« Reply #2 on: September 08, 2012, 07:05:10 AM »
Thanks Jeff
The providers new system users the strange username and I had to set the DiDs to match the username. But of course I had originally used the the called number.
It works until the next change. Thanks.
Regards

Gordon............