[cisco-voip] TCl script doesn't work

Servet ERKUN servet.erkun at doruk.net.tr
Thu Nov 22 11:05:43 EST 2007


 

Hi 

 

I have a 7206 router with adv. Ent. ios, and i put a script for aaa on
incoming dial peer,
TCL script trims incoming calling number too, 

When i tryed to call a number , TCl is working and triming the clid i see it
in debug output, but it not replace the number in invite messageses
* this scripts is working on a 3660 router properly

Here my tcl script, dial peer configuration, and tcl+sip messages debug



Any idea??

 

TCLSCRIPT

 

proc act_Authorized { } {

    global account

    global trimdestination

    global destination

    global creditTime

    global disconnect_cause

    global source

    set account [infotag get leg_username leg_incoming]

    set callInfo(accountNum) $account

 

    set status [infotag get evt_status]

    puts "\n aaa authorize Status=$status"

 

     if { $status == "ao_000" } {

         if { [infotag get aaa_avpair_exists h323-credit-time] } {

             set creditTime [infotag get aaa_avpair h323-credit-time]


         } else {

             set disconnect_cause di_021

             act_SendCauseCode

             fsm setstate CALLDISCONNECT

             return 

         }

 

         # creditTime must be greater then 0 to place a call

 

         if {$creditTime == "unlimited" ||

             $creditTime == "uninitialized" ||

             $creditTime == 0 } {

             set disconnect_cause di_021

             act_SendCauseCode

             fsm setstate CALLDISCONNECT

         } else {

             set callInfo(accountNum) $account

 

             if { [string length $account] > 10 } {

 

                  set numara [string trimleft $account 7]

                  set numara [string range $numara 0 9]

                  set headers(From) "sip:0$numara at 82.151.154.242"

                  set callInfo(protoHeaders) headers

                  

                  

 

                } 

 

             leg setup $destination callInfo leg_incoming

 

         }

     } else {

         # Authorization failed

           set disconnect_cause di_021

           act_SendCauseCode

           fsm setstate CALLDISCONNECT

     }

}

 

DIALPEER CONFIG
dial-peer voice 999 voip

 description -- Incoming --

 service billing

 voice-class aaa 1

 voice-class codec 3

 session protocol sipv2

 incoming called-number 0T

 dtmf-relay rtp-nte

 fax protocol t38 ls-redundancy 0 hs-redundancy 0 fallback pass-through
g711alaw

!

dial-peer voice 990 voip

 description -- Out --

 destination-pattern 0T

 voice-class aaa 2

 voice-class codec 3

 session protocol sipv2

 session target ipv4:192.168.165.235:5060

 dtmf-relay rtp-nte

 fax protocol t38 ls-redundancy 0 hs-redundancy 0 fallback pass-through
g711alaw

 

 

 

DEBUGOUTPUT

 

 

 

Nov 22 16:03:24.657: //-1/xxxxxxxxxxxx/SIP/Msg/ccsipDisplayMsg:

Received: 

INVITE sip:05365968227 at 192.168.165.242 SIP/2.0

To: <sip:05365968227 at 192.168.165.242>

From: 77721232693430000<sip:77721232693430000 at 192.168.165.242>;tag=bc6ee460

Via: SIP/2.0/UDP
212.58.13.13:5060;branch=z9hG4bK-d87543-1010398273-1--d87543-;rport

Call-ID: 3d0c5a292b23cc2d

CSeq: 1 INVITE

Contact: <sip:77721232693430000 at 212.58.13.13:5060>

Max-Forwards: 70

Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, NOTIFY, MESSAGE, SUBSCRIBE,
INFO

Content-Type: application/sdp

User-Agent: eyeBeam release 3004t stamp 16741

Content-Length: 231

 

v=0

o=- 15938766 15939273 IN IP4 212.58.13.13

s=eyeBeam

c=IN IP4 212.58.13.13

t=0 0

m=audio 6200 RTP/AVP 18 101

a=alt:1 1 : 385850EF 272D848F 212.58.13.13 6200

a=fmtp:101 0-15

a=rtpmap:101 telephone-event/8000

a=sendrecv

 

Nov 22 16:03:24.657:
//31/4A0C70388064/SIP/Error/sipSPIProcessCallInfoHeader: Call-Info header
with for Unsolicited Notify Absent,Disabling Unsolicited Notifies 

