Re: [Freeswitch-users] Newbie -- Help Needed Transferring Inbound Caller ID to external SIP Gateway URI
The delay is very short, they send a100 Trying and then a 480 temporarily Unavailable back, as I can see in tcpdump. After they send the fail and its acknowledged, they end it and send an SMS back. This is a full dump 12:41:27.169928 IP (tos 0x0, ttl 64, id 34092, offset 0, flags [none], proto UDP (17), length 1146) 10.22.0.252.5080 > othersipgw.ip.address.5060: SIP, length: 1118 INVITE sip:sina.nowahala@sip.othersipgw.com;+234diallednumber SIP/2.0 Via: SIP/2.0/UDP my.public.ip.address:5080;rport;branch=z9hG4bK2S6KjD1jXFj1Q Max-Forwards: 5 From: "234diallednumber" <sip:+234diallednumber@my.public.ip.address>;tag=04tDF6pXQU4Ng To: <sip:sina.nowahala@sip.othersipgw.com;+234diallednumber> Call-ID: d1ef2fdb-f8a8-1232-80a6-525400ecad09 CSeq: 68640179 INVITE Contact: <sip:mod_sofia@my.public.ip.address:5080> User-Agent: FreeSWITCH-mod_sofia/1.5.15b+git~20141120T035109Z~79de78a0fb~64bit Allow: INVITE, ACK, BYE, CANCEL, OPTIONS, MESSAGE, INFO, UPDATE, REGISTER, REFER, NOTIFY Supported: timer, path, replaces Allow-Events: talk, hold, conference, refer Content-Type: application/sdp Content-Disposition: session Content-Length: 247 X-FS-Support: update_display,send_info Remote-Party-ID: "234diallednumber" <sip:+234diallednumber@my.public.ip.address>;party=calling;screen=yes;privacy=off v=0 o=FreeSWITCH 1417930197 1417930198 IN IP4 my.public.ip.address s=FreeSWITCH c=IN IP4 my.public.ip.address t=0 0 m=audio 22290 RTP/AVP 8 0 101 13 a=rtpmap:8 PCMA/8000 a=rtpmap:0 PCMU/8000 a=rtpmap:101 telephone-event/8000 a=fmtp:101 0-16 a=ptime:20 12:41:27.385419 IP (tos 0x0, ttl 53, id 5736, offset 0, flags [none], proto UDP (17), length 384) othersipgw.ip.address.5060 > 10.22.0.252.5080: SIP, length: 356 SIP/2.0 100 Trying Via: SIP/2.0/UDP my.public.ip.address:5080;rport=5080;branch=z9hG4bK2S6KjD1jXFj1Q From: "234diallednumber" <sip:+234diallednumber@my.public.ip.address>;tag=04tDF6pXQU4Ng To: <sip:sina.nowahala@sip.othersipgw.com;+234diallednumber> Call-ID: d1ef2fdb-f8a8-1232-80a6-525400ecad09 CSeq: 68640179 INVITE User-Agent: FreeSWITCH-mod_sofia/1.2.14 Content-Length: 0 12:41:27.424422 IP (tos 0x0, ttl 53, id 5737, offset 0, flags [none], proto UDP (17), length 1015) othersipgw.ip.address.5060 > 10.22.0.252.5080: SIP, length: 987 SIP/2.0 480 Temporarily Unavailable Via: SIP/2.0/UDP my.public.ip.address:5080;rport=5080;branch=z9hG4bK2S6KjD1jXFj1Q Max-Forwards: 4 From: "234diallednumber" <sip:+234diallednumber@my.public.ip.address>;tag=04tDF6pXQU4Ng To: <sip:sina.nowahala@sip.othersipgw.com;+234diallednumber>;tag=8c8DZK1aK9mKN Call-ID: d1ef2fdb-f8a8-1232-80a6-525400ecad09 CSeq: 68640179 INVITE User-Agent: FreeSWITCH-mod_sofia/1.2.14 Accept: application/sdp Allow: INVITE, ACK, BYE, CANCEL, OPTIONS, MESSAGE, INFO, UPDATE, REGISTER, REFER, NOTIFY, PUBLISH, SUBSCRIBE Supported: timer, precondition, path, replaces Allow-Events: talk, hold, conference, presence, dialog, line-seize, call-info, sla, include-session-description, presence.winfo, message-summary, refer Reason: Q.850;cause=16;text="NORMAL_CLEARING" Content-Length: 0 X-FS-Display-Name: sina.nowahala X-FS-Display-Number: sip:sina.nowahala@sip.othersipgw.com Remote-Party-ID: "sina.nowahala" <sip:sina.nowahala@sip.othersipgw.com>;party=calling;privacy=off;screen=no 12:41:27.424789 IP (tos 0x0, ttl 64, id 34093, offset 0, flags [none], proto UDP (17), length 412) 10.22.0.252.5080 > othersipgw.ip.address.5060: SIP, length: 384 ACK sip:sina.nowahala@sip.othersipgw.com;+234diallednumber SIP/2.0 Via: SIP/2.0/UDP my.public.ip.address:5080;rport;branch=z9hG4bK2S6KjD1jXFj1Q Max-Forwards: 5 From: "234diallednumber" <sip:+234diallednumber@my.public.ip.address>;tag=04tDF6pXQU4Ng To: <sip:sina.nowahala@sip.othersipgw.com;+234diallednumber>;tag=8c8DZK1aK9mKN Call-ID: d1ef2fdb-f8a8-1232-80a6-525400ecad09 CSeq: 68640179 ACK Content-Length: 0 So you recommend a transfer on fail wav to be played? I have been tearing my hair out trying to play sounds before the call is transferred to them, so that the dialler hears something. On Sun, Dec 7, 2014 at 4:44 AM, Avi Marcus <avi@avimarcus.net> wrote:
How long is the delay? I assume they return a normal_clearing or fail 4XX? If the delay is short and they have a "real" status return, then.. for success, you can just queue a "success.wav" to play after. And for fails, you can use https://wiki.freeswitch.org/wiki/Variable_transfer_on_fail and transfer to an extension that plays an error message.
This SMS sending sounds like a normal API call.. which if it was, could be done with curl or inside a lua/js script.
-Avi
On Fri, Dec 5, 2014 at 6:47 PM, Notify Me <notify.sina@gmail.com> wrote:
Hi Avi!
Thanks for the reply, I did figure it out, thanks! This is what I did,
<include> <extension name="firstsipgw-inbound"> <condition field="destination_number" expression="^0123450(\d{2})$"/> <condition field="caller_id_number" expression="^0(\d{10})$" require-nested="true"> <action application="set" data="effective_caller_id_number=+234$1"/> <action application="set" data="caller_id_number=+234${effective_caller_id_number}"/> <action application="set" data="transfer_ringback=$${us-ring}"/> <action application="set" data="transfer_ringback=file_string://$${hold_music}"/> <action application="set" data="transfer_ringback=local_stream://connecting"/> <action application="bridge"
data="sofia/external/sip:user.name@sip.othersipgw.com;${effective_caller_id_number}"/> </condition> </extension> </include>
I can see from the logs that dials the othersipgw.com URI, and I can see tcpdumps that corresponds to the traffic being sent, and the other side gets it. The other side immediately drops the call and does some processing that returns an SMS to the dialler.
I dont know if I can trouble you for more help.. there is no ringing when the transaction happens, and the dialler is unsure what is happening, if the call actually connected. As you might have guessed from the above I am trying to make it ring for a few seconds before the call drops. Is this possible? I would like for the dialler to be able to hear it ring a few times before the call is cut.
Any help gratefully accepted.
On Tue, Dec 2, 2014 at 2:22 PM, Avi Marcus <avi@avimarcus.net> wrote:
Hi - did you figure this out yet?
One comment: <action application="bridge" data="sofia/gateway/othersipgw/+234$1"/> -- I don't know if $1 is available anymore. You might want to just set that as part of the actual number to route, e.g. add a 1212 prefix and match it again or set it as a channel variable. You can see in the logs if the $1 is resolving correctly.
-Avi
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
Official FreeSWITCH Sites http://www.freeswitch.org http://confluence.freeswitch.org http://www.cluecon.com
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
Since there's only a 100 trying and no 18X, you won't get a ringing tone. If it's short, just play a message after. If not, you can use lua/js and run this second call as a bgapi call and try to capture the response. -Avi On Sun, Dec 7, 2014 at 1:47 PM, Notify Me <notify.sina@gmail.com> wrote:
The delay is very short, they send a100 Trying and then a 480 temporarily Unavailable back, as I can see in tcpdump. After they send the fail and its acknowledged, they end it and send an SMS back. This is a full dump
12:41:27.169928 IP (tos 0x0, ttl 64, id 34092, offset 0, flags [none], proto UDP (17), length 1146) 10.22.0.252.5080 > othersipgw.ip.address.5060: SIP, length: 1118 INVITE sip:sina.nowahala@sip.othersipgw.com;+234diallednumber SIP/2.0 Via: SIP/2.0/UDP my.public.ip.address:5080;rport;branch=z9hG4bK2S6KjD1jXFj1Q Max-Forwards: 5 From: "234diallednumber" <sip:+234diallednumber@my.public.ip.address>;tag=04tDF6pXQU4Ng To: <sip:sina.nowahala@sip.othersipgw.com;+234diallednumber> Call-ID: d1ef2fdb-f8a8-1232-80a6-525400ecad09 CSeq: 68640179 INVITE Contact: <sip:mod_sofia@my.public.ip.address:5080> User-Agent: FreeSWITCH-mod_sofia/1.5.15b+git~20141120T035109Z~79de78a0fb~64bit Allow: INVITE, ACK, BYE, CANCEL, OPTIONS, MESSAGE, INFO, UPDATE, REGISTER, REFER, NOTIFY Supported: timer, path, replaces Allow-Events: talk, hold, conference, refer Content-Type: application/sdp Content-Disposition: session Content-Length: 247 X-FS-Support: update_display,send_info Remote-Party-ID: "234diallednumber" <sip:+234diallednumber@my.public.ip.address
;party=calling;screen=yes;privacy=off
v=0 o=FreeSWITCH 1417930197 1417930198 IN IP4 my.public.ip.address s=FreeSWITCH c=IN IP4 my.public.ip.address t=0 0 m=audio 22290 RTP/AVP 8 0 101 13 a=rtpmap:8 PCMA/8000 a=rtpmap:0 PCMU/8000 a=rtpmap:101 telephone-event/8000 a=fmtp:101 0-16 a=ptime:20
12:41:27.385419 IP (tos 0x0, ttl 53, id 5736, offset 0, flags [none], proto UDP (17), length 384) othersipgw.ip.address.5060 > 10.22.0.252.5080: SIP, length: 356 SIP/2.0 100 Trying Via: SIP/2.0/UDP my.public.ip.address:5080;rport=5080;branch=z9hG4bK2S6KjD1jXFj1Q From: "234diallednumber" <sip:+234diallednumber@my.public.ip.address>;tag=04tDF6pXQU4Ng To: <sip:sina.nowahala@sip.othersipgw.com;+234diallednumber> Call-ID: d1ef2fdb-f8a8-1232-80a6-525400ecad09 CSeq: 68640179 INVITE User-Agent: FreeSWITCH-mod_sofia/1.2.14 Content-Length: 0
12:41:27.424422 IP (tos 0x0, ttl 53, id 5737, offset 0, flags [none], proto UDP (17), length 1015) othersipgw.ip.address.5060 > 10.22.0.252.5080: SIP, length: 987 SIP/2.0 480 Temporarily Unavailable Via: SIP/2.0/UDP my.public.ip.address:5080;rport=5080;branch=z9hG4bK2S6KjD1jXFj1Q Max-Forwards: 4 From: "234diallednumber" <sip:+234diallednumber@my.public.ip.address>;tag=04tDF6pXQU4Ng To: <sip:sina.nowahala@sip.othersipgw.com ;+234diallednumber>;tag=8c8DZK1aK9mKN Call-ID: d1ef2fdb-f8a8-1232-80a6-525400ecad09 CSeq: 68640179 INVITE User-Agent: FreeSWITCH-mod_sofia/1.2.14 Accept: application/sdp Allow: INVITE, ACK, BYE, CANCEL, OPTIONS, MESSAGE, INFO, UPDATE, REGISTER, REFER, NOTIFY, PUBLISH, SUBSCRIBE Supported: timer, precondition, path, replaces Allow-Events: talk, hold, conference, presence, dialog, line-seize, call-info, sla, include-session-description, presence.winfo, message-summary, refer Reason: Q.850;cause=16;text="NORMAL_CLEARING" Content-Length: 0 X-FS-Display-Name: sina.nowahala X-FS-Display-Number: sip:sina.nowahala@sip.othersipgw.com Remote-Party-ID: "sina.nowahala" <sip:sina.nowahala@sip.othersipgw.com>;party=calling;privacy=off;screen=no
12:41:27.424789 IP (tos 0x0, ttl 64, id 34093, offset 0, flags [none], proto UDP (17), length 412) 10.22.0.252.5080 > othersipgw.ip.address.5060: SIP, length: 384 ACK sip:sina.nowahala@sip.othersipgw.com;+234diallednumber SIP/2.0 Via: SIP/2.0/UDP my.public.ip.address:5080;rport;branch=z9hG4bK2S6KjD1jXFj1Q Max-Forwards: 5 From: "234diallednumber" <sip:+234diallednumber@my.public.ip.address>;tag=04tDF6pXQU4Ng To: <sip:sina.nowahala@sip.othersipgw.com ;+234diallednumber>;tag=8c8DZK1aK9mKN Call-ID: d1ef2fdb-f8a8-1232-80a6-525400ecad09 CSeq: 68640179 ACK Content-Length: 0
So you recommend a transfer on fail wav to be played? I have been tearing my hair out trying to play sounds before the call is transferred to them, so that the dialler hears something.
On Sun, Dec 7, 2014 at 4:44 AM, Avi Marcus <avi@avimarcus.net> wrote:
How long is the delay? I assume they return a normal_clearing or fail 4XX? If the delay is short and they have a "real" status return, then.. for success, you can just queue a "success.wav" to play after. And for fails, you can use https://wiki.freeswitch.org/wiki/Variable_transfer_on_fail and transfer to an extension that plays an error message.
This SMS sending sounds like a normal API call.. which if it was, could be done with curl or inside a lua/js script.
-Avi
On Fri, Dec 5, 2014 at 6:47 PM, Notify Me <notify.sina@gmail.com> wrote:
Hi Avi!
Thanks for the reply, I did figure it out, thanks! This is what I did,
<include> <extension name="firstsipgw-inbound"> <condition field="destination_number" expression="^0123450(\d{2})$"/> <condition field="caller_id_number" expression="^0(\d{10})$" require-nested="true"> <action application="set"
data="effective_caller_id_number=+234$1"/>
<action application="set" data="caller_id_number=+234${effective_caller_id_number}"/> <action application="set" data="transfer_ringback=$${us-ring}"/> <action application="set" data="transfer_ringback=file_string://$${hold_music}"/> <action application="set" data="transfer_ringback=local_stream://connecting"/> <action application="bridge"
data="sofia/external/sip:user.name@sip.othersipgw.com
;${effective_caller_id_number}"/>
</condition> </extension> </include>
I can see from the logs that dials the othersipgw.com URI, and I can see tcpdumps that corresponds to the traffic being sent, and the other side gets it. The other side immediately drops the call and does some processing that returns an SMS to the dialler.
I dont know if I can trouble you for more help.. there is no ringing when the transaction happens, and the dialler is unsure what is happening, if the call actually connected. As you might have guessed from the above I am trying to make it ring for a few seconds before the call drops. Is this possible? I would like for the dialler to be able to hear it ring a few times before the call is cut.
Any help gratefully accepted.
On Tue, Dec 2, 2014 at 2:22 PM, Avi Marcus <avi@avimarcus.net> wrote:
Hi - did you figure this out yet?
One comment: <action application="bridge" data="sofia/gateway/othersipgw/+234$1"/> -- I don't know if $1 is available anymore. You might want to just set that as part of the actual number to route, e.g. add a 1212 prefix and match it again or set it as a channel variable. You can see in the logs if the $1 is resolving correctly.
-Avi
Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
Official FreeSWITCH Sites http://www.freeswitch.org http://confluence.freeswitch.org http://www.cluecon.com
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
participants (2)
-
Avi Marcus
-
Notify Me