planetWayne.com - Forums
Rants and Raves and Generally Anything
Asterisk SIP call forward

 
Post new topic   Reply to topic    planetWayne.com - Forums Forum Index -> VoIP
View previous topic :: View next topic  
Author Message
vyom
planetFreshman


Joined: 15 Mar 2005
Posts: 4

PostPosted: Wed Mar 16, 2005 5:26 am    Post subject: Asterisk SIP call forward Reply with quote

Hi,

I read the information in
http://slacker.com/~nugget/asterisk7.php and this forum
to make a SIP call with the @IP attached using ${SIPDOMAIN}

But, this is a direct call from Asterisk to the other-end.
I want to forward the call to a proxy (SER), retaining the @IP part.

Does anyone know how to do this?
Back to top
View user's profile Send private message
planetWayne
Site Admin


Joined: 30 Jan 2003
Posts: 280

PostPosted: Wed Mar 16, 2005 10:22 pm    Post subject: Reply with quote

Hiya,
If I'm reading you right - you want to dial a number on your sip phone - that gets picked up by * as being external to your system - so the call then gets bounced out to the remote end without keeping * in the call Question

If I'm right - theres a 'canreinvite' command you can include in your Sip.Conf. This is normaly in the context of each 'phone' you configure.

If you have it set as 'canreinvite=no' then this tells * to 'stay in the loop' between your phone and the remote end - doing any codec conversions etc.
The opposite of this, 'canreinvite=yes' will allow your phone to attempt to directly contact the other end when the call gets established. * takes part in the making of the call and then drops out of the loop, thereby your phone is directly connecting to the other end.
This function isnt realy a * feature but a feature of the SIP protocol itself (someone jump in if I'm wrong) so should be supported by anything that claims to be sip complient.

The only down side of this is you need a router that can cope with SIP transformations or is 'SIP Aware' - If not then you may end up loosing the voice from either end as each device cannot contact each other directly.

Hopefully I get what you mean.
Wayne.
Back to top
View user's profile Send private message Visit poster's website
vyom
planetFreshman


Joined: 15 Mar 2005
Posts: 4

PostPosted: Thu Mar 17, 2005 3:49 am    Post subject: Reply with quote

Hi Wayne,

What I wanted to do is: forward the call to a proxy rather than directly attempting to make the SIP call.

currently what is happening, when I make a call (using the fully qualified SIP address of the other end) is

[my phone] ---------> [*] --------------> [remote phone]

What I want is

[my phone] ---------> [*] -----> [proxy] --------------> [remote phone]

i.e, Asterisk should forward the call to a proxy (like SER from iptel.org).
since Asterisk is not a Proxy, I want all the outbound calls forwarded to the proxy, but still Asterisk *should* stay in the media path (that is achieved by using canreinvite=no)
Hope I made it clear now.
Back to top
View user's profile Send private message
planetWayne
Site Admin


Joined: 30 Jan 2003
Posts: 280

PostPosted: Mon Mar 21, 2005 9:14 pm    Post subject: Reply with quote

Hiya vyom,
I've been doing a bit of digging (and asking a very a knowladgeable person on this). The problem seems to be, as you found out, that * will want to make the call to the end device directly. There seems no easy way to get * to send the call via a proxy, although from a networking point of view you need a SIP aware router to handle NAT correctly. I dont know if SER will do this.

One idea that did come up in discussion was
Quote:
Macro(uridial,${EXTEN}@${SIPDOMAIN}.ser.hisdomain.com)
and setup a wildcard dns entry for *.ser.hisdomain.com then get SER to rewrite the uri (removing the .ser.hisdomain.com )

I did find THIS on the Asterisk Wiki that seems to have a few tricks and tips for SER. Admittedly I dont know too much about the workings of SER itself... but if there are any SER experts that want to jump in here Smile

Any clearer?

Thanks
Wayne.
Back to top
View user's profile Send private message Visit poster's website
vyom
planetFreshman


Joined: 15 Mar 2005
Posts: 4

PostPosted: Tue Mar 22, 2005 12:47 pm    Post subject: Reply with quote

Thanks a lot Smile
But, setting up DNS records seems complex, I was thinking of something simple like storing the value of ${SIPDOMAIN} in an environment variable and SER can fetch it, if the call is from Asterisk (since, in my case - both run on the same machine).
AFAIK, there is no way to create environment variables from Asterisk, but can be fetched! Sad
Back to top
View user's profile Send private message
ScaredyCat
planetFreshman


Joined: 23 Mar 2005
Posts: 4

PostPosted: Wed Mar 23, 2005 7:20 pm    Post subject: Reply with quote

Use the dialplan command: system and the linux command export to create the environment variable.

One thing to bear in mind is if you try to make 2 calls at the same time the variable would be overwritten...

SC
Back to top
View user's profile Send private message
vyom
planetFreshman


Joined: 15 Mar 2005
Posts: 4

PostPosted: Tue Mar 29, 2005 1:13 pm    Post subject: Reply with quote

Hey,

I didnt think of this method to pass evironment vars - great Smile
Also, the method of using a delimiter like '#' , as suggested in the following post:
http://www.planetwayne.com/forums/viewtopic.php?t=196&sid=99331e62509e7f235d6f12601d8ec8ca
also works.
i.e in the Asterisk, use a command like

${EXTEN}#${SIPDOMAIN}@sipproxy

Using the ability of SER to run external scripts, we can use shell script to get back the URI.

Thank you both Smile
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    planetWayne.com - Forums Forum Index -> VoIP All times are GMT
Page 1 of 1

 
Jump to:  
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