Sponsor: VoiceMeUp - Corporate & Wholesale VoIP Services

VoIP Mailing List Archives
Mailing list archives for the VoIP community
 SearchSearch 

[Freeswitch-users] freeswitch as SBC and kamailio - no route


 
Post new topic   Reply to topic    VoIP Mailing List Archives Forum Index -> freeSWITCH Users
View previous topic :: View next topic  
Author Message
foxb at abv.bg
Guest





PostPosted: Wed Aug 26, 2009 11:48 am    Post subject: [Freeswitch-users] freeswitch as SBC and kamailio - no route Reply with quote

Hello

I followed the tutorial
http://wiki.freeswitch.org/wiki/SBC_Setup

I have following problem when I dial 1000 Kamalio reports 302, but freeswitch does not route

Where to look for problems?

Here is the debug:

2009-08-26 20:21:42.332154 [INFO] mod_dialplan_xml.c:315 Processing 1001->1000 in context default
Dialplan: sofia/internal/1001@10.10.10.10 parsing [default->LOOKUP_ROUTE] continue=false
Dialplan: sofia/internal/1001@10.10.10.10 Regex (PASS) [LOOKUP_ROUTE] destination_number(1000) =~ /(\d+)$/ break=on-false
Dialplan: sofia/internal/1001@10.10.10.10 Action set(hangup_after_bridge=true)
Dialplan: sofia/internal/1001@10.10.10.10 Action set(continue_on_fail=true)
Dialplan: sofia/internal/1001@10.10.10.10 Action export(sip_h_X-ROUTE=LOOKUP)
Dialplan: sofia/internal/1001@10.10.10.10 Action bridge(sofia/internal/${destination_number}@127.0.0.1:5062)
Dialplan: sofia/internal/1001@10.10.10.10 Action set(ROUTE_GW=${sip_redirect_contact_user_0})
Dialplan: sofia/internal/1001@10.10.10.10 Action set(AREA=${sip_redirect_contact_user_0})
Dialplan: sofia/internal/1001@10.10.10.10 Action transfer(${destination_number} XML ROUTING)
2009-08-26 20:21:42.334579 [DEBUG] switch_core_state_machine.c:114 (sofia/internal/1001@10.10.10.10) State Change CS_ROUTING -> CS_EXECUTE
2009-08-26 20:21:42.334579 [DEBUG] switch_core_session.c:932 Send signal sofia/internal/1001@10.10.10.10 [BREAK]
2009-08-26 20:21:42.334579 [DEBUG] switch_core_state_machine.c:484 (sofia/internal/1001@10.10.10.10) State ROUTING going to sleep
2009-08-26 20:21:42.335292 [DEBUG] switch_core_state_machine.c:398 (sofia/internal/1001@10.10.10.10) Running State Change CS_EXECUTE
2009-08-26 20:21:42.335292 [DEBUG] switch_core_state_machine.c:491 (sofia/internal/1001@10.10.10.10) State EXECUTE
2009-08-26 20:21:42.335292 [DEBUG] mod_sofia.c:173 sofia/internal/1001@10.10.10.10 SOFIA EXECUTE
2009-08-26 20:21:42.335292 [DEBUG] switch_core_state_machine.c:151 sofia/internal/1001@10.10.10.10 Standard EXECUTE
EXECUTE sofia/internal/1001@10.10.10.10 set(hangup_after_bridge=true)
2009-08-26 20:21:42.336509 [DEBUG] mod_dptools.c:748 sofia/internal/1001@10.10.10.10 SET [hangup_after_bridge]=[true]
EXECUTE sofia/internal/1001@10.10.10.10 set(continue_on_fail=true)
2009-08-26 20:21:42.337353 [DEBUG] mod_dptools.c:748 sofia/internal/1001@10.10.10.10 SET [continue_on_fail]=[true]
EXECUTE sofia/internal/1001@10.10.10.10 export(sip_h_X-ROUTE=LOOKUP)
2009-08-26 20:21:42.338352 [DEBUG] mod_dptools.c:886 EXPORT [sip_h_X-ROUTE]=[LOOKUP]
EXECUTE sofia/internal/1001@10.10.10.10 bridge(sofia/internal/1000@127.0.0.1:5062)
2009-08-26 20:21:42.339309 [NOTICE] switch_channel.c:602 New Channel sofia/internal/1000@127.0.0.1:5062 [8a588e6a-925c-11de-85dd-15dc0a06983f]
2009-08-26 20:21:42.339309 [DEBUG] mod_sofia.c:2811 (sofia/internal/1000@127.0.0.1:5062) State Change CS_NEW -> CS_INIT
2009-08-26 20:21:42.340376 [DEBUG] switch_core_session.c:932 Send signal sofia/internal/1000@127.0.0.1:5062 [BREAK]
2009-08-26 20:21:42.341175 [DEBUG] switch_core_state_machine.c:398 (sofia/internal/1000@127.0.0.1:5062) Running State Change CS_INIT
2009-08-26 20:21:42.341175 [DEBUG] switch_core_state_machine.c:481 (sofia/internal/1000@127.0.0.1:5062) State INIT
2009-08-26 20:21:42.341175 [DEBUG] mod_sofia.c:83 sofia/internal/1000@127.0.0.1:5062 SOFIA INIT
2009-08-26 20:21:42.344378 [DEBUG] mod_sofia.c:111 (sofia/internal/1000@127.0.0.1:5062) State Change CS_INIT -> CS_ROUTING
2009-08-26 20:21:42.344378 [DEBUG] switch_core_session.c:932 Send signal sofia/internal/1000@127.0.0.1:5062 [BREAK]
2009-08-26 20:21:42.344378 [DEBUG] switch_core_state_machine.c:481 (sofia/internal/1000@127.0.0.1:5062) State INIT going to sleep
2009-08-26 20:21:42.344378 [DEBUG] sofia.c:3289 Channel sofia/internal/1000@127.0.0.1:5062 entering state [calling][0]
2009-08-26 20:21:42.344378 [DEBUG] switch_core_state_machine.c:398 (sofia/internal/1000@127.0.0.1:5062) Running State Change CS_ROUTING
2009-08-26 20:21:42.345314 [DEBUG] switch_core_state_machine.c:484 (sofia/internal/1000@127.0.0.1:5062) State ROUTING
2009-08-26 20:21:42.345314 [DEBUG] mod_sofia.c:130 sofia/internal/1000@127.0.0.1:5062 SOFIA ROUTING
2009-08-26 20:21:42.345314 [DEBUG] switch_ivr_originate.c:63 (sofia/internal/1000@127.0.0.1:5062) State Change CS_ROUTING -> CS_CONSUME_MEDIA
2009-08-26 20:21:42.345314 [DEBUG] switch_core_session.c:932 Send signal sofia/internal/1000@127.0.0.1:5062 [BREAK]
2009-08-26 20:21:42.345314 [DEBUG] switch_core_state_machine.c:484 (sofia/internal/1000@127.0.0.1:5062) State ROUTING going to sleep
2009-08-26 20:21:42.346255 [DEBUG] switch_core_state_machine.c:398 (sofia/internal/1000@127.0.0.1:5062) Running State Change CS_CONSUME_MEDIA
2009-08-26 20:21:42.346255 [DEBUG] switch_core_state_machine.c:503 (sofia/internal/1000@127.0.0.1:5062) State CONSUME_MEDIA
2009-08-26 20:21:42.349173 [DEBUG] sofia.c:3289 Channel sofia/internal/1000@127.0.0.1:5062 entering state [calling][0]
2009-08-26 20:21:42.350242 [DEBUG] sofia.c:3289 Channel sofia/internal/1000@127.0.0.1:5062 entering state [terminated][503]
2009-08-26 20:21:42.350242 [NOTICE] sofia.c:3849 Hangup sofia/internal/1000@127.0.0.1:5062 [CS_CONSUME_MEDIA] [NORMAL_TEMPORARY_FAILURE]
2009-08-26 20:21:42.351172 [DEBUG] switch_ivr_originate.c:2138 Originate Resulted in Error Cause: 41 [NORMAL_TEMPORARY_FAILURE]
2009-08-26 20:21:42.351172 [INFO] mod_dptools.c:2093 Originate Failed. Cause: NORMAL_TEMPORARY_FAILURE
2009-08-26 20:21:42.351172 [DEBUG] mod_dptools.c:2120 Continue on fail [true]: Cause: NORMAL_TEMPORARY_FAILURE
EXECUTE sofia/internal/1001@10.10.10.10 set(ROUTE_GW=PEER-01)
2009-08-26 20:21:42.352234 [DEBUG] mod_dptools.c:748 sofia/internal/1001@10.10.10.10 SET [ROUTE_GW]=[PEER-01]
2009-08-26 20:21:42.352234 [DEBUG] switch_channel.c:1683 Send signal sofia/internal/1000@127.0.0.1:5062 [KILL]
2009-08-26 20:21:42.352234 [DEBUG] switch_core_session.c:932 Send signal sofia/internal/1000@127.0.0.1:5062 [BREAK]
EXECUTE sofia/internal/1001@10.10.10.10 set(AREA=PEER-01)
2009-08-26 20:21:42.353179 [DEBUG] mod_dptools.c:748 sofia/internal/1001@10.10.10.10 SET [AREA]=[PEER-01]
EXECUTE sofia/internal/1001@10.10.10.10 transfer(1000 XML ROUTING)
2009-08-26 20:21:42.355174 [DEBUG] switch_ivr.c:1343 (sofia/internal/1001@10.10.10.10) State Change CS_EXECUTE -> CS_ROUTING
2009-08-26 20:21:42.355174 [DEBUG] switch_core_session.c:932 Send signal sofia/internal/1001@10.10.10.10 [BREAK]
2009-08-26 20:21:42.355174 [DEBUG] switch_ivr.c:1347 sofia/internal/1001@10.10.10.10 receive message [TRANSFER]
2009-08-26 20:21:42.355174 [DEBUG] switch_core_session.c:630 Send signal sofia/internal/1001@10.10.10.10 [BREAK]
2009-08-26 20:21:42.355174 [NOTICE] switch_ivr.c:1349 Transfer sofia/internal/1001@10.10.10.10 to XML[1000@ROUTING]
2009-08-26 20:21:42.356405 [DEBUG] switch_core_state_machine.c:491 (sofia/internal/1001@10.10.10.10) State EXECUTE going to sleep
2009-08-26 20:21:42.356405 [DEBUG] switch_core_state_machine.c:398 (sofia/internal/1001@10.10.10.10) Running State Change CS_ROUTING
2009-08-26 20:21:42.357172 [DEBUG] switch_core_state_machine.c:503 (sofia/internal/1000@127.0.0.1:5062) State CONSUME_MEDIA going to sleep
2009-08-26 20:21:42.357172 [DEBUG] switch_core_state_machine.c:398 (sofia/internal/1000@127.0.0.1:5062) Running State Change CS_HANGUP
2009-08-26 20:21:42.357172 [DEBUG] switch_core_state_machine.c:484 (sofia/internal/1001@10.10.10.10) State ROUTING
2009-08-26 20:21:42.357172 [DEBUG] mod_sofia.c:130 sofia/internal/1001@10.10.10.10 SOFIA ROUTING
2009-08-26 20:21:42.357172 [DEBUG] switch_core_state_machine.c:78 sofia/internal/1001@10.10.10.10 Standard ROUTING
2009-08-26 20:21:42.357172 [INFO] mod_dialplan_xml.c:315 Processing 1001->1000 in context ROUTING
Dialplan: sofia/internal/1001@10.10.10.10 parsing [ROUTING->PEER_01] continue=false
2009-08-26 20:21:42.358179 [DEBUG] switch_core_state_machine.c:434 (sofia/internal/1000@127.0.0.1:5062) State HANGUP
Dialplan: sofia/internal/1001@10.10.10.10 Regex (FAIL) [PEER_01] ${sip_h_X-ROUTE}(LOOKUP) =~ /PEER_01/ break=on-false
2009-08-26 20:21:42.358179 [INFO] switch_core_state_machine.c:136 No Route, Aborting
2009-08-26 20:21:42.358179 [DEBUG] mod_sofia.c:306 sofia/internal/1000@127.0.0.1:5062 Overriding SIP cause 503 with 503 from the other leg
2009-08-26 20:21:42.359202 [NOTICE] switch_core_state_machine.c:137 Hangup sofia/internal/1001@10.10.10.10 [CS_ROUTING] [NO_ROUTE_DESTINATION]


