<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
My apologies for not adding it in my previous message, but my lan
network is a 10.0.0.x network.&nbsp; The 192.168.0.1 device does not exist
on my network.<br>
<br>
Chris Danielson wrote:
<blockquote cite="mid:46E8CCC9.9070505@maxpowersoft.com" type="cite">
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
After running some more tests I noticed something very interesting...
see the 192.168.0.1 line:<br>
  <br>
2007-09-12 20:49:00 [DEBUG] sofia.c:1028 sofia_handle_sip_i_state()
Channel sofia/sip.vonics.net/18881234567 entering state [calling]<br>
sres_resolver_receive(0x556cd0, 16) called<br>
RR received sip.vonics.net. CNAME IN 890 rdlen=9<br>
RR received vonics.net. SOA IN 7199 rdlen=46<br>
sres_cache_get(0x549370, SRV, "_sip._udp.sip.vonics.net.") called<br>
rr found in cache: _sip._udp.sip.vonics.net. 33<br>
rr found in cache: _sip._udp.sip.vonics.net. 33<br>
rr found in cache: _sip._udp.sip.vonics.net. 33<br>
rr found in cache: _sip._udp.sip.vonics.net. 33<br>
sres_cache_get(0x549370, SRV, "_sip._udp.sip.vonics.net.") returned 4
entries<br>
nta: for "sip.vonics.net" query "_sip._udp.sip.vonics.net" SRV (cached)<br>
nta: _sip._udp.sip.vonics.net IN SRV 0 0&nbsp; 5060 sipserver1.vonics.net.
(udp)<br>
nta: _sip._udp.sip.vonics.net IN SRV 1 0&nbsp; 13412 sipserver1.vonics.net.
(udp)<br>
nta: _sip._udp.sip.vonics.net IN SRV 2 0&nbsp; 5060 sipserver2.vonics.net.
(udp)<br>
nta: _sip._udp.sip.vonics.net IN SRV 3 0&nbsp; 13412 sipserver2.vonics.net.
(udp)<br>
sres_cache_get(0x549370, A, "sipserver1.vonics.net.") called<br>
nta: for "sip.vonics.net" query "sipserver1.vonics.net." A<br>
sres_query(0x556cd0, 0x690fb0, A, "sipserver1.vonics.net.") called<br>
sres_send_dns_query(0x556cd0, 0x691a70) called<br>
sres_send_dns_query(0x556cd0, 0x691a70) id=14532 A
sipserver1.vonics.net. (to [192.168.0.1]:53)<br>
sres_resolver_receive(0x556cd0, 16) called<br>
sres_decode_msg: matching query for id=14531<br>
sres_resolver_receive(0x556cd0, 16) called<br>
RR received sipserver1.vonics.net. CNAME IN 3599 rdlen=9<br>
RR received juliet.vonics.net. A IN 4663 rdlen=4<br>
RR received vonics.net. NS IN 4663 rdlen=6<br>
RR received vonics.net. NS IN 4663 rdlen=6<br>
RR received vonics.net. NS IN 4663 rdlen=6<br>
  <br>
And following this log I ran a netstat just to see the socket<br>
  <br>
MaxPowerSoft001:~# netstat -nalp |grep freeswitch<br>
tcp&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 0 10.0.0.2:13412&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 0.0.0.0:*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
LISTEN&nbsp;&nbsp;&nbsp;&nbsp; 14720/freeswitch<br>
udp&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 0 10.0.0.2:32826&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 192.168.0.1:53&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
ESTABLISHED14720/freeswitch<br>
udp&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 0 10.0.0.2:13412&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
0.0.0.0:*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 14720/freeswitch<br>
  <br>
  <br>
I am wondering if the 192.168.0.1 address is causing my issues.&nbsp; Thanks
again for any light you shine on this issue.<br>
  <br>
Kind Regards,<br>
Chris Danielson<br>
  <br>
Chris Danielson wrote:
  <blockquote cite="mid:46E2CFA6.2030901@maxpowersoft.com" type="cite">
    <meta content="text/html;charset=ISO-8859-1"
 http-equiv="Content-Type">
I attempted the session.streamFile(...) and was able to successfully
hear the wav file.&nbsp; I also attempted calling the session.answer() for a
second time within the cf_bridge_call function.&nbsp; Still, I am unable to
hear the ringing sound even though the phone that I called is actually
ringing.&nbsp; When the phone is answered, the originate appears to fail due
to a 60 second timeout, which is reported as a NO_ANSWER.&nbsp; This happens
regardless of whether or not the phone I am calling is answered or not.<br>
    <br>
