[asterisk-commits] oej: branch oej/codename-pineapple r45211 -
/team/oej/codename-pineapple/chan...
asterisk-commits at lists.digium.com
asterisk-commits at lists.digium.com
Mon Oct 16 06:23:35 MST 2006
Author: oej
Date: Mon Oct 16 08:23:34 2006
New Revision: 45211
URL: http://svn.digium.com/view/asterisk?rev=45211&view=rev
Log:
Rizzo's code to calculate channel name.
Modified:
team/oej/codename-pineapple/channels/chan_sip3.c
Modified: team/oej/codename-pineapple/channels/chan_sip3.c
URL: http://svn.digium.com/view/asterisk/team/oej/codename-pineapple/channels/chan_sip3.c?rev=45211&r1=45210&r2=45211&view=diff
==============================================================================
--- team/oej/codename-pineapple/channels/chan_sip3.c (original)
+++ team/oej/codename-pineapple/channels/chan_sip3.c Mon Oct 16 08:23:34 2006
@@ -2694,12 +2694,16 @@
}
- if (title)
- ast_string_field_build(tmp, name, "SIP/%s-%08x", title, (int)(long) i);
- else if (strchr(i->fromdomain,':'))
- ast_string_field_build(tmp, name, "SIP/%s-%08x", strchr(i->fromdomain,':') + 1, (int)(long) i);
- else
- ast_string_field_build(tmp, name, "SIP/%s-%08x", i->fromdomain, (int)(long) i);
+ {
+ const char *my_name; /* pick a good name */
+ if (title)
+ my_name = title;
+ else if ( (my_name = strchr(i->fromdomain,':')) )
+ my_name++; /* skip ':' */
+ else
+ my_name = i->fromdomain;
+ ast_string_field_build(tmp, name, "SIP/%s-%08x", my_name, (int)(long) i);
+ }
if (ast_test_flag(&i->flags[0], SIP_DTMF) == SIP_DTMF_INBAND) {
i->vad = ast_dsp_new();
More information about the asterisk-commits
mailing list