[Freeswitch-users] 404 Error on incoming calls

Josip Djuricic josip.djuricic at primatel.hr
Sat Mar 15 06:07:05 EDT 2008


Kurt if I see it correctly ain't you missing brackets?

<condition field="destination_number" expression="^(In-2061234567)$">

otherwise $1 has almost no meaning, cause it won't be filled with In-2061234567

Josip


Kurt Marasco wrote:
> Michael, you are absolutely correct that it is matching on the enum 
> extension in the default profile. When I comment out the enum extension 
> I get no match.
>
> So I know that the transfer is being made from public.xml to 
> default.xml. The question is why am I not getting a match? And is there 
> any way to see what's contained in the $1 that is being passed from 
> public,xml to default.xml??? The debug shows $1 
> (Caller-Destination-Number: [$1]) and not the contents of the variable. 
> This field shows 1001 when I hard code the final extension.
>
> I found an error in my extension in default xml relating to where the 
> condition is closed, but I fixed it and still do not get a match.
>
> public.xml contains the following:
>      <!-- http://wiki.freeswitch.org/wiki/Dialplan_XML -->
>      <include>
>      <context name="public">
>
>     <extension name="unloop">
>       <condition field="${unroll_loops}" expression="^true$"/>
>       <condition field="${sip_looped_call}" expression="^true$">
>       <action application="deflect" data="${destination_number}"/>
>       </condition>
>     </extension>
>
>     <extension name="public_did2">
>      <condition field="destination_number" expression="^In-2061234567$">
>      <action application="transfer" data="$1 XML default"/>
>      </condition>
>     </extension>
>
>   </context>
> </include>
>
> The extension public_did2 differs from my working scenario only in that 
> I hard coded the destination extension 1001 in place of $1.
> My extension to match in default.xml is listed prior to the enum 
> extension that is being matched as follows:
>    <extension name="In-2061234567">
>      <condition field="destination_number" expression="^In-2061234567$">
>        <!-- <action application="ringback" /> -->
>        <action application="set" data="call_timeout=20"/>
>        <action application="bridge" data="sofia/default/1001%$${domain}"/>
>        <action application="javascript" 
> data="/usr/local/freeswitch/scripts/answermachine.js"/>
>      </condition>
>    </extension>
>
> My understanding is that $1 should contain whatever was matched in 
> public.xml, which is the string "In-2061234567". My condition expression 
> in default.xml is "^In-2061234567$", so I don't where else to look at 
> this point. My probable conclusions are that I have a syntax error or 
> that $1 is passing something other than expected. Extension 
> "In-2061234567" was not in the directory because it is not a physical 
> endpoint. I added it to the directory thinking that this might be an 
> authentication issue, but the result is the same even if "In-2061234567" 
> is in the directory (No sip phone is registering to "In-2061234567" as 
> my intent is to transfer/bridge to 1001.
>
> Kurt
>
>
>
> Michael Jerris wrote:
>   
>> This is a different extension that is transfering to the enum dialplan  
>> not XML like the extension you pasted.  Chek your conditions to see  
>> why its matching the wrong ext.
>>
>> Mike
>>
>> On Mar 14, 2008, at 6:31 PM, Kurt Marasco <kmarasco at faithwork.org>  
>> wrote:
>>
>>   
>>     
>>> Here's the FS debug from the console:
>>>
>>> nta: received INVITE sip:In-2061234567 at mydomain.com:5080 SIP/2.0  
>>> (CSeq 102)
>>> nta: INVITE (102) going to a default leg
>>> nua(0x81c22c0): adding session usage
>>> nta: sent 100 Trying for INVITE (102)
>>> nua(0x81c22c0): call state changed: init -> received, received offer
>>> 2008-03-14 18:18:40 [NOTICE] switch_channel.c:522
>>> switch_channel_set_name() New Chan
>>> sofia/outbound/5031234567 at 67.55.341.56:5060
>>> [b9608e95-8a80-49ba-b3c5-883432c4bcb2]
>>> 2008-03-14 18:18:40 [INFO] mod_dialplan_xml.c:222 dialplan_hunt()
>>> Processing PORTLAND OR->In-2061234567!
>>> 2008-03-14 18:18:40 [NOTICE] switch_ivr.c:924
>>> switch_ivr_session_transfer() Transfer
>>> sofia/outbound/5031234567 at 67.55.341.56:5060 to XML[$1 at default]
>>> 2008-03-14 18:18:40 [INFO] mod_dialplan_xml.c:222 dialplan_hunt()
>>> Processing PORTLAND OR->$1!
>>> 2008-03-14 18:18:40 [INFO] mod_dptools.c:601 info_function()  
>>> CHANNEL_DATA:
>>> Channel-State: [CS_EXECUTE]
>>> Channel-State-Number: [4]
>>> Channel-Name: [sofia/outbound/5031234567 at 67.55.341.56:5060]
>>> Unique-ID: [b9608e95-8a80-49ba-b3c5-883432c4bcb2]
>>> Call-Direction: [inbound]
>>> Answer-State: [ringing]
>>> Channel-Read-Codec-Name: [PCMU]
>>> Channel-Read-Codec-Rate: [8000]
>>> Channel-Write-Codec-Name: [PCMU]
>>> Channel-Write-Codec-Rate: [8000]
>>> Caller-Username: [5031234567]
>>> Caller-Dialplan: [XML]
>>> Caller-Caller-ID-Name: [PORTLAND OR]
>>> Caller-Caller-ID-Number: [5031234567]
>>> Caller-Network-Addr: [67.55.341.56]
>>> Caller-Destination-Number: [$1]
>>> Caller-Unique-ID: [b9608e95-8a80-49ba-b3c5-883432c4bcb2]
>>> Caller-Source: [mod_sofia]
>>> Caller-Context: [default]
>>> Caller-RDNIS: [In-2061234567]
>>> Caller-Channel-Name: [sofia/outbound/5031234567 at 67.55.341.56:5060]
>>> Caller-Channel-Created-Time: [1205543920601430]
>>> Caller-Channel-Answered-Time: [0]
>>> Caller-Channel-Hangup-Time: [0]
>>> Caller-Channel-Transfer-Time: [0]
>>> Caller-Screen-Bit: [yes]
>>> Caller-Privacy-Hide-Name: [no]
>>> Caller-Privacy-Hide-Number: [no]
>>> variable_sip_from_user: [5031234567]
>>> variable_sip_from_port: [5060]
>>> variable_sip_from_uri: [5031234567 at 67.55.341.56:5060]
>>> variable_sip_from_host: [67.55.341.56]
>>> variable_sip_from_user_stripped: [5031234567]
>>> variable_sip_from_tag: [as6a5e4b5c]
>>> variable_sofia_profile_name: [outbound]
>>> variable_sofia_profile_domain_name: [outbound]
>>> variable_sip_req_user: [In-2061234567]
>>> variable_sip_req_port: [5080]
>>> variable_sip_req_uri: [In-2061234567 at mydomain.com:5080]
>>> variable_sip_req_host: [mydomain.com]
>>> variable_sip_to_user: [In-2061234567]
>>> variable_sip_to_port: [5080]
>>> variable_sip_to_uri: [In-2061234567 at mydomain.com:5080]
>>> variable_sip_to_host: [mydomain.com]
>>> variable_sip_contact_user: [5031234567]
>>> variable_sip_contact_port: [5060]
>>> variable_sip_contact_uri: [5031234567 at 67.55.341.56:5060]
>>> variable_sip_contact_host: [67.55.341.56]
>>> variable_channel_name: [sofia/outbound/5031234567 at 67.55.341.56:5060]
>>> variable_sip_call_id: [637c71185629eca135630a1d3c215d08 at 67.55.341.56]
>>> variable_sip_user_agent: [Asterisk PBX]
>>> variable_sip_via_host: [67.55.341.56]
>>> variable_sip_via_port: [5060]
>>> variable_sip_via_rport: [5060]
>>> variable_max_forwards: [70]
>>> variable_switch_r_sdp: [v=0
>>> o=root 25187 25187 IN IP4 67.55.341.56
>>> s=session
>>> c=IN IP4 67.55.341.56
>>> t=0 0
>>> m=audio 12740 RTP/AVP 0 8 3 18 97 101
>>> a=rtpmap:0 PCMU/8000
>>> a=rtpmap:8 PCMA/8000
>>> a=rtpmap:3 GSM/8000
>>> a=rtpmap:18 G729/8000
>>> a=fmtp:18 annexb=no
>>> a=rtpmap:97 iLBC/8000
>>> a=fmtp:97 mode=30
>>> a=rtpmap:101 telephone-event/8000
>>> a=fmtp:101 0-16
>>> a=silenceSupp:off - - - -
>>> a=ptime:20
>>> ]
>>> variable_remote_media_ip: [67.55.341.56]
>>> variable_remote_media_port: [12740]
>>> variable_read_codec: [PCMU]
>>> variable_read_rate: [8000]
>>> variable_write_codec: [PCMU]
>>> variable_write_rate: [8000]
>>> variable_endpoint_disposition: [RECEIVED]
>>> variable_use_profile: [default]
>>> variable_numbering_plan: [US]
>>> variable_default_gateway: [192.168.2.1]
>>> variable_default_area_code: [509]
>>> variable_user_name: [default]
>>> variable_domain_name: [192.168.2.102]
>>>
>>>
>>> 2008-03-14 18:18:41 [NOTICE] switch_ivr.c:924
>>> switch_ivr_session_transfer() Transfer
>>> sofia/outbound/5031234567 at 67.55.341.56:5060 to enum[$1 at default]
>>> 2008-03-14 18:18:41 [INFO] switch_core_state_machine.c:112
>>> switch_core_standard_on_ring() No Route, Aborting
>>> 2008-03-14 18:18:41 [NOTICE] switch_core_state_machine.c:113
>>> switch_core_standard_on_ring() Hangup
>>> sofia/outbound/5031234567 at 67.55.341.56:5060 [CS_RING]  
>>> [NO_ROUTE_DESTINATION]
>>> nta: sent 404 Not Found for INVITE (102)
>>> nua(0x81c22c0): removing session usage
>>> nua(0x81c22c0): call state changed: init -> terminated
>>> 2008-03-14 18:18:41 [NOTICE] switch_core_session.c:717
>>> switch_core_session_thread() Session 2
>>> (sofia/outbound/5031234567 at 67.55.341.56:5060) Ended
>>> 2008-03-14 18:18:41 [NOTICE] switch_core_session.c:719
>>> switch_core_session_thread() Close Channel
>>> sofia/outbound/5031234567 at 67.55.341.56:5060 [CS_HANGUP]
>>>
>>> Thanks
>>>
>>> Josip Djuricic wrote:
>>>     
>>>       
>>>> Could you please post a FS debug also with sip debug enabled on these
>>>> event?
>>>>
>>>>
>>>> Kurt Marasco wrote:
>>>>       
>>>>         
>>>>> Thanks,
>>>>>
>>>>> That's what I tried, but I ended up I hardcoding the extension.  
>>>>> When I
>>>>> left it as $1, the console showed it being passed literally as $1  
>>>>> (But
>>>>> maybe it was actually passing the contents of the variable). Since I
>>>>> don't have a registered endpoint that matched my incoming DID, I was
>>>>> trying to have the default dial plan handle the passed DID with no  
>>>>> luck.
>>>>> It seemed to only want to transfer or bridge to a registered  
>>>>> endpoint
>>>>> and not into the dial plan.
>>>>>
>>>>> Perhaps my syntax in the default dial plan was wrong. I tried this  
>>>>> in
>>>>> the public.xml:
>>>>>    <extension name="public_did2">
>>>>>      <condition field="destination_number" expression="^ 
>>>>> (In-2061234567)$">
>>>>>    <action application="transfer" data="$1 XML default"/>
>>>>>      </condition>
>>>>>    </extension>
>>>>>
>>>>> And this in the default dial plan:
>>>>>   <extension name="In-2061234567">
>>>>>     <condition field="destination_number"  
>>>>> expression="^In-2061234567$"/>
>>>>>     <action application="ringback" />
>>>>>     <action application="set" data="call_timeout=20"/>
>>>>>     <action application="bridge" data="sofia/default/1001%$$ 
>>>>> {domain}"/>
>>>>>     <action application="javascript"
>>>>> data="/usr/local/freeswitch/scripts/answermachine.js"/>
>>>>>   </extension>
>>>>>
>>>>> The above fails, but below worked by itself in public.xml:
>>>>>    <extension name="public_did">
>>>>>      <condition field="destination_number" expression="^In-2061234567 
>>>>> $">
>>>>>    <action application="transfer" data="1001 XML default"/>
>>>>>      </condition>
>>>>>    </extension>
>>>>>
>>>>> Thanks,
>>>>> Kurt
>>>>>
>>>>> Josip Djuricic wrote:
>>>>>
>>>>>         
>>>>>           
>>>>>> Hi there,
>>>>>>
>>>>>> if I'm not mistaking (if I am Brian or someone else will tell), you
>>>>>> can do it from the public.xml
>>>>>>
>>>>>> Example:
>>>>>>    <extension name="name_of_incoming_extension">
>>>>>>     <condition field="destination_number"
>>>>>> expression="^(incoming_extension_number_match)$">
>>>>>>        <action application="transfer" data="$1 XML default"/>
>>>>>>      </condition>
>>>>>>     </extension>
>>>>>>
>>>>>> If I'm not mistaking with transfer to XML default you do exactly  
>>>>>> what
>>>>>> you wanna do.
>>>>>>
>>>>>> Josip
>>>>>>
>>>>>> Kurt Marasco wrote:
>>>>>>
>>>>>>           
>>>>>>             
>>>>>>> Thanks Brian and Josip for your responses,
>>>>>>>
>>>>>>> Brian's suggestion did the trick for me. I can both transfer and
>>>>>>> bridge the call to a registered extension in the default dial  
>>>>>>> plan.
>>>>>>>
>>>>>>> Not sure if If it makes sense to do this, but is there a way to  
>>>>>>> pass
>>>>>>> the call into the default dial plan and have the default dial plan
>>>>>>> process the sip invite. I'm able to send the incoming did to a
>>>>>>> registered endpoint from (in the directory) but can't pass it  
>>>>>>> through
>>>>>>> to the default and match on the original incoming did.
>>>>>>>
>>>>>>> I'm still confused about what the nat profile does, because I'm
>>>>>>> behind nat and am not using the nat profile, yet freeswitch  
>>>>>>> seems to
>>>>>>> be working.
>>>>>>>
>>>>>>>
>>>>>>> Brian West wrote:
>>>>>>>
>>>>>>>             
>>>>>>>               
>>>>>>>> Kurt,
>>>>>>>> First off let me fill in a few blanks here.
>>>>>>>>
>>>>>>>> Correct me if i'm wrong this looks like an inbound invite to port
>>>>>>>> 5070 right?  If so then you're not using the default config as it
>>>>>>>> was designed. (I did the bulk of the config)
>>>>>>>>
>>>>>>>> Here is what you do.  Have your IPKALL did hit your IP on port  
>>>>>>>> 5080
>>>>>>>> instead.. aka the outbound profile.
>>>>>>>>
>>>>>>>> Then open up dialplan/public.xml and install an extension that  
>>>>>>>> can
>>>>>>>> route to a registered endpoing.  their is a 5551212 example in  
>>>>>>>> there.
>>>>>>>>
>>>>>>>> /b
>>>>>>>>
>>>>>>>>
>>>>>>>> On Mar 11, 2008, at 5:02 AM, Kurt Marasco wrote:
>>>>>>>>
>>>>>>>>
>>>>>>>>               
>>>>>>>>                 
>>>>>>>>> Hi I am testing FS and am currently working with the xml  
>>>>>>>>> dialplan.
>>>>>>>>> I have FS behind a NAT router and have 2 soft phones  
>>>>>>>>> functioning on
>>>>>>>>> another PC behind the router. I currently have working
>>>>>>>>> conversations when dialing between the extensions set up on each
>>>>>>>>> phone.
>>>>>>>>>
>>>>>>>>> I am now trying to call one of the softphones via an IpKall  
>>>>>>>>> DID. I
>>>>>>>>> have no problem making this work if I use wikipbx, but can't  
>>>>>>>>> make
>>>>>>>>> it work using the xml dialplan, so clearly FS is working and my
>>>>>>>>> configuration is the issue. I am currently sending the ipkall  
>>>>>>>>> sip
>>>>>>>>> invite to port 5070, but have tried 5060 as well.
>>>>>>>>>
>>>>>>>>> Here is the console output from FS when I dial my IpKall DID  
>>>>>>>>> from
>>>>>>>>> my land line.
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>                 
>>>>>>>>>                   
>>>>>>>>>> nta: received INVITE sip:In-2061234567 at mydomain.com:5070 SIP/ 
>>>>>>>>>> 2.0
>>>>>>>>>> (CSeq 102)
>>>>>>>>>> nta: INVITE (102) going to a default leg
>>>>>>>>>> nua(0x8117508): adding session usage
>>>>>>>>>> nta: sent 100 Trying for INVITE (102)
>>>>>>>>>> nua(0x8117508): call state changed: init -> received,  
>>>>>>>>>> received offer
>>>>>>>>>> 2008-03-11 02:25:31 [NOTICE] switch_channel.c:522
>>>>>>>>>> switch_channel_set_name() New Chan
>>>>>>>>>> sofia/nat/5035557777 at 69.64.180.77:5060
>>>>>>>>>> [53bb0a56-f059-483e-9e08-d583a9566255]
>>>>>>>>>> 2008-03-11 02:25:32 [INFO] mod_dialplan_xml.c:222  
>>>>>>>>>> dialplan_hunt()
>>>>>>>>>> Processing PORTLAND OR->In-2061234567!
>>>>>>>>>> *2008-03-11 02:25:32 [INFO] switch_core_state_machine.c:112
>>>>>>>>>> switch_core_standard_on_ring() No Route, Aborting*
>>>>>>>>>> 2008-03-11 02:25:32 [NOTICE] switch_core_state_machine.c:113
>>>>>>>>>> switch_core_standard_on_ring() Hangup
>>>>>>>>>> sofia/nat/5035557777 at 69.64.180.77:5060 [CS_RING]
>>>>>>>>>> [NO_ROUTE_DESTINATION]
>>>>>>>>>> nta: sent 404 Not Found for INVITE (102)
>>>>>>>>>> nua(0x8117508): removing session usage
>>>>>>>>>> nua(0x8117508): call state changed: init -> terminated
>>>>>>>>>> nta: received ACK sip:In-2061234567 at mydomain.com:5070 SIP/2.0
>>>>>>>>>> (CSeq 102)
>>>>>>>>>> nta: ACK (102) is going to INVITE (102)
>>>>>>>>>> 2008-03-11 02:25:32 [NOTICE] switch_core_session.c:717
>>>>>>>>>> switch_core_session_thread() Session 1
>>>>>>>>>> (sofia/nat/5035557777 at 69.64.180.77:5060) Ended
>>>>>>>>>> 2008-03-11 02:25:32 [NOTICE] switch_core_session.c:719
>>>>>>>>>> switch_core_session_thread() Close Channel
>>>>>>>>>> sofia/nat/5035557777 at 69.64.180.77:5060 [CS_HANGUP]
>>>>>>>>>>
>>>>>>>>>>                   
>>>>>>>>>>                     
>>>>>>>>> Any thoughts on what I'm doing wrong would be appreciated.
>>>>>>>>>
>>>>>>>>> Kurt
>>>>>>>>> _______________________________________________
>>>>>>>>> Freeswitch-users mailing list
>>>>>>>>> Freeswitch-users at lists.freeswitch.org
>>>>>>>>> <mailto:Freeswitch-users at lists.freeswitch.org>
>>>>>>>>> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
>>>>>>>>> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
>>>>>>>>> http://www.freeswitch.org
>>>>>>>>>
>>>>>>>>>                 
>>>>>>>>>                   
>>>>>>> --- 
>>>>>>> --- 
>>>>>>> ------------------------------------------------------------------
>>>>>>>
>>>>>>> _______________________________________________
>>>>>>> Freeswitch-users mailing list
>>>>>>> Freeswitch-users at lists.freeswitch.org
>>>>>>> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
>>>>>>> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
>>>>>>> http://www.freeswitch.org
>>>>>>>
>>>>>>>
>>>>>>>             
>>>>>>>               
>>>>>> --- 
>>>>>> --- 
>>>>>> ------------------------------------------------------------------
>>>>>>
>>>>>> _______________________________________________
>>>>>> Freeswitch-users mailing list
>>>>>> Freeswitch-users at lists.freeswitch.org
>>>>>> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
>>>>>> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
>>>>>> http://www.freeswitch.org
>>>>>>
>>>>>>
>>>>>>           
>>>>>>             
>>>>> _______________________________________________
>>>>> Freeswitch-users mailing list
>>>>> Freeswitch-users at lists.freeswitch.org
>>>>> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
>>>>> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
>>>>> http://www.freeswitch.org
>>>>>
>>>>>
>>>>>
>>>>>         
>>>>>           
>>>> --- 
>>>> ---------------------------------------------------------------------
>>>>
>>>> _______________________________________________
>>>> Freeswitch-users mailing list
>>>> Freeswitch-users at lists.freeswitch.org
>>>> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
>>>> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
>>>> http://www.freeswitch.org
>>>>
>>>>       
>>>>         
>>> _______________________________________________
>>> Freeswitch-users mailing list
>>> Freeswitch-users at lists.freeswitch.org
>>> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
>>> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
>>> http://www.freeswitch.org
>>>     
>>>       
>> _______________________________________________
>> Freeswitch-users mailing list
>> Freeswitch-users at lists.freeswitch.org
>> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
>> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
>> http://www.freeswitch.org
>>   
>>     
>
> _______________________________________________
> Freeswitch-users mailing list
> Freeswitch-users at lists.freeswitch.org
> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
> http://www.freeswitch.org
>
>
>   

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20080315/2224ab49/attachment-0001.html 


More information about the Freeswitch-users mailing list