Nov 22 16:03:24.657:
//31/4A0C70388064/SIP/Error/sipSPI_ipip_copy_sdp_to_channelInfo: 

failed to update call entry

Nov 22 16:03:24.661: //-1//AFW_:EE06E74054000:/Tcl_Link: Linking script
billing

Nov 22 16:03:24.661: //-1//TCL :EE06E74054000:/tcl_RequiredVersionObjCmd:
Script requires version 2.0. So 2.1 is OK

Nov 22 16:03:24.661: //-1//TCL :EE06E74054000:/tcl_FSMObjCmd:  fsm define
fsm CALL_INIT 

Nov 22 16:03:24.661: //-1//TCL :EE06E74054000:/tcl_FSMDefineObjCmd: State
Machine: Array fsm: Start State: CALL_INIT

Nov 22 16:03:24.661: //-1//TCL :EE06E74054000:/tcl_FSMDefineObjCmd: FSM Data
structure

Nov 22 16:03:24.661: (CALLACTIVE(2),
ev_disconnected(17)--(act_ConnectionDestroy)-->(CONNDESTROY(3))

Nov 22 16:03:24.661: (CALLDISCONNECT(4),
ev_disconnect_done(18)--(act_Cleanup)-->(any_state(0))

Nov 22 16:03:24.661: (CALLDISCONNECT(4),
ev_leg_timer(1)--(act_Cleanup)-->(any_state(0))

Nov 22 16:03:24.661: (PLACECALL(5),
ev_setup_done(184)--(act_CallSetupDone)-->(CALLACTIVE(2))

Nov 22 16:03:24.661: (CONNDESTROY(3),
ev_destroy_done(36)--(act_SendCauseCode)-->(CALLDISCONNECT(4))

Nov 22 16:03:24.661: (CALLACTIVE(2),
ev_leg_timer(1)--(act_ConnectionDestroy)-->(CONNDESTROY(3))

Nov 22 16:03:24.661: (any_state(0),
ev_disconnected(17)--(act_Cleanup)-->(any_state(0))

Nov 22 16:03:24.661: (AUTHORIZE(6),
ev_authorize_done(159)--(act_Authorized)-->(PLACECALL(5))

Nov 22 16:03:24.661: (CALLDISCONNECT(4),
ev_destroy_done(36)--(act_Cleanup)-->(any_state(0))

Nov 22 16:03:24.661: (any_state(0),
ev_disconnect_done(18)--(act_Cleanup)-->(any_state(0))

Nov 22 16:03:24.661: (CALL_INIT(1),
ev_setup_indication(30)--(act_Setup)-->(AUTHORIZE(6))

Nov 22 16:03:24.661: (CALLDISCONNECT(4),
ev_disconnected(17)--(act_Cleanup)-->(any_state(0))

Nov 22 16:03:24.661: FSM start state CALL_INIT(1)

Nov 22 16:03:24.661: //-1//AFW_:EE06E74054000:/Tcl_Link: Script billing
succesfully linked.

Nov 22 16:03:24.661: //-1/xxxxxxxxxxxx/SIP/Msg/ccsipDisplayMsg:

Sent: 

SIP/2.0 100 Trying

Via: SIP/2.0/UDP
212.58.13.13:5060;branch=z9hG4bK-d87543-1010398273-1--d87543-;rport

From: 77721232693430000<sip:77721232693430000 at 192.168.165.242>;tag=bc6ee460

To: <sip:05365968227 at 192.168.165.242>

Date: Thu, 22 Nov 2007 16:03:24 GMT

Call-ID: 3d0c5a292b23cc2d

Server: Cisco-SIPGateway/IOS-12.x

CSeq: 1 INVITE

Allow-Events: telephone-event

Content-Length: 0

 

 

 

Nov 22 16:03:24.661: //31//TCL :/tcl_InfotagObjCmd:  infotag get leg_dnis 

Nov 22 16:03:24.661: //31//TCL :/tcl_InfotagGetObjCmd: infotag get leg_dnis 

Nov 22 16:03:24.661: //31//AFW_:/vtr_lg_dnis: argc 2 argindex 2

Nov 22 16:03:24.661: //31//TCL :/tcl_InfotagObjCmd:  infotag get leg_ani 

Nov 22 16:03:24.661: //31//TCL :/tcl_InfotagGetObjCmd: infotag get leg_ani 

Nov 22 16:03:24.661: //31//AFW_:/vtr_lg_ani: argc 2 argindex 2

Nov 22 16:03:24.661: //31//TCL :/tcl_InfotagObjCmd:  infotag get
leg_username leg_incoming 

Nov 22 16:03:24.661: //31//TCL :/tcl_InfotagGetObjCmd: infotag get
leg_username leg_incoming 

Nov 22 16:03:24.661: //31//AFW_:/vtr_lg_username: argc 3 argindex 2

Nov 22 16:03:24.661: //31//AFW_:/vtd_lg_incoming: argc 3

Nov 22 16:03:24.661: //31//AFW_:/vtd_lg_incoming: Legs [31 ]

Nov 22 16:03:24.661: //31//Tcl :/tcl_parseCallID_vartagObj: VARTAG
Translation Leg Count=1

Nov 22 16:03:24.661: //31//TCL :/tcl_InfotagObjCmd:  infotag get
leg_password leg_incoming 

Nov 22 16:03:24.661: //31//TCL :/tcl_InfotagGetObjCmd: infotag get
leg_password leg_incoming 

Nov 22 16:03:24.661: //31//AFW_:/vtr_lg_password: argc 3 argindex 2

Nov 22 16:03:24.661: //31//AFW_:/vtd_lg_incoming: argc 3

Nov 22 16:03:24.661: //31//AFW_:/vtd_lg_incoming: Legs [31 ]

Nov 22 16:03:24.661: //31//Tcl :/tcl_parseCallID_vartagObj: VARTAG
Translation Leg Count=1

Nov 22 16:03:24.661: //31//TCL :/tcl_AAAObjCmd:  aaa authorize
77721232693430000  77721232693430000 05365968227 leg_incoming 

Nov 22 16:03:24.665: //31//TCL :/tcl_AuthorizeObjCmd:  authorize
77721232693430000  77721232693430000 05365968227 leg_incoming 

Nov 22 16:03:24.665: //31//AFW_:/vtd_lg_incoming: argc 6

Nov 22 16:03:24.665: //31//AFW_:/vtd_lg_incoming: Legs [31 ]

Nov 22 16:03:24.665: //31//Tcl :/tcl_parseCallID_vartagObj: VARTAG
Translation Leg Count=1

Nov 22 16:03:24.665: //31//TCL :/tcl_AuthorizeObjCmd:
account=77721232693430000, password=,

Nov 22 16:03:24.665: //31//TCL :/tcl_AuthorizeObjCmd:
ani=77721232693430000, dnis=05365968227, methodList=,

Nov 22 16:03:24.665: //31//TCL :/tcl_AuthorizeObjCmd:    av-send=, guid=

Nov 22 16:03:24.665: //31//TCL :/tcl_InfotagObjCmd:  infotag get
leg_username leg_incoming 

Nov 22 16:03:24.665: //31//TCL :/tcl_InfotagGetObjCmd: infotag get
leg_username leg_incoming 

Nov 22 16:03:24.665: //31//AFW_:/vtr_lg_username: argc 3 argindex 2

Nov 22 16:03:24.665: //31//AFW_:/vtd_lg_incoming: argc 3

Nov 22 16:03:24.665: //31//AFW_:/vtd_lg_incoming: Legs [31 ]

Nov 22 16:03:24.665: //31//Tcl :/tcl_parseCallID_vartagObj: VARTAG
Translation Leg Count=1

Nov 22 16:03:24.665: //31//TCL :/tcl_InfotagObjCmd:  infotag get evt_status 

Nov 22 16:03:24.665: //31//TCL :/tcl_InfotagGetObjCmd: infotag get
evt_status 

Nov 22 16:03:24.665: //31//AFW_:/vtr_ev_status: argc 2 argindex 2

Nov 22 16:03:24.665: //31//TCL :/tcl_InfotagObjCmd:  infotag get
aaa_avpair_exists h323-credit-time 

Nov 22 16:03:24.665: //31//TCL :/tcl_InfotagGetObjCmd: infotag get
aaa_avpair_exists h323-credit-time 

Nov 22 16:03:24.665: //31//AFW_:/vtr_ra_avpair_exists: argc 3 argindex 2

Nov 22 16:03:24.665: //31//TCL :/tcl_InfotagObjCmd:  infotag get aaa_avpair
h323-credit-time 

Nov 22 16:03:24.665: //31//TCL :/tcl_InfotagGetObjCmd: infotag get
aaa_avpair h323-credit-time 

Nov 22 16:03:24.665: //31//AFW_:/vtr_ra_avpair: argc 3 argindex 2

Nov 22 16:03:24.665: //31//TCL :/tcl_LegObjCmd:  leg setup 05365968227
callInfo leg_incoming 

Nov 22 16:03:24.665: //31//AFW_:/vtd_lg_incoming: argc 4

Nov 22 16:03:24.665: //31//AFW_:/vtd_lg_incoming: Legs [31 ]

Nov 22 16:03:24.665: //31//Tcl :/tcl_parseCallID_vartagObj: VARTAG
Translation Leg Count=1

Nov 22 16:03:24.665: //-1//CSPK:/tclSetCallInfoParams:
accountNum=77721232693430000

Nov 22 16:03:24.665: //-1//CSPK:/tclUpdateTDList: Binding a new usrContainer
[0x7FE92E0] to SetupInfo

Nov 22 16:03:24.665: //-1//TCL :/tclCmdProtoHeadersHelper: Successful in
setting 'protoHeaders' tag-data [headers] instID [0]

Nov 22 16:03:24.665: ccDumpTdRequestDataGen:

Nov 22 16:03:24.665:   called_urip=NULL

Nov 22 16:03:24.665:   calling_urip=NULL

Nov 22 16:03:24.665: url_dump_header_line_avpair:

Nov 22 16:03:24.665:   num_headers = 1

Nov 22 16:03:24.665:     headers[0].linep =
From=sip:02123269343 at 192.168.165.242, len = 35

Nov 22 16:03:24.665:       data.attr.datap =
From=sip:02123269343 at 192.168.165.242, len = 4

Nov 22 16:03:24.665:       data.value.datap =
sip:02123269343 at 192.168.165.242, len = 30

Nov 22 16:03:24.665:   num_bodies = 0

Nov 22 16:03:24.669: //-1/xxxxxxxxxxxx/SIP/Msg/ccsipDisplayMsg:

Sent: 

INVITE sip:05365968227 at 192.168.165.235:5060 SIP/2.0

Via: SIP/2.0/UDP 192.168.165.242:5060;branch=z9hG4bK207CD

Remote-Party-ID: "77721232693430000"
<sip:77721232693430000 at 192.168.165.242>;party=calling;screen=no;privacy=off

From: "77721232693430000"
<sip:77721232693430000 at 192.168.165.242>;tag=1A637A4-218C

To: <sip:05365968227 at 192.168.165.235>

Date: Thu, 22 Nov 2007 16:03:24 GMT

Call-ID: 4A0E4549-984B11DC-8069C4CC-EDEDF625 at 192.168.165.242

Supported: 100rel,timer,resource-priority,replaces

Min-SE:  300

Cisco-Guid: 1242329144-2555056604-2154087628-3991795237

User-Agent: Cisco-SIPGateway/IOS-12.x

Allow: INVITE, OPTIONS, BYE, CANCEL, ACK, PRACK, UPDATE, REFER, SUBSCRIBE,
NOTIFY, INFO, REGISTER

CSeq: 101 INVITE

Timestamp: 1195747404

Contact: <sip:77721232693430000 at 192.168.165.242:5060>

Expires: 180

Allow-Events: telephone-event

Max-Forwards: 69

Content-Type: application/sdp

Content-Disposition: session;handling=required

Content-Length: 322

 

 

 

 

 


Servet ERKÜN


Network Engineer


(

 90 (212) 326 93 43


*

  <mailto:servet.erkun at doruk.net.tr> servet at doruk.net.tr 


 <http://www.doruk.net.tr/> cid:image001.gif at 01C73577.B3E3A750

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://puck.nether.net/pipermail/cisco-voip/attachments/20071122/6855f75d/attachment-0001.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: image/jpeg
Size: 1860 bytes
Desc: not available
Url : https://puck.nether.net/pipermail/cisco-voip/attachments/20071122/6855f75d/attachment-0001.jpe 


More information about the cisco-voip mailing list