[Freeswitch-users] SIP switching made simple?

Martin Fiala fialkam at gmail.com
Mon Apr 13 09:56:11 PDT 2009


I'm trying to use freeswitch, was able to compile it without problems,
which is very nice. Then studying the configurations etc., I managed
to set up SIP accounts those register properly. But now, if I want to
call one registered account from the other one, I get error 404 - not
found. I tried to set up a minimalistic dialplan using xml syntax as
well as asterisk syntax but neither worked for me. I changed just a
few thing, I'll list them later. I'm trying to make calls using ip
addresses and ports instead of domain names..

This is the error freeswitch outputs:
2009-04-13 18:35:48 [NOTICE] switch_channel.c:567
switch_channel_set_name() New Channel sofia/internal/02 at
2009-04-13 18:35:48 [INFO] mod_dialplan_xml.c:233 dialplan_hunt()
Processing 02->01 in context default
2009-04-13 18:35:48 [NOTICE] switch_ivr.c:1343
switch_ivr_session_transfer() Transfer sofia/internal/02 at
to enum[01 at default]
2009-04-13 18:35:50 [INFO] switch_core_state_machine.c:122
switch_core_standard_on_routing() No Route, Aborting
2009-04-13 18:35:50 [NOTICE] switch_core_state_machine.c:123
switch_core_standard_on_routing() Hangup
sofia/internal/02 at [CS_ROUTING] [NO_ROUTE_DESTINATION]
2009-04-13 18:35:50 [NOTICE] switch_core_session.c:970
switch_core_session_thread() Session 1
(sofia/internal/02 at Ended
2009-04-13 18:35:50 [NOTICE] switch_core_session.c:972
switch_core_session_thread() Close Channel
sofia/internal/02 at [CS_HANGUP]

My users are added in file users.xml in directory/ :
  <user id="01" mailbox="01">
      <param name="password" value="01"/>
      <param name="vm-password" value="01"/>
      <variable name="accountcode" value="01"/>
      <variable name="user_context" value="default"/>
      <variable name="effective_caller_id_name" value="01"/>
      <variable name="effective_caller_id_number" value="01"/>
  <user id="02" mailbox="02">
      <param name="password" value="02"/>
      <param name="vm-password" value="02"/>
      <variable name="accountcode" value="02"/>
      <variable name="user_context" value="default"/>
      <variable name="effective_caller_id_name" value="02"/>
      <variable name="effective_caller_id_number" value="02"/>

I've added the file dialplan/default/000_default.xml with contents:
<extension name="internal">
  <condition field="source" expression="mod_sofia" />
  <condition field="destination_number" expression="^(4\d+)">
    <action application="bridge" data="sofia/internal/$0 at" />
That's from sample configs, I wonder, if the IP address can be used
like that. I understand it that way, the ip address specified is of
registrar server. I've added the port as I'm testing it on local loop
and thus am running different sip services on the same ip (freeswitch
and calling softfones). Is that ok?

extensions.conf I've tried to use:

; Things you're used to....
;exten => music,n,Dial(SIP/1234 at conference.freeswitch.org|120)

;exten => _1XXXXX,n,set(cool=${EXTEN})
;exten => _1XXXXX,n,set(myvar=true)
;exten => _1XXXXX,n,Goto(default|music)
;exten => 2137991400/1000,n,Goto(default|music)

; Some new magic you can do....
;exten => ~^(18(0{2}|8{2}|7{2}|6{2})\d{7})$,n,enum($1)
;exten => ~^(18(0{2}|8{2}|7{2}|6{2})\d{7})$,n,bridge(${enum_auto_route})

; instead of exten, put anything about the call you would rather match on.
; either the names of a field in caller_profile or a string of
variables to expand.
;caller_id_number => 2137991400,n,Goto(default|music)
;${sip_from_user} => bill,n,Goto(default|music)

exten => 01,1,Dial(SIP/01,20)
exten => 02,1,Dial(SIP/02,20)

When using extensions.conf I've changed this line in
sip_profiles/internal.xml from:
<param name="dialplan" value="XML"/>
<param name="dialplan" value="asterisk,XML"/>
I didn't make any other changes in that file.

I didn't change anything else.

I'm trying to use two sip phones - one using port 6001 (user "01")
and the other one 5000 (user "02"). After registration succeeds,
calling this sip uri : sip:01 at, where is IP:PORT of freeswitch (the IP is same for
softphones.. the same machine).

Thanks for any help.

More information about the FreeSWITCH-users mailing list