[Asterisk-Users] Caller-ID name delivered in double-quotes

David Sharp djs at secure.net
Sat Sep 13 22:32:57 MST 2003


they bothered me too so i made a little mod to remove them.  
here is a patch if you are interested.



Index: channels/chan_sip.c
===================================================================
RCS file: /usr/cvsroot/asterisk/channels/chan_sip.c,v
retrieving revision 1.178
diff -c -r1.178 chan_sip.c
*** channels/chan_sip.c 13 Sep 2003 20:26:20 -0000      1.178
--- channels/chan_sip.c 14 Sep 2003 05:54:35 -0000
***************
*** 2131,2136 ****
--- 2131,2147 ----
        return 0;
  }
  
+ void dequotestring(char *str) {
+   char *buf,*p,*q;
+ 
+   if (!str) return;
+   buf = strdup(str);
+   for(p=str,q=buf;*p;p++) if (*p != '\"') *q++ = *p;
+   *q = 0;
+   strcpy(str,buf);
+   free(buf);
+ }
+ 
  static int respprep(struct sip_request *resp, struct sip_pvt *p, char *msg, struct sip_request *req)
  {
        char newto[256] = "", *ot;
***************
*** 2686,2691 ****
--- 2697,2703 ----
        add_header(req, "Via", p->via);
        /* SLD: FIXME?: do Route: here too?  I think not cos this is the first request.
         * OTOH, then we won't have anything in p->route anyway */
+       dequotestring(from);
        add_header(req, "From", from);
        strncpy(p->exten, l, sizeof(p->exten) - 1);
        build_contact(p);



On 2003.09.13 22:03:25 +0000, Steve Haehnichen wrote:
> I did some searching in the archive, but found only one message with
> this same question and no answer.  Hopefully it's a simple config problem.
> 
> When the Caller-ID is delivered, it is surrounded by double-quotes,
> like this:
>  "ATA-57 1"
> 
> On long caller-id strings, the last character is cut off to make room
> for the leading double-quote:
>  "BudgeTone 1234 
> instead of
>  BudgeTone 12345
> 
> I'd like to omit the quotes, since the local telco doesn't quote the
> names, and it cuts off precious characters.
> 
> I'm defining the phones this way in sip.conf:
> 
> [200]
> callerid = ATA-57 1 <200>
> type = friend
> secret = xxxx
> host = dynamic
> defaultip = ata-57.my.com
> canreinvite = no                        ; Cisco poops on reinvite?
> 
> [201]
> callerid = ATA-57 2 <201>
> type = friend
> secret = xxxx
> host = dynamic
> defaultip = ata-57.my.com
> canreinvite = no
> 
> 
> It doesn't seem specific to the ATA-186.. the BudgeTone caller-id is
> also quoted.
> 
> How can I remove the double-quotes to make the Caller-ID more normal?
> 
> Thanks!
> -Steve
> _______________________________________________
> Asterisk-Users mailing list
> Asterisk-Users at lists.digium.com
> http://lists.digium.com/mailman/listinfo/asterisk-users
> 



More information about the asterisk-users mailing list