[Freeswitch-users] leg_delay_start not working and hangup_after_bridge=true but not if MEDIA_TIMEOUT hangup cause

Mikael Aleksander Bjerkeland mikael at bjerkeland.com
Thu Apr 16 01:19:45 PDT 2009


El mié, 15-04-2009 a las 17:43 +0200, Mikael Bjerkeland escribió:
> Hi,
> 
> I have two scenarios I'm having trouble figuring out and I'd be happy
> if someone could tell me what I'm doing wrong.
> 
> 1. leg_delay_start=N not working
> 
> I am trying to delay the origination of the second leg in a forked
> dial with the following:
> 
> <action application="bridge"
> data="user/mikael-nokia at voip.domain.com,[leg_delay_start=10]openzap/1/a/99355151"/>
> 
> 
> However the second leg is called at exactly the same time as the first
> one. I am away from my testing environment right now, so I'm sorry for
> not posting my logs. It appears to me that leg_delay_start is broken
> on at least rev 13013.
> 
> 
> 2. I'd like to stop processing the dialplan after a bridge, but not on
> specific hangup causes. If I get a MEDIA_TIMEOUT hangup cause in the
> call I'd like to continue in the dialplan. Currently I have the
> following:
> 
>         <action application="set" data="hangup_after_bridge=true"/>
>         <action application="set" data="continue_on_fail=true"/>
>         <action application="bridge"
> data="user/mikael-nokia at voip.domain.com"/>
>         <!-- I will only get here if the first bridge is rejected or
> TODO: I get a MEDIA_TIMEOUT on it -->
>         <action application="bridge" data="openzap/1/a/99355151"/>
> 
> 
> Any ideas on how to accomplish this?

I started testing this with the following dialplan:

    <extension name="mikael-nokia+fallback">
      <condition field="destination_number" expression="^503$">
        <action application="set" data="hangup_after_bridge=false"/>
        <action application="set" data="continue_on_fail=true"/>
        <action application="bridge"
data="user/mikael-nokia at fs.voip.domain.com"/>
        <action application="info"/>    
        <action application="set" data="followme_extension=99355151"/>
        <action application="execute_extension"
data="post_call_followme_check"/>
        <action application="hangup"/>
      </condition>
    </extension>

  <extension name="post_call_followme_check">
    <condition field="destination_number"
expression="^post_call_followme_check$"/>
    <condition field="${originate_disposition}"
expression="^MEDIA_TIMEOUT|$${continue_on_fail_causes}$"
break="on-true">
      <action application="log" data="1 Follow me transferring call
because of orig disposition: ${originate_disposition}"/>
      <action application="transfer" data="${followme_extension}"/>
    </condition>
    <condition>
      <action application="log" data="1 Follow me call ended normally
with orig disposition: ${originate_disposition}."/>
      <action application="hangup"/>
    </condition>
  </extension>


${originate_disposition} never has the value of MEDIA_TIMEOUT since the
call was answered, which is absolutely correct, so what I am searching
for now is how to get the actual hangup cause. The info app doesn't show
MEDIA_TIMEOUT anywhere, but my logs show this:

2009-04-16 10:02:34 [DEBUG] switch_ivr_bridge.c:377
audio_bridge_thread() sofia/internal/sip:mikael-nokia at 10.247.3.253
ending bridge by request from read function
2009-04-16 10:02:34 [DEBUG] switch_ivr_bridge.c:456
audio_bridge_thread() Send signal
sofia/internal/sip:mikael-nokia at 10.247.3.253 [BREAK]
2009-04-16 10:02:34 [DEBUG] switch_ivr_bridge.c:452
audio_bridge_thread() BRIDGE THREAD DONE
[sofia/internal/sip:mikael-nokia at 10.247.3.253]
2009-04-16 10:02:34 [DEBUG] switch_ivr_bridge.c:456
audio_bridge_thread() Send signal
sofia/internal/mikael-ekiga at fs.voip.domain.com [BREAK]
2009-04-16 10:02:34 [DEBUG] switch_core_state_machine.c:508
switch_core_session_run() (sofia/internal/sip:mikael-nokia at 10.247.3.253)
State EXCHANGE_MEDIA going to sleep
2009-04-16 10:02:34 [DEBUG] switch_core_state_machine.c:397
switch_core_session_run() (sofia/internal/sip:mikael-nokia at 10.247.3.253)
Running State Change CS_HANGUP
EXECUTE sofia/internal/mikael-ekiga at fs.voip.domain.com info()
2009-04-16 10:02:34 [DEBUG] switch_core_state_machine.c:448
switch_core_session_run() (sofia/internal/sip:mikael-nokia at 10.247.3.253)
State HANGUP
2009-04-16 10:02:34 [DEBUG] mod_sofia.c:315 sofia_on_hangup() Channel
sofia/internal/sip:mikael-nokia at 10.247.3.253 hanging up, cause:
MEDIA_TIMEOUT
2009-04-16 10:02:34 [DEBUG] mod_sofia.c:370 sofia_on_hangup() Sending
BYE to sofia/internal/sip:mikael-nokia at 10.247.3.253
2009-04-16 10:02:34 [DEBUG] switch_core_state_machine.c:46
switch_core_standard_on_hangup()
sofia/internal/sip:mikael-nokia at 10.247.3.253 Standard HANGUP, cause:
MEDIA_TIMEOUT
2009-04-16 10:02:34 [DEBUG] switch_core_state_machine.c:448
switch_core_session_run() (sofia/internal/sip:mikael-nokia at 10.247.3.253)
State HANGUP going to sleep
2009-04-16 10:02:34 [INFO] mod_dptools.c:946 info_function()
CHANNEL_DATA:
Channel-State: [CS_EXECUTE]
Channel-State-Number: [4]
Channel-Name: [sofia/internal/mikael-ekiga at fs.voip.domain.com]
Unique-ID: [d505477c-2a5c-11de-9175-4ba93d212d75]
Call-Direction: [inbound]
Presence-Call-Direction: [inbound]
Answer-State: [answered]
Channel-Read-Codec-Name: [G722]
Channel-Read-Codec-Rate: [16000]
Channel-Write-Codec-Name: [G722]
Channel-Write-Codec-Rate: [16000]
Caller-Username: [mikael-ekiga]
Caller-Dialplan: [XML]
Caller-Caller-ID-Name: [Mikael Bjerkeland]
Caller-Caller-ID-Number: [mikael-ekiga]
Caller-Network-Addr: [10.0.255.251]
Caller-Destination-Number: [503]
Caller-Unique-ID: [d505477c-2a5c-11de-9175-4ba93d212d75]
Caller-Source: [mod_sofia]
Caller-Context: [customers]
Caller-Channel-Name: [sofia/internal/mikael-ekiga at fs.voip.domain.com]
Caller-Profile-Index: [1]
Caller-Profile-Created-Time: [1239868906687578]
Caller-Channel-Created-Time: [1239868906687578]
Caller-Channel-Answered-Time: [1239868911327578]
Caller-Channel-Progress-Time: [1239868907307602]
Caller-Channel-Progress-Media-Time: [1239868911327578]
Caller-Channel-Hangup-Time: [0]
Caller-Channel-Transfer-Time: [0]
Caller-Screen-Bit: [true]
Caller-Privacy-Hide-Name: [false]
Caller-Privacy-Hide-Number: [false]
Other-Leg-Username: [mikael-ekiga]
Other-Leg-Dialplan: [XML]
Other-Leg-Caller-ID-Name: [Mikael Bjerkeland]
Other-Leg-Caller-ID-Number: [21651012]
Other-Leg-Network-Addr: [10.247.3.253]
Other-Leg-Destination-Number: [sip:mikael-nokia at 10.247.3.253]
Other-Leg-Unique-ID: [d50bf8c4-2a5c-11de-9175-4ba93d212d75]
Other-Leg-Source: [mod_sofia]
Other-Leg-Context: [customers]
Other-Leg-Channel-Name: [sofia/internal/sip:mikael-nokia at 10.247.3.253]
Other-Leg-Screen-Bit: [true]
Other-Leg-Privacy-Hide-Name: [false]
Other-Leg-Privacy-Hide-Number: [false]
variable_sip_received_ip: [10.0.255.251]
variable_sip_received_port: [5065]
variable_sip_via_protocol: [udp]
variable_sip_authorized: [true]
variable_sip_mailbox: [4723695000]
variable_sip_auth_username: [mikael-ekiga]
variable_sip_auth_realm: [fs.voip.domain.com]
variable_mailbox: [4723695000]
variable_user_name: [mikael-ekiga]
variable_domain_name: [fs.voip.domain.com]
variable_effective_caller_id_number: [21651012]
variable_effective_caller_id_name: [Mikael Bjerkeland]
variable_caller_id_number: [21651012]
variable_caller_id_name: [Mikael Bjerkeland]
variable_line_open_for_external_calls: [true]
variable_room_number: [800]
variable_user_context: [customers]
variable_sip_from_user: [mikael-ekiga]
variable_sip_from_uri: [mikael-ekiga at fs.voip.domain.com]
variable_sip_from_host: [fs.voip.domain.com]
variable_sip_from_user_stripped: [mikael-ekiga]
variable_sip_from_tag: [942742a2-ca28-de11-854f-0015c583ee77]
variable_sofia_profile_name: [internal]
variable_sip_req_user: [503]
variable_sip_req_uri: [503 at fs.voip.domain.com]
variable_sip_req_host: [fs.voip.domain.com]
variable_sip_to_user: [503]
variable_sip_to_uri: [503 at fs.voip.domain.com]
variable_sip_to_host: [fs.voip.domain.com]
variable_sip_contact_user: [mikael-ekiga]
variable_sip_contact_port: [5065]
variable_sip_contact_uri: [mikael-ekiga at 10.0.255.251:5065]
variable_sip_contact_host: [10.0.255.251]
variable_channel_name: [sofia/internal/mikael-ekiga at fs.voip.domain.com]
variable_sip_call_id:
[e82d42a2-ca28-de11-854f-0015c583ee77 at mikael-xpsm1530]
variable_sip_user_agent: [Ekiga/3.2.0]
variable_sip_via_host: [10.0.255.251]
variable_sip_via_port: [5065]
variable_sip_via_rport: [5065]
variable_max_forwards: [70]
variable_presence_id: [mikael-ekiga at fs.voip.domain.com]
variable_switch_r_sdp: [v=0
o=- 1239868973 1239868973 IN IP4 10.0.255.251
s=Opal SIP Session
c=IN IP4 10.0.255.251
t=0 0
m=audio 5090 RTP/AVP 9 8 117 0 116 101 120
a=rtpmap:9 G722/8000/1
a=rtpmap:8 PCMA/8000/1
a=rtpmap:117 Speex/16000/1
a=fmtp:117 sr=16000,mode=any
a=rtpmap:0 PCMU/8000/1
a=rtpmap:116 Speex/8000/1
a=fmtp:116 sr=8000,mode=any
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16,32,36
a=rtpmap:120 NSE/8000
a=fmtp:120 192-193
m=video 5092 RTP/AVP 119 31
a=rtpmap:119 theora/90000
a=fmtp:119
delivery-method="in_band";height=576;sampling="YCbCr-4:2:0";width=704
a=rtpmap:31 h261/90000
a=fmtp:31 CIF=1;QCIF=1
]
variable_ep_codec_string:
[G722 at 8000h@0i,PCMA at 8000h@0i,SPEEX at 16000h@0i,SPEEX at 16000h@0i,SPEEX at 16000h@0i,PCMU at 8000h@0i,H261 at 90000h@0i]
variable_hangup_after_bridge: [false]
variable_continue_on_fail: [true]
variable_dialed_user: [mikael-nokia]
variable_dialed_domain: [fs.voip.domain.com]
variable_switch_m_sdp: [v=0
o=Nokia-SIPUA 603233522614072812 292890395656351010 IN IP4 10.247.3.253
s=FreeSWITCH
c=IN IP4 10.247.3.253
t=0 0
m=audio 49152 RTP/AVP 8 101 13
a=rtpmap:8 PCMA/8000/1
a=rtpmap:101 telephone-event/8000/1
a=fmtp:101 0-15
a=rtpmap:13 CN/8000/1
a=ptime:20
a=maxptime:200
m=video 0 RTP/AVP 99
a=rtpmap:99 H264/90000
]
variable_remote_media_ip: [10.0.255.251]
variable_remote_media_port: [5090]
variable_read_codec: [G722]
variable_read_rate: [16000]
variable_write_codec: [G722]
variable_write_rate: [16000]
variable_video_possible: [true]
variable_remote_video_ip: [10.0.255.251]
variable_remote_video_port: [5092]
variable_sip_video_fmtp: [CIF=1;QCIF=1]
variable_sip_video_pt: [31]
variable_local_media_ip: [10.100.4.192]
variable_local_media_port: [56008]
variable_local_video_ip: [10.100.4.192]
variable_local_video_port: [59022]
variable_video_read_codec: [H261]
variable_video_read_rate: [90000]
variable_video_write_codec: [H261]
variable_video_write_rate: [90000]
variable_endpoint_disposition: [ANSWER]
variable_originate_disposition: [SUCCESS]
variable_bridge_channel: [sofia/internal/sip:mikael-nokia at 10.247.3.253]
variable_bridge_uuid: [d50bf8c4-2a5c-11de-9175-4ba93d212d75]
variable_signal_bond: [d50bf8c4-2a5c-11de-9175-4ba93d212d75]
variable_current_application: [info]



How do I get the "raw" hangup cause first mentioned below?

"
2009-04-16 10:02:34 [DEBUG] mod_sofia.c:315 sofia_on_hangup() Channel
sofia/internal/sip:mikael-nokia at 10.247.3.253 hanging up, cause:
MEDIA_TIMEOUT
"

As mentioned earlier the origination was in fact a success, but since I
moved out of wi-fi coverage area I got a MEDIA_TIMEOUT which should
trigger a transfer to my cell phone number. :-)


> 
> Thanks,
> Mikael





More information about the FreeSWITCH-users mailing list