_______________________________________________
FreeSWITCH-users mailing list
FreeSWITCH-users@lists.freeswitch.org
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org
Back to top
brian at freeswitch.org
Guest





PostPosted: Wed Aug 26, 2009 12:01 pm    Post subject: [Freeswitch-users] freeswitch as SBC and kamailio - no route Reply with quote

We do not blindly follow 302's as that is a dangerous thing to do. You have to process all 302's in the dialplan.

Set this on your sofia profile <param name="manual-redirect" value="true"/>


You can set these variables sip_redirect_profile, sip_redirect_context, sip_redirect_dialplan,


When a redirect happens you get these variables - sip_redirect_contact_%d, sip_redirected_to, sip_redirect_contact_user_%d, sip_redirect_contact_host_%d, sip_redirect_contact_params_%d, sip_redirect_dialstring_%d, sip_redirect_dialstring, sip_redirected_by


Then its up to you to process the redirect in your dialplan, If you don't set the sip_redirect_context then it'll default to redirected context and XML as the dialplan.


/b



On Aug 26, 2009, at 11:37 AM, Hristo Benev wrote:
Quote:
Hello

I followed the tutorial
http://wiki.freeswitch.org/wiki/SBC_Setup

I have following problem when I dial 1000 Kamalio reports 302, but freeswitch does not route

Where to look for problems?
Back to top
foxb at abv.bg
Guest





PostPosted: Wed Aug 26, 2009 2:07 pm    Post subject: [Freeswitch-users] freeswitch as SBC and kamailio - no route Reply with quote

I think that the problem is here:
-------------------------
2009-08-26 22:56:52.725878 [INFO] mod_dialplan_xml.c:315 Processing 1001->1000 in context ROUTING
Dialplan: sofia/internal/1001@209.71.254.33 parsing [ROUTING->PEER_01] continue=false
Dialplan: sofia/internal/1001@209.71.254.33 Regex (FAIL) [PEER_01] ${sip_h_X-ROUTE}(LOOKUP) =~ /PEER_01/ break=on-false
2009-08-26 22:56:52.728289 [INFO] switch_core_state_machine.c:136 No Route, Aborting
--------------------------

Actually Regex FAIL

I'm not familiar, but is this stating that ${sip_h_X-ROUTE} should be PEER_01 for success?
Here is my default.xml:
----------------
<?xml version="1.0" encoding="utf-8"?>
<!-- http://wiki.freeswitch.org/wiki/Dialplan_XML -->
<include>
<context name="default">

<extension name="LOOKUP_ROUTE">
<condition field="destination_number" expression="(\d+)$">
<action application="set" data="hangup_after_bridge=true"/>
<action application="set" data="continue_on_fail=true"/>
<action application="export" data="sip_h_X-ROUTE=LOOKUP"/>
<action application="bridge" data="sofia/internal/${destination_number}@127.0.0.1:5062"/>
<action application="set" data="ROUTE_GW=${sip_redirect_contact_user_0}"/>
<action application="set" data="AREA=${sip_redirect_contact_user_0}"/>
<action application="transfer" data="${destination_number} XML ROUTING"/>
</condition>
</extension>

</context>

<context name="ROUTING">

<extension name="PEER_01">
<condition field="${sip_h_X-ROUTE}" expression="PEER_01">
<action application="set" data="hangup_after_bridge=true"/>
<action application="set" data="continue_on_fail=NORMAL_TEMPORARY_FAILURE,TIMEOUT,NO_ROUTE_DESTINATION"/>
<action application="set" data="PEER=1.1.1.1"/>
<action application="bridge" data="sofia/external/${destination_number}@1.1.1.1"/>
<action application="set" data="PEER=2.2.2.2"/>
<action application="bridge" data="sofia/external/${destination_number}@2.2.2.2"/>
<action application="set" data="PEER=3.3.3.3"/>
<action application="bridge" data="sofia/external/${destination_number}@3.3.3.3"/>
</condition>
</extension>

</context>

</include>

--------------------------



Quote:
-------- Оригинално писмо --------
От: Brian West
Относно: Re: [Freeswitch-users] freeswitch as SBC and kamailio - no route
До: freeswitch-users@lists.freeswitch.org
Изпратено на: Сряда, 2009, Август 26 19:47:37 EEST

Quote:
We do not blindly follow 302's as that is a dangerous thing to do.
You have to process all 302's in the dialplan.
Set this on your sofia profile
You can set these variables sip_redirect_profile,
sip_redirect_context,
sip_redirect_dialplan,
When a redirect happens you get these variables - sip_redirect_contact_%d,
sip_redirected_to,
sip_redirect_contact_user_%d,
sip_redirect_contact_host_%d,
sip_redirect_contact_params_%d,
sip_redirect_dialstring_%d,
sip_redirect_dialstring,
sip_redirected_byThen its up to you to process the redirect in your dialplan, If you don't set the
sip_redirect_context then it'll default to redirected context and XML as the dialplan./bOn Aug 26, 2009, at 11:37 AM, Hristo Benev wrote:HelloI followed the tutorialhttp://wiki.freeswitch.org/wiki/SBC_SetupI have following problem when I dial 1000 Kamalio reports 302, but freeswitch does not routeWhere to look for problems?

_______________________________________________
FreeSWITCH-users mailing list
FreeSWITCH-users@lists.freeswitch.org
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org
Back to top
foxb at abv.bg
Guest





PostPosted: Wed Aug 26, 2009 4:10 pm    Post subject: [Freeswitch-users] freeswitch as SBC and kamailio - no route Reply with quote

It seems that the problem is on kamailio configuration.
Will ask on their list.

But to test i try to connect to my asterisk server and i receive 407 proxy authentication required.

I have it setup as friend in asterisk, but still ???

Any ideas?

Thanks,


Quote:
-------- Оригинално писмо --------
От: Hristo Benev
Относно: Re: [Freeswitch-users] freeswitch as SBC and kamailio - no route
До: freeswitch-users@lists.freeswitch.org
Изпратено на: Сряда, 2009, Август 26 22:02:13 EEST

Quote:
I think that the problem is here:
-------------------------
2009-08-26 22:56:52.725878 [INFO] mod_dialplan_xml.c:315 Processing 1001->1000 in context ROUTING
Dialplan: sofia/internal/1001@209.71.254.33 parsing [ROUTING->PEER_01] continue=false
Dialplan: sofia/internal/1001@209.71.254.33 Regex (FAIL) [PEER_01] ${sip_h_X-ROUTE}(LOOKUP) =~ /PEER_01/ break=on-false
2009-08-26 22:56:52.728289 [INFO] switch_core_state_machine.c:136 No Route, Aborting
--------------------------

Actually Regex FAIL

I'm not familiar, but is this stating that ${sip_h_X-ROUTE} should be PEER_01 for success?
Here is my default.xml:
----------------






































--------------------------



Quote:
-------- Оригинално писмо --------
От: Brian West
Относно: Re: [Freeswitch-users] freeswitch as SBC and kamailio - no route
До: freeswitch-users@lists.freeswitch.org
Изпратено на: Сряда, 2009, Август 26 19:47:37 EEST

Quote:
We do not blindly follow 302's as that is a dangerous thing to do.
You have to process all 302's in the dialplan.
Set this on your sofia profile
You can set these variables sip_redirect_profile,
sip_redirect_context,
sip_redirect_dialplan,
When a redirect happens you get these variables - sip_redirect_contact_%d,
sip_redirected_to,
sip_redirect_contact_user_%d,
sip_redirect_contact_host_%d,
sip_redirect_contact_params_%d,
sip_redirect_dialstring_%d,
sip_redirect_dialstring,
sip_redirected_byThen its up to you to process the redirect in your dialplan, If you don't set the
sip_redirect_context then it'll default to redirected context and XML as the dialplan./bOn Aug 26, 2009, at 11:37 AM, Hristo Benev wrote:HelloI followed the tutorialhttp://wiki.freeswitch.org/wiki/SBC_SetupI have following problem when I dial 1000 Kamalio reports 302, but freeswitch does not routeWhere to look for problems?

_______________________________________________
FreeSWITCH-users mailing list
FreeSWITCH-users@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@lists.freeswitch.org
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org
Back to top
kawarod at laposte.net
Guest





PostPosted: Thu Aug 27, 2009 1:47 am    Post subject: [Freeswitch-users] freeswitch as SBC and kamailio - no route Reply with quote

Hi Hristo,

I'm the author of this setup and wiki page. I did a lot of modifications
on this setup (alternative routing if failure essentially) but don't
have too much time to update the wiki.

May you please send me an ngrep trace when you call 1000:

ngrep -d any -nn -i '1000' port 5060 -W byline

I will check what's happening.
Do you have an entry for 1000 in your mysql database ?

regards,
rod

Hristo Benev a écrit :
Quote:

It seems that the problem is on kamailio configuration.
Will ask on their list.

But to test i try to connect to my asterisk server and i receive 407 proxy authentication required.

I have it setup as friend in asterisk, but still ???

Any ideas?

Thanks,


Quote:
-------- Оригинално писмо --------
От: Hristo Benev
Относно: Re: [Freeswitch-users] freeswitch as SBC and kamailio - no route
До: freeswitch-users@lists.freeswitch.org
Изпратено на: Сряда, 2009, Август 26 22:02:13 EEST

Quote:
I think that the problem is here:
-------------------------
2009-08-26 22:56:52.725878 [INFO] mod_dialplan_xml.c:315 Processing 1001->1000 in context ROUTING
Dialplan: sofia/internal/1001@209.71.254.33 parsing [ROUTING->PEER_01] continue=false
Dialplan: sofia/internal/1001@209.71.254.33 Regex (FAIL) [PEER_01] ${sip_h_X-ROUTE}(LOOKUP) =~ /PEER_01/ break=on-false
2009-08-26 22:56:52.728289 [INFO] switch_core_state_machine.c:136 No Route, Aborting
--------------------------

Actually Regex FAIL

I'm not familiar, but is this stating that ${sip_h_X-ROUTE} should be PEER_01 for success?
Here is my default.xml:
----------------






































--------------------------



Quote:
-------- Оригинално писмо --------
От: Brian West
Относно: Re: [Freeswitch-users] freeswitch as SBC and kamailio - no route
До: freeswitch-users@lists.freeswitch.org
Изпратено на: Сряда, 2009, Август 26 19:47:37 EEST

Quote:
We do not blindly follow 302's as that is a dangerous thing to do.
You have to process all 302's in the dialplan.
Set this on your sofia profile
You can set these variables sip_redirect_profile,
sip_redirect_context,
sip_redirect_dialplan,
When a redirect happens you get these variables - sip_redirect_contact_%d,
sip_redirected_to,
sip_redirect_contact_user_%d,
sip_redirect_contact_host_%d,
sip_redirect_contact_params_%d,
sip_redirect_dialstring_%d,
sip_redirect_dialstring,
sip_redirected_byThen its up to you to process the redirect in your dialplan, If you don't set the
sip_redirect_context then it'll default to redirected context and XML as the dialplan./bOn Aug 26, 2009, at 11:37 AM, Hristo Benev wrote:HelloI followed the tutorialhttp://wiki.freeswitch.org/wiki/SBC_SetupI have following problem when I dial 1000 Kamalio reports 302, but freeswitch does not routeWhere to look for problems?

_______________________________________________
FreeSWITCH-users mailing list
FreeSWITCH-users@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@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@lists.freeswitch.org
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org
Back to top
foxb at abv.bg
Guest





PostPosted: Thu Aug 27, 2009 7:12 am    Post subject: [Freeswitch-users] freeswitch as SBC and kamailio - no route Reply with quote

Bojnour,

I'll send a trace ASAP.

What I see is that SIP header does not get updated -> regex is not true then it does not go to the peer. (I assume that is coming from kamailio config)

I'm really interested to see the updates of the project.

Thank you for the good tutorial.

Hristo


Quote:
-------- Оригинално писмо --------
От: rod
Относно: Re: [Freeswitch-users] freeswitch as SBC and kamailio - no route
До: freeswitch-users@lists.freeswitch.org
Изпратено на: Четвъртък, 2009, Август 27 09:41:05 EEST

