VoIP Mailing List Archives
Mailing list archives for the VoIP community |
|
View previous topic :: View next topic |
Author |
Message |
b_ball_henry at hotmai... Guest
|
Posted: Sat Aug 22, 2009 1:48 am Post subject: [Freeswitch-users] can't pass full sip url to dialplan |
|
|
Hi:
I try to dial sip url from my softphone but seems like the sip address is being processed by sofia before it pass to the dialplan. The example here is :
X-lite(softphone) dials -> 1009@4.2.2.2 (1009@4.2.2.2) (it's fake sip address, the purpose was just to test what's being passed to dialplan) sofia receives the invite and return with trying sofia pass the destination number to dailplan with "1009" (without the "sip:" in front and without the "@4.2.2.2" after it)
Please see pastebin for full log. http://pastebin.freeswitch.org/10089
ignore anything after line 80, because it's not my point, and the destination is a fake address.
I would like to know how do you actually pass a full sip url to the dialplan to do the regex match. Because from the default.xml dialplan, it comes with an example sip url dialing extension that match's ^sip:(.*)$ . So I assume there must be a way of passing full sip url to the dialplan. Here is the example dialplan expecting sofia to pass it a full sip url:
 <!-- dial via SIP uri -->   <extension name="sip_uri">      <condition field="destination_number" expression="^sip:(.*)$">       <action application="bridge" data="sofia/${use_profile}/$1"/>      </condition>   </extension>
Thanks
--
Henry Huang |
|
Back to top |
|
|
mike at jerris.com Guest
|
Posted: Sat Aug 22, 2009 3:40 am Post subject: [Freeswitch-users] can't pass full sip url to dialplan |
|
|
No, you don't get the full sip uri in the dialplan like that. You do have a whole bunch of variables of the parsed sip header you can use. Use the "info" application to see all the vars so you can see what you have to route the call on.
Mike
On Aug 22, 2009, at 2:40 AM, Henry Huang wrote:
Quote: | Hi:
I try to dial sip url from my softphone but seems like the sip address is being processed by sofia before it pass to the dialplan. The example here is :
X-lite(softphone) dials -> 1009@4.2.2.2 (1009@4.2.2.2) (it's fake sip address, the purpose was just to test what's being passed to dialplan) sofia receives the invite and return with trying sofia pass the destination number to dailplan with "1009" (without the "sip:" in front and without the "@4.2.2.2" after it)
Please see pastebin for full log. http://pastebin.freeswitch.org/10089
ignore anything after line 80, because it's not my point, and the destination is a fake address.
I would like to know how do you actually pass a full sip url to the dialplan to do the regex match. Because from the default.xml dialplan, it comes with an example sip url dialing extension that match's ^[url=sip:(.*)$]sip:(.*)$[/url] . So I assume there must be a way of passing full sip url to the dialplan. Here is the example dialplan expecting sofia to pass it a full sip url:
<!-- dial via SIP uri --> <extension name="sip_uri"> <condition field="destination_number" expression="^[url=sip:(.*)$]sip:(.*)$[/url]"> <action application="bridge" data="sofia/${use_profile}/$1"/> </condition> </extension>
|
|
|
Back to top |
|
|
red.rain.seven at gmai... Guest
|
Posted: Sat Aug 22, 2009 3:44 am Post subject: [Freeswitch-users] can't pass full sip url to dialplan |
|
|
It that case, the example of dialing sip_uri in the dialplan/default.xml should be removed to prevent confusion. Because according to what you said, one can never be able to hit this extension:
<!-- dial via SIP uri --> Â Â Â <extension name="sip_uri"> Â Â Â Â Â <condition field="destination_number" expression="^sip:(.*)$">Â Â Â Â Â Â Â <action application="bridge" data="sofia/${use_profile}/$1"/> Â Â Â Â Â </condition>Â Â Â </extension>
And thanks for the tip, I will use variable instead.
On Sat, Aug 22, 2009 at 4:35 PM, Michael Jerris <mike@jerris.com (mike@jerris.com)> wrote:
Quote: | No, you don't get the full sip uri in the dialplan like that. Â You do have a whole bunch of variables of the parsed sip header you can use. Â Use the "info" application to see all the vars so you can see what you have to route the call on.
Mike
On Aug 22, 2009, at 2:40 AM, Henry Huang wrote:
Quote: | Hi:
I try to dial sip url from my softphone but seems like the sip address is being processed by sofia before it pass to the dialplan. The example here is :
X-lite(softphone) dials -> 1009@4.2.2.2 (1009@4.2.2.2) (it's fake sip address, the purpose was just to test what's being passed to dialplan) sofia receives the invite and return with trying sofia pass the destination number to dailplan with "1009" (without the "sip:" in front and without the "@4.2.2.2" after it)
Please see pastebin for full log. http://pastebin.freeswitch.org/10089
ignore anything after line 80, because it's not my point, and the destination is a fake address.
I would like to know how do you actually pass a full sip url to the dialplan to do the regex match. Because from the default.xml dialplan, it comes with an example sip url dialing extension that match's ^sip:(.*)$ . So I assume there must be a way of passing full sip url to the dialplan. Here is the example dialplan expecting sofia to pass it a full sip url:
 <!-- dial via SIP uri -->   <extension name="sip_uri">      <condition field="destination_number" expression="^sip:(.*)$">       <action application="bridge" data="sofia/${use_profile}/$1"/>      </condition>   </extension>