Here is the current execution flow within my Javascript:<br>
    <br>
function cf_bridge_call(phone) {<br>
&nbsp;&nbsp;&nbsp; var str = "sofia/gateway/line2/"+phone;<br>
&nbsp;&nbsp;&nbsp; session.setVariable("ringback", "%(2000, 4000, 440.0, 480.0)");<br>
&nbsp;&nbsp;&nbsp; session.preAnswer(); /* attemped a session.answer() here in another
test.&nbsp; The sound file still played, not no ringing was heard.&nbsp; */<br>
&nbsp;&nbsp;&nbsp; session.streamFile("/usr/local/freeswitch/sounds/you_rang.wav");<br>
&nbsp;&nbsp;&nbsp; session.execute("bridge", str);<br>
}<br>
    <br>
session.answer();<br>
session.flushDigits();<br>
/**<br>
&nbsp;* Query database and dynamically load a phone number into variable<br>
&nbsp;**/<br>
var phoneNo = db_get_phone();<br>
cf_bridge_call(phoneNo);<br>
    <br>
The log output was:<br>
    <br>
2007-09-08 01:54:35 [DEBUG] switch_ivr_play_say.c:1007
switch_ivr_play_file() done playing file<br>
2007-09-08 01:54:35 [NOTICE] switch_channel.c:385
switch_channel_set_name() New Chan sofia/sip.vonics.net/18881234567
[1f766c60-5de9-11dc-af73-3b3c22977fdb]<br>
2007-09-08 01:54:35 [DEBUG] mod_sofia.c:1431 sofia_outgoing_channel()
sofia/sip.vonics.net/18881234567 State Change CS_NEW -&gt; CS_INIT<br>
2007-09-08 01:54:35 [DEBUG] switch_core_session.c:647
switch_core_session_signal_state_change() Kill
sofia/sip.vonics.net/18881234567 [BREAK]<br>
2007-09-08 01:54:35 [DEBUG] switch_core_state_machine.c:383
switch_core_session_run() (sofia/sip.vonics.net/18881234567) State INIT<br>
2007-09-08 01:54:35 [DEBUG] mod_sofia.c:92 sofia_on_init() SOFIA INIT<br>
2007-09-08 01:54:35 [DEBUG] sofia.c:71 sofia_event_callback() event
[nua_i_state] status [0][INVITE sent] session:
sofia/sip.vonics.net/18881234567<br>
2007-09-08 01:54:35 [DEBUG] sofia.c:1028 sofia_handle_sip_i_state()
Channel sofia/sip.vonics.net/18881234567 entering state [calling]<br>
2007-09-08 01:54:35 [DEBUG] mod_sofia.c:105 sofia_on_init()
sofia/sip.vonics.net/18881234567 State Change CS_INIT -&gt; CS_RING<br>
2007-09-08 01:54:35 [DEBUG] switch_core_session.c:647
switch_core_session_signal_state_change() Kill
sofia/sip.vonics.net/18881234567 [BREAK]<br>
2007-09-08 01:54:35 [DEBUG] switch_core_state_machine.c:418
switch_core_session_run() (sofia/sip.vonics.net/18881234567) State RING<br>
2007-09-08 01:54:35 [DEBUG] mod_sofia.c:120 sofia_on_ring() SOFIA RING<br>
2007-09-08 01:54:35 [DEBUG] switch_ivr_originate.c:48
originate_on_ring() sofia/sip.vonics.net/18881234567 State Change
CS_RING -&gt; CS_HOLD<br>
2007-09-08 01:54:35 [DEBUG] switch_core_session.c:647
switch_core_session_signal_state_change() Kill
sofia/sip.vonics.net/18881234567 [BREAK]<br>
2007-09-08 01:54:35 [DEBUG] switch_core_state_machine.c:596
switch_core_session_run() (sofia/sip.vonics.net/18881234567) State HOLD<br>
2007-09-08 01:54:35 [DEBUG] switch_core_state_machine.c:204
switch_core_standard_on_hold() Standard HOLD<br>
2007-09-08 01:54:35 [DEBUG] switch_ivr_originate.c:619
switch_ivr_originate() Raw Codec Activation Success L16@8000hz 1
channel 20ms<br>
2007-09-08 01:54:35 [DEBUG] switch_ivr_originate.c:667
switch_ivr_originate() Play Ringback Tone [%(2000, 4000, 440.0, 480.0)]<br>
2007-09-08 01:54:35 [DEBUG] sofia.c:71 sofia_event_callback() event
[nua_r_invite] status [401][Unauthorized] session:
sofia/sip.vonics.net/18881234567<br>
2007-09-08 01:54:35 [DEBUG] sofia_reg.c:691
sofia_reg_handle_sip_r_challenge() Authenticating 'FreeSWITCH' with
'Digest:"sip.vonics.net":16191111111:5874'.<br>
2007-09-08 01:54:35 [DEBUG] sofia.c:71 sofia_event_callback() event
[nua_i_state] status [0][INVITE sent] session:
sofia/sip.vonics.net/18881234567<br>
2007-09-08 01:54:35 [DEBUG] sofia.c:1028 sofia_handle_sip_i_state()
Channel sofia/sip.vonics.net/18881234567 entering state [calling]<br>
2007-09-08 01:55:35 [NOTICE] switch_ivr_originate.c:805
switch_ivr_originate() Hangup sofia/sip.vonics.net/18881234567
[CS_HOLD] [NO_ANSWER]<br>
2007-09-08 01:55:35 [DEBUG] switch_channel.c:1076
switch_channel_perform_hangup() Kill sofia/sip.vonics.net/18881234567
[KILL]<br>
2007-09-08 01:55:35 [DEBUG] switch_core_session.c:647
switch_core_session_signal_state_change() Kill
sofia/sip.vonics.net/18881234567 [BREAK]<br>
2007-09-08 01:55:35 [DEBUG] switch_ivr_originate.c:878
switch_ivr_originate() Originate Cancelled by originator termination
Cause: 19 [NO_ANSWER]<br>
2007-09-08 01:55:35 [INFO] mod_dptools.c:1087 audio_bridge_function()
Originate Failed.&nbsp; Cause: NO_ANSWER<br>
    <br>