Quote:
Hi Hristo,

I'm the author of this setup and wiki page. I did a lot of modifications
on this setup (alternative routing if failure essentially) but don't
have too much time to update the wiki.

May you please send me an ngrep trace when you call 1000:

ngrep -d any -nn -i '1000' port 5060 -W byline

I will check what's happening.
Do you have an entry for 1000 in your mysql database ?

regards,
rod

Hristo Benev a écrit :
Quote:

It seems that the problem is on kamailio configuration.
Will ask on their list.

But to test i try to connect to my asterisk server and i receive 407 proxy authentication required.

I have it setup as friend in asterisk, but still ???

Any ideas?

Thanks,


Quote:
-------- Оригинално писмо --------
От: Hristo Benev
Относно: Re: [Freeswitch-users] freeswitch as SBC and kamailio - no route
До: freeswitch-users@lists.freeswitch.org
Изпратено на: Сряда, 2009, Август 26 22:02:13 EEST

Quote:
I think that the problem is here:
-------------------------
2009-08-26 22:56:52.725878 [INFO] mod_dialplan_xml.c:315 Processing 1001->1000 in context ROUTING
Dialplan: sofia/internal/1001@209.71.254.33 parsing [ROUTING->PEER_01] continue=false
Dialplan: sofia/internal/1001@209.71.254.33 Regex (FAIL) [PEER_01] ${sip_h_X-ROUTE}(LOOKUP) =~ /PEER_01/ break=on-false
2009-08-26 22:56:52.728289 [INFO] switch_core_state_machine.c:136 No Route, Aborting
--------------------------

Actually Regex FAIL

I'm not familiar, but is this stating that ${sip_h_X-ROUTE} should be PEER_01 for success?
Here is my default.xml:
----------------






































--------------------------



Quote:
-------- Оригинално писмо --------
От: Brian West
Относно: Re: [Freeswitch-users] freeswitch as SBC and kamailio - no route
До: freeswitch-users@lists.freeswitch.org
Изпратено на: Сряда, 2009, Август 26 19:47:37 EEST

Quote:
We do not blindly follow 302's as that is a dangerous thing to do.
You have to process all 302's in the dialplan.
Set this on your sofia profile
You can set these variables sip_redirect_profile,
sip_redirect_context,
sip_redirect_dialplan,
When a redirect happens you get these variables - sip_redirect_contact_%d,
sip_redirected_to,
sip_redirect_contact_user_%d,
sip_redirect_contact_host_%d,
sip_redirect_contact_params_%d,
sip_redirect_dialstring_%d,
sip_redirect_dialstring,
sip_redirected_byThen its up to you to process the redirect in your dialplan, If you don't set the
sip_redirect_context then it'll default to redirected context and XML as the dialplan./bOn Aug 26, 2009, at 11:37 AM, Hristo Benev wrote:HelloI followed the tutorialhttp://wiki.freeswitch.org/wiki/SBC_SetupI have following problem when I dial 1000 Kamalio reports 302, but freeswitch does not routeWhere to look for problems?

_______________________________________________
FreeSWITCH-users mailing list
FreeSWITCH-users@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@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@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@lists.freeswitch.org
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org
Back to top
foxb at abv.bg
Guest





PostPosted: Thu Aug 27, 2009 10:33 am    Post subject: [Freeswitch-users] freeswitch as SBC and kamailio - no route Reply with quote

I assume you asked for port 5062 since I do not have any traffic on 5060 (I have one IP and my internal sip port is 5090 and external 5080).

If you need additional info I'll provide it.

Here is trace:

ngrep -d any -nn -i '1000' port 5062 -W byline
interface: any
filter: (ip or ip6) and ( port 5062 )
match: 1000
#
U 10.10.10.10:5090 -> 127.0.0.1:5062
INVITE sip:1000@127.0.0.1:5062 SIP/2.0.
Via: SIP/2.0/UDP 10.10.10.10:5090;rport;branch=z9hG4bKtrDyU1US5X5tj.
Max-Forwards: 69.
From: "Extension 1001" <sip:1001@10.10.10.10>;tag=978g69jZaFpBD.
To: <sip:1000@127.0.0.1:5062>.
Call-ID: 7f0eff2d-0dbf-122d-bfb0-612c8433bc7c.
CSeq: 119574771 INVITE.
Contact: <sip:mod_sofia@10.10.10.10:5090>.
User-Agent: FreeSWITCH-mod_sofia/1.0.4-exported.
Allow: INVITE, ACK, BYE, CANCEL, OPTIONS, PRACK, MESSAGE, SUBSCRIBE, NOTIFY, REFER, UPDATE, REGISTER, INFO, PUBLISH.
Supported: timer, precondition, path, replaces.
Allow-Events: talk, presence, dialog, call-info, sla, include-session-description, presence.winfo, message-summary, refer.
Content-Type: application/sdp.
Content-Disposition: session.
Content-Length: 429.
X-ROUTE: LOOKUP.
Remote-Party-ID: "Extension 1001" <sip:1001@10.10.10.10>;party=calling;screen=yes;privacy=off.
.
v=0.
o=FreeSWITCH 1251355692 1251355693 IN IP4 10.10.10.10.
s=FreeSWITCH.
c=IN IP4 10.10.10.10.
t=0 0.
m=audio 30522 RTP/AVP 0 115 107 9 8 3 101 13.
a=rtpmap:0 PCMU/8000.
a=rtpmap:115 G7221/32000.
a=fmtp:115 bitrate=48000.
a=rtpmap:107 G7221/16000.
a=fmtp:107 bitrate=32000.
a=rtpmap:9 G722/8000.
a=rtpmap:8 PCMA/8000.
a=rtpmap:3 GSM/8000.
a=rtpmap:101 telephone-event/8000.
a=fmtp:101 0-16.
a=rtpmap:13 CN/8000.
a=ptime:20.

#
U 127.0.0.1:5062 -> 10.10.10.10:5090
SIP/2.0 302 PEER_01.
Via: SIP/2.0/UDP 10.10.10.10:5090;rport=5090;branch=z9hG4bKtrDyU1US5X5tj.
From: "Extension 1001" <sip:1001@10.10.10.10>;tag=978g69jZaFpBD.
To: <sip:1000@127.0.0.1:5062>;tag=458fb4012080e656b6742c09466dabcd.31c8.
Call-ID: 7f0eff2d-0dbf-122d-bfb0-612c8433bc7c.
CSeq: 119574771 INVITE.
Contact: sip:France@PEER_01.
Server: Kamailio (1.5.2-notls (i386/linux)).
Content-Length: 0.
.

#
U 10.10.10.10:5090 -> 127.0.0.1:5062
ACK sip:1000@127.0.0.1:5062 SIP/2.0.
Via: SIP/2.0/UDP 10.10.10.10:5090;rport;branch=z9hG4bKtrDyU1US5X5tj.
Max-Forwards: 69.
From: "Extension 1001" <sip:1001@10.10.10.10>;tag=978g69jZaFpBD.
To: <sip:1000@127.0.0.1:5062>;tag=458fb4012080e656b6742c09466dabcd.31c8.
Call-ID: 7f0eff2d-0dbf-122d-bfb0-612c8433bc7c.
CSeq: 119574771 ACK.
Content-Length: 0.
.





Quote:
-------- Оригинално писмо --------
От: Hristo Benev
Относно: Re: [Freeswitch-users] freeswitch as SBC and kamailio - no route
До: freeswitch-users@lists.freeswitch.org
Изпратено на: Четвъртък, 2009, Август 27 14:58:53 EEST

Quote:

Bojnour,

I'll send a trace ASAP.

What I see is that SIP header does not get updated -> regex is not true then it does not go to the peer. (I assume that is coming from kamailio config)

I'm really interested to see the updates of the project.

Thank you for the good tutorial.

Hristo


Quote:
-------- Оригинално писмо --------
От: rod
Относно: Re: [Freeswitch-users] freeswitch as SBC and kamailio - no route
До: freeswitch-users@lists.freeswitch.org
Изпратено на: Четвъртък, 2009, Август 27 09:41:05 EEST

Quote:
Hi Hristo,

I'm the author of this setup and wiki page. I did a lot of modifications
on this setup (alternative routing if failure essentially) but don't
have too much time to update the wiki.

May you please send me an ngrep trace when you call 1000:

ngrep -d any -nn -i '1000' port 5060 -W byline

I will check what's happening.
Do you have an entry for 1000 in your mysql database ?

regards,
rod

Hristo Benev a écrit :
Quote:

It seems that the problem is on kamailio configuration.
Will ask on their list.

But to test i try to connect to my asterisk server and i receive 407 proxy authentication required.

I have it setup as friend in asterisk, but still ???

Any ideas?

Thanks,


Quote:
-------- Оригинално писмо --------
От: Hristo Benev
Относно: Re: [Freeswitch-users] freeswitch as SBC and kamailio - no route
До: freeswitch-users@lists.freeswitch.org
Изпратено на: Сряда, 2009, Август 26 22:02:13 EEST

Quote:
I think that the problem is here:
-------------------------
2009-08-26 22:56:52.725878 [INFO] mod_dialplan_xml.c:315 Processing 1001->1000 in context ROUTING
Dialplan: sofia/internal/1001@209.71.254.33 parsing [ROUTING->PEER_01] continue=false
Dialplan: sofia/internal/1001@209.71.254.33 Regex (FAIL) [PEER_01] ${sip_h_X-ROUTE}(LOOKUP) =~ /PEER_01/ break=on-false
2009-08-26 22:56:52.728289 [INFO] switch_core_state_machine.c:136 No Route, Aborting
--------------------------

Actually Regex FAIL

I'm not familiar, but is this stating that ${sip_h_X-ROUTE} should be PEER_01 for success?
Here is my default.xml:
----------------






































--------------------------



Quote:
-------- Оригинално писмо --------
От: Brian West
Относно: Re: [Freeswitch-users] freeswitch as SBC and kamailio - no route
До: freeswitch-users@lists.freeswitch.org
Изпратено на: Сряда, 2009, Август 26 19:47:37 EEST

Quote:
We do not blindly follow 302's as that is a dangerous thing to do.
You have to process all 302's in the dialplan.
Set this on your sofia profile
You can set these variables sip_redirect_profile,
sip_redirect_context,
sip_redirect_dialplan,
When a redirect happens you get these variables - sip_redirect_contact_%d,
sip_redirected_to,
sip_redirect_contact_user_%d,
sip_redirect_contact_host_%d,
sip_redirect_contact_params_%d,
sip_redirect_dialstring_%d,
sip_redirect_dialstring,
sip_redirected_byThen its up to you to process the redirect in your dialplan, If you don't set the
sip_redirect_context then it'll default to redirected context and XML as the dialplan./bOn Aug 26, 2009, at 11:37 AM, Hristo Benev wrote:HelloI followed the tutorialhttp://wiki.freeswitch.org/wiki/SBC_SetupI have following problem when I dial 1000 Kamalio reports 302, but freeswitch does not routeWhere to look for problems?

_______________________________________________
FreeSWITCH-users mailing list
FreeSWITCH-users@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@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@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@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@lists.freeswitch.org
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org
Back to top
kawarod at laposte.net
Guest





PostPosted: Fri Aug 28, 2009 2:04 am    Post subject: [Freeswitch-users] freeswitch as SBC and kamailio - no route Reply with quote

Hello,

the trace seems good.
If you check the answer from Kamailio, you'll see that Kamailio answers
with "302 PEER_01".

As Michael Collins stated before, you can get the variable containing
"PEER_01", then this variable is stored in a custom variable.

In your dialplan, may you please add:

<action application="info"/>, just before the transfer line, eg:

<condition field="destination_number" expression="(\d+)$">
<action application="set" data="hangup_after_bridge=true"/>
<action application="set" data="continue_on_fail=true"/>
<action application="export" data="sip_h_X-ROUTE=LOOKUP"/>
<action application="bridge" data="sofia/internal/${destination_number}@127.0.0.1:5062"/>
<action application="set" data="ROUTE_GW=${sip_redirect_contact_user_0}"/>
<action application="set" data="AREA=${sip_redirect_contact_user_0}"/>
<action application="info"/>
<action application="transfer" data="${destination_number} XML ROUTING"/>
</condition>