|
_______________________________________________
FreeSWITCH-users mailing list
FreeSWITCH-users@lists.freeswitch.org (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
|
--
Henry Huang
UniC Solution - Communication Unified
VoIP & Open Source software Consultant |
|
Back to top |
|
|
jason at jasonjgw.net Guest
|
Posted: Sat Aug 22, 2009 5:40 am Post subject: [Freeswitch-users] can't pass full sip url to dialplan |
|
|
Henry Huang <red.rain.seven@gmail.com> wrote:
Quote: | It that case, the example of dialing sip_uri in the dialplan/default.xml
should be removed to prevent confusion. Because according to what you said,
one can never be able to hit this extension:
|
It is entirely possible to reach this extension, but notice that the "sip:"
prefix is removed before the rest of the URI is used in calling the bridge
application.
If you don't understand why this dial-plan entry works, go back and read about
regular expressions and the format of destinations used with the bridge
application. There are examples and explanations on the wiki.
_______________________________________________
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 |
|
|
red.rain.seven at gmai... Guest
|
Posted: Sat Aug 22, 2009 9:19 am Post subject: [Freeswitch-users] can't pass full sip url to dialplan |
|
|
Jason:
I fully understand how the regex works in the dialplan. If you look closely in my original email and check out the pastebin. You will see that sofia does not pass the "sip:" to dialplan. I can do any combination of letters that dials from my softphone, and it will pass them to the dialplan. but if I put "sip:" in the front of my dial string. The "sip:" gets trunkated by sofia module so does the "@xx.xx.xx.xx" gets trunkated before it reaches dialplan to for regex matching. Therefore I say you can never reach the example sip uri extension because sofia will trunkate "sip:" .
Here is the excert from pastebin:
3.  INVITE sip:1009@4.2.2.2 SIP/2.0
(line 3 , the freeswitch has successfuly received my dialying to sip: 1009@4.2.2.2 (1009@4.2.2.2)) 73. 2009-08-20 16:37:28.982772 [INFO] mod_dialplan_xml.c:315 Processing 1001->1009 in context Global
74. Dialplan: sofia/trunkgroup_1/1001@192.168.1.67 parsing [Global->number_1] continue=false
75. Dialplan: sofia/trunkgroup_1/1001@192.168.1.67 Regex (FAIL) [number_1] destination_number(1009) =~ /^sip(.*)$/ break=on-false
(line 73~75, you can see that on line 73, sofia has trunkated the "sip: " & "@4.2.2.2" and only leave "1009" as the destination to pass to dialplan for regex match.)
On Sat, Aug 22, 2009 at 6:30 PM, Jason White <jason@jasonjgw.net (jason@jasonjgw.net)> wrote:
--
Henry Huang
UniC Solution - Communication Unified
VoIP & Open Source software Consultant |
|
Back to top |
|
|
mike at jerris.com Guest
|
Posted: Sat Aug 22, 2009 9:30 am Post subject: [Freeswitch-users] can't pass full sip url to dialplan |
|
|
a call coming from sofia would never hit that in the dialplan. That extension is useful for dialing a sip url from mod_portaudio.
Mike
On Aug 22, 2009, at 10:09 AM, Henry Huang wrote:
Quote: | Jason:
I fully understand how the regex works in the dialplan. If you look closely in my original email and check out the pastebin. You will see that sofia does not pass the "sip:" to dialplan. I can do any combination of letters that dials from my softphone, and it will pass them to the dialplan. but if I put "sip:" in the front of my dial string. The "sip:" gets trunkated by sofia module so does the "@xx.xx.xx.xx" gets trunkated before it reaches dialplan to for regex matching. Therefore I say you can never reach the example sip uri extension because sofia will trunkate "sip:" .
Here is the excert from pastebin:
3. INVITE sip:1009@4.2.2.2 SIP/2.0
(line 3 , the freeswitch has successfuly received my dialying to sip: 1009@4.2.2.2 (1009@4.2.2.2)) 73. 2009-08-20 16:37:28.982772 [INFO] mod_dialplan_xml.c:315 Processing 1001->1009 in context Global
74. Dialplan: sofia/trunkgroup_1/1001@192.168.1.67 parsing [Global->number_1] continue=false
75. Dialplan: sofia/trunkgroup_1/1001@192.168.1.67 Regex (FAIL) [number_1] destination_number(1009) =~ /^sip(.*)$/ break=on-false
(line 73~75, you can see that on line 73, sofia has trunkated the "sip: " & "@4.2.2.2" and only leave "1009" as the destination to pass to dialplan for regex match.)
On Sat, Aug 22, 2009 at 6:30 PM, Jason White <jason@jasonjgw.net (jason@jasonjgw.net)> wrote:
--
Henry Huang
UniC Solution - Communication Unified
VoIP & Open Source software Consultant
_______________________________________________
FreeSWITCH-users mailing list
FreeSWITCH-users@lists.freeswitch.org (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
|
Posted: Sat Aug 22, 2009 9:34 am Post subject: [Freeswitch-users] can't pass full sip url to dialplan |
|
|
Remember the dialplan is agnostic... it has no clue about SIP, IAX,
Jingle, H323... it routes... you have various other variables you can
condition on also... route on destination_number and you'll be fine.
/b
On Aug 22, 2009, at 9:09 AM, Henry Huang wrote:
Quote: | I fully understand how the regex works in the dialplan. If you look
closely in my original email and check out the pastebin. You will
see that sofia does not pass the "sip:" to dialplan. I can do any
combination of letters that dials from my softphone, and it will
pass them to the dialplan. but if I put "sip:" in the front of my
dial string. The "sip:" gets trunkated by sofia module so does the
"@xx.xx.xx.xx" gets trunkated before it reaches dialplan to for
regex matching. Therefore I say you can never reach the example sip
uri extension because sofia will trunkate "sip:" .
|
_______________________________________________
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 |
|
|
red.rain.seven at gmai... Guest
|
Posted: Sat Aug 22, 2009 9:51 am Post subject: [Freeswitch-users] can't pass full sip url to dialplan |
|
|
Brian:
but why can't I pass "sip:" to dialplan? seems like it's being truncated by sofia..
Can you confirm that?
On Sat, Aug 22, 2009 at 10:30 PM, Brian West <brian@freeswitch.org (brian@freeswitch.org)> wrote:
Quote: | Remember the dialplan is agnostic... it has no clue about SIP, IAX,
Jingle, H323... it routes... you have various other variables you can
condition on also... route on destination_number and you'll be fine.
/b
On Aug 22, 2009, at 9:09 AM, Henry Huang wrote:
Quote: | I fully understand how the regex works in the dialplan. If you look
closely in my original email and check out the pastebin. You will
see that sofia does not pass the "sip:" to dialplan. I can do any
combination of letters that dials from my softphone, and it will
pass them to the dialplan. but if I put "sip:" in the front of my
dial string. The "sip:" gets trunkated by sofia module so does the
"@xx.xx.xx.xx" gets trunkated before it reaches dialplan to for
regex matching. Therefore I say you can never reach the example sip
uri extension because sofia will trunkate "sip:" .
|
_______________________________________________
FreeSWITCH-users mailing list
FreeSWITCH-users@lists.freeswitch.org (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
|
--
Henry Huang
UniC Solution - Communication Unified
VoIP & Open Source software Consultant |
|
Back to top |
|
|
brian at freeswitch.org Guest
|
Posted: Sat Aug 22, 2009 10:04 am Post subject: [Freeswitch-users] can't pass full sip url to dialplan |
|
|
Because the dial plan is technology agnostic... you have been told
more than once it won't pass it to the dialplan from mod_sofia...
/b
On Aug 22, 2009, at 9:46 AM, Henry Huang wrote:
Quote: | Brian:
but why can't I pass "sip:" to dialplan? seems like it's being
truncated by sofia..
Can you confirm that?
|
_______________________________________________
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 |
|
|
red.rain.seven at gmai... Guest
|
Posted: Sat Aug 22, 2009 10:05 am Post subject: [Freeswitch-users] can't pass full sip url to dialplan |
|
|
Brian:
Sorry, it's my English. I didn't understand what you meant by "agnostic" back there. Now I know.
Thank you.
On Sat, Aug 22, 2009 at 10:59 PM, Brian West <brian@freeswitch.org (brian@freeswitch.org)> wrote:
--
Henry Huang
UniC Solution - Communication Unified
VoIP & Open Source software Consultant |
|
Back to top |
|
|
red.rain.seven at gmai... Guest
|
Posted: Sat Aug 22, 2009 10:11 am Post subject: [Freeswitch-users] can't pass full sip url to dialplan |
|
|
Brian:
Oh, and again, if it's not passing it to the dialplan. I had suggested to remove the sample "sip uri" extension in the default.xml dialplan. because no one can reach the dialplan with prefix "sip:" because sofia is going to remove that prefix.
<!-- dial via SIP uri --> Â Â Â <extension name="sip_uri"> Â Â Â Â Â <condition field="destination_number" expression="^sip:(.*)$">Â Â Â Â Â Â Â <action application="bridge" data="sofia/${use_profile}/$1"/> Â Â Â Â Â </condition>Â Â Â </extension>
On Sat, Aug 22, 2009 at 10:59 PM, Brian West <brian@freeswitch.org (brian@freeswitch.org)> wrote:
--
Henry Huang
UniC Solution - Communication Unified
VoIP & Open Source software Consultant |
|
Back to top |
|
|
brian at freeswitch.org Guest
|
Posted: Sat Aug 22, 2009 10:24 am Post subject: [Freeswitch-users] can't pass full sip url to dialplan |
|
|
You were told already this was used by mod_portaudio. So that you can pa call [url=sip:blah@domain.com]sip:blah@domain.com[/url] which portaudio passes the exact string you dial with pa call to the dialplan.
/b
On Aug 22, 2009, at 10:07 AM, Henry Huang wrote:
Quote: | Brian:
Oh, and again, if it's not passing it to the dialplan. I had suggested to remove the sample "sip uri" extension in the default.xml dialplan. because no one can reach the dialplan with prefix "sip:" because sofia is going to remove that prefix.
<!-- dial via SIP uri --> <extension name="sip_uri"> <condition field="destination_number" expression="^[url=sip:(.*)$]sip:(.*)$[/url]"> <action application="bridge" data="sofia/${use_profile}/$1"/> </condition> </extension> |
|
|
Back to top |
|
|
msc at freeswitch.org Guest
|
Posted: Sat Aug 22, 2009 10:39 am Post subject: [Freeswitch-users] can't pass full sip url to dialplan |
|
|
On Sat, Aug 22, 2009 at 8:07 AM, Henry Huang <red.rain.seven@gmail.com (red.rain.seven@gmail.com)> wrote:
Quote: | Brian:
Oh, and again, if it's not passing it to the dialplan. I had suggested to remove the sample "sip uri" extension in the default.xml dialplan. because no one can reach the dialplan with prefix "sip:" because sofia is going to remove that prefix. |
Well, this isn't entirely accurate. Like Mike J said, if you dialed something like this at the CLI:
pa call sip:user@domain.com ([email]sip%3Auser@domain.com[/email])
Then you'd need the dialplan entry that handles the SIP URI.
Going back to the original question...
X-Lite dials 1009@4.2.2.2 (1009@4.2.2.2) correct?
But you're saying that the dialplan simply sees "1009" as the destination number? I'm looking at the pastebin (10089) and trying to figure out exactly what is happening. All I can see is that you have a context named "Global" so I'm assuming you've made at least some modifications to the default dialplan. Can you pastebin that whole context?
The other thing that you should probably do is create an extension in this global context that routes a call to the info application. You could do something like this so that "9992" would do an info dump:
<extension name="info">
<condition field="destination_number" expression="^(9992)$">
<action application="info"/>
</condition>
</extension>
Then reloadxml and make a call to 9992 from your X-Lite client. The CLI will have a dump and you'll see all sorts of variables listed. Many of those are available for you to use for condition matches and routing in the dialplan.
Let us know how the info application does in giving you information about the A leg of the call.
-MC
|
|
Back to top |
|
|
red.rain.seven at gmai... Guest
|
Posted: Sat Aug 22, 2009 12:41 pm Post subject: [Freeswitch-users] can't pass full sip url to dialplan |
|
|
Michael:
Thank you for making it in "for dummies" format.
These are really nice tips I can use. thanks.
On Sat, Aug 22, 2009 at 11:35 PM, Michael Collins <msc@freeswitch.org (msc@freeswitch.org)> wrote:
Quote: |
On Sat, Aug 22, 2009 at 8:07 AM, Henry Huang <red.rain.seven@gmail.com (red.rain.seven@gmail.com)> wrote:
Quote: | Brian:
Oh, and again, if it's not passing it to the dialplan. I had suggested to remove the sample "sip uri" extension in the default.xml dialplan. because no one can reach the dialplan with prefix "sip:" because sofia is going to remove that prefix. |
Well, this isn't entirely accurate. Like Mike J said, if you dialed something like this at the CLI:
pa call sip:user@domain.com ([email]sip%3Auser@domain.com[/email])
Then you'd need the dialplan entry that handles the SIP URI.
Going back to the original question...
X-Lite dials 1009@4.2.2.2 (1009@4.2.2.2) correct?
But you're saying that the dialplan simply sees "1009" as the destination number? I'm looking at the pastebin (10089) and trying to figure out exactly what is happening. All I can see is that you have a context named "Global" so I'm assuming you've made at least some modifications to the default dialplan. Can you pastebin that whole context?
The other thing that you should probably do is create an extension in this global context that routes a call to the info application. You could do something like this so that "9992" would do an info dump:
<extension name="info">
 <condition field="destination_number" expression="^(9992)$">
   <action application="info"/>
 </condition>
</extension>
Then reloadxml and make a call to 9992 from your X-Lite client. The CLI will have a dump and you'll see all sorts of variables listed. Many of those are available for you to use for condition matches and routing in the dialplan.
Let us know how the info application does in giving you information about the A leg of the call.
-MC
_______________________________________________
FreeSWITCH-users mailing list
FreeSWITCH-users@lists.freeswitch.org (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
|
--
Henry Huang
UniC Solution - Communication Unified
VoIP & Open Source software Consultant |
|
Back to top |
|
|
kevin at johnnyvoip.com Guest
|
Posted: Sat Aug 22, 2009 6:32 pm Post subject: [Freeswitch-users] can't pass full sip url to dialplan |
|
|
X-lite I believe handles the sip: by itself sometime and therefore will try and place a call to the sip address directly from x-lite without touching FreeSWITCH. Be aware of this while testing and watch for this behavior because it might throw off your expectations.
Regards,
Kevin Green
On Sat, Aug 22, 2009 at 1:35 PM, Henry Huang <red.rain.seven@gmail.com (red.rain.seven@gmail.com)> wrote:
Quote: | Michael:
Thank you for making it in "for dummies" format.
These are really nice tips I can use. thanks.
On Sat, Aug 22, 2009 at 11:35 PM, Michael Collins <msc@freeswitch.org (msc@freeswitch.org)> wrote:
Quote: |
On Sat, Aug 22, 2009 at 8:07 AM, Henry Huang <red.rain.seven@gmail.com (red.rain.seven@gmail.com)> wrote:
Quote: | Brian:
Oh, and again, if it's not passing it to the dialplan. I had suggested to remove the sample "sip uri" extension in the default.xml dialplan. because no one can reach the dialplan with prefix "sip:" because sofia is going to remove that prefix. |
Well, this isn't entirely accurate. Like Mike J said, if you dialed something like this at the CLI:
pa call sip:user@domain.com ([email]sip%3Auser@domain.com[/email])
Then you'd need the dialplan entry that handles the SIP URI.
Going back to the original question...
X-Lite dials 1009@4.2.2.2 (1009@4.2.2.2) correct?
But you're saying that the dialplan simply sees "1009" as the destination number? I'm looking at the pastebin (10089) and trying to figure out exactly what is happening. All I can see is that you have a context named "Global" so I'm assuming you've made at least some modifications to the default dialplan. Can you pastebin that whole context?
The other thing that you should probably do is create an extension in this global context that routes a call to the info application. You could do something like this so that "9992" would do an info dump:
<extension name="info">
<condition field="destination_number" expression="^(9992)$">
<action application="info"/>
</condition>
</extension>
Then reloadxml and make a call to 9992 from your X-Lite client. The CLI will have a dump and you'll see all sorts of variables listed. Many of those are available for you to use for condition matches and routing in the dialplan.
Let us know how the info application does in giving you information about the A leg of the call.
-MC
_______________________________________________
FreeSWITCH-users mailing list
FreeSWITCH-users@lists.freeswitch.org (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
|
--
Henry Huang
UniC Solution - Communication Unified
VoIP & Open Source software Consultant
_______________________________________________
FreeSWITCH-users mailing list
FreeSWITCH-users@lists.freeswitch.org (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 |
|
|
|
|
|
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
|