[Asterisk-video] patch for chan_misdn

Klaus Darilion klaus.mailinglists at pernau.at
Mon Mar 17 03:49:18 CDT 2008



barbara_b02 at libero.it schrieb:
> Hi Klaus!
> Thank you very much for the clarifications.
> I haven't a zaptel card so I'm trying to make a patch for chan_misdn...
> I obtained something good but there are some things I've not understood:
> In a SIP->3G call:
> - "who" set userinformationlayer1 ?
> - which are the possible values of userinformationlayer1 ?

The patch I wrote works following:
1a. Extended Asterisk's channel structure (ast_chan) to store the 
userinformationlayer1.
1b. Extended func_chan to read/write this value
1c. Extended app_dial to copy userinformationlayer1 from incoming 
channel to outgoing channel.

2. Modify chan_zap and libpri to check if userinformationlayer1 is set 
(-1 means that is is not specified = default value). If it is specified, 
and transfercapability is VIDEO, is will set the values in libpri.

Thus, you could reuse 1a-1c, but in the second step you have to add this 
modifications to chan_misdn.

The values for userinofrmationlayer 1 are defined in Q.931. Usually it 
is a-law or µ-law. The value for H.223+H.245 (this is a 3G vide call) is 38.

regards
klaus


> 
> When entering zt_new() userinformationlayer1 = a certain pri_event for incoming calls
> and userinformationlayer1=-1 for outgoing calls ??? Is it right?
> 
> I send you misdn-log without any patch (caps:Unknown Bearer), with a first change (caps:Unknown Bearer), and with other changes (caps:Unres Digital) => Asterisk understand the call is digital but the call fails for hungup.
> 
> Thanks!
> Best Regads
>   Barbara
> 
> 
> # without any patch
> 
> P[ 0]  --> * NEW CHANNEL dad:03934714462 oad:(null)
> P[ 1] read_config: Getting Config
> P[ 1]  --> TON: Unknown
> P[ 1]  --> LTON: Unknown
> P[ 1]  --> CTON: Unknown
> P[ 1] * CALL: 1/03934714462
> P[ 1]  --> * dad:dialcell tech:mISDN/0-u4 ctx:default
> P[ 1]  --> * adding2newbc ext dialcell
> P[ 1]  --> * adding2newbc callerid 101
> P[ 1]  --> pres: -1 screen: -1
> P[ 1]  --> pres: 0
> P[ 1]  --> PRES: Allowed (0x0)
> P[ 1]  --> SCREEN: Unscreened (0x0)
> P[ 1] NO OPTS GIVEN
> P[ 1] I SEND:SETUP oad:101 dad:03934714462 pid:6
> P[ 1]  --> channel:0 mode:TE cause:16 ocause:16 rad: cad:
> P[ 1]  --> info_dad: onumplan:0 dnumplan:0 rnumplan:0 cpnnumplan:0
> P[ 1]  --> caps:Unknown Bearer pi:0 keypad: sending_complete:0
> P[ 1] --> new_l3id 30005
> P[ 1]  --> * SEND: State Dialing pid:6
> P[ 1] * IND : HANGUP    pid:6 ctx:default dad:03934714462 oad:dialcell State:CALLING
> P[ 1]  --> l3id:30005
> P[ 1]  --> cause:16
> P[ 1]  --> out_cause:16
> P[ 1]  --> state:CALLING
> [Mar 13 12:02:23] NOTICE[26783]: chan_misdn.c:2523 misdn_hangup: release channel, in CALLING/INCOMING_SETUP state.. no other events happened
> P[ 1] I SEND:RELEASE_COMPLETE oad:101 dad:03934714462 pid:6
> P[ 1]  --> channel:255 mode:TE cause:16 ocause:16 rad: cad:
> P[ 1]  --> info_dad: onumplan:0 dnumplan:0 rnumplan:0 cpnnumplan:0
> P[ 1]  --> caps:Unknown Bearer pi:0 keypad: sending_complete:0
> P[ 1] $$$ CLEANUP CALLED pid:6
> P[ 1] empty_chan_in_stack: cannot empty channel 255
> P[ 1] CC_RELEASE_COMPLETE|CONFIRM [TE] 
> P[ 1] I IND :RELEASE_COMPLETE oad: dad: pid:6 state:none
> P[ 1]  --> channel:0 mode:TE cause:16 ocause:16 rad: cad:
> P[ 1]  --> info_dad: onumplan:0 dnumplan:0 rnumplan:0 cpnnumplan:0
> P[ 1]  --> caps:Speech pi:0 keypad: sending_complete:0
> P[ 1]  --> no Ch, so we've already released.
> P[ 0] Cannot hangup chan, no ch
> P[ 1] release_chan: Ch not found!
> P[ 1] $$$ CLEANUP CALLED pid:6
> P[ 1] $$$ CLEANUP CALLED pid:6
> P[ 1]  --> Channel: mISDN/0-u4 hanguped new state:CLEANING
> P[ 0] MGMT: SSTATUS: L1_ACTIVATED 
> P[ 1] MGMT: SSTATUS: L2_ESTABLISH 
> P[ 1] $$$ CLEANUP CALLED pid:0
> [Mar 13 12:02:33] WARNING[26782]: pbx.c:2525 __ast_pbx_run: Timeout, but no rule 't' in context 'default'
> P[ 1] MGMT: SSTATUS: L2_RELEASED 
> 
> # with a first change
> 
> P[ 0]  --> * NEW CHANNEL dad:03934714462 oad:(null)
> P[ 1] read_config: Getting Config
> P[ 1]  --> TON: Unknown
> P[ 1]  --> LTON: Unknown
> P[ 1]  --> CTON: Unknown
> P[ 1] * CALL: 1/03934714462
> P[ 1]  --> * dad:dialcell tech:mISDN/0-u11 ctx:default
> P[ 1]  --> * adding2newbc ext dialcell
> P[ 1]  --> * adding2newbc callerid 101
> P[ 1]  --> pres: -1 screen: -1
> P[ 1]  --> pres: 0
> P[ 1]  --> PRES: Allowed (0x0)
> P[ 1]  --> SCREEN: Unscreened (0x0)
> P[ 1] NO OPTS GIVEN
> P[ 1] I SEND:SETUP oad:101 dad:03934714462 pid:5
> P[ 1]  --> channel:0 mode:TE cause:16 ocause:16 rad: cad:
> P[ 1]  --> info_dad: onumplan:0 dnumplan:0 rnumplan:0 cpnnumplan:0
> P[ 1]  --> caps:Unknown Bearer pi:0 keypad: sending_complete:0
> P[ 1] --> new_l3id 30003
> P[ 1]  --> * SEND: State Dialing pid:5
>     -- Called 1/03934714462
> P[ 0] MGMT: SSTATUS: L1_ACTIVATED 
> P[ 1] MGMT: SSTATUS: L2_ESTABLISH 
> P[ 1] set_channel: bc->channel:255 channel:1
> P[ 1] I IND :NEW_CHANNEL oad:101 dad:03934714462 pid:5 state:CALLING
> P[ 1]  --> channel:1 mode:TE cause:16 ocause:16 rad: cad:
> P[ 1]  --> info_dad: onumplan:0 dnumplan:0 rnumplan:0 cpnnumplan:0
> P[ 1]  --> caps:Unknown Bearer pi:0 keypad: sending_complete:0
> P[ 1]  --> updating channel name to [mISDN/1-u12]
> P[ 1]  --> found chan (preselected): 1
> P[ 1]  --> TRANSPARENT Mode
> P[ 1] I IND :SETUP_ACKNOWLEDGE oad:101 dad:03934714462 pid:5 state:CALLING
> P[ 1]  --> channel:1 mode:TE cause:16 ocause:16 rad: cad:
> P[ 1]  --> info_dad: onumplan:0 dnumplan:0 rnumplan:0 cpnnumplan:0
> P[ 1]  --> caps:Unknown Bearer pi:0 keypad: sending_complete:0
> P[ 1]  --> updating channel name to [mISDN/1-u13]
> P[ 1] BCHAN: bchan ACT Confirm pid:5
> P[ 1] set_channel: bc->channel:1 channel:1
> P[ 1] I IND :NEW_CHANNEL oad:101 dad:03934714462 pid:5 state:CALLING_ACKNOWLEDGE
> P[ 1]  --> channel:1 mode:TE cause:16 ocause:16 rad: cad:
> P[ 1]  --> info_dad: onumplan:0 dnumplan:0 rnumplan:0 cpnnumplan:0
> P[ 1]  --> caps:Unknown Bearer pi:0 keypad: sending_complete:0
> P[ 1]  --> updating channel name to [mISDN/1-u14]
> P[ 1] I IND :PROCEEDING oad:101 dad:03934714462 pid:5 state:CALLING_ACKNOWLEDGE
> P[ 1]  --> channel:1 mode:TE cause:16 ocause:16 rad: cad:
> P[ 1]  --> info_dad: onumplan:0 dnumplan:0 rnumplan:0 cpnnumplan:0
> P[ 1]  --> caps:Unknown Bearer pi:0 keypad: sending_complete:0
> P[ 1]  --> updating channel name to [mISDN/1-u15]
>     -- mISDN/1-u15 is proceeding passing it to Local/dialcell at sip_to_cell-c476,2
> P[ 1] I IND :DISCONNECT oad:101 dad:03934714462 pid:5 state:PROCEEDING
> P[ 1]  --> channel:1 mode:TE cause:88 ocause:16 rad: cad:
> P[ 1]  --> info_dad: onumplan:0 dnumplan:0 rnumplan:0 cpnnumplan:0
> P[ 1]  --> caps:Unknown Bearer pi:0 keypad: sending_complete:0
> P[ 1]  --> org:1 nt:0, inbandavail:0 state:6
> P[ 1]  --> queue_hangup
> P[ 1] * IND : HANGUP    pid:5 ctx:default dad:03934714462 oad:dialcell State:PROCEEDING
> P[ 1] I SEND:RELEASE oad:101 dad:03934714462 pid:5
> P[ 1]  --> channel:1 mode:TE cause:88 ocause:-1 rad: cad:
> P[ 1]  --> l3id:30003
> P[ 1]  --> info_dad: onumplan:0 dnumplan:0 rnumplan:0 cpnnumplan:0
> P[ 1]  --> cause:88
> P[ 1]  --> caps:Unknown Bearer pi:0 keypad: sending_complete:0
> P[ 1]  --> out_cause:-1
> P[ 1]  --> state:PROCEEDING
> P[ 1]  --> Channel: mISDN/1-u15 hanguped new state:CLEANING
>   == Everyone is busy/congested at this time (1:0/0/1)
>     -- Executing [dialcell at sip_to_cell:6] Hangup("Local/dialcell at sip_to_cell-c476,2", "") in new stack
>   == Spawn extension (sip_to_cell, dialcell, 6) exited non-zero on 'Local/dialcell at sip_to_cell-c476,2'
>   == Auto fallthrough, channel 'SIP/101-08223920' status is 'UNKNOWN'
> P[ 1] I IND :RELEASE_COMPLETE oad:101 dad:03934714462 pid:5 state:CLEANING
> P[ 1]  --> channel:1 mode:TE cause:88 ocause:-1 rad: cad:
> P[ 1]  --> info_dad: onumplan:0 dnumplan:0 rnumplan:0 cpnnumplan:0
> P[ 1]  --> caps:Unknown Bearer pi:0 keypad: sending_complete:0
> P[ 1] ast_hangup already called, so we have no ast ptr anymore in event(RELEASE_COMPLETE)
> P[ 1]  --> No need to queue hangup
> P[ 1] Cannot hangup chan, no ast
> P[ 1] $$$ CLEANUP CALLED pid:5
> P[ 1] $$$ Cleaning up bc with stid :10010100 pid:5
> P[ 1] Sending Control ECHOCAN_OFF
> P[ 1] $$$ CLEANUP CALLED pid:5
> P[ 1] BCHAN: DeACT Conf pid:5
> P[ 1] BCHAN: MGR_DELLAYER|CNF pid:5
> P[ 1] MGMT: SSTATUS: L2_RELEASED 
> P[ 0] MGMT: SSTATUS: L1_DEACTIVATED 
> 
> # with other changes
> 
> P[ 0]  --> * NEW CHANNEL dad:03934714462 oad:(null)
> P[ 1] read_config: Getting Config
> P[ 1]  --> TON: Unknown
> P[ 1]  --> LTON: Unknown
> P[ 1]  --> CTON: Unknown
> P[ 1] * CALL: 1/03934714462
> P[ 1]  --> * dad:dialcell tech:mISDN/0-u0 ctx:default
> P[ 1]  --> * adding2newbc ext dialcell
> P[ 1]  --> * adding2newbc callerid 101
> P[ 1]  --> * Call with flag Digital
> P[ 1]  --> pres: -1 screen: -1
> P[ 1]  --> pres: 0
> P[ 1]  --> PRES: Allowed (0x0)
> P[ 1]  --> SCREEN: Unscreened (0x0)
> P[ 1] NO OPTS GIVEN
> P[ 1] I SEND:SETUP oad:101 dad:03934714462 pid:2
> P[ 1]  --> channel:0 mode:TE cause:16 ocause:16 rad: cad:
> P[ 1]  --> info_dad: onumplan:0 dnumplan:0 rnumplan:0 cpnnumplan:0
> P[ 1]  --> caps:Unres Digital pi:0 keypad: sending_complete:0
> P[ 1] --> new_l3id 30001
> P[ 1]  --> * SEND: State Dialing pid:2
>     -- Called 1/03934714462
> P[ 1] MGMT: SSTATUS: L2_ESTABLISH 
> P[ 1] set_channel: bc->channel:255 channel:1
> P[ 1] I IND :NEW_CHANNEL oad:101 dad:03934714462 pid:2 state:CALLING
> P[ 1]  --> channel:1 mode:TE cause:16 ocause:16 rad: cad:
> P[ 1]  --> info_dad: onumplan:0 dnumplan:0 rnumplan:0 cpnnumplan:0
> P[ 1]  --> caps:Unres Digital pi:0 keypad: sending_complete:0
> P[ 1]  --> updating channel name to [mISDN/1-u1]
> P[ 1]  --> found chan (preselected): 1
> P[ 1]  --> TRANSPARENT Mode
> P[ 1] I IND :SETUP_ACKNOWLEDGE oad:101 dad:03934714462 pid:2 state:CALLING
> P[ 1]  --> channel:1 mode:TE cause:16 ocause:16 rad: cad:
> P[ 1]  --> info_dad: onumplan:0 dnumplan:0 rnumplan:0 cpnnumplan:0
> P[ 1]  --> caps:Unres Digital pi:0 keypad: sending_complete:0
> P[ 1]  --> updating channel name to [mISDN/1-u2]
> P[ 1] BCHAN: bchan ACT Confirm pid:2
> P[ 1] set_channel: bc->channel:1 channel:1
> P[ 1] I IND :NEW_CHANNEL oad:101 dad:03934714462 pid:2 state:CALLING_ACKNOWLEDGE
> P[ 1]  --> channel:1 mode:TE cause:16 ocause:16 rad: cad:
> P[ 1]  --> info_dad: onumplan:0 dnumplan:0 rnumplan:0 cpnnumplan:0
> P[ 1]  --> caps:Unres Digital pi:0 keypad: sending_complete:0
> P[ 1]  --> updating channel name to [mISDN/1-u3]
> P[ 1] I IND :PROCEEDING oad:101 dad:03934714462 pid:2 state:CALLING_ACKNOWLEDGE
> P[ 1]  --> channel:1 mode:TE cause:16 ocause:16 rad: cad:
> P[ 1]  --> info_dad: onumplan:0 dnumplan:0 rnumplan:0 cpnnumplan:0
> P[ 1]  --> caps:Unres Digital pi:0 keypad: sending_complete:0
> P[ 1]  --> updating channel name to [mISDN/1-u4]
>     -- mISDN/1-u4 is proceeding passing it to Local/dialcell at sip_to_cell-feb0,2
> P[ 1] I IND :DISCONNECT oad:101 dad:03934714462 pid:2 state:PROCEEDING
> P[ 1]  --> channel:1 mode:TE cause:88 ocause:16 rad: cad:
> P[ 1]  --> info_dad: onumplan:0 dnumplan:0 rnumplan:0 cpnnumplan:0
> P[ 1]  --> caps:Unres Digital pi:0 keypad: sending_complete:0
> P[ 1]  --> org:1 nt:0, inbandavail:0 state:6
> P[ 1]  --> queue_hangup
> P[ 1] I SEND:RELEASE oad:101 dad:03934714462 pid:2
> P[ 1] * IND : HANGUP    pid:2 ctx:default dad:03934714462 oad:dialcell State:PROCEEDING
> P[ 1]  --> l3id:30001
> P[ 1]  --> cause:88
> P[ 1]  --> out_cause:88
> P[ 1]  --> state:PROCEEDING
> P[ 1]  --> Channel: mISDN/1-u4 hanguped new state:CLEANING
> P[ 1]  --> channel:1 mode:TE cause:88 ocause:88 rad: cad:
> P[ 1]  --> info_dad: onumplan:0 dnumplan:0 rnumplan:0 cpnnumplan:0
> P[ 1]  --> caps:Unres Digital pi:0 keypad: sending_complete:0
>   == Everyone is busy/congested at this time (1:0/0/1)
>     -- Executing [dialcell at sip_to_cell:6] Hangup("Local/dialcell at sip_to_cell-feb0,2", "") in new stack
>   == Spawn extension (sip_to_cell, dialcell, 6) exited non-zero on 'Local/dialcell at sip_to_cell-feb0,2'
>   == Auto fallthrough, channel 'SIP/101-08204970' status is 'UNKNOWN'
> P[ 1] I IND :RELEASE_COMPLETE oad:101 dad:03934714462 pid:2 state:CLEANING
> P[ 1]  --> channel:1 mode:TE cause:88 ocause:88 rad: cad:
> P[ 1]  --> info_dad: onumplan:0 dnumplan:0 rnumplan:0 cpnnumplan:0
> P[ 1]  --> caps:Unres Digital pi:0 keypad: sending_complete:0
> P[ 1] ast_hangup already called, so we have no ast ptr anymore in event(RELEASE_COMPLETE)
> P[ 1]  --> No need to queue hangup
> P[ 1] Cannot hangup chan, no ast
> P[ 1] $$$ CLEANUP CALLED pid:2
> P[ 1] $$$ Cleaning up bc with stid :10010100 pid:2
> P[ 1] Sending Control ECHOCAN_OFF
> P[ 1] $$$ CLEANUP CALLED pid:2
> P[ 1] BCHAN: MGR_DELLAYER|CNF pid:2
> P[ 1] MGMT: SSTATUS: L2_RELEASED 
> P[ 0] MGMT: SSTATUS: L1_DEACTIVATED 
> 
> 
> _______________________________________________
> --Bandwidth and Colocation Provided by http://www.api-digital.com--
> 
> asterisk-video mailing list
> To UNSUBSCRIBE or update options visit:
>    http://lists.digium.com/mailman/listinfo/asterisk-video



More information about the asterisk-video mailing list