Thanks again for all the help.<br>
    <br>
Kind Regards,<br>
Chris Danielson<br>
    <br>
Anthony Minessale wrote:
    <blockquote cite="mid:967338.4472.qm@web90615.mail.mud.yahoo.com"
 type="cite">
      <style type="text/css"><!-- DIV {margin:0px;} --></style>
      <div
 style="font-family: courier,monaco,monospace,sans-serif; font-size: 12pt;">you
can find out by playing a file in the script<br>
to make sure you have an audio path.<br>
      <br>
session.preAnswer();<br>
session.streamFile("/some.wav");<br>
      <br>
If that doesn't work the inbound device may not support early media so
try session.answer(); instead to compare what happens when you send a
200 ok instead of a 183 progress<br>
      <br>
      <br>
      <div>&nbsp;</div>
      <div>Anthony Minessale II<br>
      <br>
      <span>FreeSWITCH <a moz-do-not-send="true" target="_blank"
 href="http://www.freeswitch.org/">http://www.freeswitch.org/</a></span><br>
      <span>ClueCon <a moz-do-not-send="true" target="_blank"
 href="http://www.cluecon.com/">http://www.cluecon.com/</a></span><br>
      <br>
AIM: anthm<br>
      <a moz-do-not-send="true" class="moz-txt-link-abbreviated"
 href="mailto:MSN:anthony_minessale@hotmail.com">MSN:anthony_minessale@hotmail.com</a><br>
      <a moz-do-not-send="true" class="moz-txt-link-abbreviated"
 href="mailto:GTALK/JABBER/PAYPAL:anthony.minessale@gmail.com">GTALK/JABBER/PAYPAL:anthony.minessale@gmail.com</a><br>
IRC: irc.freenode.net #freeswitch</div>
      <div><br>
FreeSWITCH Developer Conference<br>
      <a moz-do-not-send="true" class="moz-txt-link-freetext"
 href="sip:888@conference.freeswitch.org">sip:888@conference.freeswitch.org</a><br>
      <a moz-do-not-send="true" class="moz-txt-link-abbreviated"
 href="mailto:iax:guest@conference.freeswitch.org/888">iax:guest@conference.freeswitch.org/888</a><br>
      <a moz-do-not-send="true" class="moz-txt-link-abbreviated"
 href="mailto:googletalk:conf+888@conference.freeswitch.org">googletalk:conf+888@conference.freeswitch.org</a><br>
pstn:213-799-1400</div>
      <div
 style="font-family: courier,monaco,monospace,sans-serif; font-size: 12pt;"><br>
      <br>
      <div
 style="font-family: times new roman,new york,times,serif; font-size: 12pt;">-----
Original Message ----<br>
From: Chris Danielson <a moz-do-not-send="true"
 class="moz-txt-link-rfc2396E" href="mailto:chris@maxpowersoft.com">&lt;chris@maxpowersoft.com&gt;</a><br>