Using application Info, you'll see on the console (or CDR) the list of
variables used for this call. You should see the content of
"${sip_redirect_contact_user_0}" that should contain the value
"PEER_01". Please check this and let me know.

For the new configuration file, no problem for sharing. But as I wrote
on the wiki page, I worked on this setup cause LCR module was not
available when I start working on FS, nor I'm a good programmer to write
a server side HTTP script (used by xml_curl) that could scale to my needs.

I enhanced a bit this configuration with support for fallback routing,
almost realtime graph (every minutes using www.cacti.net and some
functions in FS like limit_hash) of number of concurrent calls per AREA,
PEER...

Thanks for "the good tutorial", but don't forget the dev team who did
this great product ;-)

rod.


Hristo Benev a écrit :
Quote:
I assume you asked for port 5062 since I do not have any traffic on 5060 (I have one IP and my internal sip port is 5090 and external 5080).

If you need additional info I'll provide it.

Here is trace:

ngrep -d any -nn -i '1000' port 5062 -W byline
interface: any
filter: (ip or ip6) and ( port 5062 )
match: 1000
#
U 10.10.10.10:5090 -> 127.0.0.1:5062
INVITE sip:1000@127.0.0.1:5062 SIP/2.0.
Via: SIP/2.0/UDP 10.10.10.10:5090;rport;branch=z9hG4bKtrDyU1US5X5tj.
Max-Forwards: 69.
From: "Extension 1001" <sip:1001@10.10.10.10>;tag=978g69jZaFpBD.
To: <sip:1000@127.0.0.1:5062>.
Call-ID: 7f0eff2d-0dbf-122d-bfb0-612c8433bc7c.
CSeq: 119574771 INVITE.
Contact: <sip:mod_sofia@10.10.10.10:5090>.
User-Agent: FreeSWITCH-mod_sofia/1.0.4-exported.
Allow: INVITE, ACK, BYE, CANCEL, OPTIONS, PRACK, MESSAGE, SUBSCRIBE, NOTIFY, REFER, UPDATE, REGISTER, INFO, PUBLISH.
Supported: timer, precondition, path, replaces.
Allow-Events: talk, presence, dialog, call-info, sla, include-session-description, presence.winfo, message-summary, refer.
Content-Type: application/sdp.
Content-Disposition: session.
Content-Length: 429.
X-ROUTE: LOOKUP.
Remote-Party-ID: "Extension 1001" <sip:1001@10.10.10.10>;party=calling;screen=yes;privacy=off.
.
v=0.
o=FreeSWITCH 1251355692 1251355693 IN IP4 10.10.10.10.
s=FreeSWITCH.
c=IN IP4 10.10.10.10.
t=0 0.
m=audio 30522 RTP/AVP 0 115 107 9 8 3 101 13.
a=rtpmap:0 PCMU/8000.
a=rtpmap:115 G7221/32000.
a=fmtp:115 bitrate=48000.
a=rtpmap:107 G7221/16000.
a=fmtp:107 bitrate=32000.
a=rtpmap:9 G722/8000.
a=rtpmap:8 PCMA/8000.
a=rtpmap:3 GSM/8000.
a=rtpmap:101 telephone-event/8000.
a=fmtp:101 0-16.
a=rtpmap:13 CN/8000.
a=ptime:20.

#
U 127.0.0.1:5062 -> 10.10.10.10:5090
SIP/2.0 302 PEER_01.
Via: SIP/2.0/UDP 10.10.10.10:5090;rport=5090;branch=z9hG4bKtrDyU1US5X5tj.
From: "Extension 1001" <sip:1001@10.10.10.10>;tag=978g69jZaFpBD.
To: <sip:1000@127.0.0.1:5062>;tag=458fb4012080e656b6742c09466dabcd.31c8.
Call-ID: 7f0eff2d-0dbf-122d-bfb0-612c8433bc7c.
CSeq: 119574771 INVITE.
Contact: sip:France@PEER_01.
Server: Kamailio (1.5.2-notls (i386/linux)).
Content-Length: 0.
.

#
U 10.10.10.10:5090 -> 127.0.0.1:5062
ACK sip:1000@127.0.0.1:5062 SIP/2.0.
Via: SIP/2.0/UDP 10.10.10.10:5090;rport;branch=z9hG4bKtrDyU1US5X5tj.
Max-Forwards: 69.
From: "Extension 1001" <sip:1001@10.10.10.10>;tag=978g69jZaFpBD.
To: <sip:1000@127.0.0.1:5062>;tag=458fb4012080e656b6742c09466dabcd.31c8.
Call-ID: 7f0eff2d-0dbf-122d-bfb0-612c8433bc7c.
CSeq: 119574771 ACK.
Content-Length: 0.
.





Quote:
-------- Оригинално писмо --------
От: Hristo Benev
Относно: Re: [Freeswitch-users] freeswitch as SBC and kamailio - no route
До: freeswitch-users@lists.freeswitch.org
Изпратено на: Четвъртък, 2009, Август 27 14:58:53 EEST

Quote:

Bojnour,

I'll send a trace ASAP.

What I see is that SIP header does not get updated -> regex is not true then it does not go to the peer. (I assume that is coming from kamailio config)

I'm really interested to see the updates of the project.

Thank you for the good tutorial.

Hristo


Quote:
-------- Оригинално писмо --------
От: rod
Относно: Re: [Freeswitch-users] freeswitch as SBC and kamailio - no route
До: freeswitch-users@lists.freeswitch.org
Изпратено на: Четвъртък, 2009, Август 27 09:41:05 EEST

Quote:
Hi Hristo,

I'm the author of this setup and wiki page. I did a lot of modifications
on this setup (alternative routing if failure essentially) but don't
have too much time to update the wiki.

May you please send me an ngrep trace when you call 1000:

ngrep -d any -nn -i '1000' port 5060 -W byline

I will check what's happening.
Do you have an entry for 1000 in your mysql database ?

regards,
rod

Hristo Benev a écrit :
Quote:

It seems that the problem is on kamailio configuration.
Will ask on their list.

But to test i try to connect to my asterisk server and i receive 407 proxy authentication required.

I have it setup as friend in asterisk, but still ???

Any ideas?

Thanks,


Quote:
-------- Оригинално писмо --------
От: Hristo Benev
Относно: Re: [Freeswitch-users] freeswitch as SBC and kamailio - no route
До: freeswitch-users@lists.freeswitch.org
Изпратено на: Сряда, 2009, Август 26 22:02:13 EEST

Quote:
I think that the problem is here:
-------------------------
2009-08-26 22:56:52.725878 [INFO] mod_dialplan_xml.c:315 Processing 1001->1000 in context ROUTING
Dialplan: sofia/internal/1001@209.71.254.33 parsing [ROUTING->PEER_01] continue=false
Dialplan: sofia/internal/1001@209.71.254.33 Regex (FAIL) [PEER_01] ${sip_h_X-ROUTE}(LOOKUP) =~ /PEER_01/ break=on-false
2009-08-26 22:56:52.728289 [INFO] switch_core_state_machine.c:136 No Route, Aborting
--------------------------

Actually Regex FAIL

I'm not familiar, but is this stating that ${sip_h_X-ROUTE} should be PEER_01 for success?
Here is my default.xml:
----------------






































--------------------------



Quote:
-------- Оригинално писмо --------
От: Brian West
Относно: Re: [Freeswitch-users] freeswitch as SBC and kamailio - no route
До: freeswitch-users@lists.freeswitch.org
Изпратено на: Сряда, 2009, Август 26 19:47:37 EEST

Quote:
We do not blindly follow 302's as that is a dangerous thing to do.
You have to process all 302's in the dialplan.
Set this on your sofia profile
You can set these variables sip_redirect_profile,
sip_redirect_context,
sip_redirect_dialplan,
When a redirect happens you get these variables - sip_redirect_contact_%d,
sip_redirected_to,
sip_redirect_contact_user_%d,
sip_redirect_contact_host_%d,
sip_redirect_contact_params_%d,
sip_redirect_dialstring_%d,
sip_redirect_dialstring,
sip_redirected_byThen its up to you to process the redirect in your dialplan, If you don't set the
sip_redirect_context then it'll default to redirected context and XML as the dialplan./bOn Aug 26, 2009, at 11:37 AM, Hristo Benev wrote:HelloI followed the tutorialhttp://wiki.freeswitch.org/wiki/SBC_SetupI have following problem when I dial 1000 Kamalio reports 302, but freeswitch does not routeWhere to look for problems?

_______________________________________________
FreeSWITCH-users mailing list
FreeSWITCH-users@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@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@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@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@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@lists.freeswitch.org
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org
Back to top
foxb at abv.bg
Guest





PostPosted: Fri Aug 28, 2009 11:49 am    Post subject: [Freeswitch-users] freeswitch as SBC and kamailio - no route Reply with quote

Hello Rod,

I did the change.

Here is extract of console:
-----------------------------------------------------------------------------------------
variable_continue_on_fail: [true]
variable_sip_h_X-ROUTE: [LOOKUP]
variable_export_vars: [sip_h_X-ROUTE]
variable_signal_bond: [a66d089a-93ee-11de-ab7a-094dff0ede20]
variable_sip_redirect_contact_0: [sip:France@PEER_01]
variable_sip_redirected_to: [sip:France@PEER_01]
variable_sip_redirect_contact_user_0: [France] <-------------------------------------------
variable_sip_redirect_contact_host_0: [PEER_01]
variable_sip_redirect_dialstring_0: [sofia/internal/sip:France@PEER_01]
variable_sip_redirect_dialstring: [sofia/internal/sip:France@PEER_01]
variable_proto_specific_hangup_cause: [sip:503]
variable_sip_hangup_phrase: [DNS Error]
variable_originate_disposition: [NORMAL_TEMPORARY_FAILURE]
variable_ROUTE_GW: [France]
variable_AREA: [France]
variable_current_application: [info]
------------------------------------------------------------------------------------------
I have different value it is actually the description field as shown here:

--------------------------------
/opt/kamailio/sbin/kamctl cr show
cr carrier names
+----+---------+
| id | carrier |
+----+---------+
| 1 | default |
+----+---------+
cr domain names
+----+---------+
| id | domain |
+----+---------+
| 1 | default |
+----+---------+
cr routes
+----+---------+--------+-------------+-------+------+------+-------+--------------+----------------+----------------+-------------+
| id | carrier | domain | scan_prefix | flags | mask | prob | strip | rewrite_host | rewrite_prefix | rewrite_suffix | description |
+----+---------+--------+-------------+-------+------+------+-------+--------------+----------------+----------------+-------------+
| 1 | 1 | 1 | 1000 | 0 | 0 | 1 | 0 | PEER_01 | | | France |
+----+---------+--------+-------------+-------+------+------+-------+--------------+----------------+----------------+-------------+
-----------------------------------------

And here is what I have in kamailio:
-------------------------------------------------------------------------------------
####### Routing Logic ########


# main request routing logic

route{

if (!mf_process_maxfwd_header("10")) {
sl_send_reply("483","Too Many Hops");
exit;
}

t_check_trans();

if ($rU==NULL) {
# request with no Username in RURI
sl_send_reply("484","Address Incomplete");
exit;
}

# LOOKUP ROUTE TABLE WHEN ASKED BY HEADER: X-ROUTE:LOOKUP
if (is_method("INVITE") && $hdr(X-ROUTE)=="LOOKUP"){
if(!cr_route("default", "default", "$rU", "$rU", "call_id","$avp(s:route_desc)")){
#xlog("ROUTING FAILED: no route found for $rU");
sl_send_reply("604", "Unable to route this call");
exit;
} else {
xlog("LOOKUP FOUND: $rd $avp(s:route_desc)");
avp_pushto("$ru/username", "$avp(s:route_desc)");
sl_send_reply("302", "$rd");
exit;
}
}
}
----------------------------------------------------------------------------------

Another question...
In that part of FreeSwitch dialplan.xml

-----------------------------------
<context name="ROUTING">

<extension name="PEER_01">
<condition field="${sip_h_X-ROUTE}" expression="PEER_01">
<action application="set" data="hangup_after_bridge=true"/>

-----------------------------------

X-ROUTE maybe should be replaced with ROUTE_GW otherwise there is no way the regex is true.


