[Freeswitch-users] SIP switching made simple?

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


Hello.

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 192.168.2.100
[19bad83a-ec9a-4b59-8457-cd76f1eaef65]
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 192.168.2.100
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 192.168.2.100 [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 192.168.2.100) Ended
2009-04-13 18:35:50 [NOTICE] switch_core_session.c:972
switch_core_session_thread() Close Channel
sofia/internal/02 at 192.168.2.100 [CS_HANGUP]

My users are added in file users.xml in directory/ :
<include>
  <user id="01" mailbox="01">
    <params>
      <param name="password" value="01"/>
      <param name="vm-password" value="01"/>
    </params>
    <variables>
      <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"/>
    </variables>
  </user>
  <user id="02" mailbox="02">
    <params>
      <param name="password" value="02"/>
      <param name="vm-password" value="02"/>
    </params>
    <variables>
      <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"/>
    </variables>
  </user>
</include>



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 192.168.2.100:5060" />
  </condition>
</extension>
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:
[default]

; 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)

[pbx]
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"/>
to
<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 192.168.2.100:5060, where
192.168.2.100:5060 is IP:PORT of freeswitch (the IP is same for
softphones.. the same machine).

Thanks for any help.
Fiala




More information about the FreeSWITCH-users mailing list