To: <a moz-do-not-send="true" class="moz-txt-link-abbreviated"
 href="mailto:freeswitch-users@lists.freeswitch.org">freeswitch-users@lists.freeswitch.org</a><br>
Sent: Thursday, September 6, 2007 11:50:29 PM<br>
Subject: Re: [Freeswitch-users] 2 SIP Lines, Difficulty Originating Call<br>
      <br>
Thanks again for all the help.&nbsp; My apologies for not replying sooner, I
was out of town for a week and needed some extra time to research and
try some of the things you had mentioned.&nbsp; Everything that is brought
up in this thread will get documented by me within the wiki.<br>
      <br>
So far I have tried both techniques within my JavaScript code that
Anthony mentioned.&nbsp; Here is one example:<br>
      <br>
function cf_bridge_call(phone) {<br>
&nbsp;&nbsp;&nbsp; var str = "sofia/gateway/line2/"+phone;<br>
&nbsp;&nbsp;&nbsp; session.setVariable("ringback", "%(2000, 4000, 440.0, 480.0)");<br>
&nbsp;&nbsp;&nbsp; session.preAnswer();<br>
&nbsp;&nbsp;&nbsp; session.execute("bridge", str);<br>
}<br>
cf_bridge_call("18881234567");<br>
      <br>
When I make this call I still do not hear the ringing and notice that
the console renders:<br>
nta: received 180 Ringing for INVITE (87950735) <br>
nta: 180 Ringing was discarded <br>
      <br>
When the phone is actually answered, I still cannot hear the person on
the other side speaking too.&nbsp; <br>
      <br>
Is this possibly due to the fact that I am having a NAT issue?&nbsp; Or
could this be that my carrier is doing something out of the norm?&nbsp; And
finally, should I implement this strictly as a dialplan within the
default_context.xml file and avoid handling this functionality within
JavaScript?<br>
      <br>
Kind Regards,<br>
&nbsp;&nbsp;&nbsp; Chris Danielson<br>
      <br>
Anthony Minessale wrote:
      <blockquote type="cite">
        <div
 style="font-family: courier,monaco,monospace,sans-serif; font-size: 12pt;">You
should choose one or the other not both.<br>
One is inband ringing generated by FreeSWITCH and the other<br>
is just the sip message telling the phone to indicate ringinig.<br>
Here is a description I wrote on an earlier posting here that someone
may want to stick in the wiki.<br>
        <br>
---snip<br>
        <br>
ring_ready is a dialplan application that sends the protocol specific
message to indicate ringing.&nbsp; In the case of SIP a 180 Ringing.<br>
        <br>
ringback is a channel variable you can set to artificially generate a
tone or play an audio file to an originating channel while it waits to
be connected to another call.<br>
        <br>
pre_answer is a dialplan application that will send the protocol
specific message to indicate early media.&nbsp; In the case of SIP a 183
Progress<br>
        <br>
So, if you call into freeswitch with sip and the first entry in your
dialplan is ring_ready followed by a bridge to some other destination
when it hits ring_ready it will send "180 Ringing" back to your phone
so it can generate the ringing sound.<br>
        <br>
If instead you use the set application to set ringback to a tone spec
or audio file followed by a call to pre_answer to establish an early
media connection followed by a call to bridge to another dest, then the
core will generate this audio locally and send it back to your phone.
Again, this occurs during early media meaning the call has not been
answered but the SIP has negotiated a media path in advance for this
type of pre-answer audio indication.&nbsp; SIP has no promise that early
media must be supported so some switches and devices opt to not support
it meaning you may not be able to hear any audio until the call is
officially answered which would keep you from hearing the artificial
ringback at all. <br>
        <br>
&nbsp;<br>
        <br>
        <div>&nbsp;</div>
        <div>Anthony Minessale II<br>
        <br>
        <span>FreeSWITCH <a moz-do-not-send="true" rel="nofollow"
 target="_blank" href="http://www.freeswitch.org/">http://www.freeswitch.org/</a></span><br>
        <span>ClueCon <a moz-do-not-send="true" rel="nofollow"
 target="_blank" href="http://www.cluecon.com/">http://www.cluecon.com/</a></span><br>
        <br>
AIM: anthm<br>
        <a moz-do-not-send="true" rel="nofollow"
 class="moz-txt-link-abbreviated" target="_blank"
 href="mailto:MSN:anthony_minessale@hotmail.com">MSN:anthony_minessale@hotmail.com</a><br>
        <a moz-do-not-send="true" rel="nofollow"
 class="moz-txt-link-abbreviated" target="_blank"
 href="mailto:GTALK/JABBER/PAYPAL:anthony.minessale@gmail.com">GTALK/JABBER/PAYPAL:anthony.minessale@gmail.com</a><br>