As for thanks - for sure by default they are also for the developers of both apps.
I'm new in freeSwitch and/or Kamailio for now I'm still testing and learning so it will be nice to have something working to start with.



Quote:
-------- Оригинално писмо --------
От: rod
Относно: Re: [Freeswitch-users] freeswitch as SBC and kamailio - no route
До: freeswitch-users@lists.freeswitch.org
Изпратено на: Петък, 2009, Август 28 09:54:00 EEST

Quote:
Hello,

the trace seems good.
If you check the answer from Kamailio, you'll see that Kamailio answers
with "302 PEER_01".

As Michael Collins stated before, you can get the variable containing
"PEER_01", then this variable is stored in a custom variable.

In your dialplan, may you please add:

, just before the transfer line, eg:













Using application Info, you'll see on the console (or CDR) the list of
variables used for this call. You should see the content of
"${sip_redirect_contact_user_0}" that should contain the value
"PEER_01". Please check this and let me know.

For the new configuration file, no problem for sharing. But as I wrote
on the wiki page, I worked on this setup cause LCR module was not
available when I start working on FS, nor I'm a good programmer to write
a server side HTTP script (used by xml_curl) that could scale to my needs.

I enhanced a bit this configuration with support for fallback routing,
almost realtime graph (every minutes using www.cacti.net and some
functions in FS like limit_hash) of number of concurrent calls per AREA,
PEER...

Thanks for "the good tutorial", but don't forget the dev team who did
this great product ;-)

rod.


Hristo Benev a écrit :
Quote:
I assume you asked for port 5062 since I do not have any traffic on 5060 (I have one IP and my internal sip port is 5090 and external 5080).

If you need additional info I'll provide it.

Here is trace:

ngrep -d any -nn -i '1000' port 5062 -W byline
interface: any
filter: (ip or ip6) and ( port 5062 )
match: 1000
#
U 10.10.10.10:5090 -> 127.0.0.1:5062
INVITE sip:1000@127.0.0.1:5062 SIP/2.0.
Via: SIP/2.0/UDP 10.10.10.10:5090;rport;branch=z9hG4bKtrDyU1US5X5tj.
Max-Forwards: 69.
From: "Extension 1001" ;tag=978g69jZaFpBD.
To: .
Call-ID: 7f0eff2d-0dbf-122d-bfb0-612c8433bc7c.
CSeq: 119574771 INVITE.
Contact: .
User-Agent: FreeSWITCH-mod_sofia/1.0.4-exported.
Allow: INVITE, ACK, BYE, CANCEL, OPTIONS, PRACK, MESSAGE, SUBSCRIBE, NOTIFY, REFER, UPDATE, REGISTER, INFO, PUBLISH.
Supported: timer, precondition, path, replaces.
Allow-Events: talk, presence, dialog, call-info, sla, include-session-description, presence.winfo, message-summary, refer.
Content-Type: application/sdp.
Content-Disposition: session.
Content-Length: 429.
X-ROUTE: LOOKUP.
Remote-Party-ID: "Extension 1001" ;party=calling;screen=yes;privacy=off.
.
v=0.
o=FreeSWITCH 1251355692 1251355693 IN IP4 10.10.10.10.
s=FreeSWITCH.
c=IN IP4 10.10.10.10.
t=0 0.
m=audio 30522 RTP/AVP 0 115 107 9 8 3 101 13.
a=rtpmap:0 PCMU/8000.
a=rtpmap:115 G7221/32000.
a=fmtp:115 bitrate=48000.
a=rtpmap:107 G7221/16000.
a=fmtp:107 bitrate=32000.
a=rtpmap:9 G722/8000.
a=rtpmap:8 PCMA/8000.
a=rtpmap:3 GSM/8000.
a=rtpmap:101 telephone-event/8000.
a=fmtp:101 0-16.
a=rtpmap:13 CN/8000.
a=ptime:20.

#
U 127.0.0.1:5062 -> 10.10.10.10:5090
SIP/2.0 302 PEER_01.
Via: SIP/2.0/UDP 10.10.10.10:5090;rport=5090;branch=z9hG4bKtrDyU1US5X5tj.
From: "Extension 1001" ;tag=978g69jZaFpBD.
To: ;tag=458fb4012080e656b6742c09466dabcd.31c8.
Call-ID: 7f0eff2d-0dbf-122d-bfb0-612c8433bc7c.
CSeq: 119574771 INVITE.
Contact: sip:France@PEER_01.
Server: Kamailio (1.5.2-notls (i386/linux)).
Content-Length: 0.
.

#
U 10.10.10.10:5090 -> 127.0.0.1:5062
ACK sip:1000@127.0.0.1:5062 SIP/2.0.
Via: SIP/2.0/UDP 10.10.10.10:5090;rport;branch=z9hG4bKtrDyU1US5X5tj.
Max-Forwards: 69.
From: "Extension 1001" ;tag=978g69jZaFpBD.
To: ;tag=458fb4012080e656b6742c09466dabcd.31c8.
Call-ID: 7f0eff2d-0dbf-122d-bfb0-612c8433bc7c.
CSeq: 119574771 ACK.
Content-Length: 0.
.





Quote:
-------- Оригинално писмо --------
От: Hristo Benev
Относно: Re: [Freeswitch-users] freeswitch as SBC and kamailio - no route
До: freeswitch-users@lists.freeswitch.org
Изпратено на: Четвъртък, 2009, Август 27 14:58:53 EEST

Quote:

Bojnour,

I'll send a trace ASAP.

What I see is that SIP header does not get updated -> regex is not true then it does not go to the peer. (I assume that is coming from kamailio config)

I'm really interested to see the updates of the project.

Thank you for the good tutorial.

Hristo


Quote:
-------- Оригинално писмо --------
От: rod
Относно: Re: [Freeswitch-users] freeswitch as SBC and kamailio - no route
До: freeswitch-users@lists.freeswitch.org
Изпратено на: Четвъртък, 2009, Август 27 09:41:05 EEST

Quote:
Hi Hristo,

I'm the author of this setup and wiki page. I did a lot of modifications
on this setup (alternative routing if failure essentially) but don't
have too much time to update the wiki.

May you please send me an ngrep trace when you call 1000:

ngrep -d any -nn -i '1000' port 5060 -W byline

I will check what's happening.
Do you have an entry for 1000 in your mysql database ?

regards,
rod

Hristo Benev a écrit :
Quote:

It seems that the problem is on kamailio configuration.
Will ask on their list.

But to test i try to connect to my asterisk server and i receive 407 proxy authentication required.

I have it setup as friend in asterisk, but still ???

Any ideas?

Thanks,


Quote:
-------- Оригинално писмо --------
От: Hristo Benev
Относно: Re: [Freeswitch-users] freeswitch as SBC and kamailio - no route
До: freeswitch-users@lists.freeswitch.org
Изпратено на: Сряда, 2009, Август 26 22:02:13 EEST

Quote:
I think that the problem is here:
-------------------------
2009-08-26 22:56:52.725878 [INFO] mod_dialplan_xml.c:315 Processing 1001->1000 in context ROUTING
Dialplan: sofia/internal/1001@209.71.254.33 parsing [ROUTING->PEER_01] continue=false
Dialplan: sofia/internal/1001@209.71.254.33 Regex (FAIL) [PEER_01] ${sip_h_X-ROUTE}(LOOKUP) =~ /PEER_01/ break=on-false
2009-08-26 22:56:52.728289 [INFO] switch_core_state_machine.c:136 No Route, Aborting
--------------------------

Actually Regex FAIL

I'm not familiar, but is this stating that ${sip_h_X-ROUTE} should be PEER_01 for success?
Here is my default.xml:
----------------






































--------------------------



Quote:
-------- Оригинално писмо --------
От: Brian West
Относно: Re: [Freeswitch-users] freeswitch as SBC and kamailio - no route
До: freeswitch-users@lists.freeswitch.org
Изпратено на: Сряда, 2009, Август 26 19:47:37 EEST

Quote:
We do not blindly follow 302's as that is a dangerous thing to do.
You have to process all 302's in the dialplan.
Set this on your sofia profile
You can set these variables sip_redirect_profile,
sip_redirect_context,
sip_redirect_dialplan,
When a redirect happens you get these variables - sip_redirect_contact_%d,
sip_redirected_to,
sip_redirect_contact_user_%d,
sip_redirect_contact_host_%d,
sip_redirect_contact_params_%d,
sip_redirect_dialstring_%d,
sip_redirect_dialstring,
sip_redirected_byThen its up to you to process the redirect in your dialplan, If you don't set the
sip_redirect_context then it'll default to redirected context and XML as the dialplan./bOn Aug 26, 2009, at 11:37 AM, Hristo Benev wrote:HelloI followed the tutorialhttp://wiki.freeswitch.org/wiki/SBC_SetupI have following problem when I dial 1000 Kamalio reports 302, but freeswitch does not routeWhere to look for problems?

_______________________________________________
FreeSWITCH-users mailing list
FreeSWITCH-users@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@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@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@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@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@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@lists.freeswitch.org
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org
Back to top
brian at freeswitch.org
Guest





PostPosted: Fri Aug 28, 2009 12:50 pm    Post subject: [Freeswitch-users] freeswitch as SBC and kamailio - no route Reply with quote

Now you have to actually catch this in your dialplan on FreeSWITCH and
execute the bridge application to the dialstring provided

/b

On Aug 28, 2009, at 11:42 AM, Hristo Benev wrote:

Quote:
variable_sip_redirect_dialstring_0: [sofia/internal/
sip:France@PEER_01]
variable_sip_redirect_dialstring: [sofia/internal/sip:France@PEER_01]


_______________________________________________
FreeSWITCH-users mailing list
FreeSWITCH-users@lists.freeswitch.org
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org
Back to top
kawarod at laposte.net
Guest





PostPosted: Sat Aug 29, 2009 12:52 am    Post subject: [Freeswitch-users] freeswitch as SBC and kamailio - no route Reply with quote

Ok,

I found what's happening. I probably did some change on the wiki to
start reflect the new configuration, without having time enough to check
the configuration. There is a mistake in your dialplan configuration.
You should put this instead:

wrong line:

<action application="set" data="ROUTE_GW=${sip_redirect_contact_user_0}"/>

please correct with:
<action application="set" data="ROUTE_GW=${sip_redirect_contact_host_0}"/>


This should match PEER_01 in dialplan instead of trying matching
France@PEER_01.

Let me know if this is right now.

rod

Hristo Benev a écrit :
Quote:
Hello Rod,

I did the change.

Here is extract of console:
-----------------------------------------------------------------------------------------
variable_continue_on_fail: [true]
variable_sip_h_X-ROUTE: [LOOKUP]
variable_export_vars: [sip_h_X-ROUTE]
variable_signal_bond: [a66d089a-93ee-11de-ab7a-094dff0ede20]
variable_sip_redirect_contact_0: [sip:France@PEER_01]
variable_sip_redirected_to: [sip:France@PEER_01]
variable_sip_redirect_contact_user_0: [France] <-------------------------------------------
variable_sip_redirect_contact_host_0: [PEER_01]
variable_sip_redirect_dialstring_0: [sofia/internal/sip:France@PEER_01]
variable_sip_redirect_dialstring: [sofia/internal/sip:France@PEER_01]
variable_proto_specific_hangup_cause: [sip:503]
variable_sip_hangup_phrase: [DNS Error]
variable_originate_disposition: [NORMAL_TEMPORARY_FAILURE]
variable_ROUTE_GW: [France]
variable_AREA: [France]
variable_current_application: [info]
------------------------------------------------------------------------------------------
I have different value it is actually the description field as shown here:

--------------------------------
/opt/kamailio/sbin/kamctl cr show
cr carrier names
+----+---------+
| id | carrier |
+----+---------+
| 1 | default |
+----+---------+
cr domain names
+----+---------+
| id | domain |
+----+---------+
| 1 | default |
+----+---------+
cr routes
+----+---------+--------+-------------+-------+------+------+-------+--------------+----------------+----------------+-------------+
| id | carrier | domain | scan_prefix | flags | mask | prob | strip | rewrite_host | rewrite_prefix | rewrite_suffix | description |
+----+---------+--------+-------------+-------+------+------+-------+--------------+----------------+----------------+-------------+
| 1 | 1 | 1 | 1000 | 0 | 0 | 1 | 0 | PEER_01 | | | France |
+----+---------+--------+-------------+-------+------+------+-------+--------------+----------------+----------------+-------------+
-----------------------------------------

