[Asterisk-Dev] Evaluating trailing numbers in extensions.conf

Kevin P. Fleming kpfleming at starnetworks.us
Fri Mar 18 08:08:11 MST 2005


Harald Milz wrote:

> As it seems there is no official way to access the full SIP address -
> that we are sent in the To: header - with EXTEN, MACRO_EXTEN or anything
> else. There are only very few places within the source code where it is
> available, and this is where I added my CALLEDNUM patch.

Harald,

Sorry for the delay in responding, I've been quite busy.

This is a side-effect of having to REGiSTER with sipgate. When Asterisk 
(or any SIP UAC) sends a REGISTER to a SIP registrar, it provides a 
"contact address" for calls to be delivered back to it. When calls are 
delivered, they are sent to that exact address, every time.

When you don't add '/sip' to the end of the register => line in 
sip.conf, then Asterisk registers the 's' extension with sipgate, and 
that's why calls come in that way.

In other words, as long as you have to REGISTER with sipgate, Asterisk 
will always be told _by sipgate_ that the call is for the 's' extension 
(or whatever extension you put on the end of the register => line).

To get the behavior you are looking for, you need SIP 'trunking', but 
that doesn't work when one end has to register with the other.

Now, as a workaround, in CVS HEAD there is a SIPGetHeader() application, 
which would allow you to pull out the To: header in the dialplan and 
extract what you need out of it.



More information about the asterisk-dev mailing list