[Asterisk-Users] Setting channel display in SIP
Eric Wieling aka ManxPower
eric at fnords.org
Fri Jan 14 12:42:34 MST 2005
Howard Lowndes wrote:
> I have actually got a bit more cunning that this by using sipgetheader()
> and sipaddheader().
>
> The default user name is "asterisk", hard coded in chan_sip.c, so what I
> did was to use sipgetheader() to get the From: header, then I cut() it
> at the ":" character and the "@" character and checked the string
> between these two characters. If the string was "asterisk" then I did
> sipaddheader(From: ${PIECE_BEFORE}:replacement-string@${PIECE_AFTER}).
>
> OK, so it adds a second From: header, but as it gets added after the
> original it doesn't seem to matter because it works and
> "replacement-string" is what gets displayed on the phone, which is what
> I want. I also don't see that the tag= in the header makes any
> difference either.
>
> Can anyone see any probs I am likely to encounter using this?
Well if you like killing a fly with a with a tactical nuke, then no
there's nothing wrong with how you are doing it. The rest of us just
use the Caller*ID functions of Asterisk to accomplish it.
More information about the asterisk-users
mailing list