And here is what I have in kamailio:
-------------------------------------------------------------------------------------
####### Routing Logic ########


# main request routing logic

route{

if (!mf_process_maxfwd_header("10")) {
sl_send_reply("483","Too Many Hops");
exit;
}

t_check_trans();

if ($rU==NULL) {
# request with no Username in RURI
sl_send_reply("484","Address Incomplete");
exit;
}

# LOOKUP ROUTE TABLE WHEN ASKED BY HEADER: X-ROUTE:LOOKUP
if (is_method("INVITE") && $hdr(X-ROUTE)=="LOOKUP"){
if(!cr_route("default", "default", "$rU", "$rU", "call_id","$avp(s:route_desc)")){
#xlog("ROUTING FAILED: no route found for $rU");
sl_send_reply("604", "Unable to route this call");
exit;
} else {
xlog("LOOKUP FOUND: $rd $avp(s:route_desc)");
avp_pushto("$ru/username", "$avp(s:route_desc)");
sl_send_reply("302", "$rd");
exit;
}
}
}
----------------------------------------------------------------------------------

Another question...
In that part of FreeSwitch dialplan.xml

-----------------------------------
<context name="ROUTING">

<extension name="PEER_01">
<condition field="${sip_h_X-ROUTE}" expression="PEER_01">
<action application="set" data="hangup_after_bridge=true"/>

-----------------------------------

X-ROUTE maybe should be replaced with ROUTE_GW otherwise there is no way the regex is true.


As for thanks - for sure by default they are also for the developers of both apps.
I'm new in freeSwitch and/or Kamailio for now I'm still testing and learning so it will be nice to have something working to start with.



Quote:
-------- Оригинално писмо --------
От: rod
Относно: Re: [Freeswitch-users] freeswitch as SBC and kamailio - no route
До: freeswitch-users@lists.freeswitch.org
Изпратено на: Петък, 2009, Август 28 09:54:00 EEST

Quote:
Hello,

the trace seems good.
If you check the answer from Kamailio, you'll see that Kamailio answers
with "302 PEER_01".

As Michael Collins stated before, you can get the variable containing
"PEER_01", then this variable is stored in a custom variable.

In your dialplan, may you please add:

, just before the transfer line, eg:













Using application Info, you'll see on the console (or CDR) the list of
variables used for this call. You should see the content of
"${sip_redirect_contact_user_0}" that should contain the value
"PEER_01". Please check this and let me know.

For the new configuration file, no problem for sharing. But as I wrote
on the wiki page, I worked on this setup cause LCR module was not
available when I start working on FS, nor I'm a good programmer to write
a server side HTTP script (used by xml_curl) that could scale to my needs.

I enhanced a bit this configuration with support for fallback routing,
almost realtime graph (every minutes using www.cacti.net and some
functions in FS like limit_hash) of number of concurrent calls per AREA,
PEER...

Thanks for "the good tutorial", but don't forget the dev team who did
this great product ;-)

rod.


Hristo Benev a écrit :
Quote:
I assume you asked for port 5062 since I do not have any traffic on 5060 (I have one IP and my internal sip port is 5090 and external 5080).

If you need additional info I'll provide it.

Here is trace:

ngrep -d any -nn -i '1000' port 5062 -W byline
interface: any
filter: (ip or ip6) and ( port 5062 )
match: 1000
#
U 10.10.10.10:5090 -> 127.0.0.1:5062
INVITE sip:1000@127.0.0.1:5062 SIP/2.0.
Via: SIP/2.0/UDP 10.10.10.10:5090;rport;branch=z9hG4bKtrDyU1US5X5tj.
Max-Forwards: 69.
From: "Extension 1001" ;tag=978g69jZaFpBD.
To: .
Call-ID: 7f0eff2d-0dbf-122d-bfb0-612c8433bc7c.
CSeq: 119574771 INVITE.
Contact: .
User-Agent: FreeSWITCH-mod_sofia/1.0.4-exported.
Allow: INVITE, ACK, BYE, CANCEL, OPTIONS, PRACK, MESSAGE, SUBSCRIBE, NOTIFY, REFER, UPDATE, REGISTER, INFO, PUBLISH.
Supported: timer, precondition, path, replaces.
Allow-Events: talk, presence, dialog, call-info, sla, include-session-description, presence.winfo, message-summary, refer.
Content-Type: application/sdp.
Content-Disposition: session.
Content-Length: 429.
X-ROUTE: LOOKUP.
Remote-Party-ID: "Extension 1001" ;party=calling;screen=yes;privacy=off.
.
v=0.
o=FreeSWITCH 1251355692 1251355693 IN IP4 10.10.10.10.
s=FreeSWITCH.
c=IN IP4 10.10.10.10.
t=0 0.
m=audio 30522 RTP/AVP 0 115 107 9 8 3 101 13.
a=rtpmap:0 PCMU/8000.
a=rtpmap:115 G7221/32000.
a=fmtp:115 bitrate=48000.
a=rtpmap:107 G7221/16000.
a=fmtp:107 bitrate=32000.
a=rtpmap:9 G722/8000.
a=rtpmap:8 PCMA/8000.
a=rtpmap:3 GSM/8000.
a=rtpmap:101 telephone-event/8000.
a=fmtp:101 0-16.
a=rtpmap:13 CN/8000.
a=ptime:20.

#
U 127.0.0.1:5062 -> 10.10.10.10:5090
SIP/2.0 302 PEER_01.
Via: SIP/2.0/UDP 10.10.10.10:5090;rport=5090;branch=z9hG4bKtrDyU1US5X5tj.
From: "Extension 1001" ;tag=978g69jZaFpBD.
To: ;tag=458fb4012080e656b6742c09466dabcd.31c8.
Call-ID: 7f0eff2d-0dbf-122d-bfb0-612c8433bc7c.
CSeq: 119574771 INVITE.
Contact: sip:France@PEER_01.
Server: Kamailio (1.5.2-notls (i386/linux)).
Content-Length: 0.
.

#
U 10.10.10.10:5090 -> 127.0.0.1:5062
ACK sip:1000@127.0.0.1:5062 SIP/2.0.
Via: SIP/2.0/UDP 10.10.10.10:5090;rport;branch=z9hG4bKtrDyU1US5X5tj.
Max-Forwards: 69.
From: "Extension 1001" ;tag=978g69jZaFpBD.
To: ;tag=458fb4012080e656b6742c09466dabcd.31c8.
Call-ID: 7f0eff2d-0dbf-122d-bfb0-612c8433bc7c.
CSeq: 119574771 ACK.
Content-Length: 0.
.





Quote:
-------- Оригинално писмо --------
От: Hristo Benev
Относно: Re: [Freeswitch-users] freeswitch as SBC and kamailio - no route
До: freeswitch-users@lists.freeswitch.org
Изпратено на: Четвъртък, 2009, Август 27 14:58:53 EEST

Quote:

Bojnour,

I'll send a trace ASAP.

What I see is that SIP header does not get updated -> regex is not true then it does not go to the peer. (I assume that is coming from kamailio config)

I'm really interested to see the updates of the project.

Thank you for the good tutorial.

Hristo


Quote:
-------- Оригинално писмо --------
От: rod
Относно: Re: [Freeswitch-users] freeswitch as SBC and kamailio - no route
До: freeswitch-users@lists.freeswitch.org
Изпратено на: Четвъртък, 2009, Август 27 09:41:05 EEST

Quote:
Hi Hristo,

I'm the author of this setup and wiki page. I did a lot of modifications
on this setup (alternative routing if failure essentially) but don't
have too much time to update the wiki.

May you please send me an ngrep trace when you call 1000:

ngrep -d any -nn -i '1000' port 5060 -W byline

I will check what's happening.
Do you have an entry for 1000 in your mysql database ?

regards,
rod

Hristo Benev a écrit :
Quote:

It seems that the problem is on kamailio configuration.
Will ask on their list.

But to test i try to connect to my asterisk server and i receive 407 proxy authentication required.

I have it setup as friend in asterisk, but still ???

Any ideas?

Thanks,


Quote:
-------- Оригинално писмо --------
От: Hristo Benev
Относно: Re: [Freeswitch-users] freeswitch as SBC and kamailio - no route
До: freeswitch-users@lists.freeswitch.org
Изпратено на: Сряда, 2009, Август 26 22:02:13 EEST

Quote:
I think that the problem is here:
-------------------------
2009-08-26 22:56:52.725878 [INFO] mod_dialplan_xml.c:315 Processing 1001->1000 in context ROUTING
Dialplan: sofia/internal/1001@209.71.254.33 parsing [ROUTING->PEER_01] continue=false
Dialplan: sofia/internal/1001@209.71.254.33 Regex (FAIL) [PEER_01] ${sip_h_X-ROUTE}(LOOKUP) =~ /PEER_01/ break=on-false
2009-08-26 22:56:52.728289 [INFO] switch_core_state_machine.c:136 No Route, Aborting
--------------------------

Actually Regex FAIL

I'm not familiar, but is this stating that ${sip_h_X-ROUTE} should be PEER_01 for success?
Here is my default.xml:
----------------






































--------------------------



Quote:
-------- Оригинално писмо --------
От: Brian West
Относно: Re: [Freeswitch-users] freeswitch as SBC and kamailio - no route
До: freeswitch-users@lists.freeswitch.org
Изпратено на: Сряда, 2009, Август 26 19:47:37 EEST

Quote:
We do not blindly follow 302's as that is a dangerous thing to do.
You have to process all 302's in the dialplan.
Set this on your sofia profile
You can set these variables sip_redirect_profile,
sip_redirect_context,
sip_redirect_dialplan,
When a redirect happens you get these variables - sip_redirect_contact_%d,
sip_redirected_to,
sip_redirect_contact_user_%d,
sip_redirect_contact_host_%d,
sip_redirect_contact_params_%d,
sip_redirect_dialstring_%d,
sip_redirect_dialstring,
sip_redirected_byThen its up to you to process the redirect in your dialplan, If you don't set the
sip_redirect_context then it'll default to redirected context and XML as the dialplan./bOn Aug 26, 2009, at 11:37 AM, Hristo Benev wrote:HelloI followed the tutorialhttp://wiki.freeswitch.org/wiki/SBC_SetupI have following problem when I dial 1000 Kamalio reports 302, but freeswitch does not routeWhere to look for problems?

_______________________________________________
FreeSWITCH-users mailing list
FreeSWITCH-users@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@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@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@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@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@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@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@lists.freeswitch.org
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org
Back to top
kawarod at laposte.net
Guest





PostPosted: Sat Aug 29, 2009 1:02 am    Post subject: [Freeswitch-users] freeswitch as SBC and kamailio - no route Reply with quote

you are right for the regex. This is part of an old setup, correct with:

<extension name="PEER_01">
<condition field="${ROUTE_GW}" expression="PEER_01">
<action application="set" data="hangup_after_bridge=true"/>



Hristo Benev a écrit :
Quote:
Hello Rod,

I did the change.

Here is extract of console:
-----------------------------------------------------------------------------------------
variable_continue_on_fail: [true]
variable_sip_h_X-ROUTE: [LOOKUP]
variable_export_vars: [sip_h_X-ROUTE]
variable_signal_bond: [a66d089a-93ee-11de-ab7a-094dff0ede20]
variable_sip_redirect_contact_0: [sip:France@PEER_01]
variable_sip_redirected_to: [sip:France@PEER_01]
variable_sip_redirect_contact_user_0: [France] <-------------------------------------------
variable_sip_redirect_contact_host_0: [PEER_01]
variable_sip_redirect_dialstring_0: [sofia/internal/sip:France@PEER_01]
variable_sip_redirect_dialstring: [sofia/internal/sip:France@PEER_01]
variable_proto_specific_hangup_cause: [sip:503]
variable_sip_hangup_phrase: [DNS Error]
variable_originate_disposition: [NORMAL_TEMPORARY_FAILURE]
variable_ROUTE_GW: [France]
variable_AREA: [France]
variable_current_application: [info]
------------------------------------------------------------------------------------------
I have different value it is actually the description field as shown here:

--------------------------------
/opt/kamailio/sbin/kamctl cr show
cr carrier names
+----+---------+
| id | carrier |
+----+---------+
| 1 | default |
+----+---------+
cr domain names
+----+---------+
| id | domain |
+----+---------+
| 1 | default |
+----+---------+
cr routes
+----+---------+--------+-------------+-------+------+------+-------+--------------+----------------+----------------+-------------+
| id | carrier | domain | scan_prefix | flags | mask | prob | strip | rewrite_host | rewrite_prefix | rewrite_suffix | description |
+----+---------+--------+-------------+-------+------+------+-------+--------------+----------------+----------------+-------------+
| 1 | 1 | 1 | 1000 | 0 | 0 | 1 | 0 | PEER_01 | | | France |
+----+---------+--------+-------------+-------+------+------+-------+--------------+----------------+----------------+-------------+
-----------------------------------------

And here is what I have in kamailio:
-------------------------------------------------------------------------------------
####### Routing Logic ########


# main request routing logic

route{

if (!mf_process_maxfwd_header("10")) {
sl_send_reply("483","Too Many Hops");
exit;
}

t_check_trans();

if ($rU==NULL) {
# request with no Username in RURI
sl_send_reply("484","Address Incomplete");
exit;
}

# LOOKUP ROUTE TABLE WHEN ASKED BY HEADER: X-ROUTE:LOOKUP
if (is_method("INVITE") && $hdr(X-ROUTE)=="LOOKUP"){
if(!cr_route("default", "default", "$rU", "$rU", "call_id","$avp(s:route_desc)")){
#xlog("ROUTING FAILED: no route found for $rU");
sl_send_reply("604", "Unable to route this call");
exit;
} else {
xlog("LOOKUP FOUND: $rd $avp(s:route_desc)");
avp_pushto("$ru/username", "$avp(s:route_desc)");
sl_send_reply("302", "$rd");
exit;
}
}
}
----------------------------------------------------------------------------------

Another question...
In that part of FreeSwitch dialplan.xml

-----------------------------------
<context name="ROUTING">

<extension name="PEER_01">
<condition field="${sip_h_X-ROUTE}" expression="PEER_01">
<action application="set" data="hangup_after_bridge=true"/>

-----------------------------------

X-ROUTE maybe should be replaced with ROUTE_GW otherwise there is no way the regex is true.


As for thanks - for sure by default they are also for the developers of both apps.
I'm new in freeSwitch and/or Kamailio for now I'm still testing and learning so it will be nice to have something working to start with.



Quote:
-------- Оригинално писмо --------
От: rod
Относно: Re: [Freeswitch-users] freeswitch as SBC and kamailio - no route
До: freeswitch-users@lists.freeswitch.org
Изпратено на: Петък, 2009, Август 28 09:54:00 EEST

Quote:
Hello,

the trace seems good.
If you check the answer from Kamailio, you'll see that Kamailio answers
with "302 PEER_01".

As Michael Collins stated before, you can get the variable containing
"PEER_01", then this variable is stored in a custom variable.

In your dialplan, may you please add:

, just before the transfer line, eg:













Using application Info, you'll see on the console (or CDR) the list of
variables used for this call. You should see the content of
"${sip_redirect_contact_user_0}" that should contain the value
"PEER_01". Please check this and let me know.

For the new configuration file, no problem for sharing. But as I wrote
on the wiki page, I worked on this setup cause LCR module was not
available when I start working on FS, nor I'm a good programmer to write
a server side HTTP script (used by xml_curl) that could scale to my needs.

I enhanced a bit this configuration with support for fallback routing,
almost realtime graph (every minutes using www.cacti.net and some
functions in FS like limit_hash) of number of concurrent calls per AREA,
PEER...

Thanks for "the good tutorial", but don't forget the dev team who did
this great product ;-)

rod.


Hristo Benev a écrit :
Quote:
I assume you asked for port 5062 since I do not have any traffic on 5060 (I have one IP and my internal sip port is 5090 and external 5080).

If you need additional info I'll provide it.

Here is trace:

ngrep -d any -nn -i '1000' port 5062 -W byline
interface: any
filter: (ip or ip6) and ( port 5062 )
match: 1000
#
U 10.10.10.10:5090 -> 127.0.0.1:5062
INVITE sip:1000@127.0.0.1:5062 SIP/2.0.
Via: SIP/2.0/UDP 10.10.10.10:5090;rport;branch=z9hG4bKtrDyU1US5X5tj.
Max-Forwards: 69.
From: "Extension 1001" ;tag=978g69jZaFpBD.
To: .
Call-ID: 7f0eff2d-0dbf-122d-bfb0-612c8433bc7c.
CSeq: 119574771 INVITE.
Contact: .
User-Agent: FreeSWITCH-mod_sofia/1.0.4-exported.
Allow: INVITE, ACK, BYE, CANCEL, OPTIONS, PRACK, MESSAGE, SUBSCRIBE, NOTIFY, REFER, UPDATE, REGISTER, INFO, PUBLISH.
Supported: timer, precondition, path, replaces.
Allow-Events: talk, presence, dialog, call-info, sla, include-session-description, presence.winfo, message-summary, refer.
Content-Type: application/sdp.
Content-Disposition: session.
Content-Length: 429.
X-ROUTE: LOOKUP.
Remote-Party-ID: "Extension 1001" ;party=calling;screen=yes;privacy=off.
.
v=0.
o=FreeSWITCH 1251355692 1251355693 IN IP4 10.10.10.10.
s=FreeSWITCH.
c=IN IP4 10.10.10.10.
t=0 0.
m=audio 30522 RTP/AVP 0 115 107 9 8 3 101 13.
a=rtpmap:0 PCMU/8000.
a=rtpmap:115 G7221/32000.
a=fmtp:115 bitrate=48000.
a=rtpmap:107 G7221/16000.
a=fmtp:107 bitrate=32000.
a=rtpmap:9 G722/8000.
a=rtpmap:8 PCMA/8000.
a=rtpmap:3 GSM/8000.
a=rtpmap:101 telephone-event/8000.
a=fmtp:101 0-16.
a=rtpmap:13 CN/8000.
a=ptime:20.

#
U 127.0.0.1:5062 -> 10.10.10.10:5090
SIP/2.0 302 PEER_01.
Via: SIP/2.0/UDP 10.10.10.10:5090;rport=5090;branch=z9hG4bKtrDyU1US5X5tj.
From: "Extension 1001" ;tag=978g69jZaFpBD.
To: ;tag=458fb4012080e656b6742c09466dabcd.31c8.
Call-ID: 7f0eff2d-0dbf-122d-bfb0-612c8433bc7c.
CSeq: 119574771 INVITE.
Contact: sip:France@PEER_01.
Server: Kamailio (1.5.2-notls (i386/linux)).
Content-Length: 0.
.

#
U 10.10.10.10:5090 -> 127.0.0.1:5062
ACK sip:1000@127.0.0.1:5062 SIP/2.0.
Via: SIP/2.0/UDP 10.10.10.10:5090;rport;branch=z9hG4bKtrDyU1US5X5tj.
Max-Forwards: 69.
From: "Extension 1001" ;tag=978g69jZaFpBD.
To: ;tag=458fb4012080e656b6742c09466dabcd.31c8.
Call-ID: 7f0eff2d-0dbf-122d-bfb0-612c8433bc7c.
CSeq: 119574771 ACK.
Content-Length: 0.
.





Quote:
-------- Оригинално писмо --------
От: Hristo Benev
Относно: Re: [Freeswitch-users] freeswitch as SBC and kamailio - no route
До: freeswitch-users@lists.freeswitch.org
Изпратено на: Четвъртък, 2009, Август 27 14:58:53 EEST

Quote:

Bojnour,

I'll send a trace ASAP.

What I see is that SIP header does not get updated -> regex is not true then it does not go to the peer. (I assume that is coming from kamailio config)

I'm really interested to see the updates of the project.

Thank you for the good tutorial.

Hristo


Quote:
-------- Оригинално писмо --------
От: rod
Относно: Re: [Freeswitch-users] freeswitch as SBC and kamailio - no route
До: freeswitch-users@lists.freeswitch.org
Изпратено на: Четвъртък, 2009, Август 27 09:41:05 EEST

Quote:
Hi Hristo,

I'm the author of this setup and wiki page. I did a lot of modifications
on this setup (alternative routing if failure essentially) but don't
have too much time to update the wiki.

May you please send me an ngrep trace when you call 1000:

ngrep -d any -nn -i '1000' port 5060 -W byline

I will check what's happening.
Do you have an entry for 1000 in your mysql database ?

regards,
rod

Hristo Benev a écrit :
Quote:

It seems that the problem is on kamailio configuration.
Will ask on their list.

But to test i try to connect to my asterisk server and i receive 407 proxy authentication required.

I have it setup as friend in asterisk, but still ???

Any ideas?

Thanks,


Quote:
-------- Оригинално писмо --------
От: Hristo Benev
Относно: Re: [Freeswitch-users] freeswitch as SBC and kamailio - no route
До: freeswitch-users@lists.freeswitch.org
Изпратено на: Сряда, 2009, Август 26 22:02:13 EEST

Quote:
I think that the problem is here:
-------------------------
2009-08-26 22:56:52.725878 [INFO] mod_dialplan_xml.c:315 Processing 1001->1000 in context ROUTING
Dialplan: sofia/internal/1001@209.71.254.33 parsing [ROUTING->PEER_01] continue=false
Dialplan: sofia/internal/1001@209.71.254.33 Regex (FAIL) [PEER_01] ${sip_h_X-ROUTE}(LOOKUP) =~ /PEER_01/ break=on-false
2009-08-26 22:56:52.728289 [INFO] switch_core_state_machine.c:136 No Route, Aborting
--------------------------

Actually Regex FAIL

I'm not familiar, but is this stating that ${sip_h_X-ROUTE} should be PEER_01 for success?
Here is my default.xml:
----------------






































--------------------------



Quote:
-------- Оригинално писмо --------
От: Brian West
Относно: Re: [Freeswitch-users] freeswitch as SBC and kamailio - no route
До: freeswitch-users@lists.freeswitch.org
Изпратено на: Сряда, 2009, Август 26 19:47:37 EEST

Quote:
We do not blindly follow 302's as that is a dangerous thing to do.
You have to process all 302's in the dialplan.
Set this on your sofia profile
You can set these variables sip_redirect_profile,
sip_redirect_context,
sip_redirect_dialplan,
When a redirect happens you get these variables - sip_redirect_contact_%d,
sip_redirected_to,
sip_redirect_contact_user_%d,
sip_redirect_contact_host_%d,
sip_redirect_contact_params_%d,
sip_redirect_dialstring_%d,
sip_redirect_dialstring,
sip_redirected_byThen its up to you to process the redirect in your dialplan, If you don't set the
sip_redirect_context then it'll default to redirected context and XML as the dialplan./bOn Aug 26, 2009, at 11:37 AM, Hristo Benev wrote:HelloI followed the tutorialhttp://wiki.freeswitch.org/wiki/SBC_SetupI have following problem when I dial 1000 Kamalio reports 302, but freeswitch does not routeWhere to look for problems?

_______________________________________________
FreeSWITCH-users mailing list
FreeSWITCH-users@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@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@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@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@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@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@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@lists.freeswitch.org
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org
Back to top
foxb at abv.bg
Guest





PostPosted: Mon Aug 31, 2009 10:58 am    Post subject: [Freeswitch-users] freeswitch as SBC and kamailio - no route Reply with quote

Now it is correct.

Thank you for your time.



Quote:
-------- Оригинално писмо --------
От: rod
Относно: Re: [Freeswitch-users] freeswitch as SBC and kamailio - no route
До: freeswitch-users@lists.freeswitch.org
Изпратено на: Събота, 2009, Август 29 08:43:24 EEST

Quote:
Ok,

I found what's happening. I probably did some change on the wiki to
start reflect the new configuration, without having time enough to check
the configuration. There is a mistake in your dialplan configuration.
You should put this instead:

wrong line:



please correct with:



This should match PEER_01 in dialplan instead of trying matching
France@PEER_01.

Let me know if this is right now.

rod

Hristo Benev a écrit :
Quote:
Hello Rod,

I did the change.

