[Asterisk-Dev] adding SIPFROMUSER and SIPFROMDOMAIN variables / pbx_builtin_getvar_helper problem

Günther Starnberger gst at sysfrog.org
Wed Aug 10 11:58:49 MST 2005


hello,

currently asterisk does use asterisk at ip-address as username in the
'From' field when i route a call from a sip user who isn't a peer to
another sip destination.

as my users are registered on openser which routes all destinations to
asterisk (even sip-to-sip calls as workaround for bug #3710) i have no
possibility to add the users as peer on asterisk. (and even if this
would be possible i can't add 3rd party sip users).

my idea for a workaround is to add two variables: SIPFROMUSER and
SIPFROMDOMAIN which can be set before calling the dial app and which are
used by the sip channel as username and domain in the 'From' field.

i tried to add the code for this in the function 'initreqprep' in
'chan_sip.c'. it looks like:

char *tmp2 = (char *) NULL;
tmp2 = pbx_builtin_getvar_helper(p->owner, "SIPDOMAIN");
if (tmp2 && !ast_strlen_zero(tmp2)) {
    ast_copy_string(p->fromdomain, tmp2, sizeof(p->fromdomain));
}

the problem is that pbx_builtin_getvar_helper always just returns NULL.
any hints what could be wrong?

is 'initreqprep' the right place to add this hack? are there better
possibilites to achieve the same thing?

bye,
/gst

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : http://lists.digium.com/pipermail/asterisk-dev/attachments/20050810/d7963d6e/attachment.pgp


More information about the asterisk-dev mailing list