IRC: irc.freenode.net #freeswitch</div>
        <div><br>
FreeSWITCH Developer Conference<br>
        <a moz-do-not-send="true" rel="nofollow"
 class="moz-txt-link-freetext">sip:888@conference.freeswitch.org</a><br>
        <a moz-do-not-send="true" rel="nofollow"
 class="moz-txt-link-abbreviated" target="_blank"
 href="mailto:iax:guest@conference.freeswitch.org/888">iax:guest@conference.freeswitch.org/888</a><br>
        <a moz-do-not-send="true" rel="nofollow"
 class="moz-txt-link-abbreviated" target="_blank"
 href="mailto:googletalk:conf+888@conference.freeswitch.org">googletalk:conf+888@conference.freeswitch.org</a><br>
pstn:213-799-1400</div>
        <div
 style="font-family: courier,monaco,monospace,sans-serif; font-size: 12pt;"><br>
        <br>
        <div
 style="font-family: times new roman,new york,times,serif; font-size: 12pt;">-----
Original Message ----<br>
From: Tamas Cseke <a moz-do-not-send="true" rel="nofollow"
 class="moz-txt-link-rfc2396E" target="_blank"
 href="mailto:cstomi.levlist@gmail.com">&lt;cstomi.levlist@gmail.com&gt;</a><br>
To: <a moz-do-not-send="true" rel="nofollow"
 class="moz-txt-link-abbreviated" target="_blank"
 href="mailto:chris@maxpowersoft.com">chris@maxpowersoft.com</a>; <a
 moz-do-not-send="true" rel="nofollow" class="moz-txt-link-abbreviated"
 target="_blank" href="mailto:freeswitch-users@lists.freeswitch.org">freeswitch-users@lists.freeswitch.org</a><br>
Sent: Monday, August 27, 2007 2:34:22 AM<br>
Subject: Re: [Freeswitch-users] 2 SIP Lines, Difficulty Originating Call<br>
        <br>
        <div>Chris Danielson &iacute;rta:<br>
&gt; If any one can help me, I am having two issues.&nbsp;&nbsp;Basically, while
my <br>
&gt; javascript is executing a single inbound SIP call the script <br>
&gt; conditionally gets to a point where the end-user can originate a
call to <br>
&gt; an external phone number.&nbsp;&nbsp;Keep in mind that I have two sip lines <br>
&gt; defined as gateways supplied by my carrier vonics.net.&nbsp;&nbsp;Upon
calling the <br>
&gt; originate method, the call is actually placed and the destination
phone <br>
&gt; actually begins to ring.&nbsp;&nbsp;At this point I still cannot hear the
ringing <br>
&gt; on the original session that was originated by my inbound
call.&nbsp;&nbsp;Also, <br>
&gt; the originate method times out regardless of whether or not the <br>
&gt; destination "phone" number was answered or not. <br>
&gt;<br>
&gt; So my two issues are:<br>
&gt; 1)&nbsp;&nbsp;Why does the originate method start a call, the destination
phone <br>
&gt; called actually rings, but always times out, regardless of whether
or <br>
&gt; not the phone was answered?<br>
&gt; 2)&nbsp;&nbsp;When calling the originate method, I never hear the phone
ringing on <br>
&gt; my inbound connection.<br>
&gt;&nbsp;&nbsp; <br>
You should call ring_ready app, if you want to hear the ringing afaik.<br>
        <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/* set ringback tone */<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;session.setVariable("ringback", "%(2000, 4000, 440.0, <br>
480.0)");<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;session.execute("ring_ready", "");<br>
        <br>
I found these pages, maybe you can find more about it on wiki.<br>
        <a moz-do-not-send="true" rel="nofollow" target="_blank"
 href="http://wiki.freeswitch.org/wiki/Custom_Ring_Back_Tones">http://wiki.freeswitch.org/wiki/Custom_Ring_Back_Tones</a><br>
        <a moz-do-not-send="true" rel="nofollow" target="_blank"
 href="http://wiki.freeswitch.org/wiki/Misc._Dialplan_Tools_ring_ready">http://wiki.freeswitch.org/wiki/Misc._Dialplan_Tools_ring_ready</a><br>
        <br>
Hope this help!<br>
        <br>
Regards,<br>
Tamas</div>
        </div>
        </div>
        </div>
      </blockquote>
      </div>
      </div>
      </div>
    </blockquote>
  </blockquote>
  <br>
</blockquote>
<br>
</body>
</html>