Here is extract of console:
-----------------------------------------------------------------------------------------
variable_continue_on_fail: [true]
variable_sip_h_X-ROUTE: [LOOKUP]
variable_export_vars: [sip_h_X-ROUTE]
variable_signal_bond: [a66d089a-93ee-11de-ab7a-094dff0ede20]
variable_sip_redirect_contact_0: [sip:France@PEER_01]
variable_sip_redirected_to: [sip:France@PEER_01]
variable_sip_redirect_contact_user_0: [France] variable_sip_redirect_contact_host_0: [PEER_01]
variable_sip_redirect_dialstring_0: [sofia/internal/sip:France@PEER_01]
variable_sip_redirect_dialstring: [sofia/internal/sip:France@PEER_01]
variable_proto_specific_hangup_cause: [sip:503]
variable_sip_hangup_phrase: [DNS Error]
variable_originate_disposition: [NORMAL_TEMPORARY_FAILURE]
variable_ROUTE_GW: [France]
variable_AREA: [France]
variable_current_application: [info]
------------------------------------------------------------------------------------------
I have different value it is actually the description field as shown here:

--------------------------------
/opt/kamailio/sbin/kamctl cr show
cr carrier names
+----+---------+
| id | carrier |
+----+---------+
| 1 | default |
+----+---------+
cr domain names
+----+---------+
| id | domain |
+----+---------+
| 1 | default |
+----+---------+
cr routes
+----+---------+--------+-------------+-------+------+------+-------+--------------+----------------+----------------+-------------+
| id | carrier | domain | scan_prefix | flags | mask | prob | strip | rewrite_host | rewrite_prefix | rewrite_suffix | description |
+----+---------+--------+-------------+-------+------+------+-------+--------------+----------------+----------------+-------------+
| 1 | 1 | 1 | 1000 | 0 | 0 | 1 | 0 | PEER_01 | | | France |
+----+---------+--------+-------------+-------+------+------+-------+--------------+----------------+----------------+-------------+
-----------------------------------------

And here is what I have in kamailio:
-------------------------------------------------------------------------------------
####### Routing Logic ########


# main request routing logic

route{

if (!mf_process_maxfwd_header("10")) {
sl_send_reply("483","Too Many Hops");
exit;
}

t_check_trans();

if ($rU==NULL) {
# request with no Username in RURI
sl_send_reply("484","Address Incomplete");
exit;
}

# LOOKUP ROUTE TABLE WHEN ASKED BY HEADER: X-ROUTE:LOOKUP
if (is_method("INVITE") && $hdr(X-ROUTE)=="LOOKUP"){
if(!cr_route("default", "default", "$rU", "$rU", "call_id","$avp(s:route_desc)")){
#xlog("ROUTING FAILED: no route found for $rU");
sl_send_reply("604", "Unable to route this call");
exit;
} else {
xlog("LOOKUP FOUND: $rd $avp(s:route_desc)");
avp_pushto("$ru/username", "$avp(s:route_desc)");
sl_send_reply("302", "$rd");
exit;
}
}
}
----------------------------------------------------------------------------------

Another question...
In that part of FreeSwitch dialplan.xml

-----------------------------------






-----------------------------------

X-ROUTE maybe should be replaced with ROUTE_GW otherwise there is no way the regex is true.


As for thanks - for sure by default they are also for the developers of both apps.
I'm new in freeSwitch and/or Kamailio for now I'm still testing and learning so it will be nice to have something working to start with.



Quote:
-------- Оригинално писмо --------
От: rod
Относно: Re: [Freeswitch-users] freeswitch as SBC and kamailio - no route
До: freeswitch-users@lists.freeswitch.org
Изпратено на: Петък, 2009, Август 28 09:54:00 EEST

Quote:
Hello,

the trace seems good.
If you check the answer from Kamailio, you'll see that Kamailio answers
with "302 PEER_01".

As Michael Collins stated before, you can get the variable containing
"PEER_01", then this variable is stored in a custom variable.

In your dialplan, may you please add:

, just before the transfer line, eg:













Using application Info, you'll see on the console (or CDR) the list of
variables used for this call. You should see the content of
"${sip_redirect_contact_user_0}" that should contain the value
"PEER_01". Please check this and let me know.

For the new configuration file, no problem for sharing. But as I wrote
on the wiki page, I worked on this setup cause LCR module was not
available when I start working on FS, nor I'm a good programmer to write
a server side HTTP script (used by xml_curl) that could scale to my needs.

I enhanced a bit this configuration with support for fallback routing,
almost realtime graph (every minutes using www.cacti.net and some
functions in FS like limit_hash) of number of concurrent calls per AREA,
PEER...

Thanks for "the good tutorial", but don't forget the dev team who did
this great product ;-)

rod.


Hristo Benev a écrit :
Quote:
I assume you asked for port 5062 since I do not have any traffic on 5060 (I have one IP and my internal sip port is 5090 and external 5080).

If you need additional info I'll provide it.

Here is trace:

ngrep -d any -nn -i '1000' port 5062 -W byline
interface: any
filter: (ip or ip6) and ( port 5062 )
match: 1000
#
U 10.10.10.10:5090 -> 127.0.0.1:5062
INVITE sip:1000@127.0.0.1:5062 SIP/2.0.
Via: SIP/2.0/UDP 10.10.10.10:5090;rport;branch=z9hG4bKtrDyU1US5X5tj.
Max-Forwards: 69.
From: "Extension 1001" ;tag=978g69jZaFpBD.
To: .
Call-ID: 7f0eff2d-0dbf-122d-bfb0-612c8433bc7c.
CSeq: 119574771 INVITE.
Contact: .
User-Agent: FreeSWITCH-mod_sofia/1.0.4-exported.
Allow: INVITE, ACK, BYE, CANCEL, OPTIONS, PRACK, MESSAGE, SUBSCRIBE, NOTIFY, REFER, UPDATE, REGISTER, INFO, PUBLISH.
Supported: timer, precondition, path, replaces.
Allow-Events: talk, presence, dialog, call-info, sla, include-session-description, presence.winfo, message-summary, refer.
Content-Type: application/sdp.
Content-Disposition: session.
Content-Length: 429.
X-ROUTE: LOOKUP.
Remote-Party-ID: "Extension 1001" ;party=calling;screen=yes;privacy=off.
.
v=0.
o=FreeSWITCH 1251355692 1251355693 IN IP4 10.10.10.10.
s=FreeSWITCH.
c=IN IP4 10.10.10.10.
t=0 0.
m=audio 30522 RTP/AVP 0 115 107 9 8 3 101 13.
a=rtpmap:0 PCMU/8000.
a=rtpmap:115 G7221/32000.
a=fmtp:115 bitrate=48000.
a=rtpmap:107 G7221/16000.
a=fmtp:107 bitrate=32000.
a=rtpmap:9 G722/8000.
a=rtpmap:8 PCMA/8000.
a=rtpmap:3 GSM/8000.
a=rtpmap:101 telephone-event/8000.
a=fmtp:101 0-16.
a=rtpmap:13 CN/8000.
a=ptime:20.

#
U 127.0.0.1:5062 -> 10.10.10.10:5090
SIP/2.0 302 PEER_01.
Via: SIP/2.0/UDP 10.10.10.10:5090;rport=5090;branch=z9hG4bKtrDyU1US5X5tj.
From: "Extension 1001" ;tag=978g69jZaFpBD.
To: ;tag=458fb4012080e656b6742c09466dabcd.31c8.
Call-ID: 7f0eff2d-0dbf-122d-bfb0-612c8433bc7c.
CSeq: 119574771 INVITE.
Contact: sip:France@PEER_01.
Server: Kamailio (1.5.2-notls (i386/linux)).
Content-Length: 0.
.

#
U 10.10.10.10:5090 -> 127.0.0.1:5062
ACK sip:1000@127.0.0.1:5062 SIP/2.0.
Via: SIP/2.0/UDP 10.10.10.10:5090;rport;branch=z9hG4bKtrDyU1US5X5tj.
Max-Forwards: 69.
From: "Extension 1001" ;tag=978g69jZaFpBD.
To: ;tag=458fb4012080e656b6742c09466dabcd.31c8.
Call-ID: 7f0eff2d-0dbf-122d-bfb0-612c8433bc7c.
CSeq: 119574771 ACK.
Content-Length: 0.
.





Quote:
-------- Оригинално писмо --------
От: Hristo Benev
Относно: Re: [Freeswitch-users] freeswitch as SBC and kamailio - no route
До: freeswitch-users@lists.freeswitch.org
Изпратено на: Четвъртък, 2009, Август 27 14:58:53 EEST

Quote:

Bojnour,

I'll send a trace ASAP.

What I see is that SIP header does not get updated -> regex is not true then it does not go to the peer. (I assume that is coming from kamailio config)

I'm really interested to see the updates of the project.

Thank you for the good tutorial.

Hristo


Quote:
-------- Оригинално писмо --------
От: rod
Относно: Re: [Freeswitch-users] freeswitch as SBC and kamailio - no route
До: freeswitch-users@lists.freeswitch.org
Изпратено на: Четвъртък, 2009, Август 27 09:41:05 EEST

Quote:
Hi Hristo,

I'm the author of this setup and wiki page. I did a lot of modifications
on this setup (alternative routing if failure essentially) but don't
have too much time to update the wiki.

May you please send me an ngrep trace when you call 1000:

ngrep -d any -nn -i '1000' port 5060 -W byline

I will check what's happening.
Do you have an entry for 1000 in your mysql database ?

regards,
rod

Hristo Benev a écrit :
Quote:

It seems that the problem is on kamailio configuration.
Will ask on their list.

But to test i try to connect to my asterisk server and i receive 407 proxy authentication required.

I have it setup as friend in asterisk, but still ???

Any ideas?

Thanks,


Quote:
-------- Оригинално писмо --------
От: Hristo Benev
Относно: Re: [Freeswitch-users] freeswitch as SBC and kamailio - no route
До: freeswitch-users@lists.freeswitch.org
Изпратено на: Сряда, 2009, Август 26 22:02:13 EEST

Quote:
I think that the problem is here:
-------------------------
2009-08-26 22:56:52.725878 [INFO] mod_dialplan_xml.c:315 Processing 1001->1000 in context ROUTING
Dialplan: sofia/internal/1001@209.71.254.33 parsing [ROUTING->PEER_01] continue=false
Dialplan: sofia/internal/1001@209.71.254.33 Regex (FAIL) [PEER_01] ${sip_h_X-ROUTE}(LOOKUP) =~ /PEER_01/ break=on-false
2009-08-26 22:56:52.728289 [INFO] switch_core_state_machine.c:136 No Route, Aborting
--------------------------

Actually Regex FAIL

I'm not familiar, but is this stating that ${sip_h_X-ROUTE} should be PEER_01 for success?
Here is my default.xml:
----------------






































--------------------------



Quote:
-------- Оригинално писмо --------
От: Brian West
Относно: Re: [Freeswitch-users] freeswitch as SBC and kamailio - no route
До: freeswitch-users@lists.freeswitch.org
Изпратено на: Сряда, 2009, Август 26 19:47:37 EEST

Quote:
We do not blindly follow 302's as that is a dangerous thing to do.
You have to process all 302's in the dialplan.
Set this on your sofia profile
You can set these variables sip_redirect_profile,
sip_redirect_context,
sip_redirect_dialplan,
When a redirect happens you get these variables - sip_redirect_contact_%d,
sip_redirected_to,
sip_redirect_contact_user_%d,
sip_redirect_contact_host_%d,
sip_redirect_contact_params_%d,
sip_redirect_dialstring_%d,
sip_redirect_dialstring,
sip_redirected_byThen its up to you to process the redirect in your dialplan, If you don't set the
sip_redirect_context then it'll default to redirected context and XML as the dialplan./bOn Aug 26, 2009, at 11:37 AM, Hristo Benev wrote:HelloI followed the tutorialhttp://wiki.freeswitch.org/wiki/SBC_SetupI have following problem when I dial 1000 Kamalio reports 302, but freeswitch does not routeWhere to look for problems?

_______________________________________________
FreeSWITCH-users mailing list
FreeSWITCH-users@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@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@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@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@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@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@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@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@lists.freeswitch.org
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org
Back to top
Display posts from previous:   
Post new topic   Reply to topic    VoIP Mailing List Archives Forum Index -> freeSWITCH Users All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group

VoiceMeUp - Corporate & Wholesale VoIP Services