Thanks to all for the suggestions.  I've used the "PRINTF" version of Valdimir 
and others' suggestion...

SEQUENTIAL,PRINTF 9999
1212555%04d;1555212%0.4d

[Two entries, one for caller, one for callee]

...but there is an interesting gotcha to be aware of.

Suppose you have a shell script like this...

sipp ... ... .. -inf ~/config/important.csv -inf ~/config/telephones.csv ...

because you can have multiple input CSV files and you are using them.

Now you want to use something like...

INVITE sip:[field0 file="telephones.csv"]...

which is legal - EXCEPT that the filename in the "file=" MUST match PRECISELY 
that in the "-inf" command line parameter.  OK, so let's write...

INVITE sip:[field0 file="~/config/telephones.csv"]...

WRONG!  Because the shell script expanded the tilda to /home/pds so you need to 
write

INVITE sip:[field0 file="/home/pds/config/telephones.csv"]...

WRONG!  Because when my friend Bob runs the script, the tilda expands to 
/home/bpp!

Umm, so let's try this...

sipp ... ... .. -inf ~/config/important.csv -inf ~/config/telephones.csv -key 
phones ~/config/telephones.csv ...

INVITE sip:[field0 file="[$phones]"]...

Now the "phones" keyword is correctly expanded by the shell and the double 
keyword expansion on the INVIIE will create the correct entry.

WRONG!  SIPp doesn't like the attempted expansion - Sigh, are we getting 
frustrated yet or what?

Fortunately the following DOES work

<nop>
 <action>
  <assignstr assign_to="callee" file="[$phones]" value="[field0]" />
 </action>
</nop>

...

INVITE sip:[$callee]...

So eventually it worked!  Hope this helps someone avoid having to wade through 
this in future, and thanks for the pointers everyone.

Regards,
Paul D Smith




-----Original Message-----
From: Vladimir Broz [mailto:vladik...@centrum.cz] 
Sent: 28 June 2010 08:01
To: sipp-users@lists.sourceforge.net
Cc: Paul D.Smith
Subject: Re: [Sipp-users] Formatting telephone numbers?

Hi,

I do it using an external file from which the number is injected.

users.csv
SEQUENTIAL (or RANDOM)
12125550001
12125550002
.....

and then use "-inf users.csv" and in xml config INVITE 
sip:[fiel...@[remote_ip]:.......

Regards,
-Vladimir B.


On 06/23/2010 02:05 PM, Paul D.Smith wrote:
> It is possible to have counters in SIPp and use these to "create"
> callers, callee etc, for example:
>
> INVITE sip:[call_numb...@[remote_ip]:[remote_port] SIP/2.0
>
> But how can I format these into something which actually looks like a
> telephone number, for example using [call_number] and some text to
> generate..
>
> 12125550001
>
> 12125550002
>
> ...
>
> 12125559999
>
> Rather than
>
> 1
>
> 2
>
> ...
>
> 9999
>
> Or
>
> 12125551
>
> 12125552
>
> ....
>
> 12125559999
>
> i.e. I want to effectively apply the 'C' %4.4d format to [call_number].
>
> Thanks,
>
> Paul DS.
>
>
>
> ------------------------------------------------------------------------------
> ThinkGeek and WIRED's GeekDad team up for the Ultimate
> GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the
> lucky parental unit.  See the prize list and enter to win:
> http://p.sf.net/sfu/thinkgeek-promo
>
>
>
> _______________________________________________
> Sipp-users mailing list
> Sipp-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/sipp-users

------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
_______________________________________________
Sipp-users mailing list
Sipp-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sipp-users

Reply via email to